@alevental/cccp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/cccp-pipeline/SKILL.md +562 -0
- package/.claude/skills/cccp-run/SKILL.md +111 -0
- package/README.md +280 -0
- package/dist/activity-bus.d.ts +9 -0
- package/dist/activity-bus.js +10 -0
- package/dist/activity-bus.js.map +1 -0
- package/dist/agent-resolver.d.ts +29 -0
- package/dist/agent-resolver.js +122 -0
- package/dist/agent-resolver.js.map +1 -0
- package/dist/agent.d.ts +39 -0
- package/dist/agent.js +117 -0
- package/dist/agent.js.map +1 -0
- package/dist/autoresearch.d.ts +11 -0
- package/dist/autoresearch.js +295 -0
- package/dist/autoresearch.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +157 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +126 -0
- package/dist/config.js +76 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +24 -0
- package/dist/context.js +82 -0
- package/dist/context.js.map +1 -0
- package/dist/contract.d.ts +26 -0
- package/dist/contract.js +65 -0
- package/dist/contract.js.map +1 -0
- package/dist/db.d.ts +70 -0
- package/dist/db.js +358 -0
- package/dist/db.js.map +1 -0
- package/dist/dispatcher.d.ts +9 -0
- package/dist/dispatcher.js +7 -0
- package/dist/dispatcher.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +30 -0
- package/dist/errors.js.map +1 -0
- package/dist/evaluator.d.ts +23 -0
- package/dist/evaluator.js +49 -0
- package/dist/evaluator.js.map +1 -0
- package/dist/gate/auto-approve.d.ts +9 -0
- package/dist/gate/auto-approve.js +11 -0
- package/dist/gate/auto-approve.js.map +1 -0
- package/dist/gate/gate-strategy.d.ts +22 -0
- package/dist/gate/gate-strategy.js +2 -0
- package/dist/gate/gate-strategy.js.map +1 -0
- package/dist/gate/gate-watcher.d.ts +15 -0
- package/dist/gate/gate-watcher.js +64 -0
- package/dist/gate/gate-watcher.js.map +1 -0
- package/dist/logger.d.ts +24 -0
- package/dist/logger.js +22 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp/gate-notifier.d.ts +26 -0
- package/dist/mcp/gate-notifier.js +161 -0
- package/dist/mcp/gate-notifier.js.map +1 -0
- package/dist/mcp/mcp-config.d.ts +25 -0
- package/dist/mcp/mcp-config.js +80 -0
- package/dist/mcp/mcp-config.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts +1 -0
- package/dist/mcp/mcp-server.js +262 -0
- package/dist/mcp/mcp-server.js.map +1 -0
- package/dist/pge.d.ts +12 -0
- package/dist/pge.js +361 -0
- package/dist/pge.js.map +1 -0
- package/dist/pipeline.d.ts +6 -0
- package/dist/pipeline.js +120 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/prompt.d.ts +67 -0
- package/dist/prompt.js +121 -0
- package/dist/prompt.js.map +1 -0
- package/dist/runner.d.ts +11 -0
- package/dist/runner.js +494 -0
- package/dist/runner.js.map +1 -0
- package/dist/scaffold/index.d.ts +14 -0
- package/dist/scaffold/index.js +260 -0
- package/dist/scaffold/index.js.map +1 -0
- package/dist/scaffold/templates.d.ts +47 -0
- package/dist/scaffold/templates.js +2177 -0
- package/dist/scaffold/templates.js.map +1 -0
- package/dist/stage-helpers.d.ts +7 -0
- package/dist/stage-helpers.js +27 -0
- package/dist/stage-helpers.js.map +1 -0
- package/dist/state.d.ts +43 -0
- package/dist/state.js +177 -0
- package/dist/state.js.map +1 -0
- package/dist/stream/stream-tail.d.ts +17 -0
- package/dist/stream/stream-tail.js +95 -0
- package/dist/stream/stream-tail.js.map +1 -0
- package/dist/stream/stream.d.ts +142 -0
- package/dist/stream/stream.js +251 -0
- package/dist/stream/stream.js.map +1 -0
- package/dist/temp-tracker.d.ts +6 -0
- package/dist/temp-tracker.js +24 -0
- package/dist/temp-tracker.js.map +1 -0
- package/dist/tui/cmux.d.ts +22 -0
- package/dist/tui/cmux.js +82 -0
- package/dist/tui/cmux.js.map +1 -0
- package/dist/tui/components.d.ts +21 -0
- package/dist/tui/components.js +108 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/dashboard.d.ts +6 -0
- package/dist/tui/dashboard.js +125 -0
- package/dist/tui/dashboard.js.map +1 -0
- package/dist/tui/detail-log.d.ts +10 -0
- package/dist/tui/detail-log.js +171 -0
- package/dist/tui/detail-log.js.map +1 -0
- package/dist/types.d.ts +273 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/examples/agents/diff-evaluator.md +57 -0
- package/examples/agents/prompt-tuner.md +30 -0
- package/examples/agents/summarizer.md +14 -0
- package/examples/autoresearch-artifacts/expected-output.md +17 -0
- package/examples/autoresearch-artifacts/prompt.md +35 -0
- package/examples/autoresearch-artifacts/source-material.md +28 -0
- package/examples/business-case.yaml +41 -0
- package/examples/cccp.yaml +48 -0
- package/examples/content-calendar.yaml +59 -0
- package/examples/customer-feedback-loop.yaml +44 -0
- package/examples/design-sprint.yaml +54 -0
- package/examples/feature-development.yaml +96 -0
- package/examples/growth-experiment.yaml +49 -0
- package/examples/incident-runbook.yaml +43 -0
- package/examples/product-launch.yaml +85 -0
- package/examples/prompt-tuning.yaml +25 -0
- package/examples/quarterly-planning.yaml +51 -0
- package/examples/sprint-cycle.yaml +67 -0
- package/package.json +47 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cccp-pipeline
|
|
3
|
+
description: Write CCCP pipeline YAML files. Complete schema reference with examples. Use when writing, modifying, or reviewing pipeline definitions.
|
|
4
|
+
allowed-tools: Write, Read, Bash(cccp:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CCCP Pipeline Authoring Reference
|
|
8
|
+
|
|
9
|
+
This is the complete reference for writing CCCP pipeline YAML files. Use this to produce correct, valid pipeline definitions.
|
|
10
|
+
|
|
11
|
+
## Pipeline Structure
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
name: string # Required. Pipeline identifier.
|
|
15
|
+
description: string # Optional. Human-readable description.
|
|
16
|
+
variables: # Optional. Default variables for all stages.
|
|
17
|
+
key: "value"
|
|
18
|
+
stages: # Required. At least one stage.
|
|
19
|
+
- name: string # Required. Unique stage identifier.
|
|
20
|
+
type: agent | pge | autoresearch | human_gate
|
|
21
|
+
# ... stage-specific fields
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Shared Stage Fields
|
|
25
|
+
|
|
26
|
+
Every stage type supports these base fields:
|
|
27
|
+
|
|
28
|
+
| Field | Type | Required | Description |
|
|
29
|
+
|-------|------|----------|-------------|
|
|
30
|
+
| `name` | string | Yes | Unique stage identifier |
|
|
31
|
+
| `task` | string | No | Inline task instructions |
|
|
32
|
+
| `task_file` | string | No | Path to file containing task (mutually exclusive with `task`) |
|
|
33
|
+
| `mcp_profile` | string | No | Named MCP profile from `cccp.yaml` |
|
|
34
|
+
| `variables` | map | No | Stage-level variable overrides |
|
|
35
|
+
|
|
36
|
+
`task` and `task_file` cannot both be set on the same stage.
|
|
37
|
+
|
|
38
|
+
## Stage Type: `agent`
|
|
39
|
+
|
|
40
|
+
Single agent dispatch. Simplest stage type.
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
- name: research
|
|
44
|
+
type: agent
|
|
45
|
+
task: "Research the topic and write a summary."
|
|
46
|
+
agent: researcher # Required. Agent name or path.
|
|
47
|
+
operation: spec-writing # Optional. For directory agents only.
|
|
48
|
+
inputs: # Optional. Files agent should read.
|
|
49
|
+
- "{artifact_dir}/brief.md"
|
|
50
|
+
output: "{artifact_dir}/research.md" # Optional. Expected output path.
|
|
51
|
+
allowed_tools: # Optional. Restrict available tools.
|
|
52
|
+
- Read
|
|
53
|
+
- Grep
|
|
54
|
+
- Glob
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Field | Type | Required | Description |
|
|
58
|
+
|-------|------|----------|-------------|
|
|
59
|
+
| `agent` | string | Yes | Agent name (searched in agent paths) or direct path |
|
|
60
|
+
| `operation` | string | No | Operation file for directory-style agents |
|
|
61
|
+
| `inputs` | string[] | No | File paths passed to agent (interpolated) |
|
|
62
|
+
| `output` | string | No | Expected output path (stage fails if missing after execution) |
|
|
63
|
+
| `allowed_tools` | string[] | No | Allowlist of tools the agent can use |
|
|
64
|
+
|
|
65
|
+
## Stage Type: `pge`
|
|
66
|
+
|
|
67
|
+
Plan-Generate-Evaluate cycle with retry loop.
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
- name: implementation
|
|
71
|
+
type: pge
|
|
72
|
+
task: "Implement the feature."
|
|
73
|
+
plan: "{artifact_dir}/plan.md" # Optional. Plan document path.
|
|
74
|
+
inputs: # Optional. Shared across all agents.
|
|
75
|
+
- "{artifact_dir}/design.md"
|
|
76
|
+
planner: # Required. Planner agent config.
|
|
77
|
+
agent: architect
|
|
78
|
+
operation: task-planning
|
|
79
|
+
inputs: # Optional. Planner-specific inputs.
|
|
80
|
+
- "{artifact_dir}/requirements.md"
|
|
81
|
+
generator: # Required. Generator agent config.
|
|
82
|
+
agent: implementer
|
|
83
|
+
mcp_profile: dev-tools
|
|
84
|
+
evaluator: # Required. Evaluator agent config.
|
|
85
|
+
agent: code-reviewer
|
|
86
|
+
contract:
|
|
87
|
+
deliverable: "{artifact_dir}/implementation-report.md" # Required. Output path.
|
|
88
|
+
guidance: "All acceptance criteria must be met." # Optional. Free-form.
|
|
89
|
+
template: "templates/contract-template.md" # Optional. Structural guide.
|
|
90
|
+
max_iterations: 5 # Required. 1-10.
|
|
91
|
+
on_fail: human_gate # Optional. Default: "stop".
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### PGE Agent Config (planner, generator, evaluator)
|
|
95
|
+
|
|
96
|
+
| Field | Type | Required | Description |
|
|
97
|
+
|-------|------|----------|-------------|
|
|
98
|
+
| `agent` | string | Yes | Agent name or path |
|
|
99
|
+
| `operation` | string | No | Operation for directory agents |
|
|
100
|
+
| `mcp_profile` | string | No | Agent-specific MCP profile (overrides stage-level) |
|
|
101
|
+
| `allowed_tools` | string[] | No | Tool allowlist |
|
|
102
|
+
| `inputs` | string[] | No | Agent-specific inputs (merged with stage `inputs`) |
|
|
103
|
+
|
|
104
|
+
### PGE Contract Fields
|
|
105
|
+
|
|
106
|
+
| Field | Type | Required | Constraints | Description |
|
|
107
|
+
|-------|------|----------|-------------|-------------|
|
|
108
|
+
| `deliverable` | string | Yes | - | Path where generator writes output |
|
|
109
|
+
| `max_iterations` | integer | Yes | 1-10 | Maximum retry iterations |
|
|
110
|
+
| `guidance` | string | No | - | Free-form guidance for planner and contract writer |
|
|
111
|
+
| `template` | string | No | - | Path to structural template for contract |
|
|
112
|
+
|
|
113
|
+
### PGE Execution Flow
|
|
114
|
+
|
|
115
|
+
1. **Planner**: Reads plan document + inputs, writes `task-plan.md`
|
|
116
|
+
2. **Contract**: Evaluator reads task plan + guidance/template, writes `contract.md`
|
|
117
|
+
3. **Generator**: Reads contract + task plan + inputs, produces `deliverable`
|
|
118
|
+
4. **Evaluator**: Reads contract + deliverable, writes `evaluation-N.md`
|
|
119
|
+
5. **Route**: PASS → stage succeeds. FAIL → retry from step 3. Max iterations → apply `on_fail`.
|
|
120
|
+
|
|
121
|
+
The evaluator output must contain `### Overall: PASS` or `### Overall: FAIL`.
|
|
122
|
+
|
|
123
|
+
### `on_fail` Strategies
|
|
124
|
+
|
|
125
|
+
| Value | Behavior |
|
|
126
|
+
|-------|----------|
|
|
127
|
+
| `"stop"` (default) | Mark stage failed, halt pipeline |
|
|
128
|
+
| `"skip"` | Mark stage skipped, continue pipeline |
|
|
129
|
+
| `"human_gate"` | Pause for human approval |
|
|
130
|
+
|
|
131
|
+
## Stage Type: `autoresearch`
|
|
132
|
+
|
|
133
|
+
Iterative artifact optimization. Adjust-Execute-Evaluate loop.
|
|
134
|
+
|
|
135
|
+
```yaml
|
|
136
|
+
- name: tune-prompt
|
|
137
|
+
type: autoresearch
|
|
138
|
+
task: "Summarize the document using the prompt."
|
|
139
|
+
artifact: prompts/summarizer.md # Required. Tunable artifact path.
|
|
140
|
+
ground_truth: expected/summary.md # Required. Known-correct output.
|
|
141
|
+
output: "{artifact_dir}/actual-summary.md" # Required. Executor output path.
|
|
142
|
+
inputs: # Optional. Shared inputs.
|
|
143
|
+
- source-material.md
|
|
144
|
+
adjuster: # Required. Adjusts artifact.
|
|
145
|
+
agent: prompt-tuner
|
|
146
|
+
executor: # Required. Runs task with artifact.
|
|
147
|
+
agent: summarizer
|
|
148
|
+
evaluator: # Required. Compares output to ground truth.
|
|
149
|
+
agent: diff-evaluator
|
|
150
|
+
max_iterations: 10 # Optional. Omit for unlimited.
|
|
151
|
+
on_fail: stop # Optional. Default: "stop".
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
| Field | Type | Required | Constraints | Description |
|
|
155
|
+
|-------|------|----------|-------------|-------------|
|
|
156
|
+
| `artifact` | string | Yes | - | Path to the artifact being tuned |
|
|
157
|
+
| `ground_truth` | string | Yes | - | Path to known-correct expected output |
|
|
158
|
+
| `output` | string | Yes | - | Path where executor writes output |
|
|
159
|
+
| `inputs` | string[] | No | - | Shared input files |
|
|
160
|
+
| `adjuster` | PgeAgentConfig | Yes | - | Agent that modifies the artifact |
|
|
161
|
+
| `executor` | PgeAgentConfig | Yes | - | Agent that runs the task |
|
|
162
|
+
| `evaluator` | PgeAgentConfig | Yes | - | Agent that compares output to ground truth |
|
|
163
|
+
| `max_iterations` | integer | No | 1+ or omit | Omit for unlimited iterations |
|
|
164
|
+
| `on_fail` | string | No | stop/human_gate/skip | Behavior on max iterations reached |
|
|
165
|
+
|
|
166
|
+
### Autoresearch Execution Flow
|
|
167
|
+
|
|
168
|
+
1. **Iteration 1**: Skip adjuster. Executor runs task using initial artifact. Evaluator compares.
|
|
169
|
+
2. **Iteration 2+**: Adjuster reads previous evaluation, modifies artifact. Executor runs. Evaluator compares.
|
|
170
|
+
3. **Route**: PASS → done. FAIL → loop. Max reached → apply `on_fail`.
|
|
171
|
+
|
|
172
|
+
## Stage Type: `human_gate`
|
|
173
|
+
|
|
174
|
+
Pause pipeline for human approval.
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
- name: design-approval
|
|
178
|
+
type: human_gate
|
|
179
|
+
prompt: "Review the design document. Approve to proceed."
|
|
180
|
+
artifacts: # Optional. Files for reviewer to inspect.
|
|
181
|
+
- "{artifact_dir}/design.md"
|
|
182
|
+
on_reject: stop # Optional. Default: "stop".
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| Field | Type | Required | Description |
|
|
186
|
+
|-------|------|----------|-------------|
|
|
187
|
+
| `prompt` | string | No | Instructions for the reviewer |
|
|
188
|
+
| `artifacts` | string[] | No | File paths for review |
|
|
189
|
+
| `on_reject` | string | No | `"stop"` (default) or `"retry"` |
|
|
190
|
+
|
|
191
|
+
In `--headless` mode, all gates are auto-approved.
|
|
192
|
+
|
|
193
|
+
## Variables
|
|
194
|
+
|
|
195
|
+
### Syntax
|
|
196
|
+
|
|
197
|
+
Use `{variable_name}` in any string field. Unresolved placeholders are left as-is.
|
|
198
|
+
|
|
199
|
+
### Built-in Variables
|
|
200
|
+
|
|
201
|
+
| Variable | Source | Example |
|
|
202
|
+
|----------|--------|---------|
|
|
203
|
+
| `{project}` | CLI `--project` flag | `"myapp"` |
|
|
204
|
+
| `{project_dir}` | CLI `--project-dir` or cwd | `/path/to/project` |
|
|
205
|
+
| `{artifact_dir}` | Resolved artifact directory | `docs/projects/myapp/pipeline-name` |
|
|
206
|
+
| `{pipeline_name}` | Pipeline `name` field | `"feature-dev"` |
|
|
207
|
+
|
|
208
|
+
### Precedence (highest wins)
|
|
209
|
+
|
|
210
|
+
1. CLI: `--var key=value`
|
|
211
|
+
2. Stage-level: `variables` block on the stage
|
|
212
|
+
3. Pipeline-level: top-level `variables` block
|
|
213
|
+
4. Built-in variables
|
|
214
|
+
|
|
215
|
+
### Example
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
name: sprint-cycle
|
|
219
|
+
variables:
|
|
220
|
+
sprint: "1"
|
|
221
|
+
|
|
222
|
+
stages:
|
|
223
|
+
- name: implement
|
|
224
|
+
type: agent
|
|
225
|
+
task: "Implement sprint {sprint}."
|
|
226
|
+
agent: implementer
|
|
227
|
+
output: "{artifact_dir}/sprint-{sprint}-complete.md"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Override at CLI: `cccp run -f sprint.yaml -p app -v sprint=3`
|
|
231
|
+
|
|
232
|
+
## Agent Resolution
|
|
233
|
+
|
|
234
|
+
### Search Order (first match wins)
|
|
235
|
+
|
|
236
|
+
1. `<pipeline-dir>/agents/<agent>.md`
|
|
237
|
+
2. `<project-dir>/.claude/agents/<agent>.md`
|
|
238
|
+
3. `<project-dir>/.claude/agents/<agent>/agent.md` (directory agent)
|
|
239
|
+
4. `<project-dir>/agents/<agent>.md`
|
|
240
|
+
5. Paths from `cccp.yaml` → `agent_paths`
|
|
241
|
+
|
|
242
|
+
### Flat vs Directory Agents
|
|
243
|
+
|
|
244
|
+
**Flat agent**: Single `.md` file. Cannot use `operation`.
|
|
245
|
+
```yaml
|
|
246
|
+
agent: researcher # resolves to researcher.md
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Directory agent**: Folder with `agent.md` + operation files. Use `operation` to specialize.
|
|
250
|
+
```yaml
|
|
251
|
+
agent: architect
|
|
252
|
+
operation: design # resolves to architect/agent.md + architect/design.md
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Direct Paths
|
|
256
|
+
|
|
257
|
+
If the agent name contains `/` or ends in `.md`, it's treated as a direct path:
|
|
258
|
+
```yaml
|
|
259
|
+
agent: ./custom-agents/my-agent.md
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Project Configuration (`cccp.yaml`)
|
|
263
|
+
|
|
264
|
+
```yaml
|
|
265
|
+
agent_paths: # Additional agent search directories
|
|
266
|
+
- ./agents
|
|
267
|
+
- ./shared-agents
|
|
268
|
+
|
|
269
|
+
artifact_dir: "docs/projects/{project}/{pipeline_name}" # Artifact path pattern
|
|
270
|
+
|
|
271
|
+
default_mcp_profile: base # Fallback MCP profile
|
|
272
|
+
|
|
273
|
+
permission_mode: bypassPermissions # default | acceptEdits | bypassPermissions | auto
|
|
274
|
+
|
|
275
|
+
mcp_profiles:
|
|
276
|
+
base:
|
|
277
|
+
servers:
|
|
278
|
+
qmd:
|
|
279
|
+
command: qmd
|
|
280
|
+
args: [serve, --stdio]
|
|
281
|
+
advanced:
|
|
282
|
+
extends: base # Inherits base servers
|
|
283
|
+
servers:
|
|
284
|
+
figma:
|
|
285
|
+
command: npx
|
|
286
|
+
args: [-y, figma-console-mcp]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Complete Examples
|
|
290
|
+
|
|
291
|
+
### Example 1: Minimal Agent Pipeline
|
|
292
|
+
|
|
293
|
+
A simple three-stage pipeline: research, review, approve.
|
|
294
|
+
|
|
295
|
+
```yaml
|
|
296
|
+
name: example
|
|
297
|
+
description: Research, write, review with human approval.
|
|
298
|
+
|
|
299
|
+
stages:
|
|
300
|
+
- name: research
|
|
301
|
+
type: agent
|
|
302
|
+
task: "Research the project and write a summary."
|
|
303
|
+
agent: researcher
|
|
304
|
+
output: "{artifact_dir}/research.md"
|
|
305
|
+
|
|
306
|
+
- name: review
|
|
307
|
+
type: pge
|
|
308
|
+
task: "Write a technical document and evaluate it."
|
|
309
|
+
inputs:
|
|
310
|
+
- "{artifact_dir}/research.md"
|
|
311
|
+
planner:
|
|
312
|
+
agent: architect
|
|
313
|
+
operation: plan-authoring
|
|
314
|
+
generator:
|
|
315
|
+
agent: writer
|
|
316
|
+
evaluator:
|
|
317
|
+
agent: reviewer
|
|
318
|
+
contract:
|
|
319
|
+
deliverable: "{artifact_dir}/document.md"
|
|
320
|
+
guidance: "All required sections must be present and technically accurate."
|
|
321
|
+
max_iterations: 3
|
|
322
|
+
on_fail: stop
|
|
323
|
+
|
|
324
|
+
- name: approval
|
|
325
|
+
type: human_gate
|
|
326
|
+
prompt: "Please review the document and approve."
|
|
327
|
+
artifacts:
|
|
328
|
+
- "{artifact_dir}/document.md"
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Example 2: Feature Development (PGE + Human Gates)
|
|
332
|
+
|
|
333
|
+
Full SDLC: spec, design, implement, test, ship.
|
|
334
|
+
|
|
335
|
+
```yaml
|
|
336
|
+
name: feature-development
|
|
337
|
+
description: Full feature development cycle — spec, design, implement, test, ship.
|
|
338
|
+
|
|
339
|
+
stages:
|
|
340
|
+
- name: product-spec
|
|
341
|
+
type: pge
|
|
342
|
+
task: "Write a product requirements document based on the feature brief."
|
|
343
|
+
inputs:
|
|
344
|
+
- "{artifact_dir}/feature-brief.md"
|
|
345
|
+
planner:
|
|
346
|
+
agent: product-manager
|
|
347
|
+
operation: spec-writing
|
|
348
|
+
generator:
|
|
349
|
+
agent: product-manager
|
|
350
|
+
operation: spec-writing
|
|
351
|
+
evaluator:
|
|
352
|
+
agent: reviewer
|
|
353
|
+
contract:
|
|
354
|
+
deliverable: "{artifact_dir}/prd.md"
|
|
355
|
+
guidance: "Must include user stories, acceptance criteria, scope boundaries, success metrics, and dependencies."
|
|
356
|
+
max_iterations: 3
|
|
357
|
+
|
|
358
|
+
- name: spec-approval
|
|
359
|
+
type: human_gate
|
|
360
|
+
prompt: "Review the PRD. Approve to proceed to technical design."
|
|
361
|
+
artifacts:
|
|
362
|
+
- "{artifact_dir}/prd.md"
|
|
363
|
+
|
|
364
|
+
- name: technical-design
|
|
365
|
+
type: pge
|
|
366
|
+
task: "Design the technical architecture for this feature."
|
|
367
|
+
inputs:
|
|
368
|
+
- "{artifact_dir}/prd.md"
|
|
369
|
+
planner:
|
|
370
|
+
agent: architect
|
|
371
|
+
operation: design
|
|
372
|
+
generator:
|
|
373
|
+
agent: architect
|
|
374
|
+
operation: design
|
|
375
|
+
evaluator:
|
|
376
|
+
agent: reviewer
|
|
377
|
+
contract:
|
|
378
|
+
deliverable: "{artifact_dir}/design.md"
|
|
379
|
+
guidance: "Architecture must address all PRD requirements. Include component diagram, API contracts, and data flow."
|
|
380
|
+
max_iterations: 3
|
|
381
|
+
|
|
382
|
+
- name: design-approval
|
|
383
|
+
type: human_gate
|
|
384
|
+
prompt: "Review the technical design. Approve to proceed to implementation."
|
|
385
|
+
artifacts:
|
|
386
|
+
- "{artifact_dir}/design.md"
|
|
387
|
+
|
|
388
|
+
- name: implementation
|
|
389
|
+
type: pge
|
|
390
|
+
task: "Implement the feature according to the design."
|
|
391
|
+
inputs:
|
|
392
|
+
- "{artifact_dir}/prd.md"
|
|
393
|
+
- "{artifact_dir}/design.md"
|
|
394
|
+
planner:
|
|
395
|
+
agent: architect
|
|
396
|
+
operation: task-planning
|
|
397
|
+
generator:
|
|
398
|
+
agent: implementer
|
|
399
|
+
evaluator:
|
|
400
|
+
agent: code-reviewer
|
|
401
|
+
contract:
|
|
402
|
+
deliverable: "{artifact_dir}/implementation-report.md"
|
|
403
|
+
guidance: "All PRD acceptance criteria must be met. Tests required for new code paths."
|
|
404
|
+
max_iterations: 5
|
|
405
|
+
on_fail: human_gate
|
|
406
|
+
|
|
407
|
+
- name: test-suite
|
|
408
|
+
type: pge
|
|
409
|
+
task: "Write comprehensive tests for the implemented feature."
|
|
410
|
+
inputs:
|
|
411
|
+
- "{artifact_dir}/design.md"
|
|
412
|
+
- "{artifact_dir}/implementation-report.md"
|
|
413
|
+
planner:
|
|
414
|
+
agent: qa-engineer
|
|
415
|
+
operation: test-planning
|
|
416
|
+
generator:
|
|
417
|
+
agent: qa-engineer
|
|
418
|
+
operation: test-authoring
|
|
419
|
+
evaluator:
|
|
420
|
+
agent: code-reviewer
|
|
421
|
+
contract:
|
|
422
|
+
deliverable: "{artifact_dir}/test-report.md"
|
|
423
|
+
guidance: "Critical paths must have coverage. Edge cases and error conditions must be tested."
|
|
424
|
+
max_iterations: 3
|
|
425
|
+
|
|
426
|
+
- name: ship-approval
|
|
427
|
+
type: human_gate
|
|
428
|
+
prompt: "Implementation and tests complete. Approve to ship."
|
|
429
|
+
artifacts:
|
|
430
|
+
- "{artifact_dir}/implementation-report.md"
|
|
431
|
+
- "{artifact_dir}/test-report.md"
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Example 3: Autoresearch Loop
|
|
435
|
+
|
|
436
|
+
Iterative prompt optimization against ground truth.
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
name: prompt-tuning
|
|
440
|
+
description: Tunes a prompt until output matches expected result.
|
|
441
|
+
|
|
442
|
+
stages:
|
|
443
|
+
- name: tune-summarization-prompt
|
|
444
|
+
type: autoresearch
|
|
445
|
+
task: >
|
|
446
|
+
Use the prompt artifact to summarize the source material.
|
|
447
|
+
Read the prompt at the artifact path, follow its instructions,
|
|
448
|
+
and apply them to the source material to produce a summary.
|
|
449
|
+
artifact: autoresearch-artifacts/prompt.md
|
|
450
|
+
ground_truth: autoresearch-artifacts/expected-output.md
|
|
451
|
+
output: "{artifact_dir}/actual-output.md"
|
|
452
|
+
inputs:
|
|
453
|
+
- autoresearch-artifacts/source-material.md
|
|
454
|
+
adjuster:
|
|
455
|
+
agent: prompt-tuner
|
|
456
|
+
executor:
|
|
457
|
+
agent: summarizer
|
|
458
|
+
evaluator:
|
|
459
|
+
agent: diff-evaluator
|
|
460
|
+
# No max_iterations — runs until PASS
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
## Patterns
|
|
464
|
+
|
|
465
|
+
### Input Chaining
|
|
466
|
+
|
|
467
|
+
Pass the output of one stage as input to the next:
|
|
468
|
+
|
|
469
|
+
```yaml
|
|
470
|
+
stages:
|
|
471
|
+
- name: research
|
|
472
|
+
type: agent
|
|
473
|
+
agent: researcher
|
|
474
|
+
output: "{artifact_dir}/research.md"
|
|
475
|
+
|
|
476
|
+
- name: write
|
|
477
|
+
type: agent
|
|
478
|
+
agent: writer
|
|
479
|
+
inputs:
|
|
480
|
+
- "{artifact_dir}/research.md" # Output from previous stage
|
|
481
|
+
output: "{artifact_dir}/document.md"
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### Sprint Variables
|
|
485
|
+
|
|
486
|
+
Parameterize pipelines for reuse across sprints:
|
|
487
|
+
|
|
488
|
+
```yaml
|
|
489
|
+
variables:
|
|
490
|
+
sprint: "1"
|
|
491
|
+
|
|
492
|
+
stages:
|
|
493
|
+
- name: brief
|
|
494
|
+
type: agent
|
|
495
|
+
agent: architect
|
|
496
|
+
operation: sprint-brief
|
|
497
|
+
output: "{artifact_dir}/sprint-{sprint}-brief.md"
|
|
498
|
+
|
|
499
|
+
- name: implement
|
|
500
|
+
type: pge
|
|
501
|
+
plan: "{artifact_dir}/sprint-{sprint}-brief.md"
|
|
502
|
+
# ...
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
Run: `cccp run -f sprint.yaml -p app -v sprint=3`
|
|
506
|
+
|
|
507
|
+
### Escalation on Failure
|
|
508
|
+
|
|
509
|
+
Use `on_fail: human_gate` for critical stages so failures get human review instead of halting:
|
|
510
|
+
|
|
511
|
+
```yaml
|
|
512
|
+
contract:
|
|
513
|
+
deliverable: "{artifact_dir}/output.md"
|
|
514
|
+
max_iterations: 5
|
|
515
|
+
on_fail: human_gate # Pause for human instead of stopping
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Use `on_fail: skip` for non-critical stages that shouldn't block the pipeline:
|
|
519
|
+
|
|
520
|
+
```yaml
|
|
521
|
+
on_fail: skip # Continue pipeline even if this stage fails
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Different Agents per PGE Role
|
|
525
|
+
|
|
526
|
+
The planner, generator, and evaluator can be completely different agents with different MCP profiles:
|
|
527
|
+
|
|
528
|
+
```yaml
|
|
529
|
+
planner:
|
|
530
|
+
agent: architect
|
|
531
|
+
operation: task-planning
|
|
532
|
+
mcp_profile: research # Planner gets research tools
|
|
533
|
+
generator:
|
|
534
|
+
agent: implementer
|
|
535
|
+
mcp_profile: dev-tools # Generator gets dev tools
|
|
536
|
+
evaluator:
|
|
537
|
+
agent: code-reviewer
|
|
538
|
+
mcp_profile: base # Evaluator gets minimal tools
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
### Task from File
|
|
542
|
+
|
|
543
|
+
For complex tasks that don't fit inline in YAML:
|
|
544
|
+
|
|
545
|
+
```yaml
|
|
546
|
+
- name: implement
|
|
547
|
+
type: pge
|
|
548
|
+
task_file: "{artifact_dir}/task-spec.md" # Read task from file at runtime
|
|
549
|
+
# ...
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
The path is interpolated with variables before reading.
|
|
553
|
+
|
|
554
|
+
## Validation
|
|
555
|
+
|
|
556
|
+
Dry-run to verify a pipeline without executing:
|
|
557
|
+
|
|
558
|
+
```bash
|
|
559
|
+
cccp run -f pipeline.yaml -p test --dry-run
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
This shows all assembled prompts, resolved agent paths, and interpolated variables without dispatching any agents.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cccp-run
|
|
3
|
+
description: Run, resume, and monitor CCCP pipelines. Use when the user asks to execute a pipeline, check run status, manage gates, or work with cmux panes.
|
|
4
|
+
allowed-tools: Bash(cccp:*), mcp__cccp__*
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Running CCCP Pipelines
|
|
8
|
+
|
|
9
|
+
## CLI Commands
|
|
10
|
+
|
|
11
|
+
### `cccp run` — Execute a pipeline
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cccp run -f <pipeline.yaml> -p <project> [options]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Flag | Required | Description |
|
|
18
|
+
|------|----------|-------------|
|
|
19
|
+
| `-f, --file <path>` | Yes | Pipeline YAML file |
|
|
20
|
+
| `-p, --project <name>` | Yes | Project name (used in artifact paths and state) |
|
|
21
|
+
| `-d, --project-dir <path>` | No | Project directory (default: cwd) |
|
|
22
|
+
| `-a, --artifact-dir <path>` | No | Override artifact output directory |
|
|
23
|
+
| `--dry-run` | No | Show prompts without executing agents |
|
|
24
|
+
| `--headless` | No | Auto-approve all gates, disable TUI |
|
|
25
|
+
| `-v, --var <key=value>` | No | Set pipeline variable (repeatable) |
|
|
26
|
+
|
|
27
|
+
**Recommended workflow:**
|
|
28
|
+
1. Dry-run first: `cccp run -f pipeline.yaml -p myproject --dry-run`
|
|
29
|
+
2. Full run: `cccp run -f pipeline.yaml -p myproject`
|
|
30
|
+
3. Headless (CI): `cccp run -f pipeline.yaml -p myproject --headless`
|
|
31
|
+
|
|
32
|
+
**Variables:** Override pipeline defaults from CLI:
|
|
33
|
+
```bash
|
|
34
|
+
cccp run -f sprint.yaml -p app -v sprint=3 -v env=staging
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### `cccp resume` — Resume an interrupted run
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cccp resume -p <project> -r <run-id-prefix> [options]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Flag | Required | Description |
|
|
44
|
+
|------|----------|-------------|
|
|
45
|
+
| `-p, --project <name>` | Yes | Project name |
|
|
46
|
+
| `-r, --run <id-prefix>` | Yes | Run ID or prefix (8+ characters) |
|
|
47
|
+
| `-d, --project-dir <path>` | No | Project directory (default: cwd) |
|
|
48
|
+
| `--headless` | No | Auto-approve all gates |
|
|
49
|
+
|
|
50
|
+
Skips completed stages and resumes from the first incomplete stage. For PGE stages, resumes at the correct iteration and sub-step.
|
|
51
|
+
|
|
52
|
+
### `cccp dashboard` — Monitor a run
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cccp dashboard -r <run-id-prefix> [-d <project-dir>]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Launches a standalone TUI dashboard. Can run in a separate terminal or cmux pane while the pipeline executes.
|
|
59
|
+
|
|
60
|
+
### `cccp mcp-server` — Start the MCP server
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cccp mcp-server
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Exposes five tools over stdio: `cccp_runs`, `cccp_status`, `cccp_gate_respond`, `cccp_logs`, `cccp_artifacts`.
|
|
67
|
+
|
|
68
|
+
Register in `.mcp.json`:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"cccp": {
|
|
73
|
+
"command": "cccp",
|
|
74
|
+
"args": ["mcp-server"]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Gate Interaction
|
|
81
|
+
|
|
82
|
+
Human gates pause the pipeline until approved or rejected.
|
|
83
|
+
|
|
84
|
+
**Via MCP** (recommended): Use the `cccp_gate_respond` tool with `approved: true/false` and optional `feedback`.
|
|
85
|
+
|
|
86
|
+
**Via headless mode:** `--headless` auto-approves all gates immediately.
|
|
87
|
+
|
|
88
|
+
**Checking gate status:** Use `cccp_status` MCP tool with the run ID to see pending gates.
|
|
89
|
+
|
|
90
|
+
## cmux Integration
|
|
91
|
+
|
|
92
|
+
When running inside a cmux workspace (`CMUX_WORKSPACE_ID` is set), CCCP automatically:
|
|
93
|
+
- Updates the sidebar status pill with the current stage
|
|
94
|
+
- Shows a progress bar based on stage completion
|
|
95
|
+
- Sends desktop notifications for gate requests and pipeline completion
|
|
96
|
+
|
|
97
|
+
**Manual pane management:**
|
|
98
|
+
```bash
|
|
99
|
+
# Create a split pane for monitoring
|
|
100
|
+
cmux new-split right # Returns surface:N
|
|
101
|
+
|
|
102
|
+
# Send a dashboard command to the new pane
|
|
103
|
+
cmux send --surface surface:1 "cccp dashboard -r abc12345"
|
|
104
|
+
cmux send-key --surface surface:1 Enter
|
|
105
|
+
|
|
106
|
+
# Check status from sidebar
|
|
107
|
+
cmux set-status cccp "Stage 3/5"
|
|
108
|
+
cmux set-progress 0.6
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
All cmux commands are no-ops when not in a cmux workspace.
|