@coralai/sps-cli 0.51.10 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README-CN.md +131 -457
- package/README.md +131 -460
- package/dist/commands/skillCommand.js +17 -17
- package/dist/commands/skillCommand.js.map +1 -1
- package/dist/console/routes/chat.js +3 -3
- 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-DVmciGET.css +10 -0
- package/dist/console-assets/assets/index-mm4gDnm8.js +553 -0
- package/dist/console-assets/index.html +2 -2
- 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/main.js +79 -79
- package/dist/main.js.map +1 -1
- package/dist/providers/MarkdownTaskBackend.d.ts +6 -2
- package/dist/providers/MarkdownTaskBackend.d.ts.map +1 -1
- package/dist/providers/MarkdownTaskBackend.js +32 -20
- package/dist/providers/MarkdownTaskBackend.js.map +1 -1
- package/dist/services/CardService.js +14 -14
- package/dist/services/CardService.js.map +1 -1
- package/dist/services/ChatService.js +11 -11
- 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 +33 -33
- 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 +11 -11
- package/dist/services/SystemService.js.map +1 -1
- package/dist/services/WorkerService.js +11 -11
- package/dist/services/WorkerService.js.map +1 -1
- package/package.json +2 -2
- package/skills/sps-memory/SKILL.md +1 -1
- package/skills/sps-pipeline/SKILL.md +35 -15
- package/dist/console-assets/assets/index-BJ1T4p1K.css +0 -10
- package/dist/console-assets/assets/index-DKc9idxO.js +0 -553
package/README.md
CHANGED
|
@@ -1,547 +1,218 @@
|
|
|
1
|
-
# SPS CLI
|
|
1
|
+
# SPS CLI
|
|
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
|
+
## 1. Introduction
|
|
8
8
|
|
|
9
|
-
SPS (Smart Pipeline System)
|
|
9
|
+
SPS (Smart Pipeline System) is an open-source **AI-agent harness** that turns a single-line task into reviewed, committed, deployable output. It drives an underlying agent through a card-based pipeline — plan, execute, review, ship — with a per-project knowledge base auto-injected into every prompt.
|
|
10
10
|
|
|
11
|
-
|
|
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). |
|
|
16
|
-
|
|
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).
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Table of contents
|
|
11
|
+
### 24/7 unattended software development
|
|
22
12
|
|
|
23
|
-
|
|
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)
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Install & setup
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install -g @coralai/sps-cli # latest 0.51.x
|
|
42
|
-
sps setup # interactive wizard (must run once)
|
|
43
|
-
```
|
|
13
|
+
Drop tasks into the backlog and the harness runs them around the clock — planning, coding, testing, committing, opening MRs, escalating only when truly blocked. While you sleep, the pipeline ticks; your morning standup reads the merged commits. SPS exists so a single human can run a development team's worth of work without sitting in front of a chat window.
|
|
44
14
|
|
|
45
|
-
|
|
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.
|
|
15
|
+
### Beyond software — extensible to any domain via skills
|
|
51
16
|
|
|
52
|
-
|
|
17
|
+
The pipeline, skills, and knowledge layer are intentionally generic. Any process that can be expressed as "task in → reviewed output out" can be wired up by swapping the skill bundle:
|
|
53
18
|
|
|
54
|
-
**
|
|
19
|
+
- **Accounting** — invoice intake → categorization → ledger reconciliation → period close
|
|
20
|
+
- **Self-media** — topic research → drafting → review → publishing
|
|
21
|
+
- **AI video generation** — script → storyboard → render → cut → review
|
|
22
|
+
- **Writing** — research → outline → draft → revise → publish
|
|
23
|
+
- **Any other workflow** — define stages in YAML, write skills in markdown; the harness runs them
|
|
55
24
|
|
|
56
|
-
|
|
25
|
+
One CLI, one console, one filesystem-driven workflow. No vendor lock-in.
|
|
57
26
|
|
|
58
|
-
|
|
27
|
+

|
|
59
28
|
|
|
60
|
-
|
|
29
|
+
## 2. Core Concepts
|
|
61
30
|
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
```
|
|
31
|
+
### Harness
|
|
32
|
+
A long-running shell around the AI agent: daemon, supervisor, transport, profile management, file-system task lifecycle. The agent focuses on writing code; the harness owns the infrastructure.
|
|
80
33
|
|
|
81
|
-
|
|
34
|
+
### Pipeline
|
|
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.
|
|
82
36
|
|
|
83
|
-
|
|
37
|
+
### Skills
|
|
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.
|
|
84
39
|
|
|
85
|
-
|
|
40
|
+
### Memory
|
|
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`.
|
|
86
42
|
|
|
87
|
-
|
|
43
|
+
| Layer | Path | Scope |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| **User** | `~/.coral/memory/user/` | Cross-project preferences (style, language, workflow habits) |
|
|
46
|
+
| **Agent** | `~/.coral/memory/agents/<id>/` | Per-agent observations (communication patterns specific to one agent ↔ user pair) |
|
|
47
|
+
| **Project** | `~/.coral/memory/projects/<name>/` | Per-project conventions, architecture decisions, lessons, references |
|
|
88
48
|
|
|
89
|
-
|
|
49
|
+
Four entry types — `convention` (never decays), `decision` (slow), `lesson` (30-day decay), `reference` (never decays). Each layer keeps a flat directory of `*.md` files plus a `MEMORY.md` index. The agent reads it on demand and writes back when it discovers something worth keeping — a sparse, private drift; complementary to the dense, shared Wiki below.
|
|
90
50
|
|
|
91
|
-
|
|
51
|
+
### Knowledge Base — LLM Wiki
|
|
92
52
|
|
|
93
|
-
|
|
53
|
+
Inspired by Andrej Karpathy's "LLM Wiki": instead of re-reading source code from scratch every session, the agent **distills** project knowledge into a persistent, structured wiki that primes every future prompt.
|
|
94
54
|
|
|
95
|
-
|
|
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
|
-
```
|
|
55
|
+
**The problem**: An AI agent re-discovering your codebase on every task burns tokens, misses non-obvious decisions, and walks into the same gotcha twice. Most of the knowledge in a codebase is implicit — in commit context, in design tradeoffs, in incident postmortems that never made it back into the source.
|
|
102
56
|
|
|
103
|
-
|
|
57
|
+
**The wiki**: Workers continuously distill code, design docs, and completed cards into atomic, cross-linked pages:
|
|
104
58
|
|
|
105
|
-
|
|
|
59
|
+
| Page type | What it captures |
|
|
106
60
|
|---|---|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
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
|
-
---
|
|
61
|
+
| `modules/` | What each component does and how it's used |
|
|
62
|
+
| `concepts/` | Recurring patterns and architectural primitives |
|
|
63
|
+
| `decisions/` | Why a specific choice was made (with version anchor) |
|
|
64
|
+
| `lessons/` | Non-obvious gotchas surfaced from incidents |
|
|
65
|
+
| `sources/` | Distilled summaries of external materials added to `.raw/` (PDFs, articles, transcripts) |
|
|
120
66
|
|
|
121
|
-
|
|
67
|
+
**Self-maintaining**: After each card, the worker auto-writes back any new lessons or module changes — no manual curation. SOP lives in `skills/wiki-update/` and follows a 4-question filter (module changed? decision made? lesson learned? new pattern?). Four NOs = no write.
|
|
122
68
|
|
|
123
|
-
|
|
69
|
+
**Self-retrieving**: Every card prompt receives 5-layer auto-injection (~2K tokens) so the worker starts informed:
|
|
124
70
|
|
|
125
|
-
|
|
71
|
+
- **L1** `hot.md` — recent context (~500 tokens)
|
|
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
|
|
126
76
|
|
|
127
|
-
|
|
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:
|
|
77
|
+
**Compounds over time**: Each completed card adds to the corpus. The longer a project runs, the better workers understand it without reading raw source. Old workers' lessons prime new workers — the wiki *is* the project's institutional memory.
|
|
135
78
|
|
|
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
|
-
```
|
|
79
|
+
**Obsidian-compatible**: Stored at `<repo>/wiki/` with `[[wikilink]]` syntax and flat YAML frontmatter. Open the directory as an Obsidian vault for graph view, backlinks, and full-text search out of the box.
|
|
145
80
|
|
|
146
|
-
|
|
81
|
+
### Agent Mode
|
|
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.
|
|
147
83
|
|
|
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
|
-
```
|
|
84
|
+
## 3. Console
|
|
155
85
|
|
|
156
|
-
|
|
86
|
+
Launch the local web UI:
|
|
157
87
|
|
|
158
88
|
```bash
|
|
159
|
-
sps
|
|
160
|
-
sps
|
|
161
|
-
sps
|
|
162
|
-
sps
|
|
163
|
-
sps status # all projects
|
|
89
|
+
sps console # opens http://127.0.0.1:4311
|
|
90
|
+
sps console --port 5000 # custom port
|
|
91
|
+
sps console --no-open # don't auto-open the browser
|
|
92
|
+
sps console --kill # stop a running console
|
|
164
93
|
```
|
|
165
94
|
|
|
166
|
-
|
|
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
|
-
---
|
|
95
|
+
Single command, no extra services — kanban, chat, skills, workers, logs, projects all in one place.
|
|
194
96
|
|
|
195
|
-
|
|
97
|
+
**Kanban — card-driven workflow at a glance**
|
|
196
98
|
|
|
197
|
-
|
|
198
|
-
Backlog → Todo → Inprogress → [QA / Review] → Done
|
|
199
|
-
↑↓ ↓ fail
|
|
200
|
-
Planning NEEDS-FIX (halt)
|
|
201
|
-
(manual park, v0.51.9+)
|
|
202
|
-
```
|
|
99
|
+

|
|
203
100
|
|
|
204
|
-
**
|
|
205
|
-
- **`sps card add` (CLI / agent / API default)** → **Backlog**(自动跑)
|
|
206
|
-
- **Console "新卡片" 表单(人在 UI 操作)** → **Planning**(暂存,等用户拖到 Backlog)
|
|
101
|
+
**Chat — multi-turn agent conversations with tool-call streaming**
|
|
207
102
|
|
|
208
|
-
|
|
209
|
-
卡片严格按 seq 排序;不再有 pipeline_order.json。
|
|
103
|
+

|
|
210
104
|
|
|
211
|
-
|
|
105
|
+
**Skills — bundled & per-project skill management**
|
|
212
106
|
|
|
213
|
-
|
|
214
|
-
sps card add <p> "Title" "Description"
|
|
215
|
-
sps card add <p> "T" "D" --skills python,backend --labels feature
|
|
107
|
+

|
|
216
108
|
|
|
217
|
-
|
|
218
|
-
# console: /board?project=<n>
|
|
109
|
+
**Workers — capacity, runtime, stage-by-stage logs**
|
|
219
110
|
|
|
220
|
-
|
|
221
|
-
sps card mark-complete <p> <seq> # called by Claude Code Stop hook
|
|
111
|
+

|
|
222
112
|
|
|
223
|
-
|
|
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
|
|
113
|
+
## 4. Install
|
|
262
114
|
|
|
263
115
|
```bash
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
sps
|
|
116
|
+
# Install
|
|
117
|
+
npm install -g @coralai/sps-cli
|
|
118
|
+
sps setup # one-time interactive wizard
|
|
267
119
|
|
|
268
|
-
|
|
269
|
-
|
|
120
|
+
# Update
|
|
121
|
+
npm update -g @coralai/sps-cli
|
|
122
|
+
sps skill sync --force # pull updated skill SOPs after upgrade
|
|
270
123
|
```
|
|
271
124
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
### Wiki CLI (when `WIKI_ENABLED=true`)
|
|
125
|
+
### Build from source
|
|
275
126
|
|
|
276
127
|
```bash
|
|
277
|
-
|
|
278
|
-
sps
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
|
128
|
+
git clone https://github.com/edwardZhang/sps-cli.git
|
|
129
|
+
cd sps-cli
|
|
130
|
+
npm install
|
|
131
|
+
npm run build # tsc + console assets
|
|
132
|
+
npm link # symlink `sps` to local build
|
|
286
133
|
```
|
|
287
134
|
|
|
288
|
-
|
|
135
|
+
### Prerequisites
|
|
289
136
|
|
|
290
|
-
|
|
137
|
+
- **Node.js ≥ 18**
|
|
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
|
|
291
143
|
|
|
292
|
-
|
|
144
|
+
SPS spawns `claude` over the Agent Client Protocol; it inherits whatever credentials you've already configured. No separate SPS-side API key needed.
|
|
293
145
|
|
|
294
|
-
##
|
|
146
|
+
## 5. Quick Start
|
|
295
147
|
|
|
296
|
-
|
|
148
|
+
### Step 1 — Run the setup wizard (one time)
|
|
297
149
|
|
|
298
150
|
```bash
|
|
299
|
-
sps
|
|
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)
|
|
151
|
+
sps setup
|
|
307
152
|
```
|
|
308
153
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
154
|
+
The wizard:
|
|
155
|
+
- Creates `~/.coral/{projects,memory,sessions,skills}/` directory tree
|
|
156
|
+
- Copies bundled skills into `~/.coral/skills/` and symlinks them into `~/.claude/skills/` so Claude Code picks them up
|
|
157
|
+
- Installs `@agentclientprotocol/claude-agent-acp` globally so `claude` can be driven over ACP
|
|
158
|
+
- Optionally writes `~/.coral/env` (GitLab token, Matrix notification, etc. — all optional)
|
|
314
159
|
|
|
315
|
-
|
|
160
|
+
Re-runnable safely: `sps setup --force` keeps existing values as defaults. After upgrading sps-cli later, run **`sps skill sync --force`** to pull updated skill SOPs.
|
|
316
161
|
|
|
317
|
-
|
|
162
|
+
### Step 2 — Smoke-test with the agent (no project needed)
|
|
318
163
|
|
|
319
164
|
```bash
|
|
320
|
-
|
|
321
|
-
sps
|
|
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]
|
|
165
|
+
sps agent "Explain this repo" # one-shot
|
|
166
|
+
sps agent --chat # multi-turn REPL, persistent session
|
|
392
167
|
```
|
|
393
168
|
|
|
394
|
-
|
|
169
|
+
If this works, your Claude Code auth is good and SPS is wired correctly.
|
|
395
170
|
|
|
396
|
-
|
|
397
|
-
|
|
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
|
|
171
|
+
### Step 3 — Launch the console
|
|
432
172
|
|
|
173
|
+
```bash
|
|
174
|
+
sps console # http://127.0.0.1:4311
|
|
433
175
|
```
|
|
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
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
In the target repo (PROJECT_DIR):
|
|
459
|
-
|
|
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
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
---
|
|
471
|
-
|
|
472
|
-
## Architecture
|
|
473
176
|
|
|
474
|
-
4
|
|
177
|
+
### Step 4 — Run a pipeline
|
|
475
178
|
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
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
|
|
179
|
+
```bash
|
|
180
|
+
sps project init my-app --repo /path/to/repo # initialize a project
|
|
181
|
+
sps card add my-app "Add a login button" # add a task card
|
|
182
|
+
sps tick my-app # advance active cards one stage
|
|
487
183
|
```
|
|
488
184
|
|
|
489
|
-
|
|
185
|
+
**TUI dashboard** — compact multi-project view (`sps status`):
|
|
490
186
|
|
|
491
|
-
|
|
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.
|
|
187
|
+

|
|
495
188
|
|
|
496
|
-
|
|
189
|
+
## 6. Supported Agents
|
|
497
190
|
|
|
498
|
-
|
|
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)
|
|
191
|
+
SPS-CLI is shell-driven, so any coding agent that can read a skill and execute commands can use it as a task harness. We ship `skills/sps-pipeline/` — install it into the agent's skill directory and the agent immediately learns the full SPS command surface (cards, pipeline ticks, wiki, project setup, daemon lifecycle).
|
|
505
192
|
|
|
506
|
-
|
|
193
|
+
| Agent | Wire-up |
|
|
194
|
+
|---|---|
|
|
195
|
+
| **Claude Code** | ✅ `sps skill sync` symlinks `sps-pipeline` into `~/.claude/skills/`; auto-loaded on description match |
|
|
196
|
+
| **Codex** | ✅ Drop `skills/sps-pipeline/SKILL.md` into the Codex skill directory |
|
|
197
|
+
| **OpenClaw** | ✅ Same — point its skill loader at `skills/sps-pipeline/` |
|
|
198
|
+
| **Harness Agent** | ✅ Same pattern — the skill is agent-agnostic |
|
|
199
|
+
| **Any other coding agent** | ✅ If it reads instructions and shells out, it can drive SPS |
|
|
507
200
|
|
|
508
|
-
|
|
201
|
+
The skill is plain markdown — copy it, adapt it, fork it. SPS owns orchestration; the agent owns intent.
|
|
509
202
|
|
|
510
|
-
|
|
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:
|
|
203
|
+
## 7. Acknowledgements
|
|
527
204
|
|
|
528
|
-
|
|
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`. |
|
|
205
|
+
SPS stands on the shoulders of:
|
|
538
206
|
|
|
539
|
-
|
|
207
|
+
- **Andrej Karpathy** — ["LLM Wiki"](https://gist.github.com/karpathy) mental model — the foundation for SPS's knowledge layer
|
|
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
|
|
540
211
|
|
|
541
|
-
## License
|
|
212
|
+
## 8. License
|
|
542
213
|
|
|
543
|
-
MIT
|
|
214
|
+
[MIT](./LICENSE)
|
|
544
215
|
|
|
545
|
-
|
|
216
|
+
## 9. Copyright
|
|
546
217
|
|
|
547
|
-
|
|
218
|
+
Copyright (c) 2026 Coral AI
|