@davidorex/pi-workflows 0.2.0 → 0.3.1

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 (216) hide show
  1. package/CHANGELOG.md +7 -4
  2. package/README.md +12 -2
  3. package/agents/architecture-designer.agent.yaml +58 -0
  4. package/agents/architecture-inferrer.agent.yaml +60 -0
  5. package/agents/gap-identifier.agent.yaml +66 -0
  6. package/agents/handoff-writer.agent.yaml +64 -0
  7. package/agents/plan-creator.agent.yaml +63 -0
  8. package/agents/project-definer.agent.yaml +53 -0
  9. package/agents/project-inferrer.agent.yaml +63 -0
  10. package/agents/requirements-gatherer.agent.yaml +58 -0
  11. package/dist/agent-spec.d.ts +27 -0
  12. package/dist/agent-spec.d.ts.map +1 -0
  13. package/dist/agent-spec.js +112 -0
  14. package/dist/agent-spec.js.map +1 -0
  15. package/dist/checkpoint.d.ts +50 -0
  16. package/dist/checkpoint.d.ts.map +1 -0
  17. package/dist/checkpoint.js +109 -0
  18. package/dist/checkpoint.js.map +1 -0
  19. package/dist/completion.d.ts +18 -0
  20. package/dist/completion.d.ts.map +1 -0
  21. package/dist/completion.js +58 -0
  22. package/dist/completion.js.map +1 -0
  23. package/dist/dag.d.ts +56 -0
  24. package/dist/dag.d.ts.map +1 -0
  25. package/dist/dag.js +178 -0
  26. package/dist/dag.js.map +1 -0
  27. package/dist/dispatch.d.ts +35 -0
  28. package/dist/dispatch.d.ts.map +1 -0
  29. package/dist/dispatch.js +311 -0
  30. package/dist/dispatch.js.map +1 -0
  31. package/dist/expression.d.ts +64 -0
  32. package/dist/expression.d.ts.map +1 -0
  33. package/dist/expression.js +294 -0
  34. package/dist/expression.js.map +1 -0
  35. package/dist/format.d.ts +19 -0
  36. package/dist/format.d.ts.map +1 -0
  37. package/dist/format.js +42 -0
  38. package/dist/format.js.map +1 -0
  39. package/dist/index.d.ts +8 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +724 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/output.d.ts +12 -0
  44. package/dist/output.d.ts.map +1 -0
  45. package/dist/output.js +59 -0
  46. package/dist/output.js.map +1 -0
  47. package/dist/state.d.ts +66 -0
  48. package/dist/state.d.ts.map +1 -0
  49. package/dist/state.js +227 -0
  50. package/dist/state.js.map +1 -0
  51. package/dist/step-agent.d.ts +35 -0
  52. package/dist/step-agent.d.ts.map +1 -0
  53. package/dist/step-agent.js +171 -0
  54. package/dist/step-agent.js.map +1 -0
  55. package/dist/step-command.d.ts +21 -0
  56. package/dist/step-command.d.ts.map +1 -0
  57. package/dist/step-command.js +150 -0
  58. package/dist/step-command.js.map +1 -0
  59. package/dist/step-foreach.d.ts +33 -0
  60. package/dist/step-foreach.d.ts.map +1 -0
  61. package/dist/step-foreach.js +112 -0
  62. package/dist/step-foreach.js.map +1 -0
  63. package/dist/step-gate.d.ts +18 -0
  64. package/dist/step-gate.d.ts.map +1 -0
  65. package/dist/step-gate.js +137 -0
  66. package/dist/step-gate.js.map +1 -0
  67. package/dist/step-loop.d.ts +32 -0
  68. package/dist/step-loop.d.ts.map +1 -0
  69. package/dist/step-loop.js +278 -0
  70. package/dist/step-loop.js.map +1 -0
  71. package/dist/step-monitor.d.ts +56 -0
  72. package/dist/step-monitor.d.ts.map +1 -0
  73. package/dist/step-monitor.js +317 -0
  74. package/dist/step-monitor.js.map +1 -0
  75. package/dist/step-parallel.d.ts +43 -0
  76. package/dist/step-parallel.d.ts.map +1 -0
  77. package/dist/step-parallel.js +122 -0
  78. package/dist/step-parallel.js.map +1 -0
  79. package/{src/step-pause.ts → dist/step-pause.d.ts} +3 -13
  80. package/dist/step-pause.d.ts.map +1 -0
  81. package/dist/step-pause.js +22 -0
  82. package/dist/step-pause.js.map +1 -0
  83. package/dist/step-shared.d.ts +63 -0
  84. package/dist/step-shared.d.ts.map +1 -0
  85. package/dist/step-shared.js +136 -0
  86. package/dist/step-shared.js.map +1 -0
  87. package/dist/step-transform.d.ts +11 -0
  88. package/dist/step-transform.d.ts.map +1 -0
  89. package/dist/step-transform.js +41 -0
  90. package/dist/step-transform.js.map +1 -0
  91. package/dist/template.d.ts +51 -0
  92. package/dist/template.d.ts.map +1 -0
  93. package/{src/template.ts → dist/template.js} +32 -38
  94. package/dist/template.js.map +1 -0
  95. package/dist/test-helpers.d.ts +17 -0
  96. package/dist/test-helpers.d.ts.map +1 -0
  97. package/dist/test-helpers.js +46 -0
  98. package/dist/test-helpers.js.map +1 -0
  99. package/dist/tui.d.ts +47 -0
  100. package/dist/tui.d.ts.map +1 -0
  101. package/dist/tui.js +143 -0
  102. package/dist/tui.js.map +1 -0
  103. package/dist/types.d.ts +165 -0
  104. package/dist/types.d.ts.map +1 -0
  105. package/dist/types.js +3 -0
  106. package/dist/types.js.map +1 -0
  107. package/dist/workflow-discovery.d.ts +23 -0
  108. package/dist/workflow-discovery.d.ts.map +1 -0
  109. package/dist/workflow-discovery.js +103 -0
  110. package/dist/workflow-discovery.js.map +1 -0
  111. package/dist/workflow-executor.d.ts +50 -0
  112. package/dist/workflow-executor.d.ts.map +1 -0
  113. package/dist/workflow-executor.js +738 -0
  114. package/dist/workflow-executor.js.map +1 -0
  115. package/dist/workflow-sdk.d.ts +44 -0
  116. package/dist/workflow-sdk.d.ts.map +1 -0
  117. package/dist/workflow-sdk.js +457 -0
  118. package/dist/workflow-sdk.js.map +1 -0
  119. package/dist/workflow-spec.d.ts +33 -0
  120. package/dist/workflow-spec.d.ts.map +1 -0
  121. package/dist/workflow-spec.js +476 -0
  122. package/dist/workflow-spec.js.map +1 -0
  123. package/dist/workflows-dir.d.ts +3 -0
  124. package/dist/workflows-dir.d.ts.map +1 -0
  125. package/{src/workflows-dir.ts → dist/workflows-dir.js} +1 -0
  126. package/dist/workflows-dir.js.map +1 -0
  127. package/package.json +53 -38
  128. package/schemas/decomposition-specs.schema.json +48 -48
  129. package/schemas/execution-results.schema.json +48 -48
  130. package/schemas/investigation-findings.schema.json +43 -43
  131. package/schemas/pattern-analysis.schema.json +41 -41
  132. package/schemas/phase.schema.json +48 -0
  133. package/schemas/plan-breakdown.schema.json +20 -20
  134. package/schemas/quality-analysis.schema.json +33 -33
  135. package/schemas/research-findings.schema.json +42 -42
  136. package/schemas/structure-analysis.schema.json +40 -40
  137. package/schemas/synthesis.schema.json +31 -31
  138. package/schemas/verifier-output.schema.json +94 -94
  139. package/skill-narrative.md +107 -0
  140. package/skills/pi-workflows/SKILL.md +185 -0
  141. package/skills/pi-workflows/references/bundled-resources.md +87 -0
  142. package/templates/architecture-designer/task.md +117 -0
  143. package/templates/architecture-inferrer/task.md +61 -0
  144. package/templates/gap-identifier/task.md +103 -0
  145. package/templates/handoff-writer/task.md +91 -0
  146. package/templates/plan-creator/task.md +143 -0
  147. package/templates/project-definer/task.md +67 -0
  148. package/templates/project-inferrer/task.md +56 -0
  149. package/templates/requirements-gatherer/task.md +90 -0
  150. package/workflows/analyze-existing-project.workflow.yaml +94 -0
  151. package/workflows/create-handoff.workflow.yaml +66 -0
  152. package/workflows/create-phase.workflow.yaml +1 -1
  153. package/workflows/do-gap.workflow.yaml +4 -4
  154. package/workflows/fix-audit.workflow.yaml +1 -1
  155. package/workflows/gap-to-phase.workflow.yaml +1 -1
  156. package/workflows/init-new-project.workflow.yaml +81 -0
  157. package/workflows/plan-from-requirements.workflow.yaml +59 -0
  158. package/workflows/self-implement.workflow.yaml +3 -3
  159. package/workflows/typed-analysis.workflow.yaml +4 -4
  160. package/src/agent-spec.test.ts +0 -289
  161. package/src/agent-spec.ts +0 -122
  162. package/src/block-validation.test.ts +0 -350
  163. package/src/checkpoint.test.ts +0 -237
  164. package/src/checkpoint.ts +0 -140
  165. package/src/completion.test.ts +0 -143
  166. package/src/completion.ts +0 -68
  167. package/src/dag.test.ts +0 -350
  168. package/src/dag.ts +0 -219
  169. package/src/dispatch.test.ts +0 -475
  170. package/src/dispatch.ts +0 -353
  171. package/src/expression.test.ts +0 -353
  172. package/src/expression.ts +0 -332
  173. package/src/format.test.ts +0 -80
  174. package/src/format.ts +0 -41
  175. package/src/graduated-failure.test.ts +0 -556
  176. package/src/index.test.ts +0 -114
  177. package/src/index.ts +0 -516
  178. package/src/loop.test.ts +0 -551
  179. package/src/output.test.ts +0 -213
  180. package/src/output.ts +0 -70
  181. package/src/parallel-integration.test.ts +0 -175
  182. package/src/resume.test.ts +0 -192
  183. package/src/state.test.ts +0 -192
  184. package/src/state.ts +0 -254
  185. package/src/step-agent.test.ts +0 -327
  186. package/src/step-agent.ts +0 -178
  187. package/src/step-command.test.ts +0 -330
  188. package/src/step-command.ts +0 -132
  189. package/src/step-foreach.test.ts +0 -647
  190. package/src/step-foreach.ts +0 -148
  191. package/src/step-gate.test.ts +0 -185
  192. package/src/step-gate.ts +0 -116
  193. package/src/step-loop.test.ts +0 -626
  194. package/src/step-loop.ts +0 -323
  195. package/src/step-parallel.test.ts +0 -475
  196. package/src/step-parallel.ts +0 -168
  197. package/src/step-pause.test.ts +0 -30
  198. package/src/step-shared.test.ts +0 -355
  199. package/src/step-shared.ts +0 -157
  200. package/src/step-transform.test.ts +0 -155
  201. package/src/step-transform.ts +0 -47
  202. package/src/template-integration.test.ts +0 -72
  203. package/src/template.test.ts +0 -162
  204. package/src/test-helpers.ts +0 -51
  205. package/src/tui.test.ts +0 -355
  206. package/src/tui.ts +0 -182
  207. package/src/types.ts +0 -195
  208. package/src/verifier-schema.test.ts +0 -226
  209. package/src/workflow-discovery.test.ts +0 -105
  210. package/src/workflow-discovery.ts +0 -114
  211. package/src/workflow-executor.test.ts +0 -1532
  212. package/src/workflow-executor.ts +0 -810
  213. package/src/workflow-sdk.test.ts +0 -238
  214. package/src/workflow-sdk.ts +0 -262
  215. package/src/workflow-spec.test.ts +0 -576
  216. package/src/workflow-spec.ts +0 -471
@@ -0,0 +1,56 @@
1
+ Infer the project identity for the project at `{{ path }}`.
2
+
3
+ ## Codebase Analysis
4
+
5
+ {% if analysis.files is defined %}
6
+ ### Files ({{ analysis.files | length }} total)
7
+ {% for file in analysis.files | batch(20) | first %}
8
+ - `{{ file.path }}` ({{ file.language | default("unknown") }})
9
+ {% endfor %}
10
+ {% if analysis.files | length > 20 %}
11
+ ... and {{ analysis.files | length - 20 }} more files
12
+ {% endif %}
13
+ {% endif %}
14
+
15
+ {% if analysis.entryPoints is defined %}
16
+ ### Entry Points
17
+ {% for ep in analysis.entryPoints %}
18
+ - `{{ ep }}`
19
+ {% endfor %}
20
+ {% endif %}
21
+
22
+ ## Instructions
23
+
24
+ Read project metadata and documentation to determine the project's identity. Start with:
25
+ - README.md (or equivalent)
26
+ - Package manifest (package.json, Cargo.toml, pyproject.toml, go.mod, etc.)
27
+ - CLAUDE.md or similar project instructions if present
28
+ - CI/CD configuration if present
29
+
30
+ Produce a project identity block:
31
+
32
+ 1. **name** — the project's canonical name (from package manifest, not directory name)
33
+ 2. **description** — concise summary of what the project does (2-3 sentences max)
34
+ 3. **core_value** — single sentence: why does this project exist? What value does it provide?
35
+ 4. **target_users** — who uses this? (e.g., "TypeScript developers", "DevOps engineers", "data scientists")
36
+ 5. **constraints** — each with `type` and `description`:
37
+ - Runtime constraints (Node.js version, browser support, etc.)
38
+ - Language constraints (TypeScript strict mode, ESM-only, etc.)
39
+ - Compatibility constraints (API stability, backward compat, etc.)
40
+ 6. **scope_boundaries**:
41
+ - `in`: what the project explicitly does
42
+ - `out`: what the project explicitly does not do (deferred or excluded)
43
+ 7. **goals** — each with `id`, `description`, and optional `success_criteria` array
44
+ - Only include goals evidenced by the codebase (README roadmap, issues, TODO markers)
45
+ 8. **status** — one of: inception, planning, development, maintenance, complete
46
+ - Infer from: version maturity, commit recency, test coverage, presence of CI
47
+ 9. **repository** — repository URL if discoverable from package manifest or git remote
48
+ 10. **stack** — primary technology choices only (language, framework, key libraries — not every dependency)
49
+
50
+ ## Required Output Schema
51
+
52
+ You MUST produce JSON conforming exactly to this schema. Every required field must be present.
53
+
54
+ ```json
55
+ {{ output_schema }}
56
+ ```
@@ -0,0 +1,90 @@
1
+ ## Project Identity
2
+
3
+ **Name:** {{ project.name }}
4
+ **Description:** {{ project.description }}
5
+ **Core Value:** {{ project.core_value }}
6
+
7
+ ### Target Users
8
+ {% for user in project.target_users %}
9
+ - {{ user }}
10
+ {% endfor %}
11
+
12
+ ### Constraints
13
+ {% for constraint in project.constraints %}
14
+ - [{{ constraint.type }}] {{ constraint.description }}
15
+ {% endfor %}
16
+
17
+ ### Scope Boundaries
18
+
19
+ **In scope:**
20
+ {% for item in project.scope_boundaries.in %}
21
+ - {{ item }}
22
+ {% endfor %}
23
+
24
+ **Out of scope:**
25
+ {% for item in project.scope_boundaries.out %}
26
+ - {{ item }}
27
+ {% endfor %}
28
+
29
+ ### Goals
30
+ {% for goal in project.goals %}
31
+ - **{{ goal.id }}**: {{ goal.description }}
32
+ {% for criterion in goal.success_criteria %}- {{ criterion }}
33
+ {% endfor %}
34
+ {% endfor %}
35
+
36
+ {% if vision %}
37
+ ## Original Vision
38
+
39
+ {{ vision }}
40
+ {% endif %}
41
+
42
+ ## Instructions
43
+
44
+ Derive requirements from the project identity above. Produce a comprehensive but proportionate set of requirements covering what the system must do (functional), quality attributes it must exhibit (non-functional), hard limits it must respect (constraint), and external connections it must support (integration).
45
+
46
+ ### For each requirement, provide:
47
+
48
+ 1. **id** — unique, formatted as REQ-001, REQ-002, etc.
49
+ 2. **description** — clear statement of what is required
50
+ 3. **type** — one of: `functional`, `non-functional`, `constraint`, `integration`
51
+ 4. **status** — set to `"proposed"` for all
52
+ 5. **priority** — MoSCoW: `must`, `should`, `could`, `wont`
53
+ 6. **acceptance_criteria** — array of specific, verifiable statements
54
+ 7. **source** — set to `"agent"` for all
55
+ 8. **depends_on** — array of other requirement IDs this depends on (empty array if none)
56
+
57
+ ### Priority guidance
58
+
59
+ - **must**: the project fails without this — directly tied to core_value and essential goals
60
+ - **should**: important for target users but the project could ship a minimal version without it
61
+ - **could**: enhances the experience but is clearly secondary
62
+ - **wont**: explicitly excluded — derive these from scope_boundaries.out
63
+
64
+ ### Coverage expectations
65
+
66
+ - Every goal should map to at least one "must" requirement
67
+ - Every constraint should appear as a "constraint" type requirement
68
+ - Include at least one non-functional requirement for each quality attribute the project implies (performance, security, usability, reliability, etc. — only those that are relevant)
69
+ - Include "wont" requirements for major items in scope_boundaries.out
70
+
71
+ ### Output format
72
+
73
+ Produce a single JSON object with a `requirements` array:
74
+
75
+ ```json
76
+ {
77
+ "requirements": [
78
+ {
79
+ "id": "REQ-001",
80
+ "description": "string",
81
+ "type": "functional",
82
+ "status": "proposed",
83
+ "priority": "must",
84
+ "acceptance_criteria": ["string"],
85
+ "source": "agent",
86
+ "depends_on": []
87
+ }
88
+ ]
89
+ }
90
+ ```
@@ -0,0 +1,94 @@
1
+ name: analyze-existing-project
2
+ description: Analyze an existing codebase, infer architecture and conventions, identify gaps, create planning state
3
+ version: "1"
4
+
5
+ input:
6
+ type: object
7
+ properties:
8
+ path:
9
+ type: string
10
+ description: Path to analyze (defaults to current directory)
11
+
12
+ steps:
13
+ explore:
14
+ agent: code-explorer
15
+ input:
16
+ path: ${{ input.path }}
17
+
18
+ # These two analyze concurrently — no mutual dependencies, both depend only on explore
19
+ analyze-structure:
20
+ agent: structure-analyzer
21
+ input:
22
+ exploration: ${{ steps.explore.textOutput }}
23
+ path: ${{ input.path }}
24
+ output:
25
+ format: json
26
+
27
+ analyze-patterns:
28
+ agent: pattern-analyzer
29
+ input:
30
+ exploration: ${{ steps.explore.textOutput }}
31
+ path: ${{ input.path }}
32
+ output:
33
+ format: json
34
+
35
+ infer-architecture:
36
+ agent: architecture-inferrer
37
+ input:
38
+ analysis:
39
+ structure: ${{ steps.analyze-structure.output }}
40
+ patterns: ${{ steps.analyze-patterns.output }}
41
+ path: ${{ input.path }}
42
+ output:
43
+ format: json
44
+ schema: block:architecture
45
+ retry:
46
+ maxAttempts: 2
47
+
48
+ infer-project:
49
+ agent: project-inferrer
50
+ input:
51
+ analysis:
52
+ structure: ${{ steps.analyze-structure.output }}
53
+ patterns: ${{ steps.analyze-patterns.output }}
54
+ path: ${{ input.path }}
55
+ output:
56
+ format: json
57
+ schema: block:project
58
+ retry:
59
+ maxAttempts: 2
60
+
61
+ identify-gaps:
62
+ agent: gap-identifier
63
+ input:
64
+ analysis:
65
+ structure: ${{ steps.analyze-structure.output }}
66
+ patterns: ${{ steps.analyze-patterns.output }}
67
+ architecture: ${{ steps.infer-architecture.output }}
68
+ path: ${{ input.path }}
69
+ output:
70
+ format: json
71
+ schema: block:gaps
72
+ retry:
73
+ maxAttempts: 2
74
+
75
+ artifacts:
76
+ project:
77
+ path: .project/project.json
78
+ from: steps.infer-project.output
79
+ architecture:
80
+ path: .project/architecture.json
81
+ from: steps.infer-architecture.output
82
+ gaps:
83
+ path: .project/gaps.json
84
+ from: steps.identify-gaps.output
85
+
86
+ completion:
87
+ template: |
88
+ Existing project analyzed. Results written to .project/ blocks.
89
+
90
+ **Project:** ${{ steps.infer-project.output.name }} — ${{ steps.infer-project.output.core_value }}
91
+ **Architecture:** ${{ steps.infer-architecture.output.modules | length }} modules, ${{ steps.infer-architecture.output.patterns | length }} patterns
92
+ **Gaps:** ${{ steps.identify-gaps.output.gaps | length }} identified
93
+
94
+ Use `/project status` to see the full state. Use `/project validate` to check cross-block references.
@@ -0,0 +1,66 @@
1
+ name: create-handoff
2
+ description: Capture current work context for session resume
3
+ version: "1"
4
+
5
+ steps:
6
+ load-state:
7
+ command: |
8
+ node -e "
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const projectDir = '.project';
12
+ const state = {};
13
+
14
+ // Read project identity
15
+ try { state.project = JSON.parse(fs.readFileSync(path.join(projectDir, 'project.json'), 'utf-8')); } catch {}
16
+
17
+ // Read phase files
18
+ try {
19
+ const phasesDir = path.join(projectDir, 'phases');
20
+ state.phases = fs.readdirSync(phasesDir).filter(f => f.endsWith('.json')).map(f => {
21
+ try { return JSON.parse(fs.readFileSync(path.join(phasesDir, f), 'utf-8')); } catch { return null; }
22
+ }).filter(Boolean);
23
+ } catch { state.phases = []; }
24
+
25
+ // Read block summaries
26
+ try {
27
+ state.gaps = JSON.parse(fs.readFileSync(path.join(projectDir, 'gaps.json'), 'utf-8'));
28
+ } catch {}
29
+ try {
30
+ state.decisions = JSON.parse(fs.readFileSync(path.join(projectDir, 'decisions.json'), 'utf-8'));
31
+ } catch {}
32
+ try {
33
+ state.tasks = JSON.parse(fs.readFileSync(path.join(projectDir, 'tasks.json'), 'utf-8'));
34
+ } catch {}
35
+
36
+ // Recent git activity
37
+ try {
38
+ const { execSync } = require('child_process');
39
+ state.recent_commits = execSync('git log --oneline -10', { encoding: 'utf-8' }).trim().split('\n');
40
+ state.changed_files = execSync('git diff --name-only HEAD~3 2>/dev/null || echo \"\"', { encoding: 'utf-8' }).trim().split('\n').filter(Boolean);
41
+ } catch { state.recent_commits = []; state.changed_files = []; }
42
+
43
+ console.log(JSON.stringify(state));
44
+ "
45
+ output:
46
+ format: json
47
+
48
+ capture:
49
+ agent: handoff-writer
50
+ input:
51
+ project_state: ${{ steps.load-state.output }}
52
+ path: "."
53
+ output:
54
+ format: json
55
+ schema: block:handoff
56
+ retry:
57
+ maxAttempts: 2
58
+
59
+ artifacts:
60
+ handoff:
61
+ path: .project/handoff.json
62
+ from: steps.capture.output
63
+
64
+ completion:
65
+ message: |
66
+ Handoff captured to .project/handoff.json. Resume context is available for the next session.
@@ -42,7 +42,7 @@ steps:
42
42
  inventory: "${{ steps.load-context.output.inventory }}"
43
43
  output:
44
44
  format: json
45
- schema: ../../.project/schemas/phase.schema.json
45
+ schema: block:phase
46
46
 
47
47
  write-phase:
48
48
  command: |
@@ -37,7 +37,7 @@ steps:
37
37
  gap: "${{ steps.load.output.gap }}"
38
38
  output:
39
39
  format: json
40
- schema: schemas/investigation-findings.schema.json
40
+ schema: ../schemas/investigation-findings.schema.json
41
41
 
42
42
  research:
43
43
  when: "${{ steps.investigate.output.needs_research }}"
@@ -47,7 +47,7 @@ steps:
47
47
  research_questions: "${{ steps.investigate.output.research_questions }}"
48
48
  output:
49
49
  format: json
50
- schema: schemas/research-findings.schema.json
50
+ schema: ../schemas/research-findings.schema.json
51
51
 
52
52
  decompose:
53
53
  agent: decomposer
@@ -57,7 +57,7 @@ steps:
57
57
  research: "${{ steps.research.output }}"
58
58
  output:
59
59
  format: json
60
- schema: schemas/decomposition-specs.schema.json
60
+ schema: ../schemas/decomposition-specs.schema.json
61
61
 
62
62
  implement:
63
63
  forEach: "${{ steps.decompose.output.specs }}"
@@ -72,7 +72,7 @@ steps:
72
72
  onExhausted: fail
73
73
  output:
74
74
  format: json
75
- schema: schemas/execution-results.schema.json
75
+ schema: ../schemas/execution-results.schema.json
76
76
 
77
77
  verify:
78
78
  command: |
@@ -87,7 +87,7 @@ steps:
87
87
  conformance_reference: "${{ steps.load.output.conformance_reference }}"
88
88
  output:
89
89
  format: json
90
- schema: schemas/execution-results.schema.json
90
+ schema: ../schemas/execution-results.schema.json
91
91
  path: .project/fix-audit-results.json
92
92
 
93
93
  route-results:
@@ -72,7 +72,7 @@ steps:
72
72
  inventory: "${{ steps.load-context.output.inventory }}"
73
73
  output:
74
74
  format: json
75
- schema: ../../.project/schemas/phase.schema.json
75
+ schema: block:phase
76
76
 
77
77
  write-phase:
78
78
  command: |
@@ -0,0 +1,81 @@
1
+ name: init-new-project
2
+ description: Bootstrap a new project from vision through requirements to initial plan
3
+ version: "1"
4
+
5
+ input:
6
+ type: object
7
+ required: [vision]
8
+ properties:
9
+ vision:
10
+ type: string
11
+ description: What the project aims to achieve, who it's for, and why it matters
12
+
13
+ steps:
14
+ define-identity:
15
+ agent: project-definer
16
+ input:
17
+ vision: ${{ input.vision }}
18
+ output:
19
+ format: json
20
+ schema: block:project
21
+ retry:
22
+ maxAttempts: 2
23
+
24
+ gather-requirements:
25
+ agent: requirements-gatherer
26
+ input:
27
+ project: ${{ steps.define-identity.output }}
28
+ vision: ${{ input.vision }}
29
+ output:
30
+ format: json
31
+ schema: block:requirements
32
+ retry:
33
+ maxAttempts: 2
34
+
35
+ design-architecture:
36
+ agent: architecture-designer
37
+ input:
38
+ project: ${{ steps.define-identity.output }}
39
+ requirements: ${{ steps.gather-requirements.output }}
40
+ output:
41
+ format: json
42
+ schema: block:architecture
43
+ retry:
44
+ maxAttempts: 2
45
+
46
+ create-plan:
47
+ agent: plan-creator
48
+ input:
49
+ project: ${{ steps.define-identity.output }}
50
+ requirements: ${{ steps.gather-requirements.output }}
51
+ architecture: ${{ steps.design-architecture.output }}
52
+ output:
53
+ format: json
54
+ schema: block:tasks
55
+ retry:
56
+ maxAttempts: 2
57
+
58
+ artifacts:
59
+ project:
60
+ path: .project/project.json
61
+ from: steps.define-identity.output
62
+ requirements:
63
+ path: .project/requirements.json
64
+ from: steps.gather-requirements.output
65
+ architecture:
66
+ path: .project/architecture.json
67
+ from: steps.design-architecture.output
68
+ tasks:
69
+ path: .project/tasks.json
70
+ from: steps.create-plan.output
71
+
72
+ completion:
73
+ template: |
74
+ Project initialized from vision. Results written to .project/ blocks.
75
+
76
+ **Identity:** ${{ steps.define-identity.output.name }} — ${{ steps.define-identity.output.core_value }}
77
+ **Requirements:** ${{ steps.gather-requirements.output.requirements | length }} captured
78
+ **Architecture:** ${{ steps.design-architecture.output.modules | length }} modules
79
+ **Plan:** phases and tasks created
80
+
81
+ Use `/project status` to see the full state. Use `/project validate` to check cross-block references.
@@ -0,0 +1,59 @@
1
+ name: plan-from-requirements
2
+ description: Decompose accepted requirements into phases and tasks
3
+ version: "1"
4
+
5
+ steps:
6
+ load-context:
7
+ command: |
8
+ node -e "
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const projectDir = '.project';
12
+ const context = {};
13
+
14
+ // Read requirements
15
+ try { context.requirements = JSON.parse(fs.readFileSync(path.join(projectDir, 'requirements.json'), 'utf-8')); } catch { context.requirements = { requirements: [] }; }
16
+
17
+ // Read architecture
18
+ try { context.architecture = JSON.parse(fs.readFileSync(path.join(projectDir, 'architecture.json'), 'utf-8')); } catch { context.architecture = null; }
19
+
20
+ // Read project identity
21
+ try { context.project = JSON.parse(fs.readFileSync(path.join(projectDir, 'project.json'), 'utf-8')); } catch { context.project = null; }
22
+
23
+ // Read existing phases
24
+ try {
25
+ const phasesDir = path.join(projectDir, 'phases');
26
+ context.existing_phases = fs.readdirSync(phasesDir).filter(f => f.endsWith('.json')).map(f => {
27
+ try { return JSON.parse(fs.readFileSync(path.join(phasesDir, f), 'utf-8')); } catch { return null; }
28
+ }).filter(Boolean);
29
+ } catch { context.existing_phases = []; }
30
+
31
+ console.log(JSON.stringify(context));
32
+ "
33
+ output:
34
+ format: json
35
+
36
+ create-plan:
37
+ agent: plan-creator
38
+ input:
39
+ project: ${{ steps.load-context.output.project }}
40
+ requirements: ${{ steps.load-context.output.requirements }}
41
+ architecture: ${{ steps.load-context.output.architecture }}
42
+ existing_phases: ${{ steps.load-context.output.existing_phases }}
43
+ output:
44
+ format: json
45
+ schema: block:tasks
46
+ retry:
47
+ maxAttempts: 2
48
+
49
+ artifacts:
50
+ tasks:
51
+ path: .project/tasks.json
52
+ from: steps.create-plan.output
53
+
54
+ completion:
55
+ template: |
56
+ Plan created from requirements. Tasks written to .project/tasks.json.
57
+
58
+ Use `/project status` to see the phase and task breakdown.
59
+ Use `/project validate` to check cross-block references.
@@ -25,7 +25,7 @@ steps:
25
25
  conventions: "${{ input.conventions }}"
26
26
  output:
27
27
  format: json
28
- schema: schemas/plan-breakdown.schema.json
28
+ schema: ../schemas/plan-breakdown.schema.json
29
29
 
30
30
  implement:
31
31
  forEach: "${{ steps.plan.output.plans }}"
@@ -37,7 +37,7 @@ steps:
37
37
  conventions: "${{ input.conventions }}"
38
38
  output:
39
39
  format: json
40
- schema: schemas/execution-results.schema.json
40
+ schema: ../schemas/execution-results.schema.json
41
41
 
42
42
  verify:
43
43
  agent: verifier
@@ -46,7 +46,7 @@ steps:
46
46
  step_output: "${{ steps.implement.output }}"
47
47
  output:
48
48
  format: json
49
- schema: schemas/verifier-output.schema.json
49
+ schema: ../schemas/verifier-output.schema.json
50
50
 
51
51
  check:
52
52
  gate:
@@ -26,7 +26,7 @@ steps:
26
26
  path: ${{ input.path }}
27
27
  output:
28
28
  format: json
29
- schema: schemas/structure-analysis.schema.json
29
+ schema: ../schemas/structure-analysis.schema.json
30
30
 
31
31
  analyze-quality:
32
32
  agent: quality-analyzer
@@ -35,7 +35,7 @@ steps:
35
35
  path: ${{ input.path }}
36
36
  output:
37
37
  format: json
38
- schema: schemas/quality-analysis.schema.json
38
+ schema: ../schemas/quality-analysis.schema.json
39
39
 
40
40
  analyze-patterns:
41
41
  agent: pattern-analyzer
@@ -44,7 +44,7 @@ steps:
44
44
  path: ${{ input.path }}
45
45
  output:
46
46
  format: json
47
- schema: schemas/pattern-analysis.schema.json
47
+ schema: ../schemas/pattern-analysis.schema.json
48
48
 
49
49
  synthesize:
50
50
  agent: synthesizer
@@ -54,7 +54,7 @@ steps:
54
54
  patterns: ${{ steps.analyze-patterns.output }}
55
55
  output:
56
56
  format: json
57
- schema: schemas/synthesis.schema.json
57
+ schema: ../schemas/synthesis.schema.json
58
58
 
59
59
  completion:
60
60
  message: |