@coralai/sps-cli 0.52.3 → 0.53.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-CN.md +457 -131
- package/README.md +460 -131
- package/dist/commands/agentCommand.js +1 -1
- package/dist/commands/agentCommand.js.map +1 -1
- package/dist/commands/agentDaemon.d.ts.map +1 -1
- package/dist/commands/agentDaemon.js +3 -9
- package/dist/commands/agentDaemon.js.map +1 -1
- package/dist/commands/agentRenderer.d.ts +1 -1
- package/dist/commands/agentRenderer.d.ts.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +0 -4
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skillCommand.js +14 -14
- package/dist/commands/skillCommand.js.map +1 -1
- package/dist/console/routes/chat.d.ts.map +1 -1
- package/dist/console/routes/chat.js +14 -18
- package/dist/console/routes/chat.js.map +1 -1
- package/dist/console/routes/fs.js +2 -2
- package/dist/console/routes/fs.js.map +1 -1
- package/dist/console-assets/assets/index-CoAkaUkW.css +10 -0
- package/dist/console-assets/assets/index-p6b8pcpR.js +557 -0
- package/dist/console-assets/index.html +2 -2
- package/dist/core/claudeJsonl.d.ts +43 -0
- package/dist/core/claudeJsonl.d.ts.map +1 -0
- package/dist/core/claudeJsonl.js +187 -0
- package/dist/core/claudeJsonl.js.map +1 -0
- package/dist/core/runtimeSnapshot.d.ts +1 -1
- package/dist/core/runtimeSnapshot.d.ts.map +1 -1
- package/dist/core/runtimeStore.d.ts +1 -1
- package/dist/core/runtimeStore.d.ts.map +1 -1
- package/dist/core/sessionContext.d.ts +1 -1
- package/dist/core/sessionContext.d.ts.map +1 -1
- package/dist/core/sessionLiveness.d.ts +1 -1
- package/dist/core/sessionLiveness.d.ts.map +1 -1
- package/dist/core/state.d.ts +1 -1
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/wiki/hot.js +2 -2
- package/dist/core/wiki/hot.js.map +1 -1
- package/dist/core/wiki/reader.js +4 -4
- package/dist/core/wiki/reader.js.map +1 -1
- package/dist/core/wiki/scaffold.js +1 -1
- package/dist/core/wiki/types.d.ts +50 -50
- package/dist/daemon/daemonClient.d.ts +2 -2
- package/dist/daemon/daemonClient.d.ts.map +1 -1
- package/dist/engines/MonitorEngine.js.map +1 -1
- package/dist/main.js +40 -40
- package/dist/main.js.map +1 -1
- package/dist/manager/worker-manager-impl.d.ts +1 -1
- package/dist/manager/worker-manager-impl.d.ts.map +1 -1
- package/dist/providers/ACPWorkerRuntime.d.ts +5 -5
- package/dist/providers/ACPWorkerRuntime.d.ts.map +1 -1
- package/dist/providers/ACPWorkerRuntime.js +1 -1
- package/dist/providers/ACPWorkerRuntime.js.map +1 -1
- package/dist/providers/MarkdownTaskBackend.d.ts +2 -6
- package/dist/providers/MarkdownTaskBackend.d.ts.map +1 -1
- package/dist/providers/MarkdownTaskBackend.js +20 -32
- package/dist/providers/MarkdownTaskBackend.js.map +1 -1
- package/dist/providers/registry.d.ts +1 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/services/CardService.js +11 -11
- package/dist/services/CardService.js.map +1 -1
- package/dist/services/ChatService.d.ts +31 -1
- package/dist/services/ChatService.d.ts.map +1 -1
- package/dist/services/ChatService.js +149 -33
- package/dist/services/ChatService.js.map +1 -1
- package/dist/services/LogService.js +2 -2
- package/dist/services/LogService.js.map +1 -1
- package/dist/services/PipelineService.js +29 -29
- package/dist/services/PipelineService.js.map +1 -1
- package/dist/services/ProjectService.js +16 -16
- package/dist/services/ProjectService.js.map +1 -1
- package/dist/services/SkillService.js +9 -9
- package/dist/services/SkillService.js.map +1 -1
- package/dist/services/SystemService.js +9 -9
- package/dist/services/SystemService.js.map +1 -1
- package/dist/services/WorkerService.js +7 -7
- package/dist/services/WorkerService.js.map +1 -1
- package/dist/services/executors.d.ts +1 -0
- package/dist/services/executors.d.ts.map +1 -1
- package/dist/services/executors.js +7 -0
- package/dist/services/executors.js.map +1 -1
- package/dist/shared/runtimePaths.d.ts +8 -0
- package/dist/shared/runtimePaths.d.ts.map +1 -1
- package/dist/shared/runtimePaths.js +22 -0
- package/dist/shared/runtimePaths.js.map +1 -1
- package/dist/shared/runtimeSchemas.d.ts +14 -14
- package/package.json +7 -3
- package/skills/sps-memory/SKILL.md +1 -1
- package/skills/sps-pipeline/SKILL.md +19 -19
- package/LICENSE +0 -21
- package/dist/console-assets/assets/index-Bf8zeTg0.js +0 -566
- package/dist/console-assets/assets/index-j5Dtsmq0.css +0 -10
package/README.md
CHANGED
|
@@ -1,218 +1,547 @@
|
|
|
1
|
-
# SPS CLI
|
|
1
|
+
# SPS CLI — AI Agent Harness & Development Pipeline
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@coralai/sps-cli) [](
|
|
3
|
+
[](https://www.npmjs.com/package/@coralai/sps-cli) [](../../LICENSE)
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> **中文文档**:[README-CN.md](./README-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**v0.51.3**
|
|
8
8
|
|
|
9
|
-
SPS (Smart Pipeline System)
|
|
9
|
+
SPS (Smart Pipeline System) drives a Claude Code worker through task cards — code, commit, push, QA, merge, all automated. Three modes:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
| Mode | Command | When |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **Harness** | `sps agent` | Zero-config — one-shot or multi-turn chat with Claude. No project, no PM. |
|
|
14
|
+
| **Pipeline** | `sps tick <project>` | Automated card-driven workflow with YAML-configurable stages. |
|
|
15
|
+
| **Console** | `sps console` | Web UI — kanban, logs, workers, projects, chat (since v0.44). |
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
The headline feature in v0.51 is the **Wiki Knowledge Base** — opt-in per project, structured cross-linked pages (modules / concepts / decisions / lessons / sources), 5-layer retrieval auto-injected into worker prompts. See [doc-28](../../docs/design/28-wiki-system.md) and [`ATTRIBUTION.md`](./ATTRIBUTION.md).
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
---
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
## Table of contents
|
|
18
22
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
23
|
+
- [Install & setup](#install--setup)
|
|
24
|
+
- [Harness mode (`sps agent`)](#harness-mode-sps-agent)
|
|
25
|
+
- [Console mode (`sps console`)](#console-mode-sps-console)
|
|
26
|
+
- [Pipeline mode (`sps tick`)](#pipeline-mode-sps-tick)
|
|
27
|
+
- [Card lifecycle](#card-lifecycle)
|
|
28
|
+
- [Memory + Wiki](#memory--wiki)
|
|
29
|
+
- [Skills](#skills)
|
|
30
|
+
- [Command reference](#command-reference)
|
|
31
|
+
- [Project config (conf)](#project-config-conf)
|
|
32
|
+
- [Project layout](#project-layout)
|
|
33
|
+
- [Architecture](#architecture)
|
|
34
|
+
- [Troubleshooting](#troubleshooting)
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
---
|
|
26
37
|
|
|
27
|
-
|
|
38
|
+
## Install & setup
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g @coralai/sps-cli # latest 0.51.x
|
|
42
|
+
sps setup # interactive wizard (must run once)
|
|
43
|
+
```
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
`sps setup`:
|
|
46
|
+
1. Creates `~/.coral/` directory tree (`projects/`, `memory/{user,agents}/`).
|
|
47
|
+
2. Copies bundled skills → `~/.coral/skills/`.
|
|
48
|
+
3. Asks for `GITLAB_URL` / `GITLAB_TOKEN` / `MATRIX_*` (optional) → writes `~/.coral/env`.
|
|
49
|
+
4. Symlinks user skills → `~/.claude/skills/`.
|
|
50
|
+
5. Installs `@agentclientprotocol/claude-agent-acp` globally.
|
|
33
51
|
|
|
34
|
-
|
|
35
|
-
Each task is a **card** that flows through stages: `Backlog → Planning → Todo → Inprogress → QA → Done`. Every stage has its own prompt, allowed tools, exit gates — all configurable in YAML.
|
|
52
|
+
Re-run safe with `sps setup --force` (keeps existing values as defaults). After upgrading sps-cli later, run **`sps skill sync --force`** to pull updated skill SOPs (default sync is non-destructive — won't overwrite existing skills).
|
|
36
53
|
|
|
37
|
-
|
|
38
|
-
Stages dispatch atomic **skills** to drive each task — `sps-pipeline`, `wiki-update`, `git-commit`, persona skills, and 24 dev skills bundled. Skills compose without ballooning the system prompt; the harness loads only what the current stage needs.
|
|
54
|
+
**Prerequisites**: Node ≥ 18; an Anthropic API key (or Claude Pro / Max subscription); `claude` CLI in PATH.
|
|
39
55
|
|
|
40
|
-
|
|
41
|
-
A 3-layer markdown-on-disk persistence for **non-obvious, reusable facts** that should survive across sessions. Lives entirely under `~/.coral/memory/`; auto-injected into every pipeline worker prompt by `StageEngine`.
|
|
56
|
+
---
|
|
42
57
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
## Harness mode (`sps agent`)
|
|
59
|
+
|
|
60
|
+
Direct one-shot or multi-turn chat with Claude. No project, no PM, no Git.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# One-shot
|
|
64
|
+
sps agent "Explain this repo"
|
|
65
|
+
sps agent --output summary.md "Summarize the architecture"
|
|
66
|
+
|
|
67
|
+
# Multi-turn (daemon-backed, persistent sessions)
|
|
68
|
+
sps agent --chat # interactive REPL
|
|
69
|
+
sps agent --chat --name reviewer # named session, resume later
|
|
70
|
+
sps agent status # list active sessions
|
|
71
|
+
sps agent close --name reviewer
|
|
72
|
+
|
|
73
|
+
# Profile + context files
|
|
74
|
+
sps agent --profile reviewer "Review this module" --context src/auth.ts --context src/auth.test.ts
|
|
75
|
+
sps agent --system "You are a release engineer" "Plan the v0.52 cut"
|
|
76
|
+
|
|
77
|
+
# Verbose
|
|
78
|
+
sps agent --verbose "Why did this build fail?"
|
|
79
|
+
```
|
|
48
80
|
|
|
49
|
-
|
|
81
|
+
**`--profile <name>`**: looks up `~/.coral/skills/dev-worker/references/<name>.md`, injects as system prompt. (Different from `sps skill add` — that's for project-level skill linking.)
|
|
50
82
|
|
|
51
|
-
|
|
83
|
+
**Built-in agent**: `claude` only (Codex / Gemini support removed in v0.38). Workers communicate via ACP JSON-RPC over stdio with `claude-agent-acp`.
|
|
52
84
|
|
|
53
|
-
|
|
85
|
+
**Agent skills auto-loaded by Claude Code**: `~/.claude/skills/` is scanned by `claude` itself — including `sps-pipeline`, `sps-memory`, `wiki-update`, and the 24 dev/persona skills. Skill descriptions trigger lazy load; no SPS prompt injection needed for harness mode.
|
|
54
86
|
|
|
55
|
-
**
|
|
87
|
+
**Daemon cwd caveat**: `sps console` and `sps agent --chat` start a session daemon (`~/.coral/sessions/daemon.sock`) that captures `process.cwd()` at startup and uses it as the default working directory for all chat workers. To switch the chat's working directory, restart the daemon: `sps agent daemon stop && sps agent daemon start` from the desired cwd.
|
|
56
88
|
|
|
57
|
-
|
|
89
|
+
---
|
|
58
90
|
|
|
59
|
-
|
|
91
|
+
## Console mode (`sps console`)
|
|
92
|
+
|
|
93
|
+
Local web UI bundled into the binary. Single-instance guard via `~/.coral/console.lock`.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
sps console # opens http://127.0.0.1:4311
|
|
97
|
+
sps console --port 5000
|
|
98
|
+
sps console --no-open # don't auto-open browser
|
|
99
|
+
sps console --kill # stop running console
|
|
100
|
+
sps console --dev # vite dev server (development)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Pages:
|
|
104
|
+
|
|
105
|
+
| Path | Purpose |
|
|
60
106
|
|---|---|
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
|
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
107
|
+
| `/projects` | List all projects with status |
|
|
108
|
+
| `/projects/new` | Create project (form has Wiki toggle, v0.51+) |
|
|
109
|
+
| `/projects/<n>` | Pipeline editor + conf editor + delete |
|
|
110
|
+
| `/board` | Kanban (per-column scrolling, v0.51.1+) |
|
|
111
|
+
| `/workers` | Aggregate worker dashboard across projects |
|
|
112
|
+
| `/logs` | Live SSE log viewer |
|
|
113
|
+
| `/skills` | User-level skill management |
|
|
114
|
+
| `/system` | Global settings + daemon status |
|
|
115
|
+
| `/chat` | Agent chat (multi-session, persistent) |
|
|
116
|
+
|
|
117
|
+
Tech: Hono server on `127.0.0.1:4311`, chokidar watchers pushing SSE to React 19 + Vite + Tailwind v4 + shadcn/ui frontend. Design system: Pastel Neubrutalism, locked in [`console/DESIGN.md`](./console/DESIGN.md).
|
|
118
|
+
|
|
119
|
+
---
|
|
66
120
|
|
|
67
|
-
|
|
121
|
+
## Pipeline mode (`sps tick`)
|
|
68
122
|
|
|
69
|
-
|
|
123
|
+
Fully automated card-driven workflow. **One worker, one card at a time, serial.** Each card walks one or more YAML-defined stages (e.g. `develop → review → Done`); failure halts pipeline until you remove the `NEEDS-FIX` label.
|
|
70
124
|
|
|
71
|
-
|
|
72
|
-
- **L2** `index.md` excerpt — top-30 page TL;DRs (~500 tokens)
|
|
73
|
-
- **L3** pinned pages — explicitly referenced in card frontmatter
|
|
74
|
-
- **L4** skill-tag matches — pages tagged with the card's active skills
|
|
75
|
-
- **L5** BM25F keyword fallback — top-3 by title/desc
|
|
125
|
+
### Create a project
|
|
76
126
|
|
|
77
|
-
|
|
127
|
+
```bash
|
|
128
|
+
sps project init my-app
|
|
129
|
+
# or use Console /projects/new — has a Wiki toggle (v0.51+)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Asks for: project dir, merge branch, max workers, ACK timeout, optional GitLab remote, optional Matrix room.
|
|
133
|
+
|
|
134
|
+
Generates:
|
|
78
135
|
|
|
79
|
-
|
|
136
|
+
```
|
|
137
|
+
~/.coral/projects/my-app/
|
|
138
|
+
├── conf # mode 600 — your active config
|
|
139
|
+
├── conf.example # full reference (read-only docs)
|
|
140
|
+
├── pipelines/
|
|
141
|
+
│ ├── project.yaml # default 1-stage pipeline (develop → Done)
|
|
142
|
+
│ └── sample.yaml.example # heavily-commented YAML reference
|
|
143
|
+
└── pipeline_order.json # active pipeline pointer
|
|
144
|
+
```
|
|
80
145
|
|
|
81
|
-
|
|
82
|
-
SPS is **agent-agnostic**. Any coding agent that can read a skill and shell out — Claude Code, Codex, OpenClaw, your own — can drive SPS through the bundled `sps-pipeline` skill. The harness adapts to the agent, not the other way around. Wiring up a new agent means dropping a skill file; no SPS code change required. See [§6](#6-supported-agents) for the integration matrix.
|
|
146
|
+
In the target repo (PROJECT_DIR):
|
|
83
147
|
|
|
84
|
-
|
|
148
|
+
```
|
|
149
|
+
.claude/CLAUDE.md # worker rules (auto-installed)
|
|
150
|
+
.claude/skills/ # symlinked from ~/.coral/skills/
|
|
151
|
+
.claude/settings.local.json # Claude Code local config
|
|
152
|
+
wiki/ # if WIKI_ENABLED — see doc-28
|
|
153
|
+
ATTRIBUTION.md # if WIKI_ENABLED
|
|
154
|
+
```
|
|
85
155
|
|
|
86
|
-
|
|
156
|
+
### Run
|
|
87
157
|
|
|
88
158
|
```bash
|
|
89
|
-
sps
|
|
90
|
-
sps
|
|
91
|
-
sps
|
|
92
|
-
sps
|
|
159
|
+
sps tick my-app # foreground tick loop
|
|
160
|
+
sps pipeline start my-app # alias
|
|
161
|
+
sps pipeline stop my-app # graceful stop (alias: sps stop my-app)
|
|
162
|
+
sps stop --all # stop all running ticks
|
|
163
|
+
sps status # all projects
|
|
93
164
|
```
|
|
94
165
|
|
|
95
|
-
|
|
166
|
+
### Pipeline YAML
|
|
167
|
+
|
|
168
|
+
`~/.coral/projects/<n>/pipelines/project.yaml` — single source of truth for stages.
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
mode: project
|
|
172
|
+
git: true # false = non-code project, no git ops
|
|
173
|
+
stages:
|
|
174
|
+
- name: develop
|
|
175
|
+
profile: fullstack
|
|
176
|
+
on_complete: "move_card Review"
|
|
177
|
+
on_fail: { action: "label NEEDS-FIX", halt: true }
|
|
178
|
+
- name: review
|
|
179
|
+
profile: reviewer
|
|
180
|
+
on_complete: "move_card Done"
|
|
181
|
+
on_fail: { action: "label REVIEW-FAILED", halt: true }
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Critical rules:
|
|
185
|
+
1. `mode: project` for state-machine pipelines; `mode: steps` for one-shot custom (use `sps pipeline run <name>`).
|
|
186
|
+
2. Each stage's `on_complete` must point to the **next** stage's target state.
|
|
187
|
+
3. Last stage's `on_complete: "move_card Done"`.
|
|
188
|
+
4. Don't write `agent:` field — it's silently ignored (v0.38+ Claude is the only worker).
|
|
189
|
+
5. `trigger` and `card_state` are auto-derived per stage.
|
|
190
|
+
|
|
191
|
+
Field reference: see `~/.coral/projects/<n>/pipelines/sample.yaml.example` (auto-generated, comment-rich) or [doc-17](../../docs/design/17-pipeline-configuration-design.md).
|
|
192
|
+
|
|
193
|
+
---
|
|
96
194
|
|
|
97
|
-
|
|
195
|
+
## Card lifecycle
|
|
98
196
|
|
|
99
|
-
|
|
197
|
+
```
|
|
198
|
+
Backlog → Todo → Inprogress → [QA / Review] → Done
|
|
199
|
+
↑↓ ↓ fail
|
|
200
|
+
Planning NEEDS-FIX (halt)
|
|
201
|
+
(manual park, v0.51.9+)
|
|
202
|
+
```
|
|
100
203
|
|
|
101
|
-
**
|
|
204
|
+
**v0.51.10**: caller-aware default state.
|
|
205
|
+
- **`sps card add` (CLI / agent / API default)** → **Backlog**(自动跑)
|
|
206
|
+
- **Console "新卡片" 表单(人在 UI 操作)** → **Planning**(暂存,等用户拖到 Backlog)
|
|
102
207
|
|
|
103
|
-
|
|
208
|
+
CLI 用户想暂存:`sps card add ... --draft`。Console 用户想立即跑:勾"立即派发执行"。
|
|
209
|
+
卡片严格按 seq 排序;不再有 pipeline_order.json。
|
|
104
210
|
|
|
105
|
-
|
|
211
|
+
Default states (configurable via YAML `pm.card_states`).
|
|
106
212
|
|
|
107
|
-
|
|
213
|
+
```bash
|
|
214
|
+
sps card add <p> "Title" "Description"
|
|
215
|
+
sps card add <p> "T" "D" --skills python,backend --labels feature
|
|
108
216
|
|
|
109
|
-
|
|
217
|
+
sps card dashboard <p> # CLI table
|
|
218
|
+
# console: /board?project=<n>
|
|
110
219
|
|
|
111
|
-
|
|
220
|
+
sps card mark-started <p> <seq> # called by Claude Code UserPromptSubmit hook
|
|
221
|
+
sps card mark-complete <p> <seq> # called by Claude Code Stop hook
|
|
112
222
|
|
|
113
|
-
|
|
223
|
+
sps reset <p> # reset all non-Done cards
|
|
224
|
+
sps reset <p> --card 5,6,7
|
|
225
|
+
sps reset <p> --all # full reset incl. Done + worktrees + branches
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Card label vocabulary
|
|
229
|
+
|
|
230
|
+
| Label | Meaning | Set by |
|
|
231
|
+
|---|---|---|
|
|
232
|
+
| `AI-PIPELINE` | Required to enter pipeline | User on creation |
|
|
233
|
+
| `STARTED-<stage>` | ACK signal — Claude received the prompt | UserPromptSubmit hook |
|
|
234
|
+
| `COMPLETED-<stage>` | Worker finished a stage | Stop hook |
|
|
235
|
+
| `CLAIMED` | StageEngine reserved a worker slot | Engine |
|
|
236
|
+
| `NEEDS-FIX` | Worker failed; pipeline halted | Engine |
|
|
237
|
+
| `BLOCKED` | External dep; pipeline skips | User |
|
|
238
|
+
| `WAITING-CONFIRMATION` | Worker waiting on user input | Engine |
|
|
239
|
+
| `STALE-RUNTIME` | Inprogress > timeout | MonitorEngine |
|
|
240
|
+
| `ACK-TIMEOUT` | Claude never ACK'd within `WORKER_ACK_TIMEOUT_S` | MonitorEngine |
|
|
241
|
+
| `skill:<name>` | Force-load specific skill | User |
|
|
242
|
+
| `conflict:<domain>` | Serial-with-others-in-same-domain | User |
|
|
243
|
+
|
|
244
|
+
The active stage writes a per-slot marker file at `~/.coral/projects/<p>/runtime/worker-<slot>-current.json` (v0.50.21+). Stop hook reads it to detect which card the worker just finished.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Memory + Wiki
|
|
249
|
+
|
|
250
|
+
Two complementary persistence systems, both auto-injected into worker prompts.
|
|
251
|
+
|
|
252
|
+
| | **Memory** | **Wiki** (v0.51+) |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| Path | `~/.coral/memory/{user,agents,projects/<p>}/` | `<repo>/wiki/` (per-project, in repo) |
|
|
255
|
+
| Format | Flat markdown + YAML frontmatter | 5 page types with zod-validated frontmatter |
|
|
256
|
+
| Cross-link | None (flat index) | `[[type/Title]]` wikilinks |
|
|
257
|
+
| Auto-inject | `knowledge` section of prompt | `wikiContext` section (5-layer retrieval) |
|
|
258
|
+
| Opt-in | Always on (toggle via `ENABLE_MEMORY=false`) | Per-project (`WIKI_ENABLED=true`) |
|
|
259
|
+
| Best for | Personal prefs, ad-hoc decisions, gotchas | Structured project knowledge: modules, concepts, decisions, lessons |
|
|
260
|
+
|
|
261
|
+
### Memory CLI
|
|
114
262
|
|
|
115
263
|
```bash
|
|
116
|
-
#
|
|
117
|
-
|
|
118
|
-
sps
|
|
264
|
+
sps memory list <p> # show project memory index
|
|
265
|
+
sps memory list # global view (user + agents)
|
|
266
|
+
sps memory context <p> --card <seq> # preview prompt injection
|
|
119
267
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
sps skill sync --force # pull updated skill SOPs after upgrade
|
|
268
|
+
sps memory add <p> --type convention --name "API uses camelCase" \
|
|
269
|
+
--description "REST endpoints use camelCase" --body "..."
|
|
123
270
|
```
|
|
124
271
|
|
|
125
|
-
|
|
272
|
+
Types: `convention` (no decay), `decision` (slow), `lesson` (30 days), `reference` (no decay).
|
|
273
|
+
|
|
274
|
+
### Wiki CLI (when `WIKI_ENABLED=true`)
|
|
126
275
|
|
|
127
276
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
277
|
+
sps wiki init <p> # scaffold wiki/ (auto on project init if toggled on)
|
|
278
|
+
sps wiki update <p> # show source diff
|
|
279
|
+
sps wiki update <p> --finalize # flush manifest after worker writes pages
|
|
280
|
+
sps wiki check <p> # lint: orphan / dead-link / fm-gap / stale
|
|
281
|
+
sps wiki list <p> --type lesson --tag pipeline
|
|
282
|
+
sps wiki get <p> lessons/Stop-Hook-Race
|
|
283
|
+
sps wiki status <p> # source ↔ manifest ↔ pages diff
|
|
284
|
+
sps wiki add <p> ~/notes.md --category transcripts
|
|
285
|
+
sps wiki read <p> "<query>" # preview the 5-layer retrieval
|
|
133
286
|
```
|
|
134
287
|
|
|
135
|
-
|
|
288
|
+
The 5-layer retrieval: hot.md / index summary / pinned / skill-tag / BM25F keyword. Type priority: lesson = 3, decision = 3, concept = 2, module = 1, source = 1. Token budget capped at ~2000.
|
|
136
289
|
|
|
137
|
-
-
|
|
138
|
-
- **A working Claude Code installation locally.** Run `claude --help` first — if that works for you, SPS will work. SPS does not care **how** you authenticate Claude Code:
|
|
139
|
-
- Anthropic API key (`ANTHROPIC_API_KEY`)
|
|
140
|
-
- Claude Pro / Max subscription
|
|
141
|
-
- Third-party API gateway / proxy
|
|
142
|
-
- Any other auth method Claude Code supports
|
|
290
|
+
Worker SOP: [`skills/wiki-update/SKILL.md`](./skills/wiki-update/SKILL.md) (300 lines, single source of truth).
|
|
143
291
|
|
|
144
|
-
|
|
292
|
+
---
|
|
145
293
|
|
|
146
|
-
##
|
|
294
|
+
## Skills
|
|
147
295
|
|
|
148
|
-
|
|
296
|
+
User-level skills live in `~/.coral/skills/` (28 bundled, copied from npm package on `sps setup`). Symlinked into `~/.claude/skills/` so Claude Code auto-loads them.
|
|
149
297
|
|
|
150
298
|
```bash
|
|
151
|
-
sps
|
|
299
|
+
sps skill list # what's available + project status
|
|
300
|
+
sps skill add <name> --project <p> # symlink into <repo>/.claude/skills/
|
|
301
|
+
sps skill remove <name> --project <p>
|
|
302
|
+
sps skill freeze <name> --project <p> # symlink → real copy (allow project edits)
|
|
303
|
+
sps skill unfreeze <name> --project <p> # back to symlink
|
|
304
|
+
sps skill sync # ① bundled (npm pkg) → ~/.coral/skills/
|
|
305
|
+
# ② ~/.coral/skills/ → ~/.claude/skills/
|
|
306
|
+
sps skill sync --force # ⭐ overwrite existing user skills (after sps-cli upgrade)
|
|
152
307
|
```
|
|
153
308
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
309
|
+
Bundled skills (v0.51.3):
|
|
310
|
+
|
|
311
|
+
- **Dev (23)**: `frontend`, `frontend-developer`, `backend`, `backend-architect`, `typescript`, `golang`, `rust`, `python`, `java`, `kotlin`, `swift`, `mobile`, `database`, `database-optimizer`, `qa-tester`, `security-engineer`, `architecture-decision-records`, `coding-standards`, `debugging-workflow`, `devops`, `devops-automator`, `git-workflow`, `code-reviewer`
|
|
312
|
+
- **Worker profiles (3)**: `dev-worker`, `tax-worker`, `reviewer` (referenced via `--profile`)
|
|
313
|
+
- **SPS-specific (5)**: `sps-pipeline`, `sps-memory`, `wiki-update`
|
|
159
314
|
|
|
160
|
-
|
|
315
|
+
---
|
|
161
316
|
|
|
162
|
-
|
|
317
|
+
## Command reference
|
|
163
318
|
|
|
164
319
|
```bash
|
|
165
|
-
|
|
166
|
-
sps
|
|
320
|
+
# Setup & projects
|
|
321
|
+
sps setup [--force]
|
|
322
|
+
sps project init <name>
|
|
323
|
+
sps project doctor <name> [--fix] [--json] [--reset-state] [--skip-remote]
|
|
324
|
+
sps doctor <name> --fix # alias
|
|
325
|
+
|
|
326
|
+
# Pipeline
|
|
327
|
+
sps tick <project> [--json]
|
|
328
|
+
sps pipeline start|stop|status|reset|workers|board|card|logs|list|run|use [project] [args]
|
|
329
|
+
sps pipeline run <name> "<prompt>" # for mode: steps pipelines
|
|
330
|
+
sps pipeline tick <project> # one-off StageEngine pass
|
|
331
|
+
sps scheduler tick <project> # dormant since v0.51.9 (kept for tick orchestrator)
|
|
332
|
+
sps qa tick <project> # QA → Done finalization
|
|
333
|
+
sps monitor tick <project> # health probe (ACK timeout, stale)
|
|
334
|
+
sps pm scan <project> # rebuild card index from disk
|
|
335
|
+
|
|
336
|
+
# Cards
|
|
337
|
+
sps card add <p> "title" ["description"] [--skills a,b] [--labels x,y]
|
|
338
|
+
sps card dashboard <p>
|
|
339
|
+
sps card mark-started <p> [seq] [--stage <name>]
|
|
340
|
+
sps card mark-complete <p> <seq> [--stage <name>]
|
|
341
|
+
|
|
342
|
+
# Worker
|
|
343
|
+
sps worker ps <project>
|
|
344
|
+
sps worker dashboard <project>
|
|
345
|
+
sps worker kill <project> <seq>
|
|
346
|
+
sps worker launch <project> <seq>
|
|
347
|
+
|
|
348
|
+
# Status / logs
|
|
349
|
+
sps status [--json]
|
|
350
|
+
sps stop <project> [--all]
|
|
351
|
+
sps reset <project> [--all] [--card N,N,N]
|
|
352
|
+
sps logs [project] [--err] [--lines N] [--no-follow]
|
|
353
|
+
|
|
354
|
+
# Memory
|
|
355
|
+
sps memory list [project] [--agent <id>]
|
|
356
|
+
sps memory context <project> [--card <seq>] [--agent <id>]
|
|
357
|
+
sps memory add <project> --type <T> --name "title" [--body "content"]
|
|
358
|
+
|
|
359
|
+
# Wiki (v0.51+)
|
|
360
|
+
sps wiki init <p>
|
|
361
|
+
sps wiki update <p> [--finalize] [--json]
|
|
362
|
+
sps wiki read <p> "<query>" [--skills a,b] [--pinned id1,id2] [--budget N]
|
|
363
|
+
sps wiki check <p> [--json] [--fix]
|
|
364
|
+
sps wiki add <p> <file> [--category <name>] [--no-ingest]
|
|
365
|
+
sps wiki list <p> [--type T] [--tag T] [--json]
|
|
366
|
+
sps wiki get <p> <pageId> [--json]
|
|
367
|
+
sps wiki status <p> [--json]
|
|
368
|
+
|
|
369
|
+
# Skill
|
|
370
|
+
sps skill list [--project <p>]
|
|
371
|
+
sps skill add <name> [--project <p>]
|
|
372
|
+
sps skill remove <name> [--project <p>]
|
|
373
|
+
sps skill freeze <name> [--project <p>]
|
|
374
|
+
sps skill unfreeze <name> [--project <p>]
|
|
375
|
+
sps skill sync [--force]
|
|
376
|
+
|
|
377
|
+
# Console
|
|
378
|
+
sps console [--port N] [--host H] [--no-open] [--dev] [--kill]
|
|
379
|
+
|
|
380
|
+
# Agent
|
|
381
|
+
sps agent "<prompt>" [--profile <p>] [--system "..."] [--context file] [--output file] [--verbose]
|
|
382
|
+
sps agent --chat [--name <session>]
|
|
383
|
+
sps agent status|close|list|add [args]
|
|
384
|
+
sps agent daemon start|stop|status
|
|
385
|
+
|
|
386
|
+
# Hooks (called by Claude Code, not by users)
|
|
387
|
+
sps hook stop
|
|
388
|
+
sps hook user-prompt-submit
|
|
389
|
+
|
|
390
|
+
# ACP control (for advanced debugging)
|
|
391
|
+
sps acp <ensure|run|prompt|status|stop|pending|respond> <project> [args]
|
|
167
392
|
```
|
|
168
393
|
|
|
169
|
-
|
|
394
|
+
Add `--help` after any command to see its specific usage. Add `--json` for structured output where supported.
|
|
170
395
|
|
|
171
|
-
|
|
396
|
+
---
|
|
172
397
|
|
|
173
|
-
|
|
174
|
-
|
|
398
|
+
## Project config (conf)
|
|
399
|
+
|
|
400
|
+
Live at `~/.coral/projects/<name>/conf` (shell `export VAR="value"` syntax, mode 600). Full field reference (with comments) auto-generated at `~/.coral/projects/<name>/conf.example`.
|
|
401
|
+
|
|
402
|
+
| Field | Default | Notes |
|
|
403
|
+
|---|---|---|
|
|
404
|
+
| `PROJECT_NAME` | (required) | Internal id |
|
|
405
|
+
| `PROJECT_DIR` | (required) | Absolute path to repo |
|
|
406
|
+
| `GITLAB_PROJECT` | — | `user/repo` (optional, for GitLab API) |
|
|
407
|
+
| `GITLAB_PROJECT_ID` | — | Numeric ID (GitLab only; auto-resolved from path on first MR) |
|
|
408
|
+
| `GITLAB_MERGE_BRANCH` | `main` | Worker pushes here |
|
|
409
|
+
| `PM_TOOL` | `markdown` | **Only `markdown` supported as of v0.42**. Cards live in `~/.coral/projects/<n>/cards/<state>/<seq>.md` |
|
|
410
|
+
| `PIPELINE_LABEL` | `AI-PIPELINE` | Required label on cards to enter pipeline |
|
|
411
|
+
| `MR_MODE` | `none` | `none` (push direct) / `create` (open MR; needs `GITLAB_PROJECT_ID`) |
|
|
412
|
+
| `WORKER_TRANSPORT` | `acp-sdk` | Fixed; do not change |
|
|
413
|
+
| `MAX_CONCURRENT_WORKERS` | `1` | Slot count; cards still serial within a project |
|
|
414
|
+
| `MAX_ACTIONS_PER_TICK` | `3` | New tasks claimable per tick |
|
|
415
|
+
| `INPROGRESS_TIMEOUT_HOURS` | `2` | After this, MonitorEngine flags STALE-RUNTIME |
|
|
416
|
+
| `WORKER_ACK_TIMEOUT_S` | `300` | Wait for STARTED-<stage> label after dispatch (5min, raised in v0.50.24) |
|
|
417
|
+
| `WORKER_ACK_MAX_RETRIES` | `1` | ACK timeout retry count |
|
|
418
|
+
| `MONITOR_AUTO_QA` | `true` | Auto-advance to QA on stale runtime |
|
|
419
|
+
| `CONFLICT_DEFAULT` | `serial` | Fallback for cards without `conflict:` label |
|
|
420
|
+
| `MATRIX_ROOM_ID` | — | Project-level Matrix override |
|
|
421
|
+
| `WORKTREE_DIR` | `~/.coral/worktrees/<p>` | Worker scratch space |
|
|
422
|
+
| `DEFAULT_WORKER_SKILLS` | — | Comma-separated; fallback when no `profile:` and no `card.skills` |
|
|
423
|
+
| `ENABLE_MEMORY` | `true` | `false` skips memory write instructions in prompt |
|
|
424
|
+
| **`WIKI_ENABLED`** | unset (off) | **v0.51+**: `true` enables wiki context injection + reminder |
|
|
425
|
+
| `COMPLETION_SIGNAL` | `done` | Word the Stop hook listens for |
|
|
426
|
+
|
|
427
|
+
Global credentials at `~/.coral/env`: `GITLAB_URL`, `GITLAB_TOKEN`, `GITLAB_SSH_HOST`, `GITLAB_SSH_PORT`, `MATRIX_HOMESERVER`, `MATRIX_ACCESS_TOKEN`, `MATRIX_ROOM_ID`. Set via `sps setup` or `vim`.
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## Project layout
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
~/.coral/ # User-global state
|
|
435
|
+
├── env # Global credentials (mode 600)
|
|
436
|
+
├── skills/ # User-level skills (synced from npm)
|
|
437
|
+
├── memory/{user,agents,projects}/ # 3-layer memory store
|
|
438
|
+
├── projects/<name>/ # Per-project state
|
|
439
|
+
│ ├── conf # Project config (mode 600)
|
|
440
|
+
│ ├── conf.example # Field reference (auto-generated)
|
|
441
|
+
│ ├── pipelines/{project,*}.yaml # Pipeline definitions
|
|
442
|
+
│ ├── pipeline_order.json # Active pipeline pointer
|
|
443
|
+
│ ├── runtime/state.json # Worker slot + active card state
|
|
444
|
+
│ ├── runtime/worker-<slot>-current.json # Per-slot card marker (v0.50.21+)
|
|
445
|
+
│ ├── runtime/tick.lock # Tick lock
|
|
446
|
+
│ ├── runtime/acp-state.json # ACP session state
|
|
447
|
+
│ ├── cards/<state>/<seq>.md # Card files (markdown PM backend)
|
|
448
|
+
│ ├── cards/seq.txt # Sequence counter
|
|
449
|
+
│ ├── logs/ # Per-tick logs
|
|
450
|
+
│ └── pm_meta/ # Card index
|
|
451
|
+
├── sessions/ # Agent daemon (chat sessions)
|
|
452
|
+
│ ├── daemon.sock daemon.pid
|
|
453
|
+
│ └── chat-sessions/<id>.json # Persisted chat sessions
|
|
454
|
+
├── console.lock # Single-instance guard for console
|
|
455
|
+
└── worktrees/<project>/<seq>/ # Worker worktree per active card
|
|
175
456
|
```
|
|
176
457
|
|
|
177
|
-
|
|
458
|
+
In the target repo (PROJECT_DIR):
|
|
178
459
|
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
460
|
+
```
|
|
461
|
+
.claude/
|
|
462
|
+
├── CLAUDE.md # Worker rules (project-specific + SPS-injected)
|
|
463
|
+
├── settings.local.json # Claude Code local config
|
|
464
|
+
├── skills/ # Symlinked from ~/.coral/skills/
|
|
465
|
+
└── hooks/{start,stop}.sh # Lifecycle hooks (call into sps)
|
|
466
|
+
wiki/ # If WIKI_ENABLED — see docs/design/28-wiki-system.md
|
|
467
|
+
ATTRIBUTION.md # If WIKI_ENABLED
|
|
183
468
|
```
|
|
184
469
|
|
|
185
|
-
|
|
470
|
+
---
|
|
186
471
|
|
|
187
|
-
|
|
472
|
+
## Architecture
|
|
188
473
|
|
|
189
|
-
|
|
474
|
+
4-layer service architecture (v0.50+):
|
|
190
475
|
|
|
191
|
-
|
|
476
|
+
```
|
|
477
|
+
Delivery (commands/, console/routes/) Thin parameter parsing + I/O orchestration
|
|
478
|
+
↓
|
|
479
|
+
Service (services/) ProjectService / ChatService / PipelineService /
|
|
480
|
+
SkillService / WikiService — Result<T> + DomainEvent
|
|
481
|
+
↓
|
|
482
|
+
Domain (engines/) SchedulerEngine / StageEngine / MonitorEngine /
|
|
483
|
+
CloseoutEngine / EventHandler — pipeline logic
|
|
484
|
+
↓
|
|
485
|
+
Infrastructure WorkerManager (single worker), ACPWorkerRuntime,
|
|
486
|
+
(manager/, providers/, daemon/) sessionDaemon, TaskBackend, RepoBackend
|
|
487
|
+
```
|
|
192
488
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
| **Any other coding agent** | ✅ If it reads instructions and shells out, it can drive SPS |
|
|
489
|
+
Engines:
|
|
490
|
+
|
|
491
|
+
- **SchedulerEngine** — dormant since v0.51.9 (cards go directly to Backlog on add; Planning is a manual park). Class kept as a no-op for the tick orchestrator's stable interface.
|
|
492
|
+
- **StageEngine** — drives card through stages; builds prompt (skill + projectRules + memory + **wikiContext** + task description + **wikiUpdateReminder**); kicks worker via ACP.
|
|
493
|
+
- **MonitorEngine** — ACK timeout detection, stale runtime, auto-QA promotion.
|
|
494
|
+
- **CloseoutEngine** + **EventHandler** — finalize completed cards.
|
|
200
495
|
|
|
201
|
-
|
|
496
|
+
**Single-worker is intentional**: v0.37.2 deleted multi-worker concurrency code. Don't propose "add a parallel mode" — the architecture relies on serial execution for state coherence. For higher throughput, run multiple projects in parallel.
|
|
202
497
|
|
|
203
|
-
|
|
498
|
+
For deep dives:
|
|
499
|
+
- [doc-27: Service Layer Architecture](../../docs/design/27-service-layer-architecture.md) — current architecture
|
|
500
|
+
- [doc-26: Console Architecture](../../docs/design/26-console-architecture.md) — console internals
|
|
501
|
+
- [doc-28: Wiki System](../../docs/design/28-wiki-system.md) — wiki design
|
|
502
|
+
- [doc-13: Development Guardrails](../../docs/design/13-development-guardrails.md) — hard rules for contributors
|
|
503
|
+
- [doc-17: Pipeline Configuration](../../docs/design/17-pipeline-configuration-design.md) — YAML field semantics
|
|
504
|
+
- [docs/design/](../../docs/design/) — full design tree (most v0.15-v0.32 docs are marked HISTORICAL)
|
|
204
505
|
|
|
205
|
-
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
## Troubleshooting
|
|
509
|
+
|
|
510
|
+
```bash
|
|
511
|
+
sps doctor <project> --fix # ★ first thing to try
|
|
512
|
+
sps logs <project> --err # stderr / errors only
|
|
513
|
+
sps reset <project> --card <seq> # nuke a stuck card
|
|
514
|
+
sps reset <project> --all # full project reset
|
|
515
|
+
|
|
516
|
+
# Worker / daemon issues
|
|
517
|
+
sps worker ps <project>
|
|
518
|
+
sps agent daemon status # is the chat daemon up?
|
|
519
|
+
sps agent daemon stop && sps agent daemon start # restart (clears stale cwd)
|
|
520
|
+
|
|
521
|
+
# Wiki issues
|
|
522
|
+
sps wiki check <project>
|
|
523
|
+
sps wiki status <project>
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Common issues:
|
|
527
|
+
|
|
528
|
+
| Symptom | Cause / fix |
|
|
529
|
+
|---|---|
|
|
530
|
+
| Pipeline halted with `NEEDS-FIX` | Open the failed card, fix the issue, remove the label. Console makes this 2 clicks. |
|
|
531
|
+
| Worker not starting | `sps worker ps`, then `sps logs --err`. Often Claude API key missing or `claude-agent-acp` adapter not installed (`sps setup` reinstalls). |
|
|
532
|
+
| Cards stuck in Planning | Need `AI-PIPELINE` label. `sps card add` applies it automatically; if added externally, add manually. |
|
|
533
|
+
| ACK timeout on every card | Claude cold-start is slow with many skill / memory files. Raise `WORKER_ACK_TIMEOUT_S` (default 300s as of v0.50.24). |
|
|
534
|
+
| Console shows stale data | SSE may have dropped; reload page; if persistent, `sps console --kill && sps console`. |
|
|
535
|
+
| Wiki context not injecting | Verify `WIKI_ENABLED=true` in conf and `wiki/WIKI.md` exists. StageEngine logs a warning if conf says yes but scaffold is missing. |
|
|
536
|
+
| New skill SOP not pulling after upgrade | `sps skill sync --force` (default sync skips existing skills). |
|
|
537
|
+
| Daemon chat using wrong cwd | Daemon captures cwd at startup. `sps agent daemon stop && cd <repo> && sps agent daemon start`. |
|
|
206
538
|
|
|
207
|
-
|
|
208
|
-
- **Anthropic Claude Agent SDK** — ACP transport, sub-agent infrastructure
|
|
209
|
-
- **kepano / claude-obsidian** (MIT) — Wiki architecture, manifest, hot cache. Full attribution in [ATTRIBUTION.md](./ATTRIBUTION.md)
|
|
210
|
-
- **hono · chokidar · zod · yaml · vitest · biome** — runtime & toolchain
|
|
539
|
+
---
|
|
211
540
|
|
|
212
|
-
##
|
|
541
|
+
## License & attribution
|
|
213
542
|
|
|
214
|
-
[
|
|
543
|
+
MIT, see [`LICENSE`](../../LICENSE).
|
|
215
544
|
|
|
216
|
-
|
|
545
|
+
The Wiki system (v0.51+) borrows ~70% from [claude-obsidian](https://github.com/kepano/claude-obsidian) (MIT) — three-layer architecture, manifest delta tracking, hot cache, ingest workflow, contradiction callouts, wikilinks. SPS-specific 30%: 5 page types, `sources={card,commit,path}`, 5-layer reader, `sps wiki check` exit gate. Mental model from Karpathy's "LLM Wiki" gist.
|
|
217
546
|
|
|
218
|
-
|
|
547
|
+
Full attribution: [`ATTRIBUTION.md`](./ATTRIBUTION.md).
|