@rryando/arcs 3.6.0 → 3.8.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.
Files changed (70) hide show
  1. package/README.md +180 -229
  2. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  3. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  4. package/dist/cli/arcs-orchestrate.js +59 -30
  5. package/dist/cli/arcs-orchestrate.js.map +1 -1
  6. package/dist/cli/brief-renderer.d.ts +5 -0
  7. package/dist/cli/brief-renderer.d.ts.map +1 -1
  8. package/dist/cli/brief-renderer.js +7 -0
  9. package/dist/cli/brief-renderer.js.map +1 -1
  10. package/dist/cli/commands/batch.js +24 -1
  11. package/dist/cli/commands/batch.js.map +1 -1
  12. package/dist/cli/commands/brief.js +24 -0
  13. package/dist/cli/commands/brief.js.map +1 -1
  14. package/dist/cli/commands/knowledge-search.js +2 -1
  15. package/dist/cli/commands/knowledge-search.js.map +1 -1
  16. package/dist/cli/commands/knowledge.js +112 -11
  17. package/dist/cli/commands/knowledge.js.map +1 -1
  18. package/dist/cli/commands/utility.d.ts +1 -1
  19. package/dist/cli/commands/utility.d.ts.map +1 -1
  20. package/dist/cli/commands/utility.js +60 -2
  21. package/dist/cli/commands/utility.js.map +1 -1
  22. package/dist/cli/instructions.d.ts.map +1 -1
  23. package/dist/cli/instructions.js +0 -2
  24. package/dist/cli/instructions.js.map +1 -1
  25. package/dist/cli/md-renderer.d.ts.map +1 -1
  26. package/dist/cli/md-renderer.js +5 -0
  27. package/dist/cli/md-renderer.js.map +1 -1
  28. package/dist/cli/setup.d.ts.map +1 -1
  29. package/dist/cli/setup.js +3 -5
  30. package/dist/cli/setup.js.map +1 -1
  31. package/dist/utils/knowledge-templates.d.ts +51 -0
  32. package/dist/utils/knowledge-templates.d.ts.map +1 -0
  33. package/dist/utils/knowledge-templates.js +209 -0
  34. package/dist/utils/knowledge-templates.js.map +1 -0
  35. package/opencode/arcs/bundle-runtime.json +7 -7
  36. package/opencode/arcs/manifest.json +0 -64
  37. package/opencode/arcs/prompts/arcs-docs.txt +11 -5
  38. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +59 -30
  39. package/opencode/arcs/prompts/arcs-orchestrate.txt +59 -30
  40. package/opencode/arcs/prompts/code-reviewer.txt +45 -1
  41. package/opencode/arcs/prompts/devil-advocate.txt +9 -0
  42. package/opencode/arcs/prompts/docs-researcher.txt +10 -8
  43. package/opencode/arcs/prompts/graph-explorer.txt +9 -6
  44. package/opencode/arcs/prompts/oncall-ops.txt +10 -7
  45. package/opencode/arcs/prompts/software-engineer.txt +8 -3
  46. package/opencode/arcs/prompts/tech-architect.txt +58 -18
  47. package/opencode/arcs/skills/brainstorming/SKILL.md +6 -0
  48. package/opencode/arcs/skills/code-agent/SKILL.md +4 -0
  49. package/opencode/arcs/skills/deep-pr-review/SKILL.md +9 -4
  50. package/opencode/arcs/skills/deep-pr-review/review-template.md +1 -1
  51. package/opencode/arcs/skills/executing-plans/SKILL.md +161 -1
  52. package/opencode/arcs/skills/init-project/SKILL.md +8 -10
  53. package/opencode/arcs/skills/quick-dev/SKILL.md +4 -0
  54. package/opencode/arcs/skills/requesting-code-review/SKILL.md +9 -1
  55. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +1 -1
  56. package/opencode/arcs/skills/test-driven-development/SKILL.md +1 -1
  57. package/opencode/arcs/skills/the-ladder/SKILL.md +2 -0
  58. package/opencode/arcs/skills/writing-knowledge/SKILL.md +74 -0
  59. package/opencode/arcs/skills/writing-plans/SKILL.md +8 -3
  60. package/package.json +4 -1
  61. package/scripts/build-opencode-bundle.mjs +0 -2
  62. package/scripts/deploy-claudecode-bundle.mjs +0 -16
  63. package/scripts/lint-bundle.mjs +0 -2
  64. package/skills/init-project.md +7 -8
  65. package/opencode/arcs/prompts/qa-analyst.txt +0 -82
  66. package/opencode/arcs/prompts/system-architect.txt +0 -88
  67. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +0 -181
  68. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/code-quality-reviewer-prompt.md +0 -0
  69. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/implementer-prompt.md +0 -0
  70. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/spec-reviewer-prompt.md +0 -0
package/README.md CHANGED
@@ -10,82 +10,84 @@
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
11
11
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
12
12
 
13
- *Persistent workflow continuity for AI agents start from context, not a blank slate.*
13
+ *Stop re-explaining your project to the AI every session.*
14
14
 
15
15
  </div>
16
16
 
17
17
  ---
18
18
 
19
- ARCS gives AI coding agents a queryable project DAG so they never start cold. Instead of scanning a codebase from scratch, an agent calls `arcs brief` and gets back: what to work on, what was decided, and what went wrong last time in a single ~1 KB JSON envelope.
19
+ Your AI coding agent is stateless. Every session, it scans the codebase from scratch, forgets what failed last time, and has no idea which task is safe to start. **ARCS is the durable memory that fixes that.**
20
20
 
21
- > **arcs** `/ɑːrks/` Directed edges in graph theory. Also: **A**gent **R**outing & **C**ontext **S**ystem.
21
+ It's a CLI-native tool that gives agents a persistent, queryable project **DAG** — with real dependency semantics. An agent calls `arcs brief` and gets back an *operating brief*: what to work on, what's blocked, what was decided, and what already broke — in a single ~1 KB JSON envelope, with zero source files read. Work happens, results flow back into the graph, and the next session starts from context instead of a blank slate.
22
22
 
23
- ---
23
+ > **arcs** `/ɑːrks/` — directed edges in graph theory. Also: **A**gent **R**outing & **C**ontext **S**ystem.
24
24
 
25
+ ---
25
26
 
26
- ## The Problem
27
+ ## Before / After
27
28
 
28
- Every AI coding session starts fresh. The agent doesn't know:
29
- - What task to pick up next (and which tasks are blocked by incomplete work)
30
- - What was already tried and failed
31
- - What architectural decisions were made
32
- - What the current plan looks like
29
+ A normal session vs. a session with ARCS:
33
30
 
34
- ARCS solves this with three persistent surfaces:
31
+ | | Without ARCS | With ARCS |
32
+ |---|---|---|
33
+ | **Orientation** | Re-scan the repo, re-read files, re-derive the architecture | `arcs brief` → operating brief in ~1 KB |
34
+ | **Picking work** | Guess what's next; trip over half-finished dependencies | `arcs next` → first task whose deps are *all* satisfied |
35
+ | **Prior knowledge** | Re-discover the same gotcha you hit last week | Related knowledge surfaces alongside the task |
36
+ | **Finishing** | Result evaporates when the session ends | `arcs done` unblocks dependents; `arcs remember` captures the lesson |
35
37
 
36
- | Surface | Storage | Purpose |
37
- |---------|---------|---------|
38
- | **Queue** | `tasks/index.json` | Work items with dependency ordering via `dependsOn` |
39
- | **Plan** | `plans/*.md` + `.diagram.mmd` | Multi-step feature work with Mermaid execution maps |
40
- | **Memory** | `knowledge/*.md` | Durable discoveries: lessons, patterns, gotchas, architecture |
38
+ The DAG is the shared, durable memory *between* otherwise-disconnected agent sessions. The knowledge base only compounds — instead of re-deriving — when entries are substantive **and** read before work. ARCS enforces both (see [Knowledge Depth](#knowledge-depth)).
41
39
 
42
40
  ---
43
41
 
42
+ ## Three Surfaces
43
+
44
+ ARCS persists everything onto three surfaces, plus a dependency graph and auto-generated Mermaid diagrams that tie them together.
45
+
46
+ | Surface | Storage | What it holds |
47
+ |---------|---------|---------------|
48
+ | **Queue** | `tasks/index.json` (rendered to `tasks.md`) | Immediate work items, ordered by `dependsOn` edges |
49
+ | **Plan** | `plans/*.md` + `.diagram.mmd` | Durable multi-step change records with Mermaid execution maps |
50
+ | **Memory** | `knowledge/*.md` | Reusable discoveries: gotchas, lessons, patterns, architecture, decisions |
44
51
 
52
+ Dependency-aware selection runs across all three: `arcs next` returns the next unblocked task, and `arcs diagram ready` returns the unblocked nodes of a plan's execution map.
53
+
54
+ ---
45
55
 
46
56
  ## Quick Start
47
57
 
48
- **1. First Time Setup: Install / Update**
58
+ **1. Install**
49
59
 
50
60
  ```bash
51
61
  npm install -g @rryando/arcs
52
-
53
- # setup models
54
62
  arcs init
55
63
  ```
56
64
 
57
- Registers `arcs` CLI, creates `~/.arcs/`, and runs an interactive TUI wizard that:
58
- - Detects **OpenCode** and/or **Claude Code** on PATH
59
- - Selects which platforms to configure (or both)
60
- - For **OpenCode**: picks heavy / standard / light model tiers from authenticated providers
61
- - For **Claude Code**: picks heavy / standard / light model tiers from the full Claude model list (opus / sonnet / haiku families), pre-filled from `~/.claude/settings.json`
62
- - Deploys agents + skills to the appropriate config directories
65
+ `arcs init` runs an interactive setup wizard that:
66
+ - Detects **OpenCode** and/or **Claude Code** on your PATH
67
+ - Lets you pick which platform(s) to configure
68
+ - Selects heavy / standard / light model tiers from your authenticated providers
69
+ - Deploys the ARCS agent + skill bundle to the right config directories
63
70
 
64
- **2. Init Existing Project to arcs**
71
+ **2. Onboard a project**
65
72
 
66
73
  ```bash
67
74
  cd your-project
68
-
69
- opencode
70
-
71
- send `arch init` on ARCS Orchestrator subagent
72
-
73
- and follow thru initiation process
74
75
  ```
75
76
 
76
- <img width="948" height="499" alt="image" src="https://github.com/user-attachments/assets/2795bd80-f1bb-4c34-9a60-9b6ef9d81d04" />
77
+ Open OpenCode (or Claude Code), select the **ARCS Orchestrator** agent, and ask it to initialize. It scans the repo and populates the DAG — overview, tasks, plans, and an initial pass of structural knowledge.
77
78
 
79
+ <img width="948" height="499" alt="ARCS Orchestrator init" src="https://github.com/user-attachments/assets/2795bd80-f1bb-4c34-9a60-9b6ef9d81d04" />
78
80
 
79
- **3. Use it**
81
+ **3. Use it — by hand or via the orchestrator**
80
82
 
81
83
  ```bash
82
- arcs brief # What should I work on?
83
- arcs next # Get next unblocked task
84
+ arcs brief # What should I work on? (operating brief)
85
+ arcs next # Next dependency-safe task + related knowledge
84
86
  arcs done <taskId> # Mark complete, unblock dependents
85
- arcs remember "..." # Capture what I learned
87
+ arcs remember "..." # Capture what you learned
86
88
  ```
87
89
 
88
- Or select **ARCS Orchestrator** in OpenCode for full automation.
90
+ Or hand the loop to the **ARCS Orchestrator** for full automation.
89
91
 
90
92
  ---
91
93
 
@@ -93,25 +95,27 @@ Or select **ARCS Orchestrator** in OpenCode for full automation.
93
95
 
94
96
  | Tool | Required | Notes |
95
97
  |------|----------|-------|
96
- | [Node.js](https://nodejs.org/) v20+ | Yes | Runtime |
97
- | [OpenCode](https://opencode.ai/) | Recommended | Agent host (orchestrator + sub-agents) |
98
- | [Claude Code](https://claude.ai/code) | Recommended | Alternative agent host `arcs init` deploys ARCS sub-agents with full model-tier selection |
99
- | [codegraph](https://github.com/colbymchenry/codegraph) | No | Optional code-intelligence: per-project index, MCP-based exploration, structural knowledge extraction |
100
- | [rtk](https://github.com/rtk-ai/rtk) | No | Optional token-optimized command proxy (60-90% savings on shell output) — `arcs init` and bundle deploys auto-wire it for OpenCode and Claude Code when present |
98
+ | [Node.js](https://nodejs.org/) 20+ | Yes | Runtime |
99
+ | [OpenCode](https://opencode.ai/) | Recommended | Agent host orchestrator + sub-agents |
100
+ | [Claude Code](https://claude.ai/code) | Recommended | Alternative agent host; `arcs init` deploys the sub-agents with full model-tier selection |
101
+ | [codegraph](https://github.com/colbymchenry/codegraph) | Optional | Per-project code-intelligence index, queried via MCP; degrades gracefully when absent |
102
+ | [rtk](https://github.com/rtk-ai/rtk) | Optional | Token-optimized command proxy; auto-wired into both hosts when present |
103
+
104
+ ARCS itself is **CLI-only** — pure TypeScript, no MCP server, no preview server. The optional tools above are about the agent *host*, not ARCS.
101
105
 
102
106
  ---
103
107
 
104
108
  ## How It Works
105
109
 
106
- ### The Core Loop
110
+ ### The core loop
107
111
 
108
112
  ```
109
113
  arcs next → [agent works] → arcs done <id> → arcs remember "..."
110
- │ │
111
- returns first task │ completes task, │ captures durable
112
- whose dependencies │ unblocks dependents │ knowledge for
113
- are ALL satisfied │ │ future sessions
114
- ▼ ▼
114
+ │ │
115
+ │ first task whose │ completes task, │ captures durable
116
+ dependencies are │ unblocks dependents │ knowledge for
117
+ │ ALL satisfied │ │ future sessions
118
+ ▼ ▼
115
119
  ┌─────────────────────────────────────────────────────────────────┐
116
120
  │ ~/.arcs/projects/{slug}/ │
117
121
  │ │
@@ -121,11 +125,9 @@ arcs next → [agent works] → arcs done <id> → arcs remember "..."
121
125
  └─────────────────────────────────────────────────────────────────┘
122
126
  ```
123
127
 
124
- Three commands: `arcs next` work → `arcs done`. The DAG handles ordering.
125
-
126
- ### Task Dependencies — The Actual DAG
128
+ ### Task dependencies the actual DAG
127
129
 
128
- Tasks declare dependencies. ARCS enforces acyclicity and uses topological sort to determine execution order:
130
+ Tasks declare dependencies. ARCS enforces acyclicity and uses topological sort to decide execution order:
129
131
 
130
132
  ```bash
131
133
  arcs task create myapp "Design database schema" --priority=high
@@ -152,48 +154,9 @@ flowchart TD
152
154
  classDef blocked fill:#ef4444,color:#fff
153
155
  ```
154
156
 
155
- `arcs next` returns "Write integration tests" (T003) it's the first task whose dependencies are all done. T004 is blocked because T003 isn't done yet. Priority is a tiebreaker within the same topological level, not the primary sort.
156
-
157
- ### The Orchestrator
157
+ `arcs next` returns **"Write integration tests"** — the first task whose dependencies are all done. "Deploy to staging" stays blocked until it is. Priority is only a tiebreaker *within* the same topological level, never the primary sort.
158
158
 
159
- When used with [OpenCode](https://opencode.ai/), ARCS ships a full orchestrator that automates the loop:
160
-
161
- ```mermaid
162
- flowchart TD
163
- User(["User Request"])
164
- T0["arcs brief → T0 envelope"]
165
- Classify{"Classify Intent"}
166
-
167
- Init["INIT\nScan repo → populate DAG"]
168
- Brain["BRAINSTORM\nCreate plan → wire dependsOn\n→ generate diagram"]
169
- Exec["EXECUTE\narcs next → dispatch sub-agent\n→ arcs done → unblock dependents"]
170
- Sync["SYNC\nAudit DAG → reconcile drift"]
171
-
172
- DAG[("Project DAG\ntasks + plans + knowledge\n+ dependency graph")]
173
-
174
- User --> T0 --> Classify
175
- Classify -- "new project" --> Init
176
- Classify -- "plan features" --> Brain
177
- Classify -- "do work" --> Exec
178
- Classify -- "update docs" --> Sync
179
- Init & Brain & Exec & Sync --> DAG
180
- ```
181
-
182
- The orchestrator:
183
- 1. **Orients** — calls `arcs brief` for the T0 routing envelope (~1 KB)
184
- 2. **Classifies** — detects intent (INIT / BRAINSTORM / EXECUTE / SYNC / EXPLORE)
185
- 3. **Delegates** — dispatches specialist sub-agents in parallel when possible
186
- 4. **Consumes** — parses structured sub-agent output (STATUS, FILES_TOUCHED, VERIFY, BLOCKED_BY)
187
- 5. **Persists** — writes to DAG: task transitions, knowledge captures, plan updates
188
- 6. **Advances** — `arcs done` completes tasks, automatically unblocking dependents
189
-
190
- **Operating values — held directly, not just delegated.** The orchestrator applies the same disciplines it hands to sub-agents to its *own* routing decisions:
191
-
192
- - **`the-ladder`** — minimalism is the default for orchestration itself. The cheapest rung that answers the need wins: *answer from context → one `arcs` CLI call → `graph-explorer` → typed agent*, with the fewest tasks and the smallest disjoint scope per dispatch. Over-dispatching and over-decomposing are the orchestrator's form of over-engineering.
193
- - **`devil-advocate`** — skepticism runs *before* the formal gate, not only at it. Every plan, dispatch, and "done" is challenged first ("what breaks without this? who's actually blocked? can fewer agents do it?"); the dispatched gate then merely confirms.
194
- - **confidence-to-orchestrate** — it never dispatches on a guess. Ambiguity is resolved cheaply from the DAG first, then the *residual* unknowns go to the user as batched questions (each with options + a recommended default) until it can state the goal and "done" in one sentence — and it stops asking the moment it can.
195
-
196
- ### T0 Routing Envelope (the operating brief)
159
+ ### The operating brief (`arcs brief`)
197
160
 
198
161
  ```bash
199
162
  $ arcs brief --lean --json
@@ -217,78 +180,141 @@ $ arcs brief --lean --json
217
180
  }
218
181
  ```
219
182
 
220
- ~1 KB. No source files read. The orchestrator uses `recommendedSurface` to pick the workflow branch.
183
+ ~1 KB, no source files read. `recommendedSurface` (QUEUE / PLAN / MEMORY) tells the agent which workflow branch to take. `brief` also reports a `knowledgeHealth` line (`{ total, thin, stale }`) so an under-maintained knowledge base is visible right at orientation.
184
+
185
+ ---
186
+
187
+ ## The Agent Bundle
188
+
189
+ ARCS ships an OpenCode / Claude Code bundle: a **delegation-first orchestrator**, **8 typed sub-agents**, and **15 skills**, deployed via `arcs deploy-superpowers` (or wired automatically by `arcs init`).
190
+
191
+ ### The orchestrator
192
+
193
+ It never reads code, runs tests, or explores directly — it routes. It also holds its own operating values rather than only delegating them:
194
+
195
+ - **`the-ladder`** — minimalism applies to orchestration itself. The cheapest rung that answers the need wins: *answer from context → one `arcs` CLI call → `graph-explorer` → typed agent*, with the fewest tasks and smallest disjoint scope per dispatch.
196
+ - **`devil-advocate`** — every plan, dispatch, and "done" is challenged *before* the formal gate ("what breaks without this? who's actually blocked? can fewer agents do it?"); the gate then merely confirms.
197
+ - **confidence-to-orchestrate** — it never dispatches on a guess. Ambiguity is resolved cheaply from the DAG first, then residual unknowns go to the user as batched questions — and it stops asking the moment it can state the goal and "done" in one sentence.
198
+
199
+ A **read-first knowledge protocol** runs throughout: prior knowledge is read before every non-mechanical dispatch, and durable insight is captured at fan-in via idempotent `arcs knowledge upsert` — so the DAG compounds instead of duplicating.
200
+
201
+ ### Sub-agents
202
+
203
+ Each has a sharp niche; survivors carry explicit modes. The orchestrator dispatches them with self-contained scoped prompts (SCOPE / GOAL / CONTEXT / IDS / CONSTRAINTS / SKILL / VERIFY / RETURN) and consumes their structured, non-prose output.
204
+
205
+ | Sub-agent | Role |
206
+ |-----------|------|
207
+ | **graph-explorer** | DAG-first + codegraph-MCP exploration — "where is X / what depends on Y" |
208
+ | **software-engineer** | Writes code; verifies only the files it touched |
209
+ | **tech-architect** | Deep structural analysis, refactor guidance, trade-off evaluation |
210
+ | **oncall-ops** | Debugging, log triage, bisect, root-cause analysis |
211
+ | **code-reviewer** | Read-only review — reactive diff/PR review **and** proactive convention/architecture audit |
212
+ | **devil-advocate** | Adversarial KISS/YAGNI/DRY gate; its completion gate is the single full-project verification |
213
+ | **arcs-docs** | DAG health, plan/knowledge/diagram curation |
214
+ | **docs-researcher** | External research and documentation; tech-stack scans |
215
+
216
+ Every sub-agent opens with the standard return envelope so the orchestrator can parse, not re-read:
217
+
218
+ ```
219
+ STATUS: done | blocked | partial
220
+ FILES_TOUCHED: src/foo.ts
221
+ VERIFY: vitest run test/foo.test.ts → pass
222
+ BLOCKED_BY: <only when blocked/partial — evidence>
223
+ KNOWLEDGE: none
224
+ ```
225
+
226
+ Sub-agents verify only the files they touched. The **devil-advocate completion gate** runs the session's single full-project pass (full suite + `tsc --noEmit`); on a block, the orchestrator re-dispatches scoped fixes and re-gates.
227
+
228
+ ### Skills (loaded per dispatch)
229
+
230
+ | Category | Skills |
231
+ |----------|--------|
232
+ | **Work mode** (pick one) | `quick-dev`, `code-agent`, `test-driven-development`, `brainstorming` |
233
+ | **Lifecycle** | `writing-plans`, `executing-plans` (sequential or parallel), `writing-knowledge` |
234
+ | **Quality** | `requesting-code-review`, `deep-pr-review`, `systematic-debugging` |
235
+ | **Discipline** | `the-ladder` (auto-layers under work modes — not a mode you pick) |
236
+ | **Tooling** | `to-diagram`, `init-project`, `caveman-commit`, `enriching-codegraph-proposals` |
237
+
238
+ `the-ladder` climbs to the lowest rung that solves the problem — **YAGNI → standard library → native feature → existing dependency → one line → the minimum that works** — while never simplifying away hard carve-outs (trust-boundary validation, data-loss handling, security, accessibility, anything explicitly requested).
221
239
 
222
240
  ---
223
241
 
224
- ## CLI Reference
242
+ ## Knowledge Depth
243
+
244
+ Thin, one-sentence memory doesn't compound. ARCS treats knowledge depth as a first-class concern:
225
245
 
226
- All commands: `arcs <command> [args] --json`. Output: `{ok, data}` on success, `{ok, code, message}` on error.
246
+ - **Per-kind body templates** each of the 8 knowledge kinds has a fillable skeleton. Scaffold one with `arcs knowledge template --kind=<kind>`.
247
+ - **Write-time guard** — `knowledge create` / `upsert` warn on shallow bodies (and on missing summary or source files) unless you explicitly opt out with `--allow-thin`.
248
+ - **`knowledge-health` validator** — `arcs validate <slug> --checks=knowledge-health` flags thin and stale entries; the same counts surface in `arcs brief`.
227
249
 
228
- ### Core Agent Loop
250
+ The throughline: substantive entries, written once and read before work, are what turn the knowledge base into compounding memory rather than a graveyard.
251
+
252
+ ---
253
+
254
+ ## Command Cheat-Sheet
255
+
256
+ All commands take `--json` for structured output (`{ok, data}` on success, `{ok, code, message}` on error) and `--lean` to strip timestamps and save tokens. Full discovery: `arcs --commands --json`.
257
+
258
+ ### Core loop
229
259
 
230
260
  | Command | Purpose |
231
261
  |---------|---------|
232
- | `arcs brief` | T0 routing envelope what to focus on |
233
- | `arcs next` | Next dependency-safe task + related knowledge |
234
- | `arcs done <taskId>` | Mark complete, unblock dependents |
235
- | `arcs remember "<text>"` | Capture knowledge (auto-classifies kind) |
236
- | `arcs status` | Progress overview across all surfaces |
262
+ | `arcs brief <slug>` | Operating brieffocus + knowledge-health counts |
263
+ | `arcs next <slug>` | Next dependency-safe task + related knowledge |
264
+ | `arcs done <slug> <taskId>` | Mark complete, unblock dependents |
265
+ | `arcs remember <slug> "<text>"` | Capture knowledge (auto-classifies kind) |
266
+ | `arcs status <slug>` | Progress across all three surfaces |
237
267
 
238
- ### Tasks & Dependencies
268
+ ### Tasks & plans
239
269
 
240
270
  | Command | Purpose |
241
271
  |---------|---------|
242
- | `arcs task create <slug> <title> --dependsOn=id1,id2` | Create task with dependency edges |
243
- | `arcs task update <slug> <id> --dependsOn=id1` | Add/update dependencies |
244
- | `arcs task transition <slug> <id> <status>` | Move through lifecycle |
272
+ | `arcs task create <slug> <title> --dependsOn=id1,id2` | Create a task with dependency edges |
273
+ | `arcs task update <slug> <id>` | Update a task (incl. `--dependsOn`) |
274
+ | `arcs task transition <slug> <id> <status>` | Move a task through its lifecycle |
275
+ | `arcs plan create <slug> <title>` | Create a durable plan record |
245
276
  | `arcs diagram ready <slug> <planId>` | Get unblocked diagram nodes |
246
277
 
247
- ### Project Management
278
+ ### Knowledge
248
279
 
249
280
  | Command | Purpose |
250
281
  |---------|---------|
251
- | `arcs project init` | Register current directory as a project |
252
- | `arcs project update-doc <slug> <doc> --content="..."` | Update a project doc inline |
253
- | `arcs project list` | List all tracked projects |
254
- | `arcs context [slug]` | Full context assembly (audience-targeted) |
255
- | `arcs search <slug> "<query>"` | BM25 + graph-scored search across DAG |
256
- | `arcs validate <slug>` | Health check — status drift, orphans, staleness |
282
+ | `arcs knowledge template --kind=<kind>` | Emit the fillable body skeleton for a kind |
283
+ | `arcs knowledge upsert <slug> <title> --kind=<kind>` | Idempotent create-or-update by title **recommended for agents** |
284
+ | `arcs knowledge create <slug> <title> --kind=<kind>` | Create a new entry |
285
+ | `arcs knowledge search <slug> "<query>"` | Search the knowledge base |
286
+ | `arcs knowledge list <slug>` | List entries |
287
+
288
+ The 8 knowledge kinds: `lesson`, `gotcha`, `pattern`, `architecture`, `module`, `feature`, `reference`, `decision`. `create` / `upsert` accept `--summary`, `--keywords`, `--body` / `--body-file`, `--source-files`, and `--audience`.
257
289
 
258
- ### Plans & Knowledge
290
+ ### Project, search & maintenance
259
291
 
260
292
  | Command | Purpose |
261
293
  |---------|---------|
262
- | `arcs plan create <slug> <title>` | Create a plan |
263
- | `arcs knowledge create <slug> <title>` | Create knowledge entry |
264
-
265
- ### Flags
266
-
267
- | Flag | Effect |
268
- |------|--------|
269
- | `--json` | Structured JSON output (always use for agents) |
270
- | `--lean` | Strip timestamps (saves tokens) |
271
- | `--dry-run` | Validate without mutation |
272
- | `--help` | Per-command usage |
294
+ | `arcs project init` | Register the current directory as a project |
295
+ | `arcs project list` | List tracked projects |
296
+ | `arcs project update-doc <slug> <doc> --content="..."` | Update a project doc inline |
297
+ | `arcs context <slug>` | Full audience-targeted context assembly |
298
+ | `arcs search <slug> "<query>"` | BM25 + graph-scored search across the DAG |
299
+ | `arcs related <slug> <id>` | Graph-related entities for a node |
300
+ | `arcs validate <slug> --checks=<check>` | Health checks: `all`, `sourcefiles`, `status-drift`, `diagrams`, `agents-md`, `knowledge-health` |
301
+ | `arcs batch <slug>` | Apply multiple DAG ops in one call |
273
302
 
274
- Full command discovery: `arcs --commands --json`.
303
+ ### Bundle
275
304
 
276
- > **Batch op format** — fields at top level, NOT nested under `params`:
277
- > ```json
278
- > {"op":"task-create", "slug":"<slug>","title":"...","priority":"medium","planId":"..."}
279
- > {"op":"task-transition","slug":"<slug>","taskId":"...","status":"done"}
280
- > {"op":"doc-update", "slug":"<slug>","doc":"overview","content":"..."}
281
- > {"op":"knowledge-create","slug":"<slug>","title":"...","kind":"lesson","summary":"...","body":"..."}
282
- > ```
283
- > Nested `{op, params:{...}}` format is also accepted (unwrapped automatically).
305
+ | Command | Purpose |
306
+ |---------|---------|
307
+ | `arcs lint-bundle` | Validate agent/skill bundle integrity |
308
+ | `arcs deploy-superpowers` | Deploy the bundle to OpenCode (`~/.config/opencode/`) |
309
+ | `arcs deploy-claudecode-superpowers` | Deploy the bundle to Claude Code |
284
310
 
285
311
  ---
286
312
 
287
313
  ## Graph & Retrieval
288
314
 
289
- ARCS builds a relationship graph across all project entities:
315
+ ARCS builds a weighted relationship graph across every project entity:
290
316
 
291
- | Edge Type | Weight | Connects |
317
+ | Edge type | Weight | Connects |
292
318
  |-----------|--------|----------|
293
319
  | `task_belongs_to_plan` | 1.0 | Task → Plan |
294
320
  | `task_blocks_task` | 0.95 | Task → Task (from `dependsOn`) |
@@ -297,55 +323,7 @@ ARCS builds a relationship graph across all project entities:
297
323
  | `plan_contains_task` | 0.8 | Plan → Task |
298
324
  | `shares_keywords` | 0.5 | Knowledge → Knowledge |
299
325
 
300
- Queries: `arcs search` uses BM25 for text + graph traversal (weighted BFS) for relationship scoring. `arcs next` enriches results with related knowledge from the graph.
301
-
302
- ---
303
-
304
- ## Sub-Agents
305
-
306
- The orchestrator is **delegation-first** — it never reads code, runs tests, or explores. It dispatches specialist sub-agents with self-contained scoped prompts (SCOPE / GOAL / CONTEXT / IDS / CONSTRAINTS / SKILL / VERIFY / RETURN) and consumes their structured (non-prose) output:
307
-
308
- | Sub-Agent | Role | When |
309
- |-----------|------|------|
310
- | **graph-explorer** | DAG-first knowledge + code exploration via codegraph MCP tools | Any "where is X / what depends on Y" query |
311
- | **software-engineer** | Writes code, verifies only its touched files | EXECUTE — bounded tasks |
312
- | **system-architect** | Module boundaries, plan creation | BRAINSTORM — design-open |
313
- | **tech-architect** | Deep analysis, trade-offs | Analysis without edits |
314
- | **oncall-ops** | Debugging, log triage, bisect | Bugs, test failures |
315
- | **code-reviewer** | Pre-merge review | PR review, phase gates |
316
- | **devil-advocate** | Adversarial KISS/YAGNI/DRY gate | Phase boundaries (mandatory); completion gate = the single full-project verification |
317
- | **arcs-docs** | DAG health, knowledge curation | SYNC workflow |
318
- | **docs-researcher** | External research, documentation | INIT tech-stack scan |
319
- | **qa-analyst** | Convention audits, compliance | Read-only audits |
320
-
321
- All sub-agents return **structured output** (not prose) opening with the standard return envelope:
322
-
323
- ```
324
- STATUS: done | blocked | partial
325
- FILES_TOUCHED:
326
- src/foo.ts
327
- VERIFY: vitest run test/foo.test.ts → pass
328
- BLOCKED_BY: <only when blocked/partial — evidence>
329
- KNOWLEDGE: none
330
- ```
331
-
332
- The orchestrator parses STATUS/VERDICT first, forwards FILES_TOUCHED + VERIFY into the devil-advocate execute gate, extracts KNOWLEDGE/CAPTURES for DAG persistence, and routes SCOPE_CHANGE to diagram regeneration. Sub-agents verify only the files they touched; the devil-advocate completion gate runs the session's single full-project pass (full suite + `tsc --noEmit`), and on BLOCK the orchestrator re-dispatches scoped fixes from the gate's FAILURES attribution and re-gates.
333
-
334
- ### Skills (loaded per-dispatch)
335
-
336
- | Category | Skills |
337
- |----------|--------|
338
- | **Work mode** (pick one) | `quick-dev`, `code-agent`, `test-driven-development`, `brainstorming` |
339
- | **Lifecycle** | `writing-plans`, `executing-plans`, `subagent-driven-development` |
340
- | **Quality** | `requesting-code-review`, `deep-pr-review`, `systematic-debugging` |
341
- | **Tooling** | `to-diagram`, `init-project`, `caveman-commit`, `enriching-codegraph-proposals` |
342
-
343
- ### Minimalism Reflex — `the-ladder`
344
-
345
- `the-ladder` auto-layers under the construction work modes (`quick-dev` / `code-agent` / `executing-plans`) — it is not a work mode you pick. Before writing code, it climbs the rungs and stops at the lowest one that solves the problem: **YAGNI → standard library → native platform feature → already-installed dependency → one line → the minimum that works.** Hard carve-outs are never simplified away — input validation at trust boundaries, data-loss handling, security, accessibility, and anything explicitly requested. Non-trivial logic ships with one runnable check.
346
-
347
- - **`// SHORTCUT:` markers** — deliberate simplifications are marked inline as `// SHORTCUT: <ceiling>, upgrade when <trigger>`. The orchestrator harvests these into the knowledge DAG at session completion so deferrals don't rot.
348
- - **Bloat-audit pass** — `deep-pr-review` gained an over-engineering pass (delete / stdlib / native / yagni / shrink tags, `net: -N lines` output) distinct from correctness review.
326
+ `arcs search` combines BM25 text scoring with weighted-BFS graph traversal; `arcs next` enriches its result with related knowledge pulled from the graph.
349
327
 
350
328
  ---
351
329
 
@@ -361,41 +339,19 @@ The orchestrator parses STATUS/VERDICT first, forwards FILES_TOUCHED + VERIFY in
361
339
  ├── tasks/index.json # Structured tasks + dependsOn edges
362
340
  ├── plans/
363
341
  │ ├── {id}.meta.json # Plan status + keywords
364
- │ ├── {id}.md # Plan body
365
- │ └── {id}.diagram.mmd # Mermaid execution map (auto-generated arrows)
342
+ │ ├── {id}.md # Plan body (plans/*.md)
343
+ │ └── {id}.diagram.mmd # Mermaid execution map
366
344
  └── knowledge/
367
345
  ├── index.json # Knowledge index
368
346
  ├── {id}.meta.json # Metadata (kind, audience, sourceFiles)
369
- └── {id}.md # Entry body
347
+ └── {id}.md # Entry body (knowledge/*.md)
370
348
  ```
371
349
 
372
- ### Knowledge Kinds
373
-
374
- 8 structured categories: `lesson`, `gotcha`, `pattern`, `architecture`, `module`, `feature`, `reference`, `decision`.
375
-
376
350
  ---
377
351
 
378
- ## Codegraph (Optional)
379
-
380
- When [codegraph](https://github.com/colbymchenry/codegraph) is on PATH, ARCS builds a per-project index (`codegraph index`) during INIT and SYNC and auto-extracts structural knowledge proposals:
381
-
382
- | Category | Cap | What |
383
- |----------|-----|------|
384
- | God nodes | 8 | Highest-connectivity symbols (ranked by callers + callees / impact) |
385
- | Clusters | 8 | Directory-based module boundaries (pseudo-communities) |
386
- | Couplings | 5 | Cross-module dependency links |
387
-
388
- Codegraph is CLI-driven (Node ≥20 — no extra runtime), self-contained, 100% local, and auto-syncs its index via its own file watcher. All features degrade gracefully when the binary is absent.
389
-
390
- ### Graph-Explorer Integration
391
-
392
- The `graph-explorer` sub-agent uses codegraph's **MCP tools** as **Step 5** in its query protocol — after ARCS DAG queries (Steps 1–4) but before any file-system fallback. When a `.codegraph/` index exists, the agent answers structural questions with near-zero file reads via:
352
+ ## Codegraph (optional)
393
353
 
394
- - **`codegraph_explore`** primary: "how does X work" / "how does X reach Y" / survey an area, returning verbatim source grouped by file plus a relationship map
395
- - **`codegraph_search` / `codegraph_node`** — locate a symbol / fetch its full source
396
- - **`codegraph_callers` / `codegraph_callees` / `codegraph_impact`** — walk call flow and blast radius before edits
397
-
398
- This provides fine-grained structural answers (individual call chains, coupling paths, symbol neighborhoods) that are richer than ARCS knowledge entries without resorting to grep/find.
354
+ When [codegraph](https://github.com/colbymchenry/codegraph) is on PATH, ARCS builds a per-project index during onboarding and sync, and auto-extracts structural knowledge proposals (god nodes, module clusters, cross-module couplings). The `graph-explorer` sub-agent queries codegraph's MCP tools to answer structural questions — call chains, blast radius, symbol neighborhoods with near-zero raw file reads. Every codegraph feature degrades gracefully when the binary is absent.
399
355
 
400
356
  ---
401
357
 
@@ -409,29 +365,24 @@ cd arcs && npm install && npm run build
409
365
  | Command | Description |
410
366
  |---------|-------------|
411
367
  | `npm run build` | Compile TypeScript to `dist/` |
412
- | `npm test` | Vitest suite (~842 tests) |
413
- | `npm run typecheck` | Type check without emit |
414
- | `npm run lint` | Biome lint + format |
368
+ | `npm test` | Run the Vitest suite (900+ tests across 82 files) |
369
+ | `npm run typecheck` | Type-check without emit (`tsc --noEmit`) |
370
+ | `npm run lint` | Biome lint + format check (`src/`, `test/`) |
371
+ | `npm run format` | Rewrite files with Biome formatting |
372
+
373
+ **Tech stack:** pure TypeScript (ES2022, strict), Node 20+, `zod` (schemas), `@clack/prompts` (interactive setup), `picocolors`; Biome for lint/format, Vitest for tests.
374
+
375
+ > Tests that touch DAG data must run in an isolated temp directory via the `withTempDataDir()` helper — see [`CLAUDE.md`](CLAUDE.md) for the testing-isolation rule.
415
376
 
416
- ### Bundle Workflow
377
+ ### Bundle workflow
417
378
 
418
379
  ```bash
419
- npm run build:opencode-bundle # Build agent/skill bundle
380
+ npm run build:opencode-bundle # Build the agent/skill bundle
420
381
  arcs lint-bundle # Validate bundle integrity
421
382
  arcs deploy-superpowers # Deploy to ~/.config/opencode/
422
383
  ```
423
384
 
424
- **What `deploy-superpowers` writes to `opencode.json`:**
425
-
426
- The bundle merges a small set of keys into your `~/.config/opencode/opencode.json`. Each merge entry has a `mode`:
427
-
428
- | Mode | Behavior | Used for |
429
- |------|----------|----------|
430
- | `overwrite` (default) | Always sets the value, even on re-deploy | Plugin registration |
431
- | `if-absent` | Only sets if the key isn't already present | User-preference keys: `model`, `small_model`, `agent.{build,plan,general}.model`, `lsp` |
432
- | `merge` | Deep-merge: adds new keys, never overwrites existing user values | Sub-agent definitions, `permission.external_directory` |
433
-
434
- This means: **your config is always respected.** Provider/model routing seeds on first install but never re-stamps. Sub-agent definitions get new fields (prompt paths, descriptions) on re-deploy but your model overrides survive. JSONC comments in `opencode.json` are supported.
385
+ `deploy-superpowers` merges a small set of keys into `~/.config/opencode/opencode.json` with per-key modes — `overwrite` for plugin registration, `if-absent` for model/preference keys, and deep `merge` for sub-agent definitions. The upshot: **your config is always respected** — model routing seeds on first install but never re-stamps, and JSONC comments are preserved.
435
386
 
436
387
  ---
437
388