一键导入
docs-code
Use when asked to analyze code and add explanatory code annotations, file headers, doc comments, inline comments, or JSX-safe comments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when asked to analyze code and add explanatory code annotations, file headers, doc comments, inline comments, or JSX-safe comments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when asked to add a Changesets release note, create a .changeset markdown file, choose semver impact, or satisfy a missing changeset check before a pull request.
Generates interactive multi-page HTML codebase courses with Mermaid diagrams, architecture walkthroughs, module dependency tutorials, data-flow views, state-machine views, and per-module deep dives. Use when asked to teach, map, explain, or visually tour a repository.
Use when creating a GitHub pull request or merge request from the current branch, especially when a project PR template may exist.
Use when asked to quickly stage all current changes and commit them with an automatically selected commit message.
Use when asked to create, rewrite, audit, or maintain README, ARCHITECTURE, CONTRIBUTING, TUTORIAL, docs navigation, project options, badges, or documentation signatures.
| name | docs-code |
| description | Use when asked to analyze code and add explanatory code annotations, file headers, doc comments, inline comments, or JSX-safe comments. |
Analyze a codebase, get confirmation on the module map, then add high-value comments without changing code behavior.
This skill accepts an optional target path:
Resolve the argument relative to the project root.
Always skip generated and dependency directories:
node_modules
.git
dist
build
.next
out
target
vendor
__pycache__
.cache
coverage
.turbo
.changeset
*.tsbuildinfo
Complete this phase before editing.
Report format:
## Module Analysis Report
### [Module Name]
- **Responsibility**: one-sentence description
- **Key Files**:
- `path/to/file1.ext` — what it does
- `path/to/file2.ext` — what it does
- **Exports**: key exported functions, types, classes, or commands
- **Depends On**: other modules it uses
- **Used By**: modules that depend on it
For a file argument, skip the module-level report. Instead:
After user confirmation, add only comments. Do not modify code logic.
Detect project conventions first. If a project already uses a comment style, follow it.
| Language | File header | Doc comments | Inline |
|---|---|---|---|
| JS / TS | /** @file ... */ or // | TSDoc /** ... */ | // |
| JSX / TSX | same as JS / TS | TSDoc on exports | // outside JSX, {/* ... */} inside JSX |
| Python | """Module docstring.""" | """...""" | # |
| Shell | # ... | # ... | # |
| Go | // ... | // ... | // |
| Rust | //! ... | /// ... | // |
| Java / Kotlin | /** ... */ | /** ... */ | // |
| C / C++ | /* ... */ | /** ... */ | // |
| Ruby | # ... | # ... | # |
| Lua | -- ... | --- ... | -- |
JSX / TSX rule: // and /* */ are invalid inside JSX markup. Inside returned JSX, use {/* ... */}. Outside JSX markup, use normal JS comment syntax.
Add comments only where they do not already exist:
TODO: for incomplete implementation and FIXME: for known bugs.NOTE: for critical logic that requires extra care.max-lines, max-lines-per-function, or complexity, use project thresholds instead.Example section banner:
// ═══════════ Parsing ═══════════
Process files module by module. After each module, list changed files and annotation types:
## Annotation Summary
- `src/parser.ts` — file header and exported function docs
- `src/render.tsx` — JSX-safe inline comments for non-obvious branches
| Mistake | Fix |
|---|---|
| Editing code while documenting | Only add comments. |
| Skipping Phase 1 confirmation | Stop after the report and wait. |
Using // inside JSX markup | Use {/* ... */} inside JSX. |
| Commenting trivial code | Explain intent only where it reduces confusion. |
| Adding comments to generated files | Skip generated, bundled, dependency, and build output files. |