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.
Files changed (143) hide show
  1. package/.claude/skills/brainstorm/SKILL.md +340 -0
  2. package/.claude/skills/code-review-excellence/SKILL.md +198 -0
  3. package/.claude/skills/directive/SKILL.md +121 -0
  4. package/.claude/skills/directive/docs/pipeline/00-delegation-and-triage.md +181 -0
  5. package/.claude/skills/directive/docs/pipeline/01-checkpoint.md +34 -0
  6. package/.claude/skills/directive/docs/pipeline/02-read-directive.md +38 -0
  7. package/.claude/skills/directive/docs/pipeline/03-read-context.md +15 -0
  8. package/.claude/skills/directive/docs/pipeline/04-challenge.md +38 -0
  9. package/.claude/skills/directive/docs/pipeline/05-planning.md +64 -0
  10. package/.claude/skills/directive/docs/pipeline/06-technical-audit.md +88 -0
  11. package/.claude/skills/directive/docs/pipeline/07-plan-approval.md +145 -0
  12. package/.claude/skills/directive/docs/pipeline/07b-project-brainstorm.md +85 -0
  13. package/.claude/skills/directive/docs/pipeline/08-worktree-and-state.md +50 -0
  14. package/.claude/skills/directive/docs/pipeline/09-execute-projects.md +709 -0
  15. package/.claude/skills/directive/docs/pipeline/10-wrapup.md +242 -0
  16. package/.claude/skills/directive/docs/pipeline/11-completion-gate.md +75 -0
  17. package/.claude/skills/directive/docs/reference/rules/casting-rules.md +78 -0
  18. package/.claude/skills/directive/docs/reference/rules/failure-handling.md +20 -0
  19. package/.claude/skills/directive/docs/reference/rules/phase-definitions.md +42 -0
  20. package/.claude/skills/directive/docs/reference/rules/scope-and-dod.md +30 -0
  21. package/.claude/skills/directive/docs/reference/schemas/audit-output.md +44 -0
  22. package/.claude/skills/directive/docs/reference/schemas/brainstorm-output.md +52 -0
  23. package/.claude/skills/directive/docs/reference/schemas/challenger-output.md +13 -0
  24. package/.claude/skills/directive/docs/reference/schemas/checkpoint.md +18 -0
  25. package/.claude/skills/directive/docs/reference/schemas/current-json.md +5 -0
  26. package/.claude/skills/directive/docs/reference/schemas/directive-json.md +143 -0
  27. package/.claude/skills/directive/docs/reference/schemas/investigation-output.md +37 -0
  28. package/.claude/skills/directive/docs/reference/schemas/plan-schema.md +103 -0
  29. package/.claude/skills/directive/docs/reference/templates/architect-prompt.md +66 -0
  30. package/.claude/skills/directive/docs/reference/templates/auditor-prompt.md +53 -0
  31. package/.claude/skills/directive/docs/reference/templates/brainstorm-prompt.md +68 -0
  32. package/.claude/skills/directive/docs/reference/templates/challenger-prompt.md +35 -0
  33. package/.claude/skills/directive/docs/reference/templates/digest.md +134 -0
  34. package/.claude/skills/directive/docs/reference/templates/investigator-prompt.md +51 -0
  35. package/.claude/skills/directive/docs/reference/templates/planner-prompt.md +130 -0
  36. package/.claude/skills/frontend-design/SKILL.md +42 -0
  37. package/.claude/skills/gruai-agents/SKILL.md +161 -0
  38. package/.claude/skills/gruai-config/SKILL.md +61 -0
  39. package/.claude/skills/healthcheck/SKILL.md +216 -0
  40. package/.claude/skills/report/SKILL.md +380 -0
  41. package/.claude/skills/scout/SKILL.md +452 -0
  42. package/.claude/skills/seo-audit/SKILL.md +107 -0
  43. package/.claude/skills/walkthrough/SKILL.md +274 -0
  44. package/.claude/skills/webapp-testing/SKILL.md +96 -0
  45. package/LICENSE +21 -0
  46. package/README.md +206 -0
  47. package/cli/templates/CLAUDE.md.template +57 -0
  48. package/cli/templates/agent-roles/backend.md +47 -0
  49. package/cli/templates/agent-roles/cmo.md +52 -0
  50. package/cli/templates/agent-roles/content.md +48 -0
  51. package/cli/templates/agent-roles/coo.md +66 -0
  52. package/cli/templates/agent-roles/cpo.md +52 -0
  53. package/cli/templates/agent-roles/cto.md +63 -0
  54. package/cli/templates/agent-roles/data.md +46 -0
  55. package/cli/templates/agent-roles/design.md +46 -0
  56. package/cli/templates/agent-roles/frontend.md +47 -0
  57. package/cli/templates/agent-roles/fullstack.md +47 -0
  58. package/cli/templates/agent-roles/qa.md +46 -0
  59. package/cli/templates/backlog.json.template +3 -0
  60. package/cli/templates/directive.json.template +9 -0
  61. package/cli/templates/directive.md.template +23 -0
  62. package/cli/templates/goals-index.md +21 -0
  63. package/cli/templates/gruai.config.json.template +12 -0
  64. package/cli/templates/lessons.md +16 -0
  65. package/cli/templates/vision.md +35 -0
  66. package/cli/templates/welcome-directive/directive.json +9 -0
  67. package/cli/templates/welcome-directive/directive.md +53 -0
  68. package/dist/assets/GamePage-C5XQQOQH.js +49 -0
  69. package/dist/assets/README.md +17 -0
  70. package/dist/assets/characters/char_0.png +0 -0
  71. package/dist/assets/characters/char_1.png +0 -0
  72. package/dist/assets/characters/char_10.png +0 -0
  73. package/dist/assets/characters/char_11.png +0 -0
  74. package/dist/assets/characters/char_2.png +0 -0
  75. package/dist/assets/characters/char_3.png +0 -0
  76. package/dist/assets/characters/char_4.png +0 -0
  77. package/dist/assets/characters/char_5.png +0 -0
  78. package/dist/assets/characters/char_6.png +0 -0
  79. package/dist/assets/characters/char_7.png +0 -0
  80. package/dist/assets/characters/char_8.png +0 -0
  81. package/dist/assets/characters/char_9.png +0 -0
  82. package/dist/assets/index-CnTPDqpP.js +12 -0
  83. package/dist/assets/index-gR5q7ikB.css +1 -0
  84. package/dist/assets/office/furniture.png +0 -0
  85. package/dist/assets/office/room-builder.png +0 -0
  86. package/dist/index.html +16 -0
  87. package/dist-server/scripts/intelligence-trends.d.ts +100 -0
  88. package/dist-server/scripts/intelligence-trends.js +365 -0
  89. package/dist-server/server/actions/cleanup.d.ts +4 -0
  90. package/dist-server/server/actions/cleanup.js +30 -0
  91. package/dist-server/server/actions/send-input.d.ts +6 -0
  92. package/dist-server/server/actions/send-input.js +147 -0
  93. package/dist-server/server/actions/terminal.d.ts +4 -0
  94. package/dist-server/server/actions/terminal.js +427 -0
  95. package/dist-server/server/config.d.ts +9 -0
  96. package/dist-server/server/config.js +217 -0
  97. package/dist-server/server/db.d.ts +7 -0
  98. package/dist-server/server/db.js +79 -0
  99. package/dist-server/server/hooks/event-receiver.d.ts +11 -0
  100. package/dist-server/server/hooks/event-receiver.js +36 -0
  101. package/dist-server/server/index.d.ts +1 -0
  102. package/dist-server/server/index.js +552 -0
  103. package/dist-server/server/notifications/macos.d.ts +5 -0
  104. package/dist-server/server/notifications/macos.js +22 -0
  105. package/dist-server/server/notifications/notifier.d.ts +17 -0
  106. package/dist-server/server/notifications/notifier.js +110 -0
  107. package/dist-server/server/parsers/process-discovery.d.ts +39 -0
  108. package/dist-server/server/parsers/process-discovery.js +776 -0
  109. package/dist-server/server/parsers/session-scanner.d.ts +56 -0
  110. package/dist-server/server/parsers/session-scanner.js +390 -0
  111. package/dist-server/server/parsers/session-state.d.ts +68 -0
  112. package/dist-server/server/parsers/session-state.js +696 -0
  113. package/dist-server/server/parsers/session-state.test.d.ts +1 -0
  114. package/dist-server/server/parsers/session-state.test.js +950 -0
  115. package/dist-server/server/parsers/task-parser.d.ts +10 -0
  116. package/dist-server/server/parsers/task-parser.js +97 -0
  117. package/dist-server/server/parsers/team-parser.d.ts +3 -0
  118. package/dist-server/server/parsers/team-parser.js +67 -0
  119. package/dist-server/server/platform/__tests__/claude-code.test.d.ts +1 -0
  120. package/dist-server/server/platform/__tests__/claude-code.test.js +311 -0
  121. package/dist-server/server/platform/claude-code.d.ts +34 -0
  122. package/dist-server/server/platform/claude-code.js +94 -0
  123. package/dist-server/server/platform/index.d.ts +5 -0
  124. package/dist-server/server/platform/index.js +1 -0
  125. package/dist-server/server/platform/types.d.ts +190 -0
  126. package/dist-server/server/platform/types.js +9 -0
  127. package/dist-server/server/state/aggregator.d.ts +42 -0
  128. package/dist-server/server/state/aggregator.js +1080 -0
  129. package/dist-server/server/state/work-item-types.d.ts +555 -0
  130. package/dist-server/server/state/work-item-types.js +168 -0
  131. package/dist-server/server/types.d.ts +237 -0
  132. package/dist-server/server/types.js +1 -0
  133. package/dist-server/server/watchers/claude-watcher.d.ts +17 -0
  134. package/dist-server/server/watchers/claude-watcher.js +130 -0
  135. package/dist-server/server/watchers/context-watcher.d.ts +22 -0
  136. package/dist-server/server/watchers/context-watcher.js +125 -0
  137. package/dist-server/server/watchers/directive-watcher.d.ts +46 -0
  138. package/dist-server/server/watchers/directive-watcher.js +497 -0
  139. package/dist-server/server/watchers/session-watcher.d.ts +18 -0
  140. package/dist-server/server/watchers/session-watcher.js +126 -0
  141. package/dist-server/server/watchers/state-watcher.d.ts +36 -0
  142. package/dist-server/server/watchers/state-watcher.js +369 -0
  143. package/package.json +68 -0
@@ -0,0 +1,143 @@
1
+ <!-- Reference: directive-json.md | Source: SKILL.md restructure -->
2
+
3
+ # directive.json — THE Single Source of Truth
4
+
5
+ directive.json is the ONLY state file for a directive. It stores metadata, pipeline progress, per-step outputs, and project references. There is NO separate checkpoint file — directive.json IS the checkpoint.
6
+
7
+ **File:** `.context/directives/{directive-name}/directive.json`
8
+
9
+ ```json
10
+ {
11
+ "id": "$ARGUMENTS",
12
+ "title": "{extracted from first heading of the .md}",
13
+ "status": "in_progress",
14
+ "created": "{today's date YYYY-MM-DD}",
15
+ "completed": null,
16
+ "weight": "{classification from triage step}",
17
+ "category": "framework | pipeline | dashboard | game",
18
+ "produced_features": [],
19
+ "report": null,
20
+ "backlog_sources": [],
21
+
22
+ "started_at": "ISO datetime",
23
+ "updated_at": "ISO datetime",
24
+ "current_step": "triage | read | context | challenge | brainstorm | plan | audit | approve | project-brainstorm | setup | execute | review-gate | wrapup | completion",
25
+
26
+ "pipeline": {
27
+ "triage": {
28
+ "status": "completed",
29
+ "agent": "CEO",
30
+ "output": { "weight": "medium", "rationale": "..." }
31
+ },
32
+ "read": {
33
+ "status": "completed",
34
+ "agent": "CEO",
35
+ "output": { "summary": "..." }
36
+ },
37
+ "context": {
38
+ "status": "completed",
39
+ "agent": "CEO",
40
+ "output": { "summary": "Read vision.md, goals, lessons..." }
41
+ },
42
+ "challenge": {
43
+ "status": "skipped",
44
+ "agent": "C-suite",
45
+ "output": { "summary": "Skipped for medium weight" }
46
+ },
47
+ "brainstorm": {
48
+ "status": "completed",
49
+ "agent": "C-suite",
50
+ "output": { "summary": "..." },
51
+ "artifacts": [".context/directives/{id}/brainstorm.md"]
52
+ },
53
+ "plan": {
54
+ "status": "completed",
55
+ "agent": "COO",
56
+ "output": { "goal": "...", "projects": "..." },
57
+ "artifacts": [".context/directives/{id}/plan.json"]
58
+ },
59
+ "audit": {
60
+ "status": "completed",
61
+ "agent": "CTO",
62
+ "output": { "summary": "...", "findings": 3 },
63
+ "artifacts": [".context/directives/{id}/audit.md"]
64
+ },
65
+ "approve": {
66
+ "status": "completed",
67
+ "agent": "CEO",
68
+ "output": { "decision": "approved", "modifications": [] }
69
+ },
70
+ "project-brainstorm": {
71
+ "status": "completed",
72
+ "agent": "CTO + builder",
73
+ "output": { "summary": "Task breakdown and DOD produced per project" },
74
+ "artifacts": [".context/directives/{id}/projects/{project-id}/project.json"]
75
+ },
76
+ "setup": {
77
+ "status": "completed",
78
+ "agent": "CEO",
79
+ "output": { "mode": "branch", "branch": "directive/{id}" }
80
+ },
81
+ "execute": {
82
+ "status": "active",
83
+ "agent": "frontend-engineer",
84
+ "reviewers": ["CTO"],
85
+ "output": { "progress": "1/3 complete", "current": "project-name" }
86
+ },
87
+ "review-gate": { "status": "pending" },
88
+ "wrapup": { "status": "pending", "agent": "CEO" },
89
+ "completion": { "status": "pending", "agent": "CEO" }
90
+ },
91
+
92
+ "projects": [
93
+ {
94
+ "id": "project-slug",
95
+ "status": "pending | in_progress | completed | failed"
96
+ }
97
+ ],
98
+
99
+ "planning": {
100
+ "coo_plan": {},
101
+ "ceo_approval": { "status": "approved|rejected|auto-approved", "modifications": [] },
102
+ "worktree_path": "string | null"
103
+ },
104
+
105
+ "wrapup": {
106
+ "okrs_persisted": false,
107
+ "follow_ups_processed": false,
108
+ "digest_path": null,
109
+ "lessons_updated": false
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### Status enum
115
+ Valid values for `status`: `pending`, `triaged`, `in_progress`, `awaiting_completion`, `completed`, `failed`, `reopened`.
116
+
117
+ - `awaiting_completion` — all work done, wrapup produced, waiting for CEO to approve completion
118
+ - `reopened` — CEO reopened after completion; new projects being planned
119
+
120
+ ### Pipeline step statuses
121
+ Each step in `pipeline` has: `status` (pending|active|completed|skipped|failed), `agent` (who runs it), `output` (key-value summary of what happened), and optional `artifacts` (file paths to detailed outputs).
122
+
123
+ ### Projects
124
+ The `projects[]` array contains lightweight references. Each entry has `id` (matching the project directory name under this directive) and `status`. The full project detail (tasks, DOD, agents) lives in `projects/{id}/project.json` — directive.json does NOT duplicate task-level data.
125
+
126
+ ### Write protocol
127
+ Use the Write tool to overwrite the entire directive.json. Always update `updated_at` to the current ISO timestamp. Update `pipeline.{step}.status` and `pipeline.{step}.output` after each step completes.
128
+
129
+ ### Extracting `category`
130
+ - Look for `**Category**: {category}` in the directive text
131
+ - Valid categories: `framework`, `pipeline`, `ui`, `game`
132
+ - If not found, infer from the directive name/scope
133
+ - If uncertain, set to the best-fit category — every directive MUST have a category
134
+
135
+ ### On completion (wrapup + completion gate)
136
+ - Set `status` to `"awaiting_completion"` (CEO must approve)
137
+ - CEO reviews digest and either:
138
+ - **Approves** -> status = `"completed"`, set `completed` to today's date
139
+ - **Reopens** -> status = `"reopened"`, CEO states what's missing, the COO plans new projects
140
+ - Set `report` to the digest filename
141
+ - `pipeline` data stays — it's the permanent execution record
142
+
143
+ Directives live in `directives/{id}/` — a directory per directive containing directive.json, directive.md, and all artifacts.
@@ -0,0 +1,37 @@
1
+ <!-- Reference: investigation-output.md | Source: redesign-pipeline-steps -->
2
+
3
+ # Investigation Output JSON Schema
4
+
5
+ Output from the Investigator agent (first phase of the two-agent audit flow). Contains pure data -- no recommendations, no risk classifications, no follow-ups.
6
+
7
+ The Architect agent receives this output as input when producing design recommendations.
8
+
9
+ ```json
10
+ {
11
+ "projects": [
12
+ {
13
+ "id": "slug matching the COO's project id",
14
+ "baseline": "Real measured baseline (e.g., '4 endpoints use string interpolation for SQL')",
15
+ "active_files": ["files that are in use and need work"],
16
+ "dead_code": ["files that exist but aren't actively used"],
17
+ "findings": "What was found in the codebase — specific, factual, no recommendations",
18
+ "constraints": ["Codebase patterns, conventions, or technical debt that affect this scope"]
19
+ }
20
+ ]
21
+ }
22
+ ```
23
+
24
+ ## Field Definitions
25
+
26
+ - **id**: Matches the project slug from the COO's plan.
27
+ - **baseline**: Exact measurements. Numbers, not vague qualifiers. "4 endpoints" not "several endpoints."
28
+ - **active_files**: Files that exist, are actively imported/used, and need modification for this project.
29
+ - **dead_code**: Files that exist but have no active imports, route references, or usage. Candidates for cleanup.
30
+ - **findings**: Factual observations about the codebase state. What patterns exist, what conventions are used, what state things are in. No recommendations.
31
+ - **constraints**: Technical debt, naming conventions, architectural patterns, or existing abstractions that would affect how this project is implemented. The Architect uses these to make informed design decisions.
32
+
33
+ ## What This Schema Does NOT Include
34
+
35
+ - `recommended_approach` — that's the Architect's job (see audit-output.md)
36
+ - `follow_ups` — the Architect produces these
37
+ - `risk` classifications — the Architect classifies risk informed by these findings
@@ -0,0 +1,103 @@
1
+ <!-- Reference: plan-schema.md | Source: SKILL.md restructure -->
2
+
3
+ # COO Plan JSON Schema
4
+
5
+ The COO's output must follow this schema EXACTLY. The COO plans at the **project level** -- task breakdown and DOD are produced later in the project-brainstorm step by the CTO + the assigned builder.
6
+
7
+ ## Schema
8
+
9
+ ```json
10
+ {
11
+ "goal": "CEO's goal title",
12
+ "category": "framework | pipeline | dashboard | game",
13
+ "challenges": {
14
+ "risks": ["Top 3 risks with this directive — be specific, not generic"],
15
+ "over_engineering_flags": ["Anything in the directive that's scoped too broadly or could be simpler"],
16
+ "recommendation": "Proceed as-is | Simplify (explain how — but still deliver everything)"
17
+ },
18
+ "projects": [
19
+ {
20
+ "id": "project-slug",
21
+ "title": "Human-readable title",
22
+ "priority": "P0 | P1 | P2",
23
+ "complexity": "simple | moderate | complex",
24
+ "agent": ["builder-name"],
25
+ "reviewers": ["reviewer-name"],
26
+ "auditor": "agent-id -- who investigates the codebase (resolve from registry by role)",
27
+ "scope_summary": "2-4 sentences: what this project delivers, the outcome, and the approach",
28
+ "depends_on": [],
29
+ "touches_files_hint": ["path/to/likely-modified-file.ts"]
30
+ }
31
+ ]
32
+ }
33
+ ```
34
+
35
+ ## Field reference
36
+
37
+ ### `depends_on` (array of project IDs, optional, default `[]`)
38
+
39
+ Explicit cross-project dependencies. If `depends_on: ["project-a"]`, this project cannot start until `project-a` completes. This is the **project-level** `depends_on` — The COO outputs it to control cross-project execution order.
40
+
41
+ **Task-level `depends_on`** is a separate concept: produced during the project-brainstorm step when the CTO + the builder decompose a project into tasks. Task-level `depends_on` controls within-project wave analysis (which tasks in the same project can run in parallel). Both levels feed into the wave algorithm in the execute step.
42
+
43
+ - Empty array (or omitted) = no dependencies = eligible for parallel execution (subject to file-overlap checks).
44
+ - Supplements array ordering. Array order is still respected -- `depends_on` makes implicit dependencies explicit and enables cross-priority-tier dependencies.
45
+ - The COO identifies these from scope analysis: "this project reads output produced by that project" = dependency.
46
+
47
+ ### `touches_files_hint` (array of file paths, optional)
48
+
49
+ The COO's prediction of which files this project will modify.
50
+
51
+ - Used as a hint for the auditor -- NOT the source of truth for wave analysis. The audit's `active_files` determines real file overlap.
52
+ - If The COO is unsure, omit it. Better no hint than a wrong hint. The auditor will discover the real files.
53
+ - Why a hint: The COO does not scan the codebase. She guesses from scope descriptions. The auditor actually reads the code.
54
+
55
+ ## Example: parallel vs sequential projects
56
+
57
+ ```json
58
+ {
59
+ "projects": [
60
+ {
61
+ "id": "update-schemas",
62
+ "title": "Update shared type definitions",
63
+ "priority": "P0",
64
+ "depends_on": [],
65
+ "touches_files_hint": ["src/types.ts", "src/schemas.ts"]
66
+ },
67
+ {
68
+ "id": "build-dashboard-widget",
69
+ "title": "Build dashboard analytics widget",
70
+ "priority": "P0",
71
+ "depends_on": ["update-schemas"],
72
+ "touches_files_hint": ["src/components/AnalyticsWidget.tsx"]
73
+ },
74
+ {
75
+ "id": "build-settings-page",
76
+ "title": "Build user settings page",
77
+ "priority": "P0",
78
+ "depends_on": ["update-schemas"],
79
+ "touches_files_hint": ["src/components/SettingsPage.tsx"]
80
+ },
81
+ {
82
+ "id": "integration-tests",
83
+ "title": "End-to-end tests for new features",
84
+ "priority": "P1",
85
+ "depends_on": ["build-dashboard-widget", "build-settings-page"]
86
+ }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ Wave analysis computes from this:
92
+ - **Wave 1**: `update-schemas` (no dependencies)
93
+ - **Wave 2**: `build-dashboard-widget` + `build-settings-page` (both depend only on wave 1, no file overlap -- run in parallel)
94
+ - **Wave 3**: `integration-tests` (depends on both wave 2 projects)
95
+
96
+ Without `depends_on`, all four projects would run sequentially by array order.
97
+
98
+ ## Key rules
99
+
100
+ - **Projects are ordered by priority + dependency.** Array order is respected. `depends_on` adds explicit dependency edges that the wave analyzer uses to compute parallel execution groups.
101
+ - **Dependent work belongs in ONE project.** If work items share code dependencies, they MUST be in the same project. Use `depends_on` only for genuinely separate projects where one must complete before another starts.
102
+ - **No tasks or DOD in the COO's output.** The COO identifies WHAT projects are needed and WHO builds them. Task decomposition and definition of done are produced in the project-brainstorm step by the CTO + the assigned builder.
103
+ - **Every project gets a brainstorm.** Complex projects get a full brainstorm (CTO + builder + specialist). Simple projects get a lightweight brainstorm (CTO solo).
@@ -0,0 +1,66 @@
1
+ <!-- Reference: architect-prompt.md | Source: redesign-pipeline-steps -->
2
+
3
+ # Architect Prompt Template
4
+
5
+ Used in the second phase of the two-agent audit flow (audit step). The Architect reads the QA engineer's investigation data + the COO's plan and produces design recommendations and risk-classified follow-ups.
6
+
7
+ The Architect role is filled by the named auditor from the COO's cast -- not a separate agent definition. If no auditor is assigned, defaults to the CTO.
8
+
9
+ ```
10
+ You are providing technical design recommendations based on a codebase investigation. The QA engineer already scanned the codebase in investigation mode and reported raw findings. Your job is to use those findings + the COO's plan to recommend HOW to implement each task.
11
+
12
+ COO'S PLAN:
13
+ {The COO's projects -- id, title, scope_summary for each}
14
+
15
+ INVESTIGATION DATA (from the QA engineer's investigation):
16
+ {The QA engineer's JSON output -- baselines, active_files, dead_code, findings, constraints per task}
17
+
18
+ GUARDRAILS:
19
+ {.context/vision.md guardrails section}
20
+
21
+ CEO STANDING ORDERS:
22
+ {.context/preferences.md}
23
+
24
+ LESSONS:
25
+ {.context/lessons/review-quality.md — for the CTO}
26
+ {.context/lessons/agent-behavior.md}
27
+
28
+ For each task:
29
+ 1. Read the QA engineer's investigation findings carefully -- these are ground truth about the codebase
30
+ 2. Consider the constraints the QA engineer flagged -- your approach must work within them
31
+ 3. Recommend a specific technical approach referencing real files and patterns from the investigation. **Your `recommended_approach` is the implementation spec that builders receive as their starting context.** Be concrete — name specific files to modify, patterns to follow, and functions to call. Vague approaches ("refactor the module") get ignored; specific ones ("add a Zod schema to server/api/products.ts validateInput(), following the pattern in server/api/users.ts") get followed.
32
+ 4. Identify follow-up actions with risk classification
33
+ 5. Flag if the QA engineer's findings suggest the task scope should change
34
+
35
+ RISK CLASSIFICATION for follow-ups:
36
+ - "low": Safe to auto-execute without CEO approval. Examples: delete dead code, remove unused imports, create backlog tickets, update OKR status, fix typos in comments.
37
+ - "medium": Auto-executed without CEO approval, but revert commands are included in the digest so the CEO can undo if needed. Examples: fix auth gaps, add input validation, add middleware, refactor modules, change API behavior.
38
+ - "high": CEO must decide. Examples: schema changes, new API endpoints, infrastructure changes, auth flow changes, anything user-facing, anything that could affect revenue.
39
+
40
+ When in doubt, classify UP (low → medium, medium → high). Read the guardrails — anything that would violate a guardrail is automatically high risk.
41
+
42
+ CRITICAL OUTPUT FORMAT: Your response must contain ONLY valid JSON. No prose, no analysis summary, no markdown fences, no text before or after the JSON. The very first character of your response must be `{` and the very last must be `}`.
43
+
44
+ Your output must follow this schema:
45
+
46
+ {
47
+ "tasks": [
48
+ {
49
+ "id": "slug matching the COO's task id",
50
+ "baseline": "Carried forward from investigation (for downstream reference)",
51
+ "active_files": ["Carried forward from investigation"],
52
+ "dead_code": ["Carried forward from investigation"],
53
+ "findings": "Carried forward from investigation + any additional design-relevant observations",
54
+ "recommended_approach": "How to implement this, referencing real patterns and files from the investigation data",
55
+ "follow_ups": [
56
+ {
57
+ "action": "Short description of what to do",
58
+ "risk": "low | medium | high",
59
+ "rationale": "Why this risk level — what could go wrong?",
60
+ "files": ["affected files, if known"]
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+ }
66
+ ```
@@ -0,0 +1,53 @@
1
+ <!-- Reference: auditor-prompt.md | Source: SKILL.md restructure -->
2
+
3
+ # Auditor Prompt Template (CTO, or named auditor)
4
+
5
+ Used for simple tasks (1-2 phases) where the single-agent audit path is used instead of the two-agent flow. The named auditor (defaulting to the CTO) does both investigation and architecture in one pass.
6
+
7
+ ```
8
+ You are auditing the codebase to provide real technical context for the COO's strategic plan.
9
+
10
+ For each project you've been assigned, your job is:
11
+ 1. Scan the codebase for the scope described — use Glob, Grep, Read tools
12
+ 2. Verify target files/endpoints are still active (grep for imports, fetch calls, route usage)
13
+ 3. Flag dead code — files or endpoints that exist but aren't actively used anywhere
14
+ 4. Measure real baselines (exact counts, specific file lists)
15
+ 5. Recommend a technical approach based on what you find
16
+ 6. Identify follow-up actions discovered during the audit, with risk classification
17
+
18
+ Be THOROUGH: grep broadly to find ALL instances of a problem, not just the obvious ones. Check existing patterns, env var names, and function signatures before recommending changes.
19
+
20
+ If a project's scope turns out to have nothing to fix (e.g., the problem described doesn't exist in the codebase, or it was already fixed), say so clearly in your findings.
21
+
22
+ RISK CLASSIFICATION for follow-ups:
23
+ - "low": Safe to auto-execute without CEO approval. Examples: delete dead code, remove unused imports, create backlog tickets, update OKR status, fix typos in comments.
24
+ - "medium": Auto-executed without CEO approval, but revert commands are included in the digest so the CEO can undo if needed. Examples: fix auth gaps, add input validation, add middleware, refactor modules, change API behavior.
25
+ - "high": CEO must decide. Examples: schema changes, new API endpoints, infrastructure changes, auth flow changes, anything user-facing, anything that could affect revenue.
26
+
27
+ When in doubt, classify UP (low → medium, medium → high). Read `.context/vision.md` guardrails — anything that would violate a guardrail is automatically high risk.
28
+
29
+ CRITICAL OUTPUT FORMAT: Your response must contain ONLY valid JSON. No prose, no analysis summary, no markdown fences, no text before or after the JSON. The very first character of your response must be `{` and the very last must be `}`.
30
+
31
+ Your output must follow this schema:
32
+
33
+ {
34
+ "projects": [
35
+ {
36
+ "id": "slug matching the COO's project id",
37
+ "baseline": "Real measured baseline (e.g., '4 endpoints use string interpolation for SQL')",
38
+ "active_files": ["files that are in use and need work"],
39
+ "dead_code": ["files that exist but aren't actively used — list them for auto-cleanup in follow_ups"],
40
+ "findings": "What you found in the codebase — be specific",
41
+ "recommended_approach": "How to implement this, referencing real patterns and files",
42
+ "follow_ups": [
43
+ {
44
+ "action": "Short description of what to do",
45
+ "risk": "low | medium | high",
46
+ "rationale": "Why this risk level — what could go wrong?",
47
+ "files": ["affected files, if known"]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ```
@@ -0,0 +1,68 @@
1
+ <!-- Reference: brainstorm-prompt.md | Source: SKILL.md restructure -->
2
+
3
+ # Brainstorm Agent Prompt Template
4
+
5
+ ## Phase 1: Initial Proposal
6
+
7
+ Used for all brainstorm participants (C-suite + auditor) in both heavyweight and strategic directives.
8
+
9
+ ```
10
+ You are {Name}, {Title}. The CEO issued a directive that needs approach exploration before execution planning.
11
+
12
+ DIRECTIVE:
13
+ {directive text}
14
+
15
+ CONTEXT:
16
+ - Vision: {vision.md relevant sections}
17
+ - Preferences: {preferences.md}
18
+
19
+ Your job: Propose a concrete approach for this directive. Not "endorse or challenge" — actually design HOW to solve this.
20
+
21
+ {auditor_instruction — include ONLY for the auditor agent}
22
+ As the auditor, ground your proposal in codebase reality. Reference specific files, patterns, and baselines you know exist. Flag any approaches that sound good in theory but would conflict with the actual codebase structure.
23
+ {/auditor_instruction}
24
+
25
+ {
26
+ "agent": "{name}",
27
+ "approach": "Your recommended approach in 3-5 sentences — be specific about what to build/change and in what order",
28
+ "tradeoffs": ["Key trade-off 1", "Key trade-off 2"],
29
+ "avoid": "What approach you'd explicitly NOT take and why",
30
+ "confidence": "high | medium | low — how certain are you this is the right approach?",
31
+ "feasibility_flags": ["Any codebase constraints or existing patterns that affect this approach — auditor fills this, others may leave empty"]
32
+ }
33
+
34
+ CRITICAL: First character `{`, last `}`. JSON only.
35
+ ```
36
+
37
+ ## Phase 2: Deliberation Round (Strategic Directives ONLY)
38
+
39
+ **This phase fires ONLY for strategic directives. Skip entirely for heavyweight.**
40
+
41
+ After collecting all initial proposals, share them with each agent and ask for one rebuttal. Each agent sees all proposals and writes one targeted critique.
42
+
43
+ ```
44
+ You are {Name}, {Title}. You proposed an approach for this directive. Now review all proposals and write ONE rebuttal.
45
+
46
+ YOUR PROPOSAL:
47
+ {this agent's Phase 1 output}
48
+
49
+ ALL PROPOSALS:
50
+ {all Phase 1 outputs from all agents, including yours}
51
+
52
+ Write ONE rebuttal targeting the proposal you most disagree with. Be specific: what's wrong with it, what they missed, and what would happen if we followed their approach.
53
+
54
+ {
55
+ "agent": "{name}",
56
+ "target_agent": "name of the agent whose proposal you're rebutting",
57
+ "critique": "What's wrong with their approach — be specific about what they missed or got wrong",
58
+ "alternative": "What should be done instead, referencing your original proposal or a new variation"
59
+ }
60
+
61
+ CRITICAL: First character `{`, last `}`. JSON only.
62
+ ```
63
+
64
+ ## Synthesis
65
+
66
+ After collecting proposals (and rebuttals for strategic), the orchestrator synthesizes:
67
+ - **Heavyweight**: Synthesize proposals only. Identify convergence points and key disagreements. Write synthesis to brainstorm.md.
68
+ - **Strategic**: Synthesize proposals AND rebuttals. Identify which critiques landed, which proposals survived challenge. Extract 2-3 CEO clarification questions from unresolved disagreements. Write synthesis to brainstorm.md.
@@ -0,0 +1,35 @@
1
+ <!-- Reference: challenger-prompt.md | Source: SKILL.md restructure -->
2
+
3
+ # Challenger Prompt Template
4
+
5
+ Customize per agent:
6
+
7
+ ```
8
+ You are {Name}, {Title}. The CEO has issued a directive. Before we plan execution, your job is to independently evaluate this directive from your domain expertise.
9
+
10
+ DIRECTIVE:
11
+ {directive text}
12
+
13
+ CONTEXT:
14
+ - Vision + Guardrails: {vision.md content}
15
+ - CEO Preferences: {preferences.md content}
16
+ - Current Goals: {goals index summary}
17
+
18
+ Evaluate the directive and produce ONE of these responses:
19
+
20
+ 1. ENDORSE — You agree this is the right thing to do. Briefly explain why from your domain perspective.
21
+ 2. CHALLENGE — You see problems with this directive. Explain what concerns you and propose an alternative or modification.
22
+ 3. FLAG — The directive is fine directionally, but there are risks or considerations the CEO should be aware of before committing.
23
+
24
+ Keep it SHORT — 3-5 sentences max. This is a gut check, not a detailed analysis.
25
+
26
+ CRITICAL OUTPUT FORMAT: Your response must contain ONLY valid JSON. The very first character must be `{` and the very last must be `}`.
27
+
28
+ {
29
+ "agent": "{name}",
30
+ "verdict": "endorse | challenge | flag",
31
+ "reasoning": "Your 3-5 sentence evaluation from your domain perspective",
32
+ "alternative": "If challenging: what would you do instead? If endorsing/flagging: null",
33
+ "risk_flags": ["Short risk statements, if any. Empty array if none."]
34
+ }
35
+ ```
@@ -0,0 +1,134 @@
1
+ <!-- Reference: digest.md | Source: SKILL.md restructure -->
2
+
3
+ # Digest Report Template
4
+
5
+ Report file format:
6
+
7
+ ```markdown
8
+ # Directive Report: {goal title}
9
+
10
+ **Date**: {today}
11
+ **Directive**: {directive filename}
12
+ **Planned by**: COO
13
+
14
+ ## Summary
15
+
16
+ {1-2 sentence overview of what was accomplished}
17
+
18
+ ## Definition of Done Assessment
19
+
20
+ ### {Task Title}
21
+ - [x] {criterion 1} — MET
22
+ - [x] {criterion 2} — MET
23
+ - [ ] {criterion 3} — NOT MET ({reason})
24
+
25
+ (repeat for each task)
26
+
27
+ ## Tasks
28
+
29
+ ### {Task Title} — {status: completed/partial/skipped/failed}
30
+ - **Phases**: {phases list}
31
+ - **Team**: {who was involved}
32
+ - **Scope**: {what was accomplished}
33
+ - **Files changed**: {list}
34
+ - **Audit baseline**: {what the audit found before work started}
35
+ - **Review findings**: {summary of reviewer feedback, if any}
36
+ - **Notes**: {any blockers, partial work, or follow-ups}
37
+
38
+ (repeat for each task)
39
+
40
+ ## Follow-Up Actions
41
+
42
+ ### Auto-Executed (low risk — done, just FYI)
43
+ - {action} — {result}
44
+
45
+ ### Auto-Executed (medium risk — done, revert commands below)
46
+ - {action} — {result}
47
+
48
+ ### Backlogged (high risk — written to goal backlog)
49
+ - {action} — Added to {goal}/backlog.json
50
+
51
+ ## Revert Commands
52
+
53
+ {Copy-pasteable commands to undo each auto-executed medium-risk follow-up action. The CEO can run any of these to revert a specific action without affecting other changes.}
54
+
55
+ | # | Action | Revert Command |
56
+ |---|--------|----------------|
57
+ | 1 | {medium-risk action description} | `git checkout {hash} -- {file}` |
58
+ | 2 | {medium-risk action description} | `rm {file}` |
59
+
60
+ {If no medium-risk follow-ups were auto-executed: "No medium-risk actions — no revert commands needed."}
61
+
62
+ {IMPORTANT: Every revert command must be tested before inclusion. The engineer generating these commands must verify they actually work — untested revert commands are worse than no revert commands.}
63
+
64
+ ## Agent-Proposed Improvements
65
+
66
+ {Collect all `proposed_improvements` from engineer build reports. These are gaps, missing features, and edge cases identified by agents during the build — not assigned work, but task from the builders.}
67
+
68
+ - {improvement description} — proposed by {agent/task}
69
+ - {improvement description} — proposed by {agent/task}
70
+
71
+ {If no improvements were proposed, note: "No improvements proposed — agents completed assigned work only." This is a signal that the task instruction isn't working.}
72
+
73
+ ## Corrections Caught
74
+
75
+ {Aggregate corrections_check data from all task reviews. For each violation found and fixed during the build cycle:}
76
+
77
+ | Correction | Task | Reviewer | Resolution |
78
+ |------------|-----------|----------|------------|
79
+ | {Standing Correction #N: description} | {task title} | {who caught it} | {Fixed in retry / Noted for follow-up} |
80
+
81
+ - **Corrections reviewed**: {total across all tasks} (out of {N} standing corrections × {M} tasks)
82
+ - **Violations found**: {count}
83
+ - **Violations fixed**: {count fixed during retry vs noted}
84
+
85
+ {If no violations: "All standing corrections verified across all tasks. No violations found — the guardrails held."}
86
+
87
+ ## UX Verification Results
88
+
89
+ {Results from browser testing after UI tasks:}
90
+ - {page/flow tested}: {pass/fail} — {what was found}
91
+ - Screenshots: {list of screenshots taken}
92
+
93
+ {If no UI work: "No UI tasks — UX verification skipped."}
94
+
95
+ ## Potentially Stale Docs
96
+
97
+ {Output from `.claude/hooks/detect-stale-docs.sh` — lists docs that reference files modified in this directive but were not themselves updated. These docs may contain outdated information.}
98
+
99
+ - {doc path} -> references modified: {list of modified files it references}
100
+ - {doc path} -> references modified: {list of modified files it references}
101
+
102
+ {If no stale docs detected: "No potentially stale docs detected."}
103
+
104
+ ## Self-Assessment
105
+
106
+ ### Audit Accuracy
107
+ - Findings confirmed by build: {count}/{total}
108
+ - Findings that were wrong or irrelevant: {list}
109
+ - Issues found during build that audit missed: {list}
110
+
111
+ ### Build Success
112
+ - Type-check passed: {yes/no}
113
+ - Tasks completed: {count}/{total}
114
+ - Build failures: {list if any}
115
+
116
+ ### UX Verification
117
+ - UI tasks verified in browser: {count}/{total UI tasks}
118
+ - Dead-end UI found: {count} (elements that look clickable but do nothing)
119
+ - Data mismatches found: {count} (numbers/counts that don't match backend)
120
+ - Issues fixed during verification: {list or "none"}
121
+
122
+ ### Agent Task
123
+ - Improvements proposed by agents: {count}
124
+ - Improvements worth pursuing: {list or "none yet — need more data"}
125
+ - Agents that proposed nothing: {list — these agents need better prompting}
126
+
127
+ ### Risk Classification
128
+ - Low-risk auto-executes that caused problems: {list or "none"}
129
+ - Items that should have been classified differently: {list or "none"}
130
+
131
+ ### Challenge Accuracy
132
+ - C-suite challenges: {count endorsed, count challenged, count flagged}
133
+ - Challenges that proved correct in hindsight: {list or "N/A — first run"}
134
+ ```