@rryando/arcs 3.6.0 → 3.7.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 (43) hide show
  1. package/README.md +22 -6
  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 +38 -15
  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 +49 -7
  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 +48 -2
  21. package/dist/cli/commands/utility.js.map +1 -1
  22. package/opencode/arcs/prompts/arcs-docs.txt +10 -5
  23. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +38 -15
  24. package/opencode/arcs/prompts/arcs-orchestrate.txt +38 -15
  25. package/opencode/arcs/prompts/code-reviewer.txt +6 -0
  26. package/opencode/arcs/prompts/devil-advocate.txt +8 -0
  27. package/opencode/arcs/prompts/docs-researcher.txt +8 -7
  28. package/opencode/arcs/prompts/graph-explorer.txt +8 -6
  29. package/opencode/arcs/prompts/oncall-ops.txt +9 -7
  30. package/opencode/arcs/prompts/qa-analyst.txt +5 -1
  31. package/opencode/arcs/prompts/software-engineer.txt +7 -3
  32. package/opencode/arcs/prompts/system-architect.txt +8 -2
  33. package/opencode/arcs/prompts/tech-architect.txt +11 -5
  34. package/opencode/arcs/skills/brainstorming/SKILL.md +6 -0
  35. package/opencode/arcs/skills/code-agent/SKILL.md +4 -0
  36. package/opencode/arcs/skills/deep-pr-review/SKILL.md +6 -1
  37. package/opencode/arcs/skills/executing-plans/SKILL.md +6 -0
  38. package/opencode/arcs/skills/quick-dev/SKILL.md +4 -0
  39. package/opencode/arcs/skills/requesting-code-review/SKILL.md +8 -0
  40. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +4 -0
  41. package/opencode/arcs/skills/the-ladder/SKILL.md +2 -0
  42. package/opencode/arcs/skills/writing-plans/SKILL.md +6 -0
  43. package/package.json +1 -1
@@ -7,6 +7,8 @@ Your dispatch normally carries SCOPE/CONTEXT/IDS with pre-derived facts. When it
7
7
  2. Run `arcs brief --lean --json` for live DAG state — ONLY when the dispatch carries no T0 excerpt.
8
8
  3. Run `arcs search <slug> "<keywords>" --json` — ONLY for context the dispatch left open.
9
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
+
10
12
  Core skills you load: brainstorming (design exploration with dual-mode ARCS integration), writing-plans (implementation plans), to-diagram (visual execution maps).
11
13
 
12
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).
@@ -30,7 +32,7 @@ MANDATORY EXIT GATE: Before finalizing any design, verify: (1) dependency direct
30
32
  | `arcs graph inspect <slug> --json` | Analyze coupling density and fan-in/fan-out |
31
33
  | `arcs related <slug> --plan=<planId> --json` | Find graph-linked entities across projects |
32
34
  | `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 |
35
+ | `arcs knowledge upsert <slug> "<title>" --kind=architecture --summary="..." --json` | Record architectural decision or observation (idempotent by title) |
34
36
  | `arcs search <slug> "<keywords>" --lean --json` | Find existing plans/knowledge before proposing new |
35
37
 
36
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`.
@@ -71,7 +73,11 @@ BOUNDARIES:
71
73
  RISKS:
72
74
  - <risk with severity and mitigation>
73
75
 
74
- ARTIFACTS:
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)
75
81
  - executed: <arcs command run + resulting entry/plan id>
76
82
  - proposed: <ready-to-run arcs command for the orchestrator to execute verbatim>
77
83
  ```
@@ -11,6 +11,8 @@ Your dispatch normally carries SCOPE/CONTEXT/IDS with pre-derived facts. When it
11
11
  2. Run `arcs brief --lean --json` for live DAG state — ONLY when the dispatch carries no T0 excerpt.
12
12
  3. Run `arcs search <slug> "<keywords>" --json` — ONLY for context the dispatch left open.
13
13
 
14
+ 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.
15
+
14
16
  Core skills you load: brainstorming (design exploration), writing-plans (structured plans from analysis findings).
15
17
 
16
18
  You have ARCS CLI access — use it to read project context, check existing architectural knowledge entries, and capture findings as durable knowledge entries (kind: architecture or lesson).
@@ -31,8 +33,8 @@ MANDATORY EXIT GATE: Before delivering analysis, confirm: (1) all relevant modul
31
33
  | `arcs related <slug> --knowledge=<id> --json` | Trace dependency chains between entities |
32
34
  | `arcs audit <slug> --json` | Check structural health (stale refs, orphan entities) |
33
35
  | `arcs knowledge get <slug> <id> --body --json` | Read full knowledge entry for deep analysis |
34
- | `arcs knowledge search <slug> "<keywords>" --lean --json` | Find prior architectural findings |
35
- | `arcs knowledge create <slug> "<title>" --kind=architecture --summary="..." --json` | Record analysis finding |
36
+ | `arcs knowledge search <slug> "<keywords>" --lean --json` | Find prior kind=architecture\|decision findings before analyzing |
37
+ | `arcs knowledge upsert <slug> "<title>" --kind=architecture --summary="..." --json` | Record analysis finding (idempotent by title) |
36
38
  | `arcs diff <slug> --since="7d" --json` | See what changed since last sync (scope recent changes) |
37
39
 
38
40
  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`.
@@ -47,9 +49,9 @@ When dispatched for structural analysis:
47
49
  2. `arcs graph inspect <slug> --json` — get coupling density, fan-in/fan-out metrics
48
50
  3. `arcs related <slug> --knowledge=<id> --json` — trace dependency chains from the subject
49
51
  4. `arcs audit <slug> --json` — check for structural health issues
50
- 5. `arcs knowledge search <slug> "<area>" --lean --json` — find prior findings
52
+ 5. `arcs knowledge search <slug> "<area>" --lean --json` — find prior kind=architecture|decision findings before analyzing
51
53
  6. Analyze: apply 6-dimension framework (module boundaries, dependency direction, API cohesion, coupling, layering, evolution fitness)
52
- 7. `arcs knowledge create <slug> "<finding>" --kind=architecture --summary="..." --json` — record findings
54
+ 7. `arcs knowledge upsert <slug> "<finding>" --kind=architecture --summary="..." --json` — record findings (idempotent by title)
53
55
 
54
56
  Output: severity-ranked findings with evidence (file paths, metrics, dependency chains).
55
57
 
@@ -73,7 +75,11 @@ RECOMMENDATIONS:
73
75
  RISKS:
74
76
  - <risk if recommendation is NOT followed>
75
77
 
76
- ARTIFACTS:
78
+ KNOWLEDGE: <none | one ready-to-run command per durable, reusable insight surfaced this dispatch:
79
+ arcs knowledge upsert <slug> "<title>" --kind=<lesson|gotcha|pattern|architecture|decision> --summary="<1-2 sentences>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json
80
+ (upsert is idempotent by title — no dedup search needed)>
81
+
82
+ ARTIFACTS: (non-knowledge artifacts only — plans, diagrams)
77
83
  - executed: <arcs command run + resulting entry id>
78
84
  - proposed: <ready-to-run arcs command for the orchestrator to execute verbatim>
79
85
  ```
@@ -41,6 +41,10 @@ flowchart TD
41
41
  K --> L[Invoke writing-plans skill]
42
42
  ```
43
43
 
44
+ ## Prior Decisions Check
45
+
46
+ Before challenging, read what's already settled so you don't relitigate or contradict a prior call: `arcs knowledge search <slug> "<topic-keywords>" --lean --json` filtering for `kind=decision` and `kind=architecture`. If a load-bearing decision already covers this area, surface it — a settled call is not reopened without a concrete new trigger.
47
+
44
48
  ## Challenge Protocol
45
49
 
46
50
  Before designing anything, interrogate the request:
@@ -124,6 +128,8 @@ arcs plan create <slug> --title="YYYY-MM-DD <topic> Design" --summary="..." --st
124
128
 
125
129
  When creating tasks from the plan, wire execution order with `--dependsOn=dep-task-id-1,dep-task-id-2`. The `dependsOn` graph determines what `arcs next` returns — priority is a tiebreaker within the same topological level.
126
130
 
131
+ After the design lands, capture the reasoning that the plan body alone will lose — this is the richest, most-skipped knowledge in the whole workflow. For each load-bearing DECISION and each REJECTED ALTERNATIVE (with the rationale for rejection), emit/run an upsert: `arcs knowledge upsert <slug> "<decision title>" --kind=decision --summary="<what was decided and why; what was rejected and why>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json`. Upsert is idempotent by title, so no dedup search is needed. (When the orchestrator drives this skill, emit the upsert command for it to run; standalone with bash, run it directly.)
132
+
127
133
  After storage: _"Spec saved to plan `<planId>`. Review it. Push back if anything's wrong."_
128
134
 
129
135
  ## Visual Companion
@@ -42,6 +42,10 @@ Look for:
42
42
 
43
43
  If relevant entries exist, incorporate their guidance. Don't rediscover what's already known.
44
44
 
45
+ ## Capture Exit: Record What You Resolved
46
+
47
+ Phase 0 is read-only; close the loop on the way out. After implementing, if you resolved a non-obvious ambiguity or hit a gotcha worth saving, upsert it so the next agent doesn't re-investigate: `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha> --summary="<what was resolved / the trap and how to avoid it>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. Skip when the work was mechanical and surfaced nothing non-obvious. Upsert is idempotent by title.
48
+
45
49
  ## Behaviour
46
50
 
47
51
  - Apply `the-ladder` during implementation — reach for stdlib / native / an installed dep before new code, and leave `// SHORTCUT:` markers for deliberate simplifications
@@ -45,7 +45,7 @@ flowchart TD
45
45
  S -->|don't post| END1[Show report only]
46
46
  S -->|post| T[gh api: review + inline comments]
47
47
  T --> U{Recurring pattern surfaced?}
48
- U -->|yes + opt-in| V[Propose knowledge:create]
48
+ U -->|yes| V[Propose arcs knowledge upsert in report — ARCS-write opt-in to apply]
49
49
  U -->|no| END2[Done]
50
50
  V --> END2
51
51
  ```
@@ -180,6 +180,10 @@ gh api POST /repos/{owner}/{repo}/pulls/{number}/reviews \
180
180
  | 4 (summary only) | `gh pr review <number> --comment --body "..."` — **one call, no `comments[]`** |
181
181
  | 5 (don't post) | No `gh` writes |
182
182
 
183
+ ## Knowledge Proposals (standard report output)
184
+
185
+ A recurring finding — the same class of bug, the same convention violation, a trap seen more than once across the diff — is durable knowledge, not just a one-off comment. Make proposing it a standard part of the report, not an afterthought: for each recurring finding, include a proposed `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha> --summary="<the recurring issue and the fix convention>" --keywords="<k1,k2>" --source-files="<path,...>" --json` in the report. This is a *proposal*: it is still subject to the ARCS-write opt-in and only applied when the user opts in. It does NOT gate on the GitHub posting choice — a review that posts nothing can still surface knowledge proposals. Upsert is idempotent by title.
186
+
183
187
  ## Report Structure
184
188
 
185
189
  ```
@@ -189,6 +193,7 @@ gh api POST /repos/{owner}/{repo}/pulls/{number}/reviews \
189
193
  ## Rubric Selection (which dimensions activated, why)
190
194
  ## Findings (grouped by severity)
191
195
  ## Cleared Dimensions (with evidence)
196
+ ## Knowledge Proposals (recurring findings → proposed arcs knowledge upsert, ARCS-write opt-in)
192
197
  ## Architectural / Performance Handoffs (if any)
193
198
  ## Posting Plan (mode chosen → exact comments to be posted)
194
199
  ## Confidence & Gaps
@@ -57,6 +57,8 @@ When plan has `.diagram.mmd`:
57
57
 
58
58
  **Verify scope rule:** Run ONLY the current task's `verify` command, scoped to that task's `files`. If the authored command is broader than the task's scope (bare `npm test`, `vitest run`, `biome check .`), narrow it to the touched files first (e.g. `npm test -- test/orders.test.ts`). Failures in files outside the task's scope are report-only — list them under BLOCKED_BY, never fix them. Full-project verification happens once, at the devil-advocate completion gate.
59
59
 
60
+ **Directed gotcha read before each task:** Before executing a task, search the DAG for known traps in its area so you don't walk into one the plan didn't anticipate: `arcs knowledge search <slug> "<task-keywords>" --lean --json`, filtering for `kind=gotcha`. Pull the body of anything relevant with `arcs knowledge get <slug> <id> --body --lean --json`.
61
+
60
62
  ## Sub-Agent Context
61
63
 
62
64
  Fetch once, then paste the relevant output into each dispatch's CONTEXT — don't make sub-agents re-fetch:
@@ -79,6 +81,10 @@ Sub-agents MUST NOT edit `.mmd` files — orchestrator owns diagram updates.
79
81
 
80
82
  Ask for clarification rather than guessing. Don't force through blockers.
81
83
 
84
+ ## Capturing Execution Discoveries
85
+
86
+ When execution surfaces something the plan didn't know — a plan-vs-reality delta, a gotcha hit mid-task, a convention the plan got wrong — capture it so the "new knowledge entries" sync trigger below actually fires: `arcs knowledge upsert <slug> "<title>" --kind=<gotcha|lesson> --summary="<what reality diverged from the plan / the trap hit>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. Skip when execution matched the plan exactly. Upsert is idempotent by title.
87
+
82
88
  ## Auto-Sync Triggers
83
89
 
84
90
  Post-execution DAG sync fires automatically when:
@@ -29,6 +29,10 @@ arcs knowledge search <slug> "<keywords>" --lean --json
29
29
 
30
30
  Check for patterns, gotchas, and lessons before implementing. Skip only if the change is purely mechanical (rename, config nudge).
31
31
 
32
+ ## Capture Exit (lightweight)
33
+
34
+ If a "bounded" change surfaced a non-obvious gotcha along the way, capture it before finishing: `arcs knowledge upsert <slug> "<title>" --kind=gotcha --summary="<the trap in 1-2 sentences>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. Mechanical changes capture nothing — keep this lightweight; only a genuine surprise is worth an entry. Upsert is idempotent by title.
35
+
32
36
  ## Behaviour
33
37
 
34
38
  0. Apply `the-ladder` before writing code — climb the rungs (stdlib / native platform / installed dep before new code) and mark deliberate simplifications with `// SHORTCUT:` comments
@@ -32,6 +32,10 @@ flowchart TD
32
32
  - `{BASE_SHA}` / `{HEAD_SHA}` — commit range
33
33
  - `{PROJECT_CONVENTIONS}` — CLAUDE.md / linter configs / style guides (gather once per session, reuse across dispatches)
34
34
 
35
+ ## Feed DAG Conventions to the Reviewer
36
+
37
+ When gathering conventions, also pull what the DAG already knows so the reviewer checks against settled patterns, not just static config: `arcs knowledge search <slug> "<changed-area keywords>" --lean --json`, filtering for `kind=pattern` and `kind=gotcha`. Fold the relevant entries into the reviewer's `{PROJECT_CONVENTIONS}` context.
38
+
35
39
  ## When to Request
36
40
 
37
41
  **Mandatory:** after major features, before merge to main.
@@ -49,3 +53,7 @@ flowchart TD
49
53
  See template at: `requesting-code-review/code-reviewer.md`
50
54
 
51
55
  Reviewer returns the unified envelope: STATUS → VERDICT (approve | request-changes | comment-only) → FINDINGS by severity (CRITICAL/HIGH/MEDIUM/LOW) with 📍 file:line anchors.
56
+
57
+ ## Capture Recurring Findings
58
+
59
+ When a finding recurs — the same class of issue flagged more than once, or a convention the codebase keeps violating — propose it as durable knowledge so future reviews and implementers inherit it: `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha> --summary="<the recurring issue and the fix convention>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. Upsert is idempotent by title.
@@ -128,6 +128,10 @@ Mapping to the orchestrator's Standard Return Envelope: DONE→done, DONE_WITH_C
128
128
  Include in every dispatch prompt:
129
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
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
+
131
135
  ## Git State Discipline
132
136
 
133
137
  - Sub-agents MUST NOT run `git stash` — ever, under any circumstance
@@ -47,6 +47,8 @@ Mark every deliberate simplification inline so it reads as intent, not ignorance
47
47
 
48
48
  The comment names the known ceiling AND the trigger to revisit. Example: `# SHORTCUT: global lock, switch to per-account locks when throughput matters`. A SHORTCUT marker with no named upgrade trigger is the kind that silently rots — always name the trigger. (These markers are harvested into the ARCS knowledge DAG at session completion by the orchestrator.)
49
49
 
50
+ When a SHORTCUT's ceiling is durable and non-obvious — a real trap the next person could step into, not just a local stub — don't rely on the orchestrator harvest alone: also capture it directly with `arcs knowledge upsert <slug> "<ceiling title>" --kind=gotcha --summary="<the ceiling and its upgrade trigger>" --keywords="<k1,k2>" --source-files="<path,...>" --json`. The harvest stays as backup; this is the path that fires when no orchestrator runs. Upsert is idempotent by title — skip the dedup search.
51
+
50
52
  ## Boundaries
51
53
 
52
54
  This skill governs WHAT you build (minimal), not correctness or how you talk. It layers under a work-mode skill (quick-dev / code-agent / executing-plans); it does not replace them. The devil-advocate gate still independently verifies KISS/YAGNI/DRY after the fact — the ladder is build-minimal, the gate is verify-minimal.
@@ -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:
@@ -163,6 +167,8 @@ 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?"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rryando/arcs",
3
- "version": "3.6.0",
3
+ "version": "3.7.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",