@coralai/sps-cli 0.51.0 → 0.51.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.
@@ -1,67 +1,122 @@
1
1
  ---
2
2
  name: sps-pipeline
3
3
  description: |
4
- SPS pipeline management — create projects, configure YAML pipelines, manage task cards,
5
- start/stop pipelines, and monitor worker status. Single worker serial execution model.
6
- Use when asked to "create a pipeline", "set up a project", "add tasks", "start the pipeline",
7
- "check pipeline status", or manage SPS workflow. (🪸 Coral SPS)
4
+ SPS pipeline & project management — set up projects, configure YAML pipelines, manage
5
+ task cards, drive worker lifecycle, run web console, monitor health. Use when the user
6
+ asks to "create a pipeline", "set up a project", "add tasks", "start the pipeline",
7
+ "open console", "check status", or anything in the SPS workflow. (🪸 Coral SPS)
8
8
  ---
9
9
 
10
- # SPS Pipeline Management (v0.37.2 — Single Worker Model)
10
+ # SPS Pipeline (v0.51.x — Single-Worker Card Pipeline + Web Console + Wiki)
11
11
 
12
- SPS runs a single AI worker that processes task cards one at a time. Each card goes through
13
- one or more stages (develop, review, etc.) before moving to Done. If a card fails, the
14
- pipeline halts until the issue is resolved.
12
+ SPS drives an AI worker through task cards. **One worker, one card at a time, serial
13
+ execution.** Each card walks one or more YAML-defined stages (e.g. `develop review
14
+ Done`); failure halts until the user resolves it. v0.50 added a 4-layer service
15
+ architecture; v0.51 added per-project Wiki knowledge base injection.
15
16
 
16
- ## Interactive Pipeline Creation
17
+ ## Two ways to operate
17
18
 
18
- When the user asks to create a pipeline, set up a project, or configure YAML:
19
+ | Mode | Command | Use when |
20
+ |---|---|---|
21
+ | **Web Console** (preferred) | `sps console` | Daily work — kanban, logs, worker dashboard, project create, conf editor, pipeline editor, chat with agent, all in one UI |
22
+ | **CLI** | `sps tick / card / worker / wiki / …` | Scripting, troubleshooting, headless servers |
19
23
 
20
- ### Step 1: Gather project info
24
+ Console listens on `127.0.0.1:4311` by default; opens browser auto. Single-instance
25
+ guard via `~/.coral/console.lock`.
21
26
 
22
- Ask the user:
23
- 1. **Project name** — SPS identifier (e.g. `my-app`)
24
- 2. **Repository path** — local path (e.g. `~/projects/my-app`)
25
- 3. **Git remote** — GitLab/GitHub project path (e.g. `user/my-app`), blank to skip
26
- 4. **Target branch** — default `main` or `develop`
27
- 5. **PM backend** — `markdown` (zero-config) / `plane` / `trello`
27
+ ---
28
28
 
29
- ### Step 2: Design the pipeline
29
+ ## 1. First-time setup
30
30
 
31
- Ask the user:
32
- 1. **Project type:**
33
- - `git: true` (default) code project, worker commits + pushes to current branch
34
- - `git: false` — non-code project (document processing, data tasks, no git ops)
35
- 2. **How many stages?**
36
- - **Simple** (1 stage): develop → Done
37
- - **With review** (2 stages): develop → review → Done
38
- 3. **Skill profile?** — e.g. `fullstack`, `frontend`, `backend`, `reviewer`, `tax-worker` (optional)
31
+ ```bash
32
+ npm install -g @coralai/sps-cli # latest (currently 0.51.x)
33
+ sps setup # MUST RUN: interactive wizard
34
+ ```
39
35
 
40
- ### Step 3: Generate and deploy
36
+ `sps setup` does:
37
+ 1. Creates `~/.coral/` directory tree (`projects/`, `memory/user/`, `memory/agents/`).
38
+ 2. Copies bundled skills → `~/.coral/skills/`.
39
+ 3. Interactively writes `~/.coral/env` (Git remote token, Matrix credentials, etc.).
40
+ 4. Symlinks user skills → `~/.coral/.claude/skills/` and `~/.claude/skills/`.
41
+ 5. Installs `@agentclientprotocol/claude-agent-acp` globally if missing.
41
42
 
42
- 1. Run `sps project init <name>` if project doesn't exist
43
- 2. Generate YAML at `~/.coral/projects/<name>/pipelines/project.yaml`
44
- 3. Show the generated YAML and explain each section
43
+ Re-run safe: `sps setup --force` keeps existing values as defaults.
45
44
 
46
- ### CRITICAL: YAML Rules
45
+ **No separate console config**. Console reads `~/.coral/env` + per-project conf.
47
46
 
48
- 1. **`on_complete` of each stage MUST point to the next stage's target state** — no skipping, no looping
49
- 2. **Last stage's `on_complete` MUST be `"move_card Done"`**
50
- 3. **`trigger` and `card_state` are auto-derived** — you don't need to specify them
51
- 4. **Completion is always `exit-code`** — worker finishes when the AI process exits
52
- 5. **Single worker** — cards are processed one at a time, no concurrency
47
+ ---
53
48
 
54
- ### YAML Examples
49
+ ## 2. Create a project
55
50
 
56
- **Simple (1 stage):**
51
+ ### Option A — Console (recommended)
52
+ Open `sps console` → `/projects/new` → fill form → submit. Form provides:
53
+ - Project name + repo path
54
+ - Git toggle (worker commits + pushes? off for non-code projects)
55
+ - **Wiki toggle** (v0.51+): scaffolds `wiki/` + writes `WIKI_ENABLED=true` to conf
56
+ - Merge branch, max workers, ACK timeout, Matrix room
57
+
58
+ ### Option B — Interactive CLI
59
+ ```bash
60
+ sps project init <name> # asks the same questions on tty
61
+ ```
62
+
63
+ ### What gets created
64
+
65
+ ```
66
+ ~/.coral/projects/<name>/
67
+ ├── conf # your active settings (private, mode 600)
68
+ ├── conf.example # full reference with comments (read-only docs)
69
+ ├── pipelines/
70
+ │ ├── project.yaml # default 1-stage pipeline (develop → Done)
71
+ │ └── sample.yaml.example # heavily-commented YAML reference
72
+ ├── pipeline_order.json # active pipeline pointer
73
+ ├── runtime/
74
+ │ ├── state.json # worker slot + active card state (machine-managed)
75
+ │ └── tick.lock # lock file
76
+ ├── logs/ # per-tick logs
77
+ ├── pm_meta/ # markdown card backend metadata
78
+ └── cards/ # state subdirs created on first use
79
+ └── seq.txt
80
+ ```
81
+
82
+ Plus, in the **target repo** (PROJECT_DIR):
83
+ - `.claude/CLAUDE.md` — worker rules + (if wiki=on) wiki SOP block
84
+ - `.claude/skills/` — symlinked from `~/.coral/skills/`
85
+ - `.claude/settings.local.json` — Claude Code local config
86
+ - `wiki/` (if wiki=on) — knowledge base scaffold
87
+ - `ATTRIBUTION.md` (if wiki=on) — borrows declaration
88
+
89
+ ---
90
+
91
+ ## 3. Pipeline YAML
92
+
93
+ **Location**: `~/.coral/projects/<name>/pipelines/project.yaml`
94
+
95
+ **Single source of truth** for stages, profiles, transitions. Edit this file (or in
96
+ console at `/projects/<name>` pipeline editor) to customize.
97
+
98
+ ### Critical YAML rules
57
99
 
100
+ 1. **`mode: project`** — orchestrate cards through states. (`mode: steps` is for
101
+ one-shot custom pipelines via `sps pipeline run <name>`.)
102
+ 2. **`on_complete` of each stage points to the next stage's target state.** No
103
+ skipping, no looping.
104
+ 3. **Last stage's `on_complete: "move_card Done"`.**
105
+ 4. **Don't write `agent:` field** — it's accepted for back-compat but ignored.
106
+ Claude (via ACP) is the only supported worker as of v0.38.0.
107
+ 5. **Single worker, serial execution** — set `MAX_CONCURRENT_WORKERS` in conf if
108
+ you want >1 slot reserved, but cards still run one at a time.
109
+ 6. **Failure halts pipeline** by default (`on_fail.halt: true`). Worker labels card
110
+ `NEEDS-FIX`; user must resolve before next card runs.
111
+
112
+ ### Templates
113
+
114
+ **Simple (1 stage):**
58
115
  ```yaml
59
116
  mode: project
60
117
  git: true
61
-
62
118
  stages:
63
119
  - name: develop
64
- agent: claude
65
120
  on_complete: "move_card Done"
66
121
  on_fail:
67
122
  action: "label NEEDS-FIX"
@@ -69,182 +124,329 @@ stages:
69
124
  ```
70
125
 
71
126
  **With review (2 stages):**
72
-
73
127
  ```yaml
74
128
  mode: project
75
129
  git: true
76
-
77
130
  stages:
78
131
  - name: develop
79
- agent: claude
80
132
  profile: fullstack
81
133
  on_complete: "move_card Review"
82
- on_fail:
83
- action: "label NEEDS-FIX"
84
- halt: true
85
-
134
+ on_fail: { action: "label NEEDS-FIX", halt: true }
86
135
  - name: review
87
136
  profile: reviewer
88
137
  on_complete: "move_card Done"
89
- on_fail:
90
- action: "label REVIEW-FAILED"
91
- halt: true
138
+ on_fail: { action: "label REVIEW-FAILED", halt: true }
92
139
  ```
93
140
 
94
- **Non-code (data processing):**
95
-
141
+ **Non-git (data / docs project):**
96
142
  ```yaml
97
143
  mode: project
98
144
  git: false
99
-
100
145
  stages:
101
146
  - name: process
102
147
  profile: tax-worker
103
148
  on_complete: "move_card Done"
104
- on_fail:
105
- action: "label PROCESS-FAILED"
106
- halt: true
149
+ on_fail: { action: "label PROCESS-FAILED", halt: true }
107
150
  ```
108
151
 
109
- ### YAML Location
152
+ ### YAML field reference
153
+
154
+ | Field | Required | Notes |
155
+ |---|---|---|
156
+ | `mode` | yes | `project` (state machine) or `steps` (one-shot, run via `sps pipeline run`) |
157
+ | `git` | no | `true` (default) — worker commits + pushes / `false` — no git ops |
158
+ | `stages` | yes | Array |
159
+ | `stages[].name` | yes | Unique within file |
160
+ | `stages[].profile` | no | Skill profile (e.g. `fullstack` / `reviewer` / `tax-worker`); falls back to `DEFAULT_WORKER_SKILLS` in conf |
161
+ | `stages[].on_complete` | yes | `"move_card <NextState>"` |
162
+ | `stages[].on_fail.action` | no | `"label NEEDS-FIX"` etc. |
163
+ | `stages[].on_fail.halt` | no | default `true` |
164
+ | `stages[].on_fail.comment` | no | Comment text |
165
+ | `stages[].timeout` | no | `30s` / `5m` / `2h` (rare) |
166
+
167
+ `trigger` and `card_state` are auto-derived per stage from the position. Don't set
168
+ manually.
169
+
170
+ ### Custom pipelines (mode: steps)
171
+
172
+ For one-shot scripted runs (e.g. canary deploy, bulk ingest), use `mode: steps` and
173
+ invoke via `sps pipeline run <pipeline-name> "<prompt>"`. Out of scope for normal
174
+ card pipelines; see `sample.yaml.example` for syntax.
175
+
176
+ ---
177
+
178
+ ## 4. Card state machine
110
179
 
111
180
  ```
112
- ~/.coral/projects/<name>/pipelines/project.yaml
181
+ Planning → Backlog → Todo → Inprogress → [QA / Review] → Done
182
+ ↓ fail
183
+ NEEDS-FIX (halt)
113
184
  ```
114
185
 
115
- ### YAML Field Reference
186
+ Default states (configurable in YAML `pm.card_states`):
187
+ - **Planning** — drafted, awaiting AI-PIPELINE label promotion
188
+ - **Backlog** — eligible to run
189
+ - **Todo** — claimed by SchedulerEngine, ready for worker
190
+ - **Inprogress** — worker active
191
+ - **QA** (or **Review**) — code complete, awaiting human/auto verification
192
+ - **Done** — finished
193
+ - **Canceled** — folded into Done view (rare state)
116
194
 
117
- | Field | Required | Description |
118
- |-------|----------|-------------|
119
- | `mode` | yes | Always `project` |
120
- | `git` | no | `true` (default, commit+push) or `false` (no git) |
121
- | `stages` | yes | Array of stage definitions |
122
- | `stages[].name` | yes | Stage name (unique) |
123
- | `stages[].agent` | no | Accepted for backward-compat only; value ignored (claude is the only supported CLI) |
124
- | `stages[].profile` | no | Skill profile to load |
125
- | `stages[].on_complete` | yes | `"move_card <State>"` — next state |
126
- | `stages[].on_fail.action` | no | `"label <LABEL>"` — add label on failure |
127
- | `stages[].on_fail.halt` | no | `true` (default) stop pipeline / `false` continue |
128
- | `stages[].on_fail.comment` | no | Comment text on failure |
129
- | `stages[].timeout` | no | Max duration: `30s` / `5m` / `2h` |
195
+ Engines walk this graph each tick. The **active stage** writes a per-slot marker
196
+ file at `~/.coral/projects/<p>/runtime/worker-<slot>-current.json` (v0.50.21+).
197
+ Stop hook reads this to detect which card the worker just finished.
130
198
 
131
199
  ---
132
200
 
133
- ## Quick Reference
134
-
135
- ### Project Lifecycle
201
+ ## 5. Card management
136
202
 
137
203
  ```bash
138
- # Install
139
- npm install -g @coralai/sps-cli
140
-
141
- # Setup (credentials, skills, directories)
142
- sps setup
204
+ # Create
205
+ sps card add <project> "Title" "Description"
206
+ sps card add <project> "T" "D" --skills python,backend --labels feature
207
+ # (or use console UI's "新卡片" form)
208
+
209
+ # View
210
+ sps card dashboard <project> # CLI table
211
+ # console: /board?project=<name>
212
+
213
+ # Lifecycle (machine-managed, but you can intervene)
214
+ sps card mark-started <p> <seq> # called by Claude Code UserPromptSubmit hook
215
+ sps card mark-complete <p> <seq> # called by Claude Code Stop hook
216
+ sps reset <p> # reset all non-Done
217
+ sps reset <p> --card 5,6,7 # reset specific seq
218
+ sps reset <p> --all # full reset incl. Done
219
+ ```
143
220
 
144
- # Initialize project (interactive)
145
- sps project init <name>
221
+ ### Card label vocabulary
222
+
223
+ | Label | Meaning | Who sets |
224
+ |---|---|---|
225
+ | `AI-PIPELINE` | Required to enter pipeline | User on creation |
226
+ | `STARTED-<stage>` | ACK signal — Claude received the prompt | UserPromptSubmit hook |
227
+ | `COMPLETED-<stage>` | Worker finished a stage | Stop hook |
228
+ | `CLAIMED` | StageEngine reserved a worker slot | Engine |
229
+ | `NEEDS-FIX` | Worker failed; pipeline halted | Engine |
230
+ | `BLOCKED` | External dep; pipeline skips | User |
231
+ | `WAITING-CONFIRMATION` | Worker waiting on user input | Engine |
232
+ | `STALE-RUNTIME` | Inprogress > timeout | MonitorEngine |
233
+ | `ACK-TIMEOUT` | Claude never ACK'd within `WORKER_ACK_TIMEOUT_S` | MonitorEngine |
234
+ | `skill:<name>` | Force-load specific skill | User on card |
235
+ | `conflict:<domain>` | Serial-with-others-in-same-domain | User |
146
236
 
147
- # Create pipeline YAML
148
- vim ~/.coral/projects/<name>/pipelines/project.yaml
237
+ ---
149
238
 
150
- # Add task cards
151
- sps card add <name> "Task title" "Description"
239
+ ## 6. Pipeline lifecycle commands
152
240
 
153
- # Start pipeline
154
- sps tick <name>
241
+ ```bash
242
+ # Run continuously (one tick spawns next via cron-like loop)
243
+ sps tick <project> # foreground tick(s) — Ctrl+C to stop
244
+ sps pipeline start <project> # alias for tick
245
+ sps pipeline stop <project> # graceful stop
246
+ sps stop <project> # CLI alias for stop
247
+ sps stop --all # stop all running ticks
248
+
249
+ # Status
250
+ sps status # all projects
251
+ sps pipeline status # alias
252
+ sps doctor <project> # health check
253
+ sps doctor <project> --fix # auto-repair drift
254
+
255
+ # One-off ticks (each engine separately, useful for cron / debugging)
256
+ sps scheduler tick <p> # Planning → Backlog promotion
257
+ sps pipeline tick <p> # full StageEngine pass
258
+ sps qa tick <p> # QA → Done finalization
259
+ sps monitor tick <p> # health probe (ACK timeout, stale runtime)
260
+ sps pm scan <p> # rebuild card index from disk
261
+ ```
155
262
 
156
- # Monitor
157
- sps card dashboard <name>
158
- sps worker ps <name>
159
- sps status
263
+ ### Worker control
160
264
 
161
- # Stop
162
- sps stop <name>
265
+ ```bash
266
+ sps worker ps <project> # list slots + PIDs
267
+ sps worker dashboard <project> # rich UI (also in console)
268
+ sps worker kill <project> <seq> # SIGKILL one slot
269
+ sps worker launch <project> <seq> # manual spawn (debugging)
163
270
  ```
164
271
 
165
- ### Card Management
272
+ ### Logs
166
273
 
167
274
  ```bash
168
- sps card add <project> "Title" "Description"
169
- sps card dashboard <project>
170
- sps reset <project> # Reset all non-Done cards
171
- sps reset <project> 5 6 7 # Reset specific cards
275
+ sps logs <project> # follow mode (default)
276
+ sps logs <project> --err # stderr only
277
+ sps logs <project> --lines 50 --no-follow
278
+ # console: /logs?project=<name> (live SSE)
172
279
  ```
173
280
 
174
- ### Memory System
281
+ ---
282
+
283
+ ## 7. Web Console (`sps console`)
284
+
285
+ Single binary launches the web UI:
175
286
 
176
287
  ```bash
177
- sps memory list <project>
178
- sps memory context <project>
179
- sps memory add <project> --type convention --name "Title" --body "Content"
288
+ sps console # opens http://127.0.0.1:4311
289
+ sps console --port 5000
290
+ sps console --no-open
291
+ sps console --kill # stop running console
292
+ sps console --dev # vite dev server (development)
180
293
  ```
181
294
 
182
- Types: `convention` (no decay), `decision` (slow), `lesson` (30 days), `reference` (no decay).
295
+ Pages:
296
+ - `/projects` — list, summary cards
297
+ - `/projects/new` — create project (with Wiki toggle, v0.51)
298
+ - `/projects/<n>` — pipeline editor + conf editor + delete
299
+ - `/board` — kanban (with **per-column scrolling**, v0.51.1+)
300
+ - `/workers` — aggregate worker dashboard (all projects)
301
+ - `/logs` — live SSE log viewer
302
+ - `/skills` — user-level skill management
303
+ - `/system` — global settings, daemon status
304
+ - `/chat` — agent chat (multi-session, persistent)
183
305
 
184
306
  ---
185
307
 
186
- ## Architecture
308
+ ## 8. Memory & Wiki (auto-injected into Worker prompts)
187
309
 
188
- ```
189
- SchedulerEngine
190
- Planning cards with AI-PIPELINE label Backlog Ready
310
+ | | **Memory** (`sps-memory` skill) | **Wiki** (`wiki-update` skill) |
311
+ |---|---|---|
312
+ | Purpose | Ad-hoc facts, user prefs, decisions, gotchas | Structured project knowledge: modules, concepts, decisions, lessons |
313
+ | Path | `~/.coral/memory/{user,agents,projects/<p>}/` | `<repo>/wiki/` (per-project, in repo) |
314
+ | Schema | Markdown + YAML frontmatter (`type: convention/decision/lesson/reference`) | 5 page types with zod-validated frontmatter |
315
+ | Cross-link | None (flat index) | `[[type/Title]]` wikilinks |
316
+ | Auto-inject | `buildFullMemoryContext` → prompt's `knowledge` section | `wikiRead` 5-layer → prompt's `wikiContext` section (only when `WIKI_ENABLED=true`) |
317
+ | When to use | Personal style notes, "remember X" requests | Project knowledge that benefits future cards |
191
318
 
192
- StageEngine (single worker, serial)
193
- Take one card run stage 1 run stage 2 → ... → Done
194
- → Fail → NEEDS-FIX → halt pipeline
319
+ If you're configuring a project that needs structured knowledge accumulation,
320
+ **enable Wiki** at create time. For ad-hoc facts only, memory alone is enough.
195
321
 
196
- MonitorEngine
197
- → Worker health check
322
+ CLI helpers:
323
+ ```bash
324
+ sps memory list <p>
325
+ sps memory context <p> # preview what gets injected
326
+ sps memory add <p> --type convention --name "title" --body "content"
327
+
328
+ sps wiki init <p> # scaffold (auto when WIKI_ENABLED=true)
329
+ sps wiki update <p> # source diff
330
+ sps wiki update <p> --finalize # flush manifest after pages written
331
+ sps wiki check <p> # lint
332
+ sps wiki read <p> "<query>" # preview prompt injection
333
+ sps wiki list/get/add/status # browse / inspect
198
334
  ```
199
335
 
200
- ### Execution Model
336
+ ---
201
337
 
202
- - **One card at a time** — no concurrency, no worktrees, no feature branches
203
- - **Worker runs in PROJECT_DIR** — directly on the current branch
204
- - **git: true** worker commits and pushes to current branch
205
- - **git: false** — worker processes files, no git operations
206
- - **Failure halts pipeline** NEEDS-FIX label blocks next card until resolved
207
- - **Auto-recovery** — orphaned Inprogress cards reset to Ready on tick restart
338
+ ## 9. Conf reference (essentials)
339
+
340
+ Live at `~/.coral/projects/<name>/conf` (shell `export VAR="value"` syntax).
341
+
342
+ | Field | Default | Notes |
343
+ |---|---|---|
344
+ | `PROJECT_NAME` | (required) | Internal id |
345
+ | `PROJECT_DIR` | (required) | Repo absolute path |
346
+ | `GITLAB_PROJECT` | — | `user/repo` (optional, for GitLab API) |
347
+ | `GITLAB_MERGE_BRANCH` | `main` | Worker pushes here |
348
+ | `PM_TOOL` | `markdown` | **Only `markdown` supported as of v0.42.0**. Plane/Trello removed. Cards live in `~/.coral/projects/<n>/cards/<state>/<seq>.md` |
349
+ | `PIPELINE_LABEL` | `AI-PIPELINE` | Required label on cards to enter pipeline |
350
+ | `MR_MODE` | `none` | `none` (push direct) / `create` (open MR; needs `GITLAB_PROJECT_ID`) |
351
+ | `WORKER_TRANSPORT` | `acp-sdk` | Fixed; do not change |
352
+ | `MAX_CONCURRENT_WORKERS` | `1` | Slot count; cards still serial within a project |
353
+ | `MAX_ACTIONS_PER_TICK` | `3` | New tasks claimable per tick |
354
+ | `INPROGRESS_TIMEOUT_HOURS` | `2` | After this, MonitorEngine flags STALE-RUNTIME |
355
+ | `WORKER_ACK_TIMEOUT_S` | `300` | Wait for STARTED-<stage> label after dispatch (5min, raised in v0.50.24) |
356
+ | `WORKER_ACK_MAX_RETRIES` | `1` | ACK timeout retry count |
357
+ | `MONITOR_AUTO_QA` | `true` | Auto-advance to QA on stale runtime |
358
+ | `CONFLICT_DEFAULT` | `serial` | Fallback for cards without `conflict:` label |
359
+ | `MATRIX_ROOM_ID` | — | Project-level Matrix override |
360
+ | `WORKTREE_DIR` | `~/.coral/worktrees/<p>` | Worker scratch space |
361
+ | `DEFAULT_WORKER_SKILLS` | — | Comma-separated skill list when no `profile:` and no `card.skills` |
362
+ | `ENABLE_MEMORY` | `true` | Set `false` to skip memory write instructions in prompt |
363
+ | **`WIKI_ENABLED`** | unset (off) | **v0.51+**: `true` enables wiki context injection + reminder block |
364
+ | `COMPLETION_SIGNAL` | `done` | Word the Stop hook listens for |
365
+
366
+ Full reference: `~/.coral/projects/<n>/conf.example` (auto-generated, comment-rich).
367
+
368
+ ---
208
369
 
209
- ### Card State Flow
370
+ ## 10. Architecture (4-layer, v0.50+)
210
371
 
211
372
  ```
212
- Planning Backlog → Ready → Inprogress → [Review] → Done
213
- fail
214
- NEEDS-FIX (halt)
373
+ Delivery (commands/, console/routes/)
374
+ execute* / HTTP routes; thin
375
+ Service (services/)
376
+ → ProjectService / ChatService / PipelineService / SkillService — Result<T> + DomainEvent
377
+ Domain (engines/)
378
+ → SchedulerEngine / StageEngine / MonitorEngine / EventHandler
379
+ Infrastructure (manager/, providers/, daemon/)
380
+ → WorkerManager (single worker), ACPWorkerRuntime, sessionDaemon
215
381
  ```
216
382
 
217
- ---
383
+ ### Engines
218
384
 
219
- ## Config Reference (conf)
385
+ - **SchedulerEngine** promotes Planning → Backlog when AI-PIPELINE present
386
+ - **StageEngine** — drives card through stages; builds prompt (skill + projectRules
387
+ + memory + **wikiContext** + task description + **wikiUpdateReminder**); kicks
388
+ Worker via ACP
389
+ - **MonitorEngine** — ACK timeout detection, stale runtime, auto-QA promotion
390
+ - **CloseoutEngine / EventHandler** — finalize completed cards
220
391
 
221
- | Field | Description |
222
- |-------|-------------|
223
- | `PROJECT_NAME` | Project identifier |
224
- | `PROJECT_DIR` | Repository path |
225
- | `GITLAB_PROJECT` | Git remote path (optional) |
226
- | `GITLAB_MERGE_BRANCH` | Target branch |
227
- | `PM_TOOL` | `markdown` / `plane` / `trello` |
228
- | `PIPELINE_LABEL` | Card label for pipeline (default: `AI-PIPELINE`) |
392
+ ### Single worker is intentional
229
393
 
230
- ## Card Labels
394
+ v0.37.2 deleted multi-worker concurrency code by design. Don't propose "add a
395
+ parallel mode" — the architecture relies on serial execution for state coherence.
396
+ For higher throughput, run multiple projects in parallel (each its own tick loop).
231
397
 
232
- | Label | Purpose |
233
- |-------|---------|
234
- | `AI-PIPELINE` | Required — marks card for pipeline |
235
- | `skill:xxx` | Load specific skill profile |
236
- | `NEEDS-FIX` | Worker failed — pipeline halted |
237
- | `BLOCKED` | External dependency |
398
+ ---
238
399
 
239
- ## Troubleshooting
400
+ ## 11. Troubleshooting
240
401
 
241
402
  ```bash
242
- sps doctor <project> --fix # Health check
243
- sps logs <project> # View logs
244
- sps reset <project> <seq> # Reset stuck card
403
+ sps doctor <project> --fix # first thing to try
404
+ sps logs <project> --err # stderr / errors
405
+ sps reset <project> --card <seq> # nuke a stuck card
406
+ sps reset <project> --all # full project reset (worktrees, branches, state)
407
+
408
+ # Worker / daemon issues
409
+ sps worker ps <project>
410
+ sps agent daemon status # is the chat daemon up?
411
+ sps agent daemon stop && sps agent daemon start # restart daemon (clears stale cwd)
412
+
413
+ # Wiki issues (v0.51+)
414
+ sps wiki check <project> # lint
415
+ sps wiki status <project> # source / manifest / pages diff
245
416
  ```
246
417
 
247
418
  Common issues:
248
- - **Pipeline halted** — check `sps card dashboard`, remove NEEDS-FIX label from failed card
249
- - **Worker not starting** — check `sps worker ps`, verify API credentials
250
- - **Cards stuck in Planning** ensure cards have `AI-PIPELINE` label
419
+
420
+ - **Pipeline halted with NEEDS-FIX** — open the failed card, fix the issue, remove
421
+ the label. Console makes this 2 clicks.
422
+ - **Worker not starting** — `sps worker ps`, then check `sps logs --err`. Often
423
+ Claude API key missing or `claude-agent-acp` adapter not installed (`sps setup`
424
+ reinstalls it).
425
+ - **Cards stuck in Planning** — they need the `AI-PIPELINE` label. `sps card add`
426
+ applies it automatically.
427
+ - **ACK timeout on every card** — Claude cold-start is slow with many skills/memory
428
+ files. Raise `WORKER_ACK_TIMEOUT_S` in conf (default 300s as of v0.50.24).
429
+ - **Console shows stale data** — SSE may have dropped; reload page; if persistent,
430
+ `sps console --kill && sps console`.
431
+ - **Wiki context not injecting** — verify `WIKI_ENABLED=true` in conf and
432
+ `wiki/WIKI.md` exists. StageEngine logs a warning if conf says yes but scaffold
433
+ is missing.
434
+
435
+ ---
436
+
437
+ ## 12. Skill ↔ project linkage
438
+
439
+ User-level skills live in `~/.coral/skills/`. To use one in a specific project:
440
+
441
+ ```bash
442
+ sps skill list # what's available + project status
443
+ sps skill add <name> --project <p> # symlink into <repo>/.claude/skills/
444
+ sps skill remove <name> --project <p>
445
+ sps skill freeze <name> --project <p> # symlink → real copy (allow project edits)
446
+ sps skill unfreeze <name> --project <p> # back to symlink
447
+ sps skill sync # ① bundled (npm pkg) → ~/.coral/skills/
448
+ # ② ~/.coral/skills/ → ~/.claude/skills/
449
+ ```
450
+
451
+ **After upgrading sps-cli**, run `sps skill sync` to pick up new bundled skills
452
+ (e.g. `wiki-update` added in v0.51.0).