Nim doc comments

From planetis-m/skills · View interactive version

Nim doc comments is an AI agent skill from the GitHub repository planetis-m/skills. Document exported Nim modules and APIs with doc comments that `nim doc` actually picks up, including module docs, proc and type docs, field docs, and runnable examples. Use when writing documentation for a Nim library or fixing docs that are missing, attached to the wrong symbol, or rendering incorr

How to use this skill

Skill file

Nim Doc Comments

Rules

Placement

Visibility

Non-exported symbols do not appear in rendered docs.

runnableExamples

Content

Workflow

  1. Identify the exported API.
  2. Place each doc comment using the correct source layout.
  3. Run nim doc path/to/module.nim.
  4. Check source placement and rendered output.
  5. Fix the source comments. Never edit generated output.

Common Mistakes

| Mistake | Why it's wrong |

|---------|----------------|

| Putting a proc doc comment above the proc signature | nim doc treats it as module documentation, not proc documentation. |

| Putting a standalone ## line above a declaration inside a type or const block | It does not attach to that symbol; put the doc on the declaration line. |

| Checking only rendered HTML | A misplaced module-style comment can still render, so source placement still needs inspection. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.