一键导入
rai-epic-docs
Generate architecture docs and publish to Confluence. Use before epic close.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate architecture docs and publish to Confluence. Use before epic close.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| description | Generate architecture docs and publish to Confluence. Use before epic close. |
| allowed-tools | ["Read","Edit","Write","Grep","Glob","Bash(rai:*)"] |
| license | MIT |
| metadata | {"raise.adaptable":"true","raise.fase":"8.5","raise.frequency":"per-epic","raise.gate":"","raise.inputs":"- epic_scope: file_path, required\n- story_retrospectives: file_path[], required\n- confluence_space: string, required\n","raise.next":"rai-epic-close","raise.outputs":"- confluence_pages: url[], confluence\n","raise.prerequisites":"all stories complete","raise.version":"1.0.0","raise.visibility":"public","raise.work_cycle":"epic"} |
| name | rai-epic-docs |
Generate comprehensive developer and user-facing documentation for a completed epic. This skill ensures that every epic leaves behind documentation that maximizes reliability — not just "what was built" but "how it works, how to extend it, what can break, and how to diagnose it."
This skill runs before /rai-epic-close as a documentation gate.
When to use: After all stories are complete and merged, before /rai-epic-close.
When to skip: Never — documentation is a gate. Even XS epics get a minimal version.
Inputs: Epic scope document, story design/plan/retrospective artifacts, source code, existing Confluence space.
Gather all artifacts from the epic:
ls work/epics/e{N}-{name}/
ls work/epics/e{N}-{name}/stories/
Read:
scope.md) — stories, milestones, done criterias{N}.{M}-design.md) — decisions, integration pointss{N}.{M}-retrospective.md) — learnings, patternsgit log --oneline --name-only main..HEAD -- src/ | grep "\.py$" | sort -u
Determine epic size for documentation depth:
| Epic Size | Stories | Documentation |
|---|---|---|
| S (1-3 stories) | 1-3 | 1 Confluence page, sections can be brief |
| M (4-6 stories) | 4-6 | 1 Confluence page, full detail on all sections |
| L (7+ stories) | 7+ | 1 index page + child pages per subsystem |
Purpose: A developer understands the system by tracing one real operation end-to-end with concrete values.
Pick the most representative use case of the epic and trace it through every component with actual values:
Format:
## Worked Example: "{use case description}"
### Input
{concrete input with real values}
### Step 1: {component name}
{what happens, with actual intermediate values}
### Step 2: {component name}
{transformation, with actual values}
...
### Output
{final result with real values}
Diagram: Include an ASCII or Mermaid sequence diagram showing the component interactions.
A developer can follow the example and predict correct outputs for similar inputs.Purpose: A developer can add new functionality (new domain, new adapter, new node type) by following steps mechanically.
Document the extension point(s) this epic created:
Format:
## Extension Guide: How to Add a {extensible thing}
### Prerequisites
{what you need before starting}
### Step 1: {action}
File: `{path}`
{code snippet or config snippet}
### Step 2: {action}
...
### Verification
{commands to run to verify the extension works}
### Common Mistakes
- {mistake 1} → {consequence} → {fix}
A developer unfamiliar with the codebase can follow the guide and successfully extend the system.
Purpose: A developer can see at a glance where each transformation lives and which module to edit for a given change.
Create an end-to-end data flow showing:
Format: ASCII diagram in the document + Mermaid diagram if Confluence supports it.
## Data Flow
### Pipeline: {pipeline name}
{source} ({type})
↓ module.function()
{intermediate} ({type})
↓ module.function()
{output} ({type})
Every module mentioned in the diagram exists. Every type mentioned is a real class/model.
Purpose: A developer knows what MUST remain true for the system to work correctly. Violations of these invariants cause silent failures or bugs that manifest far from the source.
Read the source code and identify:
Format:
## Invariants & Contracts
### Data Invariants
- **INV-1:** {invariant description}
- Violated when: {scenario}
- Symptom: {what happens}
- Check: {how to verify}
### Protocol Contracts
- **CON-1:** {contract description}
...
### Value Ranges
- **RNG-1:** {range description}
...
Source: Derive these from:
Purpose: A developer encountering unexpected behavior can diagnose the root cause in minutes, not hours.
Document every known failure mode:
Sources for failure modes:
Format:
## Failure Mode Catalog
### FM-1: {symptom in developer's words}
- **Cause:** {root cause}
- **Diagnosis:** {command or check to confirm}
- **Fix:** {resolution steps}
### FM-2: {symptom}
...
Minimum failure modes to document:
Determine the page structure based on epic size:
S/M epic (1 page): Create a single page with all 5 sections under the epic's Confluence parent.
L epic (multi-page): Create an index page linking to child pages per subsystem.
Page title convention: E{N}: {Epic Name} — Developer Documentation
Parent page: Find the epic's Confluence space/parent. If none exists, use the governance section.
Publish via rai docs publish CLI command (routes to configured documentation target).
Present the documentation to the human for review:
| Condition | Action |
|---|---|
| Human approves | Continue to epic-close |
| Human requests changes | Update and re-publish |
| Human identifies missing failure modes | Add them — these are the most valuable |
| Item | Destination |
|---|---|
| Developer documentation | Confluence page(s) |
| Next | /rai-epic-close |
/rai-epic-close/rai-story-close completionswork/epics/e{N}-{name}/Interactive adapter setup for Jira and Confluence. Detects available backends, discovers projects/spaces, generates validated YAML config. 3-4 questions max.
Evaluate design proportionality using Beck's four rules. Use after implementation.
Root cause analysis using the method best suited to the bug. Phase 3 of bugfix pipeline.
Push branch, create MR, verify artifacts complete. Phase 7 of bugfix pipeline.
Execute fix tasks with TDD and all validation gates. Phase 5 of bugfix pipeline.
Decompose fix into atomic TDD tasks. Phase 4 of bugfix pipeline.