KMGraph ships a set of bundled templates in core/default-templates/. Every template is protected — do not modify files under core/ without explicit permission. To customize templates for a project, copy the relevant file into the project's knowledge graph directory.
For customization guidance, see Customize Templates.
Lessons Learned
| File | Purpose | Key Fields | Created by | Deploys to |
|---|
lessons-learned/lesson-template.md | Documents a single lesson: what happened, root cause, and fix | title, created [AUTO], author [AUTO], git.* [AUTO], tags, severity, category | /kmgraph:capture-lesson | knowledge/templates/lesson-template.md |
Architecture Decisions (ADRs)
| File | Purpose | Key Fields | Created by | Deploys to |
|---|
decisions/ADR-template.md | Records an architectural decision with status, context, and consequences | title, number, created, status, author, email | /kmgraph:create-adr | knowledge/templates/ADR-template.md |
Sessions
| File | Purpose | Key Fields | Created by | Deploys to |
|---|
sessions/session-template.md | Two-part session record: a current-state snapshot (Current State, Open Issues, Session History, Session Findings) and a timestamped narrative log (append-only) | title [AUTO], date [AUTO], branch [AUTO], as_of_commit [AUTO], last_updated [AUTO], tags [AUTO] | /kmgraph:session-summary | knowledge/templates/session-template.md |
Knowledge Graph Entries
These templates live under core/default-templates/concepts/ and provide per-category structures for the knowledge graph. Most entries are auto-generated from lessons via /kmgraph:update-graph; use these templates when creating entries directly.
| File | Category | Purpose | Created by |
|---|
concepts/entry-template.md | General | Base template for any standalone KG entry | Manual / /kmgraph:update-graph |
concepts/templates/architecture.md | Architecture | Architectural components, design decisions, trade-offs | /kmgraph:update-graph |
concepts/templates/concepts.md | Concepts | Domain terminology and core abstractions | /kmgraph:update-graph |
concepts/templates/gotchas.md | Gotchas | Pitfalls and anti-patterns; symptom → root cause → fix | /kmgraph:update-graph |
concepts/templates/patterns.md | Patterns | Reusable solutions discovered from lessons | /kmgraph:update-graph |
concepts/templates/workflows.md | Workflows | Standard operating procedures and repeatable processes | /kmgraph:update-graph |
All paths above are relative to core/default-templates/. At init, these files are seeded to knowledge/templates/ in your live knowledge graph.
| File | Purpose | Created by |
|---|
MEMORY-template.md | Persistent project memory loaded into every session; governance patterns and critical context | /kmgraph:init |
AGENTS-template.md | Scaffold for new KMGraph subagent definitions; metadata block, structure, and prompt sections | Manual |
documentation/doc-template.md | General documentation file; enforces heading hierarchy, breadcrumb nav, and third-person voice | /kmgraph:create-doc |
Meta-issue templates live under core/default-templates/meta-issue/. They are scaffolded together by /kmgraph:start-issue-tracking to track complex, multi-attempt problems.
Core Documents
| File | Purpose |
|---|
meta-issue/description.md | Living problem description; evolves as understanding changes |
meta-issue/implementation-log.md | Chronological log of every attempt |
meta-issue/test-cases.md | Success criteria and test cases that define "solved" |
Per-Attempt Documents (attempt-template/)
| File | Purpose |
|---|
attempt-template/solution-approach.md | Hypothesis and approach for one attempt |
attempt-template/plan-reference.md | Link to implementation plan and objective summary |
attempt-template/attempt-results.md | Outcomes, test results, and what actually happened |
Analysis Documents (analysis/)
| File | Purpose |
|---|
analysis/lessons-learned.md | Reusable insights extracted from the investigation |
analysis/root-cause-evolution.md | How root-cause understanding shifted across attempts |
analysis/timeline.md | Chronological history of the full investigation |
| File | Purpose |
|---|
related-issues/github-links.md | Maps GitHub issues and PRs to meta-issue attempts |
Customization
To override a template for a specific project, copy the file from core/default-templates/ into the project knowledge graph directory and edit it there. The core/ tree is not modified during normal use. See Customize Templates for step-by-step instructions.