Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when adding or editing Zig code in ZINC and you want it to remain compatible with the auto-generated Zig API docs. Covers the comment format, supported tags, parser limitations, section naming, and validation steps needed for reliable HTML, JSON, text, and llms exports.
.claude/skills/zolotukhin-zig-docgen/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 320% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 148% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 16% | 0% |
Use this when you touch src/**/*.zig and the public surface should stay extractable by site/src/lib/zig-api-loader.ts.
//! comments.Required shape:
//! @section ... line/// doc block immediately above it.Include:
@param name ... for meaningful parameters@returns ... when the return value matters@note ... for operational caveatspub fn inside an exported struct, enum, or union also gets a /// doc block.The generator supports:
pub const, pub fn, pub varpub fn methods inside exported containersExample:
pub const Nested = struct {} inside another exported struct is not part of the generated docs today.Current sections (must match SECTION_META slugs in site/src/lib/zig-api-loader.ts):
CLI & EntrypointsModel Format & LoadingTokenizationDecode PlanningInference RuntimeSamplingShader DispatchHardware DetectionVulkan RuntimeMetal RuntimeManaged ModelsSchedulerAPI ServerTool Callingsite/src/lib/zig-api-loader.ts and its tests in site/src/lib/zig-api-loader.test.ts in the same change.src/vulkan/vk.zig and src/regression_tests.zig are intentionally excluded from generated docs (EXCLUDED_MODULES in the loader).
@import("gguf"), @import("zinc_rt"), etc.) cannot have their struct runtime layout (@sizeOf / @alignOf / @offsetOf) extracted by the standalone analyzer, because zig run does not resolve those imports. Add such files to EXCLUDED_STRUCT_EXTRACTOR_MODULES in the loader so the rest of the struct-layout extraction still succeeds. Their doc summary, field declarations, params, and returns continue to render.zig//! Create reusable compute command pools and command buffers. //! @section Vulkan Runtime //! The decode runtime uses these wrappers to record dispatches and synchronize compute work. /// Command pool for allocating command buffers. pub const CommandPool = struct { /// Create a command pool bound to the selected compute queue family. /// @param instance Active Vulkan instance and logical device. /// @returns A CommandPool ready to allocate compute command buffers. pub fn init(instance: *const Instance) !CommandPool { // ... } };
//! block./// docs for every changed public symbol./// docs for every changed public method inside exported containers.Run these after doc-related Zig changes:
bashzig build test cd site && bun test cd site && npm run build
Success means:
Run this from the repo root to surface every place the contract is violated:
bashpython3 .claude/skills/zig-docgen/scripts/audit_doc_coverage.py
The script walks src/**/*.zig and reports four classes of issue:
file_no_module_doc — the file's first non-empty line isn't //!file_no_section — the //! block has no @section X linesymbol_no_doc — a top-level pub fn/pub const/pub var has no /// blockimmediately above it
method_no_doc — a pub fn inside an exported struct/enum/union lacks a/// block
Exit code is 0 when clean, 1 when issues remain. Full machine-readable report lands in /tmp/zig_doc_audit.json.
src/vulkan/vk.zig — raw Vulkan bindingssrc/.zig-api-cache/ — generated compiler artifacts (auto-emitted builtin.zig)src/shaders/ — SPIR-V shader sources, not Zigsrc/metal/ — Objective-C bridge for the Metal backendIf you add new generated trees or non-Zig sources under src/, extend EXCLUDE_DIR_PARTS in the audit script.
/// blocks that are present but vacuous (just whitespace after the slashes)@param tags@returns missing on functions where the return type is non-trivial@section values that don't match the canonical taxonomy abovepub fn inside test functions (intentional — test bodies aren't public API)Treat the audit as a floor, not a ceiling: passing it means you have some doc-block on every public symbol, not that the prose is good.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 4,281 | 32,494 | +659% | 1 | 1 | 0% | 156 | 1,668 | +969% | 0 | 0 | — |
case-02 | fail→pass | 7,345 | 23,269 | +217% | 1 | 1 | 0% | 1,309 | 5,500 | +320% | 0 | 0 | — |
case-03 | fail→pass | 5,206 | 3,533 | -32% | 1 | 1 | 0% | 781 | 1,933 | +148% | 0 | 0 | — |
case-04 | fail→pass | 12,713 | 4,091 | -68% | 1 | 1 | 0% | 1,902 | 1,987 | +4% | 0 | 0 | — |
case-05 | fail→pass | 10,271 | 3,995 | -61% | 1 | 1 | 0% | 1,628 | 2,125 | +31% | 0 | 0 | — |
case-06 | fail→pass | 11,428 | 3,534 | -69% | 1 | 1 | 0% | 1,720 | 1,989 | +16% | 0 | 0 | — |
case-07 | fail→pass | 9,962 | 4,625 | -54% | 1 | 1 | 0% | 1,526 | 2,219 | +45% | 0 | 0 | — |
case-08 | fail→pass | 11,476 | 3,747 | -67% | 1 | 1 | 0% | 1,595 | 2,113 | +32% | 0 | 0 | — |
case-09 | fail→pass | 14,784 | 4,780 | -68% | 1 | 1 | 0% | 2,227 | 2,179 | -2% | 0 | 0 | — |
case-10 | fail→pass | 14,303 | 4,211 | -71% | 1 | 1 | 0% | 2,178 | 2,094 | -4% | 0 | 0 | — |
case-11 | fail→pass | 9,403 | 2,936 | -69% | 1 | 1 | 0% | 1,497 | 1,885 | +26% | 0 | 0 | — |
case-12 | pass→pass | 5,832 | 4,803 | -18% | 1 | 1 | 0% | 886 | 2,246 | +153% | 0 | 0 | — |
case-13 | fail→pass | 9,051 | 3,383 | -63% | 1 | 1 | 0% | 1,515 | 2,007 | +32% | 0 | 0 | — |
case-14 | fail→pass | 10,896 | 2,947 | -73% | 1 | 1 | 0% | 1,591 | 1,835 | +15% | 0 | 0 | — |
case-15 | fail→pass | 7,479 | 3,057 | -59% | 1 | 1 | 0% | 1,188 | 1,950 | +64% | 0 | 0 | — |
case-16 | fail→pass | 7,955 | 2,825 | -64% | 1 | 1 | 0% | 1,181 | 1,869 | +58% | 0 | 0 | — |
case-17 | fail→fail | 8,953 | 4,759 | -47% | 1 | 1 | 0% | 1,233 | 2,293 | +86% | 0 | 0 | — |
case-18 | pass→pass | 18,149 | 4,641 | -74% | 1 | 1 | 0% | 2,705 | 2,205 | -18% | 0 | 0 | — |
case-19 | pass→pass | 11,615 | 3,418 | -71% | 1 | 1 | 0% | 1,596 | 1,909 | +20% | 0 | 0 | — |
case-20 | pass→pass | 7,488 | 3,842 | -49% | 1 | 1 | 0% | 1,204 | 2,083 | +73% | 0 | 0 | — |
case-21 | pass→pass | 7,279 | 4,776 | -34% | 1 | 1 | 0% | 1,200 | 2,120 | +77% | 0 | 0 | — |
case-22 | pass→pass | 13,414 | 9,313 | -31% | 1 | 1 | 0% | 1,888 | 2,733 | +45% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +64 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.