@davidorex/pi-workflows 0.2.0 → 0.3.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/CHANGELOG.md +7 -4
- package/README.md +12 -2
- package/agents/architecture-designer.agent.yaml +58 -0
- package/agents/architecture-inferrer.agent.yaml +60 -0
- package/agents/gap-identifier.agent.yaml +66 -0
- package/agents/handoff-writer.agent.yaml +64 -0
- package/agents/plan-creator.agent.yaml +63 -0
- package/agents/project-definer.agent.yaml +53 -0
- package/agents/project-inferrer.agent.yaml +63 -0
- package/agents/requirements-gatherer.agent.yaml +58 -0
- package/dist/agent-spec.d.ts +27 -0
- package/dist/agent-spec.d.ts.map +1 -0
- package/dist/agent-spec.js +112 -0
- package/dist/agent-spec.js.map +1 -0
- package/dist/checkpoint.d.ts +50 -0
- package/dist/checkpoint.d.ts.map +1 -0
- package/dist/checkpoint.js +109 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/completion.d.ts +18 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +58 -0
- package/dist/completion.js.map +1 -0
- package/dist/dag.d.ts +56 -0
- package/dist/dag.d.ts.map +1 -0
- package/dist/dag.js +172 -0
- package/dist/dag.js.map +1 -0
- package/dist/dispatch.d.ts +35 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +311 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/expression.d.ts +64 -0
- package/dist/expression.d.ts.map +1 -0
- package/dist/expression.js +294 -0
- package/dist/expression.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +42 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +675 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +12 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +59 -0
- package/dist/output.js.map +1 -0
- package/dist/state.d.ts +66 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +227 -0
- package/dist/state.js.map +1 -0
- package/dist/step-agent.d.ts +35 -0
- package/dist/step-agent.d.ts.map +1 -0
- package/dist/step-agent.js +156 -0
- package/dist/step-agent.js.map +1 -0
- package/dist/step-command.d.ts +21 -0
- package/dist/step-command.d.ts.map +1 -0
- package/dist/step-command.js +150 -0
- package/dist/step-command.js.map +1 -0
- package/dist/step-foreach.d.ts +33 -0
- package/dist/step-foreach.d.ts.map +1 -0
- package/dist/step-foreach.js +112 -0
- package/dist/step-foreach.js.map +1 -0
- package/dist/step-gate.d.ts +18 -0
- package/dist/step-gate.d.ts.map +1 -0
- package/dist/step-gate.js +137 -0
- package/dist/step-gate.js.map +1 -0
- package/dist/step-loop.d.ts +32 -0
- package/dist/step-loop.d.ts.map +1 -0
- package/dist/step-loop.js +278 -0
- package/dist/step-loop.js.map +1 -0
- package/dist/step-monitor.d.ts +56 -0
- package/dist/step-monitor.d.ts.map +1 -0
- package/dist/step-monitor.js +317 -0
- package/dist/step-monitor.js.map +1 -0
- package/dist/step-parallel.d.ts +43 -0
- package/dist/step-parallel.d.ts.map +1 -0
- package/dist/step-parallel.js +122 -0
- package/dist/step-parallel.js.map +1 -0
- package/{src/step-pause.ts → dist/step-pause.d.ts} +3 -13
- package/dist/step-pause.d.ts.map +1 -0
- package/dist/step-pause.js +22 -0
- package/dist/step-pause.js.map +1 -0
- package/dist/step-shared.d.ts +57 -0
- package/dist/step-shared.d.ts.map +1 -0
- package/dist/step-shared.js +125 -0
- package/dist/step-shared.js.map +1 -0
- package/dist/step-transform.d.ts +11 -0
- package/dist/step-transform.d.ts.map +1 -0
- package/dist/step-transform.js +41 -0
- package/dist/step-transform.js.map +1 -0
- package/dist/template.d.ts +51 -0
- package/dist/template.d.ts.map +1 -0
- package/{src/template.ts → dist/template.js} +32 -38
- package/dist/template.js.map +1 -0
- package/dist/test-helpers.d.ts +17 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/dist/test-helpers.js +46 -0
- package/dist/test-helpers.js.map +1 -0
- package/dist/tui.d.ts +47 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +143 -0
- package/dist/tui.js.map +1 -0
- package/dist/types.d.ts +164 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-discovery.d.ts +23 -0
- package/dist/workflow-discovery.d.ts.map +1 -0
- package/dist/workflow-discovery.js +103 -0
- package/dist/workflow-discovery.js.map +1 -0
- package/dist/workflow-executor.d.ts +50 -0
- package/dist/workflow-executor.d.ts.map +1 -0
- package/dist/workflow-executor.js +726 -0
- package/dist/workflow-executor.js.map +1 -0
- package/dist/workflow-sdk.d.ts +44 -0
- package/dist/workflow-sdk.d.ts.map +1 -0
- package/dist/workflow-sdk.js +438 -0
- package/dist/workflow-sdk.js.map +1 -0
- package/dist/workflow-spec.d.ts +33 -0
- package/dist/workflow-spec.d.ts.map +1 -0
- package/dist/workflow-spec.js +464 -0
- package/dist/workflow-spec.js.map +1 -0
- package/dist/workflows-dir.d.ts +3 -0
- package/dist/workflows-dir.d.ts.map +1 -0
- package/{src/workflows-dir.ts → dist/workflows-dir.js} +1 -0
- package/dist/workflows-dir.js.map +1 -0
- package/package.json +53 -38
- package/schemas/decomposition-specs.schema.json +48 -48
- package/schemas/execution-results.schema.json +48 -48
- package/schemas/investigation-findings.schema.json +43 -43
- package/schemas/pattern-analysis.schema.json +41 -41
- package/schemas/phase.schema.json +48 -0
- package/schemas/plan-breakdown.schema.json +20 -20
- package/schemas/quality-analysis.schema.json +33 -33
- package/schemas/research-findings.schema.json +42 -42
- package/schemas/structure-analysis.schema.json +40 -40
- package/schemas/synthesis.schema.json +31 -31
- package/schemas/verifier-output.schema.json +94 -94
- package/skill-narrative.md +84 -0
- package/skills/pi-workflows/SKILL.md +247 -0
- package/templates/architecture-designer/task.md +117 -0
- package/templates/architecture-inferrer/task.md +61 -0
- package/templates/gap-identifier/task.md +103 -0
- package/templates/handoff-writer/task.md +91 -0
- package/templates/plan-creator/task.md +143 -0
- package/templates/project-definer/task.md +67 -0
- package/templates/project-inferrer/task.md +56 -0
- package/templates/requirements-gatherer/task.md +90 -0
- package/workflows/analyze-existing-project.workflow.yaml +74 -0
- package/workflows/create-handoff.workflow.yaml +58 -0
- package/workflows/create-phase.workflow.yaml +1 -1
- package/workflows/do-gap.workflow.yaml +4 -4
- package/workflows/fix-audit.workflow.yaml +1 -1
- package/workflows/gap-to-phase.workflow.yaml +1 -1
- package/workflows/init-new-project.workflow.yaml +55 -0
- package/workflows/plan-from-requirements.workflow.yaml +51 -0
- package/workflows/self-implement.workflow.yaml +3 -3
- package/workflows/typed-analysis.workflow.yaml +4 -4
- package/src/agent-spec.test.ts +0 -289
- package/src/agent-spec.ts +0 -122
- package/src/block-validation.test.ts +0 -350
- package/src/checkpoint.test.ts +0 -237
- package/src/checkpoint.ts +0 -140
- package/src/completion.test.ts +0 -143
- package/src/completion.ts +0 -68
- package/src/dag.test.ts +0 -350
- package/src/dag.ts +0 -219
- package/src/dispatch.test.ts +0 -475
- package/src/dispatch.ts +0 -353
- package/src/expression.test.ts +0 -353
- package/src/expression.ts +0 -332
- package/src/format.test.ts +0 -80
- package/src/format.ts +0 -41
- package/src/graduated-failure.test.ts +0 -556
- package/src/index.test.ts +0 -114
- package/src/index.ts +0 -516
- package/src/loop.test.ts +0 -551
- package/src/output.test.ts +0 -213
- package/src/output.ts +0 -70
- package/src/parallel-integration.test.ts +0 -175
- package/src/resume.test.ts +0 -192
- package/src/state.test.ts +0 -192
- package/src/state.ts +0 -254
- package/src/step-agent.test.ts +0 -327
- package/src/step-agent.ts +0 -178
- package/src/step-command.test.ts +0 -330
- package/src/step-command.ts +0 -132
- package/src/step-foreach.test.ts +0 -647
- package/src/step-foreach.ts +0 -148
- package/src/step-gate.test.ts +0 -185
- package/src/step-gate.ts +0 -116
- package/src/step-loop.test.ts +0 -626
- package/src/step-loop.ts +0 -323
- package/src/step-parallel.test.ts +0 -475
- package/src/step-parallel.ts +0 -168
- package/src/step-pause.test.ts +0 -30
- package/src/step-shared.test.ts +0 -355
- package/src/step-shared.ts +0 -157
- package/src/step-transform.test.ts +0 -155
- package/src/step-transform.ts +0 -47
- package/src/template-integration.test.ts +0 -72
- package/src/template.test.ts +0 -162
- package/src/test-helpers.ts +0 -51
- package/src/tui.test.ts +0 -355
- package/src/tui.ts +0 -182
- package/src/types.ts +0 -195
- package/src/verifier-schema.test.ts +0 -226
- package/src/workflow-discovery.test.ts +0 -105
- package/src/workflow-discovery.ts +0 -114
- package/src/workflow-executor.test.ts +0 -1532
- package/src/workflow-executor.ts +0 -810
- package/src/workflow-sdk.test.ts +0 -238
- package/src/workflow-sdk.ts +0 -262
- package/src/workflow-spec.test.ts +0 -576
- package/src/workflow-spec.ts +0 -471
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# @davidorex/pi-workflows
|
|
2
|
+
|
|
3
|
+
> Workflow orchestration extension for Pi
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
### workflow
|
|
8
|
+
|
|
9
|
+
Run a named workflow with typed input. Discovers workflows from .workflows/ and ~/.pi/agent/workflows/.
|
|
10
|
+
|
|
11
|
+
*Run a multi-step workflow with typed data flow between agents*
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Required | Description |
|
|
14
|
+
|-----------|------|----------|-------------|
|
|
15
|
+
| `workflow` | string | yes | Name of the workflow to run |
|
|
16
|
+
| `input` | unknown | no | Input data for the workflow (validated against workflow's input schema) |
|
|
17
|
+
| `fresh` | string | no | Set to 'true' to start a fresh run, ignoring any incomplete prior runs |
|
|
18
|
+
|
|
19
|
+
### workflow-list
|
|
20
|
+
|
|
21
|
+
List available workflows with names, descriptions, and sources.
|
|
22
|
+
|
|
23
|
+
*List available workflows with names, descriptions, and sources*
|
|
24
|
+
|
|
25
|
+
### workflow-agents
|
|
26
|
+
|
|
27
|
+
List available agents with full specs, or inspect a single agent by name. Returns role, description, model, tools, output format/schema, prompt template paths.
|
|
28
|
+
|
|
29
|
+
*List available agents with specs, or inspect a single agent by name*
|
|
30
|
+
|
|
31
|
+
| Parameter | Type | Required | Description |
|
|
32
|
+
|-----------|------|----------|-------------|
|
|
33
|
+
| `name` | string | no | Agent name to inspect (omit to list all) |
|
|
34
|
+
|
|
35
|
+
### workflow-validate
|
|
36
|
+
|
|
37
|
+
Validate workflow specs — check agents, schemas, step references, and filters.
|
|
38
|
+
|
|
39
|
+
*Validate workflow specs — check agents, schemas, step references, filters*
|
|
40
|
+
|
|
41
|
+
| Parameter | Type | Required | Description |
|
|
42
|
+
|-----------|------|----------|-------------|
|
|
43
|
+
| `name` | string | no | Workflow name to validate (omit to validate all) |
|
|
44
|
+
|
|
45
|
+
### workflow-status
|
|
46
|
+
|
|
47
|
+
Get workflow vocabulary — step types, filters, available agents, workflows, schemas, templates.
|
|
48
|
+
|
|
49
|
+
*Get workflow vocabulary — step types, filters, available agents, workflows, schemas*
|
|
50
|
+
|
|
51
|
+
### workflow-init
|
|
52
|
+
|
|
53
|
+
Initialize .workflows/ directory for workflow run state.
|
|
54
|
+
|
|
55
|
+
*Initialize .workflows/ directory for workflow run state*
|
|
56
|
+
|
|
57
|
+
## Commands
|
|
58
|
+
|
|
59
|
+
### /workflow
|
|
60
|
+
|
|
61
|
+
List and run workflows
|
|
62
|
+
|
|
63
|
+
Subcommands: `init`, `run`, `list`, `resume`, `validate`, `status`
|
|
64
|
+
|
|
65
|
+
## Keyboard Shortcuts
|
|
66
|
+
|
|
67
|
+
- **ctrl+h** — Pause running workflow
|
|
68
|
+
- **ctrl+j** — Resume paused workflow
|
|
69
|
+
|
|
70
|
+
## Bundled Resources
|
|
71
|
+
|
|
72
|
+
### agents/ (21 files)
|
|
73
|
+
|
|
74
|
+
- `agents/architecture-designer.agent.yaml`
|
|
75
|
+
- `agents/architecture-inferrer.agent.yaml`
|
|
76
|
+
- `agents/audit-fixer.agent.yaml`
|
|
77
|
+
- `agents/code-explorer.agent.yaml`
|
|
78
|
+
- `agents/decomposer.agent.yaml`
|
|
79
|
+
- `agents/gap-identifier.agent.yaml`
|
|
80
|
+
- `agents/handoff-writer.agent.yaml`
|
|
81
|
+
- `agents/investigator.agent.yaml`
|
|
82
|
+
- `agents/pattern-analyzer.agent.yaml`
|
|
83
|
+
- `agents/phase-author.agent.yaml`
|
|
84
|
+
- `agents/plan-creator.agent.yaml`
|
|
85
|
+
- `agents/plan-decomposer.agent.yaml`
|
|
86
|
+
- `agents/project-definer.agent.yaml`
|
|
87
|
+
- `agents/project-inferrer.agent.yaml`
|
|
88
|
+
- `agents/quality-analyzer.agent.yaml`
|
|
89
|
+
- `agents/requirements-gatherer.agent.yaml`
|
|
90
|
+
- `agents/researcher.agent.yaml`
|
|
91
|
+
- `agents/spec-implementer.agent.yaml`
|
|
92
|
+
- `agents/structure-analyzer.agent.yaml`
|
|
93
|
+
- `agents/synthesizer.agent.yaml`
|
|
94
|
+
- `agents/verifier.agent.yaml`
|
|
95
|
+
|
|
96
|
+
### schemas/ (11 files)
|
|
97
|
+
|
|
98
|
+
- `schemas/decomposition-specs.schema.json`
|
|
99
|
+
- `schemas/execution-results.schema.json`
|
|
100
|
+
- `schemas/investigation-findings.schema.json`
|
|
101
|
+
- `schemas/pattern-analysis.schema.json`
|
|
102
|
+
- `schemas/phase.schema.json`
|
|
103
|
+
- `schemas/plan-breakdown.schema.json`
|
|
104
|
+
- `schemas/quality-analysis.schema.json`
|
|
105
|
+
- `schemas/research-findings.schema.json`
|
|
106
|
+
- `schemas/structure-analysis.schema.json`
|
|
107
|
+
- `schemas/synthesis.schema.json`
|
|
108
|
+
- `schemas/verifier-output.schema.json`
|
|
109
|
+
|
|
110
|
+
### workflows/ (14 files)
|
|
111
|
+
|
|
112
|
+
- `workflows/analyze-existing-project.workflow.yaml`
|
|
113
|
+
- `workflows/create-handoff.workflow.yaml`
|
|
114
|
+
- `workflows/create-phase.workflow.yaml`
|
|
115
|
+
- `workflows/do-gap.workflow.yaml`
|
|
116
|
+
- `workflows/fix-audit.workflow.yaml`
|
|
117
|
+
- `workflows/gap-to-phase.workflow.yaml`
|
|
118
|
+
- `workflows/init-new-project.workflow.yaml`
|
|
119
|
+
- `workflows/parallel-analysis.workflow.yaml`
|
|
120
|
+
- `workflows/parallel-explicit.workflow.yaml`
|
|
121
|
+
- `workflows/pausable-analysis.workflow.yaml`
|
|
122
|
+
- `workflows/plan-from-requirements.workflow.yaml`
|
|
123
|
+
- `workflows/resumable-analysis.workflow.yaml`
|
|
124
|
+
- `workflows/self-implement.workflow.yaml`
|
|
125
|
+
- `workflows/typed-analysis.workflow.yaml`
|
|
126
|
+
|
|
127
|
+
### templates/ (28 files)
|
|
128
|
+
|
|
129
|
+
- `templates/analyzers/base-analyzer.md`
|
|
130
|
+
- `templates/analyzers/macros.md`
|
|
131
|
+
- `templates/analyzers/patterns-task.md`
|
|
132
|
+
- `templates/analyzers/patterns.md`
|
|
133
|
+
- `templates/analyzers/quality-task.md`
|
|
134
|
+
- `templates/analyzers/quality.md`
|
|
135
|
+
- `templates/analyzers/structure-task.md`
|
|
136
|
+
- `templates/analyzers/structure.md`
|
|
137
|
+
- `templates/architecture-designer/task.md`
|
|
138
|
+
- `templates/architecture-inferrer/task.md`
|
|
139
|
+
- `templates/audit-fixer/task.md`
|
|
140
|
+
- `templates/decomposer/task.md`
|
|
141
|
+
- `templates/explorer/system.md`
|
|
142
|
+
- `templates/explorer/task.md`
|
|
143
|
+
- `templates/gap-identifier/task.md`
|
|
144
|
+
- `templates/handoff-writer/task.md`
|
|
145
|
+
- `templates/investigator/task.md`
|
|
146
|
+
- `templates/phase-author/task.md`
|
|
147
|
+
- `templates/plan-creator/task.md`
|
|
148
|
+
- `templates/plan-decomposer/task.md`
|
|
149
|
+
- `templates/project-definer/task.md`
|
|
150
|
+
- `templates/project-inferrer/task.md`
|
|
151
|
+
- `templates/requirements-gatherer/task.md`
|
|
152
|
+
- `templates/researcher/task.md`
|
|
153
|
+
- `templates/spec-implementer/task.md`
|
|
154
|
+
- `templates/synthesizer/system.md`
|
|
155
|
+
- `templates/synthesizer/task.md`
|
|
156
|
+
- `templates/verifier/task.md`
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## How It Works
|
|
161
|
+
|
|
162
|
+
pi-workflows orchestrates multi-step agent workflows defined in YAML. Workflows are DAGs of typed steps with data flow via `${{ }}` expressions.
|
|
163
|
+
|
|
164
|
+
### Workflow Discovery
|
|
165
|
+
|
|
166
|
+
Workflows are discovered from three locations (first match wins):
|
|
167
|
+
1. `.workflows/*.workflow.yaml` — project-level
|
|
168
|
+
2. `~/.pi/agent/workflows/*.workflow.yaml` — user-level
|
|
169
|
+
3. Package bundled `workflows/` — built-in
|
|
170
|
+
|
|
171
|
+
### Step Types
|
|
172
|
+
|
|
173
|
+
| Type | Field | Description |
|
|
174
|
+
|------|-------|-------------|
|
|
175
|
+
| agent | `agent: name` | Dispatch an LLM subprocess via `pi --mode json` |
|
|
176
|
+
| command | `command: "..."` | Run a shell command, capture stdout as output |
|
|
177
|
+
| transform | `transform: { mapping: {...} }` | Pure data transformation via expressions, no LLM |
|
|
178
|
+
| gate | `gate: { check: "..." }` | Shell command exit code as pass/fail boolean |
|
|
179
|
+
| loop | `loop: { maxAttempts, steps }` | Repeat sub-steps until gate breaks or max reached |
|
|
180
|
+
| parallel | `parallel: { a: ..., b: ... }` | Run named sub-steps concurrently |
|
|
181
|
+
| pause | `pause: true` or `pause: "message"` | Pause execution, resumable later |
|
|
182
|
+
| forEach | `forEach: "${{ expr }}"` | Iterate over an array, executing the step per element |
|
|
183
|
+
|
|
184
|
+
### Expression Syntax
|
|
185
|
+
|
|
186
|
+
`${{ expression }}` resolves against scope: `input`, `steps`, `loop`, `forEach`.
|
|
187
|
+
|
|
188
|
+
Access step outputs: `${{ steps.investigate.output.findings }}`
|
|
189
|
+
Filters: `${{ steps.analyze.output | json }}`, `${{ items | length }}`, `${{ name | upper }}`
|
|
190
|
+
|
|
191
|
+
Available filters: length, keys, filter, json, upper, lower, trim, default, first, last, join, split, replace, includes, map, sum, min, max, sort, unique, flatten, zip, group_by, count_by, chunk, pick, omit, entries, from_entries, merge, values, not, and, or.
|
|
192
|
+
|
|
193
|
+
### Agent Resolution
|
|
194
|
+
|
|
195
|
+
Agent specs (`.agent.yaml`) are resolved from three locations (first match wins):
|
|
196
|
+
1. `.pi/agents/<name>.agent.yaml` — project-level
|
|
197
|
+
2. `~/.pi/agent/agents/<name>.agent.yaml` — user-level
|
|
198
|
+
3. Package bundled `agents/<name>.agent.yaml` — built-in
|
|
199
|
+
|
|
200
|
+
Agent specs define: model, thinking level, tools, system prompt (or template), task template, output format/schema.
|
|
201
|
+
|
|
202
|
+
### Execution Model
|
|
203
|
+
|
|
204
|
+
1. Steps are ordered by YAML declaration order
|
|
205
|
+
2. DAG planner infers parallelism from `${{ steps.X }}` references
|
|
206
|
+
3. Steps without explicit dependencies run after their predecessor (conservative sequential)
|
|
207
|
+
4. Each step's result is persisted atomically to `<runDir>/state.json`
|
|
208
|
+
5. TUI progress widget shows real-time step status, cost, and timing
|
|
209
|
+
|
|
210
|
+
### Checkpoint and Resume
|
|
211
|
+
|
|
212
|
+
Incomplete runs (failed or paused) are detected on next invocation. If the workflow spec hasn't changed incompatibly, execution resumes from the last completed step. Failed steps are re-executed. Use `fresh: "true"` to force a new run.
|
|
213
|
+
|
|
214
|
+
### Output Validation
|
|
215
|
+
|
|
216
|
+
Steps with `output.schema` validate the agent's JSON output against a JSON Schema file. Validation failure marks the step as failed.
|
|
217
|
+
|
|
218
|
+
### Per-Step Retry
|
|
219
|
+
|
|
220
|
+
Steps with `retry: { maxAttempts: N }` are re-executed on failure. Between retries:
|
|
221
|
+
- Project block files are rolled back to pre-attempt state
|
|
222
|
+
- Prior error messages are injected into the prompt
|
|
223
|
+
- Optional `steeringMessage` provides custom retry guidance
|
|
224
|
+
|
|
225
|
+
### Completion Messages
|
|
226
|
+
|
|
227
|
+
After execution, the workflow result is injected into the main LLM conversation. The `completion` field controls this: either a `template` (full `${{ }}` template) or `message` + `include` (message text plus resolved data paths).
|
|
228
|
+
|
|
229
|
+
### Artifacts
|
|
230
|
+
|
|
231
|
+
Workflows can write post-completion files via the `artifacts` field. Paths may contain `${{ }}` expressions. Artifacts targeting `.project/*.json` are validated against block schemas.
|
|
232
|
+
|
|
233
|
+
### Validation
|
|
234
|
+
|
|
235
|
+
`validateWorkflow(spec, cwd)` runs authoring-time checks without executing the workflow:
|
|
236
|
+
|
|
237
|
+
1. **Agent resolution** — all referenced agents exist in the three-tier search
|
|
238
|
+
2. **Schema resolution** — all output schema file paths resolve to existing files
|
|
239
|
+
3. **Step reference validity** — `${{ steps.X }}` expressions reference declared steps
|
|
240
|
+
4. **Step ordering** — referenced steps are declared before the referencing step
|
|
241
|
+
5. **Filter name validity** — `${{ value | filter }}` uses known filter names
|
|
242
|
+
|
|
243
|
+
Returns `{ valid: boolean, issues: ValidationIssue[] }` where each issue has severity, message, and field path. Use `/workflow validate` or `/workflow validate <name>` to run from the command line.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
*Generated from source by `scripts/generate-skills.js` — do not edit by hand.*
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
## Project Identity
|
|
2
|
+
|
|
3
|
+
**Name:** {{ project.name }}
|
|
4
|
+
**Description:** {{ project.description }}
|
|
5
|
+
**Core Value:** {{ project.core_value }}
|
|
6
|
+
{% if project.stack %}
|
|
7
|
+
|
|
8
|
+
### Stack
|
|
9
|
+
{% for item in project.stack %}
|
|
10
|
+
- {{ item }}
|
|
11
|
+
{% endfor %}
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
### Constraints
|
|
15
|
+
{% for constraint in project.constraints %}
|
|
16
|
+
- [{{ constraint.type }}] {{ constraint.description }}
|
|
17
|
+
{% endfor %}
|
|
18
|
+
|
|
19
|
+
### Scope Boundaries
|
|
20
|
+
|
|
21
|
+
**In scope:**
|
|
22
|
+
{% for item in project.scope_boundaries.in %}
|
|
23
|
+
- {{ item }}
|
|
24
|
+
{% endfor %}
|
|
25
|
+
|
|
26
|
+
**Out of scope:**
|
|
27
|
+
{% for item in project.scope_boundaries.out %}
|
|
28
|
+
- {{ item }}
|
|
29
|
+
{% endfor %}
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
### Must
|
|
34
|
+
{% for req in requirements.requirements %}
|
|
35
|
+
{% if req.priority == "must" %}
|
|
36
|
+
- **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
|
|
37
|
+
{% endif %}
|
|
38
|
+
{% endfor %}
|
|
39
|
+
|
|
40
|
+
### Should
|
|
41
|
+
{% for req in requirements.requirements %}
|
|
42
|
+
{% if req.priority == "should" %}
|
|
43
|
+
- **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
|
|
44
|
+
{% endif %}
|
|
45
|
+
{% endfor %}
|
|
46
|
+
|
|
47
|
+
### Could
|
|
48
|
+
{% for req in requirements.requirements %}
|
|
49
|
+
{% if req.priority == "could" %}
|
|
50
|
+
- **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
|
|
51
|
+
{% endif %}
|
|
52
|
+
{% endfor %}
|
|
53
|
+
|
|
54
|
+
## Instructions
|
|
55
|
+
|
|
56
|
+
Design the initial architecture for this project. Produce modules, patterns, and boundaries that satisfy the requirements above — starting with "must" requirements and ensuring "should" requirements have a clear home.
|
|
57
|
+
|
|
58
|
+
### For each module, provide:
|
|
59
|
+
|
|
60
|
+
1. **name** — short identifier (e.g., "api", "auth", "storage", "cli")
|
|
61
|
+
2. **file** — primary file path relative to project root (e.g., "src/api.ts")
|
|
62
|
+
3. **responsibility** — one sentence: what this module owns and what it does not
|
|
63
|
+
4. **dependencies** — array of other module names this depends on (empty if none)
|
|
64
|
+
5. **lines** — estimated lines of code (rough order of magnitude)
|
|
65
|
+
|
|
66
|
+
### For each pattern, provide:
|
|
67
|
+
|
|
68
|
+
1. **name** — recognized pattern name (e.g., "Repository Pattern", "Event Sourcing", "Middleware Pipeline")
|
|
69
|
+
2. **description** — why this pattern is appropriate for this project's specific needs
|
|
70
|
+
3. **used_in** — array of module names that implement this pattern
|
|
71
|
+
|
|
72
|
+
### For boundaries, provide:
|
|
73
|
+
|
|
74
|
+
An array of strings — each describing a hard architectural constraint. These should be specific to this project, not generic ("All database access goes through the storage module", not "separate concerns").
|
|
75
|
+
|
|
76
|
+
### Design principles
|
|
77
|
+
|
|
78
|
+
- Module count should be proportional to requirements — a 5-requirement project needs 3-5 modules, not 15
|
|
79
|
+
- Every "must" functional requirement should map to at least one module's responsibility
|
|
80
|
+
- Every "must" non-functional requirement should be addressed by a pattern or boundary
|
|
81
|
+
- Dependencies should flow in one direction — avoid circular module dependencies
|
|
82
|
+
- If the project has a stated stack, modules should use file extensions and conventions matching that stack
|
|
83
|
+
- Prefer explicit boundaries over implicit conventions
|
|
84
|
+
|
|
85
|
+
### Overview
|
|
86
|
+
|
|
87
|
+
Write an `overview` paragraph (required) summarizing:
|
|
88
|
+
- The architectural style (layered, modular, pipeline, etc.)
|
|
89
|
+
- The key structural decisions and why they fit this project
|
|
90
|
+
- How the architecture supports the core_value
|
|
91
|
+
|
|
92
|
+
### Output format
|
|
93
|
+
|
|
94
|
+
Produce a single JSON object:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"overview": "string (required)",
|
|
99
|
+
"modules": [
|
|
100
|
+
{
|
|
101
|
+
"name": "string (required)",
|
|
102
|
+
"file": "string (required)",
|
|
103
|
+
"responsibility": "string (required)",
|
|
104
|
+
"dependencies": ["string"],
|
|
105
|
+
"lines": 100
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"patterns": [
|
|
109
|
+
{
|
|
110
|
+
"name": "string (required)",
|
|
111
|
+
"description": "string (required)",
|
|
112
|
+
"used_in": ["module-name"]
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"boundaries": ["string"]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Infer the architecture of the project at `{{ path }}`.
|
|
2
|
+
|
|
3
|
+
## Codebase Analysis
|
|
4
|
+
|
|
5
|
+
{% if analysis.files is defined %}
|
|
6
|
+
### Files
|
|
7
|
+
{% for file in analysis.files %}
|
|
8
|
+
- `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
|
|
9
|
+
{% endfor %}
|
|
10
|
+
{% endif %}
|
|
11
|
+
|
|
12
|
+
{% if analysis.types is defined %}
|
|
13
|
+
### Types
|
|
14
|
+
{% for t in analysis.types %}
|
|
15
|
+
- `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
|
|
16
|
+
{% endfor %}
|
|
17
|
+
{% endif %}
|
|
18
|
+
|
|
19
|
+
{% if analysis.dependencies is defined %}
|
|
20
|
+
### Dependencies
|
|
21
|
+
{% for d in analysis.dependencies %}
|
|
22
|
+
- `{{ d.from }}` → `{{ d.to }}` ({{ d.type | default("import") }})
|
|
23
|
+
{% endfor %}
|
|
24
|
+
{% endif %}
|
|
25
|
+
|
|
26
|
+
{% if analysis.entryPoints is defined %}
|
|
27
|
+
### Entry Points
|
|
28
|
+
{% for ep in analysis.entryPoints %}
|
|
29
|
+
- `{{ ep }}`
|
|
30
|
+
{% endfor %}
|
|
31
|
+
{% endif %}
|
|
32
|
+
|
|
33
|
+
## Instructions
|
|
34
|
+
|
|
35
|
+
From the analysis above and targeted code reads, produce an architecture block:
|
|
36
|
+
|
|
37
|
+
1. **Modules** — each cohesive unit with a clear responsibility. For each:
|
|
38
|
+
- `name`: concise identifier (e.g., "block-api", "expression-engine")
|
|
39
|
+
- `file`: primary file path relative to project root
|
|
40
|
+
- `responsibility`: one-sentence description of what this module does
|
|
41
|
+
- `dependencies`: array of other module names this module depends on
|
|
42
|
+
- `lines`: approximate line count
|
|
43
|
+
|
|
44
|
+
2. **Patterns** — design patterns evidenced in the code. For each:
|
|
45
|
+
- `name`: pattern name (e.g., "registry", "factory", "middleware")
|
|
46
|
+
- `description`: how this pattern is applied in this codebase
|
|
47
|
+
- `used_in`: array of module names that use this pattern
|
|
48
|
+
|
|
49
|
+
3. **Boundaries** — architectural seams where modules interact through defined interfaces (e.g., "block-api validates all writes before persistence", "dispatch spawns subprocesses through a single entry point")
|
|
50
|
+
|
|
51
|
+
4. **Overview** — one paragraph summarizing the architecture: what the system does, how it's organized, and what the key design decisions are
|
|
52
|
+
|
|
53
|
+
Read entry points, config files, and module interfaces to confirm the analysis. Do not read every file.
|
|
54
|
+
|
|
55
|
+
## Required Output Schema
|
|
56
|
+
|
|
57
|
+
You MUST produce JSON conforming exactly to this schema. Every required field must be present.
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{{ output_schema }}
|
|
61
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Identify gaps in the project at `{{ path }}`.
|
|
2
|
+
|
|
3
|
+
## Architecture
|
|
4
|
+
|
|
5
|
+
{% if architecture.overview %}
|
|
6
|
+
{{ architecture.overview }}
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
### Modules
|
|
10
|
+
{% if architecture.modules is defined %}
|
|
11
|
+
{% for m in architecture.modules %}
|
|
12
|
+
- **{{ m.name }}** (`{{ m.file }}`{% if m.lines %}, {{ m.lines }} lines{% endif %}): {{ m.responsibility }}
|
|
13
|
+
{% endfor %}
|
|
14
|
+
{% endif %}
|
|
15
|
+
|
|
16
|
+
{% if architecture.patterns is defined %}
|
|
17
|
+
### Patterns
|
|
18
|
+
{% for p in architecture.patterns %}
|
|
19
|
+
- **{{ p.name }}**: {{ p.description }}{% if p.used_in %} — used in: {{ p.used_in | join(", ") }}{% endif %}
|
|
20
|
+
{% endfor %}
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
{% if architecture.boundaries is defined %}
|
|
24
|
+
### Boundaries
|
|
25
|
+
{% for b in architecture.boundaries %}
|
|
26
|
+
- {{ b }}
|
|
27
|
+
{% endfor %}
|
|
28
|
+
{% endif %}
|
|
29
|
+
|
|
30
|
+
## Codebase Analysis
|
|
31
|
+
|
|
32
|
+
{% if analysis.files is defined %}
|
|
33
|
+
### Files ({{ analysis.files | length }} total)
|
|
34
|
+
{% for file in analysis.files %}
|
|
35
|
+
- `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
|
|
36
|
+
{% endfor %}
|
|
37
|
+
{% endif %}
|
|
38
|
+
|
|
39
|
+
{% if analysis.types is defined %}
|
|
40
|
+
### Types
|
|
41
|
+
{% for t in analysis.types %}
|
|
42
|
+
- `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
|
|
43
|
+
{% endfor %}
|
|
44
|
+
{% endif %}
|
|
45
|
+
|
|
46
|
+
## Instructions
|
|
47
|
+
|
|
48
|
+
Cross-reference the architecture and analysis to identify gaps. Use targeted reads to verify findings.
|
|
49
|
+
|
|
50
|
+
### Gap categories to check
|
|
51
|
+
|
|
52
|
+
1. **missing** — functionality that should exist based on architecture but doesn't
|
|
53
|
+
- Test files for source modules (find test files, compare against source)
|
|
54
|
+
- Error handling for public APIs
|
|
55
|
+
- Documentation for exported interfaces
|
|
56
|
+
- Schema validation for user-facing inputs
|
|
57
|
+
|
|
58
|
+
2. **incomplete** — partially implemented functionality
|
|
59
|
+
- TODO/FIXME/HACK comments (`grep -r "TODO\|FIXME\|HACK"`)
|
|
60
|
+
- Stub or placeholder implementations
|
|
61
|
+
- Functions that return hardcoded values or throw "not implemented"
|
|
62
|
+
|
|
63
|
+
3. **defect** — likely bugs or incorrect behavior
|
|
64
|
+
- Uncaught promise rejections, missing null checks
|
|
65
|
+
- Type assertions that bypass safety (`as any`, `!` operator overuse)
|
|
66
|
+
- Error paths that swallow exceptions silently
|
|
67
|
+
|
|
68
|
+
4. **technical-debt** — code that works but hampers maintenance
|
|
69
|
+
- Duplicated logic across modules
|
|
70
|
+
- Outdated patterns inconsistent with the rest of the codebase
|
|
71
|
+
- Overly complex functions (high cyclomatic complexity)
|
|
72
|
+
|
|
73
|
+
5. **improvement** — opportunities to improve existing working code
|
|
74
|
+
- Performance bottlenecks
|
|
75
|
+
- Missing caching or memoization for expensive operations
|
|
76
|
+
- Public APIs that could be more ergonomic
|
|
77
|
+
|
|
78
|
+
6. **question** — ambiguities requiring human or further investigation
|
|
79
|
+
- Unclear design decisions without documented rationale
|
|
80
|
+
- Behavior that could be intentional or accidental
|
|
81
|
+
|
|
82
|
+
### Gap ID format
|
|
83
|
+
|
|
84
|
+
Use the pattern: `gap-{abbrev}-{nnn}` where abbrev is:
|
|
85
|
+
- `miss` for missing, `inc` for incomplete, `def` for defect
|
|
86
|
+
- `debt` for technical-debt, `imp` for improvement, `q` for question
|
|
87
|
+
|
|
88
|
+
### Priority calibration
|
|
89
|
+
|
|
90
|
+
- **critical**: blocks further development or causes data loss
|
|
91
|
+
- **high**: significant impact on reliability, correctness, or developer experience
|
|
92
|
+
- **medium**: notable but workable; should be addressed in normal development
|
|
93
|
+
- **low**: minor cleanup or cosmetic; address opportunistically
|
|
94
|
+
|
|
95
|
+
Set `source` to `"agent"` for all gaps. Set `status` to `"open"` for all gaps.
|
|
96
|
+
|
|
97
|
+
## Required Output Schema
|
|
98
|
+
|
|
99
|
+
You MUST produce JSON conforming exactly to this schema. Every required field must be present.
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{{ output_schema }}
|
|
103
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Capture a handoff snapshot for the project at `{{ path }}`.
|
|
2
|
+
|
|
3
|
+
## Current Project State
|
|
4
|
+
|
|
5
|
+
{% if project_state.project is defined %}
|
|
6
|
+
### Project
|
|
7
|
+
**{{ project_state.project.name | default("unnamed") }}** — {{ project_state.project.description | default("no description") }}
|
|
8
|
+
Status: {{ project_state.project.status | default("unknown") }}
|
|
9
|
+
{% endif %}
|
|
10
|
+
|
|
11
|
+
{% if project_state.phases is defined and project_state.phases | length > 0 %}
|
|
12
|
+
### Phases
|
|
13
|
+
{% for phase in project_state.phases %}
|
|
14
|
+
- Phase {{ phase.number | default(loop.index) }}: {{ phase.name | default("unnamed") }} ({{ phase.status | default("unknown") }})
|
|
15
|
+
{% endfor %}
|
|
16
|
+
{% endif %}
|
|
17
|
+
|
|
18
|
+
{% if project_state.blockSummaries is defined %}
|
|
19
|
+
### Block Summaries
|
|
20
|
+
{% for block in project_state.blockSummaries %}
|
|
21
|
+
- **{{ block.name }}**: {{ block.count | default("?") }} entries
|
|
22
|
+
{% endfor %}
|
|
23
|
+
{% endif %}
|
|
24
|
+
|
|
25
|
+
{% if project_state.gaps is defined %}
|
|
26
|
+
### Open Gaps
|
|
27
|
+
{% for gap in project_state.gaps %}
|
|
28
|
+
{% if gap.status == "open" %}
|
|
29
|
+
- [{{ gap.priority }}] {{ gap.id }}: {{ gap.description }}
|
|
30
|
+
{% endif %}
|
|
31
|
+
{% endfor %}
|
|
32
|
+
{% endif %}
|
|
33
|
+
|
|
34
|
+
{% if project_state.decisions is defined %}
|
|
35
|
+
### Recent Decisions
|
|
36
|
+
{% for decision in project_state.decisions %}
|
|
37
|
+
- {{ decision.id | default("?") }}: {{ decision.description | default(decision.title | default("no description")) }}
|
|
38
|
+
{% endfor %}
|
|
39
|
+
{% endif %}
|
|
40
|
+
|
|
41
|
+
{% if project_state.recentCommits is defined %}
|
|
42
|
+
### Recent Commits
|
|
43
|
+
{% for commit in project_state.recentCommits %}
|
|
44
|
+
- `{{ commit.sha | default("?") | truncate(7, true, "") }}` {{ commit.message | default("no message") }}
|
|
45
|
+
{% endfor %}
|
|
46
|
+
{% endif %}
|
|
47
|
+
|
|
48
|
+
## Instructions
|
|
49
|
+
|
|
50
|
+
Synthesize the project state above into a handoff block that enables a future agent or human to resume work seamlessly.
|
|
51
|
+
|
|
52
|
+
1. **context** — Write a paragraph capturing:
|
|
53
|
+
- What was being worked on (current phase, recent commits, active changes)
|
|
54
|
+
- The current state of thinking (what decisions were made, what approach is being taken)
|
|
55
|
+
- Any momentum or direction that should be preserved
|
|
56
|
+
|
|
57
|
+
2. **timestamp** — Current datetime in ISO 8601 format (e.g., 2026-03-18T14:30:00Z)
|
|
58
|
+
|
|
59
|
+
3. **current_phase** — The phase currently being worked on (number or name)
|
|
60
|
+
|
|
61
|
+
4. **current_tasks** — Task IDs currently in progress (from project state if available, otherwise infer from recent activity)
|
|
62
|
+
|
|
63
|
+
5. **blockers** — Anything preventing progress:
|
|
64
|
+
- Unresolved decisions that block implementation
|
|
65
|
+
- Failing tests or broken builds
|
|
66
|
+
- Missing dependencies or external requirements
|
|
67
|
+
- Only include genuine blockers, not wishes
|
|
68
|
+
|
|
69
|
+
6. **next_actions** — Concrete next steps, ordered by priority:
|
|
70
|
+
- What should the next session do first?
|
|
71
|
+
- What's the next logical step in the current phase?
|
|
72
|
+
- Keep to 3-5 actionable items
|
|
73
|
+
|
|
74
|
+
7. **open_questions** — Genuine unknowns requiring input:
|
|
75
|
+
- Design decisions that need human judgment
|
|
76
|
+
- Ambiguities discovered during development
|
|
77
|
+
- Technical choices with trade-offs that haven't been resolved
|
|
78
|
+
|
|
79
|
+
8. **key_decisions_pending** — Decision IDs from the project state that need resolution
|
|
80
|
+
|
|
81
|
+
9. **files_in_flux** — Files with incomplete or in-progress changes (NOT every recently committed file — only files that have partial work)
|
|
82
|
+
|
|
83
|
+
Read project blocks if needed to get more detail than the summary provides. Focus on in-flight state, not project overview.
|
|
84
|
+
|
|
85
|
+
## Required Output Schema
|
|
86
|
+
|
|
87
|
+
You MUST produce JSON conforming exactly to this schema. Every required field must be present.
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{{ output_schema }}
|
|
91
|
+
```
|