@coralai/sps-cli 0.17.2 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +520 -492
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +12 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +135 -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/commands/tick.js +8 -0
- package/dist/commands/tick.js.map +1 -1
- package/dist/core/context.d.ts +7 -2
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +11 -0
- package/dist/core/context.js.map +1 -1
- package/dist/engines/ExecutionEngine.d.ts.map +1 -1
- package/dist/engines/ExecutionEngine.js +2 -4
- package/dist/engines/ExecutionEngine.js.map +1 -1
- package/dist/main.js +7 -0
- package/dist/main.js.map +1 -1
- package/dist/providers/CodexExecProvider.d.ts.map +1 -1
- package/dist/providers/CodexExecProvider.js +2 -0
- package/dist/providers/CodexExecProvider.js.map +1 -1
- package/package.json +2 -1
- package/profiles/_template.md +48 -0
- package/profiles/architect.md +139 -0
- package/profiles/backend.md +163 -0
- package/profiles/frontend.md +122 -0
- package/profiles/fullstack.md +179 -0
- package/profiles/optimizer.md +151 -0
- package/profiles/phaser.md +109 -0
- package/profiles/prototyper.md +171 -0
- package/profiles/reviewer.md +122 -0
- package/profiles/security.md +154 -0
- package/profiles/senior.md +155 -0
- package/profiles/typescript.md +65 -0
- package/profiles/writer.md +201 -0
package/README.md
CHANGED
|
@@ -1,272 +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
|
+
[中文文档](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
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
241
|
-
|
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
|
|
251
|
-
|
|
|
252
|
-
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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:**
|
|
258
268
|
|
|
259
269
|
```bash
|
|
260
|
-
#
|
|
270
|
+
# Check + auto-fix
|
|
261
271
|
sps doctor my-project --fix
|
|
262
|
-
#
|
|
263
|
-
#
|
|
264
|
-
#
|
|
265
|
-
#
|
|
266
|
-
#
|
|
267
|
-
#
|
|
268
|
-
|
|
269
|
-
#
|
|
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
|
|
270
284
|
sps doctor my-project --json
|
|
271
285
|
```
|
|
272
286
|
|
|
@@ -274,112 +288,112 @@ sps doctor my-project --json
|
|
|
274
288
|
|
|
275
289
|
### sps card add
|
|
276
290
|
|
|
277
|
-
|
|
291
|
+
Create a task card.
|
|
278
292
|
|
|
279
293
|
```bash
|
|
280
294
|
sps card add <project> "<title>" ["description"]
|
|
281
295
|
```
|
|
282
296
|
|
|
283
|
-
|
|
297
|
+
Cards are created in the Planning state, automatically tagged with `AI-PIPELINE`, and appended to `pipeline_order.json`.
|
|
284
298
|
|
|
285
|
-
|
|
299
|
+
After creation, add a `skill:` label to specify the Worker's expertise (see label descriptions below).
|
|
286
300
|
|
|
287
|
-
|
|
|
288
|
-
|
|
289
|
-
| `--json` |
|
|
301
|
+
| Option | Description |
|
|
302
|
+
|--------|-------------|
|
|
303
|
+
| `--json` | Output creation result in JSON format |
|
|
290
304
|
|
|
291
|
-
|
|
305
|
+
**Example:**
|
|
292
306
|
|
|
293
307
|
```bash
|
|
294
|
-
#
|
|
295
|
-
sps card add my-project "
|
|
308
|
+
# Create cards + add skill labels
|
|
309
|
+
sps card add my-project "Implement user login" "JWT authentication endpoint"
|
|
296
310
|
sps pm addLabel my-project 1 "skill:backend"
|
|
297
311
|
|
|
298
|
-
sps card add my-project "
|
|
312
|
+
sps card add my-project "Implement order list" "CRUD API + pagination"
|
|
299
313
|
sps pm addLabel my-project 2 "skill:backend"
|
|
300
314
|
|
|
301
|
-
sps card add my-project "
|
|
315
|
+
sps card add my-project "Write API documentation" "User and order endpoint docs"
|
|
302
316
|
sps pm addLabel my-project 3 "skill:writer"
|
|
303
317
|
```
|
|
304
318
|
|
|
305
|
-
#### Skill
|
|
319
|
+
#### Skill Labels
|
|
306
320
|
|
|
307
|
-
|
|
321
|
+
Each card should have **one** `skill:` label. The Pipeline automatically loads the corresponding Worker skill profile and injects it into the prompt:
|
|
308
322
|
|
|
309
|
-
|
|
|
310
|
-
|
|
311
|
-
| `skill:architect` |
|
|
312
|
-
| `skill:frontend` |
|
|
313
|
-
| `skill:backend` |
|
|
314
|
-
| `skill:fullstack` |
|
|
315
|
-
| `skill:prototyper` |
|
|
316
|
-
| `skill:reviewer` |
|
|
317
|
-
| `skill:security` |
|
|
318
|
-
| `skill:writer` |
|
|
319
|
-
| `skill:optimizer` |
|
|
320
|
-
| `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 |
|
|
321
335
|
|
|
322
|
-
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`.
|
|
323
337
|
|
|
324
338
|
---
|
|
325
339
|
|
|
326
340
|
### sps tick
|
|
327
341
|
|
|
328
|
-
|
|
342
|
+
Unified main loop -- orchestrates all engines, executing scheduler -> qa -> pipeline -> monitor in sequence.
|
|
329
343
|
|
|
330
344
|
```bash
|
|
331
345
|
sps tick <project> [project2] [project3] ... [--once] [--json] [--dry-run]
|
|
332
346
|
```
|
|
333
347
|
|
|
334
|
-
|
|
348
|
+
**Execution order (per tick cycle):**
|
|
335
349
|
|
|
336
|
-
1. **scheduler tick**
|
|
337
|
-
2. **qa tick**
|
|
338
|
-
3. **pipeline tick**
|
|
339
|
-
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
|
|
340
354
|
|
|
341
|
-
|
|
355
|
+
**Run modes:**
|
|
342
356
|
|
|
343
|
-
|
|
|
344
|
-
|
|
345
|
-
|
|
|
346
|
-
|
|
|
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 |
|
|
347
361
|
|
|
348
|
-
|
|
362
|
+
**Concurrency mutex:**
|
|
349
363
|
|
|
350
|
-
|
|
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.
|
|
351
365
|
|
|
352
|
-
|
|
366
|
+
**Failure classification:**
|
|
353
367
|
|
|
354
|
-
|
|
|
355
|
-
|
|
356
|
-
|
|
|
357
|
-
|
|
|
358
|
-
|
|
|
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 |
|
|
359
373
|
|
|
360
|
-
|
|
|
361
|
-
|
|
362
|
-
| `--once` |
|
|
363
|
-
| `--json` |
|
|
364
|
-
| `--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 |
|
|
365
379
|
|
|
366
|
-
|
|
380
|
+
**Example:**
|
|
367
381
|
|
|
368
382
|
```bash
|
|
369
|
-
#
|
|
383
|
+
# Single project continuous run
|
|
370
384
|
sps tick my-project
|
|
371
385
|
|
|
372
|
-
#
|
|
386
|
+
# Multi-project simultaneous management
|
|
373
387
|
sps tick project-a project-b project-c
|
|
374
388
|
|
|
375
|
-
#
|
|
389
|
+
# Single execution + JSON output (suitable for cron)
|
|
376
390
|
sps tick my-project --once --json
|
|
377
391
|
|
|
378
|
-
#
|
|
392
|
+
# Preview mode
|
|
379
393
|
sps tick my-project --once --dry-run
|
|
380
394
|
```
|
|
381
395
|
|
|
382
|
-
**JSON
|
|
396
|
+
**JSON output format:**
|
|
383
397
|
|
|
384
398
|
```json
|
|
385
399
|
{
|
|
@@ -388,29 +402,43 @@ sps tick my-project --once --dry-run
|
|
|
388
402
|
"status": "ok",
|
|
389
403
|
"exitCode": 0,
|
|
390
404
|
"steps": [
|
|
391
|
-
{ "step": "scheduler", "status": "ok", "actions": [...] },
|
|
392
|
-
{ "step": "qa", "status": "ok", "actions": [...] },
|
|
393
|
-
{ "step": "pipeline", "status": "ok", "actions": [...] },
|
|
394
|
-
{ "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": ["..."] }
|
|
395
409
|
]
|
|
396
410
|
}
|
|
397
411
|
```
|
|
398
412
|
|
|
399
413
|
---
|
|
400
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
|
+
|
|
401
429
|
### sps scheduler tick
|
|
402
430
|
|
|
403
|
-
|
|
431
|
+
Manually execute the scheduling step: Planning -> Backlog.
|
|
404
432
|
|
|
405
433
|
```bash
|
|
406
434
|
sps scheduler tick <project> [--json] [--dry-run]
|
|
407
435
|
```
|
|
408
436
|
|
|
409
|
-
-
|
|
410
|
-
-
|
|
411
|
-
-
|
|
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
|
|
412
440
|
|
|
413
|
-
|
|
441
|
+
**Example:**
|
|
414
442
|
|
|
415
443
|
```bash
|
|
416
444
|
sps scheduler tick my-project
|
|
@@ -421,23 +449,23 @@ sps scheduler tick my-project --dry-run
|
|
|
421
449
|
|
|
422
450
|
### sps pipeline tick
|
|
423
451
|
|
|
424
|
-
|
|
452
|
+
Manually execute the execution chain: Backlog -> Todo -> Inprogress.
|
|
425
453
|
|
|
426
454
|
```bash
|
|
427
455
|
sps pipeline tick <project> [--json] [--dry-run]
|
|
428
456
|
```
|
|
429
457
|
|
|
430
|
-
|
|
458
|
+
**Internal steps:**
|
|
431
459
|
|
|
432
|
-
1.
|
|
433
|
-
2.
|
|
434
|
-
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
|
|
435
463
|
|
|
436
|
-
|
|
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).
|
|
437
465
|
|
|
438
|
-
|
|
466
|
+
Cards with `BLOCKED`, `NEEDS-FIX`, `CONFLICT`, `WAITING-CONFIRMATION`, or `STALE-RUNTIME` labels are skipped.
|
|
439
467
|
|
|
440
|
-
|
|
468
|
+
**Example:**
|
|
441
469
|
|
|
442
470
|
```bash
|
|
443
471
|
sps pipeline tick my-project
|
|
@@ -448,68 +476,68 @@ sps pipeline tick my-project --json
|
|
|
448
476
|
|
|
449
477
|
### sps worker
|
|
450
478
|
|
|
451
|
-
Worker
|
|
479
|
+
Worker lifecycle management.
|
|
452
480
|
|
|
453
481
|
#### sps worker launch
|
|
454
482
|
|
|
455
|
-
|
|
483
|
+
Manually launch a single Worker.
|
|
456
484
|
|
|
457
485
|
```bash
|
|
458
486
|
sps worker launch <project> <seq> [--json] [--dry-run]
|
|
459
487
|
```
|
|
460
488
|
|
|
461
|
-
|
|
489
|
+
If the card is in Backlog state, it will automatically execute prepare first (create branch + worktree), then launch the Worker.
|
|
462
490
|
|
|
463
|
-
|
|
491
|
+
**Launch process:**
|
|
464
492
|
|
|
465
|
-
1.
|
|
466
|
-
2.
|
|
467
|
-
3.
|
|
468
|
-
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
|
|
469
497
|
|
|
470
|
-
**Worker
|
|
498
|
+
**Worker execution modes (`WORKER_MODE`):**
|
|
471
499
|
|
|
472
|
-
|
|
|
473
|
-
|
|
474
|
-
| `print` |
|
|
475
|
-
| `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) |
|
|
476
504
|
|
|
477
|
-
**Print
|
|
505
|
+
**Print mode (recommended):**
|
|
478
506
|
|
|
479
|
-
Worker
|
|
507
|
+
The Worker runs as a subprocess, prompt is passed via stdin, output is written to a JSONL file:
|
|
480
508
|
|
|
481
509
|
```
|
|
482
510
|
Claude: claude -p --output-format stream-json --dangerously-skip-permissions
|
|
483
511
|
Codex: codex exec - --json --dangerously-bypass-approvals-and-sandbox
|
|
484
512
|
```
|
|
485
513
|
|
|
486
|
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
489
|
-
-
|
|
490
|
-
-
|
|
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
|
|
491
519
|
|
|
492
|
-
**Session Resume
|
|
520
|
+
**Session Resume chain:**
|
|
493
521
|
|
|
494
|
-
|
|
522
|
+
Multiple tasks on the same worktree (initial implementation -> CI fix -> conflict resolution) share the same session:
|
|
495
523
|
|
|
496
524
|
```
|
|
497
|
-
|
|
498
|
-
CI
|
|
499
|
-
|
|
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
|
|
500
528
|
```
|
|
501
529
|
|
|
502
|
-
**Interactive
|
|
530
|
+
**Interactive mode (fallback):**
|
|
503
531
|
|
|
504
|
-
|
|
532
|
+
Set `WORKER_MODE=interactive` to fall back to tmux interactive mode. Reuse strategy in this mode:
|
|
505
533
|
|
|
506
|
-
|
|
|
507
|
-
|
|
508
|
-
| Session
|
|
509
|
-
| Session
|
|
510
|
-
|
|
|
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 |
|
|
511
539
|
|
|
512
|
-
|
|
540
|
+
**Example:**
|
|
513
541
|
|
|
514
542
|
```bash
|
|
515
543
|
sps worker launch my-project 24
|
|
@@ -518,43 +546,43 @@ sps worker launch my-project 24 --dry-run
|
|
|
518
546
|
|
|
519
547
|
#### sps worker dashboard
|
|
520
548
|
|
|
521
|
-
|
|
549
|
+
Real-time dashboard for monitoring all Worker running states.
|
|
522
550
|
|
|
523
551
|
```bash
|
|
524
552
|
sps worker dashboard [project1] [project2] ... [--once] [--json]
|
|
525
553
|
```
|
|
526
554
|
|
|
527
|
-
|
|
|
528
|
-
|
|
529
|
-
|
|
|
530
|
-
| `--once` |
|
|
531
|
-
| `--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) |
|
|
532
560
|
|
|
533
|
-
|
|
561
|
+
**Real-time mode:**
|
|
534
562
|
|
|
535
|
-
-
|
|
536
|
-
-
|
|
537
|
-
-
|
|
538
|
-
-
|
|
539
|
-
- Print
|
|
540
|
-
- 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
|
|
541
569
|
|
|
542
|
-
|
|
570
|
+
**Example:**
|
|
543
571
|
|
|
544
572
|
```bash
|
|
545
|
-
#
|
|
573
|
+
# Monitor all projects
|
|
546
574
|
sps worker dashboard
|
|
547
575
|
|
|
548
|
-
#
|
|
576
|
+
# Monitor specific projects
|
|
549
577
|
sps worker dashboard my-project
|
|
550
578
|
|
|
551
|
-
#
|
|
579
|
+
# Single snapshot
|
|
552
580
|
sps worker dashboard --once
|
|
553
581
|
|
|
554
|
-
# JSON
|
|
582
|
+
# JSON output (for script consumption)
|
|
555
583
|
sps worker dashboard --json
|
|
556
584
|
|
|
557
|
-
#
|
|
585
|
+
# Custom refresh interval
|
|
558
586
|
SPS_DASHBOARD_INTERVAL=5000 sps worker dashboard
|
|
559
587
|
```
|
|
560
588
|
|
|
@@ -562,38 +590,38 @@ SPS_DASHBOARD_INTERVAL=5000 sps worker dashboard
|
|
|
562
590
|
|
|
563
591
|
### sps pm
|
|
564
592
|
|
|
565
|
-
PM
|
|
593
|
+
PM backend operations.
|
|
566
594
|
|
|
567
595
|
#### sps pm scan
|
|
568
596
|
|
|
569
|
-
|
|
597
|
+
View card list.
|
|
570
598
|
|
|
571
599
|
```bash
|
|
572
600
|
sps pm scan <project> [state]
|
|
573
601
|
```
|
|
574
602
|
|
|
575
|
-
|
|
603
|
+
Lists all cards when `state` is not specified.
|
|
576
604
|
|
|
577
|
-
|
|
605
|
+
**Example:**
|
|
578
606
|
|
|
579
607
|
```bash
|
|
580
|
-
#
|
|
608
|
+
# View all cards
|
|
581
609
|
sps pm scan my-project
|
|
582
610
|
|
|
583
|
-
#
|
|
611
|
+
# Filter by state
|
|
584
612
|
sps pm scan my-project Inprogress
|
|
585
613
|
sps pm scan my-project Planning
|
|
586
614
|
```
|
|
587
615
|
|
|
588
616
|
#### sps pm move
|
|
589
617
|
|
|
590
|
-
|
|
618
|
+
Manually move a card's state.
|
|
591
619
|
|
|
592
620
|
```bash
|
|
593
621
|
sps pm move <project> <seq> <state>
|
|
594
622
|
```
|
|
595
623
|
|
|
596
|
-
|
|
624
|
+
**Example:**
|
|
597
625
|
|
|
598
626
|
```bash
|
|
599
627
|
sps pm move my-project 24 QA
|
|
@@ -602,38 +630,38 @@ sps pm move my-project 25 Done
|
|
|
602
630
|
|
|
603
631
|
#### sps pm comment
|
|
604
632
|
|
|
605
|
-
|
|
633
|
+
Add a comment to a card.
|
|
606
634
|
|
|
607
635
|
```bash
|
|
608
636
|
sps pm comment <project> <seq> "<text>"
|
|
609
637
|
```
|
|
610
638
|
|
|
611
|
-
|
|
639
|
+
**Example:**
|
|
612
640
|
|
|
613
641
|
```bash
|
|
614
|
-
sps pm comment my-project 24 "CI
|
|
642
|
+
sps pm comment my-project 24 "CI passed, awaiting review"
|
|
615
643
|
```
|
|
616
644
|
|
|
617
645
|
#### sps pm checklist
|
|
618
646
|
|
|
619
|
-
|
|
647
|
+
Manage card checklists.
|
|
620
648
|
|
|
621
649
|
```bash
|
|
622
|
-
#
|
|
650
|
+
# Create checklist
|
|
623
651
|
sps pm checklist create <project> <seq> "item1" "item2" "item3"
|
|
624
652
|
|
|
625
|
-
#
|
|
653
|
+
# View checklist
|
|
626
654
|
sps pm checklist list <project> <seq>
|
|
627
655
|
|
|
628
|
-
#
|
|
656
|
+
# Check/uncheck items
|
|
629
657
|
sps pm checklist check <project> <seq> <item-id>
|
|
630
658
|
sps pm checklist uncheck <project> <seq> <item-id>
|
|
631
659
|
```
|
|
632
660
|
|
|
633
|
-
|
|
661
|
+
**Example:**
|
|
634
662
|
|
|
635
663
|
```bash
|
|
636
|
-
sps pm checklist create my-project 24 "
|
|
664
|
+
sps pm checklist create my-project 24 "Unit tests" "Integration tests" "Code review"
|
|
637
665
|
sps pm checklist list my-project 24
|
|
638
666
|
sps pm checklist check my-project 24 item-001
|
|
639
667
|
```
|
|
@@ -642,27 +670,27 @@ sps pm checklist check my-project 24 item-001
|
|
|
642
670
|
|
|
643
671
|
### sps qa tick
|
|
644
672
|
|
|
645
|
-
QA
|
|
673
|
+
QA close-out and worktree cleanup.
|
|
646
674
|
|
|
647
675
|
```bash
|
|
648
676
|
sps qa tick <project> [--json]
|
|
649
677
|
```
|
|
650
678
|
|
|
651
|
-
**MR_MODE=none
|
|
679
|
+
**When MR_MODE=none:** The QA phase primarily handles worktree cleanup. After Worker completion, the ExecutionEngine pushes directly to Done.
|
|
652
680
|
|
|
653
|
-
**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`).
|
|
654
682
|
|
|
655
|
-
**
|
|
683
|
+
**Automatic worktree cleanup:**
|
|
656
684
|
|
|
657
|
-
|
|
685
|
+
After each qa tick cycle, items in the `state.worktreeCleanup` queue are automatically processed:
|
|
658
686
|
|
|
659
|
-
1. `git worktree remove --force <path>`
|
|
660
|
-
2. `git branch -d <branch>`
|
|
661
|
-
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
|
|
662
690
|
|
|
663
|
-
|
|
691
|
+
Failed cleanup entries remain in the queue and are automatically retried in the next tick cycle.
|
|
664
692
|
|
|
665
|
-
|
|
693
|
+
**Example:**
|
|
666
694
|
|
|
667
695
|
```bash
|
|
668
696
|
sps qa tick my-project
|
|
@@ -673,23 +701,23 @@ sps qa tick my-project --json
|
|
|
673
701
|
|
|
674
702
|
### sps monitor tick
|
|
675
703
|
|
|
676
|
-
|
|
704
|
+
Manually execute anomaly detection and health inspection.
|
|
677
705
|
|
|
678
706
|
```bash
|
|
679
707
|
sps monitor tick <project> [--json]
|
|
680
708
|
```
|
|
681
709
|
|
|
682
|
-
|
|
710
|
+
**Inspection items:**
|
|
683
711
|
|
|
684
|
-
|
|
|
685
|
-
|
|
686
|
-
|
|
|
687
|
-
|
|
|
688
|
-
|
|
|
689
|
-
|
|
|
690
|
-
|
|
|
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 |
|
|
691
719
|
|
|
692
|
-
|
|
720
|
+
**Example:**
|
|
693
721
|
|
|
694
722
|
```bash
|
|
695
723
|
sps monitor tick my-project
|
|
@@ -698,130 +726,130 @@ sps monitor tick my-project --json
|
|
|
698
726
|
|
|
699
727
|
---
|
|
700
728
|
|
|
701
|
-
## Worker
|
|
729
|
+
## Worker Rule Files
|
|
702
730
|
|
|
703
|
-
`sps doctor --fix`
|
|
731
|
+
`sps doctor --fix` generates the following files in the project repository root and auto-commits them:
|
|
704
732
|
|
|
705
|
-
|
|
|
706
|
-
|
|
707
|
-
| `CLAUDE.md` | Claude Code Worker
|
|
708
|
-
| `AGENTS.md` | Codex Worker
|
|
709
|
-
| `.sps/task_prompt.txt` |
|
|
710
|
-
| `.sps/merge.sh` |
|
|
711
|
-
| `docs/DECISIONS.md` |
|
|
712
|
-
| `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) |
|
|
713
741
|
|
|
714
|
-
**Skill Profile
|
|
742
|
+
**Skill Profile injection (v0.16+):**
|
|
715
743
|
|
|
716
|
-
|
|
|
717
|
-
|
|
718
|
-
|
|
|
744
|
+
| File | Purpose |
|
|
745
|
+
|------|---------|
|
|
746
|
+
| `~/.coral/profiles/<name>.md` | Loaded into Worker prompt via `skill:<name>` label |
|
|
719
747
|
|
|
720
|
-
Prompt
|
|
748
|
+
Prompt assembly order: Skill Profile -> CLAUDE.md/AGENTS.md -> DECISIONS.md/CHANGELOG.md -> Task description
|
|
721
749
|
|
|
722
|
-
###
|
|
750
|
+
### How It Works
|
|
723
751
|
|
|
724
|
-
1. `CLAUDE.md`
|
|
725
|
-
2.
|
|
726
|
-
3. Worker
|
|
727
|
-
4.
|
|
728
|
-
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
|
|
729
757
|
|
|
730
|
-
###
|
|
758
|
+
### Project Knowledge Base
|
|
731
759
|
|
|
732
|
-
|
|
760
|
+
Each Worker is instructed in the task prompt to:
|
|
733
761
|
|
|
734
|
-
-
|
|
735
|
-
-
|
|
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`
|
|
736
764
|
|
|
737
|
-
|
|
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.
|
|
738
766
|
|
|
739
|
-
###
|
|
767
|
+
### Customizing Project Rules
|
|
740
768
|
|
|
741
|
-
|
|
769
|
+
The generated CLAUDE.md includes a "Project-Specific Rules" placeholder section where you can add:
|
|
742
770
|
|
|
743
771
|
```markdown
|
|
744
772
|
## Project-Specific Rules
|
|
745
|
-
-
|
|
746
|
-
-
|
|
747
|
-
-
|
|
748
|
-
- 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
|
|
749
777
|
```
|
|
750
778
|
|
|
751
|
-
SPS
|
|
779
|
+
SPS will not overwrite existing CLAUDE.md / AGENTS.md files.
|
|
752
780
|
|
|
753
781
|
---
|
|
754
782
|
|
|
755
|
-
##
|
|
783
|
+
## Project Configuration
|
|
756
784
|
|
|
757
|
-
|
|
785
|
+
Configuration is split into two layers:
|
|
758
786
|
|
|
759
|
-
|
|
|
760
|
-
|
|
761
|
-
| `~/.coral/env` |
|
|
762
|
-
| `~/.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.) |
|
|
763
791
|
|
|
764
|
-
|
|
792
|
+
Project conf can reference global variables (e.g., `${PLANE_URL}`).
|
|
765
793
|
|
|
766
|
-
###
|
|
794
|
+
### Configuration Field Reference
|
|
767
795
|
|
|
768
|
-
####
|
|
796
|
+
#### Project Basics
|
|
769
797
|
|
|
770
|
-
|
|
|
771
|
-
|
|
772
|
-
| `PROJECT_NAME` |
|
|
773
|
-
| `PROJECT_DISPLAY` |
|
|
774
|
-
| `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 |
|
|
775
803
|
|
|
776
804
|
#### GitLab
|
|
777
805
|
|
|
778
|
-
|
|
|
779
|
-
|
|
780
|
-
| `GITLAB_PROJECT` |
|
|
781
|
-
| `GITLAB_PROJECT_ID` |
|
|
782
|
-
| `GITLAB_MERGE_BRANCH` |
|
|
783
|
-
| `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 |
|
|
784
812
|
|
|
785
|
-
#### PM
|
|
813
|
+
#### PM Backend
|
|
786
814
|
|
|
787
|
-
|
|
|
788
|
-
|
|
789
|
-
| `PM_TOOL` |
|
|
790
|
-
| `PIPELINE_LABEL` |
|
|
791
|
-
| `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) |
|
|
792
820
|
|
|
793
821
|
#### Worker
|
|
794
822
|
|
|
795
|
-
|
|
|
796
|
-
|
|
797
|
-
| `WORKER_TOOL` |
|
|
798
|
-
| `WORKER_MODE` |
|
|
799
|
-
| `MAX_CONCURRENT_WORKERS` |
|
|
800
|
-
| `WORKER_RESTART_LIMIT` |
|
|
801
|
-
| `AUTOFIX_ATTEMPTS` |
|
|
802
|
-
| `WORKER_SESSION_REUSE` |
|
|
803
|
-
| `MAX_ACTIONS_PER_TICK` |
|
|
804
|
-
|
|
805
|
-
####
|
|
806
|
-
|
|
807
|
-
|
|
|
808
|
-
|
|
809
|
-
| `INPROGRESS_TIMEOUT_HOURS` |
|
|
810
|
-
| `MONITOR_AUTO_QA` |
|
|
811
|
-
| `CONFLICT_DEFAULT` |
|
|
812
|
-
| `TICK_LOCK_TIMEOUT_MINUTES` |
|
|
813
|
-
| `NEEDS_FIX_MAX_RETRIES` |
|
|
814
|
-
| `WORKTREE_RETAIN_HOURS` |
|
|
815
|
-
|
|
816
|
-
####
|
|
817
|
-
|
|
818
|
-
|
|
|
819
|
-
|
|
820
|
-
| `WORKTREE_DIR` |
|
|
821
|
-
| `DEPLOY_ENABLED` |
|
|
822
|
-
| `DEPLOY_SCRIPT` |
|
|
823
|
-
|
|
824
|
-
###
|
|
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
|
|
825
853
|
|
|
826
854
|
```bash
|
|
827
855
|
# ~/.coral/projects/my-project/conf
|
|
@@ -835,86 +863,86 @@ GITLAB_PROJECT="team/my-project"
|
|
|
835
863
|
GITLAB_PROJECT_ID="42"
|
|
836
864
|
GITLAB_MERGE_BRANCH="develop"
|
|
837
865
|
|
|
838
|
-
# PM
|
|
866
|
+
# PM (uses variables from global ~/.coral/env)
|
|
839
867
|
PM_TOOL="plane"
|
|
840
868
|
PLANE_API_URL="${PLANE_URL}"
|
|
841
869
|
PLANE_PROJECT_ID="project-uuid-here"
|
|
842
870
|
|
|
843
871
|
# Worker
|
|
844
872
|
WORKER_TOOL="claude"
|
|
845
|
-
WORKER_MODE="print" # print
|
|
873
|
+
WORKER_MODE="print" # print (recommended) or interactive (tmux fallback)
|
|
846
874
|
MAX_CONCURRENT_WORKERS=3
|
|
847
875
|
MAX_ACTIONS_PER_TICK=1
|
|
848
876
|
|
|
849
|
-
#
|
|
850
|
-
MR_MODE="none" # none
|
|
877
|
+
# Merge mode
|
|
878
|
+
MR_MODE="none" # none (direct merge) or create (create MR)
|
|
851
879
|
```
|
|
852
880
|
|
|
853
881
|
---
|
|
854
882
|
|
|
855
|
-
##
|
|
883
|
+
## Multi-Project Parallel Execution
|
|
856
884
|
|
|
857
|
-
SPS
|
|
885
|
+
SPS supports managing multiple projects simultaneously in a single process:
|
|
858
886
|
|
|
859
887
|
```bash
|
|
860
888
|
sps tick project-a project-b project-c
|
|
861
889
|
```
|
|
862
890
|
|
|
863
|
-
|
|
864
|
-
-
|
|
865
|
-
-
|
|
866
|
-
-
|
|
867
|
-
-
|
|
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
|
|
868
896
|
|
|
869
|
-
|
|
897
|
+
Multi-Worker parallel configuration:
|
|
870
898
|
|
|
871
899
|
```bash
|
|
872
|
-
#
|
|
900
|
+
# Set in project conf
|
|
873
901
|
MAX_CONCURRENT_WORKERS=3
|
|
874
902
|
CONFLICT_DEFAULT=parallel
|
|
875
903
|
```
|
|
876
904
|
|
|
877
905
|
---
|
|
878
906
|
|
|
879
|
-
##
|
|
907
|
+
## Architecture Overview
|
|
880
908
|
|
|
881
|
-
###
|
|
909
|
+
### Four-Layer Architecture
|
|
882
910
|
|
|
883
911
|
```
|
|
884
|
-
Layer 3 Commands + Engines CLI
|
|
885
|
-
Layer 2 Providers
|
|
886
|
-
Layer 1 Interfaces
|
|
887
|
-
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
|
|
888
916
|
```
|
|
889
917
|
|
|
890
|
-
###
|
|
918
|
+
### Supported Backends
|
|
891
919
|
|
|
892
|
-
|
|
|
893
|
-
|
|
894
|
-
| PM
|
|
895
|
-
|
|
|
920
|
+
| Type | Provider | Interface |
|
|
921
|
+
|------|----------|-----------|
|
|
922
|
+
| PM Backend | Plane CE / Trello / Markdown | TaskBackend |
|
|
923
|
+
| Code Hosting | GitLab | RepoBackend |
|
|
896
924
|
| AI Worker (print) | ClaudePrintProvider / CodexExecProvider | WorkerProvider |
|
|
897
925
|
| AI Worker (interactive) | ClaudeTmuxProvider / CodexTmuxProvider | WorkerProvider |
|
|
898
|
-
|
|
|
926
|
+
| Notifications | Matrix | Notifier |
|
|
899
927
|
|
|
900
|
-
###
|
|
928
|
+
### Engines
|
|
901
929
|
|
|
902
|
-
|
|
|
903
|
-
|
|
904
|
-
| SchedulerEngine | Planning
|
|
905
|
-
| ExecutionEngine | Backlog
|
|
906
|
-
| CloseoutEngine |
|
|
907
|
-
| 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) |
|
|
908
936
|
|
|
909
937
|
---
|
|
910
938
|
|
|
911
|
-
##
|
|
939
|
+
## Directory Structure
|
|
912
940
|
|
|
913
941
|
```
|
|
914
942
|
workflow-cli/
|
|
915
943
|
├── src/
|
|
916
|
-
│ ├── main.ts # CLI
|
|
917
|
-
│ ├── commands/ #
|
|
944
|
+
│ ├── main.ts # CLI entry point, command routing
|
|
945
|
+
│ ├── commands/ # Command implementations
|
|
918
946
|
│ │ ├── setup.ts # sps setup
|
|
919
947
|
│ │ ├── projectInit.ts # sps project init
|
|
920
948
|
│ │ ├── doctor.ts # sps doctor
|
|
@@ -927,45 +955,45 @@ workflow-cli/
|
|
|
927
955
|
│ │ ├── pmCommand.ts # sps pm *
|
|
928
956
|
│ │ ├── qaTick.ts # sps qa tick
|
|
929
957
|
│ │ └── monitorTick.ts # sps monitor tick
|
|
930
|
-
│ ├── core/ #
|
|
931
|
-
│ │ ├── config.ts #
|
|
958
|
+
│ ├── core/ # Core runtime
|
|
959
|
+
│ │ ├── config.ts # Configuration loading (shell conf parsing)
|
|
932
960
|
│ │ ├── context.ts # ProjectContext
|
|
933
|
-
│ │ ├── paths.ts #
|
|
934
|
-
│ │ ├── state.ts #
|
|
935
|
-
│ │ ├── lock.ts #
|
|
936
|
-
│ │ ├── logger.ts #
|
|
937
|
-
│ │ └── queue.ts # Pipeline
|
|
938
|
-
│ ├── engines/ #
|
|
939
|
-
│ │ ├── SchedulerEngine.ts #
|
|
940
|
-
│ │ ├── ExecutionEngine.ts #
|
|
941
|
-
│ │ ├── CloseoutEngine.ts # QA
|
|
942
|
-
│ │ └── MonitorEngine.ts #
|
|
943
|
-
│ ├── manager/ # Worker
|
|
944
|
-
│ │ ├── supervisor.ts # fd
|
|
945
|
-
│ │ ├── 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
|
|
946
974
|
│ │ ├── post-actions.ts # merge + PM update + slot release + notify
|
|
947
|
-
│ │ ├── pm-client.ts #
|
|
948
|
-
│ │ ├── resource-limiter.ts #
|
|
949
|
-
│ │ └── recovery.ts #
|
|
950
|
-
│ ├── interfaces/ #
|
|
951
|
-
│ │ ├── TaskBackend.ts # PM
|
|
952
|
-
│ │ ├── WorkerProvider.ts # Worker
|
|
953
|
-
│ │ ├── RepoBackend.ts #
|
|
954
|
-
│ │ ├── Notifier.ts #
|
|
955
|
-
│ │ └── HookProvider.ts # Hook
|
|
956
|
-
│ ├── models/ #
|
|
957
|
-
│ │ └── types.ts # Card, CommandResult, WorkerStatus
|
|
958
|
-
│ └── providers/ #
|
|
959
|
-
│ ├── 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)
|
|
960
988
|
│ ├── PlaneTaskBackend.ts
|
|
961
989
|
│ ├── TrelloTaskBackend.ts
|
|
962
990
|
│ ├── MarkdownTaskBackend.ts
|
|
963
|
-
│ ├── ClaudePrintProvider.ts # claude -p
|
|
964
|
-
│ ├── CodexExecProvider.ts # codex exec
|
|
965
|
-
│ ├── ClaudeTmuxProvider.ts # tmux
|
|
966
|
-
│ ├── CodexTmuxProvider.ts # tmux
|
|
967
|
-
│ ├── outputParser.ts # JSONL
|
|
968
|
-
│ ├── 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)
|
|
969
997
|
│ ├── GitLabRepoBackend.ts
|
|
970
998
|
│ └── MatrixNotifier.ts
|
|
971
999
|
├── package.json
|
|
@@ -974,50 +1002,50 @@ workflow-cli/
|
|
|
974
1002
|
|
|
975
1003
|
---
|
|
976
1004
|
|
|
977
|
-
## Manager
|
|
1005
|
+
## Manager Module (v0.16.0)
|
|
978
1006
|
|
|
979
|
-
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).
|
|
980
1008
|
|
|
981
|
-
|
|
|
982
|
-
|
|
983
|
-
| `supervisor.ts` | 288 | fd
|
|
984
|
-
| `completion-judge.ts` | 110 | git
|
|
985
|
-
| `post-actions.ts` | 412 | Worker
|
|
986
|
-
| `pm-client.ts` | 294 |
|
|
987
|
-
| `resource-limiter.ts` | 103 |
|
|
988
|
-
| `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 |
|
|
989
1017
|
|
|
990
|
-
|
|
991
|
-
- ExecutionEngine
|
|
992
|
-
- MonitorEngine
|
|
993
|
-
- 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)
|
|
994
1022
|
|
|
995
1023
|
---
|
|
996
1024
|
|
|
997
|
-
##
|
|
1025
|
+
## Label-Driven Skill Injection (v0.16.0)
|
|
998
1026
|
|
|
999
|
-
|
|
1027
|
+
Worker expertise is injected via PM card labels, allowing customization of Worker behavior for different tasks without code changes.
|
|
1000
1028
|
|
|
1001
|
-
|
|
1002
|
-
-
|
|
1003
|
-
-
|
|
1004
|
-
-
|
|
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
|
|
1005
1033
|
|
|
1006
|
-
**Prompt
|
|
1007
|
-
1. Skill Profiles
|
|
1008
|
-
2. Project Rules
|
|
1009
|
-
3. Project Knowledge
|
|
1010
|
-
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)
|
|
1011
1039
|
|
|
1012
|
-
|
|
1040
|
+
**Built-in skill templates:**
|
|
1013
1041
|
|
|
1014
|
-
|
|
|
1015
|
-
|
|
1016
|
-
|
|
|
1017
|
-
|
|
|
1018
|
-
|
|
|
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 |
|
|
1019
1047
|
|
|
1020
|
-
|
|
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.
|
|
1021
1049
|
|
|
1022
1050
|
---
|
|
1023
1051
|
|