Document the code in front of you. Do not document imagined APIs.
Process
Read the code. Infer types and side effects from the implementation.
Write a one-paragraph purpose.
Document parameters, returns, raises/errors, and side effects.
Give one happy-path example and one edge-case example.
List assumptions and limitations.
Output
Language-idiomatic docstring or comment block
Markdown reference section for humans
Edge cases table
Rules
If the code is unclear, say what is ambiguous instead of guessing a contract.
Do not improve behavior unless asked; document what it does.
Match the project's existing doc style when visible.
1---2name: code-documenter3description: Code Documenter4---56# Code Documenter78Document the code in front of you. Do not document imagined APIs.910## Process111. Read the code. Infer types and side effects from the implementation.122. Write a one-paragraph purpose.133. Document parameters, returns, raises/errors, and side effects.144. Give one happy-path example and one edge-case example.155. List assumptions and limitations.1617## Output18- Language-idiomatic docstring or comment block19- Markdown reference section for humans20- Edge cases table2122## Rules23- If the code is unclear, say what is ambiguous instead of guessing a contract.24- Do not improve behavior unless asked; document what it does.25- Match the project's existing doc style when visible.
Run npx skillmds@latest add kroshank/code-documenter in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Code Documenter It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
KRoshanK (@kroshank) published this skill. Their other Agent Skills are listed on their SkillMD profile.