discovery-first
Use pre-computed discovery files at .claude/state/ for codebase inventory questions. Triggers on component, hook, schema, form, type, inventory, what exists, list all, how many. Saves 90%+ tokens vs source scanning.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Discovery-First Skill
Purpose
ALWAYS read discovery files before scanning source code for inventory questions.
When This Triggers
- "What components exist in contacts?"
- "List all hooks in the codebase"
- "What schemas are used for opportunities?"
- "How many forms exist?"
- "Which types are defined?"
- "What calls useContactData?"
Discovery Files Location
| Question Type | Read This First |
|---|---|
| Components | .claude/state/component-inventory/{feature}.json |
| Hooks | .claude/state/hooks-inventory.json |
| Schemas | .claude/state/schemas-inventory/{feature}.json |
| Forms | .claude/state/forms-inventory.json |
| Types | .claude/state/types-inventory/{feature}.json |
| Call Graph | .claude/state/call-graph-inventory/{feature}.json |
Chunk Discovery Pattern
- Read
manifest.jsonin the inventory directory first - Find the chunk that contains the feature you need
- Read only that chunk (e.g.,
contacts.json)
Why This Matters
| Method | Token Cost | Speed |
|---|---|---|
| Discovery JSON | ~30KB | < 2 sec |
| Source scanning | ~500KB | 5-15 sec |
| Savings | 94% | 5x faster |
Required Behavior
-
DO: Read
.claude/state/JSON files first - DO: Use manifest.json to find the right chunk
- DON'T: Grep/Glob src/atomic-crm for inventory questions
- DON'T: Use Task/Explore agent for basic component/hook listing
- DON'T: Read individual source files when inventory answers the question
Example: Correct Approach
Question: "What hooks does ContactList use?"
Wrong approach:
Grep("use.*=", "src/atomic-crm/contacts/ContactList.tsx")
Read("src/atomic-crm/contacts/ContactList.tsx")
Correct approach:
Read(".claude/state/component-inventory/contacts.json")
→ Find ContactList entry → Read hooks array
Freshness
Discovery files are auto-regenerated on pre-commit via .husky/pre-commit.
If data seems stale, run: just discover
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!