@rryando/arcs 3.4.0 → 3.4.2
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.
- package/README.md +12 -11
- package/dist/cli/arcs-orchestrate-caveman.d.ts +1 -1
- package/dist/cli/arcs-orchestrate-caveman.d.ts.map +1 -1
- package/dist/cli/arcs-orchestrate-caveman.js +4 -5
- package/dist/cli/arcs-orchestrate-caveman.js.map +1 -1
- package/dist/cli/arcs-orchestrate.d.ts +1 -1
- package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
- package/dist/cli/arcs-orchestrate.js +91 -101
- package/dist/cli/arcs-orchestrate.js.map +1 -1
- package/dist/cli/instructions.d.ts.map +1 -1
- package/dist/cli/instructions.js +2 -0
- package/dist/cli/instructions.js.map +1 -1
- package/dist/cli/setup.d.ts +9 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +138 -0
- package/dist/cli/setup.js.map +1 -1
- package/dist/utils/rtk.d.ts +7 -0
- package/dist/utils/rtk.d.ts.map +1 -0
- package/dist/utils/rtk.js +26 -0
- package/dist/utils/rtk.js.map +1 -0
- package/opencode/arcs/.opencode/plugins/arcs.js +1 -40
- package/opencode/arcs/manifest.json +67 -7
- package/opencode/arcs/prompts/arcs-docs.txt +34 -33
- package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +95 -106
- package/opencode/arcs/prompts/arcs-orchestrate.txt +91 -101
- package/opencode/arcs/prompts/code-reviewer.txt +27 -20
- package/opencode/arcs/prompts/devil-advocate.txt +16 -6
- package/opencode/arcs/prompts/docs-researcher.txt +17 -14
- package/opencode/arcs/prompts/graph-explorer.txt +17 -14
- package/opencode/arcs/prompts/oncall-ops.txt +26 -19
- package/opencode/arcs/prompts/qa-analyst.txt +26 -20
- package/opencode/arcs/prompts/software-engineer.txt +18 -19
- package/opencode/arcs/prompts/system-architect.txt +18 -13
- package/opencode/arcs/prompts/tech-architect.txt +18 -13
- package/opencode/arcs/skills/code-agent/SKILL.md +2 -2
- package/opencode/arcs/skills/deep-pr-review/SKILL.md +7 -7
- package/opencode/arcs/skills/deep-pr-review/review-template.md +2 -2
- package/opencode/arcs/skills/executing-plans/SKILL.md +12 -8
- package/opencode/arcs/skills/init-project/SKILL.md +1 -1
- package/opencode/arcs/skills/quick-dev/SKILL.md +3 -3
- package/opencode/arcs/skills/requesting-code-review/SKILL.md +11 -7
- package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +36 -76
- package/opencode/arcs/skills/subagent-driven-development/SKILL.md +30 -11
- package/opencode/arcs/skills/subagent-driven-development/code-quality-reviewer-prompt.md +3 -2
- package/opencode/arcs/skills/subagent-driven-development/implementer-prompt.md +13 -13
- package/opencode/arcs/skills/subagent-driven-development/spec-reviewer-prompt.md +1 -1
- package/opencode/arcs/skills/systematic-debugging/SKILL.md +3 -3
- package/opencode/arcs/skills/systematic-debugging/root-cause-tracing.md +2 -2
- package/opencode/arcs/skills/test-driven-development/SKILL.md +4 -4
- package/opencode/arcs/skills/test-driven-development/tdd-rationalizations-and-examples.md +2 -2
- package/opencode/arcs/skills/to-diagram/SKILL.md +3 -1
- package/opencode/arcs/skills/writing-plans/SKILL.md +3 -1
- package/package.json +1 -1
- package/scripts/arcs-init.mjs +3 -2
- package/scripts/deploy-claudecode-bundle.mjs +42 -15
- package/scripts/deploy-opencode-bundle.mjs +5 -1
- package/scripts/lib/bundle-helpers.mjs +27 -1
- package/scripts/lint-bundle.mjs +0 -1
- package/skills/init-project.md +1 -1
- package/skills/orchestrate.md +10 -3
|
@@ -17,7 +17,7 @@ flowchart TD
|
|
|
17
17
|
K --> B{Fully bounded?}
|
|
18
18
|
B -->|Yes| C[Execute change directly]
|
|
19
19
|
B -->|No| D[Escalate to code-agent or brainstorming]
|
|
20
|
-
C --> E[Verify:
|
|
20
|
+
C --> E[Verify scoped: tsc --noEmit + lint + tests for touched files]
|
|
21
21
|
E --> F[Done — commit only when asked]
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -33,13 +33,13 @@ Check for patterns, gotchas, and lessons before implementing. Skip only if the c
|
|
|
33
33
|
|
|
34
34
|
1. Orient with ARCS context + search if pattern-related
|
|
35
35
|
2. Execute directly — no planning doc, no brainstorming, no TDD ritual
|
|
36
|
-
3.
|
|
36
|
+
3. Scoped verification only — run the dispatch VERIFY command (tests + lint for files you touched). NEVER the full suite. Pervasive change (shared types, config, build) or failures in out-of-scope files → report under BLOCKED_BY, never fix; full-project verification belongs to the devil-advocate completion gate.
|
|
37
37
|
|
|
38
38
|
## Escalation
|
|
39
39
|
|
|
40
40
|
If hidden complexity surfaces mid-task — **pause immediately**, state the issue, offer to switch to `code-agent` or `brainstorming`. Do not silently expand scope.
|
|
41
41
|
|
|
42
|
-
If self-confidence drops below 80%
|
|
42
|
+
If self-confidence drops below 80% (open decision, unverified assumption, sibling pattern unclear), escalate to `code-agent` — `quick-dev` does not permit exploration loops; `code-agent` does.
|
|
43
43
|
|
|
44
44
|
## NOT for
|
|
45
45
|
|
|
@@ -18,9 +18,9 @@ flowchart TD
|
|
|
18
18
|
C --> D[Fill code-reviewer.md template]
|
|
19
19
|
D --> E[Dispatch arcs:code-reviewer subagent]
|
|
20
20
|
E --> F{Review results}
|
|
21
|
-
F -->|
|
|
22
|
-
F -->|
|
|
23
|
-
F -->|
|
|
21
|
+
F -->|CRITICAL| G[Fix immediately]
|
|
22
|
+
F -->|HIGH| H[Fix before proceeding]
|
|
23
|
+
F -->|MEDIUM/LOW| I[Note for later]
|
|
24
24
|
G --> E
|
|
25
25
|
H --> E
|
|
26
26
|
```
|
|
@@ -30,18 +30,22 @@ flowchart TD
|
|
|
30
30
|
- `{WHAT_WAS_IMPLEMENTED}` — what you built
|
|
31
31
|
- `{PLAN_OR_REQUIREMENTS}` — what it should do
|
|
32
32
|
- `{BASE_SHA}` / `{HEAD_SHA}` — commit range
|
|
33
|
-
- `{PROJECT_CONVENTIONS}` — CLAUDE.md / linter configs / style guides
|
|
33
|
+
- `{PROJECT_CONVENTIONS}` — CLAUDE.md / linter configs / style guides (gather once per session, reuse across dispatches)
|
|
34
34
|
|
|
35
35
|
## When to Request
|
|
36
36
|
|
|
37
|
-
**Mandatory:** after
|
|
37
|
+
**Mandatory:** after major features, before merge to main.
|
|
38
|
+
**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.
|
|
38
39
|
**Optional:** when stuck, before refactoring, after complex bugfix.
|
|
39
40
|
|
|
40
41
|
## Red Flags
|
|
41
42
|
|
|
42
43
|
- Never skip because "it's simple"
|
|
43
|
-
- Never ignore
|
|
44
|
-
- Never proceed with unfixed
|
|
44
|
+
- Never ignore CRITICAL findings
|
|
45
|
+
- Never proceed with unfixed HIGH findings
|
|
45
46
|
- Always include project conventions in reviewer context
|
|
47
|
+
- CRITICAL/HIGH fixes route to the owning implementer — never fix files outside your own scope
|
|
46
48
|
|
|
47
49
|
See template at: `requesting-code-review/code-reviewer.md`
|
|
50
|
+
|
|
51
|
+
Reviewer returns the unified envelope: STATUS → VERDICT (approve | request-changes | comment-only) → FINDINGS by severity (CRITICAL/HIGH/MEDIUM/LOW) with 📍 file:line anchors.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Code Review Agent
|
|
2
2
|
|
|
3
|
-
You are reviewing code changes for production readiness.
|
|
3
|
+
You are reviewing code changes for production readiness. Your output is consumed by the orchestrator (an LLM) — structured, terse, evidence-backed findings.
|
|
4
4
|
|
|
5
5
|
**Your task:**
|
|
6
6
|
1. Read the project conventions below **before judging anything**
|
|
7
7
|
2. Review {WHAT_WAS_IMPLEMENTED}
|
|
8
8
|
3. Compare against {PLAN_OR_REQUIREMENTS}
|
|
9
9
|
4. Check code quality, architecture, testing
|
|
10
|
-
5. Categorize
|
|
11
|
-
6.
|
|
10
|
+
5. Categorize findings by severity with 📍 file:line anchors
|
|
11
|
+
6. Deliver VERDICT: approve | request-changes | comment-only
|
|
12
12
|
|
|
13
13
|
## Project Conventions
|
|
14
14
|
|
|
@@ -57,7 +57,7 @@ git diff {BASE_SHA}..{HEAD_SHA}
|
|
|
57
57
|
- Tests actually test logic (not mocks)?
|
|
58
58
|
- Edge cases covered?
|
|
59
59
|
- Integration tests where needed?
|
|
60
|
-
-
|
|
60
|
+
- Scoped verification passing — the dispatch VERIFY command only? Do NOT run the full suite — the completion gate owns it.
|
|
61
61
|
|
|
62
62
|
**Requirements:**
|
|
63
63
|
- All plan requirements met?
|
|
@@ -73,107 +73,67 @@ git diff {BASE_SHA}..{HEAD_SHA}
|
|
|
73
73
|
|
|
74
74
|
## Output Format
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
[What's well done? Be specific. Sound like a colleague giving genuine praise, not a form response.]
|
|
76
|
+
No prose narrative. No "Overall this looks..." — open with the Standard Return Envelope, then VERDICT, then FINDINGS grouped by severity.
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
When dispatched via subagent-driven-development, return its JSON envelope instead (see code-quality-reviewer-prompt.md).
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
#### Critical (Must Fix)
|
|
84
|
-
[Bugs, security issues, data loss risks, broken functionality]
|
|
85
|
-
|
|
86
|
-
#### Important (Should Fix)
|
|
87
|
-
[Architecture problems, missing features, poor error handling, test gaps]
|
|
80
|
+
```
|
|
81
|
+
STATUS: done | blocked | partial
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
[Code style, optimization opportunities, documentation improvements]
|
|
83
|
+
FILES_TOUCHED: none (review-only — you never edit)
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
📍 path/to/file.ts:42
|
|
95
|
-
Change: [what changed — show old → new if helpful]
|
|
96
|
-
Finding: [what looks off]
|
|
97
|
-
Why it matters: [practical impact]
|
|
98
|
-
Suggested direction: [concrete fix or question]
|
|
99
|
-
```
|
|
85
|
+
VERIFY: <scoped VERIFY command from dispatch> → pass|fail (omit when the dispatch provides none)
|
|
100
86
|
|
|
101
|
-
|
|
102
|
-
- "Heads up — this can throw if X is null (line 42), since you removed the guard"
|
|
103
|
-
- "Worth double-checking: the fallback here (line 88) looks unreachable given the condition above"
|
|
104
|
-
- "Minor nit: this magic number (line 130) could be a named constant for readability"
|
|
87
|
+
BLOCKED_BY: <only when blocked/partial — what prevented a complete review>
|
|
105
88
|
|
|
106
|
-
|
|
107
|
-
- "VIOLATION: null check missing"
|
|
108
|
-
- "This is wrong"
|
|
89
|
+
VERDICT: approve | request-changes | comment-only
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
[
|
|
91
|
+
FINDINGS:
|
|
92
|
+
- [CRITICAL] 📍 <file:line> — <issue> — <why it matters> — <suggested fix>
|
|
93
|
+
- [HIGH] 📍 <file:line> — <issue> — <why it matters> — <suggested fix>
|
|
94
|
+
- [MEDIUM] 📍 <file:line> — <issue> — <suggested fix>
|
|
95
|
+
- [LOW] 📍 <file:line> — <issue>
|
|
112
96
|
|
|
113
|
-
|
|
97
|
+
TASKS: <none | suggested follow-up tasks for orchestrator>
|
|
114
98
|
|
|
115
|
-
|
|
99
|
+
YAGNI: <none | speculative code identified with file:line>
|
|
100
|
+
```
|
|
116
101
|
|
|
117
|
-
**
|
|
102
|
+
Every finding carries a **📍 file:line anchor** pointing to the specific diff line. Severity guide: CRITICAL (bugs, security, data loss, broken functionality) → HIGH (architecture problems, missing features, poor error handling, test gaps) → MEDIUM (convention deviations) → LOW (style, optimization opportunities, documentation).
|
|
118
103
|
|
|
119
104
|
## Critical Rules
|
|
120
105
|
|
|
121
106
|
**DO:**
|
|
122
107
|
- Read project conventions before evaluating style or patterns
|
|
123
|
-
- Categorize by actual severity (not everything is
|
|
124
|
-
- Be specific with file:line anchors
|
|
108
|
+
- Categorize by actual severity (not everything is CRITICAL)
|
|
109
|
+
- Be specific with 📍 file:line anchors
|
|
125
110
|
- Explain WHY issues matter
|
|
126
|
-
-
|
|
127
|
-
- Give clear verdict
|
|
128
|
-
- Sound like a teammate, not a linter
|
|
111
|
+
- Give a clear VERDICT
|
|
129
112
|
|
|
130
113
|
**DON'T:**
|
|
131
114
|
- Flag something as wrong if it matches the project's own conventions
|
|
132
115
|
- Say "looks good" without checking
|
|
133
|
-
- Mark nitpicks as
|
|
116
|
+
- Mark nitpicks as CRITICAL
|
|
134
117
|
- Give feedback on code you didn't review
|
|
135
118
|
- Be vague ("improve error handling")
|
|
136
|
-
-
|
|
137
|
-
-
|
|
119
|
+
- Omit the VERDICT
|
|
120
|
+
- Wrap the envelope in prose narrative
|
|
138
121
|
|
|
139
122
|
## Example Output
|
|
140
123
|
|
|
141
124
|
```
|
|
142
|
-
|
|
143
|
-
- Clean database schema with proper migrations (db.ts:15-42) — easy to follow
|
|
144
|
-
- Comprehensive test coverage (18 tests, all edge cases hit)
|
|
145
|
-
- Good error handling with fallbacks (summarizer.ts:85-92)
|
|
146
|
-
|
|
147
|
-
### Issues
|
|
148
|
-
|
|
149
|
-
#### Important
|
|
150
|
-
|
|
151
|
-
1. 📍 index-conversations:1-31
|
|
152
|
-
Change: Added CLI wrapper without help flag
|
|
153
|
-
Finding: No --help flag; users won't discover --concurrency
|
|
154
|
-
Why it matters: Discoverability — first-time users will hit a wall
|
|
155
|
-
Suggested direction: Add `--help` case with a short usage example
|
|
156
|
-
|
|
157
|
-
2. 📍 search.ts:25-27
|
|
158
|
-
Change: Added date filtering without validation
|
|
159
|
-
Finding: Invalid dates silently return no results instead of erroring
|
|
160
|
-
Why it matters: Silent failures are hard to debug
|
|
161
|
-
Suggested direction: Validate ISO format and throw with an example date
|
|
162
|
-
|
|
163
|
-
#### Minor
|
|
125
|
+
STATUS: done
|
|
164
126
|
|
|
165
|
-
|
|
166
|
-
Change: Added batch loop with no progress output
|
|
167
|
-
Finding: Long operations give no feedback
|
|
168
|
-
Suggested direction: A simple "X of Y" counter would help
|
|
127
|
+
FILES_TOUCHED: none
|
|
169
128
|
|
|
170
|
-
|
|
171
|
-
- Consider a config file for excluded projects — hardcoded list will grow
|
|
172
|
-
- Progress reporting would meaningfully improve UX for large repos
|
|
129
|
+
VERDICT: request-changes
|
|
173
130
|
|
|
174
|
-
|
|
131
|
+
FINDINGS:
|
|
132
|
+
- [HIGH] 📍 index-conversations:1-31 — no --help flag; users won't discover --concurrency — first-time users hit a discoverability wall — add a `--help` case with a short usage example
|
|
133
|
+
- [HIGH] 📍 search.ts:25-27 — invalid dates silently return no results instead of erroring — silent failures are hard to debug — validate ISO format and throw with an example date
|
|
134
|
+
- [LOW] 📍 indexer.ts:130 — batch loop gives no progress feedback on long runs — a simple "X of Y" counter would help
|
|
175
135
|
|
|
176
|
-
|
|
136
|
+
TASKS: config file for excluded projects — hardcoded list will grow
|
|
177
137
|
|
|
178
|
-
|
|
138
|
+
YAGNI: none
|
|
179
139
|
```
|
|
@@ -44,10 +44,15 @@ flowchart TD
|
|
|
44
44
|
R -->|yes| T[Mark task done]
|
|
45
45
|
T --> U{More tasks?}
|
|
46
46
|
U -->|yes| B
|
|
47
|
-
U -->|no| V[Dispatch
|
|
48
|
-
V
|
|
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
|
|
49
50
|
```
|
|
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
|
+
|
|
51
56
|
## Retry & Escalation
|
|
52
57
|
|
|
53
58
|
```mermaid
|
|
@@ -84,8 +89,9 @@ Every implementer subagent prompt MUST include:
|
|
|
84
89
|
| **Context** | Where this task fits in the plan; what came before |
|
|
85
90
|
| **Scope** | File boundaries — what to touch, what NOT to touch |
|
|
86
91
|
| **Acceptance** | Done criteria copied verbatim from plan/diagram |
|
|
87
|
-
| **Verify** | Exact command to run before claiming done |
|
|
92
|
+
| **Verify** | Exact command to run before claiming done — scoped to the task's files, never the full suite |
|
|
88
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 |
|
|
89
95
|
|
|
90
96
|
Do NOT make the subagent read the plan file. Provide full text in the prompt.
|
|
91
97
|
|
|
@@ -102,15 +108,25 @@ Do NOT make the subagent read the plan file. Provide full text in the prompt.
|
|
|
102
108
|
- `./implementer-prompt.md`
|
|
103
109
|
- `./spec-reviewer-prompt.md`
|
|
104
110
|
- `./code-quality-reviewer-prompt.md`
|
|
105
|
-
- `./return-schema.md` — structured output format (inject into every dispatch)
|
|
106
111
|
|
|
107
112
|
## Structured Return
|
|
108
113
|
|
|
109
|
-
All sub-agents MUST return a JSON block as the
|
|
110
|
-
|
|
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.
|
|
111
127
|
|
|
112
128
|
Include in every dispatch prompt:
|
|
113
|
-
> "Return format: JSON envelope
|
|
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."
|
|
114
130
|
|
|
115
131
|
## Git State Discipline
|
|
116
132
|
|
|
@@ -129,10 +145,13 @@ Sub-agents lint and test **only files they touched**:
|
|
|
129
145
|
|-------|---------|----------|
|
|
130
146
|
| Lint | `biome check src/changed.ts` | `biome check .` |
|
|
131
147
|
| Test | `vitest run test/changed.test.ts` | `vitest run` / `npm test` |
|
|
132
|
-
| Type check | `tsc --noEmit`
|
|
148
|
+
| Type check | `tsc --noEmit` — read-only signal; out-of-scope errors are report-only | fixing type errors outside your scope |
|
|
133
149
|
|
|
134
|
-
|
|
135
|
-
|
|
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.
|
|
136
155
|
|
|
137
156
|
## Parallelism Rules
|
|
138
157
|
|
|
@@ -140,7 +159,7 @@ Parallel implementers are allowed when tasks touch **zero shared files**.
|
|
|
140
159
|
|
|
141
160
|
1. **Independence check:** Orchestrator verifies no file overlap before dispatch. If overlap → serialize.
|
|
142
161
|
2. **Batch limit:** Maximum 4 concurrent subagents per round. Queue remaining.
|
|
143
|
-
3. **Prompt construction:**
|
|
162
|
+
3. **Prompt construction:** Per the Sub-Agent Prompt Construction table above — all rows required.
|
|
144
163
|
4. **Conflict detection:** After fan-out completes, check for conflicting edits before committing.
|
|
145
164
|
5. **Shared context:** Fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
|
|
146
165
|
|
|
@@ -8,7 +8,8 @@ Use this template when dispatching a code quality reviewer subagent.
|
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
Task tool (arcs:code-reviewer):
|
|
11
|
-
|
|
11
|
+
Apply the review dimensions/checklist from requesting-code-review/code-reviewer.md.
|
|
12
|
+
Output format: the JSON envelope defined below — NOT the template's envelope+VERDICT format.
|
|
12
13
|
|
|
13
14
|
WHAT_WAS_IMPLEMENTED: [from implementer's report]
|
|
14
15
|
PLAN_OR_REQUIREMENTS: Task N from [plan-file]
|
|
@@ -25,7 +26,7 @@ Task tool (arcs:code-reviewer):
|
|
|
25
26
|
|
|
26
27
|
## Report Format (MANDATORY)
|
|
27
28
|
|
|
28
|
-
Return prose
|
|
29
|
+
Return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
|
|
29
30
|
|
|
30
31
|
```json
|
|
31
32
|
{
|
|
@@ -18,13 +18,9 @@ Task tool (general-purpose):
|
|
|
18
18
|
|
|
19
19
|
## Before You Begin
|
|
20
20
|
|
|
21
|
-
If
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Dependencies or assumptions
|
|
25
|
-
- Anything unclear in the task description
|
|
26
|
-
|
|
27
|
-
**Ask them now.** Raise any concerns before starting work.
|
|
21
|
+
If the requirements, acceptance criteria, approach, dependencies, or anything in the
|
|
22
|
+
task description is unclear or insufficient: do NO work — immediately return status
|
|
23
|
+
NEEDS_CONTEXT listing the specific questions.
|
|
28
24
|
|
|
29
25
|
## Your Job
|
|
30
26
|
|
|
@@ -38,8 +34,8 @@ Task tool (general-purpose):
|
|
|
38
34
|
|
|
39
35
|
Work from: [directory]
|
|
40
36
|
|
|
41
|
-
**While you work:** If you encounter something unexpected or unclear,
|
|
42
|
-
|
|
37
|
+
**While you work:** If you encounter something unexpected or unclear, don't guess or
|
|
38
|
+
make assumptions — stop and return BLOCKED or NEEDS_CONTEXT with the specific question.
|
|
43
39
|
|
|
44
40
|
## Git Rules
|
|
45
41
|
|
|
@@ -55,10 +51,14 @@ Task tool (general-purpose):
|
|
|
55
51
|
Lint and test ONLY the files you touched:
|
|
56
52
|
- Lint: `biome check src/your-file.ts` (NOT `biome check .`)
|
|
57
53
|
- Test: `vitest run test/your-file.test.ts` (NOT `vitest run` or `npm test`)
|
|
58
|
-
- Type check: `tsc --noEmit`
|
|
54
|
+
- Type check: `tsc --noEmit` is allowed as a read-only signal — if it reports errors
|
|
55
|
+
in files OUTSIDE your scope, do NOT fix them; record them under `concerns` and
|
|
56
|
+
proceed. The authoritative project-wide tsc run belongs to the devil-advocate gate.
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
NEVER run the full suite — not even for pervasive changes. If your change is pervasive
|
|
59
|
+
(shared types, config, build), record it in `scopeChanges`. Failures you observe in
|
|
60
|
+
files outside your scope are report-only — leave them untouched.
|
|
61
|
+
You MUST state why your verification scope is sufficient in your report (`scopeReason`).
|
|
62
62
|
|
|
63
63
|
## Code Organization
|
|
64
64
|
|
|
@@ -118,7 +118,7 @@ Task tool (general-purpose):
|
|
|
118
118
|
|
|
119
119
|
## Report Format (MANDATORY)
|
|
120
120
|
|
|
121
|
-
When done, return prose
|
|
121
|
+
When done, return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
|
|
122
122
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
|
@@ -57,7 +57,7 @@ Task tool (general-purpose):
|
|
|
57
57
|
|
|
58
58
|
## Report Format (MANDATORY)
|
|
59
59
|
|
|
60
|
-
Return prose
|
|
60
|
+
Return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
|
|
61
61
|
|
|
62
62
|
```json
|
|
63
63
|
{
|
|
@@ -43,7 +43,7 @@ flowchart TD
|
|
|
43
43
|
|
|
44
44
|
Fix --> WriteFail[Write failing test]
|
|
45
45
|
WriteFail --> Implement[Single targeted fix]
|
|
46
|
-
Implement --> Green{
|
|
46
|
+
Implement --> Green{Scoped tests pass?}
|
|
47
47
|
Green -->|Yes| Capture[Capture as ARCS knowledge]
|
|
48
48
|
Green -->|No| FailCount
|
|
49
49
|
|
|
@@ -78,8 +78,8 @@ flowchart TD
|
|
|
78
78
|
|
|
79
79
|
- Write a failing test FIRST (proves the bug exists)
|
|
80
80
|
- Implement a single targeted fix
|
|
81
|
-
- Verify
|
|
82
|
-
- If fix introduces new failures, revert and return to Phase 2
|
|
81
|
+
- Verify the scoped tests for the files you changed pass (your dispatch VERIFY command — never the full suite; the devil-advocate completion gate owns that)
|
|
82
|
+
- If your fix introduces new failures in YOUR scoped tests, revert and return to Phase 2. Failures in files outside your scope are report-only (BLOCKED_BY) — likely a sibling agent's in-flight work; never fix or revert it
|
|
83
83
|
|
|
84
84
|
## Log Triage Protocol
|
|
85
85
|
|
|
@@ -84,9 +84,9 @@ async function gitInit(directory: string) {
|
|
|
84
84
|
|
|
85
85
|
**Critical:** Use `console.error()` in tests (not logger - may not show)
|
|
86
86
|
|
|
87
|
-
**Run and capture:**
|
|
87
|
+
**Run and capture (scoped to the suspect test file — never the full suite):**
|
|
88
88
|
```bash
|
|
89
|
-
npm test 2>&1 | grep 'DEBUG git init'
|
|
89
|
+
npm test -- path/to/suspect.test.ts 2>&1 | grep 'DEBUG git init'
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
**Analyze stack traces:**
|
|
@@ -21,11 +21,11 @@ flowchart TD
|
|
|
21
21
|
B -->|Passes immediately| D[Test is wrong — fix or delete]
|
|
22
22
|
D --> A
|
|
23
23
|
C --> E{Run test}
|
|
24
|
-
E -->|
|
|
24
|
+
E -->|Your tests pass| F[Refactor — keep green]
|
|
25
25
|
E -->|Fails| C
|
|
26
26
|
F --> G{More behavior needed?}
|
|
27
27
|
G -->|Yes| A
|
|
28
|
-
G -->|No| H[Done —
|
|
28
|
+
G -->|No| H[Done — your test files green, scoped VERIFY passes]
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Iron Law
|
|
@@ -35,12 +35,12 @@ Code written before a test? **Delete it.** No "reference", no "adapting". Start
|
|
|
35
35
|
## RED — Write Failing Test
|
|
36
36
|
|
|
37
37
|
- One behavior per test, clear name, real code (no mocks unless unavoidable)
|
|
38
|
-
- Run: `npm test path/to/test.test.ts` — confirm fails for the right reason
|
|
38
|
+
- Run: `npm test -- path/to/test.test.ts` — confirm fails for the right reason
|
|
39
39
|
|
|
40
40
|
## GREEN — Minimal Code
|
|
41
41
|
|
|
42
42
|
- Simplest code to pass. Nothing beyond what the test requires.
|
|
43
|
-
- Run: confirm
|
|
43
|
+
- Run: re-run YOUR test file(s) (`npm test -- path/to/test.test.ts`) — confirm they pass, output pristine. Never the unscoped suite; the devil-advocate completion gate owns full-project verification.
|
|
44
44
|
|
|
45
45
|
## REFACTOR — Clean Up
|
|
46
46
|
|
|
@@ -66,7 +66,7 @@ test('rejects empty email', async () => {
|
|
|
66
66
|
|
|
67
67
|
### Verify RED
|
|
68
68
|
```bash
|
|
69
|
-
$ npm test
|
|
69
|
+
$ npm test -- submitForm.test.ts
|
|
70
70
|
FAIL: expected 'Email required', got undefined
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -82,7 +82,7 @@ function submitForm(data: FormData) {
|
|
|
82
82
|
|
|
83
83
|
### Verify GREEN
|
|
84
84
|
```bash
|
|
85
|
-
$ npm test
|
|
85
|
+
$ npm test -- submitForm.test.ts
|
|
86
86
|
PASS
|
|
87
87
|
```
|
|
88
88
|
|
|
@@ -142,6 +142,8 @@ Between plan-level header and `flowchart TD` declaration:
|
|
|
142
142
|
|
|
143
143
|
**Required:** node, title, status, skill, scope, acceptance. **Optional:** files, verify, blocked-by, delegate.
|
|
144
144
|
|
|
145
|
+
`verify` must name a command scoped to the node's files (e.g. `npm test -- --testPathPattern=orders`, `vitest run test/orders.test.ts`) — never the bare full suite (`npm test`, `vitest run`). The devil-advocate completion gate owns the single full-project pass.
|
|
146
|
+
|
|
145
147
|
## Plan-Level Header Comments
|
|
146
148
|
|
|
147
149
|
```
|
|
@@ -182,7 +184,7 @@ Plans with 15+ nodes: cluster into `subgraph` blocks by phase. If unreadable, sp
|
|
|
182
184
|
- **Ownership:** Only orchestrator/coordinator writes .mmd files. Sub-agents read only and report status back
|
|
183
185
|
- **Presentation:** Internal skill — never narrate conventions to user. Show rendered diagram or URL only
|
|
184
186
|
- **Determinism:** Same metadata must produce byte-identical .mmd output (nodes ordered by ID, edges by source→target, fields in fixed order)
|
|
185
|
-
- **Confidence gate:** Self-score ≥80%
|
|
187
|
+
- **Confidence gate:** Self-score ≥80% before writing .mmd files
|
|
186
188
|
- **Validation before write:** unique IDs, valid edges, all 4 classDef present, valid :::class suffixes
|
|
187
189
|
- **Backward compat:** Plans without .mmd remain valid; diagrams without rich metadata upgraded during SYNC
|
|
188
190
|
|
|
@@ -138,6 +138,8 @@ Diagrams are **agentic execution maps** in separate `.mmd` files — never embed
|
|
|
138
138
|
|
|
139
139
|
All nodes start `:::backlog` but metadata must be fully populated at creation time for diagram-first execution.
|
|
140
140
|
|
|
141
|
+
Per-node `verify` commands MUST be scoped to that task's files (e.g. `npm test -- tests/exact/path/test.py`, `vitest run test/orders.test.ts`) — never the bare full suite (`npm test`, `vitest run`, `biome check .`). The devil-advocate completion gate owns the single full-project pass.
|
|
142
|
+
|
|
141
143
|
## Plan Review Loop
|
|
142
144
|
|
|
143
145
|
```mermaid
|
|
@@ -153,7 +155,7 @@ flowchart TD
|
|
|
153
155
|
|
|
154
156
|
- Chunk boundaries: `## Chunk N: <name>`, ≤1000 lines each
|
|
155
157
|
- Same agent fixes (preserves context). Max 5 iterations, then surface to human.
|
|
156
|
-
- Reviewer must announce confidence score
|
|
158
|
+
- Reviewer must announce a confidence score (0-100). Score <80% loops back to "Fix chunk" — never proceed past a sub-threshold review.
|
|
157
159
|
|
|
158
160
|
## Storage
|
|
159
161
|
|
package/package.json
CHANGED
package/scripts/arcs-init.mjs
CHANGED
|
@@ -76,6 +76,7 @@ if (!isCommandAvailable("gh")) {
|
|
|
76
76
|
|
|
77
77
|
if (!isCommandAvailable("rtk")) {
|
|
78
78
|
console.warn(`WARNING: rtk not found.`);
|
|
79
|
-
console.warn(` RTK
|
|
80
|
-
console.warn(` Install:
|
|
79
|
+
console.warn(` RTK cuts agent token usage on shell commands: https://github.com/rtk-ai/rtk`);
|
|
80
|
+
console.warn(` Install: brew install rtk`);
|
|
81
|
+
console.warn(` Then wire it up: rtk init -g (add --opencode to also wire OpenCode)`);
|
|
81
82
|
}
|