1---2name: feature-requirements-github-issues-129-163-1653description: After implementation, execute /zerg:document to update all documentation surfaces.4---5# Feature Requirements: GitHub Issues #129, #163, #16567## Metadata8- **Feature**: github-issues-129-163-1659- **Status**: APPROVED10- **Created**: 2026-02-0711- **Author**: Factory Plan Mode (Socratic)1213---1415## 1. Problem Statement1617### 1.1 Background18Three related issues affect ZERG's documentation and workflow quality:19- Issue #129: `/zerg:document` produces only terse reference docs. An educational tone was manually developed but must be applied by hand.20- Issue #163: `/z:plan` occasionally bypasses the plan->design->rush workflow and auto-implements, violating the strict phase boundaries.21- Issue #165: Neither `/z:plan` nor `/z:design` systematically track documentation impact, leading to features shipping without updated docs.2223### 1.2 Problem241. No automated way to generate educational-style documentation from `/zerg:document`252. Plan command lacks sufficient prompt-level guards against auto-implementation drift263. Documentation drift: features ship without CHANGELOG, README, wiki, or command reference updates2728### 1.3 Impact29- New users struggle with terse reference docs (no concept explanations, no diagrams)30- Workflow violations waste time and break the plan->design->rush contract31- Stale documentation erodes trust and creates confusion3233---3435## 2. Users3637### 2.1 Primary Users38- Developers using ZERG to parallelize Claude Code work39- Contributors modifying ZERG commands4041### 2.2 User Stories42- As a developer, I want `/zerg:document --tone educational` to auto-generate concept-first documentation so I don't have to manually rewrite reference docs43- As a user, I want `/z:plan` to never start implementing so the plan->design->rush workflow is respected44- As a contributor, I want `/z:plan` and `/z:design` to surface documentation impacts so docs stay current4546---4748## 3. Functional Requirements4950### 3.1 Core Capabilities5152| ID | Requirement | Priority | Issue |53|----|-------------|----------|-------|54| FR-001 | Add `--tone educational\|reference\|tutorial` flag to `/zerg:document` | Must | #129 |55| FR-002 | `educational` is the DEFAULT tone (not reference) | Must | #129 |56| FR-003 | Tone definitions stored as separate files at `zerg/data/tones/{tone}.md` | Must | #129 |57| FR-004 | Educational tone: every concept has CONCEPT, NARRATIVE, DIAGRAM, COMMAND sections | Must | #129 |58| FR-005 | Reference tone: terse tables and API signatures (current behavior) | Must | #129 |59| FR-006 | Tutorial tone: step-by-step walkthrough with simulated dialogues | Must | #129 |60| FR-007 | Add redundant anti-implementation guards to `plan.core.md` at 4 locations | Must | #163 |61| FR-008 | Plan terminal output: "PLANNING COMPLETE" banner with explicit EXIT statement | Must | #163 |62| FR-009 | Add Section 11 "Documentation Impact Analysis" to plan's requirements.md template | Must | #165 |63| FR-010 | Design command always generates CHANGELOG.md task in Level 5 quality phase | Must | #165 |64| FR-011 | Design command generates doc update tasks whenever command/flag functionality changes | Must | #165 |65| FR-012 | Update project documentation (README, wiki, command refs, CLAUDE.md) for this feature | Must | #165 |6667### 3.2 Inputs68- `--tone` flag value: `educational` (default), `reference`, `tutorial`69- Tone definition files: `zerg/data/tones/{tone}.md`7071### 3.3 Outputs72- Documentation generated in the specified tone style73- Plan requirements.md with Section 11 documentation impact analysis74- Design task-graph.json with mandatory doc/CHANGELOG tasks75- Updated project documentation reflecting all changes7677---7879## 4. Non-Functional Requirements8081### 4.1 Performance82- No performance impact — tone is a prompt-level directive, not a computational change8384### 4.2 Maintainability85- Tone definitions as separate files: adding a new tone = adding a file (no editing existing commands)86- `document.md` stays under 300-line split threshold8788### 4.3 Testing89- Unit tests for `--tone` flag parsing in `document.py`90- CI drift check via `validate_commands` for plan anti-implementation guards91- Verification commands for each task in the task graph9293---9495## 5. Scope9697### 5.1 In Scope98- `--tone` flag for `/zerg:document` with 3 tones99- 3 tone definition files (`educational.md`, `reference.md`, `tutorial.md`)100- Anti-implementation hardening of `plan.core.md` and `plan.md` (prompt-level only)101- Section 11 in plan's requirements.md template102- Mandatory doc task generation in design command103- Project documentation updates (README, wiki, command refs, CLAUDE.md)104- CHANGELOG.md entries105106### 5.2 Out of Scope107- Python-level enforcement of plan workflow boundaries (deferred)108- Tone content transformation engine (tone is prompt-level, not programmatic)109- Splitting `document.md` into core/details (stays under 300 lines)110111### 5.3 Assumptions112- `/zerg:document` is a Claude Code slash command where Claude has file access to read tone files113- Parent files (`plan.md`, `design.md`) must stay synchronized with their `.core.md` counterparts114115---116117## 6. Dependencies118119### 6.1 Internal Dependencies120| Dependency | Type | Status |121|------------|------|--------|122| `zerg/commands/document.py` | Modify | Exists |123| `zerg/data/commands/document.md` | Modify | Exists |124| `zerg/data/commands/plan.core.md` | Modify | Exists |125| `zerg/data/commands/plan.details.md` | Modify | Exists |126| `zerg/data/commands/design.core.md` | Modify | Exists |127| `.gsd/specs/documentation-tone-overhaul/requirements.md` | Reference | Approved |128129---130131## 7. Acceptance Criteria132133### 7.1 Definition of Done134- [ ] `--tone` flag accepted by `/zerg:document` with educational as default135- [ ] 3 tone definition files exist at `zerg/data/tones/`136- [ ] `plan.core.md` has anti-implementation guards at 4+ locations137- [ ] Plan terminal output shows "PLANNING COMPLETE" banner138- [ ] `plan.details.md` requirements template includes Section 11139- [ ] `design.core.md` has "Mandatory Documentation Tasks" subsection140- [ ] All unit tests pass141- [ ] `validate_commands` passes142- [ ] Project docs (README, wiki, command refs, CLAUDE.md) updated143- [ ] CHANGELOG.md updated144145### 7.2 Test Scenarios146147| ID | Scenario | Given | When | Then |148|----|----------|-------|------|------|149| TC-001 | Default tone | No --tone flag | Run /zerg:document | Educational tone used |150| TC-002 | Explicit reference | --tone reference | Run /zerg:document | Reference style output |151| TC-003 | Invalid tone | --tone bogus | Run /zerg:document | Click rejects with error |152| TC-004 | Plan guards | Run /z:plan | Requirements approved | No implementation occurs; "PLANNING COMPLETE" shown |153| TC-005 | Design doc tasks | Run /z:design | Task graph generated | CHANGELOG task present in Level 5 |154155---156157## 8. Open Questions158159None — all resolved through Socratic discovery rounds.160161---162163## 9. Approval164165| Role | Name | Date | Signature |166|------|------|------|-----------|167| Engineering | User | 2026-02-07 | APPROVED |168169---170171## 10. Documentation172173After implementation, execute `/zerg:document` to update all documentation surfaces.174175---176177## 11. Documentation Impact Analysis178179### 11.1 Files Requiring Documentation Updates180| File | Current State | Required Update | Priority |181|------|--------------|-----------------|----------|182| `CHANGELOG.md` | [Unreleased] section | Add entries for --tone flag, plan guards, doc impact analysis | Must |183| `README.md` | Shows `/zerg:document` without --tone | Add --tone flag to usage examples | Must |184| `docs/commands-quick.md` | Document flag table lacks --tone | Add --tone row | Must |185| `docs/commands-deep.md` | No tone documentation | Add --tone deep docs with tone descriptions | Must |186| `.gsd/wiki/Command-Reference.md` | Document entry lacks --tone | Update with --tone flag | Must |187| `.gsd/wiki/Tutorial.md` | Document examples lack tone | Update examples to mention tone | Should |188| `CLAUDE.md` | No doc impact analysis requirement | Document the new requirement for /z:plan and /z:design | Must |189190### 11.2 Documentation Tasks for Design Phase191- [x] CHANGELOG.md update task (ALWAYS required)192- [x] README.md update (new CLI flag)193- [x] Command reference updates (command/flag functionality changed)194- [x] CLAUDE.md update (new project convention)195- [x] Wiki updates (user-facing behavior changes)