@rryando/arcs 3.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +246 -340
  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 +4 -3
  5. package/dist/cli/arcs-orchestrate.js.map +1 -1
  6. package/dist/cli/commands/next.js +26 -5
  7. package/dist/cli/commands/next.js.map +1 -1
  8. package/dist/cli/commands/task.d.ts.map +1 -1
  9. package/dist/cli/commands/task.js +14 -2
  10. package/dist/cli/commands/task.js.map +1 -1
  11. package/dist/retrieval/graph-builder.d.ts.map +1 -1
  12. package/dist/retrieval/graph-builder.js +18 -0
  13. package/dist/retrieval/graph-builder.js.map +1 -1
  14. package/dist/retrieval/graph-types.d.ts +1 -1
  15. package/dist/retrieval/graph-types.d.ts.map +1 -1
  16. package/dist/retrieval/graph-types.js +1 -0
  17. package/dist/retrieval/graph-types.js.map +1 -1
  18. package/dist/utils/diagram-generator.d.ts +3 -2
  19. package/dist/utils/diagram-generator.d.ts.map +1 -1
  20. package/dist/utils/diagram-generator.js +67 -6
  21. package/dist/utils/diagram-generator.js.map +1 -1
  22. package/dist/utils/errors.d.ts +2 -0
  23. package/dist/utils/errors.d.ts.map +1 -1
  24. package/dist/utils/errors.js +6 -0
  25. package/dist/utils/errors.js.map +1 -1
  26. package/dist/utils/task-store.d.ts +3 -0
  27. package/dist/utils/task-store.d.ts.map +1 -1
  28. package/dist/utils/task-store.js +35 -1
  29. package/dist/utils/task-store.js.map +1 -1
  30. package/dist/utils/toposort.d.ts +21 -0
  31. package/dist/utils/toposort.d.ts.map +1 -0
  32. package/dist/utils/toposort.js +126 -0
  33. package/dist/utils/toposort.js.map +1 -0
  34. package/dist/utils/workflow-policy.d.ts +1 -0
  35. package/dist/utils/workflow-policy.d.ts.map +1 -1
  36. package/dist/utils/workflow-policy.js +18 -2
  37. package/dist/utils/workflow-policy.js.map +1 -1
  38. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +4 -3
  39. package/opencode/arcs/prompts/arcs-orchestrate.txt +4 -3
  40. package/opencode/arcs/skills/brainstorming/SKILL.md +2 -0
  41. package/opencode/arcs/skills/executing-plans/SKILL.md +2 -0
  42. package/opencode/arcs/skills/to-diagram/SKILL.md +2 -0
  43. package/package.json +4 -3
  44. package/scripts/arcs-init.mjs +81 -0
  45. package/scripts/build-opencode-bundle.mjs +178 -0
  46. package/scripts/deploy-opencode-bundle.mjs +203 -0
  47. package/scripts/lib/bundle-helpers.mjs +172 -0
  48. package/scripts/lint-bundle.mjs +206 -0
package/README.md CHANGED
@@ -1,217 +1,249 @@
1
- # ARCS
1
+ <div align="center">
2
2
 
3
- > Give AI agents durable memory — so they start from context, not a blank slate.
3
+ # ARCS
4
4
 
5
- ARCS tracks projects, tasks, plans, and knowledge as a directed acyclic graph (DAG) stored in `~/.arcs/`. AI agents call `arcs <command>` to read structured project context instead of scanning codebases from scratch each session.
5
+ **Agent Routing & Context System**
6
6
 
7
- The name is a direct nod to graph theory — where nodes are connected by "arcs" (directed edges). It perfectly describes this DAG-based task orchestration tool.
7
+ [![npm](https://img.shields.io/npm/v/@rryando/arcs?color=cb3837&label=npm&logo=npm)](https://www.npmjs.com/package/@rryando/arcs)
8
+ [![Node](https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
11
 
9
- ---
12
+ *Persistent workflow continuity for AI agents — start from context, not a blank slate.*
10
13
 
11
- ## What Is ARCS
14
+ </div>
12
15
 
13
- Every AI coding session starts fresh. ARCS fixes that by maintaining three persistent surfaces per project:
16
+ ---
14
17
 
15
- ```mermaid
16
- graph LR
17
- CTX["arcs context\n──────────\noperating brief\ncurrent focus\nnext action"]
18
-
19
- subgraph Q["Queue (tasks.md + tasks/index.json)"]
20
- QD["backlog → in_progress → done\nimmediate work items"]
21
- end
22
- subgraph P["Plan (plans/*.md + .diagram.mmd)"]
23
- PD["proposed → in_progress → done\nmulti-step feature work"]
24
- end
25
- subgraph M["Memory (knowledge/*.md)"]
26
- MD["lessons · patterns · gotchas · architecture\ndurable, searchable, BM25-indexed"]
27
- end
28
-
29
- CTX --> Q
30
- CTX --> P
31
- CTX --> M
32
- ```
18
+ 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.
33
19
 
34
- An agent calls `arcs brief` at session start and receives an **operating brief** (~890-byte routing envelope with `currentFocus`, `recommendedSurface`, and `nextAction`) — without reading a single source file.
20
+ > **arcs** `/ɑːrks/` Directed edges in graph theory. Also: **A**gent **R**outing & **C**ontext **S**ystem.
35
21
 
36
22
  ---
37
23
 
38
- ## How It Works
24
+ ## The Problem
39
25
 
40
- ### Orchestrator Workflow DAG
26
+ Every AI coding session starts fresh. The agent doesn't know:
27
+ - What task to pick up next (and which tasks are blocked by incomplete work)
28
+ - What was already tried and failed
29
+ - What architectural decisions were made
30
+ - What the current plan looks like
41
31
 
42
- ```mermaid
43
- flowchart TD
44
- User(["User / Agent Request"])
45
- Orch{"ARCS Orchestrator\nClassify intent"}
32
+ ARCS solves this with three persistent surfaces:
46
33
 
47
- Init["INIT\nCreate project\nScan codebase\nPopulate docs & knowledge"]
48
- Brain["BRAINSTORM\nExplore state\nCreate plans + tasks\nGenerate diagram"]
49
- Exec["EXECUTE\nSelect unblocked task\nDispatch implementer\nUpdate DAG"]
50
- Sync["SYNC\nRe-scan codebase\nAudit docs\nReconcile drift"]
51
- Explore["EXPLORE\nList projects\nInspect status\n(read-only)"]
52
- Multi["MULTI\nChain workflows\nin parallel or sequence"]
34
+ | Surface | Storage | Purpose |
35
+ |---------|---------|---------|
36
+ | **Queue** | `tasks/index.json` | Work items with dependency ordering via `dependsOn` |
37
+ | **Plan** | `plans/*.md` + `.diagram.mmd` | Multi-step feature work with Mermaid execution maps |
38
+ | **Memory** | `knowledge/*.md` | Durable discoveries: lessons, patterns, gotchas, architecture |
53
39
 
54
- DAG[("~/.arcs/\nProjects · Tasks · Plans\nKnowledge · Diagrams")]
40
+ ---
55
41
 
56
- User --> Orch
57
- Orch -- "new project" --> Init
58
- Orch -- "plan features" --> Brain
59
- Orch -- "do work" --> Exec
60
- Orch -- "update docs" --> Sync
61
- Orch -- "inspect" --> Explore
62
- Orch -- "compound" --> Multi
42
+ ## How It Works
63
43
 
64
- Multi -.-> Init & Brain & Exec & Sync & Explore
44
+ ### The Core Loop
65
45
 
66
- Init & Brain & Exec & Sync & Explore --> DAG
67
46
  ```
68
-
69
- ### T0 Orientation
70
-
71
- ```bash
72
- arcs brief --lean --json
73
- # → currentFocus, recommendedSurface, nextAction (~890-byte routing envelope)
47
+ arcs next → [agent works] → arcs done <id> → arcs remember "..."
48
+ │ │ │
49
+ │ returns first task │ completes task, │ captures durable
50
+ │ whose dependencies │ unblocks dependents │ knowledge for
51
+ are ALL satisfied │ │ future sessions
52
+ ▼ ▼ ▼
53
+ ┌─────────────────────────────────────────────────────────────────┐
54
+ │ ~/.arcs/projects/{slug}/ │
55
+ │ │
56
+ │ tasks/index.json ──dependsOn──→ topological sort → next task │
57
+ │ knowledge/ ──BM25+graph──→ related context │
58
+ │ plans/ ──diagram.mmd──→ execution map │
59
+ └─────────────────────────────────────────────────────────────────┘
74
60
  ```
75
61
 
76
- The orchestrator calls `arcs brief` at the start of every session to orient without loading any source files. `--lean` strips timestamps for token efficiency.
62
+ Three commands: `arcs next` work `arcs done`. The DAG handles ordering.
77
63
 
78
- ### Confidence Gate
64
+ ### Task Dependencies — The Actual DAG
79
65
 
80
- Before any irreversible action (DAG write, code edit, plan creation), the orchestrator self-scores 0–100% confidence with cited evidence. Threshold: 80% (85% for cross-cutting changes). Reads and exploration are never gated. Self-report without citations is invalid.
66
+ Tasks declare dependencies. ARCS enforces acyclicity and uses topological sort to determine execution order:
81
67
 
82
- ### Mutations
68
+ ```bash
69
+ arcs task create myapp "Design database schema" --priority=high
70
+ arcs task create myapp "Build REST API" --dependsOn=design-database-schema
71
+ arcs task create myapp "Write integration tests" --dependsOn=build-rest-api
72
+ arcs task create myapp "Deploy to staging" --dependsOn=build-rest-api,write-integration-tests
73
+ ```
83
74
 
84
- Mutating commands run directly — no token, no proposal. Reads and writes share the same `arcs <command> [args] --json` shape.
75
+ ```mermaid
76
+ flowchart TD
77
+ T001["Design database schema"]:::done
78
+ T002["Build REST API"]:::inProgress
79
+ T003["Write integration tests"]:::backlog
80
+ T004["Deploy to staging"]:::blocked
81
+
82
+ T001 --> T002
83
+ T002 --> T003
84
+ T002 --> T004
85
+ T003 --> T004
86
+
87
+ classDef done fill:#22c55e,color:#fff
88
+ classDef inProgress fill:#f59e0b,color:#fff
89
+ classDef backlog fill:#94a3b8,color:#fff
90
+ classDef blocked fill:#ef4444,color:#fff
91
+ ```
85
92
 
86
- ---
93
+ `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.
87
94
 
88
- ## Prerequisites
95
+ ### The Orchestrator
89
96
 
90
- | Requirement | Version | Notes |
91
- |---|---|---|
92
- | [Node.js](https://nodejs.org/) | v18+ | Required |
93
- | [OpenCode](https://opencode.ai/) | latest | Required for agent integration |
94
- | [gh (GitHub CLI)](https://cli.github.com/) | any | Required — used by skills like `deep-pr-review` |
95
- | [graphify](https://github.com/safishamsi/graphify) | any | Optional — AST code-graph analysis |
96
- | [rtk](https://github.com/rtk-ai/rtk) | any | Optional — improves AI command usage tracking |
97
+ When used with [OpenCode](https://opencode.ai/), ARCS ships a full orchestrator that automates the loop:
97
98
 
98
- **Install RTK:**
99
- ```bash
100
- rtk init -g # Install hook + RTK.md (recommended)
101
- rtk init -g --opencode # OpenCode plugin (instead of Claude Code)
99
+ ```mermaid
100
+ flowchart TD
101
+ User(["User Request"])
102
+ T0["arcs brief T0 envelope"]
103
+ Classify{"Classify Intent"}
104
+
105
+ Init["INIT\nScan repo → populate DAG"]
106
+ Brain["BRAINSTORM\nCreate plan → wire dependsOn\n→ generate diagram"]
107
+ Exec["EXECUTE\narcs next → dispatch sub-agent\n→ arcs done → unblock dependents"]
108
+ Sync["SYNC\nAudit DAG → reconcile drift"]
109
+
110
+ DAG[("Project DAG\ntasks + plans + knowledge\n+ dependency graph")]
111
+
112
+ User --> T0 --> Classify
113
+ Classify -- "new project" --> Init
114
+ Classify -- "plan features" --> Brain
115
+ Classify -- "do work" --> Exec
116
+ Classify -- "update docs" --> Sync
117
+ Init & Brain & Exec & Sync --> DAG
102
118
  ```
103
119
 
104
- ---
105
-
106
- ## Quick Start
120
+ The orchestrator:
121
+ 1. **Orients** — calls `arcs brief` for the T0 routing envelope (~1 KB)
122
+ 2. **Classifies** — detects intent (INIT / BRAINSTORM / EXECUTE / SYNC)
123
+ 3. **Routes** — delegates to specialist sub-agents with scoped prompts
124
+ 4. **Executes** — `arcs next` picks dependency-safe tasks; sub-agents implement them
125
+ 5. **Advances** — `arcs done` completes tasks, automatically unblocking dependents
107
126
 
108
- **1. Install from npm**
127
+ ### T0 Routing Envelope (the operating brief)
109
128
 
110
129
  ```bash
111
- npm install -g @rryando/arcs
130
+ $ arcs brief --lean --json
112
131
  ```
113
132
 
114
- **2. Run the setup wizard**
115
-
116
- ```bash
117
- npm run init
133
+ ```json
134
+ {
135
+ "slug": "my-project",
136
+ "name": "My Project",
137
+ "operatingBrief": {
138
+ "currentFocus": "Build REST API",
139
+ "recommendedSurface": "QUEUE",
140
+ "why": "Task in progress: Build REST API",
141
+ "nextAction": "Continue task build-rest-api"
142
+ },
143
+ "openTasksCount": 3,
144
+ "topOpenTasks": [
145
+ { "id": "build-rest-api", "title": "Build REST API", "status": "in_progress" },
146
+ { "id": "write-integration-tests", "title": "Write integration tests", "status": "backlog" }
147
+ ]
148
+ }
118
149
  ```
119
150
 
120
- The wizard:
121
- 1. Builds the TypeScript source
122
- 2. Registers the `arcs` CLI at `~/.local/bin/arcs`
123
- 3. Creates `~/.arcs/` (project data store)
124
- 4. Deploys bundled agents + skills into `~/.config/opencode/`
151
+ ~1 KB. No source files read. The orchestrator uses `recommendedSurface` to pick the workflow branch.
125
152
 
126
- **3. Track a project**
153
+ ---
127
154
 
128
- Open OpenCode in your desired project folder, then call `arcs init` to register it with ARCS:
155
+ ## CLI Reference
129
156
 
130
- ```bash
131
- arcs init
132
- ```
157
+ All commands: `arcs <command> [args] --json`. Output: `{ok, data}` on success, `{ok, code, message}` on error.
133
158
 
134
- This creates the DAG structure for the project and registers the current directory as a workspace path.
159
+ ### Core Agent Loop
135
160
 
136
- **4. Start using ARCS**
161
+ | Command | Purpose |
162
+ |---------|---------|
163
+ | `arcs brief` | T0 routing envelope — what to focus on |
164
+ | `arcs next` | Next dependency-safe task + related knowledge |
165
+ | `arcs done <taskId>` | Mark complete, unblock dependents |
166
+ | `arcs remember "<text>"` | Capture knowledge (auto-classifies kind) |
167
+ | `arcs status` | Progress overview across all surfaces |
137
168
 
138
- You'll see the **ARCS Orchestrator** listed as a selectable agent in OpenCode. Every session starts with an operating brief instead of a blank slate:
169
+ ### Tasks & Dependencies
139
170
 
140
- ```bash
141
- arcs context
142
- # project overview, current focus, active plans, relevant knowledge
143
- ```
171
+ | Command | Purpose |
172
+ |---------|---------|
173
+ | `arcs task create <slug> <title> --dependsOn=id1,id2` | Create task with dependency edges |
174
+ | `arcs task update <slug> <id> --dependsOn=id1` | Add/update dependencies |
175
+ | `arcs task transition <slug> <id> <status>` | Move through lifecycle |
176
+ | `arcs diagram ready <slug> <planId>` | Get unblocked diagram nodes |
144
177
 
145
- ---
178
+ ### Project Management
146
179
 
147
- ## Agents
180
+ | Command | Purpose |
181
+ |---------|---------|
182
+ | `arcs project init` | Register current directory as a project |
183
+ | `arcs project list` | List all tracked projects |
184
+ | `arcs context [slug]` | Full context assembly (audience-targeted) |
185
+ | `arcs search <slug> "<query>"` | BM25 + graph-scored search across DAG |
186
+ | `arcs validate <slug>` | Health check — status drift, orphans, staleness |
148
187
 
149
- ### Primary Agents
188
+ ### Plans & Knowledge
150
189
 
151
- These are registered as selectable agents in OpenCode. You interact with them directly.
190
+ | Command | Purpose |
191
+ |---------|---------|
192
+ | `arcs plan create <slug> <title>` | Create a plan |
193
+ | `arcs knowledge create <slug> <title>` | Create knowledge entry |
152
194
 
153
- | Agent | Token Mode | Description |
154
- |---|---|---|
155
- | **ARCS Orchestrator** | Full prose | Classifies intent, routes to workflows, delegates to sub-agents, writes DAG |
156
- | **ARCS Caveman** | ~65% fewer tokens | Identical capabilities; caveman-speak for chat narration only |
195
+ ### Flags
157
196
 
158
- The orchestrator follows three phases on every request:
159
- 1. **Classify** — detect intent (INIT / BRAINSTORM / EXECUTE / SYNC / EXPLORE / MULTI)
160
- 2. **Route** delegate to the right workflow and specialist sub-agents
161
- 3. **Complete** summarize what was done, current state, and next steps
197
+ | Flag | Effect |
198
+ |------|--------|
199
+ | `--json` | Structured JSON output (always use for agents) |
200
+ | `--lean` | Strip timestamps (saves tokens) |
201
+ | `--dry-run` | Validate without mutation |
202
+ | `--help` | Per-command usage |
162
203
 
163
- ARCS Caveman supports three intensity levels: `lite`, `full` (default), `ultra`. Code, tool arguments, DAG content, and commit messages are always full prose regardless of mode.
204
+ Full command discovery: `arcs --commands --json`.
164
205
 
165
- ### Sub-Agents
206
+ ---
166
207
 
167
- Dispatched automatically by the orchestrator. You do not interact with them directly.
208
+ ## Graph & Retrieval
168
209
 
169
- | Sub-Agent | Role | Model |
170
- |---|---|---|
171
- | **software-engineer** | Implementation specialist. Writes code, runs tests, ships features. Loads quick-dev, code-agent, TDD, executing-plans skills as needed. | Opus |
172
- | **tech-architect** | Architecture and analysis specialist. Deep structural reasoning, refactor guidance, trade-off evaluation, and root cause analysis without making hasty edits. | Haiku |
173
- | **qa-analyst** | Quality enforcement specialist. Proactive code audits, convention compliance, and verification gate enforcement. | Haiku |
174
- | **oncall-ops** | Debugging and diagnosis specialist. Finds root causes through systematic investigation, log triage, bisect, and performance profiling. | Opus |
175
- | **arcs-docs** | ARCS documentation specialist. Manages plans, knowledge entries, diagrams, and DAG health. | Opus |
176
- | **system-architect** | Architecture and design specialist. Module boundaries, dependency graphs, migration strategies, and cross-project design decisions. | Opus |
177
- | **code-reviewer** | Reviews code changes for production readiness. Catches correctness, maintainability, and testing issues. | Haiku |
178
- | **docs-researcher** | Handles documentation writing, research synthesis, and document-heavy analysis tasks. | Opus |
210
+ ARCS builds a relationship graph across all project entities:
179
211
 
180
- ---
212
+ | Edge Type | Weight | Connects |
213
+ |-----------|--------|----------|
214
+ | `task_belongs_to_plan` | 1.0 | Task → Plan |
215
+ | `task_blocks_task` | 0.95 | Task → Task (from `dependsOn`) |
216
+ | `shares_source_file` | 0.9 | Any → Any (co-reference) |
217
+ | `knowledge_touches_file` | 0.85 | Knowledge → File |
218
+ | `plan_contains_task` | 0.8 | Plan → Task |
219
+ | `shares_keywords` | 0.5 | Knowledge → Knowledge |
181
220
 
182
- ## Skills
221
+ Queries: `arcs search` uses BM25 for text + graph traversal (weighted BFS) for relationship scoring. `arcs next` enriches results with related knowledge from the graph.
183
222
 
184
- Skills are instruction sets loaded on demand. The orchestrator auto-layers them based on context; sub-agents load them at dispatch time.
185
-
186
- ### Work Mode (select exactly one per code-change dispatch)
223
+ ---
187
224
 
188
- | Skill | Load When |
189
- |---|---|
190
- | `quick-dev` | Fully bounded — rename, refactor, config nudge, trivial bugfix |
191
- | `code-agent` | 50–90% clear, 1–2 open decisions resolvable from the repo |
192
- | `test-driven-development` | New feature or bugfix — test-first discipline adds value |
193
- | `brainstorming` | Design open, product direction genuinely unclear |
225
+ ## Sub-Agents
194
226
 
195
- ### Lifecycle & Planning (layer on top of work mode)
227
+ The orchestrator dispatches specialist sub-agents with scoped prompts:
196
228
 
197
- | Skill | Load When |
198
- |---|---|
199
- | `writing-plans` | Have requirements, about to create a structured plan |
200
- | `executing-plans` | Have a plan, executing it in a separate session with checkpoints |
201
- | `subagent-driven-development` | Multi-task plan with independent leaf nodes |
202
- | `verification-before-completion` | Before claiming "done" on any non-trivial change |
203
- | `requesting-code-review` | Self-review gate at phase/feature completion |
204
- | `deep-pr-review` | Deep PR review triggered from a GitHub PR link |
229
+ | Sub-Agent | Role | When |
230
+ |-----------|------|------|
231
+ | **software-engineer** | Writes code, runs tests | EXECUTE bounded tasks |
232
+ | **system-architect** | Module boundaries, plan creation | BRAINSTORM design-open |
233
+ | **tech-architect** | Deep analysis, trade-offs | Analysis without edits |
234
+ | **oncall-ops** | Debugging, log triage, bisect | Bugs, test failures |
235
+ | **code-reviewer** | Pre-merge review | PR review, phase gates |
236
+ | **devil-advocate** | Adversarial KISS/YAGNI/DRY gate | Phase boundaries |
237
+ | **arcs-docs** | DAG health, knowledge curation | SYNC workflow |
205
238
 
206
- ### Diagnosis & Tooling
239
+ ### Skills (loaded per-dispatch)
207
240
 
208
- | Skill | Load When |
209
- |---|---|
210
- | `systematic-debugging` | Any bug, test failure, or unexpected behavior |
211
- | `confidence-gate` | Before irreversible actions — self-score with citations |
212
- | `to-diagram` | Creating or updating a Mermaid plan diagram |
213
- | `init-project` | Initializing a new ARCS project into the DAG |
214
- | `caveman-commit` | Writing git commit messages in ARCS Caveman mode |
241
+ | Category | Skills |
242
+ |----------|--------|
243
+ | **Work mode** (pick one) | `quick-dev`, `code-agent`, `test-driven-development`, `brainstorming` |
244
+ | **Lifecycle** | `writing-plans`, `executing-plans`, `subagent-driven-development` |
245
+ | **Quality** | `requesting-code-review`, `deep-pr-review`, `systematic-debugging` |
246
+ | **Tooling** | `to-diagram`, `init-project`, `caveman-commit` |
215
247
 
216
248
  ---
217
249
 
@@ -219,230 +251,104 @@ Skills are instruction sets loaded on demand. The orchestrator auto-layers them
219
251
 
220
252
  ```
221
253
  ~/.arcs/
222
- ├── meta.json # Global registry — all project slugs
223
- └── projects/
224
- └── {slug}/
225
- ├── meta.json # name · description · status · workspacePaths · lastSyncedAt
226
- ├── overview.md # 2-3 sentence summary + goals ← summary docs
227
- ├── tasks.md # Execution queue (auto-rendered from structured tasks)
228
- ├── dependencies.md # Upstream / downstream project edges
229
- ├── knowledge.md # Pointer page knowledge/ entries
230
- ├── AGENTS.md # Auto-generated guardrail doc (symlinked into workspace)
231
- ├── tasks/
232
- └── index.json # Structured task records (status, priority, planId)
233
- ├── plans/
234
- ├── {planId}.meta.json
235
- │ ├── {planId}.md # Plan body (prose) ← structured stores
236
- │ └── {planId}.diagram.mmd # Mermaid execution map (agents read this first)
237
- └── knowledge/
238
- ├── index.json
239
- ├── {entryId}.meta.json
240
- └── {entryId}.md # Knowledge entry body
241
- ```
242
-
243
- ### Summary Docs vs Structured Stores
244
-
245
- | Layer | Files | Purpose |
246
- |---|---|---|
247
- | **Summary docs** | `overview.md`, `tasks.md`, `dependencies.md`, `knowledge.md` | Quick-orientation landing pages — short, scannable, always current |
248
- | **Structured stores** | `plans/*.md`, `knowledge/*.md`, `tasks/index.json` | Full documents with indexed metadata — durable, searchable, detailed |
249
-
250
- ### Project Lifecycle
251
-
252
- ```
253
- draft → active → completed → archived
254
+ ├── meta.json # Global registry
255
+ └── projects/{slug}/
256
+ ├── meta.json # Project metadata + workspace paths
257
+ ├── overview.md # Summary + goals
258
+ ├── tasks.md # Rendered task queue (human-readable)
259
+ ├── tasks/index.json # Structured tasks + dependsOn edges
260
+ ├── plans/
261
+ ├── {id}.meta.json # Plan status + keywords
262
+ ├── {id}.md # Plan body
263
+ │ └── {id}.diagram.mmd # Mermaid execution map (auto-generated arrows)
264
+ └── knowledge/
265
+ ├── index.json # Knowledge index
266
+ ├── {id}.meta.json # Metadata (kind, audience, sourceFiles)
267
+ └── {id}.md # Entry body
254
268
  ```
255
269
 
256
- ### Plan Diagrams
257
-
258
- Each plan has an associated `.diagram.mmd` file — a Mermaid flowchart that serves as the **agent execution map**. Agents read the diagram first for task selection before loading plan prose.
259
-
260
- Node status is encoded via `classDef`:
270
+ ### Knowledge Kinds
261
271
 
262
- | Class | Meaning |
263
- |---|---|
264
- | `:::backlog` | Not started |
265
- | `:::in_progress` | Active |
266
- | `:::done` | Complete |
267
- | `:::blocked` | Waiting on dependency |
272
+ 8 structured categories: `lesson`, `gotcha`, `pattern`, `architecture`, `module`, `feature`, `reference`, `decision`.
268
273
 
269
274
  ---
270
275
 
271
- ## Workspace Integration
272
-
273
- Registering a workspace path enables two features:
274
-
275
- **1. Context resolution** — `arcs context --path=/path/to/repo` matches the directory to its ARCS project and returns the operating brief, current focus, active plans, and relevant knowledge.
276
-
277
- **2. AGENTS.md generation** — `arcs sync-agents-md <slug>` assembles a coding guardrail document from three sources and symlinks it into each workspace:
278
-
279
- | Source | Content |
280
- |---|---|
281
- | Coding discipline | Non-negotiable rules (DRY, single responsibility, etc.) |
282
- | Codebase analysis | LLM-provided scan of tech stack, patterns, file structure |
283
- | Project context | ARCS overview, current focus, dependencies, active plans |
284
-
285
- ---
286
-
287
- ## Development
276
+ ## Quick Start
288
277
 
289
- ### Setup
278
+ **1. Install**
290
279
 
291
280
  ```bash
292
- npm install
293
- npm run build
281
+ npm install -g @rryando/arcs
294
282
  ```
295
283
 
296
- ### Commands
284
+ Registers `arcs` CLI, creates `~/.arcs/`, deploys agents + skills to `~/.config/opencode/`.
297
285
 
298
- | Command | Description |
299
- |---|---|
300
- | `npm run build` | Compile TypeScript → `dist/` |
301
- | `npm run dev` | Watch mode (rebuild on change) |
302
- | `npm test` | Run Vitest test suite (62 test files, 685 tests) |
303
- | `npm run typecheck` | Type check without emit |
304
- | `npm run lint` | Biome lint + format check |
305
- | `npm run lint:fix` | Auto-fix lint and format issues |
306
- | `npm run format` | Format only |
286
+ **2. Track a project**
307
287
 
308
- Full quality gate before committing:
309
288
  ```bash
310
- npm test && npm run typecheck && npm run lint
289
+ cd your-project
290
+ arcs init
311
291
  ```
312
292
 
313
- ### Testing Patterns
314
-
315
- | Pattern | Detail |
316
- |---|---|
317
- | Framework | Vitest |
318
- | DAG isolation | `withTempDataDir()` — each test gets a fresh `~/.arcs/` |
319
- | No mocks | Core DAG I/O tests operate on real (temp) filesystem |
320
- | Test location | All tests in `test/` (not co-located with source) |
321
-
322
- ### Environment
293
+ **3. Use it**
323
294
 
324
295
  ```bash
325
- # Override data directory (default: ~/.arcs/)
326
- ARCS_DATA_DIR=/path/to/custom/dir arcs context
296
+ arcs brief # What should I work on?
297
+ arcs next # Get next unblocked task
298
+ arcs done <taskId> # Mark complete, unblock dependents
299
+ arcs remember "..." # Capture what I learned
327
300
  ```
328
301
 
329
- ---
302
+ Or select **ARCS Orchestrator** in OpenCode for full automation.
330
303
 
331
- ## Bundle Release Playbook
304
+ ---
332
305
 
333
- > **Rule:** repo → config only. Never overwrite repo files from config.
306
+ ## Prerequisites
334
307
 
335
- | Step | Command | Notes |
336
- |---|---|---|
337
- | 1. Edit | Modify `opencode/arcs/skills/` or `opencode/arcs/prompts/` | Source of truth is the repo |
338
- | 2. Build | `npm run build:opencode-bundle` | Produces hashes, runtime JSON |
339
- | 3. Lint | `arcs lint-bundle` | Must pass with zero errors |
340
- | 4. Dry-run | `arcs deploy-superpowers --dry-run` | Review `filesAdded / filesChanged / filesRemoved` |
341
- | 5. Deploy | `arcs deploy-superpowers` | Writes to `~/.config/opencode/` |
342
- | 6. Restart | Restart OpenCode / IDE | Skills load at startup |
308
+ | Tool | Required | Notes |
309
+ |------|----------|-------|
310
+ | [Node.js](https://nodejs.org/) v18+ | Yes | Runtime |
311
+ | [OpenCode](https://opencode.ai/) | Recommended | Agent host (orchestrator + sub-agents) |
312
+ | [graphify](https://github.com/safishamsi/graphify) | No | Optional AST-based codebase knowledge extraction |
343
313
 
344
314
  ---
345
315
 
346
- ## Graphify Integration (Optional)
316
+ ## Graphify (Optional)
347
317
 
348
- Graphify performs AST-based static analysis of your codebase and ingests the results as ARCS knowledge entries without any LLM API calls.
318
+ When [graphify](https://github.com/safishamsi/graphify) is on PATH, ARCS auto-extracts structural knowledge during INIT and SYNC:
349
319
 
350
- See installation instructions at **https://github.com/safishamsi/graphify**.
320
+ | Category | Cap | What |
321
+ |----------|-----|------|
322
+ | God nodes | 8 | Highest-connectivity modules |
323
+ | Clusters | 8 | Directory-based module boundaries |
324
+ | Couplings | 5 | Cross-module dependency links |
351
325
 
352
- ### What gets extracted
326
+ ---
353
327
 
354
- | Category | Cap | Description |
355
- |---|---|---|
356
- | God nodes | 8 | Highest-connectivity modules — likely architectural hubs |
357
- | Architecture clusters | 8 | Directory-based groupings revealing module boundaries |
358
- | Cross-module couplings | 5 | Links between high-degree nodes across top-level directories |
328
+ ## Development
359
329
 
360
- ### When it runs
330
+ ```bash
331
+ git clone https://github.com/rryando/arcs.git
332
+ cd arcs && npm install && npm run build
333
+ ```
361
334
 
362
- | Trigger | Action |
363
- |---|---|
364
- | `arcs init` | Full extraction → up to 20 knowledge proposals → creates DAG entries |
365
- | SYNC workflow | Re-extracts, compares against existing entries, surfaces stale / new / drifted |
366
- | Ad-hoc | `arcs graphify-sync <slug>` re-extracts codebase graph on demand |
335
+ | Command | Description |
336
+ |---------|-------------|
337
+ | `npm run build` | Compile TypeScript to `dist/` |
338
+ | `npm test` | Vitest suite (67 files, 744 tests) |
339
+ | `npm run typecheck` | Type check without emit |
340
+ | `npm run lint` | Biome lint + format |
367
341
 
368
- Output: `graphify-out/graph.json` in workspace (auto-added to `.gitignore`).
342
+ ### Bundle Workflow
369
343
 
370
- If graphify is not installed, ARCS operates normally — all graphify features are gated behind availability checks.
344
+ ```bash
345
+ npm run build:opencode-bundle # Build agent/skill bundle
346
+ arcs lint-bundle # Validate bundle integrity
347
+ arcs deploy-superpowers # Deploy to ~/.config/opencode/
348
+ ```
371
349
 
372
350
  ---
373
351
 
374
- ## Project Structure
352
+ ## License
375
353
 
376
- ```
377
- arcs/
378
- ├── src/
379
- │ ├── index.ts # Main entry point — dispatches to CLI
380
- │ ├── cli/
381
- │ │ ├── index.ts # Registry-first CLI router + fallback
382
- │ │ ├── command-registry.ts # Declarative command registration system
383
- │ │ ├── arg-parser.ts # Schema-driven argument parser
384
- │ │ ├── output-envelope.ts # Structured JSON output ({ok, data} / {ok, code, message})
385
- │ │ ├── help-generator.ts # Auto-generated help text from registry
386
- │ │ ├── dag-commands.ts # LEGACY: thin delegation shell (backward-compat)
387
- │ │ ├── brief-renderer.ts # Renders brief output for arcs brief command
388
- │ │ ├── md-renderer.ts # Markdown rendering utilities
389
- │ │ ├── bundle-installer.ts # OpenCode bundle installer
390
- │ │ ├── setup.ts # Interactive setup wizard
391
- │ │ ├── lean-output.ts # --lean flag support (strip timestamps)
392
- │ │ ├── arcs-orchestrate.ts # Orchestrator prompt content
393
- │ │ ├── status-dashboard.ts # TTY status overview
394
- │ │ └── commands/ # 17 focused command modules (≤400 lines each)
395
- │ │ ├── index.ts # Trigger all command registrations (side-effects)
396
- │ │ ├── brief.ts # T0 operating brief
397
- │ │ ├── next.ts # arcs next — get next task + related knowledge
398
- │ │ ├── done.ts # arcs done — mark task complete (--learn flag)
399
- │ │ ├── remember.ts # arcs remember — capture knowledge (auto-classify)
400
- │ │ ├── status.ts # arcs status — progress overview
401
- │ │ ├── project.ts # project list, get, init, validate
402
- │ │ ├── project-updates.ts # project update-doc, update-status, update-paths
403
- │ │ ├── task.ts # task list, get, create, transition, update, delete
404
- │ │ ├── plan.ts # plan list, get, create, update-meta, update-body, delete
405
- │ │ ├── knowledge.ts # knowledge CRUD
406
- │ │ ├── knowledge-search.ts # Dedicated knowledge search
407
- │ │ ├── utility.ts # context, search, agents-md, validate
408
- │ │ ├── batch.ts # batch operations
409
- │ │ ├── graph.ts # related, graph inspect
410
- │ │ ├── diagnostics.ts # audit, diff
411
- │ │ ├── diagram.ts # diagram ready/inspect/validate/status/show
412
- │ │ ├── dependency.ts # dependency add/remove
413
- │ │ ├── maintenance.ts # git-log, sync-agents-md
414
- │ │ ├── bundle.ts # lint-bundle, deploy-superpowers
415
- │ │ └── loop.ts # loop start, cancel, status
416
- │ ├── retrieval/
417
- │ │ ├── bm25.ts # BM25 full-text scoring
418
- │ │ ├── graph-retrieval.ts # Graph-based related-entity retrieval
419
- │ │ ├── knowledge-selection.ts # Graph+BM25 knowledge selection for context
420
- │ │ └── graph-cache.ts # Graph index caching + invalidation
421
- │ └── utils/
422
- │ ├── dag.ts # Core DAG I/O
423
- │ ├── project-memory.ts # Barrel re-exporting split modules below
424
- │ ├── storage-utils.ts # Shared enums, types, filesystem helpers
425
- │ ├── plan-store.ts # Plan CRUD operations
426
- │ ├── knowledge-store.ts # Knowledge CRUD operations
427
- │ ├── task-store.ts # Task CRUD operations
428
- │ ├── paths.ts # Data dir and project path helpers
429
- │ ├── workflow-policy.ts # deriveOperatingBrief(), WorkflowSurface
430
- │ ├── schemas.ts # Shared Zod schemas
431
- │ ├── graphify.ts # Graphify integration (detect, extract, ingest)
432
- │ ├── graphify-knowledge.ts # Graphify→knowledge entry ingestion helpers
433
- │ ├── diagram-generator.ts # Generate Mermaid diagrams from task metadata
434
- │ ├── errors.ts # Error factory functions
435
- │ └── file-lock.ts # Advisory file locking for concurrent writes
436
- ├── opencode/arcs/
437
- │ ├── skills/ # Agent skill instruction sets (15 skills)
438
- │ ├── prompts/ # Sub-agent prompt definitions (8 agents)
439
- │ ├── manifest.json # Bundle install manifest
440
- │ └── bundle-runtime.json # Curated runtime payload
441
- ├── scripts/
442
- │ ├── arcs-cli.mjs # CLI entry wrapper (bin)
443
- │ └── build-opencode-bundle.mjs # Build bundle
444
- └── test/ # Vitest test suite (62 files, 685 tests)
445
- └── helpers/
446
- ├── cli-runner.ts # runCommand() for registry-path invocation
447
- └── temp-data-dir.ts # withTempDataDir() — isolated DAG state
448
- ```
354
+ MIT