
knowledge-graph
Manage persistent Knowledge Graph for specifications. Provides read, query, update, and validation capabilities for codebase analysis caching. Use when: spec-to-tasks needs to cache/reuse codebase analysis, task-implementation needs to validate task dependencies or contracts, spec-quality needs to synchronize provides, or any command needs to query existing patterns/components/APIs. Reduces redundant codebase exploration by caching agent discoveries.
- Installs
- 1.9K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill knowledge-graph- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads knowledge-graph automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Knowledge Graph Skill
Overview
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)
- Input: Spec folder, query type, optional filters
- Output: Filtered results matching criteria
3. update-knowledge-graph - Update KG with new discoveries
- Input: Spec folder, updates (partial KG), source description
- Output: Merged KG with new findings
4. validate-against-knowledge-graph - Validate task dependencies against KG
- Input: Spec folder, requirements (components, APIs, patterns)
- Output: Validation report with errors/warnings
5. validate-contract - Validate provides/expects between tasks
- Input: Spec folder, expects (files + symbols), completed dependencies
- Output: Satisfied/unsatisfied expectations report
6. extract-provides - Extract symbols from implemented files
- Input: Array of file paths
- Output: Array of provides with file, symbols, type
7. aggregate-knowledge-graphs - Merge patterns from all specs
- Input: Project root path
- Output: Global KG with deduplicated patterns
See references/query-examples.md for detailed usage examples.
Examples
Input/Output Examples
Read Knowledge Graph:
Input: /knowledge-graph read docs/specs/001-hotel-search/
Output: {
metadata: { spec_id: "001-hotel-search", version: "1.0" },
patterns: { architectural: [...], conventions: [...] },
components: { controllers: [...], services: [...]}
}
Query Components:
Input: /knowledge-graph query docs/specs/001-hotel-search/ components {"category": "services"}
Output: [{ id: "comp-svc-001", name: "HotelSearchService", type: "service"}]
Update Knowledge Graph:
Input: /knowledge-graph update docs/specs/001-hotel-search/ {
patterns: { architectural: [{ name: "Repository Pattern"}] }
}
Output: "Added 1 pattern to knowledge graph"
Validate Dependencies:
Input: /knowledge-graph validate docs/specs/001-hotel-search/ {
components: ["comp-repo-001"]
}
Output: { valid: true, errors: [], warnings: [] }
See references/examples.md for comprehensive workflow examples.
KG Schema Reference
See references/schema.md for complete JSON schema with examples.
Integration Patterns
See references/integration-patterns.md for detailed integration with Developer Kit commands.
Error Handling
See references/error-handling.md for comprehensive error handling strategies and recovery procedures.
Performance Considerations
See references/performance.md for optimization strategies and performance characteristics.
Security
See references/security.md for security considerations, threat mitigation, and best practices.
Best Practices
When to Query KG: Before codebase analysis, task generation, dependency validation
When to Update KG: After agent discoveries, component implementation, pattern discovery
KG Freshness:
- < 7 days: Fresh
- 7-30 days: Stale, warn user
-
30 days: Very stale, offer regeneration
See references/performance.md and references/security.md for detailed best practices.
Constraints and Warnings
Critical Constraints
- Source-Code Safe Operations: Does NOT modify source code files. Only creates/updates
knowledge-graph.jsonfiles. - Path Validation: Only reads/writes KG files from
docs/specs/[ID]/paths. - No Automatic Code Generation: Caches analysis results, does NOT generate implementation code.
Limitations
- Validation Scope: Checks components exist in KG, but cannot verify if they exist in actual codebase if KG is outdated
- Freshness Dependency: KG accuracy depends on how recently it was updated
- Single-Spec First: Each KG is primarily specific to a single specification
- File Size: KG files can grow large (>1MB) for complex specifications
See references/error-handling.md and references/security.md for complete constraints and warnings.
Reference Files
- schema.md - Complete JSON schema
- query-examples.md - Query patterns
- integration-patterns.md - Command integration
- error-handling.md - Error handling guide
- performance.md - Performance optimization
- security.md - Security considerations
- examples.md - Practical examples
FAQ
What does the knowledge-graph skill do?
Manage persistent Knowledge Graph for specifications. Provides read, query, update, and validation capabilities for codebase analysis caching. Use when: spec-to-tasks needs to cache/reuse codebase analysis, task-implementation needs to validate task dependencies or contracts, spec-quality needs to synchronize provides, or any command needs to query existing patterns/components/APIs. Reduces redundant codebase exploration by caching agent discoveries.
How do I install knowledge-graph?
Run npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill knowledge-graph in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/knowledge-graph/ (personal) or .claude/skills/knowledge-graph/ (project).
Which AI agents can use knowledge-graph?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is knowledge-graph safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains knowledge-graph?
It is published by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit. It has 1,922 recorded installs.
More from giuseppe-trisciuoglio/developer-kit
shadcn-ui
giuseppe-trisciuoglio/developer-kit
Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.
tailwind-css-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
drizzle-orm-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.
unit-test-bean-validation
giuseppe-trisciuoglio/developer-kit
Provides patterns for unit testing Jakarta Bean Validation (JSR-380), including @Valid, @NotNull, @Min, @Max, @Email constraints with Hibernate Validator. Generates custom validator tests, constraint violation assertions, validation groups, and parameterized validation tests. Validates data integrity logic without Spring context. Use when writing validation tests, bean validation tests, or testing custom constraint validators.
nextjs-performance
giuseppe-trisciuoglio/developer-kit
Expert Next.js performance optimization skill covering Core Web Vitals, image/font optimization, caching strategies, streaming, bundle optimization, and Server Components best practices. Use when optimizing Next.js applications for Core Web Vitals (LCP, INP, CLS), implementing next/image and next/font, configuring caching with unstablecache and revalidateTag, converting Client Components to Server Components, implementing Suspense streaming, or analyzing and reducing bundle size. Supports Next.js 16 + React 19 patterns.
react-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. Generates executable code patterns, validates security for public endpoints, and optimizes performance with React Compiler or manual memoization. Proactively use when building React 19 applications with Next.js App Router, implementing optimistic UI, or optimizing concurrent rendering.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.