بنقرة واحدة
code-reader
// Use when you want to deeply understand an unfamiliar codebase and generate reusable cognitive skills from it, by providing a local path or GitHub URL
// Use when you want to deeply understand an unfamiliar codebase and generate reusable cognitive skills from it, by providing a local path or GitHub URL
Review Agent Skill directories and SKILL.md files against best practices. Use this skill when the user wants to review, validate, or check an Agent Skill implementation.
整理和优化项目目录结构。当用户请求整理目录、分类文件、清理无用文件或重构文件夹结构时调用此技能。
审查技术文档。支持四种独立评审类型:大纲评审(检查目录与结构逻辑)、内容评审(检查文字准确性与代码质量)、资产评审(校验链接与引用合规)、格式评审(校对纯视觉排版与标点)。当用户请求审查或修正 Markdown 文档时使用。
检查 Markdown 文件中的本地和外部链接有效性。当用户需要验证、检查 Markdown 文档或项目的链接可访问性时调用此技能。
分析和总结指定的本地 Markdown 文件,并输出结构化的中文总结。当用户请求总结、分析或提取本地 Markdown 文档信息时调用此技能。
将指定的本地 Markdown 文件翻译成指定语言(默认中文),并在文件名中添加语言标识后缀。当用户请求翻译本地 Markdown 文档时调用此技能。
| name | code-reader |
| description | Use when you want to deeply understand an unfamiliar codebase and generate reusable cognitive skills from it, by providing a local path or GitHub URL |
Systematically read and understand a codebase, producing a set of verified cognitive skills that capture deep knowledge — module capabilities, design logic, data structures, state flow, and modification guides.
The core mechanism: a closed-book exam verification loop ensures generated skills are genuinely comprehensive, not shallow summaries.
To make this process robust and conceptually clear, the system employs three distinct agents modeled after a software engineering team:
Here is the CLI command to trigger the deep-code-read workflow:
/deep-code-read <source> <output-dir>
./path/to/repo) or GitHub URL (e.g., https://github.com/org/repo)You MUST follow these phases in order. Track progress across modules using your platform's task/todo tracking mechanism.
This initial phase handles the resolution and preparation of the target source codebase.
{output-dir}/{project-name}/git tag --list in the source repov prefix), recommend the latestmain or master branch"Detected the following tags/branches: [list]. I recommend tracking
{recommended}. Confirm or specify a different target."
This phase scans the repository structure to identify boundaries and dependencies.
src/, lib/, pkg/, packages/, or project root__init__.py), Go packages, Node packages (package.json), etc."Found the following modules: [list with one-line descriptions]. Select which modules to deep-read (or 'all')."
This phase generates the foundational skill documents.
For each selected module, dispatch a subagent with the prompt template from references/tech-writer-prompt.md.
Subagent dispatch parameters:
prompt: rendered tech-writer-prompt.md with variables filled indescription: "Deep read {module-name}"Variables to fill in the prompt:
{source-dir}: path to the source repo{module-dir}: path to the specific module within the source repo{output-dir}: the skill output directory{project-name}: extracted project name{module-name}: the module name{ref}: the tracked tag/branchAfter Tech Writer completes, verify the skill files were written to {output-dir}/{project-name}-fj-{module-name}/. Update the module's task status.
This phase executes the core verification loop to ensure the generated skills are accurate and complete.
For each module that has generated skills, run the verification cycle:
Step 1 — Agent B / QA Engineer (question generation):
Dispatch a subagent with references/qa-engineer-prompt.md, using a lightweight/smaller model (e.g., Haiku-class).
Subagent dispatch parameters:
prompt: rendered qa-engineer-prompt.mdmodel: a smaller, cheaper model — the weaker the better (if it catches gaps, those gaps are real)description: "Generate questions for {module-name}"Variables:
{source-dir}, {module-dir}, {module-name}{previous_questions}: empty string for the first roundQA Engineer returns two sets:
Save the recommended questions (keep in context for Phase 6). Accumulate all verification questions asked so far across rounds.
Step 2 — Agent C / Junior Dev (closed-book answer):
Dispatch a subagent with references/junior-dev-prompt.md.
Subagent dispatch parameters:
prompt: rendered junior-dev-prompt.md with verification questions embeddeddescription: "Verify skills for {module-name}"Variables:
{skill-dir}: {output-dir}/{project-name}-dr-{module-name}/{questions}: the verification questions from QA Engineer (without answer keys)Junior Dev returns answers to each question.
Step 3 — Evaluate:
Use your own reasoning (as the main orchestrator) to evaluate Junior Dev's answers:
For each question, check Junior Dev's answer against QA Engineer's required_facts list:
json).Step 4 — Loop or proceed:
HARD RULE: You MUST continue looping until 100% of verification questions pass OR you have completed exactly 3 rounds. There is NO early exit. A pass rate of 99% is still a failure — loop again.
{feedback} variable containing the failed questions, QA Engineer's expected answer keys, and the gaps identified.{previous_questions} so QA Engineer generates new questions instead of repeating old onesDo NOT rationalize stopping early. "Good enough", "most questions passed", "diminishing returns" are not valid reasons to skip a round. The loop exists to catch gaps — use all 3 rounds if needed.
This phase consolidates the verified module skills into a global index file.
After all modules are verified, generate {output-dir}/{project-name}-dr/SKILL.md:
---
name: {project-name}-dr
description: Use when working with {project-name} codebase — provides comprehensive module knowledge, design logic, and modification guides (generated from {ref})
---
Content must include:
To generate cross-module scenarios, read ALL the module skills and synthesize typical user workflows.
This phase presents the results to the user for final validation.
Present the recommended questions collected from Phase 4:
"Skills generated and verified. Here are some questions you might want to test: [list recommended questions]
Feel free to ask any question about {project-name}. I'll answer using ONLY the generated skills."
When answering user questions in this phase:
{output-dir}/{project-name}-fj*/Continue until the user is satisfied or decides to end the session.
This final phase handles the cleanup of temporary files if necessary.
If the source was cloned from a URL (i.e., {output-dir}/{project-name}/ was created in Phase 1):
"Skills are ready. The cloned source code is at
{output-dir}/{project-name}/. Want me to delete it to save disk space, or keep it for reference?"
Skip this phase if the source was a local path (we never cloned anything).
Strictly adhere to the following rules during the entire execution process:
superpowers:writing-skills formatting conventions (frontmatter, CSO description, directory structure) but does NOT run the full writing-skills TDD cycle