Style Guide
Authoring standards for contributors writing or reviewing documentation for the Knowledge Management Graph.
Audience: Contributors β human developers and AI documentation agents. Version: 0.5.2 Last Updated: 2026-03-03
Before writing documentation, read this guide. Every rule includes a citation showing where the standard comes from.
Contentsβ
- Non-Negotiables
- Voice and Tone
- Canonical Terminology
- Page Patterns
- Accessibility
- Formatting Standards
- Links and Cross-References
- Citations and Best-Practice Traceability
- Pre-Commit Checklist
- Related Documentation
Citation Keysβ
The following authoritative sources are referenced throughout this guide using [CitationKey] notation.
| Key | Source | Principle |
|---|---|---|
[Nielsen2015] | Nielsen Norman Group, "Plain Language Is for Everyone, Even Experts" (2015) | Plain language reduces cognitive load; read time decreases 58% |
[GoogleDevDocs] | Google Developer Documentation Style Guide (2024) | Readers scan, not read linearly; hierarchy and information density matter |
[MicrosoftMSTP] | Microsoft Manual of Style, 4th ed. | Task-based organization improves findability; use active voice and imperative mood |
[508CFR1194] | 36 CFR Part 1194, Section 508 Standards | Accessible technology requirements for documentation |
[WCAG21] | WCAG 2.1, Level AA (W3C, 2018) | Web Content Accessibility Guidelines |
[MadeToStick] | Heath & Heath, "Made to Stick" (2007) | Concrete examples are 40% more memorable than abstract descriptions |
[DiataxisFramework] | Divio Documentation System ("Diataxis"), Procida (2021) | Four documentation types: tutorials, how-tos, explanations, references |
[WritersGuide] | The Chicago Manual of Style, 17th ed. | Comma usage, capitalization, heading case conventions |
[gitbook-style-guide] | gitbook-docs/docs-maintenance/documentation-style-guide.md | Project-specific platform language and page patterns |
1. Non-Negotiablesβ
These rules cannot be overridden without an explicit versioned decision (ADR). Every contributor must follow them on every document.
1.1 Third-person voice in comprehensive documentationβ
Apply to: concepts/how-kmgraph-is-organized.md, reference/command-guide.md, GETTING-STARTED.md.
- β "The system extracts metadata automatically."
- β "The command creates a lesson file in the active category."
- β "You can see that the system extracts..."
- β "We recommend running this command first."
Validation: grep -iE "\b(you|your|we|our|they|them)\b" [file]
Citation: [gitbook-style-guide] Non-negotiable #1; [MicrosoftMSTP] Sec. 3.2 β third-person for reference documentation.
1.2 Imperative or neutral voice in quick-reference documentationβ
Apply to: CHEAT-SHEET.md.
- β
"Run
/kmgraph:initto initialize." - β "This command initializes the knowledge graph."
- β Mix of imperative and third-person within the same document.
Citation: [MicrosoftMSTP] Sec. 3.4 β imperative mood for task instructions.
1.3 Platform-agnostic language unless describing Claude Codeβspecific behaviorβ
- β "The lesson template supports any LLM workflow."
- β "MCP-compatible tools can extend the plugin."
- β
"Claude Code users can invoke commands via the
/prefix." - β "Claude will extract the metadata." (when the feature is not Claude Codeβspecific)
Citation: [gitbook-style-guide] Platform Language section.
1.4 Command prompt text is immutableβ
Never paraphrase or summarize code blocks in /commands/. Command prompt text must be reproduced verbatim; any modification is treated as a versioned decision requiring an ADR.
Citation: [gitbook-style-guide] Non-negotiable #5; immutability protects LLM reproducibility.
1.5 Never modify /commands/ or core/default-templates/ without explicit permissionβ
These directories contain LLM execution prompts and structured parsing templates. Changes break functionality.
- If a change appears necessary: stop and ask the project maintainer first.
- Allowed: adding new files in these directories when explicitly authorized.
- Never allowed: editing existing command or template files without maintainer sign-off.
Citation: MEMORY.md Code Protection Rules; [GoogleDevDocs] "Separate concerns between authoring and execution."
1.6 No hardcoded counts of mutable collectionsβ
Never write specific counts for collections that grow between releases.
Apply to any reference to commands/, skills/, agents/, hooks/, core/default-templates/, mcp-server/src/tools/, or any directory whose contents change between releases.
| Disallowed | Allowed |
|---|---|
| "26 slash commands" | "Every slash command", "All slash commands" |
| "10 skills" | "Each auto-triggered skill", "All skills" |
| "8 subagents" | "Every subagent", "The agent catalog" |
| "13+ templates" | "All bundled templates", "The template library" |
| "5 lifecycle events" | "Each lifecycle event", "The lifecycle hooks" |
Why: A specific number means every release that adds or removes an item also requires a documentation edit. Missed edits become silent inaccuracies that erode trust.
Validation grep (see Β§9 Pre-Commit Checklist):
grep -nE '\b[0-9]+\s+(commands?|skills?|agents?|hooks?|templates?|tools?|subagents?|events?)\b' docs/
Any match in user-facing docs is a style violation. Allowed exceptions: line counts, phase counts, version numbers.
Citation: [GoogleDevDocs] "Avoid information that quickly becomes stale"; [gitbook-style-guide] (ADR-027, 2026-04-08).
2. Voice and Toneβ
2.1 Voice by document typeβ
Choose the correct voice for each document type. Mixing voices within a document is not permitted.
| Document | Voice | Example |
|---|---|---|
concepts/how-kmgraph-is-organized.md | Third-person | "The system captures git metadata automatically." |
reference/command-guide.md | Third-person | "The command creates a lesson file in the active category." |
GETTING-STARTED.md | Third-person | "The initialization wizard prompts for project name." |
CHEAT-SHEET.md | Imperative or neutral | "Run /kmgraph:init." or "This command initializes..." |
STYLE-GUIDE.md (this document) | Imperative | "Use third-person voice." |
| Code comments and examples | Any style | Exception to all voice rules. |
Citation: [GoogleDevDocs] "Match the voice to the document's purpose."
2.2 Tone principlesβ
Lead every section with an outcome β state what the reader gains, not what the section contains.
- β "This section defines heading rules so contributors produce consistent hierarchy across all docs."
- β "This section is about heading rules."
Prefer concrete nouns over pronouns:
- β
"The command writes to
lessons-learned/." - β "It writes to the folder."
Additional tone rules:
- Short paragraphs (4 lines or fewer)
- Short lists (7 items or fewer before splitting into subsections)
- Avoid implementation detail in introductory content; reserve it for Advanced sections
- Every technical claim must be demonstrable with an example
Citations: [GoogleDevDocs] "State the purpose before the details."; [Nielsen2015] plain language reduces read time 58%; [MicrosoftMSTP] "Use short sentences and paragraphs."
3. Canonical Terminologyβ
Use the terms in the "Use This Term" column consistently across all documentation. Using alternative terms creates confusion and undermines searchability.
| Use This Term | Never Use | Definition |
|---|---|---|
| Command | slash command, plugin command, skill | A prompt manually invoked by the contributor via /kmgraph:β¦ |
| Skill | command (for autonomous triggers) | A prompt triggered automatically by the AI |
| Template | form, blank, scaffold | A pre-formatted markdown file providing structure |
| Knowledge graph | KG (in contributor-facing prose), database, notes system | The quick-reference layer of organized documentation |
| KG | kg, K.G. | Acceptable abbreviation in code and technical contexts only |
| Lesson Learned | lesson, note, entry | A structured problem-solving document in lessons-learned/ |
| ADR | decision record, architecture note | Architecture Decision Record, numbered sequentially |
| MEMORY.md | memory file, context file | The AI long-term context file at the KG root |
| Claude Code | Claude, the assistant | When referring to the Claude Code IDE plugin specifically |
| Any LLM | Claude, the AI | When describing platform-agnostic workflows |
| MCP | plugin API, tool | Model Context Protocol integration |
| GitHub Issue | issue (alone) | Platform-level bug report or feature request on GitHub |
[AUTO] | automatic, auto-filled | Field filled by the command without contributor input |
[MANUAL] | manual, user-filled | Field requiring contributor input |
| ISO 8601 | date format | YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ |
Citation: [gitbook-style-guide] Terminology section; [GoogleDevDocs] "Use a word list to enforce consistency."
4. Page Patternsβ
Apply the correct structural pattern for each document type. Predictable structure improves scannability and reduces the cognitive load of finding information. [GoogleDevDocs]
4a. Guide page patternβ
Apply to: GETTING-STARTED.md, CONFIGURATION.md, and similar task-oriented guides.
# [Title]
[One-sentence description of what this guide covers and who it is for.]
---
## [What It Is] (optional β omit if obvious from title)
## [When to Use / Choose a Path]
## [Step-by-step content sections]
## Troubleshooting
## Related Documentation
Citation: [gitbook-style-guide] Guide Page pattern; [DiataxisFramework] How-to guide structure.
4b. Command page patternβ
Apply to: individual command entries in reference/command-guide.md.
### π’ `/kmgraph:[command-name]`
**Purpose**: [One-line description]
**When to use**:
- [Scenario 1]
- [Scenario 2]
**What it does**:
1. [Step 1]
2. [Step 2]
**Time**: [Estimate]
**Example**:
```bash
/kmgraph:[command-name] [optional-args]
Tips (optional):
- [Tip]
Difficulty badges: π’ Essential / π‘ Intermediate / π΄ Advanced.
**Citation**: `[gitbook-style-guide]` Command Page pattern; `[MicrosoftMSTP]` "Give examples for every major operation."
---
### 4c. Concept entry pattern
Apply to: term definitions in `concepts/how-kmgraph-is-organized.md`.
```markdown
### [Term]
**What it is**: [Plain-English definition, 1β2 sentences]
**Why it matters**: [Why a contributor needs to know this]
**Example**: [Concrete example β never abstract]
**Plain English**: [One-sentence analogy]
Citation: [MadeToStick] β concrete examples are 40% more memorable; [DiataxisFramework] explanation document type.
4d. Lesson Learned patternβ
Lessons follow the template in core/default-templates/lessons-learned/lesson-template.md. Refer contributors to that template. Do not duplicate the structure here.
Citation: [DiataxisFramework] β reference documents describe structure, not process.
4e. ADR patternβ
ADRs follow the template in core/default-templates/decisions/ADR-template.md. Refer contributors to that template.
Citation: [DiataxisFramework] β reference documents describe structure, not process.
4f. Changelog entry patternβ
Apply to: every version section in CHANGELOG.md.
Each version section opens with a ### TL;DR subsection, followed by the standard Keep a Changelog technical blocks (### Added, ### Changed, ### Removed, ### Fixed).
Required subsection structureβ
### TL;DR
:::info[Short plain-English headline describing a user-visible change.]
Brief plain-English explanatory text providing context.
:::
:::info[Short plain-English headline for a workflow that is now automated.]
Brief plain-English explanatory text on what the user no longer needs to do manually.
:::
:::info[Short plain-English headline explicitly flagging a behind-the-scenes change.]
For example: Internal architecture reorganized; no changes from your perspective.
:::
Rules for ### TL;DRβ
- Write for a developer who uses KMGraph daily but is not reading the source code
- State what is different about daily use, not what code changed internally
- Explicitly call out workflows that are now automated β what the user no longer needs to do manually
- Explicitly call out commands whose behavior, name, or invocation changed
- Explicitly flag changes that are purely behind the scenes β do not omit them; include an info block to confirm nothing changed for the user
- Use plain English; avoid technical terms that are not already defined in Section 3 of this guide
- Use Docusaurus
:::info[Headline]admonitions rather than plain bullet points - Sub-bullets, code blocks, or nested headers are permitted inside the admonition block
- Each block is a complete thought and stands alone without requiring the reader to check the technical sections below
Placementβ
Place ### TL;DR immediately after the ## [version] - date heading, before all technical subsections (### Added, ### Changed, ### Removed, ### Fixed). The user sees the high-level summary first; the technical detail follows for those who need it.
Exampleβ
## [1.0.0] - 2026-04-01
### TL;DR
:::info[Zero-friction MCP setup.]
If the KMGraph MCP server isn't connected, the assistant will now offer to automatically configure it for Gemini CLI, Cursor, Windsurf, Continue.dev, or VS Code. No manual JSON editing required.
:::
:::info[Behind the scenes only:]
The internal search index format changed; search results are unchanged from your perspective.
:::
### Added
- New `kg_capture` MCP write tool
Citation: [Nielsen2015] β plain language reduces cognitive load; changelog readers are users, not implementers. [GoogleDevDocs] β "State the purpose before the details."
4g. How-to guide patternβ
Apply to: step-by-step how-to guides in docs/guides/ (e.g. capture-lessons-learned.md, create-adr.md).
## Goal
[One-sentence outcome statement β what the reader will accomplish.]
## Prerequisites
- [Requirement 1]
- [Requirement 2]
## Steps
**1. [Action title]**
[Explanation + code block if needed]
**2. [Action title]**
[Explanation + code block if needed]
## Verify
[How to confirm it worked]
## Related (optional)
- [Link to related guide 1]
- [Link to related guide 2]
Rules for how-to guidesβ
- Voice: Use imperative mood ("Run", "Fill in", "Add"). Never use third-person or descriptive language in step titles.
[MicrosoftMSTP] - Headings: Use sentence case for all H2 headings (
## Goal,## Steps,## Verify). No punctuation at end of headings. - Goal subsection: Must be a single outcome sentence describing what the reader accomplishes β not a description of what the section covers. Never write "This section explains..." or "Learn how to..."
- Prerequisites subsection: List all requirements before the reader can proceed. Include version constraints, initialization steps, or setup configurations.
- Steps subsection: Sequential numbered actions with concise titles. Each step includes explanation and optional code block. Lead with the action, not the context.
- Verify subsection: Required for every how-to guide. Provide concrete confirmation steps β how does the reader know the task succeeded? Include example output if applicable.
- Related subsection: Optional but recommended. Link to companion guides, conceptual explanations, or related tasks.
Citation notesβ
This pattern is distinct from 4a (narrative guides with broader scope and exploratory pathways). Do not mix narrative structure with task-based how-to structure within a single document.
Citation: [DiataxisFramework] how-to guide structure (Diataxis defines how-tos as focused, goal-oriented instructions); [MicrosoftMSTP] imperative mood for task instructions.
5. Accessibilityβ
All contributor-facing and user-facing documentation must meet Section 508 standards (36 CFR Part 1194) and WCAG 2.1 Level AA.
Apply these rules to every document before committing.
| Requirement | Rule | Validation |
|---|---|---|
| Heading hierarchy | Never skip levels (H1βH2βH3, never H1βH3) | Manual review |
| Link text | Always descriptive β never "click here", "read more", "here", or "this link" | grep -i "click here|read more|\bhere\b|this link" |
| Table headers | Every table has a header row with |---| separator | Visual check |
| Image alt text | Every image has descriptive alt text  | grep -P "!\[\]\(" catches empty alt text |
| Mermaid diagrams | Require: text description before diagram, text-based alternative for screen readers, WCAG contrast-compliant colors | Manual review |
| Language complexity | Plain language preferred; Flesch-Kincaid grade level β€10 for contributor-facing docs | Optional: readable npm package |
Citations: [508CFR1194] β 36 CFR Part 1194 Section 508 Standards; [WCAG21] β WCAG 2.1 Level AA; MEMORY.md 508 Accessibility Compliance section.
6. Formatting Standardsβ
6.1 Headingsβ
- Title case for H1 only:
# Documentation Style Guide - Sentence case for H2βH4:
## Voice and tone,### When to use imperative - No punctuation at the end of headings
- No more than 4 levels of heading depth in any document
- Never use a heading solely for visual styling
Citation: [GoogleDevDocs] heading capitalization rules; [WritersGuide] heading case conventions.
6.2 Listsβ
- Unordered lists (
-) for items without inherent order - Ordered lists (
1.) for sequential steps only - No more than 2 levels of nesting
- Each item is a complete thought, ending without punctuation unless it is a full sentence
- Lists of 8 or more items: break into subsections
Citation: [MicrosoftMSTP] list formatting.
6.3 Code blocksβ
- Always specify the language:
```bash,```yaml,```markdown,```json - Command invocations always use
bashcode blocks - Inline code (backticks) for: file names, directory paths, command names, field names, flag names
- Never wrap multi-line code in inline code
Validation: grep -n '^\``$' [file]` β returns 0 for a clean file.
Citation: [GoogleDevDocs] code formatting.
6.4 Tablesβ
- Pipe-based markdown tables with a header separator row
- Left-aligned columns by default
- Keep table cells concise (15 words or fewer per cell)
- Provide a plain-text equivalent for complex tables when screen readers cannot parse them
Citation: [WCAG21] table accessibility; [GoogleDevDocs] table formatting.
6.5 Callout boxesβ
Callouts highlight important information. Two formats are supported depending on rendering context:
Format 1: Blockquote Syntax (GitHub-Compatible)β
Use blockquote syntax with a bold label. Works on GitHub and any markdown renderer.
> **Note:** Informational context the reader should know.
> **Tip:** Actionable optimization or shortcut.
> **Warning:** Risk of data loss or a breaking change.
> **Important:** A must-know requirement before proceeding.
When to use: Raw markdown files, GitHub previews, or when maximum compatibility is needed.
Format 2: Docusaurus Admonitionsβ
Use Docusaurus admonition syntax for richer styling on the documentation site.
:::note[Note]
Informational context the reader should know.
:::
:::tip[Pro Tip]
Actionable optimization or shortcut.
:::
:::warning[Common Pitfall]
Risk of data loss or a breaking change.
:::
:::danger[Important]
A must-know requirement before proceeding.
:::
:::info[For Your Information]
Additional context or related resources.
:::
When to use: Comprehensive documentation files (reference/command-guide.md, concepts/how-kmgraph-is-organized.md, GETTING-STARTED.md) where site rendering matters.
Guidelinesβ
- Reserved keywords: Note, Tip, Warning, Important, Info
- Do not place consecutive callout boxes without prose between them (either format)
- Use blockquotes for lessons learned and concise guides
- Use admonitions for main documentation sections and learning paths
- All callout text must include accompanying text β never rely on formatting alone to convey meaning (WCAG 2.1)
Citation: Google Dev Docs style guide, Docusaurus admonition support, WCAG 2.1 1.1.1 Non-text Content.
6.6 Emojis and badgesβ
- Difficulty badges (π’ Essential / π‘ Intermediate / π΄ Advanced) are permitted in command documentation only
- Emojis elsewhere: use only when they carry semantic meaning (β complete, β not supported); never for decoration
- Every emoji must have accompanying text β never rely on an emoji alone to convey meaning
Citation: [WCAG21] 1.1.1 Non-text Content β emojis must not be the sole conveyor of information.
7. Links and Cross-Referencesβ
7.1 Internal linksβ
- Use relative paths:
[Command Guide](reference/command-guide.md),[Pattern Writing Guide](pillars/capturing/capture-patterns.md) - Never use absolute file system paths (
/Users/β¦) - Every document must have a "Related Documentation" section linking to at least 2 other documents
- Cross-references should be bidirectional: if doc A links to doc B, doc B should link back to doc A
Citation: [GoogleDevDocs] cross-reference guidance; MEMORY.md project standards.
7.2 External linksβ
- Use descriptive link text that describes the destination, not the URL
- β
[Google Developer Documentation Style Guide](https://developers.google.com/style) - β
[https://developers.google.com/style](https://developers.google.com/style) - Open in the same tab (default markdown behavior)
Citation: [WCAG21] 2.4.4 Link Purpose.
7.3 Anchor linksβ
- Section IDs are auto-generated from heading text in GitHub-flavored markdown
- Reference with
#heading-text-kebab-case - Test all anchor links before committing:
npx markdown-link-check [file]
Citation: [GoogleDevDocs] anchor links.
8. Citations and Best-Practice Traceabilityβ
Every design decision in documentation must include a citation using the [CitationKey] notation defined in the Citation Keys table at the top of this guide.
8.1 When a citation is requiredβ
- Any structural decision (why this heading order, not another)
- Any voice or tone rule
- Any accessibility requirement
- Any formatting convention that differs from generic markdown defaults
8.2 When a citation is not requiredβ
- Code examples (these follow the behavior of the actual commands)
- Factual statements about the project itself (file paths, command names, dates)
8.3 Citation format in plan filesβ
**Citation**: `[Nielsen2015]` β Plain language reduces cognitive load 50%
8.4 Citation format in the style guide itselfβ
Include the citation inline at the end of the rule it supports:
> **Best practice**: Lead with outcomes before details. `[GoogleDevDocs]`
Or as a standalone line after the rule block:
**Citation**: `[GoogleDevDocs]` heading capitalization rules; `[WritersGuide]` heading case conventions.
Citation: MEMORY.md Best Practice Citations section.
9. Pre-Commit Checklistβ
Run this checklist before marking documentation complete or committing a new or updated document.
Voiceβ
- Voice matches document type (third-person or imperative per Section 2)
- No second-person pronouns in comprehensive docs:
grep -iE "\b(you|your|we|our)\b" [file] - Concrete nouns used instead of ambiguous pronouns where possible
Terminologyβ
- All terms match the Canonical Terminology table (Section 3)
- "GitHub Issue" used for platform issues, not bare "issue"
- Platform language correct: "Claude Code" vs "any LLM" vs "MCP"
Structureβ
- Page follows the correct pattern for its document type (Section 4)
- H1 exists and is unique; headings never skip levels
- Every section leads with an outcome statement, not a content description
Accessibilityβ
- No "click here" or bare-URL link text:
grep -i "click here\|read more\|\bhere\b" [file] - All tables have header rows
- All images have non-empty alt text:
grep -P "!\[\]\(" [file] - Any Mermaid diagram has a text description before it
Formattingβ
- All code blocks have a language specifier:
grep -n '^\``$' [file]` - File names and path names wrapped in inline code
- No absolute file system paths in prose:
grep "/Users/" [file] - H1 in title case; H2βH4 in sentence case
Linksβ
- All internal links use relative paths
- "Related Documentation" section present with at least 2 links
- Broken link check:
npx markdown-link-check [file]
Citationsβ
- Every structural, voice, or accessibility decision has a
[CitationKey]
10. Related Documentationβ
Authoring references:
- Concepts Guide β Canonical definitions of all terms used in this guide
- Command Reference β Example of the correct command page pattern in practice
- Getting Started β Example of the correct guide page pattern in practice
Templates:
- Lesson Template β Starting scaffold for Lesson Learned documents
- ADR Template β Starting scaffold for Architecture Decision Records
- Documentation Template β Starting scaffold for general documentation
Contributor workflows:
- Session Memory β Workflow for archiving and restoring context without Claude Code
Created: 2026-02-20 Version: 1.0 Applies to: v0.0.7-alpha and later
Wayfindingβ
Every pillar landing page and guide page that leads naturally to another skill must include a cross-pillar link.
Formatβ
Use a "What's next" or "Related" block at the bottom of any page that has a natural continuation:
## What's next
Ready to find what you captured? See [Recalling](../recalling/search-the-graph.md) β the point of capturing is finding it later.
Need to keep the graph tidy as it grows? See [Organizing](../organizing/personal-vs-project.md).
Rulesβ
- Every pillar landing links to at least 2 sibling pillars with a one-sentence reason β not just "see also."
- The reason must answer "why would I go there next?" β not just describe what the page covers.
- Reference pages (
reference/) are linked from pillar content but do not link back into the learning sequence. - Do not add wayfinding to reference pages.