@rryando/arcs 3.7.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 (55) hide show
  1. package/README.md +181 -246
  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 +27 -21
  5. package/dist/cli/arcs-orchestrate.js.map +1 -1
  6. package/dist/cli/commands/knowledge.js +64 -5
  7. package/dist/cli/commands/knowledge.js.map +1 -1
  8. package/dist/cli/commands/utility.d.ts.map +1 -1
  9. package/dist/cli/commands/utility.js +12 -0
  10. package/dist/cli/commands/utility.js.map +1 -1
  11. package/dist/cli/instructions.d.ts.map +1 -1
  12. package/dist/cli/instructions.js +0 -2
  13. package/dist/cli/instructions.js.map +1 -1
  14. package/dist/cli/md-renderer.d.ts.map +1 -1
  15. package/dist/cli/md-renderer.js +5 -0
  16. package/dist/cli/md-renderer.js.map +1 -1
  17. package/dist/cli/setup.d.ts.map +1 -1
  18. package/dist/cli/setup.js +3 -5
  19. package/dist/cli/setup.js.map +1 -1
  20. package/dist/utils/knowledge-templates.d.ts +51 -0
  21. package/dist/utils/knowledge-templates.d.ts.map +1 -0
  22. package/dist/utils/knowledge-templates.js +209 -0
  23. package/dist/utils/knowledge-templates.js.map +1 -0
  24. package/opencode/arcs/bundle-runtime.json +7 -7
  25. package/opencode/arcs/manifest.json +0 -64
  26. package/opencode/arcs/prompts/arcs-docs.txt +2 -1
  27. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +27 -21
  28. package/opencode/arcs/prompts/arcs-orchestrate.txt +27 -21
  29. package/opencode/arcs/prompts/code-reviewer.txt +40 -2
  30. package/opencode/arcs/prompts/devil-advocate.txt +2 -1
  31. package/opencode/arcs/prompts/docs-researcher.txt +4 -3
  32. package/opencode/arcs/prompts/graph-explorer.txt +2 -1
  33. package/opencode/arcs/prompts/oncall-ops.txt +2 -1
  34. package/opencode/arcs/prompts/software-engineer.txt +2 -1
  35. package/opencode/arcs/prompts/tech-architect.txt +49 -15
  36. package/opencode/arcs/skills/deep-pr-review/SKILL.md +3 -3
  37. package/opencode/arcs/skills/deep-pr-review/review-template.md +1 -1
  38. package/opencode/arcs/skills/executing-plans/SKILL.md +155 -1
  39. package/opencode/arcs/skills/init-project/SKILL.md +8 -10
  40. package/opencode/arcs/skills/requesting-code-review/SKILL.md +1 -1
  41. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +1 -1
  42. package/opencode/arcs/skills/test-driven-development/SKILL.md +1 -1
  43. package/opencode/arcs/skills/writing-knowledge/SKILL.md +74 -0
  44. package/opencode/arcs/skills/writing-plans/SKILL.md +2 -3
  45. package/package.json +4 -1
  46. package/scripts/build-opencode-bundle.mjs +0 -2
  47. package/scripts/deploy-claudecode-bundle.mjs +0 -16
  48. package/scripts/lint-bundle.mjs +0 -2
  49. package/skills/init-project.md +7 -8
  50. package/opencode/arcs/prompts/qa-analyst.txt +0 -86
  51. package/opencode/arcs/prompts/system-architect.txt +0 -94
  52. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +0 -185
  53. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/code-quality-reviewer-prompt.md +0 -0
  54. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/implementer-prompt.md +0 -0
  55. /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,50 +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
- **Knowledge Protocol (read-first).** The orchestrator reads prior knowledge before every non-mechanical dispatch and captures durable insight at fan-in via idempotent `arcs knowledge upsert` — so the DAG compounds instead of duplicating. It may also run narrow, user-requested git (`status` / `diff` / `commit` / etc.) directly, while tests, lint, and builds stay delegated to sub-agents and the devil-advocate completion gate.
197
-
198
- ### T0 Routing Envelope (the operating brief)
159
+ ### The operating brief (`arcs brief`)
199
160
 
200
161
  ```bash
201
162
  $ arcs brief --lean --json
@@ -219,92 +180,141 @@ $ arcs brief --lean --json
219
180
  }
220
181
  ```
221
182
 
222
- ~1 KB. No source files read. The orchestrator uses `recommendedSurface` to pick the workflow branch. `arcs brief` also surfaces a **Knowledge Health** line (`knowledgeHealth: { total, thin, stale }`) counts of thin entries (missing summary or source-files) and stale entries (not updated in >180 days) — so KB under-maintenance is visible at orientation time.
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).
239
+
240
+ ---
241
+
242
+ ## Knowledge Depth
243
+
244
+ Thin, one-sentence memory doesn't compound. ARCS treats knowledge depth as a first-class concern:
245
+
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`.
249
+
250
+ The throughline: substantive entries, written once and read before work, are what turn the knowledge base into compounding memory rather than a graveyard.
223
251
 
224
252
  ---
225
253
 
226
- ## CLI Reference
254
+ ## Command Cheat-Sheet
227
255
 
228
- All commands: `arcs <command> [args] --json`. Output: `{ok, data}` on success, `{ok, code, message}` on error.
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`.
229
257
 
230
- ### Core Agent Loop
258
+ ### Core loop
231
259
 
232
260
  | Command | Purpose |
233
261
  |---------|---------|
234
- | `arcs brief` | T0 routing envelope what to focus on (+ Knowledge Health counts) |
235
- | `arcs next` | Next dependency-safe task + related knowledge |
236
- | `arcs done <taskId>` | Mark complete, unblock dependents |
237
- | `arcs remember "<text>"` | Capture knowledge (auto-classifies kind) |
238
- | `arcs status` | Progress overview across all surfaces |
262
+ | `arcs brief <slug>` | Operating brief — focus + 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 |
239
267
 
240
- ### Tasks & Dependencies
268
+ ### Tasks & plans
241
269
 
242
270
  | Command | Purpose |
243
271
  |---------|---------|
244
- | `arcs task create <slug> <title> --dependsOn=id1,id2` | Create task with dependency edges |
245
- | `arcs task update <slug> <id> --dependsOn=id1` | Add/update dependencies |
246
- | `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 |
247
276
  | `arcs diagram ready <slug> <planId>` | Get unblocked diagram nodes |
248
277
 
249
- ### Project Management
278
+ ### Knowledge
250
279
 
251
280
  | Command | Purpose |
252
281
  |---------|---------|
253
- | `arcs project init` | Register current directory as a project |
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`.
289
+
290
+ ### Project, search & maintenance
291
+
292
+ | Command | Purpose |
293
+ |---------|---------|
294
+ | `arcs project init` | Register the current directory as a project |
295
+ | `arcs project list` | List tracked projects |
254
296
  | `arcs project update-doc <slug> <doc> --content="..."` | Update a project doc inline |
255
- | `arcs project list` | List all tracked projects |
256
- | `arcs context [slug]` | Full context assembly (audience-targeted) |
257
- | `arcs search <slug> "<query>"` | BM25 + graph-scored search across DAG |
258
- | `arcs validate <slug> --checks=<check>` | Health check — `--checks` accepts `all`, `sourcefiles`, `status-drift`, `diagrams`, `agents-md`, `knowledge-health` |
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 |
259
302
 
260
- ### Plans & Knowledge
303
+ ### Bundle
261
304
 
262
305
  | Command | Purpose |
263
306
  |---------|---------|
264
- | `arcs plan create <slug> <title>` | Create a plan |
265
- | `arcs knowledge create <slug> <title> --kind=<kind>` | Create knowledge entry (accepts `--audience`) |
266
- | `arcs knowledge upsert <slug> <title> --kind=<kind>` | Idempotent create-or-update by title **recommended default for agent-driven enrichment** |
267
- | `arcs knowledge update-meta <slug> <id>` | Edit entry metadata (accepts `--source-files`, `--audience`) |
268
- | `arcs knowledge-search <slug> "<query>" --kind=<kind>` | Search knowledge (any of the 8 kinds) |
269
-
270
- `knowledge upsert` is the idempotent sibling of `create` — same title updates in place instead of duplicating. Both `upsert` and `create` accept:
271
-
272
- | Flag | Effect |
273
- |------|--------|
274
- | `--kind=<kind>` | One of: `lesson`, `gotcha`, `pattern`, `architecture`, `module`, `feature`, `reference`, `decision` |
275
- | `--summary="..."` | One-line summary |
276
- | `--keywords="..."` | Comma-separated keywords |
277
- | `--body="..."` / `--body-file=<path>` | Entry body inline or from file |
278
- | `--source-files="path,path:anchor"` | Comma-separated `path` or `path:anchor` references |
279
- | `--audience=<audience>` | One of: `orchestrator`, `implementer`, `designer`, `universal` |
280
-
281
- ### Flags
282
-
283
- | Flag | Effect |
284
- |------|--------|
285
- | `--json` | Structured JSON output (always use for agents) |
286
- | `--lean` | Strip timestamps (saves tokens) |
287
- | `--dry-run` | Validate without mutation |
288
- | `--help` | Per-command usage |
289
-
290
- Full command discovery: `arcs --commands --json`.
291
-
292
- > **Batch op format** — fields at top level, NOT nested under `params`:
293
- > ```json
294
- > {"op":"task-create", "slug":"<slug>","title":"...","priority":"medium","planId":"..."}
295
- > {"op":"task-transition","slug":"<slug>","taskId":"...","status":"done"}
296
- > {"op":"doc-update", "slug":"<slug>","doc":"overview","content":"..."}
297
- > {"op":"knowledge-create","slug":"<slug>","title":"...","kind":"lesson","summary":"...","body":"...","sourceFiles":["..."],"audience":"orchestrator"}
298
- > ```
299
- > `knowledge-create` carries `summary`, `sourceFiles`, and `audience` through to the created entry. Nested `{op, params:{...}}` format is also accepted (unwrapped automatically).
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 |
300
310
 
301
311
  ---
302
312
 
303
313
  ## Graph & Retrieval
304
314
 
305
- ARCS builds a relationship graph across all project entities:
315
+ ARCS builds a weighted relationship graph across every project entity:
306
316
 
307
- | Edge Type | Weight | Connects |
317
+ | Edge type | Weight | Connects |
308
318
  |-----------|--------|----------|
309
319
  | `task_belongs_to_plan` | 1.0 | Task → Plan |
310
320
  | `task_blocks_task` | 0.95 | Task → Task (from `dependsOn`) |
@@ -313,55 +323,7 @@ ARCS builds a relationship graph across all project entities:
313
323
  | `plan_contains_task` | 0.8 | Plan → Task |
314
324
  | `shares_keywords` | 0.5 | Knowledge → Knowledge |
315
325
 
316
- Queries: `arcs search` uses BM25 for text + graph traversal (weighted BFS) for relationship scoring. `arcs next` enriches results with related knowledge from the graph.
317
-
318
- ---
319
-
320
- ## Sub-Agents
321
-
322
- 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:
323
-
324
- | Sub-Agent | Role | When |
325
- |-----------|------|------|
326
- | **graph-explorer** | DAG-first knowledge + code exploration via codegraph MCP tools | Any "where is X / what depends on Y" query |
327
- | **software-engineer** | Writes code, verifies only its touched files | EXECUTE — bounded tasks |
328
- | **system-architect** | Module boundaries, plan creation | BRAINSTORM — design-open |
329
- | **tech-architect** | Deep analysis, trade-offs | Analysis without edits |
330
- | **oncall-ops** | Debugging, log triage, bisect | Bugs, test failures |
331
- | **code-reviewer** | Pre-merge review | PR review, phase gates |
332
- | **devil-advocate** | Adversarial KISS/YAGNI/DRY gate | Phase boundaries (mandatory); completion gate = the single full-project verification |
333
- | **arcs-docs** | DAG health, knowledge curation | SYNC workflow |
334
- | **docs-researcher** | External research, documentation | INIT tech-stack scan |
335
- | **qa-analyst** | Convention audits, compliance | Read-only audits |
336
-
337
- All sub-agents return **structured output** (not prose) opening with the standard return envelope:
338
-
339
- ```
340
- STATUS: done | blocked | partial
341
- FILES_TOUCHED:
342
- src/foo.ts
343
- VERIFY: vitest run test/foo.test.ts → pass
344
- BLOCKED_BY: <only when blocked/partial — evidence>
345
- KNOWLEDGE: none
346
- ```
347
-
348
- 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.
349
-
350
- ### Skills (loaded per-dispatch)
351
-
352
- | Category | Skills |
353
- |----------|--------|
354
- | **Work mode** (pick one) | `quick-dev`, `code-agent`, `test-driven-development`, `brainstorming` |
355
- | **Lifecycle** | `writing-plans`, `executing-plans`, `subagent-driven-development` |
356
- | **Quality** | `requesting-code-review`, `deep-pr-review`, `systematic-debugging` |
357
- | **Tooling** | `to-diagram`, `init-project`, `caveman-commit`, `enriching-codegraph-proposals` |
358
-
359
- ### Minimalism Reflex — `the-ladder`
360
-
361
- `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.
362
-
363
- - **`// 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.
364
- - **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.
365
327
 
366
328
  ---
367
329
 
@@ -377,41 +339,19 @@ The orchestrator parses STATUS/VERDICT first, forwards FILES_TOUCHED + VERIFY in
377
339
  ├── tasks/index.json # Structured tasks + dependsOn edges
378
340
  ├── plans/
379
341
  │ ├── {id}.meta.json # Plan status + keywords
380
- │ ├── {id}.md # Plan body
381
- │ └── {id}.diagram.mmd # Mermaid execution map (auto-generated arrows)
342
+ │ ├── {id}.md # Plan body (plans/*.md)
343
+ │ └── {id}.diagram.mmd # Mermaid execution map
382
344
  └── knowledge/
383
345
  ├── index.json # Knowledge index
384
346
  ├── {id}.meta.json # Metadata (kind, audience, sourceFiles)
385
- └── {id}.md # Entry body
347
+ └── {id}.md # Entry body (knowledge/*.md)
386
348
  ```
387
349
 
388
- ### Knowledge Kinds
389
-
390
- 8 structured categories: `lesson`, `gotcha`, `pattern`, `architecture`, `module`, `feature`, `reference`, `decision`.
391
-
392
350
  ---
393
351
 
394
- ## Codegraph (Optional)
395
-
396
- 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:
397
-
398
- | Category | Cap | What |
399
- |----------|-----|------|
400
- | God nodes | 8 | Highest-connectivity symbols (ranked by callers + callees / impact) |
401
- | Clusters | 8 | Directory-based module boundaries (pseudo-communities) |
402
- | Couplings | 5 | Cross-module dependency links |
403
-
404
- 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.
405
-
406
- ### Graph-Explorer Integration
407
-
408
- 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)
409
353
 
410
- - **`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
411
- - **`codegraph_search` / `codegraph_node`** — locate a symbol / fetch its full source
412
- - **`codegraph_callers` / `codegraph_callees` / `codegraph_impact`** — walk call flow and blast radius before edits
413
-
414
- 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.
415
355
 
416
356
  ---
417
357
 
@@ -425,29 +365,24 @@ cd arcs && npm install && npm run build
425
365
  | Command | Description |
426
366
  |---------|-------------|
427
367
  | `npm run build` | Compile TypeScript to `dist/` |
428
- | `npm test` | Vitest suite (~842 tests) |
429
- | `npm run typecheck` | Type check without emit |
430
- | `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.
431
376
 
432
- ### Bundle Workflow
377
+ ### Bundle workflow
433
378
 
434
379
  ```bash
435
- npm run build:opencode-bundle # Build agent/skill bundle
380
+ npm run build:opencode-bundle # Build the agent/skill bundle
436
381
  arcs lint-bundle # Validate bundle integrity
437
382
  arcs deploy-superpowers # Deploy to ~/.config/opencode/
438
383
  ```
439
384
 
440
- **What `deploy-superpowers` writes to `opencode.json`:**
441
-
442
- The bundle merges a small set of keys into your `~/.config/opencode/opencode.json`. Each merge entry has a `mode`:
443
-
444
- | Mode | Behavior | Used for |
445
- |------|----------|----------|
446
- | `overwrite` (default) | Always sets the value, even on re-deploy | Plugin registration |
447
- | `if-absent` | Only sets if the key isn't already present | User-preference keys: `model`, `small_model`, `agent.{build,plan,general}.model`, `lsp` |
448
- | `merge` | Deep-merge: adds new keys, never overwrites existing user values | Sub-agent definitions, `permission.external_directory` |
449
-
450
- 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.
451
386
 
452
387
  ---
453
388