self-document
Improve readability by fixing names and eliminating unnecessary comments.
Skill by nitrictech
Chalk Labs
Need help deploying self-document?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/nitrictech-self-document
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/self-document
Tools it pre-approves 5
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Read,Edit,Grep,Glob,Bash
What's inside
- Skill name
self-document- Description
- Improve readability by fixing names and eliminating unnecessary comments. Replace magic numbers, abbreviations, and comments with expressive names, variables, functions, and types.
- License
- MIT
- Allowed tools
- Read,, Edit,, Grep,, Glob,, Bash
- Instructions
- 39 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves any shell command
Files (4)
- COMMENTS.md
- EXAMPLES.md
- NAMING.md
- SKILL.md
SKILL.md (first lines)
# Self-Document
Refactor names and structure so the code speaks for itself, then add concise doc comments where callers need them.
If the user has not specified a scope, ask which file or directory to focus on before proceeding.
## Glossary
- **Inline comment** — a comment inside a function body. Earns its place when it explains a non-obvious *why* (algorithm choice, optimization, workaround for an upstream bug, regulatory requirement). Becomes noise when it restates *what* the code does ("loops over users", "increments count"). Most existing inline comments are noise.
- **Doc comment** — a comment above a function, method, or class. Documents the interface for callers. Keep and add these.
- **Self-documenting** — readable without *what*-comments because names, types, and structure carry the meaning.
- **Magic number / magic value** — a literal whose meaning is not obvious from its value (`86400`, `3`, `"PENDING"` if it is one of several states). Replace with a named constant or enum.
- **Load-bearing comment** — a comment a caller would actually break things by ignoring (e.g. "returns null if not found", "weight in grams"). The fix is almost always to push the meaning into the type system, not to keep the comment.
## Principles
- **Types are documentation; comments are the fallback.** If a type can express the constraint (`Optional<User>`, `Duration`, an enum, a newtype), prefer that. Reach for a comment only when the type system cannot carry the meaning.
- **Names should make comments redundant.** A comment explaining a variable, condition, or constant means the name is doing too little work. Rename or extract until the comment is restating the code, then delete it.
- **Comments must justify themselves.** A *why* comment (non-obvious choice, optimization, workaround) earns its place. A *what* comment (restating the code) is noise — refactor and delete. This applies wherever the comment lives.
- **Stale comments are worse than no comments.** A comment that contradicts the code actively misleads. Delete on sight.
## Process
1. **Scope.** Confirm which file or directory to work on. Read it first to learn the codebase's conventions (case style, doc-comment format, idiomatic abbreviations like `ctx` in Go).
2. **Apply the naming rules.** Find single-letter variables, abbreviations, type-prefixed names, `Utils`/`Helper`/`Manager`/`Common` containers, and `Base`/`Abstract`/`I`-prefixed types. Rename or restructure. See [NAMING.md](NAMING.md).
3. **Apply the comment rules.** For every comment, decide: does it restate the code (delete), explain a non-obvious *why* (keep), document a public API (keep, but check if naming/types can shrink it), or contradict the code (delete). For each one you delete, ask whether a named constant, extracted predicate, or richer type would carry the meaning the comment used to. See [COMMENTS.md](COMMENTS.md).
4. **Add doc comments where missing.** Every function, method, and class should have a doc comment in the language's standard format (JSDoc, godoc, docstrings, `///`). Describe the interface, not the implementation. See [COMMENTS.md](COMMENTS.md).
5. **Present changes.** Group edits by rule (naming, magic numbers, comment removal, doc comments added) so the user can review each category independently.
See [EXAMPLES.md](EXAMPLES.md) for worked before/after examples.
## Adapt to the codebase
Follow existing conventions: case style, doc-comment format, idiomatic abbreviations. Use language-specific type features (`Optional`, `Result`, enums, newtypes) where available. If the codebase has an established convention that conflicts with a rule here (e.g. `I`-prefix interfaces in C#), follow the codebase.From nitrictech/skills, MIT.
More from nitrictech/skills
- 0.494score
flatten
nitrictech
Find and fix deeply nested code using extraction (pull logic into functions) and inversion (guard clauses, early returns).
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
senior-review
nitrictech
Review a code changes, PR, etc.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
review-security
nitrictech
Audit an entire source tree for security vulnerabilities, validating findings against framework and library documentation to avoid false positives.
SkillCFreshness: C★ 1Claude Code - 0.492score
implement
nitrictech
Implement a code change, typically a PR, as specified by the user.
SkillCFreshness: C★ 1Claude Code +9 - 0.429score
dependency-injection
nitrictech
Refactor code to use dependency injection.
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
simplify-abstractions
nitrictech
Evaluate abstractions and inheritance for over-coupling.
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
functional-patterns
nitrictech
Refactor imperative loops into functional data pipelines using map, filter, reduce, sort, and slice.
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 15, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/nitrictech/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from nitrictech
- 0.494score
flatten
nitrictech
Find and fix deeply nested code using extraction (pull logic into functions) and inversion (guard clauses, early returns).
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
senior-review
nitrictech
Review a code changes, PR, etc.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
review-security
nitrictech
Audit an entire source tree for security vulnerabilities, validating findings against framework and library documentation to avoid false positives.
SkillCFreshness: C★ 1Claude Code - 0.492score
implement
nitrictech
Implement a code change, typically a PR, as specified by the user.
SkillCFreshness: C★ 1Claude Code +9 - 0.429score
dependency-injection
nitrictech
Refactor code to use dependency injection.
SkillDFreshness: D★ 1Claude Code +9 - 0.429score
simplify-abstractions
nitrictech
Evaluate abstractions and inheritance for over-coupling.
SkillDFreshness: D★ 1Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get self-document running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
self-document skill. Agent Mart. https://agentmart.dev/skills/nitrictech-self-document (last updated 2026-10-24)