From kmgraph
This skill orients the system to the four-layer architecture (context, logic, lifecycle, data) and how each layer coordinates knowledge capture, retrieval, and synchronization. Skill recognizes knowledge capture opportunities, provides command reference for manual interactive use, and guides understanding of how skills and hooks automate triggering.
npx claudepluginhub technomensch/knowledge-graph --plugin kmgraphThis skill uses the workspace's default tool permissions.
Provide orientation to the Knowledge Graph system architecture and guidance for recognizing knowledge capture opportunities. The system operates across four coordinated layers that automate knowledge lifecycle management while keeping manual commands available for interactive use.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Retrieves current documentation, API references, and code examples for libraries, frameworks, SDKs, CLIs, and services via Context7 CLI. Ideal for API syntax, configs, migrations, and setup queries.
Uses ctx7 CLI to fetch current library docs, manage AI coding skills (install/search/generate), and configure Context7 MCP for AI editors.
Provide orientation to the Knowledge Graph system architecture and guidance for recognizing knowledge capture opportunities. The system operates across four coordinated layers that automate knowledge lifecycle management while keeping manual commands available for interactive use.
The Knowledge Graph system coordinates across four layers that work together seamlessly:
Detects the moment, pre-structures data, dispatches to logic layer
Execute the work with full context
Automate at the right moment
Persistence, search, retrieval
kg_search — Full-text search across lessons, decisions, sessionskg_scaffold — Create entries from templateskg_config_* — Configuration and synckg_fts5_rebuild — Indexing and performanceRecognize these signals that indicate knowledge worth preserving:
Problem-Solution Patterns
Architectural Decisions
Process Improvements
Meta-Issues (Recurring Problems)
Valuable Patterns
Capture knowledge that meets these criteria:
Non-Obvious: Not easily found in official documentation or standard tutorials Actionable: Provides clear steps or guidance for future reference Specific: Concrete examples and context rather than vague principles Reusable: Applicable to future similar situations Verified: Based on working solution, not speculation
Avoid capturing:
Before capturing a new lesson, search for similar existing lessons to avoid duplication:
Search strategy:
/kmgraph:recall "key terms")If similar lesson found:
When to merge vs create new:
Benefits of duplicate detection:
The system automates knowledge lifecycle through layer coordination:
Example: After solving a problem
Example: Before starting problem-solving
This automation eliminates the need to remember to run commands—the system recognizes the moment and dispatches appropriate logic.
Commands remain available for explicit, interactive use. They operate on all four layers:
/kmgraph:capture-lesson [title]
/kmgraph:session-summary
/kmgraph:sync-all
/kmgraph:recall "query"
/kmgraph:status
/kmgraph:init [name]
/kmgraph:switch [name]
/kmgraph:check-sensitive
/kmgraph:configure-sanitization
After debugging session:
1. /kmgraph:capture-lesson debugging-session-title
2. Document problem, root cause, solution, prevention
3. Tag with relevant categories
During recurring problem:
1. /kmgraph:meta-issue 123
2. Document current attempt and findings
3. Update issue plan as investigation progresses
End of productive session:
1. /kmgraph:session-summary
2. Review and refine generated summary
3. Links to lessons captured during session
When facing familiar problem:
1. /kmgraph:recall "problem description"
2. Review relevant lessons and decisions
3. Apply documented solution or adapt approach
Periodic knowledge consolidation:
1. /kmgraph:sync-all
- Extracts recent chats
- Captures lessons from extracted content
- Updates knowledge graph with insights
2. Review generated content for quality
After lesson capture (NEW - v0.0.3):
Context: User just completed /kmgraph:capture-lesson
Proactive suggestion:
"✅ Lesson captured! Extract insights to Knowledge Graph?"
- Recommended: /kmgraph:update-graph (extracts patterns/gotchas/concepts)
- Full pipeline: /kmgraph:sync-all (extraction + MEMORY.md + GitHub)
- Later: Skip for now, run manually later
Why now: Fresh context enables better extraction. The knowledge-reviewer
agent will assess quality automatically.
After significant commits (NEW - v0.0.3):
Context: Git commit completed with keywords (fix|debug|implement|refactor|pattern|architecture)
Proactive suggestion:
"💡 Lesson-worthy commit detected: [hash] - [message]
This looks like knowledge worth capturing. Consider:
- /kmgraph:capture-lesson — Document while context is fresh
- Within 30 minutes is optimal for quality
Keywords detected: [fix/debug/pattern/etc]"
Why now: 30-minute window is critical — after that, context fades and
quality suffers. Commits are natural knowledge boundaries.
Before starting problem-solving (NEW - v0.0.3):
Context: User describes a problem; sounds familiar or recurring
Proactive suggestion:
"Before solving, check if we've seen this before:
- /kmgraph:recall \"[extracted keywords]\"
- Might save time if similar pattern exists
Would you like me to search existing lessons first?"
Why now: Prevents re-solving known problems. Search takes 10 seconds,
solving from scratch takes hours. Always search first.
After archiving entries (NEW - v0.0.4):
Context: User ran /kmgraph:archive-memory to free token budget
Context: User asks about a topic that was recently archived
Context: User needs to reference archived knowledge for current work
Restoration workflow:
1. Check if entry is in archive: "/kmgraph:restore-memory --list"
2. Restore by name: "/kmgraph:restore-memory \"Entry Name\""
3. Restore by ID: "/kmgraph:restore-memory --id=5"
4. Preview before writing: All restorations show preview + token impact
Decision criteria:
- Restore if: Currently working on related problem, need context for active task
- Keep archived if: Historical reference only, not currently relevant
- Token budget: Only restore if < 1,500 tokens in MEMORY.md
Why now: Restoration should be need-driven. Archive freed space for active
knowledge; only restore when archived context becomes active again.
For detailed workflow patterns with timing, command combinations, and optimization strategies, see references/command-workflows.md.
When documenting debugging or problem-solving:
Problem: What broke? What was the symptom? Context: Environment, configuration, relevant details Root Cause: Why did it break? What was the underlying issue? Solution: How was it fixed? What steps were taken? Prevention: How to avoid this in the future?
When documenting design choices:
Decision: What was chosen? Context: What problem was being solved? Alternatives: What other options were considered? Trade-offs: What are the pros/cons of each option? Rationale: Why was this option selected? Consequences: What are the implications?
When tracking recurring complex problems:
Issue: GitHub issue number and link Pattern: What keeps recurring? Attempts: Chronological log of investigation attempts Findings: What has been learned so far Current Status: Where investigation stands Next Steps: What to try next
For comprehensive capture patterns including quality checklists, edge cases, and advanced techniques, see references/capture-patterns.md.
Knowledge commands automatically capture git metadata:
This enables:
Link lessons to tracked work:
/kmgraph:link-issue for bidirectional references/kmgraph:meta-issue for complex recurring issuesKnowledge commands work within Claude Code:
Recognize these patterns during conversation and suggest appropriate commands:
After complex debugging:
/kmgraph:capture-lesson debugging-[topic]During recurring issue discussion:
/kmgraph:meta-issue [number] if tracked, or capture-lesson if notEnd of productive session:
/kmgraph:session-summaryWhen user references past work:
/kmgraph:recall "query" to find previous solutionArchitecture or design discussion:
Before solving problems, check if knowledge already exists:
Familiar-sounding problem:
/kmgraph:recall to find relevant lessonsUser mentions past work:
Recurring patterns:
For comprehensive guidance on specific topics:
references/capture-patterns.md - Detailed capture patterns, quality checklists, examples for different knowledge types, edge case handling, and advanced techniques for documenting lessons, decisions, and meta-issuesreferences/command-workflows.md - Ten detailed workflow patterns with timing recommendations, command combinations, optimization strategies, and scenario-specific guidance for daily development, complex investigation, team coordination, and knowledge consolidationFor detailed command syntax and options:
/kmgraph:status for quick reference and current KG infoBefore sharing knowledge:
/kmgraph:check-sensitive to scan for sensitive data/kmgraph:configure-sanitizationUse this skill to:
Focus on capturing non-obvious, actionable, specific, reusable, and verified knowledge that will benefit future work. Integrate knowledge capture naturally into development workflow rather than treating it as separate documentation task.