Overview
Every Silver Bullet project gets a documentation architecture scaffolded by /silver:init. The scheme is designed around three principles:
- Docs are artifacts, not afterthoughts — every document is produced by a specific workflow step and reviewed by the artifact reviewer framework
- No doc grows unbounded — every file uses one of five scalability patterns with enforced size caps
- Separation of concerns — planning artifacts (
.planning/) are ephemeral per-milestone; project docs (docs/) are durable across milestones
docs/doc-scheme.md file with the full reference. This page explains the concepts behind it.Three Layers
Documentation lives in three distinct layers, each with its own audience and lifespan:
Planning — .planning/
Specs, plans, reviews, verification reports. Created and consumed during the SDLC. Archived automatically on milestone completion. Managed by SB.
Project Docs — docs/
Architecture, testing strategy, changelog, knowledge, learnings. Durable across milestones. Updated during the Documentation step of every task finalization.
Public — README.md
Project overview for external readers. Updated during finalization and release.
Scalability Patterns
Every growing document uses one of these bounded patterns to prevent unbounded file growth:
| Pattern | How It Works | Example |
|---|---|---|
| Snapshot | Overwritten each milestone; previous version archived | ARCHITECTURE.md, STATE.md |
| Capped Table | Max N rows; oldest archived when exceeded | CHANGELOG.md (50 entries), quick tasks (20 rows) |
| Rotation | File archived at line threshold; fresh file started | REVIEW-ROUNDS.md (200 lines) |
| Summary + Archive | Only current content inline; older collapsed to links | ROADMAP.md, PROJECT.md |
| Fixed | Structurally bounded by nature — never grows | TESTING.md, per-phase artifacts |
Core Files
These files are scaffolded by /silver:init and form the backbone of your project documentation:
| File | Purpose | Scalability |
|---|---|---|
ARCHITECTURE.md | Component model, layers, data flow, design principles | Snapshot |
TESTING.md | Test pyramid, coverage goals, test classification | Fixed |
CHANGELOG.md | Rolling task log — what, commits, skills, cost | Capped (50) |
knowledge/INDEX.md | Gateway index of all project docs | Fixed |
doc-scheme.md | Documentation architecture reference (this scheme) | Fixed |
Knowledge & Learnings
Project intelligence is split into two directories to separate project-specific knowledge from portable learnings.
docs/knowledge/ — Project-Scoped Intelligence
Things learned about this project: architecture patterns discovered, gotchas encountered, key decisions made, recurring patterns, and open questions. Not redundant with ARCHITECTURE.md (which captures current state, not journey) or phase CONTEXT.md files (which are single-phase and archived).
- File convention:
YYYY-MM.md— one file per month, append-only within that month, frozen after - Categories: Architecture Patterns, Known Gotchas, Key Decisions, Recurring Patterns, Open Questions
- Gateway:
knowledge/INDEX.mdlists all project docs with paths and purposes
docs/learnings/ — Portable Learnings
General learnings applicable beyond this project. Written as if explaining to someone who has never seen this codebase. No project-specific file paths, feature names, or requirement IDs.
- File convention:
YYYY-MM.md— same monthly segmentation - Category taxonomy:
| Prefix | Covers | Example |
|---|---|---|
domain: | Business domain learnings | Regulations, patterns, terminology |
stack: | Language/framework/tool | Bash quirks, React patterns |
practice: | Software engineering | Config management, testing strategy |
devops: | CI, deployment, infra | Pipeline design, monitoring |
design: | UI, UX, accessibility | Component patterns, responsive layout |
knowledge/ instead.Graphify Retrieval
Graphify is Silver Bullet's preferred project-memory retrieval layer. After /silver:init, SB expects Graphify to be available so agents can query the local knowledge graph before work that benefits from project context: planning, editing, debugging, review, documentation, shipping, and release.
The no-key refresh path builds a local graph from the repository without semantic LLM extraction:
Agents should query with concrete task and file context, then inspect the returned nodes before acting. Broad words can match workflow or documentation nodes first, so the useful query usually names the current file, hook, skill, or artifact type.
If Graphify is missing, stale, or returns no relevant context, SB falls back to direct reads of docs/knowledge/INDEX.md, the current monthly docs/knowledge/YYYY-MM.md, the current monthly docs/learnings/YYYY-MM.md, and any directly referenced project docs. That fallback is degraded behavior: it preserves correctness, but Graphify remains the required default for SB-activated projects.
graphify-out/ and raw/ are generated local state and are ignored by default. Full semantic extraction and optional surfaces such as MCP or database-backed storage can be enabled separately when the project has the required keys and services.
Token Compression (RTK + Context Mode)
RTK (recommended_tools.rtk) compresses shell command output via upstream PreToolUse hooks once rtk-ai/rtk is installed and wired. Context Mode (recommended_tools.context_mode) compacts MCP results and recovers session state across compaction; it is ELv2-licensed and highest value with MCP-heavy workflows.
Both tools are separate opt-ins from Graphify and agentmemory. SB install gates verify CLI and host wiring; usage rules (when to use ctx_* vs Read) live in silver-bullet.md §2g-ii. Verify with bash scripts/enable-rtk-context-mode.sh. See docs/RTK.md and docs/CONTEXT-MODE.md.
Optional Files
Created when your project needs them — not scaffolded by default:
| File | When to Create |
|---|---|
CICD.md | CI/CD pipeline exists |
API.md | First API endpoint |
DEPLOYMENT.md | First deployment |
SECURITY.md | After security audit |
CONTRIBUTING.md | Multi-contributor project |
ADR/ | Significant architecture decisions |
Size Caps
Every document has an enforced growth limit. The artifact reviewer flags violations during review rounds.
| Location | Cap | If Exceeded |
|---|---|---|
docs/*.md | 500 lines | Artifact reviewer flags for splitting |
docs/knowledge/*.md | 300 lines | Split into YYYY-MM-a.md / YYYY-MM-b.md |
docs/learnings/*.md | 300 lines | Split into YYYY-MM-a.md / YYYY-MM-b.md |
.planning/ active files | 300 lines | Milestone completion archives and resets |
When Docs Update
| Event | What Updates |
|---|---|
| Every task (finalization step) | CHANGELOG.md, knowledge/YYYY-MM.md, learnings/YYYY-MM.md |
| Architecture changes | ARCHITECTURE.md (rewritten) |
| Test infrastructure changes | TESTING.md |
| Docs added or removed | knowledge/INDEX.md |
| Milestone completion | Planning artifacts archived; tables trimmed |
| Release | README.md, root CHANGELOG.md |
Non-Redundancy Rules
Silver Bullet enforces strict non-redundancy across all documentation layers:
.planning/artifacts are the source of truth during active development —docs/files are derived summariesknowledge/captures intelligence not derivable from code or git historylearnings/captures portable learnings — never duplicates project-specific knowledgeARCHITECTURE.mdis high-level design only — detailed phase designs stay in.planning/phases/CHANGELOG.mdis the task log — git log is the commit log (different granularity, no overlap)
.planning/REQUIREMENTS.md, don't copy it into docs/. Reference it. If a learning applies beyond this project, put it in learnings/, not knowledge/. The artifact reviewer checks for cross-document duplication.AF-DOCUMENT and the workflow tracker
In Silver Bullet's v0.48.3 APO architecture, documentation maps to catalog atomic flows, durable project docs, and the per-instance workflow tracker:
AF-DOCUMENT— runs when durable documentation, handoff, content, retro, or knowledge-capture evidence is required. Steps includesilver:ensure-docs, technical debt capture when needed, SB milestone summary when needed, conversation memory capture when available, and SB session reporting when needed.- Per-instance workflow tracker — the real-time state tracking artifact for an active composition. Created when a composition begins, updated after every path completes. Records selected catalog atoms, completed paths, deferred improvements, dynamic insertions, V-loop/evidence status, and the full composition plan. Unlike the three-layer documentation scheme (which is project-level and durable),
.planning/workflows/<id>.mdis composition-level and ephemeral — it exists for the duration of the current chain. The retired single-fileWORKFLOW.mdmodel is legacy only.
AF-DOCUMENT is what populates the project-level docs described in this page. The per-instance workflow tracker gives visibility into the ongoing composition before durable docs are updated.
See Also
- Composable Workflow Orchestration —
AF-DOCUMENTin the canonical APO catalog and the per-instance workflow tracker - Core Concepts — skills, hooks, enforcement layers, and the full mental model
- Verification Before Completion — how silver:verify enforces quality gates
- Dev Workflow — the full development cycle, including the Documentation finalization step