@rryando/arcs 3.6.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +180 -229
  2. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  3. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  4. package/dist/cli/arcs-orchestrate.js +59 -30
  5. package/dist/cli/arcs-orchestrate.js.map +1 -1
  6. package/dist/cli/brief-renderer.d.ts +5 -0
  7. package/dist/cli/brief-renderer.d.ts.map +1 -1
  8. package/dist/cli/brief-renderer.js +7 -0
  9. package/dist/cli/brief-renderer.js.map +1 -1
  10. package/dist/cli/commands/batch.js +24 -1
  11. package/dist/cli/commands/batch.js.map +1 -1
  12. package/dist/cli/commands/brief.js +24 -0
  13. package/dist/cli/commands/brief.js.map +1 -1
  14. package/dist/cli/commands/knowledge-search.js +2 -1
  15. package/dist/cli/commands/knowledge-search.js.map +1 -1
  16. package/dist/cli/commands/knowledge.js +112 -11
  17. package/dist/cli/commands/knowledge.js.map +1 -1
  18. package/dist/cli/commands/utility.d.ts +1 -1
  19. package/dist/cli/commands/utility.d.ts.map +1 -1
  20. package/dist/cli/commands/utility.js +60 -2
  21. package/dist/cli/commands/utility.js.map +1 -1
  22. package/dist/cli/instructions.d.ts.map +1 -1
  23. package/dist/cli/instructions.js +0 -2
  24. package/dist/cli/instructions.js.map +1 -1
  25. package/dist/cli/md-renderer.d.ts.map +1 -1
  26. package/dist/cli/md-renderer.js +5 -0
  27. package/dist/cli/md-renderer.js.map +1 -1
  28. package/dist/cli/setup.d.ts.map +1 -1
  29. package/dist/cli/setup.js +3 -5
  30. package/dist/cli/setup.js.map +1 -1
  31. package/dist/utils/knowledge-templates.d.ts +51 -0
  32. package/dist/utils/knowledge-templates.d.ts.map +1 -0
  33. package/dist/utils/knowledge-templates.js +209 -0
  34. package/dist/utils/knowledge-templates.js.map +1 -0
  35. package/opencode/arcs/bundle-runtime.json +7 -7
  36. package/opencode/arcs/manifest.json +0 -64
  37. package/opencode/arcs/prompts/arcs-docs.txt +11 -5
  38. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +59 -30
  39. package/opencode/arcs/prompts/arcs-orchestrate.txt +59 -30
  40. package/opencode/arcs/prompts/code-reviewer.txt +45 -1
  41. package/opencode/arcs/prompts/devil-advocate.txt +9 -0
  42. package/opencode/arcs/prompts/docs-researcher.txt +10 -8
  43. package/opencode/arcs/prompts/graph-explorer.txt +9 -6
  44. package/opencode/arcs/prompts/oncall-ops.txt +10 -7
  45. package/opencode/arcs/prompts/software-engineer.txt +8 -3
  46. package/opencode/arcs/prompts/tech-architect.txt +58 -18
  47. package/opencode/arcs/skills/brainstorming/SKILL.md +6 -0
  48. package/opencode/arcs/skills/code-agent/SKILL.md +4 -0
  49. package/opencode/arcs/skills/deep-pr-review/SKILL.md +9 -4
  50. package/opencode/arcs/skills/deep-pr-review/review-template.md +1 -1
  51. package/opencode/arcs/skills/executing-plans/SKILL.md +161 -1
  52. package/opencode/arcs/skills/init-project/SKILL.md +8 -10
  53. package/opencode/arcs/skills/quick-dev/SKILL.md +4 -0
  54. package/opencode/arcs/skills/requesting-code-review/SKILL.md +9 -1
  55. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +1 -1
  56. package/opencode/arcs/skills/test-driven-development/SKILL.md +1 -1
  57. package/opencode/arcs/skills/the-ladder/SKILL.md +2 -0
  58. package/opencode/arcs/skills/writing-knowledge/SKILL.md +74 -0
  59. package/opencode/arcs/skills/writing-plans/SKILL.md +8 -3
  60. package/package.json +4 -1
  61. package/scripts/build-opencode-bundle.mjs +0 -2
  62. package/scripts/deploy-claudecode-bundle.mjs +0 -16
  63. package/scripts/lint-bundle.mjs +0 -2
  64. package/skills/init-project.md +7 -8
  65. package/opencode/arcs/prompts/qa-analyst.txt +0 -82
  66. package/opencode/arcs/prompts/system-architect.txt +0 -88
  67. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +0 -181
  68. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/code-quality-reviewer-prompt.md +0 -0
  69. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/implementer-prompt.md +0 -0
  70. /package/opencode/arcs/skills/{subagent-driven-development → executing-plans}/spec-reviewer-prompt.md +0 -0
@@ -57,6 +57,10 @@ sourceFiles: [{path: "...", anchor: "..."}]
57
57
  ---end---
58
58
  ```
59
59
 
60
+ ## Prior Patterns Check
61
+
62
+ Before mapping structure, read what the DAG already knows so the plan follows established shape: `arcs knowledge search <slug> "<feature-keywords>" --lean --json`, filtering for `kind=pattern` and `kind=architecture`. Reuse known conventions rather than inventing parallel ones.
63
+
60
64
  ## File Structure
61
65
 
62
66
  Before defining tasks, map which files will be created/modified:
@@ -110,7 +114,7 @@ Expected: PASS
110
114
  ```markdown
111
115
  # [Feature Name] Implementation Plan
112
116
 
113
- > **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).
114
118
 
115
119
  **Goal:** [One sentence]
116
120
 
@@ -163,12 +167,13 @@ flowchart TD
163
167
  arcs plan create <slug> --title="YYYY-MM-DD <feature> Implementation Plan" --summary="..." --status=planned --keywords="implementation-plan" --body="<markdown>" --json
164
168
  ```
165
169
 
170
+ Then extract the plan's "why this structure" rationale into a durable entry — don't let the architecture reasoning stay sealed inside the plan body: `arcs knowledge upsert <slug> "<feature> architecture rationale" --kind=architecture --summary="<why the structure is shaped this way; key trade-offs>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json`. Use `--kind=decision` instead when the entry is really a single settled call rather than a structural shape. Upsert is idempotent by title.
171
+
166
172
  ## Execution Handoff
167
173
 
168
174
  > "Plan complete and saved via `arcs plan get <slug> <planId>` in project `<slug>`. Ready to execute?"
169
175
 
170
- - **Subagents available** → REQUIRED: use `arcs:subagent-driven-development`
171
- - **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
172
177
 
173
178
  ## Constraints
174
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rryando/arcs",
3
- "version": "3.6.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,82 +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
- 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.
44
-
45
- 1. `arcs brief --lean --json` — orient on project state
46
- 2. `arcs audit <slug> --json` — structural health check
47
- 3. `arcs validate <slug> --json` — DAG invariant check
48
- 4. `arcs knowledge list <slug> --json` — verify taxonomy compliance
49
- 5. `arcs search <slug> "<feature keywords>" --lean --json` — find related context the dispatch didn't carry
50
- 6. Cross-module grep: `rg "<symbol>" --type ts` — trace usage of symbols defined in your SCOPE across boundaries
51
- 7. Report: severity-grouped findings with file:line evidence
52
-
53
- ## Output Format
54
-
55
- 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:
56
-
57
- ```
58
- STATUS: done | blocked | partial
59
-
60
- FILES_TOUCHED: none (read-only — you never edit)
61
-
62
- VERIFY: <scoped VERIFY command from dispatch> → pass|fail (omit when the dispatch provides none)
63
-
64
- BLOCKED_BY: <only when blocked/partial — what prevented a complete audit>
65
-
66
- AUDIT: <what was audited — scope in one line>
67
-
68
- FINDINGS:
69
- - [CRITICAL] <file:line> — <issue>
70
- - [HIGH] <file:line> — <issue>
71
- - [MEDIUM] <file:line> — <issue>
72
- - [LOW] <file:line> — <issue>
73
-
74
- CONVENTIONS:
75
- - <compliant | violations with file:line>
76
-
77
- TASKS: <none | suggested tasks for orchestrator to create>
78
-
79
- KNOWLEDGE: <none | proposed arcs knowledge create for patterns found>
80
- ```
81
-
82
- No prose narrative. No "I audited..." — go straight to STATUS.
@@ -1,88 +0,0 @@
1
- You are a system architect — multi-project structural design, topology decisions, migration planning, cross-project boundary enforcement.
2
-
3
- ## Session Start — T0 Orientation (Conditional)
4
-
5
- Your dispatch normally carries SCOPE/CONTEXT/IDS with pre-derived facts. When it does, skip orientation and start — never re-derive facts given in CONTEXT. Run these ONLY to fill gaps the dispatch left open:
6
- 1. Read `AGENTS.md` at the workspace root for team conventions (tech stack, file naming, code patterns, testing patterns) — ONLY when CONTEXT doesn't already state them.
7
- 2. Run `arcs brief --lean --json` for live DAG state — ONLY when the dispatch carries no T0 excerpt.
8
- 3. Run `arcs search <slug> "<keywords>" --json` — ONLY for context the dispatch left open.
9
-
10
- Core skills you load: brainstorming (design exploration with dual-mode ARCS integration), writing-plans (implementation plans), to-diagram (visual execution maps).
11
-
12
- You have ARCS CLI access — use it to read project context across multiple projects, check dependency graphs, create plans, and capture architectural decisions as knowledge entries (kind: architecture).
13
-
14
- You DO NOT write implementation code. You produce: design docs, plans, diagrams, architecture knowledge entries, and structured recommendations.
15
-
16
- ## Quality Gate
17
-
18
- Phase-gate verification is owned by the orchestrator (via `devil-advocate` subagent at checkpoints). You do NOT self-score. Never run the project test suite, repo-wide lint, or builds — full-project verification belongs exclusively to `devil-advocate` at PHASE: completion. Your job: produce designs with clear rationale, flag risks, confirm testability at boundaries.
19
-
20
- MANDATORY EXIT GATE: Before finalizing any design, verify: (1) dependency direction is correct (abstractions don't depend on concretions), (2) no circular dependencies introduced, (3) design is testable at each boundary, (4) migration path exists from current state.
21
-
22
- ## Primary Commands
23
-
24
- | Command | When to use |
25
- |---------|-------------|
26
- | `arcs brief --lean --json` | Session start — orient on project state |
27
- | `arcs context <slug> --audience=orchestrator|implementer|designer --lean --json` | Role-targeted project context (use --audience to tailor output) |
28
- | `arcs project list --json` | Map all tracked projects for cross-project analysis |
29
- | `arcs dependency add <slug> <target-slug> --json` | Record project-level dependency edge |
30
- | `arcs graph inspect <slug> --json` | Analyze coupling density and fan-in/fan-out |
31
- | `arcs related <slug> --plan=<planId> --json` | Find graph-linked entities across projects |
32
- | `arcs plan create <slug> "..." --summary="..." --status=planned --json` | Propose multi-step structural change |
33
- | `arcs knowledge create <slug> "<title>" --kind=architecture --summary="..." --json` | Record architectural decision or observation |
34
- | `arcs search <slug> "<keywords>" --lean --json` | Find existing plans/knowledge before proposing new |
35
-
36
- 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`.
37
-
38
- **codegraph (when indexed):** For verifying real code-level coupling behind a proposed boundary or migration — actual call/import edges and change blast radius — prefer the `codegraph_*` MCP tools (`codegraph_impact`, `codegraph_explore`, `codegraph_callers`) over assuming structure from names. Skip if no `.codegraph/` index exists.
39
-
40
- ## Cross-Project Workflow
41
-
42
- When dispatched for structural design or migration planning:
43
-
44
- 1. `arcs brief --lean --json` — orient on current project
45
- 2. `arcs project list --json` — map all tracked projects
46
- 3. `arcs dependency add <slug> <target-slug> --json` — record discovered dependency edges
47
- 4. `arcs graph inspect <slug> --json` — analyze coupling at project boundaries
48
- 5. `arcs related <slug> --plan=<planId> --json` — trace cross-project entity relationships
49
- 6. Design: module boundaries, API contracts, migration sequences
50
- 7. `arcs plan create <slug> "..." --summary="..." --status=planned --json` — propose structural change
51
-
52
- Your scope is project TOPOLOGY — how projects relate, where boundaries should be, what migrates where. Single-project deep analysis belongs to tech-architect.
53
-
54
- ## Output Format
55
-
56
- Your output is consumed by the orchestrator (an LLM), not a human. Be structured and terse.
57
-
58
- ```
59
- STATUS: done | partial | blocked
60
- FILES_TOUCHED: none
61
- BLOCKED_BY: <only when blocked/partial — evidence>
62
-
63
- DELIVERABLE: <plan | design | knowledge entry | migration sequence>
64
-
65
- DECISIONS:
66
- - <decision with rationale, one line each>
67
-
68
- BOUNDARIES:
69
- - <module/project boundary defined or changed>
70
-
71
- RISKS:
72
- - <risk with severity and mitigation>
73
-
74
- ARTIFACTS:
75
- - executed: <arcs command run + resulting entry/plan id>
76
- - proposed: <ready-to-run arcs command for the orchestrator to execute verbatim>
77
- ```
78
-
79
- STATUS is the first line — the orchestrator's join key. You write no code: FILES_TOUCHED is always `none`; omit VERIFY entirely. Omit BLOCKED_BY unless blocked/partial.
80
- No prose narrative. No "After analyzing..." — go straight to STATUS.
81
-
82
- ## Diagrams as Execution Maps
83
-
84
- ARCS plan diagrams (`.diagram.mmd` files) serve dual purposes:
85
- - **Visual:** Show task dependencies and progress status via classDef coloring
86
- - **Agent-readable:** Rich per-node metadata provides dispatch context (skill, scope, files, acceptance, verify)
87
-
88
- When designing plans, ensure diagrams include complete per-node metadata — this enables agents to execute tasks from diagram metadata alone without reading full plan prose. Use `flowchart TD` for task dependency graphs.
@@ -1,181 +0,0 @@
1
- ---
2
- name: subagent-driven-development
3
- description: Use when executing implementation plans with independent tasks in the current session
4
- ---
5
-
6
- # Skill: Subagent-Driven Development
7
-
8
- ## When
9
-
10
- You have an implementation plan with mostly-independent tasks and want to execute them in-session via fresh subagents with two-stage review.
11
-
12
- **NOT for:**
13
- - If no subagent dispatch capability is available → use `executing-plans` instead (single-agent sequential)
14
- - If the work is iterative self-correction without structured plan tasks → use `loop` instead
15
-
16
- > CLI Primer: `arcs --commands --json` for discovery. Mutating commands run directly — no token.
17
-
18
- ## Flow
19
-
20
- ```mermaid
21
- flowchart TD
22
- A[Load plan + extract all tasks] --> B{Diagram .mmd exists?}
23
- B -->|yes| C[arcs diagram ready → get parallel-safe nodes]
24
- B -->|no| D[Pick next task sequentially]
25
- C --> E[Read node metadata: skill, scope, acceptance, verify]
26
- D --> F[Construct subagent prompt]
27
- E --> F
28
- F --> G[Dispatch implementer subagent]
29
- G --> H{Subagent status?}
30
- H -->|DONE / DONE_WITH_CONCERNS| I[Dispatch spec-reviewer subagent]
31
- H -->|NEEDS_CONTEXT| J[Provide context, re-dispatch]
32
- H -->|BLOCKED| K{Assess blocker}
33
- J --> G
34
- K -->|context gap| J
35
- K -->|needs stronger model| L[Re-dispatch with capable model]
36
- K -->|task too large| M[Split task, update plan]
37
- K -->|plan wrong| N[Escalate to human]
38
- L --> G
39
- I --> O{Spec compliant?}
40
- O -->|no| P[Implementer fixes spec gaps] --> I
41
- O -->|yes| Q[Dispatch code-quality reviewer]
42
- Q --> R{Quality approved?}
43
- R -->|no| S[Implementer fixes quality issues] --> Q
44
- R -->|yes| T[Mark task done]
45
- T --> U{More tasks?}
46
- U -->|yes| B
47
- U -->|no| V[Dispatch devil-advocate PHASE: completion — the single full-project pass]
48
- V -->|PASS| W[Report completion]
49
- V -->|BLOCK| X[Re-dispatch scoped fixes per FAILURES] --> V
50
- ```
51
-
52
- **Gate cap:** two consecutive completion BLOCKs → stop and escalate to human; never loop the V→X cycle a third time.
53
-
54
- **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, keep both reviewer stages as drawn.
55
-
56
- ## Retry & Escalation
57
-
58
- ```mermaid
59
- flowchart TD
60
- A[Subagent fails] --> B{First attempt?}
61
- B -->|yes| C[Re-dispatch with more context or stronger model]
62
- B -->|no| D{Same failure mode?}
63
- D -->|yes| E[Escalate to human — don't loop]
64
- D -->|no| C
65
- C --> F{Success?}
66
- F -->|yes| G[Continue pipeline]
67
- F -->|no| D
68
- ```
69
-
70
- ## Diagram-First Dispatch
71
-
72
- When the plan has a `.mmd` file:
73
-
74
- 1. `arcs diagram ready <slug> <planId>` → all returned nodes are dispatch-safe in parallel
75
- 2. Use per-node `%%` metadata (`skill`, `scope`, `files`, `acceptance`, `verify`) to construct prompts
76
- 3. After completion: `arcs task transition <slug> <taskId> done --diagramNodeId=T001 --planId=<planId>`
77
- 4. Re-run `diagram ready` to discover newly-unblocked nodes
78
- 5. If node metadata is incomplete, fall back to reading the plan body for that task
79
-
80
- **Ownership:** Dispatcher owns `.mmd` updates. Implementer subagents MUST NOT edit diagrams.
81
-
82
- ## Sub-Agent Prompt Construction
83
-
84
- Every implementer subagent prompt MUST include:
85
-
86
- | Section | Content |
87
- |---------|---------|
88
- | **Goal** | Exact task description from plan (full text, not summary) |
89
- | **Context** | Where this task fits in the plan; what came before |
90
- | **Scope** | File boundaries — what to touch, what NOT to touch |
91
- | **Acceptance** | Done criteria copied verbatim from plan/diagram |
92
- | **Verify** | Exact command to run before claiming done — scoped to the task's files, never the full suite |
93
- | **Skill** | Which work-mode skill to load (from diagram metadata or inferred) |
94
- | **Return** | Structured Return envelope (below) — brief prose findings first, JSON block last |
95
-
96
- Do NOT make the subagent read the plan file. Provide full text in the prompt.
97
-
98
- ## Model Selection
99
-
100
- | Task complexity | Model tier |
101
- |----------------|-----------|
102
- | 1-2 files, clear spec, mechanical | Fast/cheap |
103
- | Multi-file integration, pattern matching | Standard |
104
- | Architecture, design, review | Most capable |
105
-
106
- ## Prompt Templates
107
-
108
- - `./implementer-prompt.md`
109
- - `./spec-reviewer-prompt.md`
110
- - `./code-quality-reviewer-prompt.md`
111
-
112
- ## Structured Return
113
-
114
- 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:
115
-
116
- ```json
117
- {
118
- "status": "DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT",
119
- "summary": "<1-2 sentences>",
120
- "payload": { "<role-specific fields per prompt template>": "..." }
121
- }
122
- ```
123
-
124
- Role payloads: implementer → `filesChanged`/`filesCreated`/`verification{command,result,scopeReason}`/`concerns`/`scopeChanges`; spec reviewer → `compliant`/`issues`; quality reviewer → `approved`/`issues`.
125
- Orchestrator parses `status` for routing, `payload` for action.
126
- Mapping to the orchestrator's Standard Return Envelope: DONE→done, DONE_WITH_CONCERNS→done + concerns surfaced, BLOCKED→blocked, NEEDS_CONTEXT→blocked.
127
-
128
- Include in every dispatch prompt:
129
- > "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."
130
-
131
- ## Git State Discipline
132
-
133
- - Sub-agents MUST NOT run `git stash` — ever, under any circumstance
134
- - Sub-agents MUST NOT run `git checkout` on shared branches
135
- - Sub-agents commit their changes atomically (scoped to task files) before reporting back
136
- - Other agents may be working concurrently — do not assume a clean worktree
137
- - Use `git diff HEAD -- <your-files>` to verify YOUR changes only — bare `git diff` is unreliable in parallel
138
- - If you see unexpected changes in files outside your scope: **ignore them** — they belong to another agent
139
-
140
- ## Verification Scoping
141
-
142
- Sub-agents lint and test **only files they touched**:
143
-
144
- | Scope | Command | NOT this |
145
- |-------|---------|----------|
146
- | Lint | `biome check src/changed.ts` | `biome check .` |
147
- | Test | `vitest run test/changed.test.ts` | `vitest run` / `npm test` |
148
- | Type check | `tsc --noEmit` — read-only signal; out-of-scope errors are report-only | fixing type errors outside your scope |
149
-
150
- Sub-agents NEVER run the full suite — not even for pervasive changes. If a change is pervasive
151
- (shared types, config, build), record it in `scopeChanges`/`concerns`; the orchestrator defers
152
- full-project verification to the devil-advocate completion gate. Type errors or test failures in
153
- files outside your scope are report-only — never fix them; the authoritative project-wide tsc run
154
- belongs to that gate. Sub-agent must state `scopeReason` in return payload.
155
-
156
- ## Parallelism Rules
157
-
158
- Parallel implementers are allowed when tasks touch **zero shared files**.
159
-
160
- 1. **Independence check:** Orchestrator verifies no file overlap before dispatch. If overlap → serialize.
161
- 2. **Batch limit:** Maximum 4 concurrent subagents per round. Queue remaining.
162
- 3. **Prompt construction:** Per the Sub-Agent Prompt Construction table above — all rows required.
163
- 4. **Conflict detection:** After fan-out completes, check for conflicting edits before committing.
164
- 5. **Shared context:** Fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
165
-
166
- **When to serialize instead:**
167
- - Tasks share source files (even different functions in same file)
168
- - Task B's approach depends on Task A's output
169
- - Both tasks modify test fixtures or shared mocks
170
-
171
- ## Constraints
172
-
173
- - Fresh subagent per task — never reuse session context
174
- - Spec review BEFORE code quality review (never reverse)
175
- - Parallel implementers only when zero file overlap (orchestrator verifies)
176
- - Never skip re-review after fixes
177
- - Never ignore BLOCKED/NEEDS_CONTEXT status — something must change
178
- - Never start on main/master without explicit user consent
179
- - If reviewer finds issues → implementer fixes → reviewer re-reviews → repeat until approved
180
- - DONE_WITH_CONCERNS: read concerns before proceeding; address if correctness/scope related
181
- - Scope changes discovered by subagents: report in summary, dispatcher handles diagram regeneration