coding-standard-c

Enforce C coding standards for file naming, header guards, and conventions.

27|7|Updated Dec 6, 2025
One-click install
npx skills add https://github.com/jdubray/puffin --skill coding-standard-c
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-standard-c
Source: https://github.com/jdubray/puffin/tree/main/.claude/skills/coding-standard-c
Command: npx skills add https://github.com/jdubray/puffin --skill coding-standard-c

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce consistent C coding standards to improve readability, maintainability, and reduce errors across C projects.

Core Features & Use Cases

  • File Naming: Source files use snake_case with a .c extension; header files use snake_case with a .h extension; names should be short but descriptive (max ~20 characters).
  • Header Guards: Guards follow UPPER_SNAKE_CASE with an _H suffix; include path in guard examples is PROJECT_MODULE_FILE_H.
  • Variable Naming: Local variables use snake_case; global variables use g_ prefix; static variables use s_ prefix; pointers include p or ptr suffix when helpful.
  • Constant/Macro Naming: Macros and enums use UPPER_SNAKE_CASE; compile-time constants use #define with UPPER_SNAKE_CASE.
  • Function Naming: Functions use snake_case with a module prefix; static functions use snake_case; init/cleanup or create/destroy patterns are recommended.
  • Type Naming: Structs can be snake_case with _t suffix or PascalCase; typedefs use _t suffix; enums use snake_case with _e suffix for the type.
  • Organization: Organize code with headers first, then macros, then types, prototypes, global/static vars, and implementations.
  • Use Case: Refactor legacy C code or write new modules that need consistent naming and structure across a project.

Quick Start

Apply these guidelines to a C module by renaming identifiers to snake_case and adding header guards.

Frequently Asked Questions about coding-standard-c

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the standard naming conventions for C source files and header guards?

C coding standards enforce snake_case for local variables, a g_ prefix for global variables, and an s_ prefix for static variables to improve code readability and maintainability.

How do I structure a C module to follow consistent coding standards?

Structure a C module by organizing code with headers first, then macros, types, prototypes, global/static variables, and finally implementations to enforce consistent coding standards.

What is the correct naming convention for functions and types in C?

Functions should use snake_case with a descriptive module prefix, while structs use a _t suffix and enums use a snake_case name with an _e suffix for the type definition.

Can I apply these C coding standards to refactor legacy code?

You can apply these C coding standards to legacy code by renaming identifiers to snake_case, adding UPPER_SNAKE_CASE header guards, and reorganizing the file structure to match the recommended layout.