Agent Skills: nginx.org C Module Directive Design Best Practices

nginx C module directive design guidelines for creating admin-friendly configuration interfaces. This skill should be used when designing nginx module directives — deciding what to expose vs hardcode, naming conventions, scope placement, default values, variable design, and validation patterns. Triggers on tasks involving ngx_command_t design, directive naming, configuration API design, nginx module public interface, or directive deprecation.

UncategorizedID: pproenca/dot-skills/nginx-c-module-design

Install this agent skill to your local

pnpm dlx add-skill https://github.com/pproenca/dot-skills/tree/HEAD/skills/.experimental/nginx-c-module-design

Skill Files

Browse the full folder contents for nginx-c-module-design.

Download Skill

Loading file tree…

skills/.experimental/nginx-c-module-design/SKILL.md

Skill Metadata

Name
nginx-c-module-design
Description
nginx C module directive design guidelines for creating admin-friendly configuration interfaces. This skill should be used when designing nginx module directives — deciding what to expose vs hardcode, naming conventions, scope placement, default values, variable design, and validation patterns. Triggers on tasks involving ngx_command_t design, directive naming, configuration API design, nginx module public interface, or directive deprecation.

nginx.org C Module Directive Design Best Practices

Comprehensive directive design guide for nginx C module authors, focused on creating clear, consistent, and admin-friendly configuration interfaces. Contains 46 rules across 8 categories, prioritized by impact to guide decisions about what to expose, how to name it, and how to evolve it safely.

When to Apply

Reference these guidelines when:

  • Deciding which values to expose as directives vs hardcode
  • Naming new directives and choosing argument types
  • Selecting scope placement (http, server, location)
  • Setting default values and validation behavior
  • Designing nginx variables for runtime data
  • Deprecating or renaming existing directives

Companion Skills

This skill focuses on design decisions (the "what" and "why"). For implementation mechanics, see:

  • nginx-c-modules — C implementation: memory pools, request lifecycle, config parsing, handlers, filters
  • nginx-c-perf — Performance: buffers, connections, locks, caching, timeouts
  • nginx-c-debug — Debugging: crash diagnosis, GDB, tracing, sanitizers

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Exposure Decisions | CRITICAL | expose- | | 2 | Naming Conventions | CRITICAL | naming- | | 3 | Directive Types | HIGH | type- | | 4 | Scope Design | HIGH | scope- | | 5 | Default Values | MEDIUM-HIGH | default- | | 6 | Validation & Error Messages | MEDIUM | valid- | | 7 | Variable Design | MEDIUM | var- | | 8 | Evolution & Compatibility | LOW-MEDIUM | compat- |

Quick Reference

1. Exposure Decisions (CRITICAL)

2. Naming Conventions (CRITICAL)

3. Directive Types (HIGH)

4. Scope Design (HIGH)

5. Default Values (MEDIUM-HIGH)

6. Validation & Error Messages (MEDIUM)

7. Variable Design (MEDIUM)

8. Evolution & Compatibility (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

| File | Description | |------|-------------| | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |