The Knowledge Graph (KG) is a persistent JSON file that stores discoveries from codebase analysis, eliminating redundant exploration and enabling task validation.
Location
:
docs/specs/[ID-feature]/knowledge-graph.json
Key Benefits:
✅ Avoid re-exploring already-analyzed codebases
✅ Validate task dependencies against actual codebase state
✅ Share discoveries across team members
✅ Accelerate task generation with cached context
When to Use
Use this skill when:
spec-to-tasks needs to cache/reuse codebase analysis
- Store agent discoveries for future reuse
task-implementation needs to validate task dependencies and contracts
- Check if required components exist before implementing
Any command needs to query existing patterns/components/APIs
- Retrieve cached codebase context
Reducing redundant codebase exploration
- Avoid re-analyzing already-explored code
Trigger phrases:
"Load knowledge graph"
"Query knowledge graph"
"Update knowledge graph"
"Validate against knowledge graph"
"Check if component exists"
"Find existing patterns"
Instructions
Available Operations
1. read-knowledge-graph
- Load and parse KG for a specification
Input
Path to spec folder (e.g.,
docs/specs/001-feature/
)
Output
KG object with metadata, patterns, components, APIs
2. query-knowledge-graph
- Query specific sections (components, patterns, APIs)