@coralai/sps-cli 0.18.0 → 0.18.2
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/README.md +520 -501
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +108 -73
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +127 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/main.js +7 -0
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,281 +1,286 @@
|
|
|
1
|
-
# SPS CLI — AI
|
|
1
|
+
# SPS CLI — AI-Driven Fully Automated Development Pipeline
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@coralai/sps-cli)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[中文文档 / Chinese Documentation](https://git.wymsn.com/coral/jarvis-skills/-/blob/main/coding-work-flow/workflow-cli/README-CN.md)
|
|
6
|
+
|
|
7
|
+
**v0.18.0**
|
|
8
|
+
|
|
9
|
+
SPS (Smart Pipeline System) is a fully automated development pipeline CLI tool driven by AI Agents. From task card creation to code merging, the entire process runs unattended.
|
|
6
10
|
|
|
7
11
|
```
|
|
8
|
-
|
|
12
|
+
Create cards -> Start pipeline -> AI auto-codes -> Auto-merge to target branch -> Notify completion
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
##
|
|
15
|
+
## Table of Contents
|
|
12
16
|
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Prerequisites](#prerequisites)
|
|
19
|
+
- [Quick Start](#quick-start)
|
|
20
|
+
- [State Machine](#state-machine)
|
|
21
|
+
- [Command Reference](#command-reference)
|
|
18
22
|
- [sps setup](#sps-setup)
|
|
19
23
|
- [sps project init](#sps-project-init)
|
|
20
24
|
- [sps doctor](#sps-doctor)
|
|
21
25
|
- [sps card add](#sps-card-add)
|
|
22
26
|
- [sps tick](#sps-tick)
|
|
27
|
+
- [sps status](#sps-status)
|
|
23
28
|
- [sps scheduler tick](#sps-scheduler-tick)
|
|
24
29
|
- [sps pipeline tick](#sps-pipeline-tick)
|
|
25
30
|
- [sps worker](#sps-worker)
|
|
26
31
|
- [sps pm](#sps-pm)
|
|
27
32
|
- [sps qa tick](#sps-qa-tick)
|
|
28
33
|
- [sps monitor tick](#sps-monitor-tick)
|
|
29
|
-
- [Worker
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
+
- [Worker Rule Files](#worker-rule-files)
|
|
35
|
+
- [Project Configuration](#project-configuration)
|
|
36
|
+
- [Multi-Project Parallel Execution](#multi-project-parallel-execution)
|
|
37
|
+
- [Architecture Overview](#architecture-overview)
|
|
38
|
+
- [Directory Structure](#directory-structure)
|
|
34
39
|
|
|
35
40
|
---
|
|
36
41
|
|
|
37
|
-
##
|
|
42
|
+
## Installation
|
|
38
43
|
|
|
39
44
|
```bash
|
|
40
45
|
npm install -g @coralai/sps-cli
|
|
41
46
|
```
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
Local development:
|
|
44
49
|
|
|
45
50
|
```bash
|
|
46
51
|
cd coding-work-flow/workflow-cli
|
|
47
52
|
npm run build
|
|
48
|
-
#
|
|
53
|
+
# Or run directly with tsx
|
|
49
54
|
npx tsx src/main.ts --help
|
|
50
55
|
```
|
|
51
56
|
|
|
52
|
-
##
|
|
57
|
+
## Prerequisites
|
|
53
58
|
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
| Node.js | 18+ | CLI
|
|
57
|
-
| git | 2.x |
|
|
58
|
-
| Claude Code CLI
|
|
59
|
-
| tmux | 3.x |
|
|
59
|
+
| Dependency | Minimum Version | Description |
|
|
60
|
+
|------------|----------------|-------------|
|
|
61
|
+
| Node.js | 18+ | CLI runtime |
|
|
62
|
+
| git | 2.x | Branch and worktree management |
|
|
63
|
+
| Claude Code CLI or Codex CLI | Latest | AI Worker |
|
|
64
|
+
| tmux | 3.x | Only required for `WORKER_MODE=interactive` |
|
|
60
65
|
|
|
61
|
-
##
|
|
66
|
+
## Quick Start
|
|
62
67
|
|
|
63
68
|
```bash
|
|
64
|
-
# 1.
|
|
69
|
+
# 1. Global environment initialization (first-time setup, configure GitLab/PM/notification credentials)
|
|
65
70
|
sps setup
|
|
66
71
|
|
|
67
|
-
# 2.
|
|
72
|
+
# 2. Clone your project repository (prerequisite)
|
|
68
73
|
git clone git@gitlab.example.com:team/my-project.git ~/projects/my-project
|
|
69
74
|
|
|
70
|
-
# 3.
|
|
75
|
+
# 3. Initialize SPS project management directory
|
|
71
76
|
sps project init my-project
|
|
72
77
|
|
|
73
|
-
# 4.
|
|
78
|
+
# 4. Edit project configuration
|
|
74
79
|
vim ~/.coral/projects/my-project/conf
|
|
75
80
|
|
|
76
|
-
# 5.
|
|
81
|
+
# 5. Health check + auto-fix (generates CLAUDE.md, AGENTS.md, initializes state.json, etc.)
|
|
77
82
|
sps doctor my-project --fix
|
|
78
83
|
|
|
79
|
-
# 6
|
|
84
|
+
# 6. (Optional) Edit Worker rules to add project-specific coding standards
|
|
80
85
|
vim ~/projects/my-project/CLAUDE.md
|
|
81
86
|
|
|
82
|
-
# 7.
|
|
83
|
-
sps card add my-project "
|
|
84
|
-
sps card add my-project "
|
|
87
|
+
# 7. Create task cards
|
|
88
|
+
sps card add my-project "Implement user login" "JWT authentication endpoint"
|
|
89
|
+
sps card add my-project "Implement order system" "CRUD API + pagination"
|
|
85
90
|
|
|
86
|
-
# 8.
|
|
91
|
+
# 8. Start pipeline (fully automated, exits when all cards are complete)
|
|
87
92
|
sps tick my-project
|
|
88
93
|
|
|
89
|
-
# 9
|
|
94
|
+
# 9. (Optional) Monitor Worker status in real time
|
|
90
95
|
sps worker dashboard
|
|
91
96
|
```
|
|
92
97
|
|
|
93
98
|
---
|
|
94
99
|
|
|
95
|
-
##
|
|
100
|
+
## State Machine
|
|
96
101
|
|
|
97
|
-
|
|
102
|
+
Each task card progresses through the following state machine, fully driven by SPS:
|
|
98
103
|
|
|
99
|
-
### MR_MODE=none
|
|
104
|
+
### MR_MODE=none (Default, Recommended)
|
|
100
105
|
|
|
101
|
-
Worker
|
|
106
|
+
After completing coding, the Worker merges directly to the target branch, skipping MR/CI/QA stages:
|
|
102
107
|
|
|
103
108
|
```
|
|
104
|
-
Planning
|
|
109
|
+
Planning -> Backlog -> Todo -> Inprogress -> Done
|
|
105
110
|
```
|
|
106
111
|
|
|
107
|
-
|
|
|
108
|
-
|
|
109
|
-
| Planning
|
|
110
|
-
| Backlog
|
|
111
|
-
| Todo
|
|
112
|
-
| Inprogress
|
|
112
|
+
| Phase | Trigger Engine | Action |
|
|
113
|
+
|-------|---------------|--------|
|
|
114
|
+
| Planning -> Backlog | SchedulerEngine | Select card for queue, check admission criteria |
|
|
115
|
+
| Backlog -> Todo | ExecutionEngine | Create branch, create worktree, generate `.sps/merge.sh` |
|
|
116
|
+
| Todo -> Inprogress | ExecutionEngine | Assign Worker slot, build task context, launch AI Worker |
|
|
117
|
+
| Inprogress -> Done | ExecutionEngine | Detect Worker completion (code merged to target branch), release resources, clean up worktree |
|
|
113
118
|
|
|
114
|
-
Worker
|
|
119
|
+
The Worker's final step is running `bash .sps/merge.sh`, which automatically rebases and merges the feature branch into the target branch.
|
|
115
120
|
|
|
116
|
-
### MR_MODE=create
|
|
121
|
+
### MR_MODE=create (Optional)
|
|
117
122
|
|
|
118
|
-
Worker
|
|
123
|
+
After completing coding, the Worker creates an MR. The task is then considered complete. MR review is handled by subsequent processes (under development):
|
|
119
124
|
|
|
120
125
|
```
|
|
121
|
-
Planning
|
|
126
|
+
Planning -> Backlog -> Todo -> Inprogress -> Done (MR created)
|
|
122
127
|
```
|
|
123
128
|
|
|
124
|
-
|
|
|
125
|
-
|
|
126
|
-
| Inprogress
|
|
129
|
+
| Phase | Trigger Engine | Action |
|
|
130
|
+
|-------|---------------|--------|
|
|
131
|
+
| Inprogress -> Done | ExecutionEngine | Detect Worker completion (MR created), release resources, clean up worktree |
|
|
127
132
|
|
|
128
|
-
###
|
|
133
|
+
### Auxiliary Status Labels
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
Cards may be tagged with the following labels, indicating special handling is needed:
|
|
131
136
|
|
|
132
|
-
|
|
|
133
|
-
|
|
134
|
-
| `BLOCKED` |
|
|
135
|
-
| `NEEDS-FIX` | Worker
|
|
136
|
-
| `WAITING-CONFIRMATION` | Worker
|
|
137
|
-
| `CONFLICT` |
|
|
138
|
-
| `STALE-RUNTIME` | Worker
|
|
137
|
+
| Label | Meaning | Handling |
|
|
138
|
+
|-------|---------|----------|
|
|
139
|
+
| `BLOCKED` | Blocked by external dependency | Skipped, awaiting manual intervention |
|
|
140
|
+
| `NEEDS-FIX` | Worker failure or CI failure | Auto-fix or manual intervention |
|
|
141
|
+
| `WAITING-CONFIRMATION` | Worker awaiting destructive operation confirmation | Notify for manual confirmation |
|
|
142
|
+
| `CONFLICT` | Merge conflict | Worker auto-resolves or manual handling |
|
|
143
|
+
| `STALE-RUNTIME` | Worker runtime anomaly | MonitorEngine cleanup |
|
|
139
144
|
|
|
140
145
|
---
|
|
141
146
|
|
|
142
|
-
##
|
|
147
|
+
## Command Reference
|
|
143
148
|
|
|
144
|
-
###
|
|
149
|
+
### Global Options
|
|
145
150
|
|
|
146
|
-
|
|
151
|
+
All commands support:
|
|
147
152
|
|
|
148
|
-
|
|
|
149
|
-
|
|
150
|
-
| `--json` |
|
|
151
|
-
| `--dry-run` |
|
|
152
|
-
| `--help` |
|
|
153
|
-
| `--version` |
|
|
153
|
+
| Option | Description |
|
|
154
|
+
|--------|-------------|
|
|
155
|
+
| `--json` | Output structured JSON (for script/cron consumption) |
|
|
156
|
+
| `--dry-run` | Preview actions without executing |
|
|
157
|
+
| `--help` | Show help |
|
|
158
|
+
| `--version` | Show version number |
|
|
154
159
|
|
|
155
|
-
###
|
|
160
|
+
### Exit Codes
|
|
156
161
|
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
| `0` |
|
|
160
|
-
| `1` |
|
|
161
|
-
| `2` |
|
|
162
|
-
| `3` |
|
|
162
|
+
| Exit Code | Meaning |
|
|
163
|
+
|-----------|---------|
|
|
164
|
+
| `0` | Success |
|
|
165
|
+
| `1` | Business failure / validation failure |
|
|
166
|
+
| `2` | Argument error |
|
|
167
|
+
| `3` | External dependency unavailable (GitLab / PM / Worker) |
|
|
163
168
|
|
|
164
169
|
---
|
|
165
170
|
|
|
166
171
|
### sps setup
|
|
167
172
|
|
|
168
|
-
|
|
173
|
+
Global environment initialization wizard for configuring external system credentials. Preserves existing values by showing current configuration as defaults -- press Enter to keep the current value.
|
|
169
174
|
|
|
170
175
|
```bash
|
|
171
176
|
sps setup [--force]
|
|
172
177
|
```
|
|
173
178
|
|
|
174
|
-
|
|
179
|
+
**Interactive configuration items:**
|
|
175
180
|
|
|
176
|
-
- GitLab
|
|
177
|
-
- Plane
|
|
178
|
-
- Trello
|
|
179
|
-
- Matrix
|
|
181
|
+
- GitLab: `GITLAB_URL`, `GITLAB_TOKEN`, `GITLAB_SSH_HOST`, `GITLAB_SSH_PORT`
|
|
182
|
+
- Plane: `PLANE_URL`, `PLANE_API_KEY`, `PLANE_WORKSPACE_SLUG`
|
|
183
|
+
- Trello: `TRELLO_API_KEY`, `TRELLO_TOKEN`
|
|
184
|
+
- Matrix: `MATRIX_HOMESERVER`, `MATRIX_TOKEN`, `MATRIX_ROOM_ID`
|
|
180
185
|
|
|
181
|
-
|
|
186
|
+
Credentials are stored in `~/.coral/env` (permissions 0600), shared across all projects.
|
|
182
187
|
|
|
183
|
-
|
|
|
184
|
-
|
|
185
|
-
| `--force` |
|
|
188
|
+
| Option | Description |
|
|
189
|
+
|--------|-------------|
|
|
190
|
+
| `--force` | Overwrite existing `~/.coral/env` |
|
|
186
191
|
|
|
187
192
|
---
|
|
188
193
|
|
|
189
194
|
### sps project init
|
|
190
195
|
|
|
191
|
-
|
|
196
|
+
Initialize an SPS project management directory.
|
|
192
197
|
|
|
193
198
|
```bash
|
|
194
199
|
sps project init <project> [--force]
|
|
195
200
|
```
|
|
196
201
|
|
|
197
|
-
|
|
202
|
+
**Created directory structure:**
|
|
198
203
|
|
|
199
204
|
```
|
|
200
205
|
~/.coral/projects/<project>/
|
|
201
|
-
├── conf #
|
|
202
|
-
├── logs/ #
|
|
203
|
-
├── pm_meta/ # PM
|
|
204
|
-
├── runtime/ #
|
|
205
|
-
├── pipeline_order.json #
|
|
206
|
-
├── batch_scheduler.sh # cron
|
|
207
|
-
└── deploy.sh #
|
|
206
|
+
├── conf # Project configuration file (generated from template)
|
|
207
|
+
├── logs/ # Log directory
|
|
208
|
+
├── pm_meta/ # PM metadata cache
|
|
209
|
+
├── runtime/ # Runtime state
|
|
210
|
+
├── pipeline_order.json # Card execution order
|
|
211
|
+
├── batch_scheduler.sh # cron-compatible entry script
|
|
212
|
+
└── deploy.sh # Deployment script template
|
|
208
213
|
```
|
|
209
214
|
|
|
210
|
-
|
|
|
211
|
-
|
|
212
|
-
| `--force` |
|
|
215
|
+
| Option | Description |
|
|
216
|
+
|--------|-------------|
|
|
217
|
+
| `--force` | Overwrite template files (conf will not be overwritten) |
|
|
213
218
|
|
|
214
|
-
|
|
219
|
+
**Example:**
|
|
215
220
|
|
|
216
221
|
```bash
|
|
217
222
|
sps project init accounting-agent
|
|
218
|
-
#
|
|
219
|
-
#
|
|
223
|
+
# -> Creates ~/.coral/projects/accounting-agent/
|
|
224
|
+
# -> Next step: edit conf to fill in configuration values
|
|
220
225
|
```
|
|
221
226
|
|
|
222
227
|
---
|
|
223
228
|
|
|
224
229
|
### sps doctor
|
|
225
230
|
|
|
226
|
-
|
|
231
|
+
Project health check and auto-repair.
|
|
227
232
|
|
|
228
233
|
```bash
|
|
229
234
|
sps doctor <project> [--fix] [--json] [--skip-remote]
|
|
230
235
|
```
|
|
231
236
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
|
237
|
-
|
|
238
|
-
| global-env | `~/.coral/env`
|
|
239
|
-
| global-env-vars | GITLAB_URL / GITLAB_TOKEN
|
|
240
|
-
| conf-load |
|
|
241
|
-
| conf-fields |
|
|
242
|
-
| instance-dir / logs-dir / runtime-dir / pm-meta-dir |
|
|
243
|
-
| repo-dir |
|
|
244
|
-
| gitignore-sps | `.sps/`
|
|
245
|
-
| worker-rules | CLAUDE.md / AGENTS.md
|
|
246
|
-
| skill-profiles |
|
|
247
|
-
| state-json |
|
|
248
|
-
| pipeline-order |
|
|
249
|
-
| conf-cli-fields | CLI
|
|
250
|
-
| gitlab | GitLab API
|
|
251
|
-
| plane | Plane API
|
|
252
|
-
| pm-states / pm-lists | PM
|
|
253
|
-
| worker-tool | Claude Code / Codex CLI
|
|
254
|
-
| tmux | tmux
|
|
255
|
-
|
|
256
|
-
|
|
|
257
|
-
|
|
258
|
-
| `--fix` |
|
|
259
|
-
| `--json` |
|
|
260
|
-
| `--skip-remote` |
|
|
261
|
-
|
|
262
|
-
|
|
237
|
+
Equivalent to `sps project doctor <project>`.
|
|
238
|
+
|
|
239
|
+
**Checks:**
|
|
240
|
+
|
|
241
|
+
| Check | Description | --fix |
|
|
242
|
+
|-------|-------------|-------|
|
|
243
|
+
| global-env | Whether `~/.coral/env` exists | -- |
|
|
244
|
+
| global-env-vars | Whether GITLAB_URL / GITLAB_TOKEN are loaded | -- |
|
|
245
|
+
| conf-load | Whether configuration file can be loaded | -- |
|
|
246
|
+
| conf-fields | Whether all required fields are present | -- |
|
|
247
|
+
| instance-dir / logs-dir / runtime-dir / pm-meta-dir | Directory structure | Create missing directories |
|
|
248
|
+
| repo-dir | Whether project repo exists and is a git repository | -- |
|
|
249
|
+
| gitignore-sps | Whether `.sps/` is in .gitignore | Append |
|
|
250
|
+
| worker-rules | Whether CLAUDE.md / AGENTS.md exist in repo root | Generate and commit (including .gitignore) |
|
|
251
|
+
| skill-profiles | Whether profile files specified by DEFAULT_WORKER_SKILLS exist | -- |
|
|
252
|
+
| state-json | Whether runtime state file is valid | Initialize |
|
|
253
|
+
| pipeline-order | Whether execution order file exists | Create empty |
|
|
254
|
+
| conf-cli-fields | Whether CLI-required Provider field mappings are complete (Plane only) | Append mappings |
|
|
255
|
+
| gitlab | GitLab API connectivity | -- |
|
|
256
|
+
| plane | Plane API connectivity (PM_TOOL=plane only) | -- |
|
|
257
|
+
| pm-states / pm-lists | Whether PM state/list UUIDs are valid | Auto-create + write to conf |
|
|
258
|
+
| worker-tool | Whether Claude Code / Codex CLI is in PATH | -- |
|
|
259
|
+
| tmux | Whether tmux is available (WORKER_MODE=interactive only) | -- |
|
|
260
|
+
|
|
261
|
+
| Option | Description |
|
|
262
|
+
|--------|-------------|
|
|
263
|
+
| `--fix` | Auto-fix repairable issues (create directories, generate files, initialize state) |
|
|
264
|
+
| `--json` | Output check results in JSON format |
|
|
265
|
+
| `--skip-remote` | Skip remote connectivity checks (GitLab/Plane) |
|
|
266
|
+
|
|
267
|
+
**Example:**
|
|
263
268
|
|
|
264
269
|
```bash
|
|
265
|
-
#
|
|
270
|
+
# Check + auto-fix
|
|
266
271
|
sps doctor my-project --fix
|
|
267
|
-
#
|
|
268
|
-
#
|
|
269
|
-
#
|
|
270
|
-
#
|
|
271
|
-
#
|
|
272
|
-
#
|
|
273
|
-
#
|
|
274
|
-
#
|
|
275
|
-
#
|
|
276
|
-
# -
|
|
277
|
-
|
|
278
|
-
# JSON
|
|
272
|
+
# ok global-env /home/user/.coral/env
|
|
273
|
+
# ok global-env-vars GITLAB_URL and GITLAB_TOKEN set
|
|
274
|
+
# ok conf-load Loaded ~/.coral/projects/my-project/conf
|
|
275
|
+
# ok conf-fields All required fields present
|
|
276
|
+
# ok repo-dir /home/user/projects/my-project
|
|
277
|
+
# ok gitignore-sps .sps/ in .gitignore
|
|
278
|
+
# ok worker-rules Generated and committed: CLAUDE.md, AGENTS.md
|
|
279
|
+
# ok skill-profiles DEFAULT_WORKER_SKILLS="senior" -- all profiles found
|
|
280
|
+
# ok state-json Initialized with 3 worker slots
|
|
281
|
+
# - tmux Not required (WORKER_MODE=print)
|
|
282
|
+
|
|
283
|
+
# JSON output
|
|
279
284
|
sps doctor my-project --json
|
|
280
285
|
```
|
|
281
286
|
|
|
@@ -283,112 +288,112 @@ sps doctor my-project --json
|
|
|
283
288
|
|
|
284
289
|
### sps card add
|
|
285
290
|
|
|
286
|
-
|
|
291
|
+
Create a task card.
|
|
287
292
|
|
|
288
293
|
```bash
|
|
289
294
|
sps card add <project> "<title>" ["description"]
|
|
290
295
|
```
|
|
291
296
|
|
|
292
|
-
|
|
297
|
+
Cards are created in the Planning state, automatically tagged with `AI-PIPELINE`, and appended to `pipeline_order.json`.
|
|
293
298
|
|
|
294
|
-
|
|
299
|
+
After creation, add a `skill:` label to specify the Worker's expertise (see label descriptions below).
|
|
295
300
|
|
|
296
|
-
|
|
|
297
|
-
|
|
298
|
-
| `--json` |
|
|
301
|
+
| Option | Description |
|
|
302
|
+
|--------|-------------|
|
|
303
|
+
| `--json` | Output creation result in JSON format |
|
|
299
304
|
|
|
300
|
-
|
|
305
|
+
**Example:**
|
|
301
306
|
|
|
302
307
|
```bash
|
|
303
|
-
#
|
|
304
|
-
sps card add my-project "
|
|
308
|
+
# Create cards + add skill labels
|
|
309
|
+
sps card add my-project "Implement user login" "JWT authentication endpoint"
|
|
305
310
|
sps pm addLabel my-project 1 "skill:backend"
|
|
306
311
|
|
|
307
|
-
sps card add my-project "
|
|
312
|
+
sps card add my-project "Implement order list" "CRUD API + pagination"
|
|
308
313
|
sps pm addLabel my-project 2 "skill:backend"
|
|
309
314
|
|
|
310
|
-
sps card add my-project "
|
|
315
|
+
sps card add my-project "Write API documentation" "User and order endpoint docs"
|
|
311
316
|
sps pm addLabel my-project 3 "skill:writer"
|
|
312
317
|
```
|
|
313
318
|
|
|
314
|
-
#### Skill
|
|
319
|
+
#### Skill Labels
|
|
315
320
|
|
|
316
|
-
|
|
321
|
+
Each card should have **one** `skill:` label. The Pipeline automatically loads the corresponding Worker skill profile and injects it into the prompt:
|
|
317
322
|
|
|
318
|
-
|
|
|
319
|
-
|
|
320
|
-
| `skill:architect` |
|
|
321
|
-
| `skill:frontend` |
|
|
322
|
-
| `skill:backend` |
|
|
323
|
-
| `skill:fullstack` |
|
|
324
|
-
| `skill:prototyper` |
|
|
325
|
-
| `skill:reviewer` |
|
|
326
|
-
| `skill:security` |
|
|
327
|
-
| `skill:writer` |
|
|
328
|
-
| `skill:optimizer` |
|
|
329
|
-
| `skill:senior` |
|
|
323
|
+
| Label | Worker Role | Deliverables |
|
|
324
|
+
|-------|------------|--------------|
|
|
325
|
+
| `skill:architect` | Architecture design | ADR, design docs, directory structure |
|
|
326
|
+
| `skill:frontend` | Frontend development | Components, pages, frontend tests |
|
|
327
|
+
| `skill:backend` | Backend development | API, DB migration, backend tests |
|
|
328
|
+
| `skill:fullstack` | Full-stack development | Frontend + backend + DB integrated |
|
|
329
|
+
| `skill:prototyper` | Rapid prototyping | Runnable MVP |
|
|
330
|
+
| `skill:reviewer` | Code review | Review report + fix commits |
|
|
331
|
+
| `skill:security` | Security audit | Audit report + vulnerability fixes |
|
|
332
|
+
| `skill:writer` | Technical writing | README, API docs, PRD |
|
|
333
|
+
| `skill:optimizer` | Performance optimization | Benchmark report + optimization commits |
|
|
334
|
+
| `skill:senior` | General purpose (fallback) | High-quality general implementation |
|
|
330
335
|
|
|
331
|
-
Profile
|
|
336
|
+
Profile files are located at `~/.coral/profiles/<name>.md`. When no label is present, it falls back to the project conf's `DEFAULT_WORKER_SKILLS`.
|
|
332
337
|
|
|
333
338
|
---
|
|
334
339
|
|
|
335
340
|
### sps tick
|
|
336
341
|
|
|
337
|
-
|
|
342
|
+
Unified main loop -- orchestrates all engines, executing scheduler -> qa -> pipeline -> monitor in sequence.
|
|
338
343
|
|
|
339
344
|
```bash
|
|
340
345
|
sps tick <project> [project2] [project3] ... [--once] [--json] [--dry-run]
|
|
341
346
|
```
|
|
342
347
|
|
|
343
|
-
|
|
348
|
+
**Execution order (per tick cycle):**
|
|
344
349
|
|
|
345
|
-
1. **scheduler tick**
|
|
346
|
-
2. **qa tick**
|
|
347
|
-
3. **pipeline tick**
|
|
348
|
-
4. **monitor tick**
|
|
350
|
+
1. **scheduler tick** -- Planning -> Backlog (select cards for queue)
|
|
351
|
+
2. **qa tick** -- QA -> merge -> Done (prioritize freeing Worker slots)
|
|
352
|
+
3. **pipeline tick** -- Backlog -> Todo -> Inprogress (prepare environment + launch Worker)
|
|
353
|
+
4. **monitor tick** -- Anomaly inspection and alignment
|
|
349
354
|
|
|
350
|
-
|
|
355
|
+
**Run modes:**
|
|
351
356
|
|
|
352
|
-
|
|
|
353
|
-
|
|
354
|
-
|
|
|
355
|
-
|
|
|
357
|
+
| Mode | Behavior |
|
|
358
|
+
|------|----------|
|
|
359
|
+
| Continuous (default) | Cycles every 30 seconds, auto-exits when all cards are complete |
|
|
360
|
+
| Single-run (`--once`) | Executes one tick cycle then exits immediately |
|
|
356
361
|
|
|
357
|
-
|
|
362
|
+
**Concurrency mutex:**
|
|
358
363
|
|
|
359
|
-
|
|
364
|
+
Only one `tick` instance is allowed per project at any time. Mutex is implemented via `runtime/tick.lock` (PID + timestamp). Locks exceeding `TICK_LOCK_TIMEOUT_MINUTES` (default 30 minutes) are considered deadlocked and can be forcibly taken over.
|
|
360
365
|
|
|
361
|
-
|
|
366
|
+
**Failure classification:**
|
|
362
367
|
|
|
363
|
-
|
|
|
364
|
-
|
|
365
|
-
|
|
|
366
|
-
|
|
|
367
|
-
|
|
|
368
|
+
| Type | Behavior | Example |
|
|
369
|
+
|------|----------|---------|
|
|
370
|
+
| Fatal failure | Short-circuits the entire tick | Corrupted conf, PM unavailable |
|
|
371
|
+
| Degraded continuation | Subsequent steps run with limitations | Scheduler failure -> pipeline won't launch new cards |
|
|
372
|
+
| Non-critical failure | Logged and continued | Notification send failure |
|
|
368
373
|
|
|
369
|
-
|
|
|
370
|
-
|
|
371
|
-
| `--once` |
|
|
372
|
-
| `--json` |
|
|
373
|
-
| `--dry-run` |
|
|
374
|
+
| Option | Description |
|
|
375
|
+
|--------|-------------|
|
|
376
|
+
| `--once` | Exit after single execution |
|
|
377
|
+
| `--json` | Output aggregated results in JSON format |
|
|
378
|
+
| `--dry-run` | Preview actions without executing |
|
|
374
379
|
|
|
375
|
-
|
|
380
|
+
**Example:**
|
|
376
381
|
|
|
377
382
|
```bash
|
|
378
|
-
#
|
|
383
|
+
# Single project continuous run
|
|
379
384
|
sps tick my-project
|
|
380
385
|
|
|
381
|
-
#
|
|
386
|
+
# Multi-project simultaneous management
|
|
382
387
|
sps tick project-a project-b project-c
|
|
383
388
|
|
|
384
|
-
#
|
|
389
|
+
# Single execution + JSON output (suitable for cron)
|
|
385
390
|
sps tick my-project --once --json
|
|
386
391
|
|
|
387
|
-
#
|
|
392
|
+
# Preview mode
|
|
388
393
|
sps tick my-project --once --dry-run
|
|
389
394
|
```
|
|
390
395
|
|
|
391
|
-
**JSON
|
|
396
|
+
**JSON output format:**
|
|
392
397
|
|
|
393
398
|
```json
|
|
394
399
|
{
|
|
@@ -397,29 +402,43 @@ sps tick my-project --once --dry-run
|
|
|
397
402
|
"status": "ok",
|
|
398
403
|
"exitCode": 0,
|
|
399
404
|
"steps": [
|
|
400
|
-
{ "step": "scheduler", "status": "ok", "actions": [...] },
|
|
401
|
-
{ "step": "qa", "status": "ok", "actions": [...] },
|
|
402
|
-
{ "step": "pipeline", "status": "ok", "actions": [...] },
|
|
403
|
-
{ "step": "monitor", "status": "ok", "checks": [...] }
|
|
405
|
+
{ "step": "scheduler", "status": "ok", "actions": ["..."] },
|
|
406
|
+
{ "step": "qa", "status": "ok", "actions": ["..."] },
|
|
407
|
+
{ "step": "pipeline", "status": "ok", "actions": ["..."] },
|
|
408
|
+
{ "step": "monitor", "status": "ok", "checks": ["..."] }
|
|
404
409
|
]
|
|
405
410
|
}
|
|
406
411
|
```
|
|
407
412
|
|
|
408
413
|
---
|
|
409
414
|
|
|
415
|
+
### sps status
|
|
416
|
+
|
|
417
|
+
Show running status of all projects.
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
sps status [--json]
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
| Option | Description |
|
|
424
|
+
|--------|-------------|
|
|
425
|
+
| `--json` | Output structured JSON |
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
410
429
|
### sps scheduler tick
|
|
411
430
|
|
|
412
|
-
|
|
431
|
+
Manually execute the scheduling step: Planning -> Backlog.
|
|
413
432
|
|
|
414
433
|
```bash
|
|
415
434
|
sps scheduler tick <project> [--json] [--dry-run]
|
|
416
435
|
```
|
|
417
436
|
|
|
418
|
-
-
|
|
419
|
-
-
|
|
420
|
-
-
|
|
437
|
+
- Reads `pipeline_order.json` to determine card priority
|
|
438
|
+
- Checks admission criteria (Worker availability, conflict domains, etc.)
|
|
439
|
+
- Moves eligible cards from Planning to Backlog
|
|
421
440
|
|
|
422
|
-
|
|
441
|
+
**Example:**
|
|
423
442
|
|
|
424
443
|
```bash
|
|
425
444
|
sps scheduler tick my-project
|
|
@@ -430,23 +449,23 @@ sps scheduler tick my-project --dry-run
|
|
|
430
449
|
|
|
431
450
|
### sps pipeline tick
|
|
432
451
|
|
|
433
|
-
|
|
452
|
+
Manually execute the execution chain: Backlog -> Todo -> Inprogress.
|
|
434
453
|
|
|
435
454
|
```bash
|
|
436
455
|
sps pipeline tick <project> [--json] [--dry-run]
|
|
437
456
|
```
|
|
438
457
|
|
|
439
|
-
|
|
458
|
+
**Internal steps:**
|
|
440
459
|
|
|
441
|
-
1.
|
|
442
|
-
2.
|
|
443
|
-
3.
|
|
460
|
+
1. **Check Inprogress cards** -- Detect Worker completion status. MR_MODE=none pushes directly to Done; MR_MODE=create confirms MR then pushes to Done
|
|
461
|
+
2. **Process Backlog cards** -- Create branch + create worktree + generate `.sps/merge.sh` -> push to Todo
|
|
462
|
+
3. **Process Todo cards** -- Assign Worker slot + build task context + launch Worker -> push to Inprogress
|
|
444
463
|
|
|
445
|
-
|
|
464
|
+
Limited by `MAX_ACTIONS_PER_TICK` (default 1) to prevent launching too many Workers in a single tick cycle. There is a delay between multiple Worker launches (2 seconds in print mode, 10 seconds in interactive mode).
|
|
446
465
|
|
|
447
|
-
|
|
466
|
+
Cards with `BLOCKED`, `NEEDS-FIX`, `CONFLICT`, `WAITING-CONFIRMATION`, or `STALE-RUNTIME` labels are skipped.
|
|
448
467
|
|
|
449
|
-
|
|
468
|
+
**Example:**
|
|
450
469
|
|
|
451
470
|
```bash
|
|
452
471
|
sps pipeline tick my-project
|
|
@@ -457,68 +476,68 @@ sps pipeline tick my-project --json
|
|
|
457
476
|
|
|
458
477
|
### sps worker
|
|
459
478
|
|
|
460
|
-
Worker
|
|
479
|
+
Worker lifecycle management.
|
|
461
480
|
|
|
462
481
|
#### sps worker launch
|
|
463
482
|
|
|
464
|
-
|
|
483
|
+
Manually launch a single Worker.
|
|
465
484
|
|
|
466
485
|
```bash
|
|
467
486
|
sps worker launch <project> <seq> [--json] [--dry-run]
|
|
468
487
|
```
|
|
469
488
|
|
|
470
|
-
|
|
489
|
+
If the card is in Backlog state, it will automatically execute prepare first (create branch + worktree), then launch the Worker.
|
|
471
490
|
|
|
472
|
-
|
|
491
|
+
**Launch process:**
|
|
473
492
|
|
|
474
|
-
1.
|
|
475
|
-
2.
|
|
476
|
-
3.
|
|
477
|
-
4.
|
|
493
|
+
1. Assign an available Worker slot
|
|
494
|
+
2. Write `.sps/task_prompt.txt` to the worktree
|
|
495
|
+
3. Launch Worker process
|
|
496
|
+
4. Push card to Inprogress
|
|
478
497
|
|
|
479
|
-
**Worker
|
|
498
|
+
**Worker execution modes (`WORKER_MODE`):**
|
|
480
499
|
|
|
481
|
-
|
|
|
482
|
-
|
|
483
|
-
| `print` |
|
|
484
|
-
| `interactive` |
|
|
500
|
+
| Mode | Default | Description |
|
|
501
|
+
|------|---------|-------------|
|
|
502
|
+
| `print` | **Yes** | One-shot execution, process exit = task complete, no tmux dependency |
|
|
503
|
+
| `interactive` | No | Traditional tmux TUI interactive mode (fallback) |
|
|
485
504
|
|
|
486
|
-
**Print
|
|
505
|
+
**Print mode (recommended):**
|
|
487
506
|
|
|
488
|
-
Worker
|
|
507
|
+
The Worker runs as a subprocess, prompt is passed via stdin, output is written to a JSONL file:
|
|
489
508
|
|
|
490
509
|
```
|
|
491
510
|
Claude: claude -p --output-format stream-json --dangerously-skip-permissions
|
|
492
511
|
Codex: codex exec - --json --dangerously-bypass-approvals-and-sandbox
|
|
493
512
|
```
|
|
494
513
|
|
|
495
|
-
|
|
496
|
-
-
|
|
497
|
-
-
|
|
498
|
-
-
|
|
499
|
-
-
|
|
514
|
+
Key advantages:
|
|
515
|
+
- **Never gets stuck** -- No TUI interaction, process exit means completion
|
|
516
|
+
- **No confirmation needed** -- Permission flags skip all confirmation dialogs
|
|
517
|
+
- **Context continuation** -- Via `--resume <sessionId>` for cross-task context reuse (hits prompt cache, saves tokens)
|
|
518
|
+
- **No tmux dependency** -- Pure process management, suitable for CI/CD environments
|
|
500
519
|
|
|
501
|
-
**Session Resume
|
|
520
|
+
**Session Resume chain:**
|
|
502
521
|
|
|
503
|
-
|
|
522
|
+
Multiple tasks on the same worktree (initial implementation -> CI fix -> conflict resolution) share the same session:
|
|
504
523
|
|
|
505
524
|
```
|
|
506
|
-
|
|
507
|
-
CI
|
|
508
|
-
|
|
525
|
+
Task 1: claude -p "Implement feature" -> session_id_1 (stored in state.json)
|
|
526
|
+
CI fix: claude -p "Fix CI" --resume sid -> Inherits full context from task 1
|
|
527
|
+
Conflict: claude -p "Resolve conflict" --resume sid -> Inherits all historical context
|
|
509
528
|
```
|
|
510
529
|
|
|
511
|
-
**Interactive
|
|
530
|
+
**Interactive mode (fallback):**
|
|
512
531
|
|
|
513
|
-
|
|
532
|
+
Set `WORKER_MODE=interactive` to fall back to tmux interactive mode. Reuse strategy in this mode:
|
|
514
533
|
|
|
515
|
-
|
|
|
516
|
-
|
|
517
|
-
| Session
|
|
518
|
-
| Session
|
|
519
|
-
|
|
|
534
|
+
| Scenario | Behavior |
|
|
535
|
+
|----------|----------|
|
|
536
|
+
| Session exists + Claude running | Reuse: `/clear` + `cd worktree` |
|
|
537
|
+
| Session exists + Claude not running | Reuse session: `cd` + launch Claude |
|
|
538
|
+
| No session | Create new session + launch Claude |
|
|
520
539
|
|
|
521
|
-
|
|
540
|
+
**Example:**
|
|
522
541
|
|
|
523
542
|
```bash
|
|
524
543
|
sps worker launch my-project 24
|
|
@@ -527,43 +546,43 @@ sps worker launch my-project 24 --dry-run
|
|
|
527
546
|
|
|
528
547
|
#### sps worker dashboard
|
|
529
548
|
|
|
530
|
-
|
|
549
|
+
Real-time dashboard for monitoring all Worker running states.
|
|
531
550
|
|
|
532
551
|
```bash
|
|
533
552
|
sps worker dashboard [project1] [project2] ... [--once] [--json]
|
|
534
553
|
```
|
|
535
554
|
|
|
536
|
-
|
|
|
537
|
-
|
|
538
|
-
|
|
|
539
|
-
| `--once` |
|
|
540
|
-
| `--json` |
|
|
555
|
+
| Option | Description |
|
|
556
|
+
|--------|-------------|
|
|
557
|
+
| (no arguments) | Auto-discovers all projects under `~/.coral/projects/` |
|
|
558
|
+
| `--once` | Output a single snapshot then exit (no real-time mode) |
|
|
559
|
+
| `--json` | Output in JSON format (all projects, all Worker slot states + output preview) |
|
|
541
560
|
|
|
542
|
-
|
|
561
|
+
**Real-time mode:**
|
|
543
562
|
|
|
544
|
-
-
|
|
545
|
-
-
|
|
546
|
-
-
|
|
547
|
-
-
|
|
548
|
-
- Print
|
|
549
|
-
- Interactive
|
|
563
|
+
- Refreshes every 3 seconds by default (adjustable via `SPS_DASHBOARD_INTERVAL` environment variable)
|
|
564
|
+
- Press `q` to quit, press `r` to force refresh
|
|
565
|
+
- Uses alternate screen buffer (does not pollute terminal scrollback)
|
|
566
|
+
- Adaptive grid layout, one panel per Worker
|
|
567
|
+
- Print mode panels show: PID, exit code, JSONL-rendered human-readable output
|
|
568
|
+
- Interactive mode panels show: tmux pane live output
|
|
550
569
|
|
|
551
|
-
|
|
570
|
+
**Example:**
|
|
552
571
|
|
|
553
572
|
```bash
|
|
554
|
-
#
|
|
573
|
+
# Monitor all projects
|
|
555
574
|
sps worker dashboard
|
|
556
575
|
|
|
557
|
-
#
|
|
576
|
+
# Monitor specific projects
|
|
558
577
|
sps worker dashboard my-project
|
|
559
578
|
|
|
560
|
-
#
|
|
579
|
+
# Single snapshot
|
|
561
580
|
sps worker dashboard --once
|
|
562
581
|
|
|
563
|
-
# JSON
|
|
582
|
+
# JSON output (for script consumption)
|
|
564
583
|
sps worker dashboard --json
|
|
565
584
|
|
|
566
|
-
#
|
|
585
|
+
# Custom refresh interval
|
|
567
586
|
SPS_DASHBOARD_INTERVAL=5000 sps worker dashboard
|
|
568
587
|
```
|
|
569
588
|
|
|
@@ -571,38 +590,38 @@ SPS_DASHBOARD_INTERVAL=5000 sps worker dashboard
|
|
|
571
590
|
|
|
572
591
|
### sps pm
|
|
573
592
|
|
|
574
|
-
PM
|
|
593
|
+
PM backend operations.
|
|
575
594
|
|
|
576
595
|
#### sps pm scan
|
|
577
596
|
|
|
578
|
-
|
|
597
|
+
View card list.
|
|
579
598
|
|
|
580
599
|
```bash
|
|
581
600
|
sps pm scan <project> [state]
|
|
582
601
|
```
|
|
583
602
|
|
|
584
|
-
|
|
603
|
+
Lists all cards when `state` is not specified.
|
|
585
604
|
|
|
586
|
-
|
|
605
|
+
**Example:**
|
|
587
606
|
|
|
588
607
|
```bash
|
|
589
|
-
#
|
|
608
|
+
# View all cards
|
|
590
609
|
sps pm scan my-project
|
|
591
610
|
|
|
592
|
-
#
|
|
611
|
+
# Filter by state
|
|
593
612
|
sps pm scan my-project Inprogress
|
|
594
613
|
sps pm scan my-project Planning
|
|
595
614
|
```
|
|
596
615
|
|
|
597
616
|
#### sps pm move
|
|
598
617
|
|
|
599
|
-
|
|
618
|
+
Manually move a card's state.
|
|
600
619
|
|
|
601
620
|
```bash
|
|
602
621
|
sps pm move <project> <seq> <state>
|
|
603
622
|
```
|
|
604
623
|
|
|
605
|
-
|
|
624
|
+
**Example:**
|
|
606
625
|
|
|
607
626
|
```bash
|
|
608
627
|
sps pm move my-project 24 QA
|
|
@@ -611,38 +630,38 @@ sps pm move my-project 25 Done
|
|
|
611
630
|
|
|
612
631
|
#### sps pm comment
|
|
613
632
|
|
|
614
|
-
|
|
633
|
+
Add a comment to a card.
|
|
615
634
|
|
|
616
635
|
```bash
|
|
617
636
|
sps pm comment <project> <seq> "<text>"
|
|
618
637
|
```
|
|
619
638
|
|
|
620
|
-
|
|
639
|
+
**Example:**
|
|
621
640
|
|
|
622
641
|
```bash
|
|
623
|
-
sps pm comment my-project 24 "CI
|
|
642
|
+
sps pm comment my-project 24 "CI passed, awaiting review"
|
|
624
643
|
```
|
|
625
644
|
|
|
626
645
|
#### sps pm checklist
|
|
627
646
|
|
|
628
|
-
|
|
647
|
+
Manage card checklists.
|
|
629
648
|
|
|
630
649
|
```bash
|
|
631
|
-
#
|
|
650
|
+
# Create checklist
|
|
632
651
|
sps pm checklist create <project> <seq> "item1" "item2" "item3"
|
|
633
652
|
|
|
634
|
-
#
|
|
653
|
+
# View checklist
|
|
635
654
|
sps pm checklist list <project> <seq>
|
|
636
655
|
|
|
637
|
-
#
|
|
656
|
+
# Check/uncheck items
|
|
638
657
|
sps pm checklist check <project> <seq> <item-id>
|
|
639
658
|
sps pm checklist uncheck <project> <seq> <item-id>
|
|
640
659
|
```
|
|
641
660
|
|
|
642
|
-
|
|
661
|
+
**Example:**
|
|
643
662
|
|
|
644
663
|
```bash
|
|
645
|
-
sps pm checklist create my-project 24 "
|
|
664
|
+
sps pm checklist create my-project 24 "Unit tests" "Integration tests" "Code review"
|
|
646
665
|
sps pm checklist list my-project 24
|
|
647
666
|
sps pm checklist check my-project 24 item-001
|
|
648
667
|
```
|
|
@@ -651,27 +670,27 @@ sps pm checklist check my-project 24 item-001
|
|
|
651
670
|
|
|
652
671
|
### sps qa tick
|
|
653
672
|
|
|
654
|
-
QA
|
|
673
|
+
QA close-out and worktree cleanup.
|
|
655
674
|
|
|
656
675
|
```bash
|
|
657
676
|
sps qa tick <project> [--json]
|
|
658
677
|
```
|
|
659
678
|
|
|
660
|
-
**MR_MODE=none
|
|
679
|
+
**When MR_MODE=none:** The QA phase primarily handles worktree cleanup. After Worker completion, the ExecutionEngine pushes directly to Done.
|
|
661
680
|
|
|
662
|
-
**MR_MODE=create
|
|
681
|
+
**When MR_MODE=create:** QA serves as a legacy compatibility path, processing cards that reach QA state (auto-creates MR or tags `NEEDS-FIX`).
|
|
663
682
|
|
|
664
|
-
**
|
|
683
|
+
**Automatic worktree cleanup:**
|
|
665
684
|
|
|
666
|
-
|
|
685
|
+
After each qa tick cycle, items in the `state.worktreeCleanup` queue are automatically processed:
|
|
667
686
|
|
|
668
|
-
1. `git worktree remove --force <path>`
|
|
669
|
-
2. `git branch -d <branch>`
|
|
670
|
-
3. `git worktree prune`
|
|
687
|
+
1. `git worktree remove --force <path>` -- Remove worktree directory
|
|
688
|
+
2. `git branch -d <branch>` -- Delete merged local branch
|
|
689
|
+
3. `git worktree prune` -- Clean up residual references
|
|
671
690
|
|
|
672
|
-
|
|
691
|
+
Failed cleanup entries remain in the queue and are automatically retried in the next tick cycle.
|
|
673
692
|
|
|
674
|
-
|
|
693
|
+
**Example:**
|
|
675
694
|
|
|
676
695
|
```bash
|
|
677
696
|
sps qa tick my-project
|
|
@@ -682,23 +701,23 @@ sps qa tick my-project --json
|
|
|
682
701
|
|
|
683
702
|
### sps monitor tick
|
|
684
703
|
|
|
685
|
-
|
|
704
|
+
Manually execute anomaly detection and health inspection.
|
|
686
705
|
|
|
687
706
|
```bash
|
|
688
707
|
sps monitor tick <project> [--json]
|
|
689
708
|
```
|
|
690
709
|
|
|
691
|
-
|
|
710
|
+
**Inspection items:**
|
|
692
711
|
|
|
693
|
-
|
|
|
694
|
-
|
|
695
|
-
|
|
|
696
|
-
|
|
|
697
|
-
|
|
|
698
|
-
|
|
|
699
|
-
|
|
|
712
|
+
| Check | Description |
|
|
713
|
+
|-------|-------------|
|
|
714
|
+
| Orphan slot cleanup | Process/tmux session is dead but slot is still marked active |
|
|
715
|
+
| Timeout detection | Inprogress exceeds `INPROGRESS_TIMEOUT_HOURS` |
|
|
716
|
+
| Awaiting confirmation detection | Worker waiting for user confirmation (interactive mode only; print mode has no confirmations) |
|
|
717
|
+
| Block detection | Worker encountering error/fatal/stuck (interactive mode only) |
|
|
718
|
+
| State alignment | Whether PM state and runtime state are consistent |
|
|
700
719
|
|
|
701
|
-
|
|
720
|
+
**Example:**
|
|
702
721
|
|
|
703
722
|
```bash
|
|
704
723
|
sps monitor tick my-project
|
|
@@ -707,130 +726,130 @@ sps monitor tick my-project --json
|
|
|
707
726
|
|
|
708
727
|
---
|
|
709
728
|
|
|
710
|
-
## Worker
|
|
729
|
+
## Worker Rule Files
|
|
711
730
|
|
|
712
|
-
`sps doctor --fix`
|
|
731
|
+
`sps doctor --fix` generates the following files in the project repository root and auto-commits them:
|
|
713
732
|
|
|
714
|
-
|
|
|
715
|
-
|
|
716
|
-
| `CLAUDE.md` | Claude Code Worker
|
|
717
|
-
| `AGENTS.md` | Codex Worker
|
|
718
|
-
| `.sps/task_prompt.txt` |
|
|
719
|
-
| `.sps/merge.sh` |
|
|
720
|
-
| `docs/DECISIONS.md` |
|
|
721
|
-
| `docs/CHANGELOG.md` |
|
|
733
|
+
| File | Purpose | Committed to git |
|
|
734
|
+
|------|---------|-----------------|
|
|
735
|
+
| `CLAUDE.md` | Project rules for Claude Code Worker | Yes |
|
|
736
|
+
| `AGENTS.md` | Project rules for Codex Worker | Yes |
|
|
737
|
+
| `.sps/task_prompt.txt` | Specific task description per assignment (generated independently in each worktree) | No (.gitignore) |
|
|
738
|
+
| `.sps/merge.sh` | Merge script (git merge for MR_MODE=none, GitLab API MR creation for MR_MODE=create) | No (.gitignore) |
|
|
739
|
+
| `docs/DECISIONS.md` | Project knowledge base -- architecture decisions and technical choices | Yes (Worker auto-maintained) |
|
|
740
|
+
| `docs/CHANGELOG.md` | Project knowledge base -- change log | Yes (Worker auto-maintained) |
|
|
722
741
|
|
|
723
|
-
**Skill Profile
|
|
742
|
+
**Skill Profile injection (v0.16+):**
|
|
724
743
|
|
|
725
|
-
|
|
|
726
|
-
|
|
727
|
-
|
|
|
744
|
+
| File | Purpose |
|
|
745
|
+
|------|---------|
|
|
746
|
+
| `~/.coral/profiles/<name>.md` | Loaded into Worker prompt via `skill:<name>` label |
|
|
728
747
|
|
|
729
|
-
Prompt
|
|
748
|
+
Prompt assembly order: Skill Profile -> CLAUDE.md/AGENTS.md -> DECISIONS.md/CHANGELOG.md -> Task description
|
|
730
749
|
|
|
731
|
-
###
|
|
750
|
+
### How It Works
|
|
732
751
|
|
|
733
|
-
1. `CLAUDE.md`
|
|
734
|
-
2.
|
|
735
|
-
3. Worker
|
|
736
|
-
4.
|
|
737
|
-
5. `.sps/merge.sh`
|
|
752
|
+
1. `CLAUDE.md` and `AGENTS.md` are committed to the repository's main branch
|
|
753
|
+
2. When creating a git worktree, these files are automatically inherited
|
|
754
|
+
3. On startup, the Worker reads CLAUDE.md to understand project rules (auto-discovered in interactive mode; auto-loaded from cwd in print mode)
|
|
755
|
+
4. Task-specific information (seq, branch name, description) is written to `.sps/task_prompt.txt`, passed to the Worker via stdin (print mode) or tmux paste (interactive mode)
|
|
756
|
+
5. `.sps/merge.sh` is auto-generated in each worktree. After pushing, the Worker runs this script to complete the merge or MR creation
|
|
738
757
|
|
|
739
|
-
###
|
|
758
|
+
### Project Knowledge Base
|
|
740
759
|
|
|
741
|
-
|
|
760
|
+
Each Worker is instructed in the task prompt to:
|
|
742
761
|
|
|
743
|
-
-
|
|
744
|
-
-
|
|
762
|
+
- **Before starting**: Read `docs/DECISIONS.md` and `docs/CHANGELOG.md` to understand decisions and changes from preceding tasks
|
|
763
|
+
- **After completion**: Append their architecture decisions to `docs/DECISIONS.md` and change summaries to `docs/CHANGELOG.md`
|
|
745
764
|
|
|
746
|
-
|
|
765
|
+
These files are merged with the code into the target branch. The next Worker inherits them when creating a worktree, enabling cross-task knowledge transfer.
|
|
747
766
|
|
|
748
|
-
###
|
|
767
|
+
### Customizing Project Rules
|
|
749
768
|
|
|
750
|
-
|
|
769
|
+
The generated CLAUDE.md includes a "Project-Specific Rules" placeholder section where you can add:
|
|
751
770
|
|
|
752
771
|
```markdown
|
|
753
772
|
## Project-Specific Rules
|
|
754
|
-
-
|
|
755
|
-
-
|
|
756
|
-
-
|
|
757
|
-
- Linting
|
|
773
|
+
- Language: TypeScript strict mode
|
|
774
|
+
- Test framework: vitest, coverage 80%+
|
|
775
|
+
- Architecture: src/modules/<domain>/ directory structure
|
|
776
|
+
- Linting: eslint + prettier, must pass before commit
|
|
758
777
|
```
|
|
759
778
|
|
|
760
|
-
SPS
|
|
779
|
+
SPS will not overwrite existing CLAUDE.md / AGENTS.md files.
|
|
761
780
|
|
|
762
781
|
---
|
|
763
782
|
|
|
764
|
-
##
|
|
783
|
+
## Project Configuration
|
|
765
784
|
|
|
766
|
-
|
|
785
|
+
Configuration is split into two layers:
|
|
767
786
|
|
|
768
|
-
|
|
|
769
|
-
|
|
770
|
-
| `~/.coral/env` |
|
|
771
|
-
| `~/.coral/projects/<project>/conf` |
|
|
787
|
+
| File | Scope | Description |
|
|
788
|
+
|------|-------|-------------|
|
|
789
|
+
| `~/.coral/env` | Global | Credentials shared across all projects (GitLab token, PM API key, etc.) |
|
|
790
|
+
| `~/.coral/projects/<project>/conf` | Project | Project-specific configuration (repository, branch, Worker parameters, etc.) |
|
|
772
791
|
|
|
773
|
-
|
|
792
|
+
Project conf can reference global variables (e.g., `${PLANE_URL}`).
|
|
774
793
|
|
|
775
|
-
###
|
|
794
|
+
### Configuration Field Reference
|
|
776
795
|
|
|
777
|
-
####
|
|
796
|
+
#### Project Basics
|
|
778
797
|
|
|
779
|
-
|
|
|
780
|
-
|
|
781
|
-
| `PROJECT_NAME` |
|
|
782
|
-
| `PROJECT_DISPLAY` |
|
|
783
|
-
| `PROJECT_DIR` |
|
|
798
|
+
| Field | Required | Default | Description |
|
|
799
|
+
|-------|----------|---------|-------------|
|
|
800
|
+
| `PROJECT_NAME` | Yes | -- | Project name |
|
|
801
|
+
| `PROJECT_DISPLAY` | No | PROJECT_NAME | Display name |
|
|
802
|
+
| `PROJECT_DIR` | No | `~/projects/<project>` | Project repository path |
|
|
784
803
|
|
|
785
804
|
#### GitLab
|
|
786
805
|
|
|
787
|
-
|
|
|
788
|
-
|
|
789
|
-
| `GITLAB_PROJECT` |
|
|
790
|
-
| `GITLAB_PROJECT_ID` |
|
|
791
|
-
| `GITLAB_MERGE_BRANCH` |
|
|
792
|
-
| `GITLAB_RELEASE_BRANCH` |
|
|
806
|
+
| Field | Required | Default | Description |
|
|
807
|
+
|-------|----------|---------|-------------|
|
|
808
|
+
| `GITLAB_PROJECT` | Yes | -- | GitLab project path (e.g., `group/repo`) |
|
|
809
|
+
| `GITLAB_PROJECT_ID` | Yes | -- | GitLab project numeric ID |
|
|
810
|
+
| `GITLAB_MERGE_BRANCH` | Yes | `develop` | MR target branch |
|
|
811
|
+
| `GITLAB_RELEASE_BRANCH` | No | `main` | Release branch |
|
|
793
812
|
|
|
794
|
-
#### PM
|
|
813
|
+
#### PM Backend
|
|
795
814
|
|
|
796
|
-
|
|
|
797
|
-
|
|
798
|
-
| `PM_TOOL` |
|
|
799
|
-
| `PIPELINE_LABEL` |
|
|
800
|
-
| `MR_MODE` |
|
|
815
|
+
| Field | Required | Default | Description |
|
|
816
|
+
|-------|----------|---------|-------------|
|
|
817
|
+
| `PM_TOOL` | No | `trello` | PM backend type: `plane` / `trello` / `markdown` |
|
|
818
|
+
| `PIPELINE_LABEL` | No | `AI-PIPELINE` | Pipeline card label |
|
|
819
|
+
| `MR_MODE` | No | `none` | Merge mode: `none` (direct merge to target branch) / `create` (create MR, review flow under development) |
|
|
801
820
|
|
|
802
821
|
#### Worker
|
|
803
822
|
|
|
804
|
-
|
|
|
805
|
-
|
|
806
|
-
| `WORKER_TOOL` |
|
|
807
|
-
| `WORKER_MODE` |
|
|
808
|
-
| `MAX_CONCURRENT_WORKERS` |
|
|
809
|
-
| `WORKER_RESTART_LIMIT` |
|
|
810
|
-
| `AUTOFIX_ATTEMPTS` |
|
|
811
|
-
| `WORKER_SESSION_REUSE` |
|
|
812
|
-
| `MAX_ACTIONS_PER_TICK` |
|
|
813
|
-
|
|
814
|
-
####
|
|
815
|
-
|
|
816
|
-
|
|
|
817
|
-
|
|
818
|
-
| `INPROGRESS_TIMEOUT_HOURS` |
|
|
819
|
-
| `MONITOR_AUTO_QA` |
|
|
820
|
-
| `CONFLICT_DEFAULT` |
|
|
821
|
-
| `TICK_LOCK_TIMEOUT_MINUTES` |
|
|
822
|
-
| `NEEDS_FIX_MAX_RETRIES` |
|
|
823
|
-
| `WORKTREE_RETAIN_HOURS` |
|
|
824
|
-
|
|
825
|
-
####
|
|
826
|
-
|
|
827
|
-
|
|
|
828
|
-
|
|
829
|
-
| `WORKTREE_DIR` |
|
|
830
|
-
| `DEPLOY_ENABLED` |
|
|
831
|
-
| `DEPLOY_SCRIPT` |
|
|
832
|
-
|
|
833
|
-
###
|
|
823
|
+
| Field | Required | Default | Description |
|
|
824
|
+
|-------|----------|---------|-------------|
|
|
825
|
+
| `WORKER_TOOL` | No | `claude` | Worker type: `claude` / `codex` |
|
|
826
|
+
| `WORKER_MODE` | No | `print` | Execution mode: `print` (one-shot process) / `interactive` (tmux TUI) |
|
|
827
|
+
| `MAX_CONCURRENT_WORKERS` | No | `3` | Maximum parallel Workers |
|
|
828
|
+
| `WORKER_RESTART_LIMIT` | No | `2` | Maximum restart count after Worker death |
|
|
829
|
+
| `AUTOFIX_ATTEMPTS` | No | `2` | CI failure auto-fix attempt count |
|
|
830
|
+
| `WORKER_SESSION_REUSE` | No | `true` | Whether to reuse tmux sessions (interactive mode only) |
|
|
831
|
+
| `MAX_ACTIONS_PER_TICK` | No | `1` | Maximum actions per tick cycle |
|
|
832
|
+
|
|
833
|
+
#### Timeouts and Policies
|
|
834
|
+
|
|
835
|
+
| Field | Required | Default | Description |
|
|
836
|
+
|-------|----------|---------|-------------|
|
|
837
|
+
| `INPROGRESS_TIMEOUT_HOURS` | No | `8` | Inprogress timeout in hours |
|
|
838
|
+
| `MONITOR_AUTO_QA` | No | `false` | Whether Monitor auto-pushes completed cards to QA |
|
|
839
|
+
| `CONFLICT_DEFAULT` | No | `serial` | Default conflict domain strategy: `serial` / `parallel` |
|
|
840
|
+
| `TICK_LOCK_TIMEOUT_MINUTES` | No | `30` | Tick lock timeout in minutes |
|
|
841
|
+
| `NEEDS_FIX_MAX_RETRIES` | No | `3` | Maximum NEEDS-FIX retry count |
|
|
842
|
+
| `WORKTREE_RETAIN_HOURS` | No | `24` | Worktree retention in hours |
|
|
843
|
+
|
|
844
|
+
#### Paths and Deployment
|
|
845
|
+
|
|
846
|
+
| Field | Required | Default | Description |
|
|
847
|
+
|-------|----------|---------|-------------|
|
|
848
|
+
| `WORKTREE_DIR` | No | `~/.coral/worktrees/` | Worktree root directory |
|
|
849
|
+
| `DEPLOY_ENABLED` | No | `false` | Whether to enable auto-deployment |
|
|
850
|
+
| `DEPLOY_SCRIPT` | No | -- | Deployment script path |
|
|
851
|
+
|
|
852
|
+
### Configuration Example
|
|
834
853
|
|
|
835
854
|
```bash
|
|
836
855
|
# ~/.coral/projects/my-project/conf
|
|
@@ -844,86 +863,86 @@ GITLAB_PROJECT="team/my-project"
|
|
|
844
863
|
GITLAB_PROJECT_ID="42"
|
|
845
864
|
GITLAB_MERGE_BRANCH="develop"
|
|
846
865
|
|
|
847
|
-
# PM
|
|
866
|
+
# PM (uses variables from global ~/.coral/env)
|
|
848
867
|
PM_TOOL="plane"
|
|
849
868
|
PLANE_API_URL="${PLANE_URL}"
|
|
850
869
|
PLANE_PROJECT_ID="project-uuid-here"
|
|
851
870
|
|
|
852
871
|
# Worker
|
|
853
872
|
WORKER_TOOL="claude"
|
|
854
|
-
WORKER_MODE="print" # print
|
|
873
|
+
WORKER_MODE="print" # print (recommended) or interactive (tmux fallback)
|
|
855
874
|
MAX_CONCURRENT_WORKERS=3
|
|
856
875
|
MAX_ACTIONS_PER_TICK=1
|
|
857
876
|
|
|
858
|
-
#
|
|
859
|
-
MR_MODE="none" # none
|
|
877
|
+
# Merge mode
|
|
878
|
+
MR_MODE="none" # none (direct merge) or create (create MR)
|
|
860
879
|
```
|
|
861
880
|
|
|
862
881
|
---
|
|
863
882
|
|
|
864
|
-
##
|
|
883
|
+
## Multi-Project Parallel Execution
|
|
865
884
|
|
|
866
|
-
SPS
|
|
885
|
+
SPS supports managing multiple projects simultaneously in a single process:
|
|
867
886
|
|
|
868
887
|
```bash
|
|
869
888
|
sps tick project-a project-b project-c
|
|
870
889
|
```
|
|
871
890
|
|
|
872
|
-
|
|
873
|
-
-
|
|
874
|
-
-
|
|
875
|
-
-
|
|
876
|
-
-
|
|
891
|
+
Each project is fully isolated:
|
|
892
|
+
- Independent ProjectContext, Provider instances, Engine instances
|
|
893
|
+
- Independent tick.lock (non-blocking between projects)
|
|
894
|
+
- Independent state.json (Worker slots are not mixed)
|
|
895
|
+
- Errors in one project do not affect others
|
|
877
896
|
|
|
878
|
-
|
|
897
|
+
Multi-Worker parallel configuration:
|
|
879
898
|
|
|
880
899
|
```bash
|
|
881
|
-
#
|
|
900
|
+
# Set in project conf
|
|
882
901
|
MAX_CONCURRENT_WORKERS=3
|
|
883
902
|
CONFLICT_DEFAULT=parallel
|
|
884
903
|
```
|
|
885
904
|
|
|
886
905
|
---
|
|
887
906
|
|
|
888
|
-
##
|
|
907
|
+
## Architecture Overview
|
|
889
908
|
|
|
890
|
-
###
|
|
909
|
+
### Four-Layer Architecture
|
|
891
910
|
|
|
892
911
|
```
|
|
893
|
-
Layer 3 Commands + Engines CLI
|
|
894
|
-
Layer 2 Providers
|
|
895
|
-
Layer 1 Interfaces
|
|
896
|
-
Layer 0 Core Runtime
|
|
912
|
+
Layer 3 Commands + Engines CLI commands + state machine engines
|
|
913
|
+
Layer 2 Providers Concrete backend implementations
|
|
914
|
+
Layer 1 Interfaces Abstract interfaces
|
|
915
|
+
Layer 0 Core Runtime Configuration, paths, state, locks, logging
|
|
897
916
|
```
|
|
898
917
|
|
|
899
|
-
###
|
|
918
|
+
### Supported Backends
|
|
900
919
|
|
|
901
|
-
|
|
|
902
|
-
|
|
903
|
-
| PM
|
|
904
|
-
|
|
|
920
|
+
| Type | Provider | Interface |
|
|
921
|
+
|------|----------|-----------|
|
|
922
|
+
| PM Backend | Plane CE / Trello / Markdown | TaskBackend |
|
|
923
|
+
| Code Hosting | GitLab | RepoBackend |
|
|
905
924
|
| AI Worker (print) | ClaudePrintProvider / CodexExecProvider | WorkerProvider |
|
|
906
925
|
| AI Worker (interactive) | ClaudeTmuxProvider / CodexTmuxProvider | WorkerProvider |
|
|
907
|
-
|
|
|
926
|
+
| Notifications | Matrix | Notifier |
|
|
908
927
|
|
|
909
|
-
###
|
|
928
|
+
### Engines
|
|
910
929
|
|
|
911
|
-
|
|
|
912
|
-
|
|
913
|
-
| SchedulerEngine | Planning
|
|
914
|
-
| ExecutionEngine | Backlog
|
|
915
|
-
| CloseoutEngine |
|
|
916
|
-
| MonitorEngine |
|
|
930
|
+
| Engine | Responsibility |
|
|
931
|
+
|--------|---------------|
|
|
932
|
+
| SchedulerEngine | Planning -> Backlog (card selection, sorting, admission checks) |
|
|
933
|
+
| ExecutionEngine | Backlog -> Todo -> Inprogress -> Done (prepare environment, launch Worker, detect completion, release resources) |
|
|
934
|
+
| CloseoutEngine | Worktree cleanup (legacy QA card handling when MR_MODE=create) |
|
|
935
|
+
| MonitorEngine | Anomaly detection (orphan cleanup, timeouts, blocks, state alignment, dead Worker completion detection) |
|
|
917
936
|
|
|
918
937
|
---
|
|
919
938
|
|
|
920
|
-
##
|
|
939
|
+
## Directory Structure
|
|
921
940
|
|
|
922
941
|
```
|
|
923
942
|
workflow-cli/
|
|
924
943
|
├── src/
|
|
925
|
-
│ ├── main.ts # CLI
|
|
926
|
-
│ ├── commands/ #
|
|
944
|
+
│ ├── main.ts # CLI entry point, command routing
|
|
945
|
+
│ ├── commands/ # Command implementations
|
|
927
946
|
│ │ ├── setup.ts # sps setup
|
|
928
947
|
│ │ ├── projectInit.ts # sps project init
|
|
929
948
|
│ │ ├── doctor.ts # sps doctor
|
|
@@ -936,45 +955,45 @@ workflow-cli/
|
|
|
936
955
|
│ │ ├── pmCommand.ts # sps pm *
|
|
937
956
|
│ │ ├── qaTick.ts # sps qa tick
|
|
938
957
|
│ │ └── monitorTick.ts # sps monitor tick
|
|
939
|
-
│ ├── core/ #
|
|
940
|
-
│ │ ├── config.ts #
|
|
958
|
+
│ ├── core/ # Core runtime
|
|
959
|
+
│ │ ├── config.ts # Configuration loading (shell conf parsing)
|
|
941
960
|
│ │ ├── context.ts # ProjectContext
|
|
942
|
-
│ │ ├── paths.ts #
|
|
943
|
-
│ │ ├── state.ts #
|
|
944
|
-
│ │ ├── lock.ts #
|
|
945
|
-
│ │ ├── logger.ts #
|
|
946
|
-
│ │ └── queue.ts # Pipeline
|
|
947
|
-
│ ├── engines/ #
|
|
948
|
-
│ │ ├── SchedulerEngine.ts #
|
|
949
|
-
│ │ ├── ExecutionEngine.ts #
|
|
950
|
-
│ │ ├── CloseoutEngine.ts # QA
|
|
951
|
-
│ │ └── MonitorEngine.ts #
|
|
952
|
-
│ ├── manager/ # Worker
|
|
953
|
-
│ │ ├── supervisor.ts # fd
|
|
954
|
-
│ │ ├── completion-judge.ts # git
|
|
961
|
+
│ │ ├── paths.ts # Path resolution
|
|
962
|
+
│ │ ├── state.ts # Runtime state (state.json)
|
|
963
|
+
│ │ ├── lock.ts # Tick lock
|
|
964
|
+
│ │ ├── logger.ts # Logging + structured events
|
|
965
|
+
│ │ └── queue.ts # Pipeline queue
|
|
966
|
+
│ ├── engines/ # State machine engines
|
|
967
|
+
│ │ ├── SchedulerEngine.ts # Card selection and queuing
|
|
968
|
+
│ │ ├── ExecutionEngine.ts # Execution chain
|
|
969
|
+
│ │ ├── CloseoutEngine.ts # QA close-out
|
|
970
|
+
│ │ └── MonitorEngine.ts # Anomaly detection
|
|
971
|
+
│ ├── manager/ # Worker process management module (v0.16.0)
|
|
972
|
+
│ │ ├── supervisor.ts # fd-redirected spawn, child handle, exit callbacks
|
|
973
|
+
│ │ ├── completion-judge.ts # git output checks, marker/keyword detection
|
|
955
974
|
│ │ ├── post-actions.ts # merge + PM update + slot release + notify
|
|
956
|
-
│ │ ├── pm-client.ts #
|
|
957
|
-
│ │ ├── resource-limiter.ts #
|
|
958
|
-
│ │ └── recovery.ts #
|
|
959
|
-
│ ├── interfaces/ #
|
|
960
|
-
│ │ ├── TaskBackend.ts # PM
|
|
961
|
-
│ │ ├── WorkerProvider.ts # Worker
|
|
962
|
-
│ │ ├── RepoBackend.ts #
|
|
963
|
-
│ │ ├── Notifier.ts #
|
|
964
|
-
│ │ └── HookProvider.ts # Hook
|
|
965
|
-
│ ├── models/ #
|
|
966
|
-
│ │ └── types.ts # Card, CommandResult, WorkerStatus
|
|
967
|
-
│ └── providers/ #
|
|
968
|
-
│ ├── registry.ts # Provider
|
|
975
|
+
│ │ ├── pm-client.ts # Lightweight PM operations (Plane/Trello/Markdown)
|
|
976
|
+
│ │ ├── resource-limiter.ts # Global worker count cap + memory checks
|
|
977
|
+
│ │ └── recovery.ts # Post-restart PID scan recovery
|
|
978
|
+
│ ├── interfaces/ # Abstract interfaces
|
|
979
|
+
│ │ ├── TaskBackend.ts # PM backend interface
|
|
980
|
+
│ │ ├── WorkerProvider.ts # Worker interface
|
|
981
|
+
│ │ ├── RepoBackend.ts # Code repository interface
|
|
982
|
+
│ │ ├── Notifier.ts # Notification interface
|
|
983
|
+
│ │ └── HookProvider.ts # Hook interface
|
|
984
|
+
│ ├── models/ # Type definitions
|
|
985
|
+
│ │ └── types.ts # Card, CommandResult, WorkerStatus, etc.
|
|
986
|
+
│ └── providers/ # Concrete implementations
|
|
987
|
+
│ ├── registry.ts # Provider factory (routes by WORKER_MODE x WORKER_TOOL)
|
|
969
988
|
│ ├── PlaneTaskBackend.ts
|
|
970
989
|
│ ├── TrelloTaskBackend.ts
|
|
971
990
|
│ ├── MarkdownTaskBackend.ts
|
|
972
|
-
│ ├── ClaudePrintProvider.ts # claude -p
|
|
973
|
-
│ ├── CodexExecProvider.ts # codex exec
|
|
974
|
-
│ ├── ClaudeTmuxProvider.ts # tmux
|
|
975
|
-
│ ├── CodexTmuxProvider.ts # tmux
|
|
976
|
-
│ ├── outputParser.ts # JSONL
|
|
977
|
-
│ ├── streamRenderer.ts # JSONL
|
|
991
|
+
│ ├── ClaudePrintProvider.ts # claude -p one-shot execution (default)
|
|
992
|
+
│ ├── CodexExecProvider.ts # codex exec one-shot execution (default)
|
|
993
|
+
│ ├── ClaudeTmuxProvider.ts # tmux interactive mode (fallback)
|
|
994
|
+
│ ├── CodexTmuxProvider.ts # tmux interactive mode (fallback)
|
|
995
|
+
│ ├── outputParser.ts # JSONL output parsing, process management utilities
|
|
996
|
+
│ ├── streamRenderer.ts # JSONL -> human-readable text (for Dashboard)
|
|
978
997
|
│ ├── GitLabRepoBackend.ts
|
|
979
998
|
│ └── MatrixNotifier.ts
|
|
980
999
|
├── package.json
|
|
@@ -983,50 +1002,50 @@ workflow-cli/
|
|
|
983
1002
|
|
|
984
1003
|
---
|
|
985
1004
|
|
|
986
|
-
## Manager
|
|
1005
|
+
## Manager Module (v0.16.0)
|
|
987
1006
|
|
|
988
|
-
v0.16.0
|
|
1007
|
+
v0.16.0 introduced the `src/manager/` directory, decoupling Worker process management from Engines into independent modules that run as internal tick modules (not standalone daemons).
|
|
989
1008
|
|
|
990
|
-
|
|
|
991
|
-
|
|
992
|
-
| `supervisor.ts` | 288 | fd
|
|
993
|
-
| `completion-judge.ts` | 110 | git
|
|
994
|
-
| `post-actions.ts` | 412 | Worker
|
|
995
|
-
| `pm-client.ts` | 294 |
|
|
996
|
-
| `resource-limiter.ts` | 103 |
|
|
997
|
-
| `recovery.ts` | 205 | tick
|
|
1009
|
+
| Module | Lines | Responsibility |
|
|
1010
|
+
|--------|-------|---------------|
|
|
1011
|
+
| `supervisor.ts` | 288 | fd-redirected spawn (OS-level guaranteed output writing), holds child handle, exit callback triggers post-processing, three-layer env var merging (system -> global credentials -> project config) |
|
|
1012
|
+
| `completion-judge.ts` | 110 | git output checks (branch pushed/merged), auto-push, marker file detection, completion keyword matching |
|
|
1013
|
+
| `post-actions.ts` | 412 | Complete post-Worker-exit chain: merge -> PM state update -> slot release -> notify |
|
|
1014
|
+
| `pm-client.ts` | 294 | Lightweight PM operation wrapper, supports Plane/Trello/Markdown backends |
|
|
1015
|
+
| `resource-limiter.ts` | 103 | Global worker count cap check + memory check + launch interval control |
|
|
1016
|
+
| `recovery.ts` | 205 | Post-tick-restart PID scan to recover orphan worker processes |
|
|
998
1017
|
|
|
999
|
-
|
|
1000
|
-
- ExecutionEngine
|
|
1001
|
-
- MonitorEngine
|
|
1002
|
-
- tick.ts
|
|
1018
|
+
**Refactoring results:**
|
|
1019
|
+
- ExecutionEngine reduced from 1219 to 916 lines (removed attemptResume, completeAndRelease)
|
|
1020
|
+
- MonitorEngine reduced from 974 to 750 lines (removed direct PID/tmux detection)
|
|
1021
|
+
- tick.ts added ~80 lines (initialize shared Manager modules, run Recovery on startup)
|
|
1003
1022
|
|
|
1004
1023
|
---
|
|
1005
1024
|
|
|
1006
|
-
##
|
|
1025
|
+
## Label-Driven Skill Injection (v0.16.0)
|
|
1007
1026
|
|
|
1008
|
-
|
|
1027
|
+
Worker expertise is injected via PM card labels, allowing customization of Worker behavior for different tasks without code changes.
|
|
1009
1028
|
|
|
1010
|
-
|
|
1011
|
-
-
|
|
1012
|
-
-
|
|
1013
|
-
-
|
|
1029
|
+
**Mechanism:**
|
|
1030
|
+
- Adding a `skill:xxx` label to a PM card -> automatically loads `~/.coral/profiles/xxx.md` into the Worker prompt
|
|
1031
|
+
- Multiple `skill:` labels can be stacked for combined injection
|
|
1032
|
+
- Projects can configure default skills via `DEFAULT_WORKER_SKILLS`; card labels override project defaults
|
|
1014
1033
|
|
|
1015
|
-
**Prompt
|
|
1016
|
-
1. Skill Profiles
|
|
1017
|
-
2. Project Rules
|
|
1018
|
-
3. Project Knowledge
|
|
1019
|
-
4. Task
|
|
1034
|
+
**Prompt assembly order:**
|
|
1035
|
+
1. Skill Profiles (skill templates)
|
|
1036
|
+
2. Project Rules (CLAUDE.md / AGENTS.md)
|
|
1037
|
+
3. Project Knowledge (docs/DECISIONS.md, docs/CHANGELOG.md)
|
|
1038
|
+
4. Task (.sps/task_prompt.txt)
|
|
1020
1039
|
|
|
1021
|
-
|
|
1040
|
+
**Built-in skill templates:**
|
|
1022
1041
|
|
|
1023
|
-
|
|
|
1024
|
-
|
|
1025
|
-
|
|
|
1026
|
-
|
|
|
1027
|
-
|
|
|
1042
|
+
| File | Purpose |
|
|
1043
|
+
|------|---------|
|
|
1044
|
+
| `~/.coral/profiles/_template.md` | Template for creating new skills |
|
|
1045
|
+
| `~/.coral/profiles/typescript.md` | TypeScript project coding standards |
|
|
1046
|
+
| `~/.coral/profiles/phaser.md` | Phaser game framework development guide |
|
|
1028
1047
|
|
|
1029
|
-
|
|
1048
|
+
**Adding new skills requires zero code:** Simply create an md file in `~/.coral/profiles/` directory, then add the corresponding `skill:xxx` label to the PM card.
|
|
1030
1049
|
|
|
1031
1050
|
---
|
|
1032
1051
|
|