codemap
Generate, update, or drift-check agent-facing CodeMaps as progressive code terrain indexes for projects, features, capabilities, functions, modules,…
它会碰到什么
扫了多少7 个文本文件,20 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Codemap
Core Position
Create CodeMaps for agents, not CodeWiki for humans.
CodeMap saves context attention, not necessarily raw token count. It does not replace source code, tests, logs, or the current Spec. It routes the agent toward the right source-linked evidence, in the right order, with progressive disclosure.
Use a CodeMap as:
Project CodeMap: breadth-first project terrain, capability index, module boundaries, dependency index, and drill-down pointers.Feature CodeMap: depth-first capability terrain from entry to effect, including branches, dependencies, risks, and validation entry points.
Workflow
- Restate the requested scope and choose mode:
feature: capability, business feature, bug chain, API flow, function/class-centered investigation.project: repository, service, package, subsystem, or first-time onboarding map.drift-check: compare current diff or touched files with existing CodeMaps.update-existing: refresh an existing CodeMap after code terrain changes.
- Before writing a durable CodeMap, tell the user why a map/update is useful, the selected mode, scope, and expected path. Do not silently write persistent maps unless current task approval already covers it.
- Read
references/principles.mdwhen the output shape, boundary, or CodeWiki-vs-CodeMap distinction matters. - For drift checks, read
references/drift-check.md. - For updating an existing map, read
references/update-existing.md. - Inspect code with search first (
rg,rg --files, language-aware tools if available). Prefer source facts over inferred naming matches. - Build progressive Context Tree Nodes:
- start with a small orientation node;
- add capability, module, entry, branch, effect, dependency, risk, and validation nodes only where they route future context;
- keep compact indexes as lookup tables, not as the main structure;
- point nodes to files, functions, classes, tests, configs, logs, and related maps;
- mark each important relationship as
confirmed,inferred, orunknown.
- Write the map under
mydocs/codemap/when the user requests a durable artifact or the work feeds SDD-RIPER Research:
- feature:
mydocs/codemap/YYYY-MM-DD_hh-mm_<feature>功能.md - project:
mydocs/codemap/YYYY-MM-DD_hh-mm_<project>项目总图.md
- Keep the CodeMap narrow enough to guide the next agent action. Do not paste large source blocks or turn it into a narrative system document.
Templates
- For feature/capability maps, follow
references/feature-template.md. - For project/system maps, follow
references/project-template.md. - For drift checks, follow
references/drift-check.md. - For existing map updates, follow
references/update-existing.md. - If a task spans multiple repositories, create one Project CodeMap per relevant project, then add a separate interface or cross-service flow summary.
Output Rules
- Prefer path-linked, source-grounded bullets over prose.
- Separate
Confirmed,Inferred, andUnknown. - Include
Next Drill-Downso the next agent knows what to read only if needed. - Include
Validation Entryso the map can feed Spec / Plan / Review. - Treat stale or conflicting CodeMaps as indexes to re-check, not truth.
- Do not treat CodeMap as a changelog. Update only terrain-changing facts: entries, flows, module boundaries, dependencies, risks, validation entry points, or behavior rule locations.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。