nim-doc-comments
Skill4 starsChanged 3 months agoMITView on GitHub
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 incorrectly.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- planetis-m/skillsedited, first seen Jul 16, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- planetis-m/skills★ 5993% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- atlas-package-clonerSkill
- buildSkill
- docs-genSkill
- format-codeSkill
- nim-api-designSkill
- nim-c-bindingsSkill
- nim-code-organizationSkill
- nim-c-wrappersSkill
- nim-debuggingSkill
- nim-defect-analysisSkill
- nim-error-handlingSkill
- nim-fuzzingSkill
- nim-mcp-toolsSkill
- nimonypluginsSkill
- nim-ownership-hooksSkill
- nim-style-guideSkill
- nim-testingSkill
- run-testsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Do not put a standalone ## line above a declaration inside a type or const block and expect it to attach.
- Very specific: line 22
Only exported symbols (*) appear in rendered docs.
- Very specific: line 26
Do not add runnableExamples: by default.
- Very specific: line 27
If used, place runnableExamples: after doc text and before implementation statements.
- Distinctive: line 32
Start with a short summary sentence.
- Distinctive: line 38
Place each doc comment using the correct source layout.
- Distinctive: line 40
Check source placement and rendered output.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nim Doc Comments
Rules
Placement
##is a doc comment —nim docpicks it up.#is a regular comment and is ignored by docs.- Module docs go at the top of the file, before imports.
- Proc/func/iterator/template/converter docs go immediately after the signature line, before the body.
- Inside
type,const, andletblocks, attach docs to the declaration line with trailing##. - Multi-line docs continue with
##on the following lines, aligned under the declaration. - Enum value and object field docs go on their declaration lines.
- Do not put a standalone
##line above a declaration inside atypeorconstblock and expect it to attach.
Visibility
- Only exported symbols (
*) appear in rendered docs. Non-exported symbols are hidden.
runnableExamples
- Do not add
runnableExamples:by default. - If used, place
runnableExamples:after doc text and before implementation statements. nim doccompiles and runs allrunnableExamples:blocks.
Content
- Start with a short summary sentence. Explain behavior, contracts, and constraints.
- Skip comments that only restate the symbol name or obvious type info.
Workflow
- Identify the exported API.
- Place each doc comment using the correct source layout.
- Run
nim doc path/to/module.nim. - Check source placement and rendered output.
- 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
references/module_docs.md— Line and block forms for module docs and top-level examples.references/proc_and_type_docs.md— Doc placement for exported declarations and fields.references/runnable_examples.md—runnableExamplesforms with placement and compiler flags.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

