skills/harness/project-analysis/SKILL.md
深度项目分析工具。用于在现有 docs 不足、代码链路复杂、harness M0/M1 需要补足 TaskNode 输入上下文、或需要梳理系统架构、模块数据流、时序、性能风险时进行只读取证和结构化分析。常与 `project-docs-workflow`、`harness-engineering-plan` 配套使用;也可在用户明确要求架构分析、数据流分析、时序图、调用链梳理或性能排查时直接使用。默认应落文档:优先更新或新建 `docs/` 下合适长期文档,不停留在仅终端输出的 analysis-only 模式。
npx skillsauth add escapewu/skills project-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本技能是项目的深度分析层。
它不负责每次开发前后的通用 docs 编排;那由 project-docs-workflow 负责。它的职责是:在现有文档不足、链路复杂或用户明确需要时,做只读取证、调用链梳理、图表整理和性能观察,并把结果整理进项目文档。
默认行为:更新或创建 docs。 不再使用 analysis-only。当用户没有明确指定时,先沿 docs/OVERVIEW.md -> docs/feature/INDEX.md / docs/reference/INDEX.md -> 相关 README/INDEX/leaf 判断是否存在合适承接文档:能承接则 update-doc,不能承接才 new-doc。
强制要求:凡是输出 Mermaid 图表,必须在同一位置紧跟对应的 ASCII/TUI 预览图,方便用户在终端和代码评审中直接审查结构。不得省略,不得标记为可选。
本技能可用于以下分析主题:
architecture:系统架构、模块边界、依赖关系、外部服务dataflow:模块数据流、调用链、关键数据变换、外部 I/Osequence:主流程时序、跨层交互、关键分支performance-risk:性能热点、放大点、瓶颈候选、风险链路仅保留两种落点结果,且默认优先写文档。默认选择逻辑是 auto:先判断 update-doc 是否可行;不可行时再落为 new-doc。
当已有 docs/feature/<category>/README.md、子模块 README.md / INDEX.md、docs/reference/*.md 或 docs/OVERVIEW.md 能承接本次分析结果时使用。
适用场景:
project-docs-workflow / harness-engineering-plan 升级调用并提供候选文档路径输出:
当分析结果适合沉淀为一篇新的长期文档,且没有合适现有文档可承接时使用。
适用场景:
docs/ 中没有合适文档可承接输出:
docs/feature/<category>/<module>/... 或 docs/reference/...)模式选择规则:
update-doc 是否可行:若存在合适承接文档,优先更新而不是平行新建new-docanalysis-onlystandalone-report 作为独立模式;用户若要求独立报告,按 new-doc 处理并创建合适的新文档先明确:
architecture / dataflow / sequence / performance-risk 哪类分析new-doc / update-doc优先按渐进式披露检查:
docs/OVERVIEW.mddocs/feature/INDEX.md,再进入相关分类 README.md、子模块 README.md / INDEX.mddocs/reference/INDEX.md,再进入相关 reference 文件如果调用方(如 project-docs-workflow 或 harness-engineering-plan)已经提供候选文档路径,优先读取这些文档;如果没有,再按 INDEX 路由定位候选文档。禁止全量读取 docs/。
这些文档只能作为半可信上下文:
进入分析后,必须在写文档前完成模式判断:
update-docnew-doc如 docs/ 中存在旧式分析文档、frontmatter 元数据或需要做补充检索,可选使用 metadata 扫描脚本作为辅助:
python3 <skills-root>/skills/project-analysis/scripts/scan_docs_metadata.py <项目根目录>/docs
它不是主判断依据。主判断依据应是:
docs/OVERVIEW.mddocs/feature/INDEX.md 与相关分类 / 子模块文档docs/reference/INDEX.md 与相关 reference 文件在正式读代码前,先把分析拆成 2-4 个边界清晰、只读、可并行的子任务。
拆分原则:
推荐拆分方式:
优先把子任务设计成可并行的只读取证单元。只有在当前工具环境允许、且用户或调用方明确授权并行 agent 时,才启动 SubAgent;否则由主 agent 使用 rg / rg --files / sed / nl 等本地工具完成同样的取证。
执行要求:
主 agent 汇总各取证单元的结果后,再统一形成分析输出。
主 agent 负责:
Input Context 的摘要:入口点、相关文件、契约、风险、验证建议写入前至少检查:
docs/feature/<category>/<module>/... / docs/reference/... / docs/OVERVIEW.md)INDEX.md / README.md 是否已添加路由项,leaf 顶部是否有 > 上级:... 反向链接../ 链接,跨层资源改用 /docs/...、/sandbox/... 等项目根路径docs/OVERVIEW.md如发现更适合沉淀到规则层的经验,只负责识别并提示调用方;不要默认直接修改 AGENTS.md / CLAUDE.md。
完成后,向用户汇报:
new 还是 update默认优先维护这一套长期项目文档:
docs/feature/<category>/README.mddocs/feature/<category>/<module>/README.md 或 INDEX.mddocs/reference/*.mddocs/OVERVIEW.md优先规则:
docs/feature/<category>/...docs/reference/...docs/OVERVIEW.md仅在下列情况才生成独立分析文档:
注意:独立文档仍属于 new-doc,不是单独的第三种执行模式。
| 分析类型 | 文件名格式 |
|---------|-----------|
| 系统架构 | architecture.md |
| 数据流 | dataflow-{功能}.md |
| 时序图 | sequence-{流程}.md |
注意:这类文件不是默认长期落点。优先仍是 docs/feature/<category>/... / docs/reference/... / docs/OVERVIEW.md。
如果本技能由 project-docs-workflow 升级调用,调用方应尽量提供:
auto / update-doc / new-docdocs/feature/<category>/README.md、docs/reference/architecture.md)收到这些信息时,本技能应:
如果本技能由 harness-engineering-plan 在 M0 / M1 调用,调用方应尽量提供:
taskBoard.md / tasks.md / design / spec 候选路径Input Context 直接引用收到这些信息时,本技能应:
Entry Points、Relevant Files、Contracts / Data Shapes、Risks / Open Questions、Validation Candidatesharness-engineering-plandocs/OVERVIEW.md 沿 INDEX/README 可达,并在 leaf 顶部加入上级链接references/mode-architecture.mdreferences/mode-dataflow.mdreferences/output-spec.mdreferences/mermaid-templates.mddevelopment
Use when working with the news fetcher REST API at <news-fetcher-host> for supported-site lookup, domain article discovery, URL fetching, batch fetch/crawl workflows, fetch history queries, and Bearer-authenticated integration examples.
development
create and refresh repository-specific development standards for an existing local codebase. use when the user wants to analyze a local repository, extract coding conventions from real files, generate docs/ai-dev-standards, create code review checklists, or update existing agents.md or claude.md files so future coding agents load the right standards before development. do not use for generic programming advice detached from a repository.
documentation
analyze postgresql or mysql database schemas from ddl files, schema-only dumps, migration sql, or read-only database metadata. use when the user wants table structure summaries, primary keys, foreign keys, indexes, inferred table relationships, er diagrams, dbml, mermaid erd, schema documentation, or database relationship analysis for postgres/mysql schemas.
tools
Replace with description of the skill and when Claude should use it.