一键导入
analyze-agent-codebase
Run a deep architectural analysis of an agentic AI codebase using a phased approach — index, parallel clustered analysis, and synthesis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run a deep architectural analysis of an agentic AI codebase using a phased approach — index, parallel clustered analysis, and synthesis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Query the skill registry to find relevant architectural skills matching what the user wants to build. Searches across configured registries with graceful fallback to local sources.
Query the skill registry to find relevant architectural skills matching the user codebase, then audit the code against matched skill recommendations.
Extract reusable, framework-agnostic skills from an agent codebase analysis report and generate registry-ready skill files. TRIGGER when: a full_report.md has been generated by `/analyze-agent-codebase` (Claude Code) or `@analyze-agent-codebase` (Cursor), the user runs `/extract-skills` (Claude Code) or `@extract-skills` (Cursor), the user asks to extract skills from an analysis.
Extract design decisions, trade-offs, and non-obvious behaviors from a codebase's current source code. TRIGGER when: starting the design analysis pipeline, running `/mine-design` (Claude Code) or `@mine-design` (Cursor) before `/synthesize-decisions` (Claude Code) or `@synthesize-decisions` (Cursor), capturing the reasoning behind current architectural choices, analyzing a codebase snapshot for patterns that would surprise a developer arriving cold.
Run the codebase analysis pipeline — routes to agentic or general path, one step at a time, clearing context between steps (`/clear` in Claude Code, or clear context in Cursor) to prevent context blowup.
Promote design decisions from _analysis/design.md into normative practice skills — guidance that loads before a developer makes the wrong choice. TRIGGER when: _analysis/design.md exists and is ready to promote, running `/synthesize-decisions` (Claude Code) or `@synthesize-decisions` (Cursor) after `/mine-design` (Claude Code) or `@mine-design` (Cursor), extracting design-decision practices from a codebase snapshot analysis.
| name | analyze-agent-codebase |
| description | Run a deep architectural analysis of an agentic AI codebase using a phased approach — index, parallel clustered analysis, and synthesis. |
Use this skill when the user wants to perform a comprehensive architectural analysis of an agentic AI codebase.
Analyze the target codebase in four phases.
Each cluster has its own questions file in the skill directory (e.g. questions_cluster_a.md).
index.md (already in context from Cluster A) to identify candidate files, then read only those. If a topic has no matching registry entry, write: Not indexed — verify Phase 1 captured all relevant files.- [finding] — evidence: path/to/file.ext:Lxxpath/to/file.ext:Lxx-LyyOutput all results to {CODEBASE_ROOT}/_analysis/ directory inside the target codebase root.
Build a structural map of the codebase. This must complete before Phase 2.
List the full directory tree (exclude node_modules, .git, pycache, .venv, venv, dist, build, .next).
Read anchor files if they exist:
.env)Extract: orchestration framework and version, LLM provider SDKs, and key infrastructure dependencies.
Identify locations of: agent/graph definitions, tool definitions, state/memory definitions, tests, and deployment config live.
Write {CODEBASE_ROOT}/_analysis/index.md. No analysis. Mapping only.
Structure:
Top-level directory table:
| Directory | Purpose |
| Category | File Path | Purpose |
Run clusters one at a time.
Write file before proceeding to next.
Cluster assignments:
| Cluster | Questions file | Output file (written by main agent) |
|---|---|---|
| A: Core Architecture | questions_cluster_a.md | cluster_a_core_architecture.md |
| B: Execution, State, Memory | questions_cluster_b.md | cluster_b_execution_state_memory.md |
| C: Tools and Retrieval | questions_cluster_c.md | cluster_c_tools_retrieval.md |
| D: Data and Adaptation | questions_cluster_d.md | cluster_d_data_adaptation.md |
| E: Safety and Security | questions_cluster_e.md | cluster_e_safety_security.md |
| F: Ops | questions_cluster_f.md | cluster_f_ops.md |
Cluster Prompt Template:
Use this template for each cluster:
Read
{CLUSTER_QUESTIONS_FILE}. Identify relevant files using the Key File Registry in index.md (already in context). Read only those files. Produce structured findings only.
After each cluster completes, write output to: {CODEBASE_ROOT}/_analysis/{OUTPUT_FILE}. Then release: stop referencing this cluster's question file and the source files read for it — do not re-read them. Keep _analysis/index.md in context. Then proceed to the next cluster.
After all cluster files are written:
index.md are already in context — do not re-read them from disk.questions_synthesis.md.{CODEBASE_ROOT}/_analysis/synthesis.mdRun this shell command to produce {CODEBASE_ROOT}/_analysis/full_report.md — do not read or rewrite the cluster files yourself:
{
printf "# Agent Codebase Analysis Report\n**Codebase**: {CODEBASE_ROOT}\n**Date**: {DATE}\n\n"
cat \
{CODEBASE_ROOT}/_analysis/cluster_a_core_architecture.md \
{CODEBASE_ROOT}/_analysis/cluster_b_execution_state_memory.md \
{CODEBASE_ROOT}/_analysis/cluster_c_tools_retrieval.md \
{CODEBASE_ROOT}/_analysis/cluster_d_data_adaptation.md \
{CODEBASE_ROOT}/_analysis/cluster_e_safety_security.md \
{CODEBASE_ROOT}/_analysis/cluster_f_ops.md \
{CODEBASE_ROOT}/_analysis/synthesis.md
} > {CODEBASE_ROOT}/_analysis/full_report.md
index.md before starting.