@yunhozz/arc 0.2.1 → 0.2.3

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 (81) hide show
  1. package/MANIFEST.sha256 +77 -51
  2. package/README.md +4 -2
  3. package/claude/agents/arc-implementer.md +8 -8
  4. package/claude/agents/arc-planner.md +10 -12
  5. package/claude/agents/arc-qa.md +7 -7
  6. package/claude/agents/arc-reviewer.md +6 -6
  7. package/claude/agents/arc-scouter.md +6 -6
  8. package/claude/skill/SKILL.md +16 -17
  9. package/claude/skill/references/arc-visual-companion.md +33 -0
  10. package/claude/skill/references/commit.md +1 -1
  11. package/claude/skill/references/coordination.md +23 -39
  12. package/claude/skill/references/handoff-prep.md +3 -3
  13. package/claude/skill/references/handoff.md +10 -9
  14. package/claude/skill/references/limits.md +3 -4
  15. package/claude/skill/references/planning.md +53 -51
  16. package/claude/skill/references/verification.md +8 -8
  17. package/claude/skill/references/visual-companion.md +293 -15
  18. package/codex/agents/arc-implementer.toml +7 -7
  19. package/codex/agents/arc-planner.toml +11 -13
  20. package/codex/agents/arc-qa.toml +7 -7
  21. package/codex/agents/arc-reviewer.toml +6 -6
  22. package/codex/agents/arc-scouter.toml +6 -6
  23. package/codex/skill/SKILL.md +16 -20
  24. package/codex/skill/references/arc-visual-companion.md +39 -0
  25. package/codex/skill/references/commit.md +4 -6
  26. package/codex/skill/references/coordination.md +25 -44
  27. package/codex/skill/references/git-recovery.md +2 -3
  28. package/codex/skill/references/handoff-prep.md +4 -4
  29. package/codex/skill/references/handoff-worktree.md +5 -9
  30. package/codex/skill/references/handoff.md +15 -18
  31. package/codex/skill/references/limits.md +3 -4
  32. package/codex/skill/references/planning.md +56 -55
  33. package/codex/skill/references/verification.md +13 -15
  34. package/codex/skill/references/visual-companion.md +290 -18
  35. package/lib/installer/install.mjs +5 -7
  36. package/lib/installer/manifest.mjs +23 -8
  37. package/lib/installer/package-references.mjs +10 -5
  38. package/lib/installer/plan.mjs +1 -1
  39. package/lib/installer/superpowers.mjs +26 -1
  40. package/lib/installer/transaction.mjs +3 -3
  41. package/lib/installer/upgrade.mjs +2 -9
  42. package/lib/management/operations.mjs +17 -8
  43. package/lib/management/update.mjs +19 -10
  44. package/lib/npm/context.mjs +22 -0
  45. package/lib/npm/uninstall.mjs +17 -0
  46. package/lib/npm/upgrade.mjs +25 -0
  47. package/lib/policy/role-policy.json +9 -9
  48. package/lib/release/artifact.mjs +6 -4
  49. package/lib/tui/app.mjs +32 -63
  50. package/lib/tui/render.mjs +10 -12
  51. package/lib/tui/setup.mjs +11 -9
  52. package/lib/tui/terminal.mjs +8 -8
  53. package/package.json +12 -2
  54. package/scripts/update-manifest.mjs +7 -9
  55. package/claude/skill/references/superpowers/brainstorming/visual-companion.md +0 -299
  56. package/codex/skill/references/superpowers/brainstorming/visual-companion.md +0 -299
  57. package/lib/tui/workflow.mjs +0 -12
  58. /package/claude/skill/references/{superpowers/brainstorming/SKILL.md → brainstorming.md} +0 -0
  59. /package/claude/skill/references/{superpowers/brainstorming/builder-check-prompt.md → builder-check-prompt.md} +0 -0
  60. /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/frame-template.html +0 -0
  61. /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/helper.js +0 -0
  62. /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/server.cjs +0 -0
  63. /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/start-server.sh +0 -0
  64. /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/stop-server.sh +0 -0
  65. /package/claude/skill/references/{superpowers/LICENSE → superpowers-LICENSE} +0 -0
  66. /package/claude/skill/references/{superpowers/provenance.json → superpowers-provenance.json} +0 -0
  67. /package/claude/skill/references/{superpowers/test-driven-development/SKILL.md → test-driven-development.md} +0 -0
  68. /package/claude/skill/references/{superpowers/test-driven-development/writing-good-tests.md → writing-good-tests.md} +0 -0
  69. /package/claude/skill/references/{superpowers/writing-plans/SKILL.md → writing-plans.md} +0 -0
  70. /package/codex/skill/references/{superpowers/brainstorming/SKILL.md → brainstorming.md} +0 -0
  71. /package/codex/skill/references/{superpowers/brainstorming/builder-check-prompt.md → builder-check-prompt.md} +0 -0
  72. /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/frame-template.html +0 -0
  73. /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/helper.js +0 -0
  74. /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/server.cjs +0 -0
  75. /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/start-server.sh +0 -0
  76. /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/stop-server.sh +0 -0
  77. /package/codex/skill/references/{superpowers/LICENSE → superpowers-LICENSE} +0 -0
  78. /package/codex/skill/references/{superpowers/provenance.json → superpowers-provenance.json} +0 -0
  79. /package/codex/skill/references/{superpowers/test-driven-development/SKILL.md → test-driven-development.md} +0 -0
  80. /package/codex/skill/references/{superpowers/test-driven-development/writing-good-tests.md → writing-good-tests.md} +0 -0
  81. /package/codex/skill/references/{superpowers/writing-plans/SKILL.md → writing-plans.md} +0 -0
@@ -2,28 +2,23 @@
2
2
 
3
3
  ## Authorization and scope
4
4
 
5
- An explicit execution request is authorization only for its sufficiently specified scope. Confirm execution intent,
5
+ An explicit execution request authorizes only its sufficiently specified scope. Confirm execution intent,
6
6
  expected outcome, constraints, document depth, and verification risk, with no unresolved material behavior, method,
7
- or risk decision requiring the user. The request itself or a description explicitly referenced by the user must
8
- supply that scope. Record authorization evidence, scope, acceptance criteria, constraints, and depth in the brief or
9
- canonical record. Routine execution and check choices may be recorded by Orchestrator; added product behavior or
10
- material scope cannot be claimed as already approved. A restatement, role handoff, or restart does not create an
11
- approval requirement for the same scope.
7
+ or risk decision requiring the user. That scope must come from the request or a description the user explicitly references. Record authorization evidence, scope, acceptance criteria, constraints, and depth in the brief or
8
+ canonical record. Orchestrator may record routine execution and check choices; added product behavior or material scope is not already approved. Restating or handing off the same scope, or restarting, requires no new approval.
12
9
 
13
10
  Silence, ambiguous assent, approval of other work, and unspecified blanket improvement requests are not authorization.
14
11
  Planner's new material choices are not automatically approved. Ask for the missing material decision; roles route
15
12
  questions to Orchestrator. Required written specs and plans still require their individual approval in the order below.
16
13
 
17
- For material changes to scope, method, or risk, hold affected work and explain the missing decision or evidence and
18
- remaining work. Target changes, unclear ownership, unexpected state, unresolved failures, or missing required inputs
14
+ Material scope, method, or risk changes hold affected work; explain the missing decision or evidence and remaining work. Target changes, unclear ownership, unexpected state, unresolved failures, or missing required inputs
19
15
  also hold affected work under [handoff](handoff.md) and [git-recovery](git-recovery.md). Distinguish new authorization
20
16
  needs from execution issues within existing scope: ordinary corrections and reverification do not require duplicate
21
17
  approval after failure. Revalidate affected gates after resolution.
22
18
 
23
19
  ### Probe scope
24
20
 
25
- A probe-only scope completes with findings, evidence, limits, and remaining uncertainty answering the approved question;
26
- a well-supported infeasibility result can complete it. Probe-only authorization does not authorize product retention
21
+ A probe-only scope completes by answering the approved question with findings, evidence, limits, and remaining uncertainty; well-supported infeasibility can complete it. Probe-only authorization does not authorize product retention
27
22
  or subsequent implementation. Record question, method/scope, criteria, and constraints; a sufficiently specific probe
28
23
  request can supply that approval. Match checks to probe purpose/risk and do not report probe evidence as product proof.
29
24
 
@@ -36,12 +31,11 @@ remains separate.
36
31
 
37
32
  ## Formal drafting boundary
38
33
 
39
- Initial design proposals and brainstorming may precede execution-target choice. Formal spec or plan drafting includes a
40
- complete draft before saving, even when returned only in chat. Before formal drafting and saving, Orchestrator supplies
34
+ Initial design proposals and brainstorming may precede execution-target choice. Formal spec or plan drafting includes a complete draft before saving, even when returned only in chat. Before formal drafting and saving, Orchestrator supplies
41
35
  and records the actual absolute workspace/repository, branch or detached HEAD, HEAD, changes and ownership,
42
36
  explicit choice and preparation evidence, and absolute document paths inside that target. Planner drafts for that
43
37
  verified workspace; Orchestrator saves directly in the selected target. Missing or mismatched evidence stops the
44
- affected drafting or save and is reported to Orchestrator. Planned scope and paths do not establish actual preparation.
38
+ affected drafting or save and is reported to Orchestrator. Planned scope and paths do not prove actual preparation.
45
39
  Initial target preparation does not authorize Implementer; the complete handoff gate still applies.
46
40
 
47
41
  Orchestrator classifies scope before implementation. The Orchestrator direct path for small tasks is defined only in
@@ -58,31 +52,43 @@ Orchestrator preserves that language when saving.
58
52
 
59
53
  ## Planner drafting preparation and consolidated feedback
60
54
 
61
- Before formal drafting, Orchestrator performs a preflight of relevant policy, reference, profile, test, parity and
62
- manifest surfaces and conflicts. Provide one complete brief with actual absolute workspace/repository, branch or
63
- detached HEAD, HEAD, change state and ownership, explicit target choice and preparation evidence, approved preceding
64
- design/spec/plan versions, scope and exclusions, design/plan depth, dependencies and shared contracts, acceptance
65
- criteria, required QA/focused checks and evidence, hold conditions and open decisions. Resolve missing or conflicting
66
- required evidence first or hold that stage.
67
-
68
- Planner returns a complete proportional draft and self-review for the current approval stage. Orchestrator integrates,
69
- saves, reviews and obtains approval. Orchestrator checks once with a fixed checklist: scope and evidence; targets,
70
- ownership and paths; policy surfaces and conflicts; task boundaries, dependencies and acceptance criteria; checks,
71
- evidence and holds; roles, approval and commit boundaries; draft completeness. Gather all substantive omissions into
72
- one consolidated follow-up request to Planner. Do not split requests by omission or author the missing plan yourself.
73
-
74
- Initial design, required spec approval, and formal plan drafting/approval remain separate ordered stages.
75
- Allow additional Planner calls for substantive omissions or user-approved scope/evidence changes. There is no fixed
76
- call cap; never accept an incomplete draft to minimize calls. Do not add call-count conditions to Planner profiles.
77
-
78
- The complete initial brief identifies original user requirements, criteria IDs, approved decisions and open decisions;
79
- current behavior and connected source, generated, runtime, installer and documentation surfaces; conflicting rules and
80
- resolution direction; exact current-stage deliverable and absolute output path. Keep the shared brief's fixed field order
81
- in [coordination](coordination.md). Link accessible evidence and needed ranges instead of full dialogue or raw logs.
82
- Consolidated feedback contains changed fields only and marks remaining fields `unchanged` relative to the received brief.
83
- Do not call Planner again for already resolved questions. Missing target preparation or required decisions holds formal
84
- drafting; initial design proposals may still precede target selection. Written-spec approval precedes dependent plan drafting.
85
-
55
+ 1. Before formal drafting, Orchestrator performs a preflight of relevant policy, reference, profile, test, parity
56
+ and manifest surfaces and conflicts. Apply the Formal drafting boundary above and coordination's instruction
57
+ provenance, input-state and local-skill rules, including required reference paths, authorized bounded read
58
+ alternatives and return conditions. Missing required inputs or unresolved conflicts hold dependent drafting;
59
+ Planner returns them to Orchestrator. Optional read recovery grants no preparation, verification, writing or
60
+ approval authority.
61
+
62
+ 2. Maintain a compact ledger of original requirements/criteria IDs, approved and open decisions, exclusions and
63
+ scope deltas; merge intervening user changes into one next-brief delta. Distinguish user-approved decisions,
64
+ verified source facts with exact paths and lines, assumptions and open decisions.
65
+
66
+ 3. Send one complete brief for the initial call of each stage, using coordination's shared fields and evidence-link
67
+ rules. Include the prepared workspace, branch or detached HEAD, HEAD and ownership; scope, exclusions, depth,
68
+ dependencies, shared contracts, acceptance criteria, required QA/focused checks, evidence and holds. Identify
69
+ preceding approved versions, document/output paths, current behavior and connected source, generated, runtime,
70
+ installer and documentation surfaces, policy conflicts and resolution direction, open decisions and the exact
71
+ stage deliverable. For visual work, include approved sources/versions, criteria and unresolved interpretations.
72
+
73
+ 4. Planner returns a complete proportional draft and self-review. Orchestrator integrates, saves, reviews and
74
+ obtains approval; never authors missing content. Review the complete draft once with this fixed checklist:
75
+ scope and evidence; targets, ownership and paths; policy surfaces and conflicts; task boundaries, dependencies
76
+ and acceptance criteria; checks, evidence and holds; roles, approval and commit boundaries; draft completeness.
77
+ Finish the checklist before sending all substantive omissions in one consolidated follow-up request.
78
+ Identify each criterion, defect, evidence and expected correction. Follow coordination's changed-fields-only
79
+ and `unchanged` rules. Do not split requests by omission.
80
+
81
+ 5. After that correction, additional Planner calls require user-approved material scope/evidence changes or
82
+ concrete unmet checklist items, plus meaningful new input or criterion-state progress. Identify changed input,
83
+ target criterion, expected artifact and expected progress. Distinguish approved scope changes from ordinary
84
+ omissions within existing scope; omissions require no renewed scope approval. If the same criterion remains
85
+ unmet without meaningful new input, evidence or progress, hold the stage and report the criterion, observed
86
+ evidence and exact unblock input or decision. Do not repeat resolved questions, reword the same request, or
87
+ count rewording or agent replacement as meaningful input or progress.
88
+
89
+ Initial design, required spec approval, and formal plan drafting/approval remain separate ordered stages;
90
+ written-spec approval precedes dependent plan drafting. No fixed call cap applies; never accept an incomplete draft
91
+ to reduce calls or add call-count conditions to Planner profiles.
86
92
 
87
93
  ## Design path and plan depth
88
94
 
@@ -204,9 +210,7 @@ Written-spec approval precedes dependent plan drafting. On document-omission pat
204
210
  steps; preserve target choice, preparation, state/ownership checks and Implementer gates.
205
211
 
206
212
  While documents are being written, reviewed, or approved, do not stage documents or commit planning documents.
207
- Selection and initial target preparation happen before formal drafting; document completion is a staging/commit gate,
208
- not an initial preparation gate. An incomplete set or missing applicable approval blocks document commit and Implementer,
209
- not the initial choice request. No early Implementer work is authorized by approval of only some documents.
213
+ Select and initially prepare the target before formal drafting. Document completion gates staging/commit, not initial preparation. An incomplete set or missing applicable approval blocks document commit and Implementer, but not the initial choice request. No early Implementer work is authorized by approval of only some documents.
210
214
 
211
215
  This ARC defers the local brainstorming early spec commit: save and self-review the spec, obtain written-spec
212
216
  approval without committing, then write and approve all plans; commit the spec only in the final batch.
@@ -231,8 +235,7 @@ and preparation are complete. Then reflect the approved plan version in its orig
231
235
  ## Plan updates during execution
232
236
 
233
237
  Mechanical execution records may be recorded without new user approval: checkbox completion, actual results, evidence
234
- links and task completion state that preserve the approved execution contract. Record their classification, reason and
235
- actual recording time in the canonical handoff record. Required checks' removal, invented success, unsupported acceptance
238
+ links and task completion state that preserve the approved execution contract. Record their classification, reason and actual recording time in the canonical handoff record. Required checks' removal, invented success, unsupported acceptance
236
239
  or scope changes mixed with a completion mark are not mechanical records.
237
240
 
238
241
  Changes to goals, task scope or boundaries, acceptance criteria, method, risk, dependencies or required verification
@@ -242,8 +245,7 @@ follow the document-version approval rules; classify typos, paths, commands and
242
245
 
243
246
  Both mechanical records and approved contract revisions amend the original planning-document commit at a safe checkpoint.
244
247
  Make no separate document commit or fixup commit, including for newly approved scope. Preserve implementation task commits.
245
- This history update does not make actual approval time retroactive: the latest plan in the original commit is not evidence
246
- that its contents were approved from the outset. Never use rewritten history to justify work started before approval.
248
+ This history update does not backdate approval: the latest plan in the original commit does not prove its contents were approved from the outset. Never use rewritten history to justify work started before approval.
247
249
 
248
250
  In the canonical handoff record preserve plan absolute/Git paths; before and after content hashes and versions; prior and
249
251
  revised approval references and actual times; change reason and classification; affected tasks and hold/preparation/resume
@@ -269,9 +271,9 @@ Return scope changes and unresolved decisions to the user through Orchestrator.
269
271
 
270
272
  ## Local planning references
271
273
 
272
- Orchestrator briefs absolute ARC paths `references/superpowers/brainstorming/SKILL.md` and
273
- `references/superpowers/writing-plans/SKILL.md`. Planner reads them directly; resolve relative references within each
274
- skill. Missing files stop the stage; report paths without global fallback. Keep ARC approval and ownership gates.
274
+ Orchestrator briefs absolute ARC paths `references/brainstorming.md` and
275
+ `references/writing-plans.md`. Planner reads them directly; resolve relative references from the installed
276
+ `references/` directory. Missing files stop the stage; report paths without global fallback. Keep ARC approval and ownership gates.
275
277
 
276
278
 
277
279
  ## Instruction and Input Provenance
@@ -281,11 +283,11 @@ Give the Planner the exact paths and access state for required skills and refere
281
283
  [ARC role policy: contract begin]
282
284
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
283
285
  - [git.orchestrator-accept-commit] Only Orchestrator accepts work and executes Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied; Orchestrator accepts then commits without additional user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership and verify the resulting SHA, included content, HEAD and remaining changes. Existing small-task direct and plan-omission paths are unchanged.
284
- - [review.significant-no-plan] For significant/high-risk work without a plan: Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
285
- - [review.significant-plan] For significant/high-risk plan work: each task uses Implementer → fresh QA as required → Orchestrator acceptance and focused commit. After all tasks are accepted and required QA is complete, Reviewer reviews the final full change once. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
286
+ - [review.significant-no-plan] For significant/high-risk work without a plan: Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer because no plan exists. This creates no new plan obligation.
287
+ - [review.significant-plan] For significant/high-risk plan work: each task uses Implementer → fresh QA as required → Orchestrator acceptance and focused commit. Reviewer reviews the final full change once after all tasks are accepted and required QA is complete. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
286
288
  - [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Implementer → Reviewer without QA reassignment; repeat until resolved. This exception applies only at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
287
289
  - [planning.plan-amend] During approved task execution, mechanical plan progress records need no new user approval; changed goals, scope, criteria, method, risk, dependencies or required verification require revised-version approval and preparation before affected work. In both cases Orchestrator amends the original planning-document commit at a safe boundary, without a separate document or fixup commit. Preserve actual approval chronology, recoverable old/new contents, hashes, versions and SHA mappings; never retroactively authorize earlier work. Rewrite only unpublished, unshared local linear history with clear ownership and no merges; stop on unknown publication, ownership, unexpected state or replay conflicts, without force push or a fallback document commit. Preserve implementation task boundaries and revalidate affected evidence. See planning, handoff-prep, commit and verification for the full contract.
288
- - [planning.planner-brief] Before formal drafting, Orchestrator supplies one complete stage-specific brief with original requirements and criteria IDs, approved/open decisions, verified target and ownership, document paths and preceding approved versions, current behavior and connected source/generated/runtime/installer/documentation surfaces, policy conflicts, depth, dependencies, checks, holds and exact deliverable. Preserve shared brief field order. Review the complete draft once and consolidate substantive feedback as changed fields with other fields marked unchanged. Preserve sequential design, spec and plan approvals; no fixed call cap or incomplete drafts, and no calls for already resolved questions. Include instruction provenance and input states, required skill/reference paths, bounded read alternatives and return conditions, approved visual sources/versions and criteria, and unresolved interpretation decisions before dependent drafting. Planner returns incomplete required inputs to Orchestrator; optional reading recovery never grants preparation, verification, writing or approval authority.
290
+ - [planning.planner-brief] Follow planning.md's Planner drafting preparation and consolidated feedback procedure, including preflight, ledger, evidence classification, target preparation, preceding approvals, provenance and reference gates. Send one complete stage-specific initial brief. Planner returns a complete proportional draft and self-review; Orchestrator reviews once with the fixed checklist and sends one consolidated correction using changed fields only. Additional Planner calls require user-approved material scope/evidence changes or concrete unmet checklist items after correction, plus meaningful new input or criterion-state progress; state changed input, target criterion, expected artifact and expected progress. Hold repeated unmet criteria without new input, evidence or progress and report the criterion, observed evidence and exact unblock input or decision. Do not split omissions, repeat resolved items, or count rewording or agent replacement as progress. Preserve separate sequential design/spec/plan approvals; no fixed call cap, Planner-profile call-count conditions or incomplete draft acceptance.
289
291
  - [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
290
292
  [ARC role policy: contract end]
291
293
 
@@ -102,7 +102,7 @@ Orchestrator accepts using verdicts, findings, rechecks, and remaining gaps, not
102
102
  disposition never turns unverified into proven. Low-risk work without QA likewise links each criterion to Orchestrator
103
103
  focused-check evidence.
104
104
 
105
- Read brief-cited `references/superpowers/test-driven-development/SKILL.md`; preserve ARC TDD exceptions.
105
+ Read brief-cited `references/test-driven-development.md`; preserve ARC TDD exceptions.
106
106
 
107
107
 
108
108
  ### Final plan Reviewer correction loop
@@ -123,8 +123,8 @@ report only checks actually performed, their actor, target state, results and re
123
123
  Once applicable authorization, document-depth, execution-target, and handoff conditions hold for the approved scope,
124
124
  continue through execution, correction, reverification, required QA and Reviewer, findings disposition, Orchestrator
125
125
  acceptance, and the result report. Apply risk-scaled timing above; this adds no per-task Reviewer or new QA obligation.
126
- A role completion report, probe findings, or passing commands are not overall completion when approved work remains.
127
- Remaining approved execution is not an optional suggestion waiting for a user response. A probe-only scope
126
+ Role reports, probe findings, or passing commands do not establish overall completion while approved work remains.
127
+ Do not present remaining approved execution as an optional suggestion awaiting a user response. A probe-only scope
128
128
  ends at its approved question's evidence and limits; a combined scope continues under planning's scope rules.
129
129
  Document omission changes neither verification risk nor acceptance responsibility. Hold only affected work for an
130
130
  actual unmet condition and report what is needed to resume. Structural evidence does not prove live agent compliance.
@@ -133,9 +133,9 @@ For Orchestrator, **Evidence verdict**: each criterion is proven, unmet, or unve
133
133
 
134
134
  ## Visual Evidence and Adjudication
135
135
 
136
- Each visual criterion requires the exact location, version, approval, and access state of the approved visual source; criterion IDs, properties, and comparison method; and evidence linking the actual output to its revision. An Implementer report does not replace fresh QA's direct comparison. Record results as pass, mismatch, or unverified and connect them to the existing proven/unmet/unverified criterion verdicts. Use pass only when accessible evidence meets the visual criterion. Keep unsupported claims unverified. Missing output-to-revision linkage is unverified; a visible difference is a mismatch. Treat these as separate observations and do not infer the current branch UI state. Hold the comparison if the approved source or actual output is inaccessible or interpretation approval is missing.
136
+ Each visual criterion requires the exact location, version, approval, and access state of the approved visual source; criterion IDs, properties, and comparison method; and evidence linking the actual output to its revision. An Implementer report does not replace fresh QA's direct comparison. Record results as pass, mismatch, or unverified and connect them to the existing proven/unmet/unverified criterion verdicts. Use pass only when accessible evidence meets the visual criterion; keep unsupported claims unverified. Missing output-to-revision linkage is unverified; a visible difference is a mismatch. Record these separately; do not infer the current branch UI state. Hold the comparison if the approved source or actual output is inaccessible or interpretation approval is missing.
137
137
 
138
- Static policy, generated-file, and manifest checks are structural evidence. They do not prove actual role behavior, an installed build, Claude Code CLI runtime compliance, or visual fidelity. Reports include actual changes and exclusion rationale, checks run and omitted, evidence and limits by criterion, and platform availability. Preserve existing baseline failures separately; progress on independent work does not relax required checks or acceptance criteria.
138
+ Static policy, generated-file, and manifest checks are structural evidence. They do not prove actual role behavior, an installed build, Claude Code CLI runtime compliance, or visual fidelity. Reports include actual changes, exclusion rationale, checks run and omitted, each criterion's evidence and limits, and platform availability. Keep baseline failures separate; progress on independent work does not relax required checks or acceptance criteria.
139
139
 
140
140
  ## Risk-scaled execution
141
141
 
@@ -205,7 +205,7 @@ This is an operator verdict record; it does not replace semantic proof of a crit
205
205
  Failures, unknown, mismatch and unverified outcomes are not passing evidence. Preserve previous results and failure records.
206
206
 
207
207
  A failed check/review leaves an open finding. Link a separate finding to an existing check/review through `record` with
208
- `data: {action: "open", id, checkId, message}`. After a Implementer fix, record
208
+ `data: {action: "open", id, checkId, message}`. After an Implementer fix, record
209
209
  `data: {action: "resolve", id, actor: {id, role: "implementer"}, changeFingerprint}` and the fix evidence messageRef.
210
210
  The actor must be the Implementer assigned to that task, or a relevant task for an overall finding. This marks the finding resolved;
211
211
  it becomes closed only when a subsequent prepare includes it in `findingIds` and revalidation passes for the same change version.
@@ -257,8 +257,8 @@ A changed runtimeHash follows the existing stale/hold rules; the stored version
257
257
  [ARC role policy: contract begin]
258
258
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
259
259
  - [git.orchestrator-accept-commit] Only Orchestrator accepts work and executes Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied; Orchestrator accepts then commits without additional user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership and verify the resulting SHA, included content, HEAD and remaining changes. Existing small-task direct and plan-omission paths are unchanged.
260
- - [review.significant-no-plan] For significant/high-risk work without a plan: Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
261
- - [review.significant-plan] For significant/high-risk plan work: each task uses Implementer → fresh QA as required → Orchestrator acceptance and focused commit. After all tasks are accepted and required QA is complete, Reviewer reviews the final full change once. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
260
+ - [review.significant-no-plan] For significant/high-risk work without a plan: Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer because no plan exists. This creates no new plan obligation.
261
+ - [review.significant-plan] For significant/high-risk plan work: each task uses Implementer → fresh QA as required → Orchestrator acceptance and focused commit. Reviewer reviews the final full change once after all tasks are accepted and required QA is complete. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
262
262
  - [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Implementer → Reviewer without QA reassignment; repeat until resolved. This exception applies only at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
263
263
  - [planning.plan-amend] During approved task execution, mechanical plan progress records need no new user approval; changed goals, scope, criteria, method, risk, dependencies or required verification require revised-version approval and preparation before affected work. In both cases Orchestrator amends the original planning-document commit at a safe boundary, without a separate document or fixup commit. Preserve actual approval chronology, recoverable old/new contents, hashes, versions and SHA mappings; never retroactively authorize earlier work. Rewrite only unpublished, unshared local linear history with clear ownership and no merges; stop on unknown publication, ownership, unexpected state or replay conflicts, without force push or a fallback document commit. Preserve implementation task boundaries and revalidate affected evidence. See planning, handoff-prep, commit and verification for the full contract.
264
264
  - [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
@@ -1,21 +1,299 @@
1
- # Visual companion
1
+ # Visual Companion Guide
2
2
 
3
- Use a visual when it materially helps design discussion or verification. Orchestrator determines the available
4
- capability and consent required by the actual tool. Planner returns visualization needs to Orchestrator because its
5
- tools are read-only file inspection; do not invent browser or shell access for it.
6
- Other depth 2 roles must stay within their exact allowlists and may not delegate visualization to another agent.
3
+ Browser-based visual brainstorming companion for showing mockups, diagrams, and options.
7
4
 
8
- Determine actual available browser and preview capabilities before use; do not assume the platform provides a preview tool.
9
- Use an available authorized local/browser workflow only when scoped by Orchestrator.
10
- Keep preview artifacts separate from user files, record generated side effects, preserve unrelated work,
11
- and report unavailable capabilities without claiming visual verification. MUST NOT expose secrets or publish a preview without authorization.
5
+ ## When to Use
12
6
 
13
- Upstream guide/scripts: `<installed ARC>/references/superpowers/brainstorming/visual-companion.md` and adjacent `scripts/`.
14
- ARC guide: `references/visual-companion.md`; Orchestrator briefs absolute paths and retains approval/server/browser
15
- ownership. Missing files stop dependent work. MUST NOT use a global fallback.
7
+ Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
16
8
 
17
- ## Follow-up Verification of Approved Visual Sources
9
+ **Use the browser** when the content itself is visual:
18
10
 
19
- Each visual criterion requires the exact location, version, approval, and access state of the approved visual source; criterion IDs, properties, and comparison method; and evidence linking the actual output to its revision. An Implementer report does not replace fresh QA's direct comparison. Record results as pass, mismatch, or unverified and connect them to the existing proven/unmet/unverified criterion verdicts. Use pass only when accessible evidence meets the visual criterion. Keep unsupported claims unverified. Missing output-to-revision linkage is unverified; a visible difference is a mismatch. Treat these as separate observations and do not infer the current branch UI state. Hold the comparison if the approved source or actual output is inaccessible or interpretation approval is missing.
11
+ - **UI mockups** — wireframes, layouts, navigation structures, component designs
12
+ - **Architecture diagrams** — system components, data flow, relationship maps
13
+ - **Side-by-side visual comparisons** — comparing two layouts, two color schemes, two design directions
14
+ - **Design polish** — when the question is about look and feel, spacing, visual hierarchy
15
+ - **Spatial relationships** — state machines, flowcharts, entity relationships rendered as diagrams
20
16
 
21
- Static policy, generated-file, and manifest checks are structural evidence. They do not prove actual role behavior, an installed build, Claude Code CLI runtime compliance, or visual fidelity. Reports include actual changes and exclusion rationale, checks run and omitted, evidence and limits by criterion, and platform availability. Preserve existing baseline failures separately; progress on independent work does not relax required checks or acceptance criteria.
17
+ **Use the terminal** when the content is text or tabular:
18
+
19
+ - **Requirements and scope questions** — "what does X mean?", "which features are in scope?"
20
+ - **Conceptual A/B/C choices** — picking between approaches described in words
21
+ - **Tradeoff lists** — pros/cons, comparison tables
22
+ - **Technical decisions** — API design, data modeling, architectural approach selection
23
+ - **Clarifying questions** — anything where the answer is words, not a visual preference
24
+
25
+ A question *about* a UI topic is not automatically a visual question. "What kind of wizard do you want?" is conceptual — use the terminal. "Which of these wizard layouts feels right?" is visual — use the browser.
26
+
27
+ ## How It Works
28
+
29
+ The server watches a directory for HTML files and serves the newest one to the browser. You write HTML content to `screen_dir`, the user sees it in their browser and can click to select options. Selections are recorded to `state_dir/events` that you read on your next turn.
30
+
31
+ **Content fragments vs full documents:** If your HTML file starts with `<!DOCTYPE` or `<html`, the server serves it as-is (just injects the helper script). Otherwise, the server automatically wraps your content in the frame template — adding the header, CSS theme, connection status, and all interactive infrastructure. **Write content fragments by default.** Only write full documents when you need complete control over the page.
32
+
33
+ ## Starting a Session
34
+
35
+ ```bash
36
+ # Start AFTER the user approves the companion. --open auto-opens their browser on
37
+ # the first screen; --project-dir persists mockups and enables same-port restart.
38
+ bash scripts/start-server.sh --project-dir /path/to/project --open
39
+
40
+ # Returns: {"type":"server-started","port":52341,
41
+ # "url":"http://localhost:52341/?key=ab12…",
42
+ # "screen_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/content",
43
+ # "state_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/state"}
44
+ ```
45
+
46
+ Save `screen_dir` and `state_dir` from the response. With `--open`, the browser opens itself when you push the first screen — you don't need to ask the user to open it, but still share the URL as a fallback (headless/remote setups won't auto-open).
47
+
48
+ **The URL contains a session key (`?key=…`).** The server rejects any request
49
+ without it, so always give the user the **complete** URL from the `url` field —
50
+ never strip the query string, and never hand out a bare `http://host:port`. The
51
+ key gates HTTP and WebSocket access so a stray browser tab or another machine on
52
+ the network can't read the screens or inject events. After the first load the
53
+ browser remembers the key via a cookie, so reloads and `/files/*` assets work
54
+ without repeating it.
55
+
56
+ **Finding connection info:** The server writes its startup JSON to `$STATE_DIR/server-info`. If you launched the server in the background and didn't capture stdout, read that file to get the URL and port. When using `--project-dir`, check `<project>/.superpowers/brainstorm/` for the session directory.
57
+
58
+ **Note:** Pass the project root as `--project-dir` so mockups persist in `.superpowers/brainstorm/` and survive server restarts. Without it, files go to `/tmp` and get cleaned up. Remind the user to add `.superpowers/` to `.gitignore` if it's not already there.
59
+
60
+ **Launching the server by platform:**
61
+
62
+ **Claude Code:**
63
+ ```bash
64
+ # Default mode works — the script backgrounds the server itself.
65
+ bash scripts/start-server.sh --project-dir /path/to/project --open
66
+ ```
67
+
68
+ On Windows, the script auto-detects and switches to foreground mode (which blocks the tool call). Use `run_in_background: true` on the Bash tool call so the server survives across conversation turns, then read `$STATE_DIR/server-info` on the next turn to get the URL and port.
69
+
70
+ **Codex:**
71
+ ```bash
72
+ # Codex reaps background processes. The script auto-detects CODEX_CI and
73
+ # switches to foreground mode. Run it normally — no extra flags needed.
74
+ bash scripts/start-server.sh --project-dir /path/to/project --open
75
+ ```
76
+
77
+ **Gemini CLI:**
78
+ ```bash
79
+ # Use --foreground and set is_background: true on your shell tool call
80
+ # so the process survives across turns
81
+ bash scripts/start-server.sh --project-dir /path/to/project --open --foreground
82
+ ```
83
+
84
+ **Copilot CLI:**
85
+ ```bash
86
+ # Start it with Copilot CLI's non-blocking/background shell mechanism so the
87
+ # server survives across turns. Keep --foreground so the harness, not the
88
+ # script, owns backgrounding. The launcher is a .sh, so invoke it via bash
89
+ # (on Windows, call Git Bash's bash.exe from the PowerShell tool).
90
+ bash scripts/start-server.sh --project-dir /path/to/project --open --foreground
91
+ ```
92
+
93
+ **Other environments:** The server must keep running in the background across conversation turns. If your environment reaps detached processes, use `--foreground` and launch the command with your platform's background execution mechanism.
94
+
95
+ If the URL is unreachable from your browser (common in remote/containerized setups), bind a non-loopback host:
96
+
97
+ ```bash
98
+ bash scripts/start-server.sh \
99
+ --project-dir /path/to/project \
100
+ --host 0.0.0.0 \
101
+ --url-host localhost
102
+ ```
103
+
104
+ Use `--url-host` to control what hostname is printed in the returned URL JSON.
105
+
106
+ ## The Loop
107
+
108
+ 1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
109
+ - **Required: confirm the server is alive before referring to the URL or pushing a screen.** Check that `$STATE_DIR/server-info` exists and `$STATE_DIR/server-stopped` does not. If it has shut down, restart it with `start-server.sh` using the **same `--project-dir`** — it reuses the same port, so the user's open tab reconnects on its own (it shows a "paused" overlay while the server is down) and you don't need to send a new URL. The server auto-exits after 4 hours idle (configurable with `--idle-timeout-minutes`).
110
+ - Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
111
+ - **Never reuse filenames** — each screen gets a fresh file
112
+ - Use your file-creation tool — **never use cat/heredoc** (dumps noise into terminal)
113
+ - Server automatically serves the newest file
114
+
115
+ 2. **Tell user what to expect and end your turn:**
116
+ - Remind them of the URL (every step, not just first)
117
+ - Give a brief text summary of what's on screen (e.g., "Showing 3 layout options for the homepage")
118
+ - Ask them to respond in the terminal: "Take a look and let me know what you think. Click to select an option if you'd like."
119
+
120
+ 3. **On your next turn** — after the user responds in the terminal:
121
+ - Read `$STATE_DIR/events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
122
+ - Merge with the user's terminal text to get the full picture
123
+ - The terminal message is the primary feedback; `state_dir/events` provides structured interaction data
124
+
125
+ 4. **Iterate or advance** — if feedback changes current screen, write a new file (e.g., `layout-v2.html`). Only move to the next question when the current step is validated.
126
+
127
+ 5. **Unload when returning to terminal** — when the next step doesn't need the browser (e.g., a clarifying question, a tradeoff discussion), push a waiting screen to clear the stale content:
128
+
129
+ ```html
130
+ <!-- filename: waiting.html (or waiting-2.html, etc.) -->
131
+ <div style="display:flex;align-items:center;justify-content:center;min-height:60vh">
132
+ <p class="subtitle">Continuing in terminal...</p>
133
+ </div>
134
+ ```
135
+
136
+ This prevents the user from staring at a resolved choice while the conversation has moved on. When the next visual question comes up, push a new content file as usual.
137
+
138
+ 6. Repeat until done.
139
+
140
+ ## Writing Content Fragments
141
+
142
+ Write just the content that goes inside the page. The server wraps it in the frame template automatically (header, theme CSS, connection status, and all interactive infrastructure).
143
+
144
+ **Minimal example:**
145
+
146
+ ```html
147
+ <h2>Which layout works better?</h2>
148
+ <p class="subtitle">Consider readability and visual hierarchy</p>
149
+
150
+ <div class="options">
151
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
152
+ <div class="letter">A</div>
153
+ <div class="content">
154
+ <h3>Single Column</h3>
155
+ <p>Clean, focused reading experience</p>
156
+ </div>
157
+ </div>
158
+ <div class="option" data-choice="b" onclick="toggleSelect(this)">
159
+ <div class="letter">B</div>
160
+ <div class="content">
161
+ <h3>Two Column</h3>
162
+ <p>Sidebar navigation with main content</p>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ ```
167
+
168
+ That's it. No `<html>`, no CSS, no `<script>` tags needed. The server provides all of that.
169
+
170
+ ## CSS Classes Available
171
+
172
+ The frame template provides these CSS classes for your content:
173
+
174
+ ### Options (A/B/C choices)
175
+
176
+ ```html
177
+ <div class="options">
178
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
179
+ <div class="letter">A</div>
180
+ <div class="content">
181
+ <h3>Title</h3>
182
+ <p>Description</p>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ ```
187
+
188
+ **Multi-select:** Add `data-multiselect` to the container to let users select multiple options. Each click toggles the item's selected styling.
189
+
190
+ ```html
191
+ <div class="options" data-multiselect>
192
+ <!-- same option markup — users can select/deselect multiple -->
193
+ </div>
194
+ ```
195
+
196
+ ### Cards (visual designs)
197
+
198
+ ```html
199
+ <div class="cards">
200
+ <div class="card" data-choice="design1" onclick="toggleSelect(this)">
201
+ <div class="card-image"><!-- mockup content --></div>
202
+ <div class="card-body">
203
+ <h3>Name</h3>
204
+ <p>Description</p>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ ```
209
+
210
+ ### Mockup container
211
+
212
+ ```html
213
+ <div class="mockup">
214
+ <div class="mockup-header">Preview: Dashboard Layout</div>
215
+ <div class="mockup-body"><!-- your mockup HTML --></div>
216
+ </div>
217
+ ```
218
+
219
+ ### Split view (side-by-side)
220
+
221
+ ```html
222
+ <div class="split">
223
+ <div class="mockup"><!-- left --></div>
224
+ <div class="mockup"><!-- right --></div>
225
+ </div>
226
+ ```
227
+
228
+ ### Pros/Cons
229
+
230
+ ```html
231
+ <div class="pros-cons">
232
+ <div class="pros"><h4>Pros</h4><ul><li>Benefit</li></ul></div>
233
+ <div class="cons"><h4>Cons</h4><ul><li>Drawback</li></ul></div>
234
+ </div>
235
+ ```
236
+
237
+ ### Mock elements (wireframe building blocks)
238
+
239
+ ```html
240
+ <div class="mock-nav">Logo | Home | About | Contact</div>
241
+ <div style="display: flex;">
242
+ <div class="mock-sidebar">Navigation</div>
243
+ <div class="mock-content">Main content area</div>
244
+ </div>
245
+ <button class="mock-button">Action Button</button>
246
+ <input class="mock-input" placeholder="Input field">
247
+ <div class="placeholder">Placeholder area</div>
248
+ ```
249
+
250
+ ### Typography and sections
251
+
252
+ - `h2` — page title
253
+ - `h3` — section heading
254
+ - `.subtitle` — secondary text below title
255
+ - `.section` — content block with bottom margin
256
+ - `.label` — small uppercase label text
257
+
258
+ ## Browser Events Format
259
+
260
+ When the user clicks options in the browser, their interactions are recorded to `$STATE_DIR/events` (one JSON object per line). The file is cleared automatically when you push a new screen.
261
+
262
+ ```jsonl
263
+ {"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
264
+ {"type":"click","choice":"c","text":"Option C - Complex Grid","timestamp":1706000108}
265
+ {"type":"click","choice":"b","text":"Option B - Hybrid","timestamp":1706000115}
266
+ ```
267
+
268
+ The full event stream shows the user's exploration path — they may click multiple options before settling. The last `choice` event is typically the final selection, but the pattern of clicks can reveal hesitation or preferences worth asking about.
269
+
270
+ If `$STATE_DIR/events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
271
+
272
+ ## Design Tips
273
+
274
+ - **Scale fidelity to the question** — wireframes for layout, polish for polish questions
275
+ - **Explain the question on each page** — "Which layout feels more professional?" not just "Pick one"
276
+ - **Iterate before advancing** — if feedback changes current screen, write a new version
277
+ - **2-4 options max** per screen
278
+ - **Use real content when it matters** — for a photography portfolio, use actual images (Unsplash). Placeholder content obscures design issues.
279
+ - **Keep mockups simple** — focus on layout and structure, not pixel-perfect design
280
+
281
+ ## File Naming
282
+
283
+ - Use semantic names: `platform.html`, `visual-style.html`, `layout.html`
284
+ - Never reuse filenames — each screen must be a new file
285
+ - For iterations: append version suffix like `layout-v2.html`, `layout-v3.html`
286
+ - Server serves newest file by modification time
287
+
288
+ ## Cleaning Up
289
+
290
+ ```bash
291
+ bash scripts/stop-server.sh $SESSION_DIR
292
+ ```
293
+
294
+ If the session used `--project-dir`, mockup files persist in `.superpowers/brainstorm/` for later reference. Only `/tmp` sessions get deleted on stop.
295
+
296
+ ## Reference
297
+
298
+ - Frame template (CSS reference): `scripts/frame-template.html`
299
+ - Helper script (client-side): `scripts/helper.js`