mcpField
N
nginx-c-modules

nginx-c-modules

github.com/pproencaDevelopment218352 installsUpdated 11w ago
Repository

About nginx-c-modules

nginx-c-modules is a development guide for authors of nginx C modules. It organizes prioritized rules across eight areas, including memory, request lifecycle, configuration, and events, to help prevent common implementation errors.

Key features

  1. 01Rules across eight module-development categories
  2. 02Prioritized by impact
  3. 03Pool and shared-memory guidance
  4. 04Request lifecycle and configuration practices
  5. 05Filter, upstream, and event-loop guidance

Use cases

  1. 01Write nginx HTTP handlers or filters
  2. 02Manage request memory and shared-memory zones
  3. 03Implement configuration directives and merge logic
  4. 04Handle asynchronous requests and the event loop

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill nginx-c-modules

After installing, type/nginx-c-modulesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
conf-build-config.md
conf-context-flags.md
conf-custom-handler.md
conf-merge-all-fields.md
conf-module-ctx-null.md
conf-null-command.md
conf-unset-init.md
ds-cpymem-pattern.md
ds-hash-readonly.md
ds-list-iteration.md
ds-ngx-str-not-null-terminated.md
ds-ngx-str-set-literals.md
event-handle-read-write.md
event-no-blocking.md
event-posted-events.md
event-thread-pool.md
event-timer-management.md
filter-buffer-chain-iteration.md
filter-buffering-flag.md
filter-call-next.md
filter-check-subrequest.md
filter-registration-order.md
handler-add-variable.md
handler-content-handler.md
handler-empty-response.md
handler-error-page.md
handler-last-buf.md

Details

From the project README

nginx.org C Module Development Best Practices

Comprehensive development guide for nginx C modules, derived from the official nginx development documentation and community expertise. Contains 49 rules across 8 categories, prioritized by impact to guide correct module implementation and prevent common crashes, memory leaks, and undefined behavior.

When to Apply

Reference these guidelines when:

  • Writing new nginx C modules (handlers, filters, upstream, load-balancers)
  • Implementing configuration directives and merge logic
  • Managing memory with nginx pools and shared memory zones
  • Handling the HTTP request lifecycle (body reading, subrequests, finalization)
  • Working with nginx's event loop, timers, and thread pools

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Memory ManagementCRITICALmem-
2Request LifecycleCRITICALreq-
3Configuration SystemHIGHconf-
4Handler DevelopmentHIGHhandler-
5Filter ChainMEDIUM-HIGHfilter-
6Upstream & ProxyMEDIUMupstream-
7Event Loop & ConcurrencyMEDIUMevent-
8Data Structures & StringsLOW-MEDIUMds-

Quick Reference

1. Memory Management (CRITICAL)
2. Request Lifecycle (CRITICAL)
3. Configuration System (HIGH)
4. Handler Development (HIGH)
5. Filter Chain (MEDIUM-HIGH)
6. Upstream & Proxy (MEDIUM)
7. Event Loop & Concurrency (MEDIUM)
8. Data Structures & Strings (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported