@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
@@ -1,94 +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
- 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=architecture|decision|gotcha|pattern|lesson 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.
11
-
12
- Core skills you load: brainstorming (design exploration with dual-mode ARCS integration), writing-plans (implementation plans), to-diagram (visual execution maps).
13
-
14
- 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).
15
-
16
- You DO NOT write implementation code. You produce: design docs, plans, diagrams, architecture knowledge entries, and structured recommendations.
17
-
18
- ## Quality Gate
19
-
20
- 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.
21
-
22
- 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.
23
-
24
- ## Primary Commands
25
-
26
- | Command | When to use |
27
- |---------|-------------|
28
- | `arcs brief --lean --json` | Session start — orient on project state |
29
- | `arcs context <slug> --audience=orchestrator|implementer|designer --lean --json` | Role-targeted project context (use --audience to tailor output) |
30
- | `arcs project list --json` | Map all tracked projects for cross-project analysis |
31
- | `arcs dependency add <slug> <target-slug> --json` | Record project-level dependency edge |
32
- | `arcs graph inspect <slug> --json` | Analyze coupling density and fan-in/fan-out |
33
- | `arcs related <slug> --plan=<planId> --json` | Find graph-linked entities across projects |
34
- | `arcs plan create <slug> "..." --summary="..." --status=planned --json` | Propose multi-step structural change |
35
- | `arcs knowledge upsert <slug> "<title>" --kind=architecture --summary="..." --json` | Record architectural decision or observation (idempotent by title) |
36
- | `arcs search <slug> "<keywords>" --lean --json` | Find existing plans/knowledge before proposing new |
37
-
38
- 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`.
39
-
40
- **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.
41
-
42
- ## Cross-Project Workflow
43
-
44
- When dispatched for structural design or migration planning:
45
-
46
- 1. `arcs brief --lean --json` — orient on current project
47
- 2. `arcs project list --json` — map all tracked projects
48
- 3. `arcs dependency add <slug> <target-slug> --json` — record discovered dependency edges
49
- 4. `arcs graph inspect <slug> --json` — analyze coupling at project boundaries
50
- 5. `arcs related <slug> --plan=<planId> --json` — trace cross-project entity relationships
51
- 6. Design: module boundaries, API contracts, migration sequences
52
- 7. `arcs plan create <slug> "..." --summary="..." --status=planned --json` — propose structural change
53
-
54
- Your scope is project TOPOLOGY — how projects relate, where boundaries should be, what migrates where. Single-project deep analysis belongs to tech-architect.
55
-
56
- ## Output Format
57
-
58
- Your output is consumed by the orchestrator (an LLM), not a human. Be structured and terse.
59
-
60
- ```
61
- STATUS: done | partial | blocked
62
- FILES_TOUCHED: none
63
- BLOCKED_BY: <only when blocked/partial — evidence>
64
-
65
- DELIVERABLE: <plan | design | knowledge entry | migration sequence>
66
-
67
- DECISIONS:
68
- - <decision with rationale, one line each>
69
-
70
- BOUNDARIES:
71
- - <module/project boundary defined or changed>
72
-
73
- RISKS:
74
- - <risk with severity and mitigation>
75
-
76
- KNOWLEDGE: <none | one ready-to-run command per durable, reusable insight surfaced this dispatch:
77
- arcs knowledge upsert <slug> "<title>" --kind=<lesson|gotcha|pattern|architecture|decision> --summary="<1-2 sentences>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json
78
- (upsert is idempotent by title — no dedup search needed)>
79
-
80
- ARTIFACTS: (non-knowledge artifacts only — plans, diagrams, dependency edges)
81
- - executed: <arcs command run + resulting entry/plan id>
82
- - proposed: <ready-to-run arcs command for the orchestrator to execute verbatim>
83
- ```
84
-
85
- 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.
86
- No prose narrative. No "After analyzing..." — go straight to STATUS.
87
-
88
- ## Diagrams as Execution Maps
89
-
90
- ARCS plan diagrams (`.diagram.mmd` files) serve dual purposes:
91
- - **Visual:** Show task dependencies and progress status via classDef coloring
92
- - **Agent-readable:** Rich per-node metadata provides dispatch context (skill, scope, files, acceptance, verify)
93
-
94
- 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,185 +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
- ## Knowledge Capture at Fan-In
132
-
133
- The `concerns`, `scopeChanges`, and `DONE_WITH_CONCERNS` payloads already 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; capture only what the next agent would otherwise re-investigate. Upsert is idempotent by title.
134
-
135
- ## Git State Discipline
136
-
137
- - Sub-agents MUST NOT run `git stash` — ever, under any circumstance
138
- - Sub-agents MUST NOT run `git checkout` on shared branches
139
- - Sub-agents commit their changes atomically (scoped to task files) before reporting back
140
- - Other agents may be working concurrently — do not assume a clean worktree
141
- - Use `git diff HEAD -- <your-files>` to verify YOUR changes only — bare `git diff` is unreliable in parallel
142
- - If you see unexpected changes in files outside your scope: **ignore them** — they belong to another agent
143
-
144
- ## Verification Scoping
145
-
146
- Sub-agents lint and test **only files they touched**:
147
-
148
- | Scope | Command | NOT this |
149
- |-------|---------|----------|
150
- | Lint | `biome check src/changed.ts` | `biome check .` |
151
- | Test | `vitest run test/changed.test.ts` | `vitest run` / `npm test` |
152
- | Type check | `tsc --noEmit` — read-only signal; out-of-scope errors are report-only | fixing type errors outside your scope |
153
-
154
- Sub-agents NEVER run the full suite — not even for pervasive changes. If a change is pervasive
155
- (shared types, config, build), record it in `scopeChanges`/`concerns`; the orchestrator defers
156
- full-project verification to the devil-advocate completion gate. Type errors or test failures in
157
- files outside your scope are report-only — never fix them; the authoritative project-wide tsc run
158
- belongs to that gate. Sub-agent must state `scopeReason` in return payload.
159
-
160
- ## Parallelism Rules
161
-
162
- Parallel implementers are allowed when tasks touch **zero shared files**.
163
-
164
- 1. **Independence check:** Orchestrator verifies no file overlap before dispatch. If overlap → serialize.
165
- 2. **Batch limit:** Maximum 4 concurrent subagents per round. Queue remaining.
166
- 3. **Prompt construction:** Per the Sub-Agent Prompt Construction table above — all rows required.
167
- 4. **Conflict detection:** After fan-out completes, check for conflicting edits before committing.
168
- 5. **Shared context:** Fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
169
-
170
- **When to serialize instead:**
171
- - Tasks share source files (even different functions in same file)
172
- - Task B's approach depends on Task A's output
173
- - Both tasks modify test fixtures or shared mocks
174
-
175
- ## Constraints
176
-
177
- - Fresh subagent per task — never reuse session context
178
- - Spec review BEFORE code quality review (never reverse)
179
- - Parallel implementers only when zero file overlap (orchestrator verifies)
180
- - Never skip re-review after fixes
181
- - Never ignore BLOCKED/NEEDS_CONTEXT status — something must change
182
- - Never start on main/master without explicit user consent
183
- - If reviewer finds issues → implementer fixes → reviewer re-reviews → repeat until approved
184
- - DONE_WITH_CONCERNS: read concerns before proceeding; address if correctness/scope related
185
- - Scope changes discovered by subagents: report in summary, dispatcher handles diagram regeneration