一键导入
improve-codebase-architecture
Find architecture deepening opportunities. Use to improve structure, testability, module boundaries, or agent navigability.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find architecture deepening opportunities. Use to improve structure, testability, module boundaries, or agent navigability.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Normalize a consequential or ambiguous request when missing context, boundaries, or proof could materially change the work. Explicit invocation previews the improved prompt.
Explore requirements and approaches through collaborative dialogue, then write a right-sized requirements document. Use when the user says "let's brainstorm", "what should we build", or "help me think through X", presents a vague or ambitious feature request, or seems unsure about scope or direction -- even without explicitly asking to brainstorm.
Find root causes and fix bugs. Use for errors, failing tests, issue repros, stack traces, "debug this", or "why is this failing".
Create structured plans for multi-step tasks once the goal is clear enough to plan. Use after ce-brainstorm or ce-grill, or directly for clear planning requests. If the request has branchy product/scope ambiguity, run ce-grill first. After markdown plans, document-review runs before handoff.
Review recent code changes for bugs, regressions, product fit, conventions, performance, security, and blast radius.
Execute implementation work with a compact product-contract loop. Use when the user asks to build, fix, implement, polish, or finish a scoped task. Favor reasoning, prior art, smallest correct changes, focused tests, and real-surface proof. Do not run autonomous PR, CI, ticket, or residual-work pipelines.
| name | improve-codebase-architecture |
| description | Find architecture deepening opportunities. Use to improve structure, testability, module boundaries, or agent navigability. |
Surface architectural friction and propose deepening opportunities: refactors that turn shallow modules into deep ones. The aim is testability, locality, leverage, and AI-navigability.
Use this skill to produce candidates. Do not implement the refactor during the discovery pass, and do not propose final interfaces until the user chooses a candidate.
Read LANGUAGE.md before writing recommendations. Use its terms consistently:
Keep the philosophy intact:
Identify the target repository before exploration. If the user names a repo, branch, PR, plan, or path, use that as the target even if it is not the current working directory. Announce:
Default report path:
<target-repo>/.ai/reviews/YYYY-MM-DD-NNN-improve-codebase-architecture-review.html
Create .ai/reviews/ if needed. Use the next daily sequence number from existing files in that directory. Use OS temp only for scratch artifacts from subagents or intermediate analysis.
Search prior art before inspecting code deeply. Prefer the target repo's durable agent artifacts over inventing context:
AGENTS.md, and CLAUDE.md only when present as compatibility context..ai/plans/, especially active plans or plans matching the user's topic..ai/solutions/, especially architecture patterns, conventions, workflow issues, and previous bug fixes..ai/reviews/ and .ai/brainstorms/..ai/handoffs/ when recent or topic-matched.CONCEPTS.md, docs/adr/, adr/, decisions/, or ARCHITECTURE.md only if they exist. Do not create glossary or ADR files during the candidate pass.If QMD MCP is available, prefer it. Otherwise use the CLI:
qmd search "<exact terms>" -c ai
qmd search "<exact terms>" -c docs
qmd query "<architecture question>"
Do not depend on fixed collection names. If collections are unclear, inspect or list what exists and choose the closest knowledge, docs, wiki, notes, or artifact collections.
When no glossary exists, infer domain language from instructions, plans, source names, and user wording. State in the report that vocabulary was inferred.
Use RepoPromptCE or parallel exploration agents when available for broad unfamiliar areas. Otherwise use rg, targeted file reads, tests, and git history.
Explore organically and note where you experience friction:
Apply the deletion test to suspected shallow modules. Prefer candidates where deepening would concentrate product behavior and tests, not merely rename files.
Scope discipline matters. Do not expand into adjacent UX, validation, persistence, data modeling, or infra unless the accepted architecture contract cannot work without it.
Read HTML-REPORT.md before writing the report.
Write one self-contained HTML report to the target repo's .ai/reviews/ directory and open it for the user:
open <absolute-path>
Use xdg-open on Linux or start on Windows.
Each candidate must include:
Strong, Worth exploring, or Speculative.ai, QMD, docs, and source files that shaped the candidateEnd with a Top recommendation section naming the candidate to tackle first and why.
Do not write implementation steps yet. Do not create or update .ai/plans/ during the candidate pass. After the file is written, ask: "Which of these would you like to explore?"
Once the user picks a candidate, switch from candidate discovery to design exploration.
Walk the design tree with them:
Side effects are opt-in and use the repo's actual artifact system:
ce-plan or write/update the relevant .ai/plans/ artifact.ce-compound as an .ai/solutions/architecture-patterns/ or .ai/solutions/conventions/ entry.CONCEPTS.md exists and a durable domain term surfaces, defer vocabulary capture to ce-compound or ce-compound-refresh unless the current workflow explicitly owns that doc.CONTEXT.md or a new glossary as a side effect of this skill.For alternative interface designs, read INTERFACE-DESIGN.md.