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,293 @@
1
+ ---
2
+ story_id: "[F#.#]"
3
+ title: "[Feature Name]"
4
+ epic_ref: "[E# Epic Name]"
5
+ story_points: [number]
6
+ complexity: "[simple|moderate|complex]"
7
+ status: "[draft|approved|implemented]"
8
+ version: "1.0"
9
+ created: "[YYYY-MM-DD]"
10
+ updated: "[YYYY-MM-DD]"
11
+ template: "lean-feature-spec-v2"
12
+ ---
13
+
14
+ # Feature: [Title]
15
+
16
+ > **Epic**: [E#] - [Epic Name]
17
+ > **Complexity**: [simple|moderate|complex] | **SP**: [number]
18
+
19
+ ---
20
+
21
+ ## 1. What & Why
22
+
23
+ **Problem**: [1-2 sentences describing what problem this solves or what gap it fills]
24
+
25
+ **Value**: [1-2 sentences explaining why this matters to users/project/stakeholders]
26
+
27
+ ---
28
+
29
+ ## 2. Approach
30
+
31
+ **How we'll solve it** (high-level):
32
+
33
+ [1-2 sentences describing the solution approach - WHAT we're building, not detailed HOW. Focus on goals and constraints, not implementation steps.]
34
+
35
+ **Components affected**:
36
+ - **[Component/Module 1]**: [What changes - create/modify/delete]
37
+ - **[Component/Module 2]**: [What changes]
38
+
39
+ ---
40
+
41
+ ## 3. Interface / Examples
42
+
43
+ > **IMPORTANT**: Provide concrete examples - these are critical for AI code generation accuracy
44
+
45
+ ### API / CLI Usage
46
+
47
+ ```[language]
48
+ # Example of how this feature is used
49
+ # Show actual code that could be run
50
+
51
+ [Concrete code example showing the interface]
52
+ ```
53
+
54
+ ### Expected Output
55
+
56
+ ```[language or text]
57
+ # What the feature produces or how it behaves
58
+ # Include realistic data/responses
59
+
60
+ [Example output or behavior]
61
+ ```
62
+
63
+ ### Data Structures (if applicable)
64
+
65
+ ```[language]
66
+ # Key data models, schemas, or type definitions
67
+ # Example: Pydantic models, TypeScript interfaces, database schemas
68
+
69
+ [Example structure]
70
+ ```
71
+
72
+ ---
73
+
74
+ ## 4. Acceptance Criteria
75
+
76
+ > **MUST** = Required for feature completion
77
+ > **SHOULD** = Nice-to-have, defer if time-constrained
78
+ > **MUST NOT** = Explicit anti-requirements
79
+
80
+ ### Must Have
81
+
82
+ - [ ] [Critical requirement 1 - specific and testable]
83
+ - [ ] [Critical requirement 2 - specific and testable]
84
+ - [ ] [Critical requirement 3 - specific and testable]
85
+
86
+ ### Should Have
87
+
88
+ - [ ] [Nice-to-have requirement 1]
89
+ - [ ] [Nice-to-have requirement 2]
90
+
91
+ ### Must NOT
92
+
93
+ - [ ] [Explicit anti-requirement - what to avoid or prevent]
94
+
95
+ ---
96
+
97
+ <details>
98
+ <summary><h2>5. Detailed Scenarios (Optional - Use for Complex Features)</h2></summary>
99
+
100
+ > **When to include**: Complex features with multiple edge cases, state transitions, or error conditions
101
+
102
+ ### Scenario 1: [Happy Path / Primary Use Case]
103
+
104
+ ```gherkin
105
+ Given [initial context or preconditions]
106
+ When [user action or trigger event]
107
+ Then [expected outcome]
108
+ And [additional verification or side effects]
109
+ ```
110
+
111
+ ### Scenario 2: [Edge Case / Error Handling]
112
+
113
+ ```gherkin
114
+ Given [error condition context or invalid state]
115
+ When [user action or trigger]
116
+ Then [expected error handling or graceful degradation]
117
+ And [what should NOT happen]
118
+ ```
119
+
120
+ ### Scenario 3: [Another Important Case]
121
+
122
+ ```gherkin
123
+ Given [context]
124
+ When [action]
125
+ Then [outcome]
126
+ ```
127
+
128
+ </details>
129
+
130
+ ---
131
+
132
+ <details>
133
+ <summary><h2>6. Algorithm / Logic (Optional - Use for Non-Obvious Implementation)</h2></summary>
134
+
135
+ > **When to include**: Non-trivial algorithms, complex state machines, specialized business logic, or performance-critical operations
136
+
137
+ ```python
138
+ # Pseudocode or detailed algorithm description
139
+ # Focus on WHAT steps happen, not necessarily exact syntax
140
+
141
+ def complex_operation(input_data):
142
+ """
143
+ High-level algorithm outline
144
+ """
145
+ # Step 1: [What happens and why]
146
+
147
+ # Step 2: [What happens and why]
148
+
149
+ # Step 3: [What happens and why]
150
+
151
+ # Return: [What's produced]
152
+ return result
153
+ ```
154
+
155
+ **Rationale**: [Why this approach was chosen]
156
+
157
+ **Alternatives considered**:
158
+ - [Alternative 1]: [Why not chosen]
159
+ - [Alternative 2]: [Why not chosen]
160
+
161
+ **Complexity**: [Time/space complexity if relevant - e.g., O(n log n)]
162
+
163
+ </details>
164
+
165
+ ---
166
+
167
+ <details>
168
+ <summary><h2>7. Constraints & Non-Functional Requirements (Optional)</h2></summary>
169
+
170
+ > **When to include**: Performance, security, scalability, or compatibility requirements that constrain implementation
171
+
172
+ | Type | Constraint | Rationale |
173
+ |------|------------|-----------|
174
+ | **Performance** | [e.g., "<100ms response time", "Handle 10k requests/sec"] | [Why this threshold matters] |
175
+ | **Security** | [e.g., "No secrets in code", "Hash passwords with bcrypt"] | [Risk being mitigated] |
176
+ | **Scalability** | [e.g., "Support up to 10k concurrent users"] | [Expected growth or limits] |
177
+ | **Compatibility** | [e.g., "Python 3.12+", "PostgreSQL 14+"] | [Platform or dependency requirements] |
178
+ | **Accessibility** | [e.g., "WCAG 2.1 AA compliance"] | [User needs or regulatory requirements] |
179
+ | **Reliability** | [e.g., "99.9% uptime", "Graceful degradation"] | [Service level expectations] |
180
+
181
+ </details>
182
+
183
+ ---
184
+
185
+ <details>
186
+ <summary><h2>8. Testing Approach (Optional)</h2></summary>
187
+
188
+ > **When to include**: Non-obvious testing strategy, specialized test requirements, or critical quality assurance needs
189
+
190
+ | Test Type | What to Cover | Tooling / Framework |
191
+ |-----------|---------------|---------------------|
192
+ | **Unit** | [What units/functions to test; edge cases to verify] | pytest, unittest |
193
+ | **Integration** | [What integrations to verify; external dependencies] | pytest + fixtures, testcontainers |
194
+ | **E2E** | [User workflows to validate end-to-end] | Playwright, Selenium |
195
+ | **Performance** | [Load testing, benchmarks] | pytest-benchmark, locust |
196
+ | **Manual** | [What requires human verification; exploratory testing] | N/A |
197
+
198
+ **Test Data**:
199
+ - [Where to get test data or fixtures]
200
+ - [Any data generation strategy]
201
+
202
+ **Coverage Target**: [e.g., ">90% for core logic"]
203
+
204
+ </details>
205
+
206
+ ---
207
+
208
+ ## References
209
+
210
+ **Related ADRs**:
211
+ - [ADR-XXX: Decision Title](../../../dev/decisions/adr-xxx.md)
212
+
213
+ **Related Features**:
214
+ - F#.#: [Feature Title]
215
+ - F#.#: [Feature Title]
216
+
217
+ **External Docs**:
218
+ - [Document Title](URL) - [Why relevant]
219
+
220
+ **Dependencies**:
221
+ - [Upstream feature that must complete first]
222
+ - [Library or service this depends on]
223
+
224
+ ---
225
+
226
+ **Template Version**: 2.0 (Lean Feature Spec)
227
+ **Created**: [YYYY-MM-DD]
228
+ **Last Updated**: [YYYY-MM-DD]
229
+ **Based on**: Research `work/research/lean-feature-specs/` (2026-01-31)
230
+
231
+ ---
232
+
233
+ ## Template Usage Notes
234
+
235
+ ### When to Use This Template
236
+
237
+ - **Complex features**: >3 components, >5 SP, non-trivial logic
238
+ - **Architectural decisions**: Multiple implementation approaches
239
+ - **AI code generation**: Significant code to be AI-generated
240
+
241
+ ### When to Skip
242
+
243
+ - **Simple features**: <3 components, <5 SP, obvious implementation → Go directly to `feature/plan`
244
+ - **Bug fixes**: Use issue tracker
245
+ - **Infrastructure/scaffolding**: If implementation is self-evident
246
+
247
+ ### Section Priority
248
+
249
+ **Always include (4 core sections)**:
250
+ 1. What & Why
251
+ 2. Approach
252
+ 3. Examples (CRITICAL for AI alignment)
253
+ 4. Acceptance Criteria
254
+
255
+ **Include as needed (4 optional sections)**:
256
+ 5. Detailed Scenarios (complex features with edge cases)
257
+ 6. Algorithm/Logic (non-obvious implementations)
258
+ 7. Constraints (performance/security requirements)
259
+ 8. Testing (specialized test needs)
260
+
261
+ ### Tips for Effective Specs
262
+
263
+ **For AI alignment**:
264
+ - ✓ Concrete examples over prose descriptions
265
+ - ✓ Specific acceptance criteria (testable, observable)
266
+ - ✓ Use emphasis: **IMPORTANT**, **MUST**, **DO NOT**
267
+ - ✓ Focus on WHAT and WHY, not detailed HOW
268
+
269
+ **For human reviewability**:
270
+ - ✓ Keep core sections concise (1-2 sentences for What/Why)
271
+ - ✓ Use collapsible `<details>` for optional sections
272
+ - ✓ Target: Reviewable in <5 minutes
273
+ - ✓ YAML frontmatter enables quick scanning
274
+
275
+ **For iteration**:
276
+ - ✓ Version control this file alongside code
277
+ - ✓ Update spec based on implementation learnings
278
+ - ✓ 2-3 iteration cycles normal: spec → code → refine spec → regenerate
279
+
280
+ ### Evidence Base
281
+
282
+ This template design based on research with 25 sources:
283
+ - 9 Very High evidence (academic papers, vendor docs)
284
+ - 13 High evidence (engineering blogs, production cases)
285
+ - 3 Medium evidence (community validation)
286
+
287
+ **Key findings**:
288
+ - Clarity & structure critical (6 sources)
289
+ - Examples outperform prose for AI (5 sources)
290
+ - YAML+Markdown optimal format (4 sources)
291
+ - Iterative refinement essential (4 sources)
292
+
293
+ Full research: `work/research/lean-feature-specs/`
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: rai-story-implement
3
+ description: >
4
+ Execute the implementation plan task by task, verifying each step, and
5
+ producing quality code that passes validation gates. Use after planning
6
+ is complete.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: story
12
+ raise.frequency: per-story
13
+ raise.fase: "6"
14
+ raise.prerequisites: story-plan
15
+ raise.next: story-review
16
+ raise.gate: gate-code
17
+ raise.adaptable: "true"
18
+ raise.version: "2.2.0"
19
+ raise.visibility: public
20
+ raise.inputs: |
21
+ - plan_md: file_path, required, previous_skill
22
+ raise.outputs: |
23
+ - code_commits: list, git
24
+ ---
25
+
26
+ # Implement: Development Workflow
27
+
28
+ ## Purpose
29
+
30
+ Execute the implementation plan task by task with TDD, producing verified code that passes all gates.
31
+
32
+ ## Mastery Levels (ShuHaRi)
33
+
34
+ - **Shu**: Execute tasks strictly in order, verify each before proceeding
35
+ - **Ha**: Adjust plan based on discoveries during implementation
36
+ - **Ri**: Parallelize independent tasks, create stack-specific patterns
37
+
38
+ ## Context
39
+
40
+ **When to use:** After `/rai-story-plan` has produced a plan document.
41
+
42
+ **Prerequisite:** Plan must exist at `work/epics/e{N}-{name}/stories/{story_id}/plan.md`. Run `/rai-story-plan` first if missing.
43
+
44
+ **Inputs:** Implementation plan, project guardrails (from graph context).
45
+
46
+ ## Steps
47
+
48
+ ### Step 1: Load Plan & Context
49
+
50
+ Load the implementation plan and query relevant patterns:
51
+
52
+ ```bash
53
+ rai graph query "testing coverage type annotations" --types pattern,guardrail --limit 5
54
+ ```
55
+
56
+ If a design document exists, restate the design intent in 2-3 sentences and confirm with the human before proceeding. One unvalidated assumption can waste an entire task cycle.
57
+
58
+ ### Step 2: Execute Task
59
+
60
+ For the next uncompleted task in plan order:
61
+
62
+ 1. **RED** — Write a failing test that defines expected behavior
63
+ 2. **GREEN** — Write minimal code to make the test pass
64
+ 3. **REFACTOR** — Clean up while keeping tests green
65
+
66
+ Follow project rules, guardrails, and established patterns.
67
+
68
+ ### Step 3: Verify Task
69
+
70
+ Run the verification defined in the plan:
71
+ - Unit tests (`pytest`)
72
+ - Linting (`ruff check`)
73
+ - Type checking (`pyright`)
74
+
75
+ If verification fails: fix and re-verify (max 3 attempts before escalating).
76
+
77
+ ### Step 4: Commit & Checkpoint
78
+
79
+ 1. Commit the completed task
80
+ 2. Update progress log (`work/epics/.../stories/{story_id}/progress.md`)
81
+ 3. Present to the human: what was completed, files changed, verification results
82
+ 4. Wait for acknowledgment before continuing
83
+
84
+ ### Step 5: Iterate or Finalize
85
+
86
+ | Condition | Action |
87
+ |-----------|--------|
88
+ | More tasks remain | Return to Step 2 |
89
+ | All tasks complete | Run full gate check, present summary |
90
+ | Task blocked | Document blocker, escalate to human |
91
+
92
+ ## Output
93
+
94
+ | Item | Destination |
95
+ |------|-------------|
96
+ | Implemented code | Per project architecture |
97
+ | Progress log | `work/epics/.../stories/{story_id}/progress.md` |
98
+ | Next | `/rai-story-review` |
99
+
100
+ ## Quality Checklist
101
+
102
+ - [ ] Plan loaded and design intent confirmed (if design exists)
103
+ - [ ] TDD cycle followed for each task (RED → GREEN → REFACTOR)
104
+ - [ ] Each task committed individually (not batched at story end)
105
+ - [ ] All verifications pass (tests, lint, types)
106
+ - [ ] Progress log updated with actuals
107
+ - [ ] Human acknowledged each task before proceeding
108
+ - [ ] NEVER skip a failing test — fix it or escalate
109
+ - [ ] NEVER accumulate errors — stop on defect (Jidoka)
110
+
111
+ ## References
112
+
113
+ - Gate: `gates/gate-code.md`
114
+ - Next skill: `/rai-story-review`
115
+ - Progress template: `references/progress-template.md`
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: rai-story-plan
3
+ description: >
4
+ Decompose user stories into atomic executable tasks, identify dependencies,
5
+ and create a deterministic implementation plan. Use after /rai-story-design
6
+ has grounded the story's integration decisions.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: story
12
+ raise.frequency: per-story
13
+ raise.fase: "5"
14
+ raise.prerequisites: project-backlog
15
+ raise.next: story-implement
16
+ raise.gate: gate-plan
17
+ raise.adaptable: "true"
18
+ raise.version: "2.1.0"
19
+ raise.visibility: public
20
+ raise.inputs: |
21
+ - design_md: file_path, optional, previous_skill
22
+ - story_md: file_path, required, story-start
23
+ raise.outputs: |
24
+ - plan_md: file_path, next_skill
25
+ ---
26
+
27
+ # Story Plan
28
+
29
+ ## Purpose
30
+
31
+ Decompose a story into atomic executable tasks with dependencies, verification criteria, and a deterministic execution order.
32
+
33
+ ## Mastery Levels (ShuHaRi)
34
+
35
+ - **Shu**: Decompose each story into atomic tasks with full verification criteria
36
+ - **Ha**: Adjust granularity based on complexity, parallelize when possible
37
+ - **Ri**: Custom planning patterns for specific stacks
38
+
39
+ ## Context
40
+
41
+ **When to use:** After `/rai-story-design` has grounded integration decisions (or directly for simple stories).
42
+
43
+ **Prerequisite:** Design document at `work/epics/e{N}-{name}/stories/s{N}.{M}-design.md` (optional for simple stories).
44
+
45
+ **Inputs:** Story with acceptance criteria, design document (if exists).
46
+
47
+ ## Steps
48
+
49
+ ### Step 1: Verify Design
50
+
51
+ ```bash
52
+ ls work/epics/e*/stories/{story_id}-design.md 2>/dev/null || echo "INFO: No design"
53
+ ```
54
+
55
+ | Condition | Action |
56
+ |-----------|--------|
57
+ | Design exists | Load and reference |
58
+ | No design + simple story | Continue |
59
+ | No design + complex story | Run `/rai-story-design` first |
60
+
61
+ <verification>
62
+ Design loaded or simple story confirmed.
63
+ </verification>
64
+
65
+ ### Step 2: Decompose into Tasks
66
+
67
+ Divide story into atomic, individually verifiable tasks. One commit per task.
68
+
69
+ | Story Size | Tasks | Rationale |
70
+ |------------|:-----:|-----------|
71
+ | XS (1-2 SP) | 1-2 | Single-pass implementation |
72
+ | S (3-5 SP) | 2-3 | Avoid over-decomposition |
73
+ | M (5-8 SP) | 3-5 | Balance granularity and overhead |
74
+ | L (8+ SP) | 5-8 | Consider splitting the story |
75
+
76
+ **Per task:**
77
+ - Description, files to create/modify
78
+ - TDD cycle: RED (failing test) → GREEN (minimal code) → REFACTOR
79
+ - AC reference: link to `story.md` Gherkin scenario (if exists)
80
+ - Verification command (`pytest`, `ruff check`, `pyright`)
81
+ - Size (XS/S/M/L) and dependencies
82
+
83
+ **Always include as final task:** Manual integration test — validate end-to-end with running software.
84
+
85
+ <verification>
86
+ Each task is atomic and verifiable. Final integration test included.
87
+ </verification>
88
+
89
+ ### Step 3: Order & Dependencies
90
+
91
+ - Map dependencies (sequential vs parallel)
92
+ - Apply risk-first ordering (riskiest tasks early)
93
+ - Maximize parallelism where no mutual dependencies exist
94
+ - Verify no circular dependencies
95
+
96
+ <verification>
97
+ Execution order defined. Dependency graph is acyclic.
98
+ </verification>
99
+
100
+ ### Step 4: Document Plan
101
+
102
+ Create `work/epics/e{N}-{name}/stories/s{N}.{M}-plan.md` with:
103
+ - Overview (story ID, size, date)
104
+ - Ordered task list with descriptions, files, verification, sizes, dependencies
105
+ - Execution order with rationale
106
+ - Risks and mitigations
107
+ - Duration tracking table (filled during implementation)
108
+
109
+ <verification>
110
+ Plan document complete and reviewable in <5 minutes.
111
+ </verification>
112
+
113
+ ## Output
114
+
115
+ | Item | Destination |
116
+ |------|-------------|
117
+ | Implementation plan | `work/epics/e{N}-{name}/stories/s{N}.{M}-plan.md` |
118
+ | Next | `/rai-story-implement` |
119
+
120
+ ## Quality Checklist
121
+
122
+ - [ ] Design verified or simple story confirmed
123
+ - [ ] Tasks are atomic (one commit each) and verifiable
124
+ - [ ] TDD cycle specified per task (RED → GREEN → REFACTOR)
125
+ - [ ] Final manual integration test task included
126
+ - [ ] Dependencies mapped — no cycles
127
+ - [ ] Execution order follows risk-first approach
128
+ - [ ] NEVER over-decompose simple stories
129
+ - [ ] NEVER skip TDD guidance — tests define behavior
130
+
131
+ ## References
132
+
133
+ - Gate: `gates/gate-plan.md`
134
+ - Previous: `/rai-story-design`
135
+ - Next: `/rai-story-implement`