@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
@@ -10,9 +10,10 @@ description: Use when you have a written implementation plan to execute in a sep
10
10
  You have a written implementation plan to execute task-by-task with verification checkpoints.
11
11
 
12
12
  **NOT for:**
13
- - If subagents are available → use `subagent-driven-development` instead (parallel dispatch, two-stage review)
14
13
  - If the task needs iterative self-correction without a structured plan → use `loop` instead
15
14
 
15
+ Sequential single-agent execution is the **default**. When the orchestrator signals 2+ independent sub-problems, switch to **Parallel Mode** (below) — fan-out multi-agent dispatch of independent ready nodes with two-stage review.
16
+
16
17
  > CLI: `arcs --commands --json` for discovery. Mutating commands run directly — no token.
17
18
 
18
19
  ## Flow
@@ -71,6 +72,159 @@ Sub-agents run `arcs` lookups only to fill gaps the dispatch left open — never
71
72
 
72
73
  Sub-agents MUST NOT edit `.mmd` files — orchestrator owns diagram updates.
73
74
 
75
+ ## Parallel Mode
76
+
77
+ When the orchestrator signals 2+ independent sub-problems, execute the plan via fresh subagents fanned out across independent ready nodes, with two-stage review per task. This replaces the sequential single-agent walk above with diagram-first parallel dispatch.
78
+
79
+ ### Parallel Flow
80
+
81
+ ```mermaid
82
+ flowchart TD
83
+ A[Load plan + extract all tasks] --> B{Diagram .mmd exists?}
84
+ B -->|yes| C[arcs diagram ready → get parallel-safe nodes]
85
+ B -->|no| D[Pick next task sequentially]
86
+ C --> E[Read node metadata: skill, scope, acceptance, verify]
87
+ D --> F[Construct subagent prompt]
88
+ E --> F
89
+ F --> G[Dispatch implementer subagent]
90
+ G --> H{Subagent status?}
91
+ H -->|DONE / DONE_WITH_CONCERNS| I[Dispatch spec-reviewer subagent]
92
+ H -->|NEEDS_CONTEXT| J[Provide context, re-dispatch]
93
+ H -->|BLOCKED| K{Assess blocker}
94
+ J --> G
95
+ K -->|context gap| J
96
+ K -->|needs stronger model| L[Re-dispatch with capable model]
97
+ K -->|task too large| M[Split task, update plan]
98
+ K -->|plan wrong| N[Escalate to human]
99
+ L --> G
100
+ I --> O{Spec compliant?}
101
+ O -->|no| P[Implementer fixes spec gaps] --> I
102
+ O -->|yes| Q[Code-quality review — see gate note below]
103
+ Q --> R{Quality approved?}
104
+ R -->|no| S[Implementer fixes quality issues] --> Q
105
+ R -->|yes| T[Mark task done]
106
+ T --> U{More tasks?}
107
+ U -->|yes| B
108
+ U -->|no| V[Dispatch devil-advocate PHASE: completion — the single full-project pass]
109
+ V -->|PASS| W[Report completion]
110
+ V -->|BLOCK| X[Re-dispatch scoped fixes per FAILURES] --> V
111
+ ```
112
+
113
+ **Gate cap:** two consecutive completion BLOCKs → stop and escalate to human; never loop the V→X cycle a third time.
114
+
115
+ **Under the ARCS orchestrator:** the orchestrator's devil-advocate PHASE: execute gate replaces the code-quality reviewer step (the gate runs the scoped VERIFY and the drift check); spec review remains. Running standalone (no orchestrator session), keep both reviewer stages as drawn.
116
+
117
+ ### Retry & Escalation
118
+
119
+ ```mermaid
120
+ flowchart TD
121
+ A[Subagent fails] --> B{First attempt?}
122
+ B -->|yes| C[Re-dispatch with more context or stronger model]
123
+ B -->|no| D{Same failure mode?}
124
+ D -->|yes| E[Escalate to human — don't loop]
125
+ D -->|no| C
126
+ C --> F{Success?}
127
+ F -->|yes| G[Continue pipeline]
128
+ F -->|no| D
129
+ ```
130
+
131
+ ### Diagram-First Dispatch
132
+
133
+ When the plan has a `.mmd` file:
134
+
135
+ 1. `arcs diagram ready <slug> <planId>` → all returned nodes are dispatch-safe in parallel
136
+ 2. Use per-node `%%` metadata (`skill`, `scope`, `files`, `acceptance`, `verify`) to construct prompts
137
+ 3. After completion: `arcs task transition <slug> <taskId> done --diagramNodeId=T001 --planId=<planId>` (standalone only — under the orchestrator, report done and let it transition)
138
+ 4. Re-run `diagram ready` to discover newly-unblocked nodes
139
+ 5. If node metadata is incomplete, fall back to reading the plan body for that task
140
+
141
+ **Ownership:** Dispatcher owns `.mmd` updates. Implementer subagents MUST NOT edit diagrams.
142
+
143
+ ### Sub-Agent Prompt Construction
144
+
145
+ Every implementer subagent prompt MUST include:
146
+
147
+ | Section | Content |
148
+ |---------|---------|
149
+ | **Goal** | Exact task description from plan (full text, not summary) |
150
+ | **Context** | Where this task fits in the plan; what came before |
151
+ | **Scope** | File boundaries — what to touch, what NOT to touch |
152
+ | **Acceptance** | Done criteria copied verbatim from plan/diagram |
153
+ | **Verify** | Exact command to run before claiming done — scoped to the task's files, never the full suite |
154
+ | **Skill** | Which work-mode skill to load (from diagram metadata or inferred) |
155
+ | **Return** | Structured Return envelope (below) — brief prose findings first, JSON block last |
156
+
157
+ Do NOT make the subagent read the plan file. Provide full text in the prompt. Prompt templates: `./implementer-prompt.md`, `./spec-reviewer-prompt.md`, `./code-quality-reviewer-prompt.md`.
158
+
159
+ ### Model Selection
160
+
161
+ | Task complexity | Model tier |
162
+ |----------------|-----------|
163
+ | 1-2 files, clear spec, mechanical | Fast/cheap |
164
+ | Multi-file integration, pattern matching | Standard |
165
+ | Architecture, design, review | Most capable |
166
+
167
+ ### Structured Return
168
+
169
+ All sub-agents MUST return a JSON block as the LAST thing in their message — brief prose findings first, JSON block last, nothing after it:
170
+
171
+ ```json
172
+ {
173
+ "status": "DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT",
174
+ "summary": "<1-2 sentences>",
175
+ "payload": { "<role-specific fields per prompt template>": "..." }
176
+ }
177
+ ```
178
+
179
+ Role payloads: implementer → `filesChanged`/`filesCreated`/`verification{command,result,scopeReason}`/`concerns`/`scopeChanges`; spec reviewer → `compliant`/`issues`; quality reviewer → `approved`/`issues`.
180
+ Orchestrator parses `status` for routing, `payload` for action.
181
+ Mapping to the orchestrator's Standard Return Envelope: DONE→done, DONE_WITH_CONCERNS→done + concerns surfaced, BLOCKED→blocked, NEEDS_CONTEXT→blocked.
182
+
183
+ Include in every dispatch prompt:
184
+ > "Return format: brief prose findings first, then the JSON envelope (status + typed payload) from your role's prompt template as the LAST thing in your message — nothing after it."
185
+
186
+ ### Review Gates
187
+
188
+ - **Spec review** (always): a fresh reviewer verifies the implementer built what was requested — nothing more, nothing less. Reads the actual code, never trusts the report. See `./spec-reviewer-prompt.md`.
189
+ - **Code-quality review** (standalone only): a fresh reviewer verifies the implementation is clean, tested, maintainable. See `./code-quality-reviewer-prompt.md`. **Under the ARCS orchestrator, the devil-advocate PHASE: execute gate replaces this step** (it runs the scoped VERIFY + drift check) — spec review still runs.
190
+ - Spec review BEFORE code quality review (never reverse). Never skip re-review after fixes — if a reviewer finds issues, the implementer fixes and the reviewer re-reviews until approved.
191
+
192
+ ### Parallelism Rules
193
+
194
+ Parallel implementers are allowed when tasks touch **zero shared files**.
195
+
196
+ 1. **Independence check:** verify no file overlap before dispatch. If overlap → serialize.
197
+ 2. **Batch limit:** maximum 4 concurrent subagents per round. Queue remaining.
198
+ 3. **Prompt construction:** per the Sub-Agent Prompt Construction table above — all rows required.
199
+ 4. **Conflict detection:** after fan-out completes, check for conflicting edits before committing.
200
+ 5. **Shared context:** fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
201
+
202
+ **When to serialize instead:**
203
+ - Tasks share source files (even different functions in same file)
204
+ - Task B's approach depends on Task A's output
205
+ - Both tasks modify test fixtures or shared mocks
206
+
207
+ ### Knowledge Capture at Fan-In
208
+
209
+ The `concerns`, `scopeChanges`, and `DONE_WITH_CONCERNS` payloads collected from each subagent are near-free durable signal — don't discard them. At fan-in, route the durable items (a non-obvious trap hit, a convention that had to be discovered, a plan-vs-reality delta) into the DAG: `arcs knowledge upsert <slug> "<title>" --kind=<gotcha|pattern> --summary="<1-2 sentences>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. Skip purely mechanical or task-local notes. Upsert is idempotent by title.
210
+
211
+ ### Git State Discipline (Parallel)
212
+
213
+ - Sub-agents MUST NOT run `git stash` — ever, under any circumstance
214
+ - Sub-agents MUST NOT run `git checkout` on shared branches
215
+ - Sub-agents commit their changes atomically (scoped to task files) before reporting back
216
+ - Other agents may be working concurrently — do not assume a clean worktree
217
+ - Use `git diff HEAD -- <your-files>` to verify YOUR changes only — bare `git diff` is unreliable in parallel
218
+ - If you see unexpected changes in files outside your scope: **ignore them** — they belong to another agent
219
+
220
+ ### Parallel Mode Constraints
221
+
222
+ - Fresh subagent per task — never reuse session context
223
+ - Parallel implementers only when zero file overlap (dispatcher verifies)
224
+ - Never ignore BLOCKED/NEEDS_CONTEXT status — something must change
225
+ - DONE_WITH_CONCERNS: read concerns before proceeding; address if correctness/scope related
226
+ - Scope changes discovered by subagents: report in summary, dispatcher handles diagram regeneration
227
+
74
228
  ## Review Checkpoint Criteria
75
229
 
76
230
  **STOP executing immediately when:**
@@ -26,7 +26,7 @@ flowchart TD
26
26
  F -->|no| H[Skip graph step, log gap]
27
27
  G --> G2[ingestGraph → ≤20 proposals]
28
28
  G2 --> G3[codegraph MCP explore / impact for enrichment]:::sub
29
- H & G3 --> I[Fan out: system-architect + docs-researcher + tech-architect]:::sub
29
+ H & G3 --> I[Fan out: tech-architect + docs-researcher]:::sub
30
30
  I --> J[Collect proposals → dedup → arcs knowledge create × N]
31
31
  J --> K[Done]
32
32
  ```
@@ -87,10 +87,9 @@ Update via `arcs project update-doc <slug> <doc> --content="..."`.
87
87
 
88
88
  | Sub-agent | Owns | Knowledge kinds it produces |
89
89
  |-----------|------|----------------------------|
90
- | `system-architect` | Module boundaries, clusters, dependency direction | `architecture`, `module` |
90
+ | `tech-architect` | Module boundaries, clusters, dependency direction, cross-module couplings, structural gotchas, lessons | `architecture`, `module`, `gotcha`, `lesson` |
91
91
  | `docs-researcher` | Tech stack, third-party libraries, key files, features | `reference`, `feature` |
92
- | `tech-architect` | Cross-module couplings, structural gotchas, lessons | `gotcha`, `lesson` |
93
- | `qa-analyst` (optional) | Coding-style + convention scan from existing code | `pattern` |
92
+ | `code-reviewer` (audit mode, optional) | Coding-style + convention scan from existing code | `pattern` |
94
93
 
95
94
  Dispatch in parallel — all agents in one message, per the orchestrator's Parallelism rules. Each agent receives:
96
95
  - The relevant `KnowledgeProposal` records from `ingestGraph` (so they don't rediscover what codegraph already found)
@@ -105,14 +104,14 @@ Each agent returns finalized proposals: `{title, kind, summary, keywords, source
105
104
  |----------|------|------------------|---------------|
106
105
  | tech stack | `architecture` | Languages, frameworks, runtimes, build tools, versions | `docs-researcher` |
107
106
  | key files | `reference` | Entry points, config files, main modules, purposes | `docs-researcher` (use `codegraph_search "entry points"`) |
108
- | code patterns | `pattern` | Recurring design patterns, abstractions, error handling | `qa-analyst` or `system-architect` |
109
- | coding style | `pattern` | Formatting, linting, import ordering, file organization | `qa-analyst` |
110
- | core modules | `module` | Core modules / shared functions — what, where, interconnections | `system-architect` (god nodes from codegraph) |
107
+ | code patterns | `pattern` | Recurring design patterns, abstractions, error handling | `code-reviewer` (audit mode) or `tech-architect` |
108
+ | coding style | `pattern` | Formatting, linting, import ordering, file organization | `code-reviewer` (audit mode) |
109
+ | core modules | `module` | Core modules / shared functions — what, where, interconnections | `tech-architect` (god nodes from codegraph) |
111
110
  | external services | `module` | APIs, databases, message queues the project interacts with | `docs-researcher` |
112
111
  | third-party libraries | `reference` | Key dependencies and why they are used | `docs-researcher` |
113
112
  | features | `feature` | Major user-facing or system-facing features | `docs-researcher` |
114
113
  | cross-module couplings | `gotcha` | Hot edges between modules surfaced by codegraph | `tech-architect` (auto from `ingestGraph`) |
115
- | architecture clusters | `architecture` | Pseudo-community / directory groupings from codegraph | `system-architect` (auto from `ingestGraph`) |
114
+ | architecture clusters | `architecture` | Pseudo-community / directory groupings from codegraph | `tech-architect` (auto from `ingestGraph`) |
116
115
 
117
116
  ## Worked Example
118
117
 
@@ -137,9 +136,8 @@ arcs proposal promote foo <id> --title="..." --summary="..." --body-file=... --k
137
136
  arcs proposal drop foo <id> --reason="..." --json
138
137
 
139
138
  # 5. Fan out typed agents (parallel) for entries beyond proposal scope
140
- # system-architect → architecture/module entries
139
+ # tech-architect → architecture/module/gotcha/lesson entries
141
140
  # docs-researcher → reference/feature entries
142
- # tech-architect → gotcha/lesson entries
143
141
 
144
142
  # 6. Write any non-proposal-derived knowledge entries directly
145
143
  arcs knowledge create foo "Tech stack: TypeScript + Node 20" --kind=architecture --summary="..." --body="..." --json
@@ -39,7 +39,7 @@ When gathering conventions, also pull what the DAG already knows so the reviewer
39
39
  ## When to Request
40
40
 
41
41
  **Mandatory:** after major features, before merge to main.
42
- **Already scheduled:** when `subagent-driven-development` drives the loop, its pipeline dispatches this review as stage 2 (code-quality-reviewer applies this template's checklist but returns the SDD JSON envelope) — do not schedule it twice for the same task.
42
+ **Already scheduled:** when `executing-plans` parallel mode drives the loop, its pipeline dispatches this review as stage 2 (code-quality-reviewer applies this template's checklist but returns the parallel-mode JSON envelope) — do not schedule it twice for the same task.
43
43
  **Optional:** when stuck, before refactoring, after complex bugfix.
44
44
 
45
45
  ## Red Flags
@@ -75,7 +75,7 @@ git diff {BASE_SHA}..{HEAD_SHA}
75
75
 
76
76
  No prose narrative. No "Overall this looks..." — open with the Standard Return Envelope, then VERDICT, then FINDINGS grouped by severity.
77
77
 
78
- When dispatched via subagent-driven-development, return its JSON envelope instead (see code-quality-reviewer-prompt.md).
78
+ When dispatched via executing-plans parallel mode, return its JSON envelope instead (see code-quality-reviewer-prompt.md).
79
79
 
80
80
  ```
81
81
  STATUS: done | blocked | partial
@@ -9,7 +9,7 @@ description: Use when implementing any feature or bugfix, before writing impleme
9
9
 
10
10
  Implementing any feature, bugfix, or behavior change. No production code without a failing test first.
11
11
 
12
- > **Note:** This skill is typically invoked BY `code-agent` when new non-trivial behavior needs test-first implementation. Rarely loaded directly by orchestrators prefer routing through `code-agent` which will invoke TDD as needed.
12
+ > **Note:** This skill is loaded DIRECTLY by the orchestrator when test-first is a hard requirement (the decision tree's "test-first valuable" trigger). It is also available as a sub-flow within `code-agent`, which invokes TDD when new non-trivial behavior needs test-first implementation.
13
13
 
14
14
  ## Flow
15
15
 
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: writing-knowledge
3
+ description: Use when capturing a knowledge entry, before writing its body — to author a substantive per-kind body, not a summary-only stub
4
+ ---
5
+
6
+ # Skill: writing-knowledge
7
+
8
+ ## When
9
+
10
+ You are about to persist a durable insight to the DAG (`arcs knowledge upsert` / `create`) and need the entry to be *actionable*, not a stub.
11
+
12
+ > CLI Primer: `arcs --commands --json` for discovery. Mutating commands run directly — no token.
13
+
14
+ ## The Floor: Every Entry Needs a Body
15
+
16
+ A knowledge entry is two things: a `--summary` (the headline) and a `--body` (the substance). The single most common KB failure is the **summary-only stub** — an entry whose summary just restates its title and whose body is empty. It is structurally "healthy" and worthless to the next dispatch.
17
+
18
+ EVERY non-mechanical entry MUST carry a real `--body` (`--body="…"` inline, or `--body-file=<path>` once it's long enough to fight shell-escaping). The value lives in the body, written to the **anatomy of its kind**.
19
+
20
+ ## Scaffold, Don't Freehand
21
+
22
+ Before writing, scaffold the section skeleton from the command:
23
+
24
+ ```bash
25
+ arcs knowledge template --kind=<kind> --json # structured sections
26
+ arcs knowledge template --kind=<kind> # plain markdown skeleton
27
+ ```
28
+
29
+ This emits one `## <heading>` per section with a deletable hint comment. **Fill EVERY section** — a half-filled skeleton is still a stub.
30
+
31
+ > **DRY / authoritative source:** `arcs knowledge template` is the AUTHORITATIVE skeleton. The anatomy below only *illustrates* the shape. If the table here ever diverges from the command output, **the command wins** — scaffold from it, not from this file.
32
+
33
+ ## The 8 Kinds at a Glance
34
+
35
+ | Kind | Section anatomy |
36
+ | --- | --- |
37
+ | **gotcha** | Symptom · Root cause · Fix or workaround · Trigger |
38
+ | **lesson** | Expectation · What happened · Why · Next time |
39
+ | **pattern** | When to use · Shape · Example · When not to use |
40
+ | **architecture** | Structure · Invariant or constraint · Failure mode |
41
+ | **decision** | Decision · Rationale and forces · Alternatives rejected · Consequences |
42
+ | **module** | Purpose · Key files and entry points · Responsibilities · Dependencies |
43
+ | **feature** | What it does · How it works · Entry points · Edge cases |
44
+ | **reference** | Summary · Canonical location · Usage notes |
45
+
46
+ Pick the kind by what the insight *is*: a bug you hit → `gotcha`; a wrong belief corrected → `lesson`; a reusable shape → `pattern`; a structural why → `architecture`; a single settled call → `decision`; an area of the codebase → `module`/`feature`; a pointer to a canonical source → `reference`.
47
+
48
+ ## Write
49
+
50
+ ```bash
51
+ arcs knowledge upsert <slug> "<title>" \
52
+ --kind=<kind> \
53
+ --summary="<one-line headline>" \
54
+ --body="<every section of the kind, filled>" \
55
+ --keywords="<k1,k2>" \
56
+ --source-files="<path[:anchor],…>" \
57
+ --json
58
+ ```
59
+
60
+ `upsert` is idempotent by title — create-or-update, no dedup search dance. `--summary` AND `--body` AND `--source-files` together are the floor for a file-specific entry. Reach for `arcs knowledge create` only when creation MUST fail on an existing title.
61
+
62
+ ## Self-Check Before You Commit
63
+
64
+ > **"Could someone act on this in six months without re-deriving it?"**
65
+
66
+ If the insight cost you reasoning, a debug session, or a dead end, capture *that* — not just its one-line conclusion. Inverse (per the-ladder): if anyone could re-derive it in ten seconds, don't write it at all.
67
+
68
+ ## Constraints
69
+
70
+ - Scaffold from `arcs knowledge template` — never freehand the section headings.
71
+ - Fill every section; a half-filled skeleton is a stub.
72
+ - `--summary` is the headline, `--body` is the value — never ship summary-only.
73
+ - Match kind to the nature of the insight; don't force everything into `gotcha`.
74
+ - Skip capture entirely for purely mechanical work (renames, config nudges, diagram regens).
@@ -114,7 +114,7 @@ Expected: PASS
114
114
  ```markdown
115
115
  # [Feature Name] Implementation Plan
116
116
 
117
- > **For agentic workers:** REQUIRED: Use arcs:subagent-driven-development (if subagents available) or arcs:executing-plans to implement this plan.
117
+ > **For agentic workers:** REQUIRED: Use arcs:executing-plans to implement this plan (sequential single-agent by default, or parallel mode when independent tasks can fan out).
118
118
 
119
119
  **Goal:** [One sentence]
120
120
 
@@ -173,8 +173,7 @@ Then extract the plan's "why this structure" rationale into a durable entry —
173
173
 
174
174
  > "Plan complete and saved via `arcs plan get <slug> <planId>` in project `<slug>`. Ready to execute?"
175
175
 
176
- - **Subagents available** → REQUIRED: use `arcs:subagent-driven-development`
177
- - **No subagents** → use `arcs:executing-plans`
176
+ - REQUIRED: use `arcs:executing-plans` — its parallel mode fans out independent tasks to subagents when available, falling back to sequential single-agent execution otherwise
178
177
 
179
178
  ## Constraints
180
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rryando/arcs",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "ARCS — DAG-based task orchestration for AI agents. Persistent workflow continuity via graph-structured context.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -57,5 +57,8 @@
57
57
  "vite": "^6.4.1",
58
58
  "vitest": "^3.2.4",
59
59
  "@types/bun": "latest"
60
+ },
61
+ "allowScripts": {
62
+ "esbuild@0.25.12": true
60
63
  }
61
64
  }
@@ -30,10 +30,8 @@ const preservedOutputFiles = new Set([
30
30
  // Agent prompt files (repo-authored, referenced via {file:} in manifest.json)
31
31
  "prompts/software-engineer.txt",
32
32
  "prompts/tech-architect.txt",
33
- "prompts/qa-analyst.txt",
34
33
  "prompts/oncall-ops.txt",
35
34
  "prompts/arcs-docs.txt",
36
- "prompts/system-architect.txt",
37
35
  "prompts/code-reviewer.txt",
38
36
  "prompts/docs-researcher.txt",
39
37
  "prompts/devil-advocate.txt",
@@ -87,14 +87,12 @@ const agentTierMap = {
87
87
  "docs-researcher": "heavy",
88
88
  "arcs-docs": "heavy",
89
89
  "oncall-ops": "heavy",
90
- "system-architect": "heavy",
91
90
  "arcs-orchestrate": "standard",
92
91
  "arcs-orchestrate-caveman": "standard",
93
92
  "devil-advocate": "standard",
94
93
  "graph-explorer": "light",
95
94
  "code-reviewer": "light",
96
95
  "tech-architect": "light",
97
- "qa-analyst": "light",
98
96
  };
99
97
 
100
98
  // Agent descriptions mirror opencode/arcs/manifest.json (canonical) — keep in sync.
@@ -134,20 +132,6 @@ const agentMetadata = {
134
132
  tools: "Read, Glob, Grep, Bash",
135
133
  model: "inherit",
136
134
  },
137
- "qa-analyst": {
138
- name: "QA Analyst",
139
- description:
140
- "Quality enforcement specialist. Proactive code audits, review dispatch, convention compliance.",
141
- tools: "Read, Glob, Grep, Bash",
142
- model: "inherit",
143
- },
144
- "system-architect": {
145
- name: "System Architect",
146
- description:
147
- "Architecture and design specialist. Module boundaries, dependency graphs, migration strategies, and cross-project design decisions.",
148
- tools: "Read, Glob, Grep, Bash",
149
- model: "inherit",
150
- },
151
135
  "arcs-docs": {
152
136
  name: "ARCS Docs Specialist",
153
137
  description:
@@ -34,10 +34,8 @@ const preservedFiles = new Set([
34
34
  // requiredMerges, not from bundle-runtime.json's `agents` array).
35
35
  "prompts/software-engineer.txt",
36
36
  "prompts/tech-architect.txt",
37
- "prompts/qa-analyst.txt",
38
37
  "prompts/oncall-ops.txt",
39
38
  "prompts/arcs-docs.txt",
40
- "prompts/system-architect.txt",
41
39
  "prompts/code-reviewer.txt",
42
40
  "prompts/docs-researcher.txt",
43
41
  "prompts/devil-advocate.txt",
@@ -24,7 +24,7 @@ flowchart TD
24
24
  F -->|no| H[Skip graph step, log gap]
25
25
  G --> G2[ingestGraph → ≤20 proposals]
26
26
  G2 --> G3[codegraph MCP explore / impact for enrichment]:::sub
27
- H & G3 --> I[Fan out: system-architect + docs-researcher + tech-architect]:::sub
27
+ H & G3 --> I[Fan out: tech-architect + docs-researcher]:::sub
28
28
  I --> J[Collect proposals → dedup → arcs knowledge create × N]
29
29
  J --> K[Done]
30
30
  ```
@@ -82,10 +82,9 @@ If codegraph is missing, log "codegraph not on PATH; proceeding without graph si
82
82
 
83
83
  | Sub-agent | Owns | Knowledge kinds it produces |
84
84
  |-----------|------|----------------------------|
85
- | `system-architect` | Module boundaries, clusters, dependency direction | `architecture`, `module` |
85
+ | `tech-architect` | Module boundaries, clusters, dependency direction, cross-module couplings, structural gotchas, lessons | `architecture`, `module`, `gotcha`, `lesson` |
86
86
  | `docs-researcher` | Tech stack, third-party libraries, key files, features | `reference`, `feature` |
87
- | `tech-architect` | Cross-module couplings, structural gotchas, lessons | `gotcha`, `lesson` |
88
- | `qa-analyst` (optional) | Coding-style + convention scan from existing code | `pattern` |
87
+ | `code-reviewer` (audit mode, optional) | Coding-style + convention scan from existing code | `pattern` |
89
88
 
90
89
  Dispatch in parallel. Each agent receives the relevant `KnowledgeProposal` records from `ingestGraph` plus targeted codegraph MCP queries for evidence. Each agent returns finalized proposals (title, kind, summary, keywords, sourceFiles, body) for the orchestrator to write directly via `arcs knowledge create` (or `arcs batch`).
91
90
 
@@ -95,11 +94,11 @@ Dispatch in parallel. Each agent receives the relevant `KnowledgeProposal` recor
95
94
  |----------|------|------------------|---------------|
96
95
  | tech stack | `architecture` | Languages, frameworks, runtimes, build tools, versions | `docs-researcher` |
97
96
  | key files | `reference` | Entry points, config files, main modules, purposes | `docs-researcher` (codegraph_search "entry points") |
98
- | code patterns | `pattern` | Recurring design patterns, abstractions, error handling | `qa-analyst` or `system-architect` |
99
- | coding style | `pattern` | Formatting, linting, import ordering, file organization | `qa-analyst` |
100
- | core modules | `module` | Core modules/shared functions — what, where, interconnections | `system-architect` (god nodes from codegraph) |
97
+ | code patterns | `pattern` | Recurring design patterns, abstractions, error handling | `code-reviewer` (audit mode) or `tech-architect` |
98
+ | coding style | `pattern` | Formatting, linting, import ordering, file organization | `code-reviewer` (audit mode) |
99
+ | core modules | `module` | Core modules/shared functions — what, where, interconnections | `tech-architect` (god nodes from codegraph) |
101
100
  | external services | `module` | APIs, databases, message queues the project interacts with | `docs-researcher` |
102
101
  | third-party libraries | `reference` | Key dependencies and why they are used | `docs-researcher` |
103
102
  | features | `feature` | Major user-facing or system-facing features | `docs-researcher` |
104
103
  | cross-module couplings | `gotcha` | Hot edges between modules surfaced by codegraph | `tech-architect` (auto from `ingestGraph`) |
105
- | architecture clusters | `architecture` | Pseudo-community/directory groupings from codegraph | `system-architect` (auto from `ingestGraph`) |
104
+ | architecture clusters | `architecture` | Pseudo-community/directory groupings from codegraph | `tech-architect` (auto from `ingestGraph`) |
@@ -1,86 +0,0 @@
1
- You are a QA analyst — a quality enforcement specialist. You perform proactive audits, enforce conventions, and verify work meets standards. You never edit code — you produce findings and recommendations.
2
-
3
- ## IRON LAW
4
-
5
- Audits without evidence are incomplete. Every finding must cite file paths, line ranges, or command output. "It seems wrong" is not a finding.
6
-
7
- ## Session Start — T0 Orientation (Conditional)
8
-
9
- Your dispatch normally carries SCOPE/GOAL/CONTEXT/IDS. When it does, skip orientation and start — run orientation reads ONLY to fill gaps the dispatch left open:
10
- - Read `AGENTS.md` (team conventions: tech stack, file naming, code patterns, testing patterns) only when CONTEXT doesn't already state the conventions you need.
11
- - `arcs brief --lean --json` (live DAG state) and `arcs search <slug> "<keywords>" --json` only for context the dispatch omits.
12
-
13
- Never re-derive facts given in CONTEXT.
14
-
15
- Core skills you load: requesting-code-review (dispatch reviewers).
16
-
17
- You have ARCS CLI access — use it to read project context, check knowledge entries for patterns/conventions, and propose audit findings as tasks or knowledge for the orchestrator to create.
18
-
19
- READ ONLY: never edit code during quality assessment. Never execute tests, lint, or builds — the only command you may run is a scoped VERIFY command explicitly provided in your dispatch; runtime verification belongs to the devil-advocate completion gate. Produce structured reports with severity and ARCS artifact proposals.
20
-
21
- ## Quality Gate
22
-
23
- Phase-gate verification is owned by the orchestrator (via `devil-advocate` subagent at checkpoints). You do NOT self-score. Your job: produce findings with evidence, cite file:line for every claim.
24
-
25
- MANDATORY EXIT GATE: Before finalizing any audit, confirm you checked all required dimensions within the dispatch-declared SCOPE, findings match team conventions (from CONTEXT or AGENTS.md), and redundancy findings carry cross-module grep evidence for symbols defined in your SCOPE.
26
-
27
- ## Primary Commands
28
-
29
- | Command | When to use |
30
- |---------|-------------|
31
- | `arcs brief --lean --json` | Session start — orient on project state |
32
- | `arcs audit <slug> --json` | Run structural health checks (stale sourceFiles, orphan refs) |
33
- | `arcs validate <slug> --json` | Check DAG invariants (task/plan consistency). Use `--checks=sourcefiles\|status-drift\|diagrams\|agents-md` for targeted checks (default: `all`) |
34
- | `arcs diff <slug> --since="7d" --json` | Scope what changed since last audit |
35
- | `arcs knowledge list <slug> --json` | Review knowledge entries for taxonomy compliance |
36
- | `arcs search <slug> "<keywords>" --lean --json` | Find convention patterns to verify compliance |
37
- | `arcs related <slug> --task=<id> --json` | Find related tasks/knowledge via graph traversal (also accepts --plan or --knowledge) |
38
-
39
- All commands support `--json` for machine-readable output. Reads return `{ok, data}`; failures return `{ok:false, code, message, hint?}`. **Routing:** success → stdout, errors → stderr — always capture both with `2>&1`.
40
-
41
- ## Proactive Audit Workflow
42
-
43
- KNOWLEDGE-FIRST: before producing output, unless your dispatch CONTEXT already carries the relevant prior knowledge, run `arcs knowledge search <slug> "<scope keywords>" --lean --json` and read any kind=gotcha|pattern|lesson|architecture entry covering your SCOPE (`arcs knowledge get <slug> <id> --body --lean --json` for full text). Incorporate it — do not rediscover what the DAG already knows. Skip only for purely mechanical changes. Calibrate against the DAG's prior pattern/gotcha entries, not just grep and AGENTS.md.
44
-
45
- You are invoked BEFORE a feature lands — not after. Your job is to find problems before they ship. Stay within the dispatch-declared SCOPE. Steps 1-4 apply only when the dispatch GOAL is a project-level audit — skip them for feature-scoped audits.
46
-
47
- 1. `arcs brief --lean --json` — orient on project state
48
- 2. `arcs audit <slug> --json` — structural health check
49
- 3. `arcs validate <slug> --json` — DAG invariant check
50
- 4. `arcs knowledge list <slug> --json` — verify taxonomy compliance
51
- 5. `arcs search <slug> "<feature keywords>" --lean --json` — find related context the dispatch didn't carry
52
- 6. Cross-module grep: `rg "<symbol>" --type ts` — trace usage of symbols defined in your SCOPE across boundaries
53
- 7. Report: severity-grouped findings with file:line evidence
54
-
55
- ## Output Format
56
-
57
- Your output is consumed by the orchestrator (an LLM), not a human. Be structured and terse. Open with the Standard Return Envelope, then agent-specific sections:
58
-
59
- ```
60
- STATUS: done | blocked | partial
61
-
62
- FILES_TOUCHED: none (read-only — you never edit)
63
-
64
- VERIFY: <scoped VERIFY command from dispatch> → pass|fail (omit when the dispatch provides none)
65
-
66
- BLOCKED_BY: <only when blocked/partial — what prevented a complete audit>
67
-
68
- AUDIT: <what was audited — scope in one line>
69
-
70
- FINDINGS:
71
- - [CRITICAL] <file:line> — <issue>
72
- - [HIGH] <file:line> — <issue>
73
- - [MEDIUM] <file:line> — <issue>
74
- - [LOW] <file:line> — <issue>
75
-
76
- CONVENTIONS:
77
- - <compliant | violations with file:line>
78
-
79
- TASKS: <none | suggested tasks for orchestrator to create>
80
-
81
- KNOWLEDGE: <none | one ready-to-run command per durable, reusable insight surfaced this dispatch:
82
- arcs knowledge upsert <slug> "<title>" --kind=<lesson|gotcha|pattern|architecture|decision> --summary="<1-2 sentences>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json
83
- (upsert is idempotent by title — no dedup search needed)>
84
- ```
85
-
86
- No prose narrative. No "I audited..." — go straight to STATUS.