Skip to main content

Templates Reference

KMGraph ships a set of bundled templates in core/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 guides/customize-templates.md.


Lessons Learned

FilePurposeKey FieldsCreated by
lessons-learned/lesson-template.mdDocuments a single lesson: what happened, root cause, and fixtitle, created [AUTO], author [AUTO], git.* [AUTO], tags, severity, category/kmgraph:capture-lesson

Architecture Decisions (ADRs)

FilePurposeKey FieldsCreated by
decisions/ADR-template.mdRecords an architectural decision with status, context, and consequencestitle, number, created, status, author, email/kmgraph:create-adr

Sessions

FilePurposeKey FieldsCreated by
sessions/session-template.mdSummarizes a work session: what was done, decisions made, next stepsDate [AUTO], Type [MANUAL], Duration [MANUAL], Status [MANUAL]/kmgraph:session-summary

Knowledge Graph Entries

These templates live under core/templates/knowledge/ 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.

FileCategoryPurposeCreated by
knowledge/entry-template.mdGeneralBase template for any standalone KG entryManual / /kmgraph:update-graph
knowledge/architecture.mdArchitectureArchitectural components, design decisions, trade-offs/kmgraph:update-graph
knowledge/concepts.mdConceptsDomain terminology and core abstractions/kmgraph:update-graph
knowledge/gotchas.mdGotchasPitfalls and anti-patterns; symptom → root cause → fix/kmgraph:update-graph
knowledge/patterns.mdPatternsReusable solutions discovered from lessons/kmgraph:update-graph
knowledge/workflows.mdWorkflowsStandard operating procedures and repeatable processes/kmgraph:update-graph

Meta (Project-Level)

FilePurposeCreated by
MEMORY-template.mdPersistent project memory loaded into every session; governance patterns and critical context/kmgraph:init
AGENTS-template.mdScaffold for new KMGraph subagent definitions; metadata block, structure, and prompt sectionsManual
documentation/doc-template.mdGeneral documentation file; enforces heading hierarchy, breadcrumb nav, and third-person voice/kmgraph:create-doc

Meta-Issue Tracking

Meta-issue templates live under core/templates/meta-issue/. They are scaffolded together by /kmgraph:start-issue-tracking to track complex, multi-attempt problems.

Core Documents

FilePurpose
meta-issue/description.mdLiving problem description; evolves as understanding changes
meta-issue/implementation-log.mdChronological log of every attempt
meta-issue/test-cases.mdSuccess criteria and test cases that define "solved"

Per-Attempt Documents (attempt-template/)

FilePurpose
attempt-template/solution-approach.mdHypothesis and approach for one attempt
attempt-template/plan-reference.mdLink to implementation plan and objective summary
attempt-template/attempt-results.mdOutcomes, test results, and what actually happened

Analysis Documents (analysis/)

FilePurpose
analysis/lessons-learned.mdReusable insights extracted from the investigation
analysis/root-cause-evolution.mdHow root-cause understanding shifted across attempts
analysis/timeline.mdChronological history of the full investigation
FilePurpose
related-issues/github-links.mdMaps GitHub issues and PRs to meta-issue attempts

Customization

To override a template for a specific project, copy the file from core/templates/ into the project knowledge graph directory and edit it there. The core/ tree is not modified during normal use. See guides/customize-templates.md for step-by-step instructions.