From kai
Templates and rules for creating project documentation: PRDs, tech specs, and Architecture Decision Records (ADRs). Includes mermaid diagram patterns, folder structure conventions, and document lifecycle rules (create, update, refresh). Auto-activates when the user asks to document, create a PRD, write a spec, record a decision, update docs, compare docs to code, or uses the document command.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kai:doc-templatesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```markdown
# [Feature Name] — Product Requirements Document
**Status:** Draft | In Review | Approved | Superseded
**Owner:** [Name]
**Last updated:** YYYY-MM-DD
---
## Problem Statement
[1-3 sentences. What problem exists? Who has it? Why does it matter now?]
---
## Target Users
| User Type | Description | Frequency of Use |
|---|---|---|
| [Role] | [What they do] | [Daily / Weekly / Occasional] |
---
## User Journey
```mermaid
journey
title [Feature Name] — Core Flow
section [Step 1 Label]
[Action]: 5: User
section [Step 2 Label]
[Action]: 4: User, System
section [Step 3 Label]
[Action]: 5: User
| Feature | Reason Excluded |
|---|---|
| [Feature] | [Out of scope / too complex / future phase] |
| Metric | Baseline | Target | How Measured |
|---|---|---|---|
| [Metric name] | [Current] | [Goal] | [Tool / query] |
| Question | Owner | Due |
|---|---|---|
| [Question] | [Name] | [Date] |
---
## Tech Spec Template
```markdown
# [Feature Name] — Technical Specification
**Status:** Draft | In Review | Approved
**Last updated:** YYYY-MM-DD
**Source of truth:** Codebase (this doc describes as-built behavior)
---
## Overview
[2-4 sentences. What does this system do? What problem does it solve? What are the key design decisions?]
---
## Architecture
```mermaid
graph TD
Browser["Browser (Next.js)"]
Server["Server (API Routes)"]
DB["Database (PostgreSQL)"]
Google["Google APIs"]
Claude["Claude API"]
Browser --> Server
Server --> DB
Server --> Google
Server --> Claude
sequenceDiagram
participant U as User
participant C as Client
participant S as Server
participant D as Database
U->>C: [User action]
C->>S: [API request]
S->>D: [Query]
D-->>S: [Result]
S-->>C: [Response]
C-->>U: [UI update]
| Component | Location | Responsibility |
|---|---|---|
| [Component name] | src/path/to/file | [What it does] |
[Pseudocode — numbered steps describing the algorithm. NO code snippets.]
erDiagram
TABLE_A {
id uuid PK
name string
created_at timestamp
}
TABLE_B {
id uuid PK
table_a_id uuid FK
value string
}
TABLE_A ||--o{ TABLE_B : "has many"
| Method | Path | Auth | Request Body | Response |
|---|---|---|---|---|
| GET | /api/[resource] | Required | — | { data: [...] } |
| POST | /api/[resource] | Required | { field: value } | { id, ...fields } |
| PATCH | /api/[resource]/:id | Required | { field: value } | { id, ...fields } |
| DELETE | /api/[resource]/:id | Required | — | { success: true } |
| Variable | Required | Description |
|---|---|---|
VARIABLE_NAME | Yes | [What it's for, where to get it] |
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| [Risk description] | Low / Med / High | Low / Med / High | [How we handle it] |
---
## ADR Template
```markdown
# ADR-NNN: [Decision Title]
**Status:** Accepted | Superseded by ADR-NNN
**Date:** YYYY-MM-DD
**Deciders:** [Names or roles]
---
## Context
[1-3 sentences. What situation forced this decision? What constraints existed?]
---
## Decision
[1-2 sentences. Exactly what was decided.]
---
## Reasoning
[3-5 bullet points explaining why this option was chosen over alternatives.]
- [Reason 1]
- [Reason 2]
- [Reason 3]
---
## Alternatives Considered
| Option | Pros | Cons | Why Not Chosen |
|---|---|---|---|
| [Option A] | [Pros] | [Cons] | [Reason] |
| [Option B] | [Pros] | [Cons] | [Reason] |
---
## Consequences
**Positive:**
- [Good outcome 1]
- [Good outcome 2]
**Negative:**
- [Trade-off 1]
- [Trade-off 2]
project/docs/
├── PRD.md
├── TECH-SPEC.md
└── decisions/
├── 001-database-choice.md
└── 002-auth-strategy.md
| Document | How to Update | Source of Truth |
|---|---|---|
| PRD | Trust user's stated change directly. No code verification needed. | User (intent document) |
| Tech Spec | Verify against codebase before editing. Update to reflect as-built reality. | Codebase (as-built) |
| ADR | NEVER modify. Create a new superseding ADR and mark old one "Superseded by ADR-NNN". | Historical record |
npx claudepluginhub mosaic-wellness/ai-toolkit --plugin kaiGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.