Skip to main content

Customize Templates

"The default templates don't match my team's conventions. How do I change them?"

Edit the bundled templates to add required fields, remove unused ones, or change the default structure for lessons, ADRs, and session summaries. At /kmgraph:init, starter templates (lesson, ADR, session, entry) are seeded to knowledge/templates/ in your live knowledge graph; content structure templates (patterns, gotchas, concepts, architecture, workflows) go to knowledge/templates/ as well.

Default templates vs your live knowledge files

Two directories look similar but serve different roles:

DirectoryRoleEditable?
core/default-templates/Frozen out-of-box source — ships inside the plugin, seeded into your project at /kmgraph:init timePROTECTED — do not edit directly
knowledge/decisions/, knowledge/lessons-learned/, knowledge/sessions/, knowledge/concepts/Your live, editable knowledge files — created from the defaults at init, then yours to modify freelyYes

core/default-templates/ is the distribution source. After /kmgraph:init runs, the files you work with every day live under knowledge/ — they are copies, not the originals. Editing core/default-templates/ changes what future /init runs produce; it does not affect your existing knowledge/ files.

How templates work

All templates live in core/default-templates/. When the MCP server or a command creates a new entry, it reads the template from that directory. Editing files in core/default-templates/ changes all future entries of that type.

warning

core/default-templates/ is a PROTECTED directory. Per project conventions, do not commit changes to core/default-templates/ without explicit team review. Keep customizations in docs/templates/ for project-local overrides.

Available templates

TemplateFileUsed by
Lesson learnedcore/default-templates/lessons-learned/lesson-template.md/kmgraph:capture-lesson
Architecture Decision Recordcore/default-templates/decisions/ADR-template.md/kmgraph:create-adr
Session summarycore/default-templates/sessions/session-template.md/kmgraph:session-summary
MEMORY.mdcore/default-templates/MEMORY-template.md/kmgraph:init
Knowledge entrycore/default-templates/concepts/entry-template.md/kmgraph:update-graph
Meta-issuecore/default-templates/meta-issue/meta-issue-template.md/kmgraph:start-issue-tracking

Copy the template

cp core/default-templates/lessons-learned/lesson-template.md docs/templates/my-lesson-template.md

Edit the template

Open the copy and add, remove, or rename fields. The YAML frontmatter fields are recognized by KMGraph. Custom fields in the body are preserved but not indexed.

Use the custom template

/kmgraph:capture-lesson --template docs/templates/my-lesson-template.md

Confirm by running a capture command — the custom fields should appear in the output file.

Set as default

In kg-config.json, add a templateOverrides block:

{
"templateOverrides": {
"lesson": "docs/templates/my-lesson-template.md"
}
}

Common customizations

  • Add a "Team" field to tag entries by squad or domain
  • Add a "Severity" field to lessons for triage prioritization
  • Remove unused frontmatter (e.g., sprint, project) to reduce noise
  • Change the default category from debugging to a project-specific category
  • Customize hooks — automate template selection based on context
  • Custom rules — define how templates apply to different content types