raise-cli 2.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. raise_cli/__init__.py +38 -0
  2. raise_cli/__main__.py +30 -0
  3. raise_cli/adapters/__init__.py +91 -0
  4. raise_cli/adapters/declarative/__init__.py +26 -0
  5. raise_cli/adapters/declarative/adapter.py +267 -0
  6. raise_cli/adapters/declarative/discovery.py +94 -0
  7. raise_cli/adapters/declarative/expressions.py +150 -0
  8. raise_cli/adapters/declarative/reference/__init__.py +1 -0
  9. raise_cli/adapters/declarative/reference/github.yaml +143 -0
  10. raise_cli/adapters/declarative/schema.py +98 -0
  11. raise_cli/adapters/filesystem.py +299 -0
  12. raise_cli/adapters/mcp_bridge.py +10 -0
  13. raise_cli/adapters/mcp_confluence.py +246 -0
  14. raise_cli/adapters/mcp_jira.py +405 -0
  15. raise_cli/adapters/models.py +205 -0
  16. raise_cli/adapters/protocols.py +180 -0
  17. raise_cli/adapters/registry.py +90 -0
  18. raise_cli/adapters/sync.py +149 -0
  19. raise_cli/agents/__init__.py +14 -0
  20. raise_cli/agents/antigravity.yaml +8 -0
  21. raise_cli/agents/claude.yaml +8 -0
  22. raise_cli/agents/copilot.yaml +8 -0
  23. raise_cli/agents/copilot_plugin.py +124 -0
  24. raise_cli/agents/cursor.yaml +7 -0
  25. raise_cli/agents/roo.yaml +8 -0
  26. raise_cli/agents/windsurf.yaml +8 -0
  27. raise_cli/artifacts/__init__.py +30 -0
  28. raise_cli/artifacts/models.py +43 -0
  29. raise_cli/artifacts/reader.py +55 -0
  30. raise_cli/artifacts/renderer.py +104 -0
  31. raise_cli/artifacts/story_design.py +69 -0
  32. raise_cli/artifacts/writer.py +45 -0
  33. raise_cli/backlog/__init__.py +1 -0
  34. raise_cli/backlog/sync.py +115 -0
  35. raise_cli/cli/__init__.py +3 -0
  36. raise_cli/cli/commands/__init__.py +3 -0
  37. raise_cli/cli/commands/_resolve.py +153 -0
  38. raise_cli/cli/commands/adapters.py +362 -0
  39. raise_cli/cli/commands/artifact.py +137 -0
  40. raise_cli/cli/commands/backlog.py +333 -0
  41. raise_cli/cli/commands/base.py +31 -0
  42. raise_cli/cli/commands/discover.py +551 -0
  43. raise_cli/cli/commands/docs.py +130 -0
  44. raise_cli/cli/commands/doctor.py +177 -0
  45. raise_cli/cli/commands/gate.py +223 -0
  46. raise_cli/cli/commands/graph.py +1086 -0
  47. raise_cli/cli/commands/info.py +81 -0
  48. raise_cli/cli/commands/init.py +746 -0
  49. raise_cli/cli/commands/journal.py +167 -0
  50. raise_cli/cli/commands/mcp.py +524 -0
  51. raise_cli/cli/commands/memory.py +467 -0
  52. raise_cli/cli/commands/pattern.py +348 -0
  53. raise_cli/cli/commands/profile.py +59 -0
  54. raise_cli/cli/commands/publish.py +80 -0
  55. raise_cli/cli/commands/release.py +338 -0
  56. raise_cli/cli/commands/session.py +528 -0
  57. raise_cli/cli/commands/signal.py +410 -0
  58. raise_cli/cli/commands/skill.py +350 -0
  59. raise_cli/cli/commands/skill_set.py +145 -0
  60. raise_cli/cli/error_handler.py +158 -0
  61. raise_cli/cli/main.py +163 -0
  62. raise_cli/compat.py +66 -0
  63. raise_cli/config/__init__.py +41 -0
  64. raise_cli/config/agent_plugin.py +105 -0
  65. raise_cli/config/agent_registry.py +233 -0
  66. raise_cli/config/agents.py +120 -0
  67. raise_cli/config/ide.py +32 -0
  68. raise_cli/config/paths.py +379 -0
  69. raise_cli/config/settings.py +180 -0
  70. raise_cli/context/__init__.py +42 -0
  71. raise_cli/context/analyzers/__init__.py +16 -0
  72. raise_cli/context/analyzers/models.py +36 -0
  73. raise_cli/context/analyzers/protocol.py +43 -0
  74. raise_cli/context/analyzers/python.py +292 -0
  75. raise_cli/context/builder.py +1569 -0
  76. raise_cli/context/diff.py +213 -0
  77. raise_cli/context/extractors/__init__.py +13 -0
  78. raise_cli/context/extractors/skills.py +121 -0
  79. raise_cli/core/__init__.py +37 -0
  80. raise_cli/core/files.py +66 -0
  81. raise_cli/core/text.py +174 -0
  82. raise_cli/core/tools.py +441 -0
  83. raise_cli/discovery/__init__.py +50 -0
  84. raise_cli/discovery/analyzer.py +691 -0
  85. raise_cli/discovery/drift.py +355 -0
  86. raise_cli/discovery/scanner.py +1687 -0
  87. raise_cli/doctor/__init__.py +4 -0
  88. raise_cli/doctor/checks/__init__.py +1 -0
  89. raise_cli/doctor/checks/environment.py +110 -0
  90. raise_cli/doctor/checks/project.py +238 -0
  91. raise_cli/doctor/fix.py +80 -0
  92. raise_cli/doctor/models.py +56 -0
  93. raise_cli/doctor/protocol.py +43 -0
  94. raise_cli/doctor/registry.py +100 -0
  95. raise_cli/doctor/report.py +141 -0
  96. raise_cli/doctor/runner.py +95 -0
  97. raise_cli/engines/__init__.py +3 -0
  98. raise_cli/exceptions.py +215 -0
  99. raise_cli/gates/__init__.py +19 -0
  100. raise_cli/gates/builtin/__init__.py +1 -0
  101. raise_cli/gates/builtin/coverage.py +52 -0
  102. raise_cli/gates/builtin/lint.py +48 -0
  103. raise_cli/gates/builtin/tests.py +48 -0
  104. raise_cli/gates/builtin/types.py +48 -0
  105. raise_cli/gates/models.py +40 -0
  106. raise_cli/gates/protocol.py +41 -0
  107. raise_cli/gates/registry.py +141 -0
  108. raise_cli/governance/__init__.py +11 -0
  109. raise_cli/governance/extractor.py +412 -0
  110. raise_cli/governance/models.py +134 -0
  111. raise_cli/governance/parsers/__init__.py +35 -0
  112. raise_cli/governance/parsers/_convert.py +38 -0
  113. raise_cli/governance/parsers/adr.py +274 -0
  114. raise_cli/governance/parsers/backlog.py +356 -0
  115. raise_cli/governance/parsers/constitution.py +119 -0
  116. raise_cli/governance/parsers/epic.py +323 -0
  117. raise_cli/governance/parsers/glossary.py +316 -0
  118. raise_cli/governance/parsers/guardrails.py +345 -0
  119. raise_cli/governance/parsers/prd.py +112 -0
  120. raise_cli/governance/parsers/roadmap.py +118 -0
  121. raise_cli/governance/parsers/vision.py +116 -0
  122. raise_cli/graph/__init__.py +1 -0
  123. raise_cli/graph/backends/__init__.py +57 -0
  124. raise_cli/graph/backends/api.py +137 -0
  125. raise_cli/graph/backends/dual.py +139 -0
  126. raise_cli/graph/backends/pending.py +84 -0
  127. raise_cli/handlers/__init__.py +3 -0
  128. raise_cli/hooks/__init__.py +54 -0
  129. raise_cli/hooks/builtin/__init__.py +1 -0
  130. raise_cli/hooks/builtin/backlog.py +216 -0
  131. raise_cli/hooks/builtin/gate_bridge.py +83 -0
  132. raise_cli/hooks/builtin/jira_sync.py +127 -0
  133. raise_cli/hooks/builtin/memory.py +117 -0
  134. raise_cli/hooks/builtin/telemetry.py +72 -0
  135. raise_cli/hooks/emitter.py +184 -0
  136. raise_cli/hooks/events.py +262 -0
  137. raise_cli/hooks/protocol.py +38 -0
  138. raise_cli/hooks/registry.py +117 -0
  139. raise_cli/mcp/__init__.py +33 -0
  140. raise_cli/mcp/bridge.py +218 -0
  141. raise_cli/mcp/models.py +43 -0
  142. raise_cli/mcp/registry.py +77 -0
  143. raise_cli/mcp/schema.py +41 -0
  144. raise_cli/memory/__init__.py +58 -0
  145. raise_cli/memory/loader.py +247 -0
  146. raise_cli/memory/migration.py +241 -0
  147. raise_cli/memory/models.py +169 -0
  148. raise_cli/memory/writer.py +598 -0
  149. raise_cli/onboarding/__init__.py +103 -0
  150. raise_cli/onboarding/bootstrap.py +324 -0
  151. raise_cli/onboarding/claudemd.py +17 -0
  152. raise_cli/onboarding/conventions.py +742 -0
  153. raise_cli/onboarding/detection.py +374 -0
  154. raise_cli/onboarding/governance.py +443 -0
  155. raise_cli/onboarding/instructions.py +672 -0
  156. raise_cli/onboarding/manifest.py +201 -0
  157. raise_cli/onboarding/memory_md.py +399 -0
  158. raise_cli/onboarding/migration.py +207 -0
  159. raise_cli/onboarding/profile.py +624 -0
  160. raise_cli/onboarding/skill_conflict.py +100 -0
  161. raise_cli/onboarding/skill_manifest.py +176 -0
  162. raise_cli/onboarding/skills.py +437 -0
  163. raise_cli/onboarding/workflows.py +101 -0
  164. raise_cli/output/__init__.py +28 -0
  165. raise_cli/output/console.py +394 -0
  166. raise_cli/output/formatters/__init__.py +9 -0
  167. raise_cli/output/formatters/adapters.py +135 -0
  168. raise_cli/output/formatters/discover.py +439 -0
  169. raise_cli/output/formatters/skill.py +298 -0
  170. raise_cli/publish/__init__.py +3 -0
  171. raise_cli/publish/changelog.py +80 -0
  172. raise_cli/publish/check.py +179 -0
  173. raise_cli/publish/version.py +172 -0
  174. raise_cli/rai_base/__init__.py +22 -0
  175. raise_cli/rai_base/framework/__init__.py +7 -0
  176. raise_cli/rai_base/framework/methodology.yaml +233 -0
  177. raise_cli/rai_base/governance/__init__.py +1 -0
  178. raise_cli/rai_base/governance/architecture/__init__.py +1 -0
  179. raise_cli/rai_base/governance/architecture/domain-model.md +20 -0
  180. raise_cli/rai_base/governance/architecture/system-context.md +34 -0
  181. raise_cli/rai_base/governance/architecture/system-design.md +24 -0
  182. raise_cli/rai_base/governance/backlog.md +8 -0
  183. raise_cli/rai_base/governance/guardrails.md +17 -0
  184. raise_cli/rai_base/governance/prd.md +25 -0
  185. raise_cli/rai_base/governance/vision.md +16 -0
  186. raise_cli/rai_base/identity/__init__.py +8 -0
  187. raise_cli/rai_base/identity/core.md +119 -0
  188. raise_cli/rai_base/identity/perspective.md +119 -0
  189. raise_cli/rai_base/memory/__init__.py +7 -0
  190. raise_cli/rai_base/memory/patterns-base.jsonl +55 -0
  191. raise_cli/schemas/__init__.py +3 -0
  192. raise_cli/schemas/journal.py +49 -0
  193. raise_cli/schemas/session_state.py +117 -0
  194. raise_cli/session/__init__.py +5 -0
  195. raise_cli/session/bundle.py +820 -0
  196. raise_cli/session/close.py +268 -0
  197. raise_cli/session/journal.py +119 -0
  198. raise_cli/session/resolver.py +126 -0
  199. raise_cli/session/state.py +187 -0
  200. raise_cli/skills/__init__.py +44 -0
  201. raise_cli/skills/locator.py +141 -0
  202. raise_cli/skills/name_checker.py +199 -0
  203. raise_cli/skills/parser.py +145 -0
  204. raise_cli/skills/scaffold.py +212 -0
  205. raise_cli/skills/schema.py +132 -0
  206. raise_cli/skills/skillsets.py +195 -0
  207. raise_cli/skills/validator.py +197 -0
  208. raise_cli/skills_base/__init__.py +80 -0
  209. raise_cli/skills_base/contract-template.md +60 -0
  210. raise_cli/skills_base/preamble.md +37 -0
  211. raise_cli/skills_base/rai-architecture-review/SKILL.md +137 -0
  212. raise_cli/skills_base/rai-debug/SKILL.md +171 -0
  213. raise_cli/skills_base/rai-discover/SKILL.md +167 -0
  214. raise_cli/skills_base/rai-discover-document/SKILL.md +128 -0
  215. raise_cli/skills_base/rai-discover-scan/SKILL.md +147 -0
  216. raise_cli/skills_base/rai-discover-start/SKILL.md +145 -0
  217. raise_cli/skills_base/rai-discover-validate/SKILL.md +142 -0
  218. raise_cli/skills_base/rai-docs-update/SKILL.md +142 -0
  219. raise_cli/skills_base/rai-doctor/SKILL.md +120 -0
  220. raise_cli/skills_base/rai-epic-close/SKILL.md +165 -0
  221. raise_cli/skills_base/rai-epic-close/templates/retrospective.md +68 -0
  222. raise_cli/skills_base/rai-epic-design/SKILL.md +146 -0
  223. raise_cli/skills_base/rai-epic-design/templates/design.md +24 -0
  224. raise_cli/skills_base/rai-epic-design/templates/scope.md +76 -0
  225. raise_cli/skills_base/rai-epic-plan/SKILL.md +153 -0
  226. raise_cli/skills_base/rai-epic-plan/_references/sequencing-strategies.md +67 -0
  227. raise_cli/skills_base/rai-epic-plan/templates/plan-section.md +49 -0
  228. raise_cli/skills_base/rai-epic-run/SKILL.md +208 -0
  229. raise_cli/skills_base/rai-epic-start/SKILL.md +136 -0
  230. raise_cli/skills_base/rai-epic-start/templates/brief.md +34 -0
  231. raise_cli/skills_base/rai-mcp-add/SKILL.md +176 -0
  232. raise_cli/skills_base/rai-mcp-remove/SKILL.md +120 -0
  233. raise_cli/skills_base/rai-mcp-status/SKILL.md +147 -0
  234. raise_cli/skills_base/rai-problem-shape/SKILL.md +138 -0
  235. raise_cli/skills_base/rai-project-create/SKILL.md +144 -0
  236. raise_cli/skills_base/rai-project-onboard/SKILL.md +162 -0
  237. raise_cli/skills_base/rai-quality-review/SKILL.md +189 -0
  238. raise_cli/skills_base/rai-research/SKILL.md +143 -0
  239. raise_cli/skills_base/rai-research/references/research-prompt-template.md +317 -0
  240. raise_cli/skills_base/rai-session-close/SKILL.md +176 -0
  241. raise_cli/skills_base/rai-session-start/SKILL.md +110 -0
  242. raise_cli/skills_base/rai-story-close/SKILL.md +198 -0
  243. raise_cli/skills_base/rai-story-design/SKILL.md +203 -0
  244. raise_cli/skills_base/rai-story-design/references/tech-design-story-v2.md +293 -0
  245. raise_cli/skills_base/rai-story-implement/SKILL.md +115 -0
  246. raise_cli/skills_base/rai-story-plan/SKILL.md +135 -0
  247. raise_cli/skills_base/rai-story-review/SKILL.md +178 -0
  248. raise_cli/skills_base/rai-story-run/SKILL.md +282 -0
  249. raise_cli/skills_base/rai-story-start/SKILL.md +166 -0
  250. raise_cli/skills_base/rai-story-start/templates/story.md +38 -0
  251. raise_cli/skills_base/rai-welcome/SKILL.md +134 -0
  252. raise_cli/telemetry/__init__.py +42 -0
  253. raise_cli/telemetry/schemas.py +285 -0
  254. raise_cli/telemetry/writer.py +217 -0
  255. raise_cli/tier/__init__.py +0 -0
  256. raise_cli/tier/context.py +134 -0
  257. raise_cli/viz/__init__.py +7 -0
  258. raise_cli/viz/generator.py +406 -0
  259. raise_cli-2.2.1.dist-info/METADATA +433 -0
  260. raise_cli-2.2.1.dist-info/RECORD +264 -0
  261. raise_cli-2.2.1.dist-info/WHEEL +4 -0
  262. raise_cli-2.2.1.dist-info/entry_points.txt +40 -0
  263. raise_cli-2.2.1.dist-info/licenses/LICENSE +190 -0
  264. raise_cli-2.2.1.dist-info/licenses/NOTICE +4 -0
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: rai-discover-validate
3
+ description: >
4
+ Validate component descriptions using confidence-tier workflow.
5
+ Auto-validates high-confidence, batch-reviews medium by module,
6
+ flags low for individual human review.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: discovery
12
+ raise.frequency: per-project
13
+ raise.fase: "3"
14
+ raise.prerequisites: discover-scan
15
+ raise.next: ""
16
+ raise.gate: ""
17
+ raise.adaptable: "true"
18
+ raise.version: "3.0.0"
19
+ raise.visibility: public
20
+ ---
21
+
22
+ # Discovery Validate
23
+
24
+ > **Deprecated:** Use `/rai-discover` instead, which runs the full pipeline (detect → extract → describe → document → build) in one pass. This skill is kept for backward compatibility.
25
+
26
+ ## Purpose
27
+
28
+ Validate component descriptions using a confidence-tier workflow that reduces human decisions from O(components) to O(modules + exceptions).
29
+
30
+ ## Mastery Levels (ShuHaRi)
31
+
32
+ - **Shu**: Follow all steps, review each tier in order
33
+ - **Ha**: Trust high-confidence auto-validation; focus on medium/low
34
+ - **Ri**: Tune confidence thresholds for domain-specific projects
35
+
36
+ ## Context
37
+
38
+ **When to use:** After `/rai-discover-scan` has created `work/discovery/analysis.json`.
39
+
40
+ **When to skip:** All components already validated, or no `analysis.json` exists.
41
+
42
+ **Inputs:** `work/discovery/analysis.json`, `work/discovery/components-draft.yaml`.
43
+
44
+ ## Steps
45
+
46
+ ### Step 1: Load & Present Overview
47
+
48
+ ```markdown
49
+ ## Validation Overview
50
+ **Components:** {total}
51
+ - High confidence (auto-validate): {N} ({%})
52
+ - Medium confidence (module batch): {N} ({%})
53
+ - Low confidence (individual review): {N} ({%})
54
+ **Estimated human decisions:** ~{medium_modules + low_count}
55
+ ```
56
+
57
+ <verification>
58
+ Analysis loaded with confidence tiers.
59
+ </verification>
60
+
61
+ ### Step 2: Auto-Validate High Confidence (≥70)
62
+
63
+ Use `auto_purpose` and `auto_category` directly. Set `validated: true, validated_by: auto`.
64
+
65
+ Ask user: "Auto-validate {N} high-confidence components? [Approve all / Review individually]"
66
+
67
+ <verification>
68
+ High-confidence components marked validated.
69
+ </verification>
70
+
71
+ ### Step 3: Batch Review Medium Confidence (40-69)
72
+
73
+ For each module group from `analysis.json`:
74
+
75
+ | # | Name | Kind | Category | Purpose | Score |
76
+ |---|------|------|----------|---------|-------|
77
+ | 1 | {name} | {kind} | {auto_category} | {purpose} | {score} |
78
+
79
+ Ask per module: "Approve batch? [Approve all / Edit specific / Skip module]"
80
+
81
+ For C#/large projects with single-file modules: group by namespace prefix instead.
82
+
83
+ <verification>
84
+ Module batches processed.
85
+ </verification>
86
+
87
+ ### Step 4: Handle Low Confidence (<40)
88
+
89
+ **Scale gate:** If all components are low AND count >50, offer alternative modes:
90
+
91
+ | Mode | Best for | Strategy |
92
+ |------|----------|----------|
93
+ | A: By layer | Clean Architecture / CQRS | Group by top-level namespace, approve per layer |
94
+ | B: Key components | Large infra-heavy codebases | User nominates 10-20 key components, bulk-skip rest |
95
+ | C: Naming pattern | Consistent suffix patterns | Auto-accept by pattern (`*Handler`, `*Repository`) |
96
+
97
+ Otherwise, review individually — present file, signature, signals, ask: Approve / Edit / Skip.
98
+
99
+ <verification>
100
+ Low-confidence components reviewed or alternative mode applied.
101
+ </verification>
102
+
103
+ ### Step 5: Export & Save
104
+
105
+ 1. Update `components-draft.yaml` with validation states
106
+ 2. Export validated components to `work/discovery/components-validated.json` (graph node format)
107
+ 3. Update `work/discovery/context.yaml` status to `complete`
108
+
109
+ **Graph node format:**
110
+ ```json
111
+ {"id": "comp-scanner-symbol", "type": "component", "content": "purpose",
112
+ "source_file": "path", "metadata": {"name": "...", "kind": "...", "validated_by": "..."}}
113
+ ```
114
+
115
+ Present summary: total, auto-validated, batch-reviewed, individual, skipped, decision reduction %.
116
+
117
+ <verification>
118
+ `components-validated.json` created. Context status updated.
119
+ </verification>
120
+
121
+ ## Output
122
+
123
+ | Item | Destination |
124
+ |------|-------------|
125
+ | Updated draft | `work/discovery/components-draft.yaml` |
126
+ | Validated catalog | `work/discovery/components-validated.json` |
127
+ | Next | `rai graph build` or `/rai-discover-document` |
128
+
129
+ ## Quality Checklist
130
+
131
+ - [ ] High-confidence auto-validation approved by user before proceeding
132
+ - [ ] Medium batches presented with full context (module, category, purpose)
133
+ - [ ] Scale gate checked before attempting O(components) individual review
134
+ - [ ] Export uses graph node format (id, type, content, source_file, metadata)
135
+ - [ ] NEVER skip the scale gate for all-low scenarios (>50 components)
136
+
137
+ ## References
138
+
139
+ - Previous: `/rai-discover-scan`
140
+ - Next: `rai graph build` or `/rai-discover-document`
141
+ - CLI: `rai discover analyze --help`
142
+ - Confidence tiers: high ≥70, medium 40-69, low <40
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: rai-docs-update
3
+ description: >
4
+ Compare knowledge graph against module architecture docs and update
5
+ drifted fields. Deterministic frontmatter comparison using existing
6
+ rai graph commands, with inference for narrative sections. HITL
7
+ before any writes.
8
+
9
+ license: MIT
10
+
11
+ metadata:
12
+ raise.work_cycle: utility
13
+ raise.frequency: per-story
14
+ raise.fase: ""
15
+ raise.prerequisites: ""
16
+ raise.next: ""
17
+ raise.gate: ""
18
+ raise.adaptable: "true"
19
+ raise.version: "2.0.0"
20
+ raise.visibility: public
21
+ ---
22
+
23
+ # Docs Update
24
+
25
+ ## Purpose
26
+
27
+ Close the coherence loop between code and architecture docs. Compare knowledge graph truth against module doc frontmatter, update drifted fields, and optionally refresh narrative sections.
28
+
29
+ ## Mastery Levels (ShuHaRi)
30
+
31
+ - **Shu**: Present every diff, ask before every change
32
+ - **Ha**: Batch frontmatter changes with single HITL gate, narrative only for structural changes
33
+ - **Ri**: Autonomous frontmatter updates, HITL only for narrative
34
+
35
+ ## Context
36
+
37
+ **When to use:** After stories that changed code structure, during `/rai-story-close`, after discovery refresh.
38
+
39
+ **When to skip:** Stories that only changed tests/docs/non-code. No graph available.
40
+
41
+ **Inputs:** Knowledge graph (`.raise/rai/memory/index.json`), module docs (`governance/architecture/modules/*.md`).
42
+
43
+ ## Steps
44
+
45
+ ### Step 1: Build Graph & Identify Affected Modules
46
+
47
+ ```bash
48
+ rai graph build
49
+ ```
50
+
51
+ Read `.raise/rai/personal/last-diff.json` for changed modules. If no diff or no affected_modules, check all modules.
52
+
53
+ <verification>
54
+ Module list identified for comparison.
55
+ </verification>
56
+
57
+ ### Step 2: Compare Frontmatter Per Module
58
+
59
+ ```bash
60
+ rai graph context mod-{name} --format json
61
+ ```
62
+
63
+ Compare doc-declared vs code-truth:
64
+
65
+ | Doc field | Graph truth | Comparison |
66
+ |-----------|------------|------------|
67
+ | `depends_on` | `code_imports` | Sort both, compare sets |
68
+ | `depended_by` | Reverse lookup from other modules | Computed |
69
+ | `public_api` | `code_exports` | Sort both, compare sets |
70
+ | `components` | `code_components` | Direct number |
71
+
72
+ **Fields the skill MUST NOT touch:** `purpose`, `constraints`, `status`, `entry_points`, `name`, `type`.
73
+
74
+ <verification>
75
+ Drifted fields identified per module.
76
+ </verification>
77
+
78
+ ### Step 3: HITL Gate — Apply Frontmatter
79
+
80
+ Present drift report:
81
+ ```
82
+ ### mod-memory
83
+ depends_on: [config] → [config, schemas] (added: schemas)
84
+ components: 30 → 34
85
+ ```
86
+
87
+ Ask: "Apply frontmatter updates to N modules? [y/n/selective]"
88
+
89
+ Apply changes to YAML frontmatter only — preserve all other content and field ordering.
90
+
91
+ <verification>
92
+ Frontmatter updates applied (or skipped by user).
93
+ </verification>
94
+
95
+ ### Step 4: Narrative Review (if triggered)
96
+
97
+ **Trigger A (full review):** New/removed modules, major dependency changes (>2), significant API changes (>5).
98
+
99
+ **Trigger B (targeted scan):** For any frontmatter change, scan prose for stale hardcoded values (old counts, removed dependency names, removed API names). These are mechanical text fixes.
100
+
101
+ Present proposed changes as diff. HITL approval before writing.
102
+
103
+ <verification>
104
+ Narrative changes applied or no triggers found.
105
+ </verification>
106
+
107
+ ### Step 5: Rebuild & Summarize
108
+
109
+ If any changes applied:
110
+ ```bash
111
+ rai graph build
112
+ ```
113
+
114
+ Present summary: modules checked, frontmatter updated, narrative updated, graph rebuilt.
115
+
116
+ <verification>
117
+ Graph reflects updated docs. Coherence loop closed.
118
+ </verification>
119
+
120
+ ## Output
121
+
122
+ | Item | Destination |
123
+ |------|-------------|
124
+ | Updated frontmatter | `governance/architecture/modules/*.md` |
125
+ | Narrative changes | `governance/architecture/modules/*.md` (with HITL) |
126
+ | Summary | Displayed |
127
+
128
+ ## Quality Checklist
129
+
130
+ - [ ] Graph built fresh before comparison (not stale data)
131
+ - [ ] Only machine-owned fields updated (depends_on, depended_by, public_api, components)
132
+ - [ ] Human-owned fields preserved (purpose, constraints, status, entry_points)
133
+ - [ ] HITL gate before any writes — present diff first
134
+ - [ ] Graph rebuilt after changes to close coherence loop
135
+ - [ ] NEVER modify purpose or constraints without explicit human request
136
+
137
+ ## References
138
+
139
+ - ADR-025: Incremental Coherence — Graph Diffing and AI-Driven Doc Regeneration
140
+ - Module docs: `governance/architecture/modules/*.md`
141
+ - Graph: `.raise/rai/memory/index.json`
142
+ - Graph context: `rai graph context mod-{name} --format json`
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: rai-doctor
3
+ description: >
4
+ Run RaiSE self-diagnostics, explain results conversationally, and guide
5
+ the user through fixes. The CLI does the checking; the skill does the
6
+ interpreting and helping.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: utility
12
+ raise.frequency: as-needed
13
+ raise.fase: "0"
14
+ raise.prerequisites: ""
15
+ raise.next: ""
16
+ raise.gate: ""
17
+ raise.adaptable: "true"
18
+ raise.version: "2.2.0"
19
+ raise.visibility: public
20
+ ---
21
+
22
+ # Doctor
23
+
24
+ ## Purpose
25
+
26
+ Diagnose RaiSE setup health, explain issues in plain language, and guide the user through resolution. The user never touches the CLI directly — Rai runs the diagnostics and translates results into actionable conversation.
27
+
28
+ ## Context
29
+
30
+ **When to use:** User reports something isn't working, after `rai init`, after upgrading raise-cli, or proactively at session start when setup feels off.
31
+
32
+ **When to skip:** The issue is clearly in user code, not RaiSE configuration.
33
+
34
+ ## Steps
35
+
36
+ ### Step 1: Run diagnostics
37
+
38
+ ```bash
39
+ rai doctor --json
40
+ ```
41
+
42
+ Parse the JSON output. Categorize results by severity.
43
+
44
+ ### Step 2: Report to user
45
+
46
+ **If all checks pass:**
47
+ > Your RaiSE setup is healthy. All checks passed.
48
+
49
+ **If there are warnings or errors**, explain each one conversationally:
50
+
51
+ - Translate technical check IDs into human language
52
+ - Group by category (environment, project, adapters, skills, MCP)
53
+ - For each issue: what it means, why it matters, and what to do
54
+
55
+ Example:
56
+ > I found 2 issues with your setup:
57
+ >
58
+ > 1. **Graph is outdated** — your knowledge graph hasn't been rebuilt since governance files changed. This means my context queries may return stale data. I can rebuild it now if you'd like.
59
+ >
60
+ > 2. **MCP server 'jira' is unreachable** — the Jira integration can't connect. Check that JIRA_URL and JIRA_API_TOKEN are set in your environment.
61
+
62
+ ### Step 3: Offer fixes
63
+
64
+ For auto-fixable issues (those with `fix_id` in the JSON):
65
+
66
+ > I can fix issue #1 automatically. Should I run `rai doctor --fix`?
67
+
68
+ Wait for user confirmation before running fixes.
69
+
70
+ ```bash
71
+ rai doctor --fix
72
+ ```
73
+
74
+ Report the outcome of each fix.
75
+
76
+ ### Step 4: Guide manual fixes
77
+
78
+ For issues that can't be auto-fixed, guide step by step:
79
+
80
+ - Missing env vars → tell the user exactly which vars to set and where
81
+ - Missing optional extras → provide the exact pip install command
82
+ - Stale skills → offer to run `rai skill sync`
83
+ - Invalid manifest → explain what's wrong and how to fix it
84
+
85
+ ### Step 5: Bug report (if unresolvable)
86
+
87
+ If issues persist after fixes:
88
+
89
+ > This looks like a bug in RaiSE itself. I can generate a diagnostic report for the team. It only includes non-sensitive data (versions, check results, file names — never secrets or code). Want me to prepare it?
90
+
91
+ If the user agrees:
92
+
93
+ ```bash
94
+ rai doctor report
95
+ ```
96
+
97
+ Show the user the saved report path so they can review it. Then:
98
+
99
+ > The report is saved at {path}. Review it, and when ready I can open your email client to send it:
100
+
101
+ ```bash
102
+ rai doctor report --send
103
+ ```
104
+
105
+ ## Output
106
+
107
+ | Artifact | When |
108
+ |----------|------|
109
+ | Diagnostic summary | Always (conversational) |
110
+ | Auto-fixes applied | When user approves --fix |
111
+ | Report file | When user requests bug report |
112
+ | Email draft | When user approves --send |
113
+
114
+ ## Quality Checklist
115
+
116
+ - [ ] Never run `--fix` without user confirmation
117
+ - [ ] Explain issues in plain language, not technical jargon
118
+ - [ ] Never expose secrets, tokens, or file contents in conversation
119
+ - [ ] Offer bug report only after fix attempts fail
120
+ - [ ] Always show the report path so user can review before sending
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: rai-epic-close
3
+ description: >
4
+ Complete an epic with retrospective, metrics capture, and tracking update.
5
+ No branch merge — epics are logical containers. Story branches merge
6
+ directly to the development branch during story-close.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: epic
12
+ raise.frequency: per-epic
13
+ raise.fase: "9"
14
+ raise.prerequisites: all stories complete
15
+ raise.next: ""
16
+ raise.gate: ""
17
+ raise.adaptable: "true"
18
+ raise.version: "3.0.0"
19
+ raise.visibility: public
20
+ raise.inputs: |
21
+ - scope: file_path, required, previous_skill
22
+ - all_retrospectives: boolean, required, git
23
+ - dev_branch: string, required, config
24
+ raise.outputs: |
25
+ - retrospective: file_path, file
26
+ - tag: string, git
27
+ ---
28
+
29
+ # Epic Close
30
+
31
+ ## Purpose
32
+
33
+ Complete an epic by conducting a retrospective, tagging the milestone, and updating tracking. No branch merge needed — stories already merged to the development branch during story-close.
34
+
35
+ ## Mastery Levels (ShuHaRi)
36
+
37
+ - **Shu**: Follow all steps, complete full retrospective template
38
+ - **Ha**: Adjust retrospective depth based on epic complexity
39
+ - **Ri**: Integrate with release workflows, automate metrics extraction
40
+
41
+ ## Context
42
+
43
+ **When to use:** All stories complete and merged to `{dev_branch}`. Ready to close the epic lifecycle.
44
+
45
+ **When to skip:** Epic abandoned (document why, update backlog as "Abandoned").
46
+
47
+ **Inputs:** Epic scope document, all story retrospectives, passing test suite.
48
+
49
+ **Branch config:** Read `branches.development` from `.raise/manifest.yaml` for `{dev_branch}`. Default: `main`.
50
+
51
+ ## Steps
52
+
53
+ ### Step 1: Verify Stories Complete
54
+
55
+ Check all stories are done in the epic scope document:
56
+
57
+ ```bash
58
+ grep -E "^\s*-\s*\[ \]" "work/epics/e{N}-{name}/scope.md"
59
+ ```
60
+
61
+ | Condition | Action |
62
+ |-----------|--------|
63
+ | All stories checked | Continue |
64
+ | Incomplete stories | Complete them first or explicitly descope |
65
+
66
+ <verification>
67
+ All stories marked complete in epic scope.
68
+ </verification>
69
+
70
+ ### Step 2: Run Tests & Write Retrospective
71
+
72
+ Determine which test command to run using this priority chain:
73
+
74
+ 1. **Check `.raise/manifest.yaml`** for `project.test_command` — if set, use it directly (configuration over convention)
75
+ 2. **Detect language** from `project.project_type` in manifest, or scan file extensions of changed files (`git diff --name-only`)
76
+ 3. **Map language to default** using the table below
77
+
78
+ | Language | Extensions | Default Test Command |
79
+ |----------|-----------|----------------------|
80
+ | Python | `.py`, `.pyi` | `uv run pytest --tb=short` |
81
+ | TypeScript | `.ts`, `.tsx` | `npx vitest run` or `npm test` |
82
+ | JavaScript | `.js`, `.jsx` | `npx vitest run` or `npm test` |
83
+ | C# | `.cs` | `dotnet test --verbosity quiet` |
84
+ | Go | `.go` | `go test ./...` |
85
+ | PHP | `.php` | `vendor/bin/phpunit` |
86
+ | Dart | `.dart` | `flutter test` |
87
+ | Unknown | — | Ask developer |
88
+
89
+ The table is a **fallback** — `project.test_command` always wins when present.
90
+
91
+ Create retrospective at `work/epics/e{N}-{name}/retrospective.md` using `templates/retrospective.md`. Fill from story retrospectives and git history.
92
+
93
+ <verification>
94
+ Tests green. Retrospective created with metrics, patterns, and process insights.
95
+ </verification>
96
+
97
+ <if-blocked>
98
+ Tests failing → fix before closing.
99
+ </if-blocked>
100
+
101
+ ### Step 3: Tag Epic Milestone
102
+
103
+ Tag the current `{dev_branch}` HEAD to mark epic completion:
104
+
105
+ ```bash
106
+ git tag -a "epic/e{N}-complete" -m "Epic E{N}: {Epic Name} complete
107
+
108
+ Delivered: [key deliverables]
109
+ Stories: N stories
110
+
111
+ Co-Authored-By: Rai <rai@humansys.ai>"
112
+ ```
113
+
114
+ Commit retrospective and any final artifacts:
115
+
116
+ ```bash
117
+ git add -A
118
+ git commit -m "epic(e{N}): close with retrospective
119
+
120
+ Co-Authored-By: Rai <rai@humansys.ai>"
121
+ ```
122
+
123
+ <verification>
124
+ Tag created. Retrospective committed.
125
+ </verification>
126
+
127
+ ### Step 4: Update Backlog & Context
128
+
129
+ 1. Mark epic complete in `governance/backlog.md` (status → `✅ Complete`)
130
+ 2. Update `CLAUDE.local.md` to reflect completion and next epic
131
+ 3. Emit telemetry:
132
+
133
+ ```bash
134
+ rai signal emit-work epic E{N} --event complete
135
+ ```
136
+
137
+ <verification>
138
+ Backlog reflects completion. Local context updated.
139
+ </verification>
140
+
141
+ ## Output
142
+
143
+ | Item | Destination |
144
+ |------|-------------|
145
+ | Retrospective | `work/epics/e{N}-{name}/retrospective.md` |
146
+ | Tag | `epic/e{N}-complete` on `{dev_branch}` |
147
+ | Backlog update | `governance/backlog.md` |
148
+ | Context update | `CLAUDE.local.md` |
149
+
150
+ ## Quality Checklist
151
+
152
+ - [ ] All stories complete before closing (gate)
153
+ - [ ] Tests pass before closing
154
+ - [ ] Retrospective captures metrics, patterns, and process insights
155
+ - [ ] Epic milestone tagged on `{dev_branch}`
156
+ - [ ] Backlog updated with completion status
157
+ - [ ] No epic branch to clean up — epics are logical containers
158
+ - [ ] NEVER close without retrospective — learnings compound across epics
159
+
160
+ ## References
161
+
162
+ - Retrospective template: `templates/retrospective.md`
163
+ - Previous: All `/rai-story-close` completions
164
+ - Backlog: `governance/backlog.md`
165
+ - Next: `/rai-epic-design` for next epic
@@ -0,0 +1,68 @@
1
+ # Epic Retrospective: E{N} {Epic Name}
2
+
3
+ **Completed:** YYYY-MM-DD
4
+ **Duration:** X days (started YYYY-MM-DD)
5
+ **Stories:** N stories delivered
6
+
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ [2-3 sentence summary of what was delivered and its impact]
12
+
13
+ ## Metrics
14
+
15
+ | Metric | Value | Notes |
16
+ |--------|-------|-------|
17
+ | Stories Delivered | N | |
18
+ | Story Points | X SP | |
19
+ | Tests Added | N | |
20
+ | Average Velocity | X.Xx | vs baseline |
21
+ | Calendar Days | N | |
22
+
23
+ ### Story Breakdown
24
+
25
+ | Story | Size | SP | Velocity | Key Learning |
26
+ |-------|:----:|:--:|:--------:|--------------|
27
+ | S{N}.1 | S | 2 | 2.5x | [learning] |
28
+ | S{N}.2 | M | 3 | 3.0x | [learning] |
29
+
30
+ ## What Went Well
31
+
32
+ - [Positive outcome 1]
33
+ - [Positive outcome 2]
34
+
35
+ ## What Could Be Improved
36
+
37
+ - [Improvement area 1]
38
+ - [Improvement area 2]
39
+
40
+ ## Patterns Discovered
41
+
42
+ | ID | Pattern | Context |
43
+ |----|---------|---------|
44
+ | PAT-XXX | [pattern description] | [when to apply] |
45
+
46
+ ## Process Insights
47
+
48
+ - [Insight about RaiSE methodology]
49
+ - [Insight about collaboration]
50
+
51
+ ## Artifacts
52
+
53
+ - **Scope:** `work/epics/e{N}-{name}/scope.md`
54
+ - **Stories:** `work/epics/e{N}-{name}/stories/`
55
+ - **ADRs:** [list any ADRs created]
56
+ - **Tests:** N new tests
57
+
58
+ ## Release Impact
59
+
60
+ **Release:** REL-{id} ({release name})
61
+ **Epic progress:** {N}/{total} epics complete for this release
62
+
63
+ > Include this section only when the epic belongs to a release.
64
+
65
+ ## Next Steps
66
+
67
+ - [What follows this epic]
68
+ - [Dependencies unblocked]