rai-cli 2.0.0a1__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.
- rai_cli/__init__.py +38 -0
- rai_cli/__main__.py +30 -0
- rai_cli/cli/__init__.py +3 -0
- rai_cli/cli/commands/__init__.py +3 -0
- rai_cli/cli/commands/base.py +101 -0
- rai_cli/cli/commands/discover.py +547 -0
- rai_cli/cli/commands/init.py +460 -0
- rai_cli/cli/commands/memory.py +1626 -0
- rai_cli/cli/commands/profile.py +51 -0
- rai_cli/cli/commands/session.py +264 -0
- rai_cli/cli/commands/skill.py +226 -0
- rai_cli/cli/error_handler.py +158 -0
- rai_cli/cli/main.py +137 -0
- rai_cli/config/__init__.py +11 -0
- rai_cli/config/paths.py +309 -0
- rai_cli/config/settings.py +180 -0
- rai_cli/context/__init__.py +42 -0
- rai_cli/context/analyzers/__init__.py +16 -0
- rai_cli/context/analyzers/models.py +36 -0
- rai_cli/context/analyzers/protocol.py +43 -0
- rai_cli/context/analyzers/python.py +291 -0
- rai_cli/context/builder.py +1566 -0
- rai_cli/context/diff.py +213 -0
- rai_cli/context/extractors/__init__.py +13 -0
- rai_cli/context/extractors/skills.py +121 -0
- rai_cli/context/graph.py +300 -0
- rai_cli/context/models.py +134 -0
- rai_cli/context/query.py +507 -0
- rai_cli/core/__init__.py +37 -0
- rai_cli/core/files.py +66 -0
- rai_cli/core/text.py +174 -0
- rai_cli/core/tools.py +441 -0
- rai_cli/discovery/__init__.py +50 -0
- rai_cli/discovery/analyzer.py +601 -0
- rai_cli/discovery/drift.py +355 -0
- rai_cli/discovery/scanner.py +1200 -0
- rai_cli/engines/__init__.py +3 -0
- rai_cli/exceptions.py +200 -0
- rai_cli/governance/__init__.py +11 -0
- rai_cli/governance/extractor.py +311 -0
- rai_cli/governance/models.py +132 -0
- rai_cli/governance/parsers/__init__.py +35 -0
- rai_cli/governance/parsers/adr.py +255 -0
- rai_cli/governance/parsers/backlog.py +302 -0
- rai_cli/governance/parsers/constitution.py +100 -0
- rai_cli/governance/parsers/epic.py +299 -0
- rai_cli/governance/parsers/glossary.py +297 -0
- rai_cli/governance/parsers/guardrails.py +326 -0
- rai_cli/governance/parsers/prd.py +93 -0
- rai_cli/governance/parsers/vision.py +97 -0
- rai_cli/handlers/__init__.py +3 -0
- rai_cli/memory/__init__.py +58 -0
- rai_cli/memory/loader.py +247 -0
- rai_cli/memory/migration.py +247 -0
- rai_cli/memory/models.py +169 -0
- rai_cli/memory/writer.py +485 -0
- rai_cli/onboarding/__init__.py +96 -0
- rai_cli/onboarding/bootstrap.py +164 -0
- rai_cli/onboarding/claudemd.py +209 -0
- rai_cli/onboarding/conventions.py +742 -0
- rai_cli/onboarding/detection.py +155 -0
- rai_cli/onboarding/governance.py +443 -0
- rai_cli/onboarding/manifest.py +101 -0
- rai_cli/onboarding/memory_md.py +387 -0
- rai_cli/onboarding/migration.py +207 -0
- rai_cli/onboarding/profile.py +457 -0
- rai_cli/onboarding/skills.py +114 -0
- rai_cli/output/__init__.py +28 -0
- rai_cli/output/console.py +394 -0
- rai_cli/output/formatters/__init__.py +9 -0
- rai_cli/output/formatters/discover.py +442 -0
- rai_cli/output/formatters/skill.py +293 -0
- rai_cli/rai_base/__init__.py +22 -0
- rai_cli/rai_base/framework/__init__.py +7 -0
- rai_cli/rai_base/framework/methodology.yaml +235 -0
- rai_cli/rai_base/governance/__init__.py +1 -0
- rai_cli/rai_base/governance/architecture/__init__.py +1 -0
- rai_cli/rai_base/governance/architecture/domain-model.md +20 -0
- rai_cli/rai_base/governance/architecture/system-context.md +34 -0
- rai_cli/rai_base/governance/architecture/system-design.md +24 -0
- rai_cli/rai_base/governance/backlog.md +8 -0
- rai_cli/rai_base/governance/guardrails.md +18 -0
- rai_cli/rai_base/governance/prd.md +25 -0
- rai_cli/rai_base/governance/vision.md +16 -0
- rai_cli/rai_base/identity/__init__.py +8 -0
- rai_cli/rai_base/identity/core.md +119 -0
- rai_cli/rai_base/identity/perspective.md +119 -0
- rai_cli/rai_base/memory/__init__.py +7 -0
- rai_cli/rai_base/memory/patterns-base.jsonl +20 -0
- rai_cli/schemas/__init__.py +3 -0
- rai_cli/schemas/session_state.py +106 -0
- rai_cli/session/__init__.py +5 -0
- rai_cli/session/bundle.py +389 -0
- rai_cli/session/close.py +255 -0
- rai_cli/session/state.py +108 -0
- rai_cli/skills/__init__.py +44 -0
- rai_cli/skills/locator.py +129 -0
- rai_cli/skills/name_checker.py +203 -0
- rai_cli/skills/parser.py +145 -0
- rai_cli/skills/scaffold.py +185 -0
- rai_cli/skills/schema.py +130 -0
- rai_cli/skills/validator.py +172 -0
- rai_cli/skills_base/__init__.py +59 -0
- rai_cli/skills_base/rai-debug/SKILL.md +296 -0
- rai_cli/skills_base/rai-discover-document/SKILL.md +292 -0
- rai_cli/skills_base/rai-discover-scan/SKILL.md +325 -0
- rai_cli/skills_base/rai-discover-start/SKILL.md +213 -0
- rai_cli/skills_base/rai-discover-validate/SKILL.md +310 -0
- rai_cli/skills_base/rai-epic-close/SKILL.md +369 -0
- rai_cli/skills_base/rai-epic-design/SKILL.md +622 -0
- rai_cli/skills_base/rai-epic-plan/SKILL.md +672 -0
- rai_cli/skills_base/rai-epic-plan/_references/sequencing-strategies.md +67 -0
- rai_cli/skills_base/rai-epic-start/SKILL.md +217 -0
- rai_cli/skills_base/rai-project-create/SKILL.md +455 -0
- rai_cli/skills_base/rai-project-onboard/SKILL.md +503 -0
- rai_cli/skills_base/rai-research/SKILL.md +264 -0
- rai_cli/skills_base/rai-research/references/research-prompt-template.md +317 -0
- rai_cli/skills_base/rai-session-close/SKILL.md +151 -0
- rai_cli/skills_base/rai-session-start/SKILL.md +110 -0
- rai_cli/skills_base/rai-story-close/SKILL.md +367 -0
- rai_cli/skills_base/rai-story-design/SKILL.md +339 -0
- rai_cli/skills_base/rai-story-design/references/tech-design-story-v2.md +293 -0
- rai_cli/skills_base/rai-story-implement/SKILL.md +256 -0
- rai_cli/skills_base/rai-story-plan/SKILL.md +307 -0
- rai_cli/skills_base/rai-story-review/SKILL.md +276 -0
- rai_cli/skills_base/rai-story-start/SKILL.md +288 -0
- rai_cli/telemetry/__init__.py +42 -0
- rai_cli/telemetry/schemas.py +285 -0
- rai_cli/telemetry/writer.py +210 -0
- rai_cli/viz/__init__.py +7 -0
- rai_cli/viz/generator.py +404 -0
- rai_cli-2.0.0a1.dist-info/METADATA +289 -0
- rai_cli-2.0.0a1.dist-info/RECORD +137 -0
- rai_cli-2.0.0a1.dist-info/WHEEL +4 -0
- rai_cli-2.0.0a1.dist-info/entry_points.txt +2 -0
- rai_cli-2.0.0a1.dist-info/licenses/LICENSE +190 -0
- rai_cli-2.0.0a1.dist-info/licenses/NOTICE +4 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rai-project-create
|
|
3
|
+
description: >
|
|
4
|
+
Guide greenfield project setup through conversation. Fills governance templates
|
|
5
|
+
with project-specific content and builds the knowledge graph. Use after rai init
|
|
6
|
+
on a new project.
|
|
7
|
+
|
|
8
|
+
license: MIT
|
|
9
|
+
|
|
10
|
+
metadata:
|
|
11
|
+
raise.work_cycle: utility
|
|
12
|
+
raise.frequency: on-demand
|
|
13
|
+
raise.fase: ""
|
|
14
|
+
raise.prerequisites: ""
|
|
15
|
+
raise.next: "session-start"
|
|
16
|
+
raise.gate: "raise memory build produces 30+ governance nodes"
|
|
17
|
+
raise.adaptable: "true"
|
|
18
|
+
raise.version: "1.0.0"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Project Create: Greenfield Onboarding
|
|
22
|
+
|
|
23
|
+
## Purpose
|
|
24
|
+
|
|
25
|
+
Guide a developer through greenfield project setup via conversation. Collect project identity, requirements, constraints, and architecture context, then fill governance templates with parser-compatible content. Final gate: `rai memory build` produces 30+ governance nodes, making `/rai-session-start` immediately useful.
|
|
26
|
+
|
|
27
|
+
## Mastery Levels (ShuHaRi)
|
|
28
|
+
|
|
29
|
+
**Shu (守)**: Walk through every step with explanations. Show what each governance doc is for and why the format matters. Confirm each doc before writing.
|
|
30
|
+
|
|
31
|
+
**Ha (破)**: Collect info conversationally, confirm the full set before writing. Skip explanations of governance concepts.
|
|
32
|
+
|
|
33
|
+
**Ri (離)**: Collect all info in 1-2 exchanges. Write all docs. Build graph. Done.
|
|
34
|
+
|
|
35
|
+
## Context
|
|
36
|
+
|
|
37
|
+
**When to use:**
|
|
38
|
+
- After `rai init` on a new (greenfield) project
|
|
39
|
+
- When `governance/` exists but contains only placeholder templates
|
|
40
|
+
- When starting a project from scratch
|
|
41
|
+
|
|
42
|
+
**When to skip:**
|
|
43
|
+
- Project already has filled governance docs (non-placeholder content)
|
|
44
|
+
- Brownfield project with existing code → use `/rai-project-onboard` instead
|
|
45
|
+
- Project not yet initialized → run `rai init` first
|
|
46
|
+
|
|
47
|
+
**Inputs required:**
|
|
48
|
+
- A project with `rai init` already completed (`governance/` directory exists)
|
|
49
|
+
- Developer's knowledge of what they're building
|
|
50
|
+
|
|
51
|
+
**Output:**
|
|
52
|
+
- 6 governance docs filled with project-specific content
|
|
53
|
+
- Knowledge graph with 30+ governance nodes
|
|
54
|
+
- Project ready for `/rai-session-start`
|
|
55
|
+
|
|
56
|
+
## Steps
|
|
57
|
+
|
|
58
|
+
### Step 1: Verify Prerequisites (Poka-Yoke)
|
|
59
|
+
|
|
60
|
+
Check that the project is ready for greenfield onboarding.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ls governance/prd.md governance/vision.md governance/guardrails.md governance/backlog.md governance/architecture/system-context.md governance/architecture/system-design.md 2>/dev/null | wc -l
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Decision:**
|
|
67
|
+
- 6 files found → Continue (templates exist from `rai init`)
|
|
68
|
+
- 0 files → **STOP.** Tell the user: "Run `rai init` first to scaffold governance templates."
|
|
69
|
+
- Some but not all → Warn and continue with available templates
|
|
70
|
+
|
|
71
|
+
**Also check for existing content:**
|
|
72
|
+
```bash
|
|
73
|
+
grep -L "<!-- " governance/*.md governance/architecture/*.md 2>/dev/null
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Files without HTML comment placeholders likely have real content already.
|
|
77
|
+
|
|
78
|
+
- All have placeholders → Fresh templates, proceed normally
|
|
79
|
+
- Some have content → Ask user: "These docs already have content: [list]. Overwrite or skip?"
|
|
80
|
+
|
|
81
|
+
**Also check for brownfield signals:**
|
|
82
|
+
```bash
|
|
83
|
+
ls src/ lib/ app/ *.py *.ts *.js 2>/dev/null | head -5
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If source code exists, suggest: "This looks like an existing project. Consider `/rai-project-onboard` instead for brownfield analysis."
|
|
87
|
+
|
|
88
|
+
**Verification:** Governance templates exist and are ready to fill.
|
|
89
|
+
|
|
90
|
+
> **If you can't continue:** No governance/ → Run `rai init` first. Always.
|
|
91
|
+
|
|
92
|
+
### Step 2: Collect Project Identity
|
|
93
|
+
|
|
94
|
+
Ask the developer about their project. This is the foundation — everything else builds on it.
|
|
95
|
+
|
|
96
|
+
**Ask:**
|
|
97
|
+
> "What are you building? Give me:
|
|
98
|
+
> 1. **Project name** (one word or short phrase)
|
|
99
|
+
> 2. **One-paragraph description** — what it is, who it's for, why it exists"
|
|
100
|
+
|
|
101
|
+
**What you need from this:**
|
|
102
|
+
- Project name (used in all doc headers)
|
|
103
|
+
- Description paragraph (goes into `vision.md` Identity section)
|
|
104
|
+
- Enough context to ask good follow-up questions
|
|
105
|
+
|
|
106
|
+
**Verification:** You have a project name and a description paragraph.
|
|
107
|
+
|
|
108
|
+
> **If you can't continue:** User gives vague answer → Ask clarifying questions. "Who uses this? What problem does it solve?"
|
|
109
|
+
|
|
110
|
+
### Step 3: Collect Goals and Requirements
|
|
111
|
+
|
|
112
|
+
Ask about core capabilities. These become the RF-XX requirements in `prd.md`.
|
|
113
|
+
|
|
114
|
+
**Ask:**
|
|
115
|
+
> "What are the 3-5 core things [project name] must do? Think features, not implementation."
|
|
116
|
+
|
|
117
|
+
**What you need:**
|
|
118
|
+
- 3-5 features from the user, which you'll decompose into **5-8 RF-XX requirements** (split broad features into specific capabilities)
|
|
119
|
+
- Enough detail to write 2-3 sentence descriptions per requirement
|
|
120
|
+
- Understanding of the problem being solved (for PRD Problem section)
|
|
121
|
+
|
|
122
|
+
**Also collect:**
|
|
123
|
+
- What success looks like (PRD Goals section)
|
|
124
|
+
- Key outcomes (vision.md Outcomes table)
|
|
125
|
+
|
|
126
|
+
**Verification:** You have 3-5 capabilities and understand the problem space.
|
|
127
|
+
|
|
128
|
+
> **If you can't continue:** User lists implementation details instead of features → Redirect: "Those sound like HOW. What does the user GET?"
|
|
129
|
+
|
|
130
|
+
### Step 4: Collect Quality Constraints
|
|
131
|
+
|
|
132
|
+
Ask about standards and guardrails. These become entries in `guardrails.md`.
|
|
133
|
+
|
|
134
|
+
**Ask:**
|
|
135
|
+
> "What quality standards matter for [project name]? For example:
|
|
136
|
+
> - Testing: coverage targets, test types
|
|
137
|
+
> - Code quality: type safety, linting, style
|
|
138
|
+
> - Security: authentication, data handling
|
|
139
|
+
> - Performance: response times, throughput
|
|
140
|
+
> - Architecture: patterns, boundaries"
|
|
141
|
+
|
|
142
|
+
**What you need:**
|
|
143
|
+
- At least 5 guardrails across 2+ categories
|
|
144
|
+
- Each with: ID, level (MUST/SHOULD), description, verification command
|
|
145
|
+
- Categories map to guardrails.md sections (Code Quality, Testing, Security, etc.)
|
|
146
|
+
|
|
147
|
+
**Default guardrails** (include unless user opts out):
|
|
148
|
+
- `must-code-001`: Type hints on all public APIs → `pyright --strict`
|
|
149
|
+
- `must-code-002`: Linting passes → `ruff check .`
|
|
150
|
+
- `must-test-001`: All tests pass → `pytest`
|
|
151
|
+
|
|
152
|
+
**Verification:** You have 5+ guardrails with verification commands.
|
|
153
|
+
|
|
154
|
+
> **If you can't continue:** User unsure about standards → Offer language-appropriate defaults and let them adjust.
|
|
155
|
+
|
|
156
|
+
### Step 5: Collect Architecture Context
|
|
157
|
+
|
|
158
|
+
Ask about the system's shape. This fills `system-context.md` and `system-design.md`.
|
|
159
|
+
|
|
160
|
+
**Ask:**
|
|
161
|
+
> "Let's sketch the architecture:
|
|
162
|
+
> 1. **Who/what uses [project name]?** (users, other systems, APIs)
|
|
163
|
+
> 2. **What external systems does it talk to?** (databases, APIs, services)
|
|
164
|
+
> 3. **What are the main components inside?** (modules, layers, services)"
|
|
165
|
+
|
|
166
|
+
**What you need:**
|
|
167
|
+
- External actors and systems (system-context.md)
|
|
168
|
+
- External interfaces with direction and protocol (system-context.md table)
|
|
169
|
+
- Internal components with responsibilities and technology (system-design.md table)
|
|
170
|
+
|
|
171
|
+
**Verification:** You have external actors, interfaces, and internal components.
|
|
172
|
+
|
|
173
|
+
> **If you can't continue:** User hasn't thought about architecture yet → Help them think through it: "If someone drew a box for [project name], what goes in and what connects to it?"
|
|
174
|
+
|
|
175
|
+
### Step 6: Generate and Write Governance Docs
|
|
176
|
+
|
|
177
|
+
Now write all 6 governance docs with the collected information. **CRITICAL:** Follow the exact format for each doc — the graph parsers use regex patterns to extract nodes.
|
|
178
|
+
|
|
179
|
+
#### 6a: Write `governance/vision.md`
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
# Solution Vision: {project_name}
|
|
183
|
+
|
|
184
|
+
> Solution vision
|
|
185
|
+
|
|
186
|
+
## Identity
|
|
187
|
+
|
|
188
|
+
### Description
|
|
189
|
+
|
|
190
|
+
{One-paragraph description from Step 2}
|
|
191
|
+
|
|
192
|
+
## Outcomes
|
|
193
|
+
|
|
194
|
+
| **Outcome** | **Description** |
|
|
195
|
+
|-------------|-----------------|
|
|
196
|
+
| **{Outcome 1 Name}** | {Description from Step 3} |
|
|
197
|
+
| **{Outcome 2 Name}** | {Description from Step 3} |
|
|
198
|
+
| **{Outcome 3 Name}** | {Description from Step 3} |
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**IMPORTANT — Parser contract for vision.md:**
|
|
202
|
+
- Outcomes table MUST have `| **Outcome** |` as header (bold first column)
|
|
203
|
+
- Each data row MUST be `| **{Bold Name}** | {description} |`
|
|
204
|
+
- Parser regex: `\|\s*\*\*([^*]+)\*\*\s*\|\s*(.+?)\s*\|`
|
|
205
|
+
- Aim for 3-5 outcome rows
|
|
206
|
+
|
|
207
|
+
#### 6b: Write `governance/prd.md`
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
# PRD: {project_name}
|
|
211
|
+
|
|
212
|
+
> Product Requirements Document
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Problem
|
|
217
|
+
|
|
218
|
+
{Problem description from Step 3 — 2-3 sentences}
|
|
219
|
+
|
|
220
|
+
## Goals
|
|
221
|
+
|
|
222
|
+
{Success criteria from Step 3 — bullet list}
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Requirements
|
|
227
|
+
|
|
228
|
+
### RF-01: {Requirement 1 Title}
|
|
229
|
+
|
|
230
|
+
{2-3 sentence description of the capability}
|
|
231
|
+
|
|
232
|
+
### RF-02: {Requirement 2 Title}
|
|
233
|
+
|
|
234
|
+
{2-3 sentence description}
|
|
235
|
+
|
|
236
|
+
### RF-03: {Requirement 3 Title}
|
|
237
|
+
|
|
238
|
+
{2-3 sentence description}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**IMPORTANT — Parser contract for prd.md:**
|
|
242
|
+
- Each requirement MUST be `### RF-XX: Title` (### heading, RF- prefix, dash-digits, colon, space, title)
|
|
243
|
+
- Parser regex: `^### (RF-\d+):\s*(.+)$`
|
|
244
|
+
- Content below the heading is captured as the requirement body (up to next ### or 20 lines)
|
|
245
|
+
- Aim for 3-5 requirements (RF-01 through RF-05)
|
|
246
|
+
|
|
247
|
+
#### 6c: Write `governance/guardrails.md`
|
|
248
|
+
|
|
249
|
+
```markdown
|
|
250
|
+
---
|
|
251
|
+
type: guardrails
|
|
252
|
+
version: "1.0.0"
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
# Guardrails: {project_name}
|
|
256
|
+
|
|
257
|
+
> Code and architecture guardrails
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Guardrails Activos
|
|
262
|
+
|
|
263
|
+
### Code Quality
|
|
264
|
+
|
|
265
|
+
| ID | Level | Guardrail | Verification | Derived from |
|
|
266
|
+
|----|-------|-----------|--------------|--------------|
|
|
267
|
+
| must-code-001 | MUST | {description} | {command} | RF-01 |
|
|
268
|
+
| must-code-002 | MUST | {description} | {command} | RF-01 |
|
|
269
|
+
|
|
270
|
+
### Testing
|
|
271
|
+
|
|
272
|
+
| ID | Level | Guardrail | Verification | Derived from |
|
|
273
|
+
|----|-------|-----------|--------------|--------------|
|
|
274
|
+
| must-test-001 | MUST | {description} | {command} | RF-01 |
|
|
275
|
+
|
|
276
|
+
### Security
|
|
277
|
+
|
|
278
|
+
| ID | Level | Guardrail | Verification | Derived from |
|
|
279
|
+
|----|-------|-----------|--------------|--------------|
|
|
280
|
+
| must-sec-001 | MUST | {description} | {command} | RF-01 |
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**IMPORTANT — Parser contract for guardrails.md:**
|
|
284
|
+
- MUST have YAML frontmatter with `type: guardrails`
|
|
285
|
+
- Table under `### {Section Name}` heading
|
|
286
|
+
- Table MUST have header: `| ID | Level | Guardrail | Verification | Derived from |`
|
|
287
|
+
- ID format: `{level}-{category}-{NNN}` (e.g., `must-code-001`, `should-perf-001`)
|
|
288
|
+
- Level: `MUST` or `SHOULD`
|
|
289
|
+
- Aim for 5-10 guardrails across 2-4 sections
|
|
290
|
+
|
|
291
|
+
#### 6d: Write `governance/backlog.md`
|
|
292
|
+
|
|
293
|
+
```markdown
|
|
294
|
+
# Backlog: {project_name}
|
|
295
|
+
|
|
296
|
+
> **Status**: Draft
|
|
297
|
+
|
|
298
|
+
## Epics
|
|
299
|
+
|
|
300
|
+
| ID | Epic | Status | Scope | Priority |
|
|
301
|
+
|----|------|--------|-------|----------|
|
|
302
|
+
| E1 | {First epic name} | Draft | — | P1 |
|
|
303
|
+
| E2 | {Second epic name} | Draft | — | P2 |
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**IMPORTANT — Parser contract for backlog.md:**
|
|
307
|
+
- Header MUST be `# Backlog: {project_name}` (exact format)
|
|
308
|
+
- Epic table rows: `| E{N} | Name | Status | Scope | Priority |`
|
|
309
|
+
- Parser regex for header: `^# Backlog:\s*(.+)$`
|
|
310
|
+
- Parser regex for epics: `^\|\s*(E\d+)\s*\|`
|
|
311
|
+
- Aim for 2-4 epics derived from the requirements
|
|
312
|
+
|
|
313
|
+
#### 6e: Write `governance/architecture/system-context.md`
|
|
314
|
+
|
|
315
|
+
```markdown
|
|
316
|
+
# System Context: {project_name}
|
|
317
|
+
|
|
318
|
+
> C4 Level 1 — System Context diagram and description
|
|
319
|
+
|
|
320
|
+
## Overview
|
|
321
|
+
|
|
322
|
+
{High-level description from Step 5 — what is this system and who uses it?}
|
|
323
|
+
|
|
324
|
+
## Context Diagram
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
┌──────────┐ ┌──────────────┐ ┌──────────┐
|
|
328
|
+
│ {Actor} │──────►│ {project_name} │◄──────│ {System} │
|
|
329
|
+
│ │ │ │ │ │
|
|
330
|
+
└──────────┘ └──────────────┘ └──────────┘
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## External Interfaces
|
|
334
|
+
|
|
335
|
+
| System | Direction | Protocol | Description |
|
|
336
|
+
|--------|-----------|----------|-------------|
|
|
337
|
+
| {System 1} | {Inbound/Outbound/Both} | {HTTP/CLI/SQL/etc} | {What it does} |
|
|
338
|
+
| {System 2} | {Direction} | {Protocol} | {Description} |
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
#### 6f: Write `governance/architecture/system-design.md`
|
|
342
|
+
|
|
343
|
+
```markdown
|
|
344
|
+
# System Design: {project_name}
|
|
345
|
+
|
|
346
|
+
> C4 Level 2 — Container/component decomposition
|
|
347
|
+
|
|
348
|
+
## Architecture Overview
|
|
349
|
+
|
|
350
|
+
{Architecture description from Step 5}
|
|
351
|
+
|
|
352
|
+
## Components
|
|
353
|
+
|
|
354
|
+
| Component | Responsibility | Technology |
|
|
355
|
+
|-----------|---------------|------------|
|
|
356
|
+
| {Component 1} | {What it does} | {Tech stack} |
|
|
357
|
+
| {Component 2} | {What it does} | {Tech stack} |
|
|
358
|
+
|
|
359
|
+
## Key Decisions
|
|
360
|
+
|
|
361
|
+
- {Any architectural decisions mentioned in conversation}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Verification:** All 6 governance docs written with project-specific content. No HTML comment placeholders remain.
|
|
365
|
+
|
|
366
|
+
> **If you can't continue:** Write fails → Check file permissions. Governance dir should be writable.
|
|
367
|
+
|
|
368
|
+
### Step 7: Build Graph and Verify (Gate)
|
|
369
|
+
|
|
370
|
+
Run the graph builder and verify the 30+ node gate.
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
rai memory build
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
**Expected output:** The build should show governance nodes extracted from each doc.
|
|
377
|
+
|
|
378
|
+
**Verification gate:**
|
|
379
|
+
```bash
|
|
380
|
+
rai memory query "requirement outcome guardrail" --types requirement,outcome,guardrail --limit 50
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Count the governance nodes. You need **30+ total** across these types:
|
|
384
|
+
- Requirements (from prd.md): ~5-8 nodes (RF-01 through RF-05+)
|
|
385
|
+
- Outcomes (from vision.md): ~5-7 nodes (bold-pipe table rows)
|
|
386
|
+
- Guardrails (from guardrails.md): ~10-13 nodes (table rows across sections)
|
|
387
|
+
- Project (from backlog.md): 1 node
|
|
388
|
+
- Epics (from backlog.md): ~3-5 nodes (table rows)
|
|
389
|
+
- Architecture docs don't produce individual nodes but enrich the graph context
|
|
390
|
+
|
|
391
|
+
**Decision:**
|
|
392
|
+
- 30+ nodes → **Gate passed.** Continue to summary.
|
|
393
|
+
- <30 nodes → Investigate which docs didn't parse. Check format against parser contract in Step 6. Fix and rebuild.
|
|
394
|
+
|
|
395
|
+
**Verification:** `rai memory build` succeeds and produces 30+ governance nodes.
|
|
396
|
+
|
|
397
|
+
> **If you can't continue:** Nodes too low → Most common cause is format mismatch. Check RF-XX headings, bold-pipe tables, guardrail IDs, backlog header. Fix the specific doc and rebuild.
|
|
398
|
+
|
|
399
|
+
### Step 8: Summary and Next Steps
|
|
400
|
+
|
|
401
|
+
Present what was created and what to do next.
|
|
402
|
+
|
|
403
|
+
**Display:**
|
|
404
|
+
```
|
|
405
|
+
## Project Created: {project_name}
|
|
406
|
+
|
|
407
|
+
**Governance docs filled:**
|
|
408
|
+
- governance/vision.md — {N} outcomes
|
|
409
|
+
- governance/prd.md — {N} requirements
|
|
410
|
+
- governance/guardrails.md — {N} guardrails
|
|
411
|
+
- governance/backlog.md — {N} epics
|
|
412
|
+
- governance/architecture/system-context.md — context diagram + interfaces
|
|
413
|
+
- governance/architecture/system-design.md — components + decisions
|
|
414
|
+
|
|
415
|
+
**Graph:** {total} governance nodes extracted
|
|
416
|
+
|
|
417
|
+
**Next steps:**
|
|
418
|
+
1. Run `/rai-session-start` to begin your first working session
|
|
419
|
+
2. Review the generated governance docs and refine as needed
|
|
420
|
+
3. Start your first epic with `/rai-epic-design`
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Verification:** Summary displayed with node counts.
|
|
424
|
+
|
|
425
|
+
> **If you can't continue:** Everything should be done by now. If graph is still <30 nodes after fixes, proceed anyway with a warning — the user can refine docs later.
|
|
426
|
+
|
|
427
|
+
## Output
|
|
428
|
+
|
|
429
|
+
| Item | Destination |
|
|
430
|
+
|------|-------------|
|
|
431
|
+
| Filled governance docs | `governance/` (prd.md, vision.md, guardrails.md, backlog.md, architecture/) |
|
|
432
|
+
| Knowledge graph | `.raise/rai/memory/index.json` (via `rai memory build`) |
|
|
433
|
+
| Summary | Displayed to user |
|
|
434
|
+
|
|
435
|
+
## Notes
|
|
436
|
+
|
|
437
|
+
### Parser Contract
|
|
438
|
+
|
|
439
|
+
Generated content **MUST** match parser regex patterns exactly. The graph parsers extract nodes from specific Markdown structures — if the format is wrong, nodes won't be extracted and the 30+ gate will fail.
|
|
440
|
+
|
|
441
|
+
### Idempotency
|
|
442
|
+
|
|
443
|
+
The skill checks for existing non-placeholder content before writing. Docs that already have real content are skipped unless the user explicitly requests overwrite.
|
|
444
|
+
|
|
445
|
+
### Greenfield vs Brownfield
|
|
446
|
+
|
|
447
|
+
This skill is for **greenfield** projects only. It asks "what do you want to build?" — a creative conversation. For brownfield projects that need "what do you already have?", use `/rai-project-onboard` (S7.3).
|
|
448
|
+
|
|
449
|
+
## References
|
|
450
|
+
|
|
451
|
+
- Prerequisite: `rai init` (governance scaffolding from S7.1)
|
|
452
|
+
- Next: `/rai-session-start`
|
|
453
|
+
- Sibling: `/rai-project-onboard` (brownfield)
|
|
454
|
+
- Parser sources: `src/rai_cli/governance/parsers/*.py`
|
|
455
|
+
- Template sources: `src/rai_cli/rai_base/governance/*.md`
|