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,176 @@
1
+ ---
2
+ name: rai-session-close
3
+ description: >
4
+ Close a working session by reflecting on outcomes and feeding structured data to CLI.
5
+ CLI does all writes atomically; skill does inference reflection.
6
+
7
+ license: MIT
8
+
9
+ metadata:
10
+ raise.work_cycle: session
11
+ raise.frequency: per-session
12
+ raise.fase: "end"
13
+ raise.prerequisites: ""
14
+ raise.next: ""
15
+ raise.gate: ""
16
+ raise.adaptable: "true"
17
+ raise.version: "4.1.0"
18
+ raise.visibility: public
19
+ raise.inputs: |
20
+ - session_id: string, required, previous_skill
21
+ raise.outputs: |
22
+ - session_record: file_path, file
23
+ - patterns: list, cli
24
+ ---
25
+
26
+ # Session Close
27
+
28
+ ## Purpose
29
+
30
+ Close a session by reflecting on outcomes and feeding structured data to the CLI for atomic persistence.
31
+
32
+ ## Mastery Levels (ShuHaRi)
33
+
34
+ - **Shu**: Detailed handoff with explanations of what was captured
35
+ - **Ha**: Standard handoff, explain only notable items
36
+ - **Ri**: Minimal handoff — next step and open items only
37
+
38
+ ## Context
39
+
40
+ **When to use:** At the end of every working session.
41
+
42
+ **Quick close:** For short sessions, use CLI flags directly instead of a state file:
43
+ ```bash
44
+ rai session close --summary "Quick fix session" --type maintenance --project .
45
+ ```
46
+
47
+ ## Steps
48
+
49
+ ### Step 1: Craft Session Title
50
+
51
+ Generate a descriptive session title (max 80 chars) that captures what was accomplished — not planned, accomplished. Include the **epic/story name** (not just the number) so the title is self-explanatory without looking up Jira. Use the format: `SES-{ID}: {title}`.
52
+
53
+ **Good** (descriptive, includes context):
54
+ - `SES-321: E355 Branch Model Evolution cerrado + backlog review y priorización E354`
55
+ - `SES-318: E347 Backlog Automation — epic completo, 7 stories, merge a dev`
56
+ - `SES-316: Backlog sync + Semgrep MCP investigation`
57
+
58
+ **Bad** (too terse, requires lookup):
59
+ - `SES-321: E355 complete + backlog review`
60
+ - `SES-318: E347 done`
61
+
62
+ The title will be used in the `summary` field of the state file AND presented to the human for `/rename`.
63
+
64
+ ### Step 2: Reflect & Produce State File
65
+
66
+ Use inference to reflect on the session and write a YAML state file:
67
+
68
+ ```yaml
69
+ # .raise/rai/personal/session-output.yaml
70
+ session_id: "{SES-ID}"
71
+ summary: "{session_title}" # The concise title from Step 1
72
+ type: feature # feature | research | maintenance | infrastructure | ideation
73
+ outcomes:
74
+ - "Concrete deliverable 1"
75
+ patterns:
76
+ - description: "Pattern learned"
77
+ context: "tag1,tag2"
78
+ type: process
79
+ corrections:
80
+ - what: "Behavioral observation"
81
+ lesson: "Lesson learned"
82
+ coaching: # Only include fields that changed
83
+ trust_level: "established"
84
+ strengths: ["structured thinking"]
85
+ growth_edge: "async patterns"
86
+ autonomy: "high within defined scope"
87
+ relationship:
88
+ quality: "productive"
89
+ trajectory: "stable"
90
+ current_work:
91
+ release: V3.0
92
+ epic: E15
93
+ story: S15.7
94
+ phase: implement
95
+ branch: story/s15.7/session-protocol
96
+ pending:
97
+ decisions: []
98
+ blockers: []
99
+ next_actions: ["Continue with Task 7"]
100
+ narrative: |
101
+ ## Decisions
102
+ - Key decisions and WHY
103
+ ## Research
104
+ - Conclusions with file paths
105
+ ## Artifacts
106
+ - Files created/modified
107
+ ## Branch State
108
+ - Branch and commits ahead of base
109
+ next_session_prompt: |
110
+ Forward-looking guidance to future Rai. What to prioritize,
111
+ what to watch for, what context will be critical.
112
+ ```
113
+
114
+ **Capture tangents:** Check conversation for ideas → add to `dev/parking-lot.md`.
115
+
116
+ ### Step 3: Clean Working Tree
117
+
118
+ Before closing, ensure no uncommitted changes are left behind:
119
+
120
+ 1. Run `git status`
121
+ 2. If working tree is clean → proceed to Step 3
122
+ 3. If there are uncommitted changes → present them to the human with options:
123
+ - **Commit**: stage and commit with a descriptive message
124
+ - **Discard**: `git restore` the files (confirm first)
125
+ - **Leave**: explicitly acknowledge the leftovers in the handoff
126
+ 4. Do NOT close the session with a dirty working tree unless the human explicitly chooses "Leave"
127
+
128
+ ### Step 4: Feed CLI
129
+
130
+ ```bash
131
+ rai session close --state-file .raise/rai/personal/session-output.yaml --session {SES-ID} --project .
132
+ ```
133
+
134
+ This atomically: records session in index, appends patterns, updates coaching, writes session state, clears active session.
135
+
136
+ Present the closing card:
137
+
138
+ ```
139
+ ## Session Closed: SES-{ID} {session_title}
140
+
141
+ **Type:** {type}
142
+ **Outcomes:**
143
+ - {outcome 1}
144
+ - {outcome 2}
145
+ **Patterns:** {N new} | **Working tree:** {clean | N files uncommitted}
146
+
147
+ ### Next Session
148
+ **Continue:** [next step]
149
+ **Open:** [unresolved questions, if any]
150
+ ```
151
+
152
+ ## Output
153
+
154
+ | File | Update | Writer |
155
+ |------|--------|--------|
156
+ | `.raise/rai/personal/sessions/index.jsonl` | Session record | CLI |
157
+ | `.raise/rai/memory/patterns.jsonl` | New patterns | CLI |
158
+ | `~/.rai/developer.yaml` | Coaching + clear session | CLI |
159
+ | `.raise/rai/session-state.yaml` | Working state | CLI |
160
+ | `dev/parking-lot.md` | Tangents | Skill (Edit) |
161
+
162
+ ## Quality Checklist
163
+
164
+ - [ ] Session ID matches the active session from session-start
165
+ - [ ] Summary reflects actual outcomes (not planned intent)
166
+ - [ ] Narrative enables next session to resume immediately
167
+ - [ ] Next session prompt is actionable and specific
168
+ - [ ] Tangents captured in parking lot (if any)
169
+ - [ ] Working tree clean (or leftovers explicitly acknowledged)
170
+ - [ ] CLI close command executed successfully
171
+
172
+ ## References
173
+
174
+ - Complement: `/rai-session-start`
175
+ - Session state: `.raise/rai/session-state.yaml`
176
+ - Parking lot: `dev/parking-lot.md`
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: rai-session-start
3
+ description: >
4
+ Begin a session by loading context bundle, interpreting it, and proposing work.
5
+ CLI does all data plumbing; skill does inference interpretation.
6
+
7
+ license: MIT
8
+
9
+ metadata:
10
+ raise.work_cycle: session
11
+ raise.frequency: per-session
12
+ raise.fase: "start"
13
+ raise.prerequisites: ""
14
+ raise.next: ""
15
+ raise.gate: ""
16
+ raise.adaptable: "true"
17
+ raise.version: "5.0.0"
18
+ raise.visibility: public
19
+ raise.inputs: |
20
+ - project_path: string, required, argument
21
+ - developer_profile: file_path, required, config
22
+ raise.outputs: |
23
+ - session_id: string, next_skill
24
+ - context_bundle: string, cli
25
+ ---
26
+
27
+ # Session Start
28
+
29
+ ## Purpose
30
+
31
+ Load context bundle from CLI, interpret signals, and propose focused work for the session.
32
+
33
+ ## Mastery Levels (ShuHaRi)
34
+
35
+ - **Shu**: Explain context, progress metrics, and concepts in presentation
36
+ - **Ha**: Explain only new or non-obvious signals
37
+ - **Ri**: Minimal output — context line, focus, signals, "Go."
38
+
39
+ ## Context
40
+
41
+ **When to use:** At the start of every working session.
42
+
43
+ **When to skip:** Continuation of an active session (context already loaded).
44
+
45
+ **Inputs:** Developer profile (`~/.rai/developer.yaml`). If no profile exists, ask for the developer's name and pass `--name "Name"`.
46
+
47
+ ## Steps
48
+
49
+ ### Step 1: Load Orientation Bundle
50
+
51
+ ```bash
52
+ rai session start --project . --context
53
+ ```
54
+
55
+ Loads developer profile, session state, and orientation bundle. If graph unavailable: run `rai graph build` first.
56
+
57
+ **IMPORTANT:** This is the ONLY CLI command in this skill. The context bundle output is complete — do NOT invent additional flags (e.g. `--section`), sub-commands (e.g. `rai context load`), or follow-up CLI calls to "fetch more". If the bundle mentions available context sections, that information is for display only. All interpretation happens in Step 2 using inference, not additional tool calls.
58
+
59
+ ### Step 2: Interpret & Present
60
+
61
+ 1. **Check signals** (priority order):
62
+ - Next session prompt → guidance from your past self, highest-priority continuity
63
+ - Release/deadline pressure → flag urgency with days remaining
64
+ - Session narrative → review decisions, research, artifacts for continuity
65
+ - Pending decisions or blockers → address first
66
+ - Communication preferences → adapt tone
67
+
68
+ 2. **Check MCP health** (non-blocking):
69
+ - Run `rai mcp list` to detect registered servers
70
+ - If no servers registered: skip silently (no output)
71
+ - If servers found: run `rai mcp health <name>` for each
72
+ - Collect status: healthy count, unhealthy count, total
73
+
74
+ 3. **Propose session focus** from: pending items > current story/phase > deadlines
75
+
76
+ 4. **Present** (adapt verbosity to developer level):
77
+
78
+ ```
79
+ ## Session: YYYY-MM-DD
80
+
81
+ **Context:** [Release →] [Epic] → [Story], [phase]
82
+ **Focus:** [goal]
83
+ **MCP:** [{total} servers, all healthy] or [{total} servers, {unhealthy} unhealthy — run /rai-mcp-status]
84
+ **Signals:** [any, or "None"]
85
+ ```
86
+
87
+ Omit the **MCP:** line entirely if no servers are registered.
88
+
89
+ ## Output
90
+
91
+ | Item | Destination |
92
+ |------|-------------|
93
+ | Session initialized | CLI session state updated |
94
+ | Focus proposed | Presented to developer |
95
+ | Next | Begin work on proposed focus |
96
+
97
+ ## Quality Checklist
98
+
99
+ - [ ] Orientation bundle loaded successfully
100
+ - [ ] Signals interpreted in priority order
101
+ - [ ] Session focus proposed from pending work
102
+ - [ ] Verbosity adapted to developer ShuHaRi level
103
+ - [ ] MCP health checked when servers registered (silent skip if none)
104
+
105
+ ## References
106
+
107
+ - Profile: `~/.rai/developer.yaml`
108
+ - Session state: `.raise/rai/session-state.yaml`
109
+ - MCP: `rai mcp list`, `rai mcp health`, `/rai-mcp-status`
110
+ - Complement: `/rai-session-close`
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: rai-story-close
3
+ description: >
4
+ Complete a story with retrospective verification, merge to dev,
5
+ cleanup, and tracking update. Use after review to formally close
6
+ the story lifecycle.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: story
12
+ raise.frequency: per-story
13
+ raise.fase: "8"
14
+ raise.prerequisites: story-review
15
+ raise.next: ""
16
+ raise.gate: ""
17
+ raise.adaptable: "true"
18
+ raise.version: "3.0.0"
19
+ raise.visibility: public
20
+ raise.inputs: |
21
+ - retrospective_md: file_path, required, previous_skill
22
+ - tests_passing: boolean, required, cli
23
+ - dev_branch: string, required, config
24
+ raise.outputs: |
25
+ - merge_commit: string, git
26
+ ---
27
+
28
+ # Story Close
29
+
30
+ ## Purpose
31
+
32
+ Complete a story by verifying the retrospective, merging to the development branch, cleaning up the story branch, and updating epic tracking.
33
+
34
+ ## Mastery Levels (ShuHaRi)
35
+
36
+ - **Shu**: Follow all steps, verify retrospective, merge with --no-ff, update epic
37
+ - **Ha**: Adjust merge strategy for small fixes, skip epic update for standalone
38
+ - **Ri**: Integrate with CI/CD pipelines, automate cleanup workflows
39
+
40
+ ## Context
41
+
42
+ **When to use:** After `/rai-story-review` retrospective is complete. Story is verified and tests pass.
43
+
44
+ **When to skip:** Story abandoned (document why, delete branch without merge, update epic as "Abandoned").
45
+
46
+ **Inputs:** Completed retrospective, passing test suite, story branch ready for merge.
47
+
48
+ **Branch config:** Read `branches.development` from `.raise/manifest.yaml` for `{dev_branch}`. Default: `main`.
49
+
50
+ ## Steps
51
+
52
+ ### Step 1: Verify Retrospective & Tests
53
+
54
+ ```bash
55
+ RETRO="work/epics/e{N}-{name}/stories/{story_id}-retrospective.md"
56
+ [ -f "$RETRO" ] && echo "✓ Retrospective" || echo "ERROR: Run /rai-story-review first"
57
+ ```
58
+
59
+ Determine which test command to run using this priority chain:
60
+
61
+ 1. **Check `.raise/manifest.yaml`** for `project.test_command` — if set, use it directly (configuration over convention)
62
+ 2. **Detect language** from `project.project_type` in manifest, or scan file extensions of changed files (`git diff --name-only`)
63
+ 3. **Map language to default** using the table below
64
+
65
+ | Language | Extensions | Default Test Command |
66
+ |----------|-----------|----------------------|
67
+ | Python | `.py`, `.pyi` | `uv run pytest --tb=short` |
68
+ | TypeScript | `.ts`, `.tsx` | `npx vitest run` or `npm test` |
69
+ | JavaScript | `.js`, `.jsx` | `npx vitest run` or `npm test` |
70
+ | C# | `.cs` | `dotnet test --verbosity quiet` |
71
+ | Go | `.go` | `go test ./...` |
72
+ | PHP | `.php` | `vendor/bin/phpunit` |
73
+ | Dart | `.dart` | `flutter test` |
74
+ | Unknown | — | Ask developer |
75
+
76
+ The table is a **fallback** — `project.test_command` always wins when present.
77
+
78
+ | Condition | Action |
79
+ |-----------|--------|
80
+ | Retro exists + tests green | Continue |
81
+ | Retro missing | Run `/rai-story-review` first — no exceptions |
82
+ | Tests failing | Fix before merge |
83
+
84
+ Check for structural drift: if this story added modules or changed directory structure, update module docs in `governance/architecture/modules/` before closing.
85
+
86
+ <verification>
87
+ Retrospective exists. Tests pass. No undocumented structural changes.
88
+ </verification>
89
+
90
+ ### Step 2: Verify Clean Working Tree
91
+
92
+ ```bash
93
+ git status --short
94
+ ```
95
+
96
+ | Condition | Action |
97
+ |-----------|--------|
98
+ | Working tree clean | Continue to merge |
99
+ | Uncommitted changes from this story | **Commit them** before merge — artifacts must not be orphaned |
100
+ | Unrelated changes | Stash or commit separately with `chore:` prefix |
101
+
102
+ **NEVER merge with uncommitted story artifacts.** Files created during design, plan, or implementation that aren't committed will be silently lost or orphaned on the target branch.
103
+
104
+ <verification>
105
+ `git status` shows clean working tree (or only unrelated files explicitly acknowledged).
106
+ </verification>
107
+
108
+ ### Step 3: Merge to Development Branch
109
+
110
+ Always merge to `{dev_branch}`:
111
+
112
+ ```bash
113
+ git checkout {dev_branch}
114
+ git pull origin {dev_branch}
115
+ git merge --no-ff {story_branch} -m "feat(s{N}.{M}): merge {story-name}
116
+
117
+ Completed:
118
+ - [summary of deliverables]
119
+
120
+ Co-Authored-By: Rai <rai@humansys.ai>"
121
+ ```
122
+
123
+ <verification>
124
+ Merge commit created on `{dev_branch}`.
125
+ </verification>
126
+
127
+ <if-blocked>
128
+ Merge conflicts → resolve preserving story work.
129
+ </if-blocked>
130
+
131
+ ### Step 4: Update Epic Scope
132
+
133
+ Mark story complete in `work/epics/e{N}-{name}/scope.md`:
134
+ - Check the story checkbox: `- [x] S{N}.{M} {name} ✓`
135
+ - Update progress tracking table (status, actual time, velocity)
136
+
137
+ <verification>
138
+ Epic scope reflects story completion.
139
+ </verification>
140
+
141
+ ### Step 5: Delete Story Branch
142
+
143
+ ```bash
144
+ git branch -D story/s{N}.{M}/{slug}
145
+ git push origin --delete story/s{N}.{M}/{slug} 2>/dev/null || true
146
+ ```
147
+
148
+ <verification>
149
+ Story branch deleted (local and remote).
150
+ </verification>
151
+
152
+ ### Step 6: Update Context & Emit
153
+
154
+ 1. Update `CLAUDE.local.md` to reflect completion and next story
155
+ 2. Emit telemetry: `rai signal emit-work story S{N}.{M} --event complete`
156
+ 3. If the story has a backlog ticket: `rai backlog transition {story_key} done`
157
+
158
+ | Condition | Action |
159
+ |-----------|--------|
160
+ | Transition succeeds | Continue |
161
+ | Transition fails | Log warning and continue — backlog errors are **non-blocking** for lifecycle |
162
+ | No ticket | Skip backlog transition |
163
+
164
+ <verification>
165
+ Local context updated. Telemetry emitted.
166
+ </verification>
167
+
168
+ <if-blocked>
169
+ Adapter not configured or transition fails → log and continue. Backlog sync is best-effort; it must never block story close.
170
+ </if-blocked>
171
+
172
+ ## Output
173
+
174
+ | Item | Destination |
175
+ |------|-------------|
176
+ | Merge commit | `{dev_branch}` with `--no-ff` |
177
+ | Epic update | `work/epics/e{N}-{name}/scope.md` |
178
+ | Branch cleanup | Story branch deleted |
179
+ | Backlog update | via `rai backlog transition` (best-effort) |
180
+ | Context update | `CLAUDE.local.md` |
181
+
182
+ ## Quality Checklist
183
+
184
+ - [ ] Retrospective complete before merge (gate)
185
+ - [ ] Tests pass before merge
186
+ - [ ] Merge uses `--no-ff` to preserve story history
187
+ - [ ] Story branch deleted after merge
188
+ - [ ] Epic scope updated with completion status
189
+ - [ ] Working tree clean before merge — no orphaned artifacts
190
+ - [ ] Always merge to `{dev_branch}` — never to an epic branch
191
+ - [ ] NEVER merge without retrospective — learnings compound
192
+ - [ ] NEVER leave stale branches — clean as you go
193
+
194
+ ## References
195
+
196
+ - Previous: `/rai-story-review`
197
+ - Complement: `/rai-story-start`
198
+ - Epic scope: `work/epics/e{N}-{name}/scope.md`
@@ -0,0 +1,203 @@
1
+ ---
2
+ name: rai-story-design
3
+ description: >
4
+ Create lean story specifications optimized for both human understanding
5
+ and AI alignment. Design is not optional (PAT-186) — use before /rai-story-plan
6
+ for every story to ground integration decisions.
7
+
8
+ license: MIT
9
+
10
+ metadata:
11
+ raise.work_cycle: story
12
+ raise.frequency: per-story
13
+ raise.fase: "4"
14
+ raise.prerequisites: project-backlog
15
+ raise.next: story-plan
16
+ raise.gate: ""
17
+ raise.adaptable: "true"
18
+ raise.version: "2.3.0"
19
+ raise.visibility: public
20
+ raise.output_type: story-design
21
+ raise.inputs: |
22
+ - story_md: file_path, required, previous_skill
23
+ - scope_md: file_path, optional, previous_skill
24
+ raise.outputs: |
25
+ - design_yaml: file_path, .raise/artifacts/
26
+ - design_md: file_path, next_skill
27
+ ---
28
+
29
+ # Story Design
30
+
31
+ ## Purpose
32
+
33
+ Create a lean story specification optimized for both human review (clear intent) and AI alignment (accurate code generation).
34
+
35
+ ## Mastery Levels (ShuHaRi)
36
+
37
+ - **Shu**: Follow all steps, include examples for every story
38
+ - **Ha**: Skip optional sections for simple stories, adjust detail to complexity
39
+ - **Ri**: Custom spec patterns for specialized domains
40
+
41
+ ## Context
42
+
43
+ **When to use:** Before planning any story that involves architectural decisions, multiple approaches, or >3 components.
44
+
45
+ **When to skip:** Simple stories (<3 components, obvious implementation) → go to `/rai-story-plan`.
46
+
47
+ **Inputs:** Story from backlog, User Story artifact (`story.md` from `/rai-story-start`), epic scope/design documents.
48
+
49
+ ## Steps
50
+
51
+ ### Step 1: Assess Complexity
52
+
53
+ | Criterion | Simple | Moderate | Complex |
54
+ |-----------|--------|----------|---------|
55
+ | Components | 1-2 | 3-4 | 5+ |
56
+ | Story points | <5 | 5-8 | >8 |
57
+ | External integrations | 0-1 | 2-3 | 4+ |
58
+ | Algorithm complexity | Trivial | Custom logic | Novel |
59
+
60
+ | Result | Action |
61
+ |--------|--------|
62
+ | Simple | Skip design → `/rai-story-plan` |
63
+ | Moderate | Core sections only |
64
+ | Complex | Full spec with optional sections |
65
+
66
+ **Risk gate:** If story is marked HIGH RISK in epic scope, discuss risks before designing — name concerns, failure modes, and scope boundaries.
67
+
68
+ **UX gate:** If story touches human interaction (workflows, prompts, DX), recommend `/rai-research` first (~10 min, PAT-E-263).
69
+
70
+ **Integration gate (PAT-E-539):** If story name includes "dogfood", "E2E", or "integration", OR if epic has separate client/server stories developed with mocks — AC MUST include at least one scenario that runs with **real infrastructure** (docker compose, actual DB, real HTTP calls). Unit tests with mocks cannot catch cross-component contract mismatches (auth headers, payload validation, parameter limits).
71
+
72
+ <verification>
73
+ Complexity assessed. Risk/UX/Integration gates evaluated.
74
+ </verification>
75
+
76
+ ### Step 2: Frame What & Why
77
+
78
+ Load `story.md` (from `/rai-story-start`) if it exists — use its User Story as starting frame.
79
+
80
+ - **Problem**: What gap does this fill? (1-2 sentences)
81
+ - **Value**: Why does this matter? (1-2 sentences, measurable or observable)
82
+
83
+ <verification>
84
+ Can explain to non-technical stakeholder in 30 seconds.
85
+ </verification>
86
+
87
+ ### Step 3: Describe Approach
88
+
89
+ Document WHAT you're building and WHY this approach (not detailed HOW):
90
+ - Solution approach (1-2 sentences)
91
+ - Components affected (list with change type: create/modify/delete)
92
+
93
+ **For refactoring:** grep all call sites of the target. A half-migration is worse than none.
94
+
95
+ **For data mutations:** What happens when inputs reference missing entities? Declare the strategy explicitly: reject with error, skip + report count, partial success with warnings. Silent drops are semantic bugs (PAT-E-523).
96
+
97
+ **Value preservation gate (PAT-E-572):** Before finalizing components, ask: "What domain knowledge does this layer provide that a generic pass-through wouldn't?" If the answer is "none", the design may be over-abstracted. If the answer involves config/resolution/mapping that an existing pattern handles differently, check where that responsibility lives in the proven pattern. KISS means simplest that serves the purpose — removing domain intelligence to reduce LOC removes the value proposition.
98
+
99
+ For complex stories, add: scenarios (Gherkin), algorithm pseudocode, constraints, testing strategy.
100
+
101
+ <verification>
102
+ Approach is concrete enough to envision examples. Value preservation gate passed.
103
+ </verification>
104
+
105
+ ### Step 4: Create Examples (MOST IMPORTANT)
106
+
107
+ **This section drives AI code generation accuracy more than any other.**
108
+
109
+ Provide concrete, runnable examples:
110
+ 1. **API/CLI usage** — how the story is invoked
111
+ 2. **Expected output** — success + error cases
112
+ 3. **Data structures** — key models, schemas, types
113
+
114
+ Use concrete values (not placeholders), correct syntax (not pseudocode), consistent with codebase style.
115
+
116
+ <verification>
117
+ Examples are concrete, runnable, and cover success + error paths.
118
+ </verification>
119
+
120
+ <if-blocked>
121
+ Can't envision examples → approach not concrete enough, return to Step 3.
122
+ </if-blocked>
123
+
124
+ ### Step 5: Define Acceptance Criteria
125
+
126
+ If `story.md` has Gherkin AC, reference them here — refine, don't duplicate. If no `story.md`, define from scratch:
127
+
128
+ - **MUST**: Required for completion (3-5 items, specific and testable)
129
+ - **SHOULD**: Nice-to-have (1-3 items)
130
+ - **MUST NOT**: Explicit anti-requirements
131
+
132
+ All criteria must be observable outcomes traceable to value from Step 2.
133
+
134
+ <verification>
135
+ Criteria are specific, testable, and traceable. Spec reviewable in <5 minutes.
136
+ </verification>
137
+
138
+ ## Output
139
+
140
+ After completing all steps, produce the design in two locations:
141
+
142
+ ### 1. Typed artifact (source of truth)
143
+
144
+ Write a YAML artifact to `.raise/artifacts/s{N}.{M}-design.yaml` with this structure:
145
+
146
+ ```yaml
147
+ artifact_type: story-design
148
+ version: 1
149
+ skill: rai-story-design
150
+ created: '{ISO 8601 timestamp}'
151
+ story: 'S{N}.{M}'
152
+ epic: 'E{N}'
153
+ content:
154
+ summary: '{Problem + Value in 1-2 sentences}'
155
+ complexity: simple|moderate|complex
156
+ acceptance_criteria:
157
+ - id: AC1
158
+ description: '{criterion text}'
159
+ verifiable: true
160
+ integration_points:
161
+ - module: '{dotted.module.path}'
162
+ change_type: new|modification|deletion
163
+ files: ['{relative/path.py}']
164
+ decisions:
165
+ - id: D1
166
+ choice: '{what was chosen}'
167
+ rationale: '{why}'
168
+ alternatives_considered: ['{alt1}', '{alt2}']
169
+ refs:
170
+ backlog_item: '{RAISE-NNN}'
171
+ epic_scope: 'work/epics/e{N}-{name}/scope.md'
172
+ metadata: {}
173
+ ```
174
+
175
+ ### 2. Human-readable Markdown
176
+
177
+ Write the design as `work/epics/e{N}-{name}/stories/s{N}.{M}-design.md` — colocated with other story artifacts (story.md, scope.md, plan.md, retrospective.md).
178
+
179
+ | Item | Destination |
180
+ |------|-------------|
181
+ | Typed artifact | `.raise/artifacts/s{N}.{M}-design.yaml` |
182
+ | Design document | `work/epics/e{N}-{name}/stories/s{N}.{M}-design.md` |
183
+ | Next | `/rai-story-plan` |
184
+
185
+ ## Quality Checklist
186
+
187
+ - [ ] Complexity assessed — design depth matches complexity
188
+ - [ ] What & Why clear in <2 minutes
189
+ - [ ] Examples are concrete and runnable (100% coverage)
190
+ - [ ] Acceptance criteria specific and testable (3-5 MUST items)
191
+ - [ ] Risk/UX/Integration gates evaluated before designing (PAT-E-539)
192
+ - [ ] Data mutation stories declare missing-entity strategy (PAT-E-523)
193
+ - [ ] Value preservation gate: domain intelligence preserved, not simplified away (PAT-E-572)
194
+ - [ ] Spec creation <30 minutes, review <5 minutes
195
+ - [ ] NEVER over-specify HOW — trust AI for implementation details
196
+ - [ ] NEVER skip examples — they are the most important section
197
+
198
+ ## References
199
+
200
+ - Next: `/rai-story-plan`
201
+ - Risk assessment: PAT-186 (design not optional)
202
+ - UX research gate: PAT-E-263
203
+ - Value preservation gate: PAT-E-572