gru-ai 0.1.0
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.
- package/.claude/skills/brainstorm/SKILL.md +340 -0
- package/.claude/skills/code-review-excellence/SKILL.md +198 -0
- package/.claude/skills/directive/SKILL.md +121 -0
- package/.claude/skills/directive/docs/pipeline/00-delegation-and-triage.md +181 -0
- package/.claude/skills/directive/docs/pipeline/01-checkpoint.md +34 -0
- package/.claude/skills/directive/docs/pipeline/02-read-directive.md +38 -0
- package/.claude/skills/directive/docs/pipeline/03-read-context.md +15 -0
- package/.claude/skills/directive/docs/pipeline/04-challenge.md +38 -0
- package/.claude/skills/directive/docs/pipeline/05-planning.md +64 -0
- package/.claude/skills/directive/docs/pipeline/06-technical-audit.md +88 -0
- package/.claude/skills/directive/docs/pipeline/07-plan-approval.md +145 -0
- package/.claude/skills/directive/docs/pipeline/07b-project-brainstorm.md +85 -0
- package/.claude/skills/directive/docs/pipeline/08-worktree-and-state.md +50 -0
- package/.claude/skills/directive/docs/pipeline/09-execute-projects.md +709 -0
- package/.claude/skills/directive/docs/pipeline/10-wrapup.md +242 -0
- package/.claude/skills/directive/docs/pipeline/11-completion-gate.md +75 -0
- package/.claude/skills/directive/docs/reference/rules/casting-rules.md +78 -0
- package/.claude/skills/directive/docs/reference/rules/failure-handling.md +20 -0
- package/.claude/skills/directive/docs/reference/rules/phase-definitions.md +42 -0
- package/.claude/skills/directive/docs/reference/rules/scope-and-dod.md +30 -0
- package/.claude/skills/directive/docs/reference/schemas/audit-output.md +44 -0
- package/.claude/skills/directive/docs/reference/schemas/brainstorm-output.md +52 -0
- package/.claude/skills/directive/docs/reference/schemas/challenger-output.md +13 -0
- package/.claude/skills/directive/docs/reference/schemas/checkpoint.md +18 -0
- package/.claude/skills/directive/docs/reference/schemas/current-json.md +5 -0
- package/.claude/skills/directive/docs/reference/schemas/directive-json.md +143 -0
- package/.claude/skills/directive/docs/reference/schemas/investigation-output.md +37 -0
- package/.claude/skills/directive/docs/reference/schemas/plan-schema.md +103 -0
- package/.claude/skills/directive/docs/reference/templates/architect-prompt.md +66 -0
- package/.claude/skills/directive/docs/reference/templates/auditor-prompt.md +53 -0
- package/.claude/skills/directive/docs/reference/templates/brainstorm-prompt.md +68 -0
- package/.claude/skills/directive/docs/reference/templates/challenger-prompt.md +35 -0
- package/.claude/skills/directive/docs/reference/templates/digest.md +134 -0
- package/.claude/skills/directive/docs/reference/templates/investigator-prompt.md +51 -0
- package/.claude/skills/directive/docs/reference/templates/planner-prompt.md +130 -0
- package/.claude/skills/frontend-design/SKILL.md +42 -0
- package/.claude/skills/gruai-agents/SKILL.md +161 -0
- package/.claude/skills/gruai-config/SKILL.md +61 -0
- package/.claude/skills/healthcheck/SKILL.md +216 -0
- package/.claude/skills/report/SKILL.md +380 -0
- package/.claude/skills/scout/SKILL.md +452 -0
- package/.claude/skills/seo-audit/SKILL.md +107 -0
- package/.claude/skills/walkthrough/SKILL.md +274 -0
- package/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/LICENSE +21 -0
- package/README.md +206 -0
- package/cli/templates/CLAUDE.md.template +57 -0
- package/cli/templates/agent-roles/backend.md +47 -0
- package/cli/templates/agent-roles/cmo.md +52 -0
- package/cli/templates/agent-roles/content.md +48 -0
- package/cli/templates/agent-roles/coo.md +66 -0
- package/cli/templates/agent-roles/cpo.md +52 -0
- package/cli/templates/agent-roles/cto.md +63 -0
- package/cli/templates/agent-roles/data.md +46 -0
- package/cli/templates/agent-roles/design.md +46 -0
- package/cli/templates/agent-roles/frontend.md +47 -0
- package/cli/templates/agent-roles/fullstack.md +47 -0
- package/cli/templates/agent-roles/qa.md +46 -0
- package/cli/templates/backlog.json.template +3 -0
- package/cli/templates/directive.json.template +9 -0
- package/cli/templates/directive.md.template +23 -0
- package/cli/templates/goals-index.md +21 -0
- package/cli/templates/gruai.config.json.template +12 -0
- package/cli/templates/lessons.md +16 -0
- package/cli/templates/vision.md +35 -0
- package/cli/templates/welcome-directive/directive.json +9 -0
- package/cli/templates/welcome-directive/directive.md +53 -0
- package/dist/assets/GamePage-C5XQQOQH.js +49 -0
- package/dist/assets/README.md +17 -0
- package/dist/assets/characters/char_0.png +0 -0
- package/dist/assets/characters/char_1.png +0 -0
- package/dist/assets/characters/char_10.png +0 -0
- package/dist/assets/characters/char_11.png +0 -0
- package/dist/assets/characters/char_2.png +0 -0
- package/dist/assets/characters/char_3.png +0 -0
- package/dist/assets/characters/char_4.png +0 -0
- package/dist/assets/characters/char_5.png +0 -0
- package/dist/assets/characters/char_6.png +0 -0
- package/dist/assets/characters/char_7.png +0 -0
- package/dist/assets/characters/char_8.png +0 -0
- package/dist/assets/characters/char_9.png +0 -0
- package/dist/assets/index-CnTPDqpP.js +12 -0
- package/dist/assets/index-gR5q7ikB.css +1 -0
- package/dist/assets/office/furniture.png +0 -0
- package/dist/assets/office/room-builder.png +0 -0
- package/dist/index.html +16 -0
- package/dist-server/scripts/intelligence-trends.d.ts +100 -0
- package/dist-server/scripts/intelligence-trends.js +365 -0
- package/dist-server/server/actions/cleanup.d.ts +4 -0
- package/dist-server/server/actions/cleanup.js +30 -0
- package/dist-server/server/actions/send-input.d.ts +6 -0
- package/dist-server/server/actions/send-input.js +147 -0
- package/dist-server/server/actions/terminal.d.ts +4 -0
- package/dist-server/server/actions/terminal.js +427 -0
- package/dist-server/server/config.d.ts +9 -0
- package/dist-server/server/config.js +217 -0
- package/dist-server/server/db.d.ts +7 -0
- package/dist-server/server/db.js +79 -0
- package/dist-server/server/hooks/event-receiver.d.ts +11 -0
- package/dist-server/server/hooks/event-receiver.js +36 -0
- package/dist-server/server/index.d.ts +1 -0
- package/dist-server/server/index.js +552 -0
- package/dist-server/server/notifications/macos.d.ts +5 -0
- package/dist-server/server/notifications/macos.js +22 -0
- package/dist-server/server/notifications/notifier.d.ts +17 -0
- package/dist-server/server/notifications/notifier.js +110 -0
- package/dist-server/server/parsers/process-discovery.d.ts +39 -0
- package/dist-server/server/parsers/process-discovery.js +776 -0
- package/dist-server/server/parsers/session-scanner.d.ts +56 -0
- package/dist-server/server/parsers/session-scanner.js +390 -0
- package/dist-server/server/parsers/session-state.d.ts +68 -0
- package/dist-server/server/parsers/session-state.js +696 -0
- package/dist-server/server/parsers/session-state.test.d.ts +1 -0
- package/dist-server/server/parsers/session-state.test.js +950 -0
- package/dist-server/server/parsers/task-parser.d.ts +10 -0
- package/dist-server/server/parsers/task-parser.js +97 -0
- package/dist-server/server/parsers/team-parser.d.ts +3 -0
- package/dist-server/server/parsers/team-parser.js +67 -0
- package/dist-server/server/platform/__tests__/claude-code.test.d.ts +1 -0
- package/dist-server/server/platform/__tests__/claude-code.test.js +311 -0
- package/dist-server/server/platform/claude-code.d.ts +34 -0
- package/dist-server/server/platform/claude-code.js +94 -0
- package/dist-server/server/platform/index.d.ts +5 -0
- package/dist-server/server/platform/index.js +1 -0
- package/dist-server/server/platform/types.d.ts +190 -0
- package/dist-server/server/platform/types.js +9 -0
- package/dist-server/server/state/aggregator.d.ts +42 -0
- package/dist-server/server/state/aggregator.js +1080 -0
- package/dist-server/server/state/work-item-types.d.ts +555 -0
- package/dist-server/server/state/work-item-types.js +168 -0
- package/dist-server/server/types.d.ts +237 -0
- package/dist-server/server/types.js +1 -0
- package/dist-server/server/watchers/claude-watcher.d.ts +17 -0
- package/dist-server/server/watchers/claude-watcher.js +130 -0
- package/dist-server/server/watchers/context-watcher.d.ts +22 -0
- package/dist-server/server/watchers/context-watcher.js +125 -0
- package/dist-server/server/watchers/directive-watcher.d.ts +46 -0
- package/dist-server/server/watchers/directive-watcher.js +497 -0
- package/dist-server/server/watchers/session-watcher.d.ts +18 -0
- package/dist-server/server/watchers/session-watcher.js +126 -0
- package/dist-server/server/watchers/state-watcher.d.ts +36 -0
- package/dist-server/server/watchers/state-watcher.js +369 -0
- package/package.json +68 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<!-- Pipeline doc: 00-delegation-and-triage.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Step 0b: Triage (Complexity Assessment)
|
|
4
|
+
|
|
5
|
+
### Pre-flight Cleanup
|
|
6
|
+
|
|
7
|
+
Before doing anything else, kill orphaned CLI agents from prior runs. These accumulate when a directive session gets killed mid-execution (context limit, timeout, cancellation) and the spawned child processes keep running as zombies. Left unchecked, they saturate API rate limits and cause new spawns to hang indefinitely.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Kill orphaned CLI agent processes from prior runs
|
|
11
|
+
ps aux | grep "claude.*--agent.*-p" | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
|
|
12
|
+
# Also kill any orphaned -p (print mode) processes without --agent
|
|
13
|
+
ps aux | grep "claude -p" | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
|
|
14
|
+
echo "Pre-flight cleanup: killed orphaned agent processes"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This is safe — active CLI agents for the current directive haven't been spawned yet, so there's nothing to accidentally kill.
|
|
18
|
+
|
|
19
|
+
### Classify the Directive
|
|
20
|
+
|
|
21
|
+
Read the directive, then classify its weight. This determines how much process overhead is needed. Not everything needs the full pipeline.
|
|
22
|
+
|
|
23
|
+
Read the directive file: `.context/directives/$ARGUMENTS.md`
|
|
24
|
+
Read `.context/vision.md` guardrails and `.context/preferences.md`.
|
|
25
|
+
|
|
26
|
+
### Classification Rules
|
|
27
|
+
|
|
28
|
+
**Lightweight** — the COO plans, but minimal overhead. No C-suite challenges, no CEO approval:
|
|
29
|
+
- Single clear task (fix a bug, delete dead code, update a config)
|
|
30
|
+
- All changes are in well-understood files
|
|
31
|
+
- No user-facing impact
|
|
32
|
+
- No guardrail risk (check vision.md)
|
|
33
|
+
- Scope fits in one engineer agent's work
|
|
34
|
+
|
|
35
|
+
**Medium** — the COO plans, but no C-suite challenges, no CEO approval:
|
|
36
|
+
- 2-3 related tasks that need coordination
|
|
37
|
+
- Touches multiple files but within one system
|
|
38
|
+
- Low-to-medium risk (no revenue/auth/schema impact)
|
|
39
|
+
- the COO plans the projects, pipeline executes tasks, CEO gets the summary
|
|
40
|
+
|
|
41
|
+
**Heavyweight** — Full pipeline with challenges, audit, and CEO approval gate:
|
|
42
|
+
- Crosses system boundaries (frontend + backend + infra)
|
|
43
|
+
- Touches revenue, auth, user data, or database schema
|
|
44
|
+
- Architectural decisions needed
|
|
45
|
+
- Violates or tests a guardrail in vision.md
|
|
46
|
+
- CEO has explicitly flagged this area as sensitive
|
|
47
|
+
- 4+ tasks or multi-day scope
|
|
48
|
+
|
|
49
|
+
**Security classification examples** (to resolve ambiguity):
|
|
50
|
+
- Hardening existing code (fixing injection, removing hardcoded creds, adding input validation to existing routes) = **Medium**
|
|
51
|
+
- Changing auth flows, adding new auth mechanisms, modifying access controls, changing session handling = **Heavyweight**
|
|
52
|
+
|
|
53
|
+
**Strategic** — Full pipeline with brainstorm phase before the COO plans:
|
|
54
|
+
- Multiple valid approaches and the directive doesn't prescribe one
|
|
55
|
+
- Architectural or process-level change — affects HOW the system works, not just WHAT it does
|
|
56
|
+
- Crosses 2+ domain boundaries where C-suite members would have conflicting opinions
|
|
57
|
+
- Lasting consequences expensive to reverse — new schemas, API contracts, conventions
|
|
58
|
+
- The directive asks a question or states a problem without specifying the solution
|
|
59
|
+
- NOT strategic just because it's big — a directive with a clear prescribed approach is heavyweight, not strategic
|
|
60
|
+
|
|
61
|
+
### Triage Output
|
|
62
|
+
|
|
63
|
+
State the classification clearly before proceeding:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Directive: {name}
|
|
67
|
+
Classification: {lightweight | medium | heavyweight | strategic}
|
|
68
|
+
Reasoning: {1-2 sentences why}
|
|
69
|
+
Process: {what steps will be used}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Lightweight Process
|
|
73
|
+
|
|
74
|
+
1. Read context files (lessons/ topic files, preferences.md — skip the full context load)
|
|
75
|
+
2. Spawn the COO to plan projects (plan) — even for simple work, the COO produces the plan so the CEO session stays clean
|
|
76
|
+
3. Spawn auditor for technical baseline (audit) — lightweight audit, not full investigation
|
|
77
|
+
4. **No plan-approval gate** — auto-approve
|
|
78
|
+
5. Create branch (setup) — worktree only if working directory is dirty
|
|
79
|
+
6. Execute tasks (execute)
|
|
80
|
+
7. Review verification (review-gate)
|
|
81
|
+
8. Generate a short digest to `.context/reports/`
|
|
82
|
+
9. Return CEO summary (Done / Changes / Needs CEO Eyes / Next)
|
|
83
|
+
|
|
84
|
+
No C-suite challenges. No brainstorm. No plan-approval gate. No worktree (unless the CEO has uncommitted changes). No OKR updates. CEO approves completion after the fact (completion step).
|
|
85
|
+
|
|
86
|
+
**CEO SESSION RULE: The CEO session NEVER plans or builds — it triages, delegates to the COO/agents, and reviews results. This applies to ALL weights including lightweight.**
|
|
87
|
+
|
|
88
|
+
### Medium Process
|
|
89
|
+
|
|
90
|
+
1. Read full context (read + context steps)
|
|
91
|
+
2. Spawn the COO to plan projects (plan) -- the COO's inline challenge is always included, but skip separate C-suite challengers (challenge step)
|
|
92
|
+
3. Spawn auditor for technical baseline (audit)
|
|
93
|
+
4. **No plan-approval gate** -- auto-approve the plan based on directive scope and guardrails
|
|
94
|
+
5. Create branch (setup) — worktree only if working directory is dirty
|
|
95
|
+
6. Execute tasks (execute)
|
|
96
|
+
7. Review verification (review-gate)
|
|
97
|
+
8. Update OKRs, generate digest, update lessons (wrapup)
|
|
98
|
+
9. Output CEO summary
|
|
99
|
+
|
|
100
|
+
No pause for plan sign-off. The CEO reviews the digest after the fact and approves completion (completion step). If something in the plan looks risky (touches a guardrail), **upgrade to heavyweight**.
|
|
101
|
+
|
|
102
|
+
### Strategic Process
|
|
103
|
+
|
|
104
|
+
Same as heavyweight but with an additional deliberation round during brainstorm. The team figures out the approach, debates it, and the CEO answers 2-3 clarifying questions.
|
|
105
|
+
|
|
106
|
+
1. Read full context (read + context steps)
|
|
107
|
+
2. **Brainstorm phase (with deliberation)** — spawn the brainstorm team in parallel using `run_in_background: true`. The brainstorm team includes:
|
|
108
|
+
- **2-3 relevant C-suite agents** (the CTO for architecture, the CPO for product, the CMO for growth — pick based on directive domain)
|
|
109
|
+
- **The named auditor** from the project cast (defaulting to the CTO if none assigned) -- grounds proposals in codebase reality
|
|
110
|
+
|
|
111
|
+
Each agent gets:
|
|
112
|
+
- Their personality from `.claude/agents/{name}.md`
|
|
113
|
+
- The directive text
|
|
114
|
+
- `.context/vision.md` and `.context/preferences.md`
|
|
115
|
+
- The Phase 1 prompt from the brainstorm prompt template
|
|
116
|
+
- `model: "sonnet"` (cheap, fast -- this is approach exploration, not code)
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Agent tool call (per brainstorm agent):
|
|
120
|
+
subagent_type: "{agent_name}"
|
|
121
|
+
model: "sonnet"
|
|
122
|
+
run_in_background: true
|
|
123
|
+
prompt: |
|
|
124
|
+
{Phase 1 brainstorm prompt from template}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Collect results** — after spawning all brainstorm agents, collect results using TaskOutput for each agent ID. Wait for all background agents to return before synthesizing.
|
|
128
|
+
|
|
129
|
+
**Error handling** — if a brainstorm agent fails or times out, log the error and continue with the remaining proposals. If ALL brainstorm agents fail, skip the brainstorm synthesis and proceed to the COO planning with a note: "brainstorm phase failed — the COO must derive the approach independently."
|
|
130
|
+
|
|
131
|
+
3. **Deliberation round (strategic only)** — after collecting all Phase 1 proposals, spawn each agent again with all proposals visible. Each agent writes ONE rebuttal targeting the proposal they most disagree with. Use the Phase 2 prompt from the brainstorm prompt template.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Agent tool call (per brainstorm agent, round 2):
|
|
135
|
+
subagent_type: "{agent_name}"
|
|
136
|
+
model: "sonnet"
|
|
137
|
+
run_in_background: true
|
|
138
|
+
prompt: |
|
|
139
|
+
{Phase 2 deliberation prompt from template, with all Phase 1 outputs included}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Collect rebuttals** — same collection pattern as Phase 1. If a rebuttal agent fails, continue without it.
|
|
143
|
+
|
|
144
|
+
4. **Synthesize** — collect all proposals AND rebuttals. Identify which critiques landed, which proposals survived challenge. Write synthesis to `.context/directives/{directive-id}/brainstorm.md`
|
|
145
|
+
5. **CEO clarification** — write 2-3 clarifying questions based on unresolved disagreements from the deliberation. STOP and return to CEO: "This directive is strategic. The team brainstormed N approaches and debated. Here are questions before we proceed: [questions]"
|
|
146
|
+
6. **After CEO answers** — feed brainstorm synthesis + CEO answers into the COO's prompt as additional context. Continue as heavyweight from the plan step onward.
|
|
147
|
+
|
|
148
|
+
> See [docs/reference/templates/brainstorm-prompt.md](../reference/templates/brainstorm-prompt.md) for the full brainstorm agent prompt template (Phase 1 + Phase 2).
|
|
149
|
+
|
|
150
|
+
> See [docs/reference/schemas/brainstorm-output.md](../reference/schemas/brainstorm-output.md) for the brainstorm agent output JSON schema (proposals + rebuttals).
|
|
151
|
+
|
|
152
|
+
### Heavyweight Process
|
|
153
|
+
|
|
154
|
+
Full pipeline: triage → read → context → challenge → **Brainstorm** → plan → audit → approve → project-brainstorm → setup → execute → review-gate → wrapup → completion.
|
|
155
|
+
|
|
156
|
+
**Brainstorm phase (mandatory for heavyweight):** Before the COO plans, spawn the brainstorm team in parallel using `run_in_background: true`. The brainstorm team includes:
|
|
157
|
+
- **2-3 relevant C-suite agents** (the CTO for architecture, the CPO for product, the CMO for growth — pick based on directive domain)
|
|
158
|
+
- **The named auditor** from the project cast (defaulting to the CTO if none assigned) -- grounds proposals in codebase reality
|
|
159
|
+
|
|
160
|
+
Each agent gets the **Phase 1 prompt only** from the brainstorm prompt template. No deliberation round for heavyweight — proposals only, then synthesis.
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Agent tool call (per brainstorm agent):
|
|
164
|
+
subagent_type: "{agent_name}"
|
|
165
|
+
model: "sonnet"
|
|
166
|
+
run_in_background: true
|
|
167
|
+
prompt: |
|
|
168
|
+
{Phase 1 brainstorm prompt from template}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Collect results** using TaskOutput for each agent ID. Wait for all background agents to return before synthesizing.
|
|
172
|
+
|
|
173
|
+
**Error handling** — if a brainstorm agent fails or times out, log the error and continue with the remaining proposals. If ALL brainstorm agents fail, skip the brainstorm synthesis and proceed to the COO planning with a note: "brainstorm phase failed — the COO must derive the approach independently."
|
|
174
|
+
|
|
175
|
+
**Synthesize** — collect all proposals (NO rebuttals for heavyweight). Identify convergence points and key disagreements. Write synthesis to `.context/directives/{directive-id}/brainstorm.md`. CEO clarification questions are included in the plan-for-approval artifact rather than as a separate STOP gate. This ensures the team thinks through the approach before the COO plans, without adding a separate round-trip to the CEO.
|
|
176
|
+
|
|
177
|
+
> See [docs/reference/templates/brainstorm-prompt.md](../reference/templates/brainstorm-prompt.md) for the full brainstorm agent prompt template.
|
|
178
|
+
|
|
179
|
+
> See [docs/reference/schemas/brainstorm-output.md](../reference/schemas/brainstorm-output.md) for the brainstorm agent output JSON schema.
|
|
180
|
+
|
|
181
|
+
For the CEO approval gate (approve step): write the plan to `.context/directives/{directive-id}/plan-for-approval.md` and STOP. Output a summary asking the CEO to approve. Include brainstorm synthesis and any clarifying questions alongside the COO's plan. After CEO approval, continue execution from the setup step.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!-- Pipeline doc: 01-checkpoint.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Step 0: Check for Existing Progress
|
|
4
|
+
|
|
5
|
+
Check if `.context/directives/$ARGUMENTS.json` exists AND has a `current_step` field (indicating previous execution progress).
|
|
6
|
+
|
|
7
|
+
**If not found or no `current_step`:** Proceed to the read step normally.
|
|
8
|
+
|
|
9
|
+
**If found with `current_step`:** Parse the directive JSON and present a resume summary:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Found progress for {id}:
|
|
13
|
+
- Started: {started_at}, last updated: {updated_at}
|
|
14
|
+
- Progress: {completed}/{total} tasks complete
|
|
15
|
+
- Current step: {current_step}
|
|
16
|
+
- Tasks: {list each with status}
|
|
17
|
+
|
|
18
|
+
Resume or restart fresh?
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Ask the CEO using AskUserQuestion: **Resume** or **Restart**.
|
|
22
|
+
|
|
23
|
+
**If Restart:** Remove the pipeline/execution fields from directive.json (keep metadata). Delete project artifacts (`rm -rf .context/directives/{id}/projects/`). Proceed to the read step.
|
|
24
|
+
|
|
25
|
+
**If Resume:** Load directive.json data and skip to the appropriate step:
|
|
26
|
+
- `current_step` is `plan` or `audit` → Load `planning.coo_plan`, skip to approve (CEO approval)
|
|
27
|
+
- `current_step` is `approve` → Re-present plan for CEO approval. Previous approval carries over — show it and ask CEO to confirm: "Plan was previously approved. Confirm to continue?"
|
|
28
|
+
- `current_step` is `project-brainstorm` or `setup` → Load `planning.worktree_path`, verify `directive.json` pipeline state is consistent, then skip to execute
|
|
29
|
+
- `current_step` is `execute` or `review-gate` → Load tasks array. Skip tasks with `status: "completed"` or `status: "skipped"`. Restart any `in_progress` task from its first phase (do not attempt partial phase resume). Continue with `pending` tasks.
|
|
30
|
+
- `current_step` is `wrapup` or `completion` → Load wrapup state, skip completed wrapup sub-steps, continue from the first incomplete one
|
|
31
|
+
|
|
32
|
+
For resumed execute step: when restarting an in-progress task, read its artifact files (if any) for context but re-execute all phases from scratch. Only truly completed tasks are skipped.
|
|
33
|
+
|
|
34
|
+
> See [docs/reference/schemas/directive-json.md](../reference/schemas/directive-json.md) for the full directive.json schema.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Pipeline doc: 02-read-directive.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Step 1: Read the Directive
|
|
4
|
+
|
|
5
|
+
**If a directive file exists:** Read `.context/directives/$ARGUMENTS/directive.md` (or `.context/directives/$ARGUMENTS.md` for legacy flat files).
|
|
6
|
+
|
|
7
|
+
**If no directive file exists (ad-hoc request):** The CEO gave an ad-hoc description instead of a directive name. Generate a kebab-case ID from the description (e.g., "run these 3 projects" → `run-3-projects`, "comprehensive system review" → `system-review-2026-03-04`). Create a directive directory `mkdir -p .context/directives/{id}/` with both `directive.md` and `directive.json`. The `.md` should contain the CEO's original request as the directive brief.
|
|
8
|
+
|
|
9
|
+
**If $ARGUMENTS looks like a project path** (contains `/`): Read the project.json at `.context/directives/{directive}/projects/{project}/project.json`. Generate a directive ID from the project name. Create the directive files.
|
|
10
|
+
|
|
11
|
+
**Naming convention:** Directive filenames must be kebab-case (e.g., `improve-security.md`). The name is used in git branch names (`directive/$ARGUMENTS`) and file paths.
|
|
12
|
+
|
|
13
|
+
### Create directive.json (ALWAYS — for all directive types including ad-hoc)
|
|
14
|
+
|
|
15
|
+
Create `.context/directives/$ARGUMENTS/directive.json` if it doesn't already exist (create the directory first: `mkdir -p .context/directives/$ARGUMENTS/`). This companion JSON provides structured metadata for the pipeline and dashboard.
|
|
16
|
+
|
|
17
|
+
> See [docs/reference/schemas/directive-json.md](../reference/schemas/directive-json.md) for the full directive.json schema.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"id": "$ARGUMENTS",
|
|
22
|
+
"title": "{extracted from first heading of the .md}",
|
|
23
|
+
"status": "in_progress",
|
|
24
|
+
"created": "{today's date YYYY-MM-DD}",
|
|
25
|
+
"completed": null,
|
|
26
|
+
"weight": "{classification from triage: lightweight | medium | heavyweight | strategic}",
|
|
27
|
+
"category": "{one of: framework, pipeline, dashboard, game — infer from directive name/scope}",
|
|
28
|
+
"produced_features": [],
|
|
29
|
+
"report": null,
|
|
30
|
+
"backlog_sources": []
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Extract `category` from the directive .md content:
|
|
35
|
+
- Look for `**Category**: {category}` in the directive text
|
|
36
|
+
- If not found, infer from the directive name/scope (e.g., `game-*` -> `game`, `pipeline-*` -> `pipeline`, `dashboard-*` -> `dashboard`)
|
|
37
|
+
- Valid categories: `framework`, `pipeline`, `dashboard`, `game`
|
|
38
|
+
- Every directive MUST have a category
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Pipeline doc: 03-read-context.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Step 2: Read Context
|
|
4
|
+
|
|
5
|
+
Read ALL of these before spawning the COO:
|
|
6
|
+
- `.context/vision.md` — north star + guardrails (agents must respect guardrails)
|
|
7
|
+
- `.context/preferences.md` — CEO standing orders (agents must follow these)
|
|
8
|
+
- `.context/directives/*/directive.json` — current directives, their categories, and status
|
|
9
|
+
- `.context/lessons/*.md` — project gotchas and patterns (read topic files as needed per agent role)
|
|
10
|
+
- `.context/lessons/orchestration.md` — for the COO and orchestration
|
|
11
|
+
- `.context/lessons/agent-behavior.md` — for all agents
|
|
12
|
+
- All `.context/directives/*/projects/*/project.json` — current project states and task status
|
|
13
|
+
- The C-suite agent personality files (resolve names from `.claude/agent-registry.json`)
|
|
14
|
+
|
|
15
|
+
Also note the directive's `category` field — this goes to the auditor in the audit step for domain context.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Pipeline doc: 04-challenge.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Challenge: C-Suite Challenge (Heavyweight Directives Only)
|
|
4
|
+
|
|
5
|
+
**Default behavior:** Challenge is INLINED into the COO's planning prompt (see plan step). The COO identifies the top 3 risks and flags over-engineering concerns as part of the planning output.
|
|
6
|
+
|
|
7
|
+
**Separate challenger agents are only spawned when:**
|
|
8
|
+
- The CEO explicitly flags the directive as controversial
|
|
9
|
+
- The directive is heavyweight AND crosses multiple domains (e.g., touches revenue + auth + UI)
|
|
10
|
+
|
|
11
|
+
When separate challengers ARE needed, spawn 1-2 relevant C-suite members:
|
|
12
|
+
- Security / architecture / technical debt → **the CTO**
|
|
13
|
+
- User-facing features / product changes → **the CPO**
|
|
14
|
+
- Growth / SEO / marketing / positioning → **the CMO**
|
|
15
|
+
- Operational / process / resource changes → spawn **two** of the above (most relevant pair)
|
|
16
|
+
|
|
17
|
+
> See [docs/reference/templates/challenger-prompt.md](../reference/templates/challenger-prompt.md) for the full challenger prompt template.
|
|
18
|
+
|
|
19
|
+
> See [docs/reference/schemas/challenger-output.md](../reference/schemas/challenger-output.md) for the challenger JSON output schema.
|
|
20
|
+
|
|
21
|
+
**Spawn challengers in parallel** using `run_in_background: true`. Each is a lightweight agent call — use the agent's `id` from the registry as the `subagent_type`, `model: "sonnet"` (fast, cheap — this is a gut check, not deep analysis).
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Agent tool call (per challenger):
|
|
25
|
+
subagent_type: "{agent_name}"
|
|
26
|
+
model: "sonnet"
|
|
27
|
+
run_in_background: true
|
|
28
|
+
prompt: |
|
|
29
|
+
{challenger prompt from template}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Collect results** — after spawning all challengers, collect results using TaskOutput for each agent ID. Wait for all background agents to return before proceeding.
|
|
33
|
+
|
|
34
|
+
**Error handling** — if a background agent fails or times out, log the error and continue. Challenge is advisory — a failed challenger does not block the pipeline. If ALL challengers fail, note "challenge phase unavailable" and proceed to COO planning.
|
|
35
|
+
|
|
36
|
+
**Parse responses** as JSON. If any fail to parse, log the error and continue.
|
|
37
|
+
|
|
38
|
+
**Store challenges** — they get presented alongside the COO's plan in the approve step.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!-- Pipeline doc: 05-planning.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Step 3: Spawn the COO (Strategic Planning)
|
|
4
|
+
|
|
5
|
+
Spawn the COO as an Agent (model: opus, subagent_type: COO's ID from registry).
|
|
6
|
+
|
|
7
|
+
**The COO's prompt must include:**
|
|
8
|
+
- The CEO directive text (personality is auto-loaded via the `subagent_type`)
|
|
9
|
+
- The goals index, lessons, and agent summaries from the context step
|
|
10
|
+
- These explicit instructions:
|
|
11
|
+
|
|
12
|
+
> See [docs/reference/templates/planner-prompt.md](../reference/templates/planner-prompt.md) for the full COO planning prompt.
|
|
13
|
+
|
|
14
|
+
> See [docs/reference/schemas/plan-schema.md](../reference/schemas/plan-schema.md) for the COO's output JSON schema.
|
|
15
|
+
|
|
16
|
+
> See [docs/reference/rules/casting-rules.md](../reference/rules/casting-rules.md) for full casting rules.
|
|
17
|
+
|
|
18
|
+
> See [docs/reference/rules/phase-definitions.md](../reference/rules/phase-definitions.md) for phase composable building blocks.
|
|
19
|
+
|
|
20
|
+
> See [docs/reference/rules/scope-and-dod.md](../reference/rules/scope-and-dod.md) for scope format rules, Definition of Done rules, and user scenario rules.
|
|
21
|
+
|
|
22
|
+
**If this directive was classified as strategic**, also include in the COO's prompt:
|
|
23
|
+
- The brainstorm synthesis from `.context/directives/{directive-id}/brainstorm.md`
|
|
24
|
+
- CEO's clarification answers
|
|
25
|
+
- Additional instruction to the COO: "The team has brainstormed approach options for this directive. Use the brainstorm synthesis and CEO's answers to inform your plan — you don't need to re-derive the approach from scratch. Focus on execution planning, not strategy."
|
|
26
|
+
|
|
27
|
+
**Parse the COO's response** as JSON. Extract the JSON object from the response (find the first `{` and last `}`). If it fails to parse, show the error and stop.
|
|
28
|
+
|
|
29
|
+
### Save the COO's plan (DO NOT create project.json yet)
|
|
30
|
+
|
|
31
|
+
Save the COO's parsed JSON plan to `.context/directives/{directive-id}/plan.json` for reference. The directive directory should already exist from the read step.
|
|
32
|
+
|
|
33
|
+
**Do NOT create project.json at this step.** The project.json is created in the approve step (after CEO approval) so that CEO modifications to the plan are reflected in the source of truth. Creating it before approval causes plan/project drift when the CEO requests changes.
|
|
34
|
+
|
|
35
|
+
### Handle Multi-Project Plans
|
|
36
|
+
|
|
37
|
+
If the COO's plan contains a `projects` array (triggered when genuinely complex work can't be decomposed into simple tasks):
|
|
38
|
+
|
|
39
|
+
1. **Verify projects are independent** — if project B depends on project A's output (shared code, shared data structures, one builds on the other), they MUST be merged into a single project with ordered tasks. Task array ordering IS the dependency mechanism. There is no cross-project dependency field.
|
|
40
|
+
2. **Create a separate project directory and project.json for each independent project** in the approve step (after CEO approval)
|
|
41
|
+
3. **Each project gets its own brainstorm** (2-3 agents + deliberation) before build
|
|
42
|
+
4. **Each project gets its own execution cycle** in the execute step: brainstorm -> audit -> build -> review -> verify
|
|
43
|
+
5. **Projects execute sequentially by priority tier** (all P0 projects before P1)
|
|
44
|
+
6. **Project directories**: `.context/directives/{directive-id}/projects/{project-id}/` (use the project's `id`, not the directive name)
|
|
45
|
+
|
|
46
|
+
Most directives should use a single project with simple tasks. Multi-project is the exception for genuinely complex AND independent work.
|
|
47
|
+
|
|
48
|
+
**Validate the cast** — pipe the parsed JSON through `validate-cast.sh` to mechanically check casting rules:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
echo "$PLAN_JSON" | .claude/hooks/validate-cast.sh
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The script checks:
|
|
55
|
+
1. Every task has an auditor assigned
|
|
56
|
+
2. Builder is not in the reviewers array (conflict of interest)
|
|
57
|
+
3. Complex tasks (5+ phases) have at least one C-suite reviewer
|
|
58
|
+
4. Agents don't review changes to their own behavior/prompts
|
|
59
|
+
|
|
60
|
+
If validation fails (`valid: false`), log the violations and either:
|
|
61
|
+
- **Auto-fix** if the violation is clear (e.g., swap a conflicting reviewer for the next-best match per casting rules)
|
|
62
|
+
- **Block** and re-prompt the COO with the violations if auto-fix isn't possible
|
|
63
|
+
|
|
64
|
+
> See [.claude/hooks/validate-cast.sh](../../../../.claude/hooks/validate-cast.sh) for the validation script.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!-- Pipeline doc: 06-technical-audit.md | Source: SKILL.md restructure, updated by redesign-pipeline-steps -->
|
|
2
|
+
|
|
3
|
+
## Audit: Technical Audit (Two-Agent Flow)
|
|
4
|
+
|
|
5
|
+
After parsing the COO's plan, run a two-agent sequential audit: **the QA engineer (Investigation)** (pure data) then **Architect** (design recommendations). This separation prevents investigation findings from anchoring the design.
|
|
6
|
+
|
|
7
|
+
**Complexity gating:** For projects that touch integration points (data flows between systems, state management, API boundaries) or have moderate/complex scope, use the full two-agent flow. For simple projects with tight scope (single-domain), use the single-agent auditor pattern (skip the QA engineer's investigation, spawn only the named auditor -- defaulting to the CTO -- with the combined prompt from [auditor-prompt.md](../reference/templates/auditor-prompt.md)). Note: single-project directives are often `simple`; projects in multi-project plans may be moderate/complex and should always use the two-agent flow.
|
|
8
|
+
|
|
9
|
+
### Phase 1: Investigation
|
|
10
|
+
|
|
11
|
+
Spawn the QA engineer in investigation mode to scan the codebase and gather raw data. The QA engineer does NOT recommend approaches -- they report facts only.
|
|
12
|
+
|
|
13
|
+
**Group projects by scope overlap** -- if multiple projects touch similar areas, send them to a single investigation agent to avoid redundant scanning.
|
|
14
|
+
|
|
15
|
+
**Investigation spawn rules:**
|
|
16
|
+
- `subagent_type`: the QA engineer's ID from the registry -- operates in investigation mode when given the investigator prompt
|
|
17
|
+
- Spawn as Agent (model: opus)
|
|
18
|
+
- `run_in_background: true` if multiple investigation groups exist
|
|
19
|
+
|
|
20
|
+
**The QA engineer's investigation prompt must include:**
|
|
21
|
+
- The COO's projects (the ones assigned to this investigation group)
|
|
22
|
+
- The directive's category (from directive.json `category` field) — for domain context
|
|
23
|
+
- `.context/vision.md` guardrails section — for constraint awareness
|
|
24
|
+
- `.context/preferences.md` — CEO standing orders
|
|
25
|
+
- `.context/lessons/agent-behavior.md` — agent behavior lessons
|
|
26
|
+
- Explicit instruction: "You are operating in INVESTIGATION MODE. Pure data gathering — scan, measure, report. Do NOT recommend approaches."
|
|
27
|
+
|
|
28
|
+
> See [docs/reference/templates/investigator-prompt.md](../reference/templates/investigator-prompt.md) for the full investigation prompt template.
|
|
29
|
+
|
|
30
|
+
> See [docs/reference/schemas/investigation-output.md](../reference/schemas/investigation-output.md) for the investigation output JSON schema.
|
|
31
|
+
|
|
32
|
+
**Parse the QA engineer's response** as JSON. If it fails to parse, show the error and stop.
|
|
33
|
+
|
|
34
|
+
### Phase 2: Architecture (Design Recommendations)
|
|
35
|
+
|
|
36
|
+
Spawn the Architect to read the Investigator's data + the COO's plan and recommend technical approaches.
|
|
37
|
+
|
|
38
|
+
**The Architect role is filled by the named auditor from the COO's cast** -- not a separate agent definition. This ensures domain expertise informs the design.
|
|
39
|
+
|
|
40
|
+
**Architect spawn rules:**
|
|
41
|
+
- Use the auditor's `id` from the registry as the `subagent_type`
|
|
42
|
+
- If no named auditor is assigned, default to the CTO (handles unassigned audits)
|
|
43
|
+
- Spawn as Agent (model: opus)
|
|
44
|
+
|
|
45
|
+
**Architect's prompt must include:**
|
|
46
|
+
- Their personality file (for named agents — auto-loaded via `subagent_type`)
|
|
47
|
+
- The COO's projects (the ones assigned to this auditor)
|
|
48
|
+
- **The QA engineer's full investigation JSON output** — this is the Architect's primary input
|
|
49
|
+
- `.context/vision.md` guardrails section — for risk classification reference
|
|
50
|
+
- `.context/preferences.md` — CEO standing orders
|
|
51
|
+
- `.context/lessons/review-quality.md` — review lessons (for the CTO)
|
|
52
|
+
- `.context/lessons/agent-behavior.md` — agent behavior lessons
|
|
53
|
+
|
|
54
|
+
> See [docs/reference/templates/architect-prompt.md](../reference/templates/architect-prompt.md) for the full Architect prompt template.
|
|
55
|
+
|
|
56
|
+
> See [docs/reference/schemas/audit-output.md](../reference/schemas/audit-output.md) for the Architect's output JSON schema.
|
|
57
|
+
|
|
58
|
+
**Parse the Architect's response** as JSON. If it fails to parse, show the error and stop.
|
|
59
|
+
|
|
60
|
+
### Phase 2b: Design Prototype (UI-Touching Projects Only)
|
|
61
|
+
|
|
62
|
+
**Trigger:** If any project in the plan touches UI files (`*.tsx`, `*.jsx`, `*.css`, `src/components/`, `src/styles/`, or game canvas code), spawn the UI/UX designer to produce a design prototype.
|
|
63
|
+
|
|
64
|
+
**UI/UX designer spawn rules:**
|
|
65
|
+
- `subagent_type`: the UI/UX designer's ID from the registry
|
|
66
|
+
- Spawn as Agent (model: opus)
|
|
67
|
+
- Only for projects flagged as UI-touching (use file-pattern matching from the audit's `active_files`)
|
|
68
|
+
|
|
69
|
+
**The UI/UX designer's prompt must include:**
|
|
70
|
+
- The COO's projects (the UI-touching ones)
|
|
71
|
+
- The Architect's audit output (so she knows the technical constraints)
|
|
72
|
+
- `.context/preferences.md` — CEO standing orders
|
|
73
|
+
- `.context/lessons/agent-behavior.md` — agent behavior lessons
|
|
74
|
+
- Existing UI patterns: have them read the relevant component files from `active_files` to understand current patterns
|
|
75
|
+
- Instruction: "Produce a design prototype for each UI-touching project. Include ASCII wireframes, component specs, interaction notes, and responsive breakpoints. Your prototype goes into the plan markdown — builders use it as the visual spec."
|
|
76
|
+
|
|
77
|
+
**The UI/UX designer's output** is a markdown document with design prototypes. Write it to `.context/directives/{id}/design-prototype.md`. This file is:
|
|
78
|
+
- Presented to the CEO during the approval step alongside the COO's plan
|
|
79
|
+
- Included in the builder's prompt during the execute step as the visual spec to follow
|
|
80
|
+
- Referenced by the UI/UX designer during design review (review-gate) to check implementation fidelity
|
|
81
|
+
|
|
82
|
+
### After All Audit Phases
|
|
83
|
+
|
|
84
|
+
**Update directive.json:** Set `current_step: "audit"`, `planning.coo_plan` to the parsed JSON. Update `pipeline.audit` status/agent/output.
|
|
85
|
+
|
|
86
|
+
**If a project has no active files and all dead code:** Flag it for removal in the CEO presentation.
|
|
87
|
+
|
|
88
|
+
**Artifact:** Write the combined audit output (investigation data + architect recommendations) to the project directory as `audit-findings.json`. If design prototype was produced, note its path in the directive.json pipeline object.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!-- Pipeline doc: 07-plan-approval.md | Source: SKILL.md restructure -->
|
|
2
|
+
|
|
3
|
+
## Approve: Present Combined Plan to CEO
|
|
4
|
+
|
|
5
|
+
### Pre-approval: Complexity Floor Check
|
|
6
|
+
|
|
7
|
+
After the audit and before presenting the plan, validate that all tasks are genuinely `simple` using the audit's `active_files` as mechanical ground truth:
|
|
8
|
+
|
|
9
|
+
- If a task has **>5 active_files**: it's NOT simple. **Flag for re-decomposition** — the COO must break it into 2-3 smaller simple tasks.
|
|
10
|
+
- If a task has **>10 active_files** or spans **>2 directories**: it's genuinely complex. **Flag as needing its own project** with brainstorm.
|
|
11
|
+
- Log any flags: `[COMPLEXITY FLAG] {task title}: touches 7 active files -- needs decomposition`
|
|
12
|
+
|
|
13
|
+
**If any tasks are flagged:**
|
|
14
|
+
1. Re-spawn the COO with the flagged tasks + audit findings, instructing them to decompose the tasks into simple tasks (or escalate to a separate project if genuinely complex)
|
|
15
|
+
2. Re-validate the updated plan
|
|
16
|
+
3. Present the final plan to CEO
|
|
17
|
+
|
|
18
|
+
This prevents the COO (an LLM optimistic about complexity) from classifying everything as "simple". The audit's active_files count is mechanical ground truth that overrides the COO's judgment.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
**If running in a dedicated CLI session (non-interactive):** Write the full plan to `.context/directives/$ARGUMENTS/plan-for-approval.md` using the format below, update directive.json, and stop. The CEO reviews and re-launches with approval.
|
|
23
|
+
|
|
24
|
+
**If running inline (CEO session):** Present as described below.
|
|
25
|
+
|
|
26
|
+
### CEO Quick Summary (present FIRST — before any detail)
|
|
27
|
+
|
|
28
|
+
Always lead with a 3-5 bullet TL;DR that the CEO can read in 20 seconds:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
## TL;DR
|
|
32
|
+
|
|
33
|
+
- **What**: {1-sentence goal}
|
|
34
|
+
- **Scope**: {N} tasks{, M in K projects if multi-project}
|
|
35
|
+
- **Risk**: {the COO's recommendation -- proceed / scope down / defer}
|
|
36
|
+
- **Auto-ships**: {count} low-risk tasks execute without approval
|
|
37
|
+
- **Needs your call**: {count} items need CEO decision {brief description}
|
|
38
|
+
|
|
39
|
+
Approve all / Approve with changes / Reject
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The CEO should be able to approve from the TL;DR alone for medium-risk directives. The full detail below is for heavyweight review or "Approve with changes" scenarios.
|
|
43
|
+
|
|
44
|
+
### Challenges (from the COO's inline analysis + challenge step if separate challengers were spawned)
|
|
45
|
+
|
|
46
|
+
First, present the COO's built-in challenge analysis:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
## Risk & Scope Assessment (COO)
|
|
50
|
+
|
|
51
|
+
Risks: {the COO's top 3 risks from challenges.risks}
|
|
52
|
+
Over-engineering flags: {challenges.over_engineering_flags}
|
|
53
|
+
Recommendation: {challenges.recommendation}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If separate C-suite challengers were spawned (heavyweight/controversial directives only), present their responses:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
**{Agent Name}** — {ENDORSE | CHALLENGE | FLAG}
|
|
60
|
+
{reasoning}
|
|
61
|
+
{If challenge: "Alternative: {alternative}"}
|
|
62
|
+
{If risk flags: "Risks: {list}"}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If any challenge (the COO's or separate) recommends scoping down, highlight it prominently. The CEO should consider the challenge before approving the plan.
|
|
66
|
+
|
|
67
|
+
### Plan (from plan + audit steps)
|
|
68
|
+
|
|
69
|
+
Merge the COO's strategic plan with the audit findings and present **grouped by priority**:
|
|
70
|
+
|
|
71
|
+
For each task, display:
|
|
72
|
+
- Title + priority + complexity
|
|
73
|
+
- Scope (from the COO)
|
|
74
|
+
- User scenario (from the COO — the one-sentence user experience)
|
|
75
|
+
- Audit findings: active files, dead code flagged, recommended approach
|
|
76
|
+
- Phases + agent cast
|
|
77
|
+
- Definition of Done items (from the COO's plan — for CEO to review before approving)
|
|
78
|
+
|
|
79
|
+
Flag tasks where the audit found nothing to fix or all dead code -- recommend removal.
|
|
80
|
+
|
|
81
|
+
Example format:
|
|
82
|
+
```
|
|
83
|
+
## P0 — Must Ship
|
|
84
|
+
|
|
85
|
+
1. {Task Title} (phases: {phases list}) — {cast summary}
|
|
86
|
+
Scope: {the COO's scope description}
|
|
87
|
+
User scenario: {user_scenario}
|
|
88
|
+
Audit: {baseline} | {N} active files | {M} dead code files flagged
|
|
89
|
+
Approach: {auditor's recommended approach}
|
|
90
|
+
DOD: {criterion 1} | {criterion 2} | {criterion 3}
|
|
91
|
+
|
|
92
|
+
2. {Task Title} — RECOMMEND REMOVE
|
|
93
|
+
Audit: No active issues found. {explanation}
|
|
94
|
+
|
|
95
|
+
## P1 — Should Ship
|
|
96
|
+
...
|
|
97
|
+
|
|
98
|
+
## P2 — Nice to Have
|
|
99
|
+
...
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Ask the CEO to approve using AskUserQuestion:
|
|
103
|
+
- "Approve all" — execute everything as planned
|
|
104
|
+
- "Approve with changes" -- CEO adjusts priorities or removes tasks
|
|
105
|
+
- "Reject" — stop, explain what's wrong
|
|
106
|
+
|
|
107
|
+
**DOD review guidance:** Before approving, scan each task's DOD items. Flag any that are:
|
|
108
|
+
- Too vague to verify ("improve quality" vs "all routes have Zod schemas")
|
|
109
|
+
- Missing CEO-intent alignment (DOD doesn't reflect what you actually want)
|
|
110
|
+
- Incomplete (fewer than 3 items, or missing a testability dimension)
|
|
111
|
+
|
|
112
|
+
If DOD items are weak, use "Approve with changes" to request better criteria before execution starts.
|
|
113
|
+
|
|
114
|
+
If CEO wants changes, adjust the plan accordingly.
|
|
115
|
+
|
|
116
|
+
### Create project.json (after CEO approves)
|
|
117
|
+
|
|
118
|
+
Once the CEO approves (or approves with changes), create the project.json — this is the source of truth for execution. Builders read it to know what to do. The dashboard shows it for progress tracking.
|
|
119
|
+
|
|
120
|
+
1. Create directory: `mkdir -p .context/directives/{directive-id}/projects/{project-id}/` (for each project in the COO's plan)
|
|
121
|
+
2. Write `project.json` with fields derived from the COO's plan (incorporating any CEO modifications):
|
|
122
|
+
- `id`: directive name
|
|
123
|
+
- `title`: from the COO's plan goal title
|
|
124
|
+
- `category`: from the COO's `category` field (or directive.json `category`)
|
|
125
|
+
- `status`: `"in_progress"`
|
|
126
|
+
- `priority`: highest priority from tasks (P0 > P1 > P2)
|
|
127
|
+
- `agent`: array of builder agent IDs from the COO's cast (e.g. `["frontend-engineer-id"]`, `["backend-engineer-id", "data-engineer-id"]`)
|
|
128
|
+
- `reviewers`: array of reviewer agent IDs from the COO's cast (e.g. `["cto-id"]`, `["cto-id", "cpo-id"]`)
|
|
129
|
+
- `description`: from the directive brief
|
|
130
|
+
- `source_directive`: directive name
|
|
131
|
+
- `scope.in`: aggregated from all task scopes
|
|
132
|
+
- `scope.out`: anything explicitly excluded
|
|
133
|
+
- `dod`: from the COO's `definition_of_done` arrays — each criterion starts as `{ "criterion": "...", "met": false }`
|
|
134
|
+
- `browser_test`: `true` if any task touches UI files
|
|
135
|
+
- `tasks`: one entry per task from the COO's plan, each with `status: "pending"`, `agent: []`, `dod` from the task's DOD -- each criterion starts as `{ "criterion": "...", "met": false }`. **CRITICAL: The key MUST be `tasks`.** The validator will reject any other key name.
|
|
136
|
+
- `created`: current ISO 8601 timestamp with actual time (e.g. `new Date().toISOString()` — NEVER use `T00:00:00Z` placeholder)
|
|
137
|
+
- `updated`: same as `created` initially
|
|
138
|
+
|
|
139
|
+
3. If the project.json already exists (from a prior partial run or brainstorm), UPDATE it — merge new tasks, don't duplicate existing ones. Apply any CEO modifications from "Approve with changes."
|
|
140
|
+
|
|
141
|
+
This project.json will be updated by the project-brainstorm step with the full `tasks` array, then incrementally during execution as tasks complete and reviews finish. The finalization step at the end sets status to completed, updates DOD met status, etc.
|
|
142
|
+
|
|
143
|
+
**Next step:** Proceed to [07b-project-brainstorm.md](07b-project-brainstorm.md) (project-brainstorm) to decompose each project into tasks with DOD.
|
|
144
|
+
|
|
145
|
+
**Update directive.json:** Set `current_step: "approve"`, `planning.ceo_approval` to `{status: "approved", modifications: [...]}` (or rejected). Update `pipeline.approve.status` to `"completed"` with output. This is CRITICAL — CEO decisions cannot be reconstructed after context loss.
|