coding-style

Enforce PostgreSQL C source code formatting and architectural conventions.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill coding-style-matejformanek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-style
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/coding-style
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill coding-style-matejformanek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates inconsistencies in PostgreSQL C source code by enforcing strict adherence to the project's house style, preventing pgindent churn and ensuring compliance with backend development conventions.

Core Features & Use Cases

  • Style Enforcement: Validates indentation, brace placement, include ordering, and C99 subset compliance.
  • Convention Guidance: Provides authoritative rules for memory management (palloc), error reporting (ereport), and naming conventions.
  • Use Case: When submitting a patch to the PostgreSQL backend, use this skill to verify that your code matches the surrounding style and that all new typedefs are correctly registered for pgindent.

Quick Start

Use the coding-style skill to audit the current file for compliance with PostgreSQL house style and pgindent requirements.

Frequently Asked Questions about coding-style

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

FAQPage Schema
How do I enforce PostgreSQL C source code formatting standards?

PostgreSQL C source code formatting is enforced by validating indentation, brace placement, include ordering, and C99 subset compliance to ensure consistency with existing backend idioms and pgindent requirements.

What conventions does PostgreSQL backend development use for memory management?

PostgreSQL backend development uses memory context management with palloc for memory allocation, alongside ereport for error reporting, requiring strict adherence to these established patterns for patch acceptance.

How do I verify my C code matches PostgreSQL house style before submitting a patch?

To verify C code matches PostgreSQL house style before submitting a patch, audit the current file for compliance with formatting rules, architectural conventions, and ensure all new typedefs are correctly registered for pgindent.

Does PostgreSQL C development require a specific C standard or subset?

PostgreSQL C development requires strict adherence to C99 subset rules, ensuring the codebase maintains consistent language feature usage and avoids non-compliant constructs during backend editing or patch review.

Why does pgindent churn happen and how can I prevent it?

pgindent churn happens when source code formatting does not match the project's house style; preventing it requires enforcing strict indentation, include ordering, and correct typedef registration before running pgindent.

Can I use this coding style enforcement for reviewing C files in the source tree?

Yes, this coding style enforcement applies to editing, adding, or reviewing C files within the PostgreSQL source tree to ensure all modifications align with existing architectural conventions and formatting standards.