@arbiterforge/ca-pi 0.6.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 (206) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +558 -0
  3. package/package.json +35 -0
  4. package/plugins/ca-pi/CHANGELOG.md +1030 -0
  5. package/plugins/ca-pi/COMMANDS.md +90 -0
  6. package/plugins/ca-pi/ORCHESTRATOR.md +159 -0
  7. package/plugins/ca-pi/SKILLS.md +47 -0
  8. package/plugins/ca-pi/SPRINT.md +142 -0
  9. package/plugins/ca-pi/agents/INDEX.md +31 -0
  10. package/plugins/ca-pi/agents/architecture-drift-reviewer.md +86 -0
  11. package/plugins/ca-pi/agents/auth-crypto-reviewer.md +60 -0
  12. package/plugins/ca-pi/agents/backend-author.md +60 -0
  13. package/plugins/ca-pi/agents/checkpoint-aggregator.md +111 -0
  14. package/plugins/ca-pi/agents/coverage-auditor.md +71 -0
  15. package/plugins/ca-pi/agents/decision-challenger.md +116 -0
  16. package/plugins/ca-pi/agents/dependency-reviewer.md +79 -0
  17. package/plugins/ca-pi/agents/design-quality-reviewer.md +80 -0
  18. package/plugins/ca-pi/agents/finding-triage.md +86 -0
  19. package/plugins/ca-pi/agents/frontend-author.md +64 -0
  20. package/plugins/ca-pi/agents/grader.md +173 -0
  21. package/plugins/ca-pi/agents/infra-author.md +64 -0
  22. package/plugins/ca-pi/agents/map-deps.md +35 -0
  23. package/plugins/ca-pi/agents/map-structure.md +37 -0
  24. package/plugins/ca-pi/agents/migration-reviewer.md +65 -0
  25. package/plugins/ca-pi/agents/scout.md +127 -0
  26. package/plugins/ca-pi/agents/security-reviewer.md +72 -0
  27. package/plugins/ca-pi/agents/tribunal-lens-reviewer.md +65 -0
  28. package/plugins/ca-pi/extensions/codearbiter-child.js +1885 -0
  29. package/plugins/ca-pi/extensions/codearbiter.js +9802 -0
  30. package/plugins/ca-pi/generated/command-catalog.json +197 -0
  31. package/plugins/ca-pi/generated/roles.json +213 -0
  32. package/plugins/ca-pi/helpers/windows-supervisor.js +205 -0
  33. package/plugins/ca-pi/hooks/_activationlib.py +196 -0
  34. package/plugins/ca-pi/hooks/_arbiterstatelib.py +208 -0
  35. package/plugins/ca-pi/hooks/_babysitlib.py +76 -0
  36. package/plugins/ca-pi/hooks/_bashguardlib.py +1667 -0
  37. package/plugins/ca-pi/hooks/_boxlib.py +131 -0
  38. package/plugins/ca-pi/hooks/_colorlib.py +304 -0
  39. package/plugins/ca-pi/hooks/_durabilitylib.py +186 -0
  40. package/plugins/ca-pi/hooks/_entrylib.py +41 -0
  41. package/plugins/ca-pi/hooks/_fmtlib.py +161 -0
  42. package/plugins/ca-pi/hooks/_gitexec.py +45 -0
  43. package/plugins/ca-pi/hooks/_githooks.py +920 -0
  44. package/plugins/ca-pi/hooks/_gitlib.py +110 -0
  45. package/plugins/ca-pi/hooks/_hooklib.py +595 -0
  46. package/plugins/ca-pi/hooks/_host.py +115 -0
  47. package/plugins/ca-pi/hooks/_intentlib.py +242 -0
  48. package/plugins/ca-pi/hooks/_ledgerlib.py +1035 -0
  49. package/plugins/ca-pi/hooks/_metricslib.py +709 -0
  50. package/plugins/ca-pi/hooks/_pathnorm.py +74 -0
  51. package/plugins/ca-pi/hooks/_planfilelib.py +664 -0
  52. package/plugins/ca-pi/hooks/_previewlib.py +193 -0
  53. package/plugins/ca-pi/hooks/_protectedlib.py +312 -0
  54. package/plugins/ca-pi/hooks/_protectedstatelib.py +411 -0
  55. package/plugins/ca-pi/hooks/_provenancelib.py +971 -0
  56. package/plugins/ca-pi/hooks/_prunelib.py +1398 -0
  57. package/plugins/ca-pi/hooks/_prunepolicy.py +235 -0
  58. package/plugins/ca-pi/hooks/_readinjectlib.py +1080 -0
  59. package/plugins/ca-pi/hooks/_releaselib.py +2657 -0
  60. package/plugins/ca-pi/hooks/_scopelib.py +262 -0
  61. package/plugins/ca-pi/hooks/_segmentslib.py +278 -0
  62. package/plugins/ca-pi/hooks/_sensitivelib.py +270 -0
  63. package/plugins/ca-pi/hooks/_sessionlib.py +78 -0
  64. package/plugins/ca-pi/hooks/_sloplib.py +244 -0
  65. package/plugins/ca-pi/hooks/_standuplib.py +214 -0
  66. package/plugins/ca-pi/hooks/_subagentslib.py +219 -0
  67. package/plugins/ca-pi/hooks/_taskboardlib.py +1088 -0
  68. package/plugins/ca-pi/hooks/_updatelib.py +278 -0
  69. package/plugins/ca-pi/hooks/babysit.py +47 -0
  70. package/plugins/ca-pi/hooks/boardsync.py +129 -0
  71. package/plugins/ca-pi/hooks/doctor.py +420 -0
  72. package/plugins/ca-pi/hooks/git-enforce.py +325 -0
  73. package/plugins/ca-pi/hooks/hostapi.py +460 -0
  74. package/plugins/ca-pi/hooks/init-codearbiter.py +225 -0
  75. package/plugins/ca-pi/hooks/metrics.py +62 -0
  76. package/plugins/ca-pi/hooks/migration-pass.py +129 -0
  77. package/plugins/ca-pi/hooks/pi-bridge.py +543 -0
  78. package/plugins/ca-pi/hooks/post-write-edit.py +231 -0
  79. package/plugins/ca-pi/hooks/pre-bash.py +90 -0
  80. package/plugins/ca-pi/hooks/pre-edit.py +284 -0
  81. package/plugins/ca-pi/hooks/pre-read.py +81 -0
  82. package/plugins/ca-pi/hooks/pre-write.py +217 -0
  83. package/plugins/ca-pi/hooks/preview.py +69 -0
  84. package/plugins/ca-pi/hooks/prune-transcript.py +232 -0
  85. package/plugins/ca-pi/hooks/releasehash.py +216 -0
  86. package/plugins/ca-pi/hooks/security-pass.py +139 -0
  87. package/plugins/ca-pi/hooks/session-start.py +1218 -0
  88. package/plugins/ca-pi/hooks/statusline.py +736 -0
  89. package/plugins/ca-pi/hooks/taskwrite.py +351 -0
  90. package/plugins/ca-pi/hooks/update-refresh.py +51 -0
  91. package/plugins/ca-pi/hooks/wire-statusline.py +435 -0
  92. package/plugins/ca-pi/includes/anti-slop-design/INDEX.md +55 -0
  93. package/plugins/ca-pi/includes/anti-slop-design/color.md +43 -0
  94. package/plugins/ca-pi/includes/anti-slop-design/core.md +244 -0
  95. package/plugins/ca-pi/includes/anti-slop-design/images.md +32 -0
  96. package/plugins/ca-pi/includes/anti-slop-design/layout.md +45 -0
  97. package/plugins/ca-pi/includes/anti-slop-design/medium-cli.md +39 -0
  98. package/plugins/ca-pi/includes/anti-slop-design/medium-dataviz.md +43 -0
  99. package/plugins/ca-pi/includes/anti-slop-design/medium-diagram.md +35 -0
  100. package/plugins/ca-pi/includes/anti-slop-design/medium-documents.md +70 -0
  101. package/plugins/ca-pi/includes/anti-slop-design/medium-slides.md +30 -0
  102. package/plugins/ca-pi/includes/anti-slop-design/medium-web.md +39 -0
  103. package/plugins/ca-pi/includes/anti-slop-design/typography.md +51 -0
  104. package/plugins/ca-pi/includes/author-tdd-workflow.md +14 -0
  105. package/plugins/ca-pi/includes/compaction-charter.md +16 -0
  106. package/plugins/ca-pi/includes/cut-docs.md +16 -0
  107. package/plugins/ca-pi/includes/dev-mode.md +30 -0
  108. package/plugins/ca-pi/includes/farm.md +237 -0
  109. package/plugins/ca-pi/includes/fresh-verification.md +14 -0
  110. package/plugins/ca-pi/includes/harvest.md +69 -0
  111. package/plugins/ca-pi/includes/maturity-coverage.md +102 -0
  112. package/plugins/ca-pi/includes/pi-host-notes.md +69 -0
  113. package/plugins/ca-pi/includes/redirect.md +69 -0
  114. package/plugins/ca-pi/includes/reference-map.md +22 -0
  115. package/plugins/ca-pi/includes/review-matrix.md +14 -0
  116. package/plugins/ca-pi/includes/reviewer-contract.md +53 -0
  117. package/plugins/ca-pi/includes/routing-table.md +47 -0
  118. package/plugins/ca-pi/includes/security-gate-record.md +22 -0
  119. package/plugins/ca-pi/includes/smarts/core.md +90 -0
  120. package/plugins/ca-pi/includes/smarts/decision-log-format.md +56 -0
  121. package/plugins/ca-pi/routines/INDEX.md +32 -0
  122. package/plugins/ca-pi/routines/brainstorming/SKILL.md +122 -0
  123. package/plugins/ca-pi/routines/commit-gate/SKILL.md +151 -0
  124. package/plugins/ca-pi/routines/context-check/SKILL.md +85 -0
  125. package/plugins/ca-pi/routines/context-creation/SKILL.md +171 -0
  126. package/plugins/ca-pi/routines/crypto-compliance/SKILL.md +41 -0
  127. package/plugins/ca-pi/routines/debug/SKILL.md +99 -0
  128. package/plugins/ca-pi/routines/decision-lifecycle/SKILL.md +104 -0
  129. package/plugins/ca-pi/routines/decision-lifecycle/references/adr-template.md +74 -0
  130. package/plugins/ca-pi/routines/decision-variance/SKILL.md +147 -0
  131. package/plugins/ca-pi/routines/decompose/SKILL.md +168 -0
  132. package/plugins/ca-pi/routines/dispatching-parallel-agents/SKILL.md +76 -0
  133. package/plugins/ca-pi/routines/executing-plans/SKILL.md +83 -0
  134. package/plugins/ca-pi/routines/finishing-a-development-branch/SKILL.md +91 -0
  135. package/plugins/ca-pi/routines/post-merge-cleanup/SKILL.md +233 -0
  136. package/plugins/ca-pi/routines/refactor/SKILL.md +91 -0
  137. package/plugins/ca-pi/routines/release/SKILL.md +315 -0
  138. package/plugins/ca-pi/routines/secret-handling/SKILL.md +67 -0
  139. package/plugins/ca-pi/routines/security-architecture/SKILL.md +63 -0
  140. package/plugins/ca-pi/routines/skill-author/SKILL.md +108 -0
  141. package/plugins/ca-pi/routines/skill-author/references/skill-template.md +58 -0
  142. package/plugins/ca-pi/routines/subagent-driven-development/SKILL.md +149 -0
  143. package/plugins/ca-pi/routines/subagent-driven-development/references/farm-dispatch.md +145 -0
  144. package/plugins/ca-pi/routines/tdd/SKILL.md +139 -0
  145. package/plugins/ca-pi/routines/tribunal/SKILL.md +109 -0
  146. package/plugins/ca-pi/routines/tribunal/references/ai-markers.md +29 -0
  147. package/plugins/ca-pi/routines/tribunal/references/cost-and-models.md +64 -0
  148. package/plugins/ca-pi/routines/tribunal/references/finding-record.md +27 -0
  149. package/plugins/ca-pi/routines/tribunal/references/issue-filing.md +47 -0
  150. package/plugins/ca-pi/routines/tribunal/references/lenses/appsec.md +22 -0
  151. package/plugins/ca-pi/routines/tribunal/references/lenses/architecture.md +23 -0
  152. package/plugins/ca-pi/routines/tribunal/references/lenses/coverage.md +20 -0
  153. package/plugins/ca-pi/routines/tribunal/references/lenses/infra.md +24 -0
  154. package/plugins/ca-pi/routines/tribunal/references/lenses/migration.md +22 -0
  155. package/plugins/ca-pi/routines/tribunal/references/lenses/observability.md +21 -0
  156. package/plugins/ca-pi/routines/tribunal/references/lenses/performance.md +22 -0
  157. package/plugins/ca-pi/routines/tribunal/references/lenses/reliability.md +23 -0
  158. package/plugins/ca-pi/routines/tribunal/references/lenses/secrets-supply.md +22 -0
  159. package/plugins/ca-pi/routines/tribunal/references/lenses/test-fidelity.md +24 -0
  160. package/plugins/ca-pi/routines/tribunal/references/lenses/typesafety.md +21 -0
  161. package/plugins/ca-pi/routines/tribunal/references/report.md +19 -0
  162. package/plugins/ca-pi/routines/tribunal/references/schemas.md +58 -0
  163. package/plugins/ca-pi/routines/tribunal/references/telemetry.md +28 -0
  164. package/plugins/ca-pi/routines/tribunal/references/triage.md +53 -0
  165. package/plugins/ca-pi/routines/using-git-worktrees/SKILL.md +85 -0
  166. package/plugins/ca-pi/routines/writing-plans/SKILL.md +129 -0
  167. package/plugins/ca-pi/routines/writing-plans/references/farm-plan.md +50 -0
  168. package/plugins/ca-pi/skills/ca-add-dep/SKILL.md +88 -0
  169. package/plugins/ca-pi/skills/ca-adr/SKILL.md +30 -0
  170. package/plugins/ca-pi/skills/ca-adr-status/SKILL.md +30 -0
  171. package/plugins/ca-pi/skills/ca-arbiter/SKILL.md +36 -0
  172. package/plugins/ca-pi/skills/ca-audit/SKILL.md +51 -0
  173. package/plugins/ca-pi/skills/ca-btw/SKILL.md +23 -0
  174. package/plugins/ca-pi/skills/ca-checkpoint/SKILL.md +50 -0
  175. package/plugins/ca-pi/skills/ca-chore/SKILL.md +58 -0
  176. package/plugins/ca-pi/skills/ca-cleanup/SKILL.md +55 -0
  177. package/plugins/ca-pi/skills/ca-commands/SKILL.md +21 -0
  178. package/plugins/ca-pi/skills/ca-commit/SKILL.md +27 -0
  179. package/plugins/ca-pi/skills/ca-conflict/SKILL.md +61 -0
  180. package/plugins/ca-pi/skills/ca-context-check/SKILL.md +32 -0
  181. package/plugins/ca-pi/skills/ca-create-context/SKILL.md +32 -0
  182. package/plugins/ca-pi/skills/ca-debug/SKILL.md +42 -0
  183. package/plugins/ca-pi/skills/ca-decompose/SKILL.md +30 -0
  184. package/plugins/ca-pi/skills/ca-dev/SKILL.md +42 -0
  185. package/plugins/ca-pi/skills/ca-doctor/SKILL.md +44 -0
  186. package/plugins/ca-pi/skills/ca-feature/SKILL.md +105 -0
  187. package/plugins/ca-pi/skills/ca-fix/SKILL.md +42 -0
  188. package/plugins/ca-pi/skills/ca-init/SKILL.md +56 -0
  189. package/plugins/ca-pi/skills/ca-metrics/SKILL.md +80 -0
  190. package/plugins/ca-pi/skills/ca-new-skill/SKILL.md +34 -0
  191. package/plugins/ca-pi/skills/ca-override/SKILL.md +72 -0
  192. package/plugins/ca-pi/skills/ca-pr/SKILL.md +61 -0
  193. package/plugins/ca-pi/skills/ca-preview/SKILL.md +86 -0
  194. package/plugins/ca-pi/skills/ca-prune/SKILL.md +100 -0
  195. package/plugins/ca-pi/skills/ca-reconcile/SKILL.md +43 -0
  196. package/plugins/ca-pi/skills/ca-refactor/SKILL.md +43 -0
  197. package/plugins/ca-pi/skills/ca-release/SKILL.md +57 -0
  198. package/plugins/ca-pi/skills/ca-review/SKILL.md +63 -0
  199. package/plugins/ca-pi/skills/ca-spike/SKILL.md +41 -0
  200. package/plugins/ca-pi/skills/ca-sprint/SKILL.md +44 -0
  201. package/plugins/ca-pi/skills/ca-standup/SKILL.md +112 -0
  202. package/plugins/ca-pi/skills/ca-status/SKILL.md +56 -0
  203. package/plugins/ca-pi/skills/ca-task/SKILL.md +61 -0
  204. package/plugins/ca-pi/skills/ca-threat-model/SKILL.md +45 -0
  205. package/plugins/ca-pi/skills/ca-tribunal/SKILL.md +44 -0
  206. package/plugins/ca-pi/skills/ca-watch/SKILL.md +78 -0
@@ -0,0 +1,22 @@
1
+ # Reference map
2
+
3
+ Loaded on a scope-touch: before acting on code in one of these rows, read the governing doc first,
4
+ then route to the owning skill or agent. This map answers *what to read before touching a scope*; for
5
+ *what to invoke or route given a trigger*, use `routing-table.md`. "Read first" paths are under
6
+ `<project-root>/.codearbiter/` unless the row gives a `<plugin-root>/` path.
7
+
8
+ | If the change touches… | Read first | Route to |
9
+ |---|---|---|
10
+ | Any code change | `coding-standards.md` | `tdd` skill |
11
+ | Stack / dependencies | `tech-stack.md`, `security-controls.md` | `dependency-reviewer` agent |
12
+ | Auth, crypto, secrets | `security-controls.md` | `crypto-compliance` / `secret-handling` skill (`<plugin-root>/routines/<name>/SKILL.md`); `auth-crypto-reviewer` agent |
13
+ | Data model / migrations | `tech-stack.md` | `migration-reviewer` agent |
14
+ | Networking / deployment / attack surface | `security-controls.md` | `security-reviewer` agent (H-16 advisory); `security-architecture` skill (`/threat-model`, optional) |
15
+ | New domain concept or component | `CONTEXT.md` | update the vocabulary in `CONTEXT.md` |
16
+ | Failure / retry, CI/CD, branch settings | `tech-stack.md`, `security-controls.md` | `security-reviewer` agent (CI/CD: H-15 advisory) |
17
+ | Risks / ADRs | `open-questions.md`, `decisions/` | `decision-lifecycle` skill (`/adr`) |
18
+ | Architectural reconciliation | `plans/` (the three artifacts), `decisions/decision-log.md` | `decision-variance` skill (`/reconcile`) |
19
+ | Out-of-scope finding | — | inline `[NEEDS-TRIAGE]` marker (never an ADR); promoted to `open-tasks.md` by the harvest at the workflow's terminal step |
20
+ | Following up on workflow residue / a backlog task | `open-tasks.md` (schema), `<plugin-root>/includes/harvest.md` | `/ca-task` writer; harvest (`extract_*` → `promote`) at a terminal step |
21
+ | Generating a user-facing deliverable (UI, report, PR/CHANGELOG prose, slide, chart) | `<plugin-root>/includes/anti-slop-design/INDEX.md` (then `core` + the medium leaf) | `design-quality-reviewer` agent |
22
+ | Provenance drift surfaced outside a commit (merge, external edit, SessionStart drift line) | `.codearbiter/.provenance/` + `.codearbiter/code-map.md` | `context-check` skill (`/ca-context-check`) |
@@ -0,0 +1,14 @@
1
+ # Reviewer-to-path matrix
2
+
3
+ The single source of truth for which reviewer is dispatched when the scope touches a given path.
4
+ Cited by `review.md`, `pr.md`, `checkpoint.md`, and `preview.md`: edit the matrix here, not in those
5
+ commands. Each matched reviewer is one read-only unit.
6
+
7
+ | Reviewer | Dispatched when scope touches |
8
+ |---|---|
9
+ | `security-reviewer` | auth, middleware, secrets, deploy/CI, any security-sensitive path |
10
+ | `auth-crypto-reviewer` | authn, crypto, key handling, secrets |
11
+ | `dependency-reviewer` | `package.json`, lockfiles, base images, dependency manifests |
12
+ | `migration-reviewer` | DB migration file add/modify |
13
+ | `coverage-auditor` | any source change (test coverage vs. obligations) |
14
+ | `architecture-drift-reviewer` | code that may diverge from accepted ADRs in `.codearbiter/decisions/` |
@@ -0,0 +1,53 @@
1
+ # Reviewer contract — findings format, output template, out-of-scope rule
2
+
3
+ Canonical for every gate reviewer agent (`security-reviewer`, `auth-crypto-reviewer`,
4
+ `dependency-reviewer`, `migration-reviewer`, `coverage-auditor`). Loaded via each agent's
5
+ Required Reading; the agent bodies do not restate these blocks. An agent body MAY narrow the
6
+ subject field or add fields and heading qualifiers — additions extend this contract, never
7
+ replace it.
8
+
9
+ ## Findings format
10
+
11
+ ```
12
+ **Severity:** CRITICAL | HIGH | MEDIUM | LOW
13
+ **File:** <path>:<line>
14
+ **Description:** <specific problem — no vague claims>
15
+ **Remediation:** <concrete fix>
16
+ ```
17
+
18
+ Agent-specific deltas declared in the agent body (examples): `security-reviewer` and
19
+ `auth-crypto-reviewer` add a `**Control:**` line citing
20
+ `<project-root>/.codearbiter/security-controls.md`; `dependency-reviewer` uses
21
+ `**Package:** <name@version>` as the subject field; `coverage-auditor` uses
22
+ `**File:** <source path> / <test path, if exists>`.
23
+
24
+ ## Review output template
25
+
26
+ ```
27
+ ## <Role> Review — <date>
28
+
29
+ ### CRITICAL findings (N)
30
+ [findings or "none"]
31
+
32
+ ### HIGH findings (N)
33
+ [findings or "none"]
34
+
35
+ ### MEDIUM findings (N)
36
+ [findings or "none"]
37
+
38
+ ### LOW findings (N)
39
+ [findings or "none"]
40
+
41
+ ### Gate status
42
+ PASS (no CRITICAL or HIGH) | BLOCK (N CRITICAL, N HIGH must resolve before merge)
43
+ ```
44
+
45
+ `<Role>` is the reviewer's own review name (Security, Auth/Crypto, Dependency, Migration,
46
+ Coverage); an agent body may qualify the heading (e.g. the dependency review includes
47
+ `<package@version>`).
48
+
49
+ ## Out-of-scope findings
50
+
51
+ **Out-of-scope finding:** do not act on it and do not author an ADR for it (ADRs are
52
+ user-attributed, via `/adr` only). Mark it inline with a `[NEEDS-TRIAGE]` marker; never
53
+ silently drop it.
@@ -0,0 +1,47 @@
1
+ # Routing table
2
+
3
+ Loaded on a scope-touch or `/command`, not every turn. This table is the authoritative trigger→route
4
+ surface: it answers *what to invoke or route given a trigger*; for *what doc to read before touching a
5
+ scope*, use `reference-map.md`. Follow the primary route; the gate is a hard stop, not a suggestion. A
6
+ command is **invoked**; the orchestrator **routes** to a skill; a skill **dispatches** an agent.
7
+ Routing to a skill means loading its body from `<plugin-root>/routines/<name>/SKILL.md` — a route
8
+ cell names the skill; this path convention locates it. That resolution never depends on the host's
9
+ skill registry: a chain-internal skill hidden from the registry (`disable-model-invocation`) is
10
+ reached the same way.
11
+
12
+ | Invocation cue | Primary route | Also dispatch | Hard gate |
13
+ |---|---|---|---|
14
+ | New feature | `/feature` Step 0 triage → full lane `brainstorming` → `writing-plans` → `executing-plans` → `tdd`, or logged small lane straight to `tdd` | `backend-`/`frontend-`/`infra-author` | No spec, no code; no code before `tdd` Phase 1; small lane only on all triage criteria, logged to `triage.log` |
15
+ | Autonomous sprint | `/sprint` → `SPRINT.md` (brainstorm → plan → `subagent-driven-development`) | per-task impl authors + reviewers | One interactive spec gate; hard gates never auto-decided; every auto-decision logged |
16
+ | Bug fix | `/fix` → `tdd` (bug variant) | impl author | Failing regression test before any fix code |
17
+ | Docs edit / dep bump / revert | `/chore` (type-scaled gates) | `dependency-reviewer` for deps | No behavioral code; suite green for deps/revert; exits via `commit-gate` |
18
+ | Exploratory throwaway spike | `/spike` (self-contained command) → `spike/<slug>` branch | — | Never merges or PRs; `commit-gate`-exempt (nothing on the branch can land); exits to a findings note or `/feature` |
19
+ | Behavior-preserving restructure | `/refactor` → `refactor` skill | `tdd` Phase 1 (new seams only) | No refactor without parity-coverage proof |
20
+ | Unknown defect / investigation | `/debug` → `debug` skill | — | No code change in the skill; one named exit |
21
+ | Commit | `/commit` → `commit-gate` | — | No commit without all nine gates green |
22
+ | Open a PR / finish a branch | `/pr` → `finishing-a-development-branch` | reviewer fleet per path; PR-body prose applies `anti-slop-design` (`core` + `medium-documents` §7.A.1) | PR only; no direct-to-default, no force-push |
23
+ | Watch a PR's CI / babysit checks | `/watch` → detached `gh pr checks --watch` | on-red diagnose (propose\|branch) | Never auto-merges; green → notify + offer; merge-to-default routes through the hard gate; no poll loop |
24
+ | Code review of the diff | `/review` → `dispatching-parallel-agents` | reviewer fleet → `finding-triage` → `checkpoint-aggregator` | BLOCK on any CRITICAL/HIGH |
25
+ | Periodic sweep | `/checkpoint` → `dispatching-parallel-agents` | reviewer fleet → triage → aggregator | Surfaces a triaged report; not a promotion gate |
26
+ | Governance record for a window | `/audit` | — | Read-only; never overwrites a packet; audit lines quoted verbatim |
27
+ | Release / version tag | `/release` → `release` skill | `commit-gate` (release commit); CHANGELOG prose applies `anti-slop-design` (`core` §3.A/§3.B) | No tag on a red suite; tag not pushed unbidden |
28
+ | Code uses crypto / hashing / signing / TLS / random | `crypto-compliance` skill | `auth-crypto-reviewer` | BLOCK on any banned primitive |
29
+ | Code reads / writes / passes a secret | `secret-handling` skill | `auth-crypto-reviewer` | BLOCK on a secret outside the approved store |
30
+ | Auth / crypto / key change | `auth-crypto-reviewer` | `security-reviewer` | BLOCK on banned primitive, exposed secret, shell injection |
31
+ | Migration file added or changed | `migration-reviewer` | — | BLOCK on missing classification or irreversible destructive op |
32
+ | `package.json` / lockfile / base image changed | `/add-dep` → `dependency-reviewer` | — | BLOCK on denied license or supply-chain concern |
33
+ | Run a pinned third-party tool ONCE, adopting nothing (`npx jscpd@4.0.5 .`) | `/ca-add-dep` → its *Ephemeral tool run* section (no `dependency-reviewer` dispatch) | — | Exact pinned version + approved registry + one confirmation; MUST NOT touch a manifest or lockfile, verified after the run, or it is adoption and takes the full review |
34
+ | Sensitive feature / attack-surface change | `/threat-model` → `security-architecture` (optional) | `security-reviewer`, `auth-crypto-reviewer` | STOP only on a critical unmitigated threat |
35
+ | Arbitration / variance / ADR reconciliation | `/reconcile` → `decision-variance` | `scout`, `grader`, `decision-challenger` | No decision recorded without user attribution |
36
+ | New / aged ADR, unresolved `[CONFIRM-NN]` | `/adr`, `/adr-status` → `decision-lifecycle` | `decision-challenger` (optional) | No `[CONFIRM-NN]` resolved by guessing |
37
+ | Rule conflict (persona vs docs vs code) | `/conflict` | — | STOP all other work immediately |
38
+ | Unsure `/reconcile` vs `/conflict`? | rules contradict and work cannot safely continue → `/conflict`; artifacts drifted, work continues → `/reconcile` | — | When genuinely ambiguous, `/conflict` wins — stopping is recoverable, drifting past a rule conflict is not |
39
+ | New skill needed | `/new-skill` → `skill-author` | — | No skill until the gap is proven uncovered |
40
+ | Subagent raises an out-of-scope finding | inline `[NEEDS-TRIAGE]` marker | — | Never an ADR disposition; never silently dropped |
41
+ | Sitting down to code / repo hygiene cleanup | `/ca-standup` → orchestrator git actions | — | ff-only pull on a clean tree; each branch/worktree delete confirmed individually; stash/dirty/un-pushed report-only; never touch the default branch |
42
+ | Finish an already-merged branch (post-merge cleanup) | `/ca-cleanup` → `post-merge-cleanup` | — | Ancestry of the FETCHED default proven before any delete; unique/unclassifiable artifacts never discarded without a per-item confirmation; `--ff-only` and `branch -d` only; remote branch untouched; never routes to `/ca-override` |
43
+ | Add / start / done a backlog task | `/ca-task` → `hooks/taskwrite.py` (the pure `_taskboardlib` transforms) | — | Board written only through the writer; `start` always stamps a date; `done` requires in-progress; never delete to complete |
44
+ | Promote a workflow's un-actioned follow-ups | `includes/harvest.md` (run at a terminal step) → `/ca-task` (work) / `open-questions.md` (decision) | — | Batch-confirm interactive; SMARTS-logged auto under `/sprint`; dedup by `(from <origin>)`; a blocking decision escalates, never demoted |
45
+ | Zero-onboarding dry-run of the reviewer fleet | `/ca-preview` (no skill; reuses `includes/review-matrix.md` to predict reviewers) | — | Read-only; writes nothing, stages nothing, `git status` unchanged; no `/ca-init` or `.codearbiter/` required; empty diff exits clean |
46
+ | Manual drift audit of provenance-tracked docs (bypass / merge / external edit case) | `/ca-context-check` → `context-check` skill | — | Read-only unless user selects re-scout or re-baseline; MUST NOT commit on its own; not the daily loop — commit-gate auto-heal is the routine path |
47
+ | Deep on-demand codebase audit | `/ca-tribunal` → `tribunal` skill | `tribunal-lens-reviewer` per active lens (+ optional `map-structure`/`map-deps` on large repos) | Read-only until the filing gate; runs only after the user acknowledges the token estimate; never blocks a merge/commit; nothing filed or sent without explicit authorization |
@@ -0,0 +1,22 @@
1
+ # Recording the security-gate pass
2
+
3
+ The shared mechanism by which `crypto-compliance` and `secret-handling` unblock a commit. Referenced
4
+ by both skills' "On pass" step; the only difference between them is which commit hook the marker
5
+ satisfies (H-09b for crypto/TLS, H-10b for secrets).
6
+
7
+ **On a genuine PASS only**, resolve the interpreter once by presence — `PY=python3; { command -v python3 >/dev/null 2>&1 && python3 --version >/dev/null 2>&1; } || PY=python`
8
+ — never `python3 X || python X`, which reruns X on any nonzero exit and reports the second run's
9
+ code instead of the first's (#577) — then run:
10
+
11
+ ```bash
12
+ "$PY" "<plugin-root>/hooks/security-pass.py"
13
+ ```
14
+
15
+ It writes `<project-root>/.codearbiter/.markers/security-gate-passed` containing a digest of
16
+ every sensitive added line it approved. The PreToolUse commit hook (**H-09b** for crypto/TLS, **H-10b**
17
+ for secrets) blocks any commit whose staged diff touches a guarded pattern until this marker is fresh
18
+ (< 30 min) AND covers every sensitive line being committed — a pass recorded for one diff cannot
19
+ launder a later, different change through the freshness window.
20
+
21
+ On any BLOCK, do **not** record the pass — the commit stays blocked until the finding is resolved and
22
+ the gate genuinely passes. A premature or unconditional recording defeats the gate.
@@ -0,0 +1,90 @@
1
+ # SMARTS — lenses, cell rules, strength
2
+
3
+ The standardized evaluation for architectural variances. Apply the six lenses evenhandedly to every
4
+ option. This is the project's framework; do not substitute another. This `core` file is everything the
5
+ scoring path needs (decision-variance, the grader, the decision-challenger, and `/sprint` autonomous
6
+ scoring). The append-only **decision-log entry format** lives separately in
7
+ [`decision-log-format.md`](decision-log-format.md) — load it only when writing a log line.
8
+
9
+ ## Step 0 — recorded-intent check (before any lens is scored; ADR-0025)
10
+
11
+ *Applies to `/sprint` autonomous scoring and `brainstorming` (spec shaping) ONLY. Exempt by name:
12
+ `decision-variance`, the `grader`, and the `decision-challenger` — on arbitration surfaces the
13
+ variance IS the recorded-intent check, and the decision-variance Phase 4 authority order, not this
14
+ step, ranks the record.*
15
+
16
+ Before scoring, check whether the project's record already answers or constrains the decision.
17
+ Sources, ranked by the Phase 4 authority order: an explicit user decision this session (including
18
+ the approved sprint spec) > a recorded, unsuperseded `decision-log.md` entry > an accepted ADR >
19
+ the three `plans/` artifacts; `CONTEXT.md` and `open-questions.md` (including its
20
+ Deferred-decisions sections) constrain at their recorded level. Load index-first: consult the ADR
21
+ index (`decision-log.md` or the `decisions/` filename listing) and plan section headings only;
22
+ load a body only after the index names it relevant; never bulk-read `plans/` or `decisions/`
23
+ (ORCHESTRATOR §3's no-bulk-reads rule).
24
+
25
+ Three outcomes:
26
+
27
+ - **Answered** — a source already decides it. Conform to the highest-ranked source and cite it.
28
+ A wanted contradiction routes to `/reconcile` or ADR supersession in interactive lanes; under
29
+ `/sprint`, an answered-but-contradicting outcome IS the contradiction hard gate — stop and
30
+ surface, never a mid-sprint reconcile dispatch. A lower-ranked record answering against a
31
+ higher-ranked steer follows the steer and logs the divergence with both citations — never
32
+ silently conform downward.
33
+ - **Constrains** — the record narrows but does not decide. Feed the citation into the affected
34
+ cells; it satisfies the evidence-specificity rule below.
35
+ - **Silent** — no record speaks. Proceed to the lenses and state `intent: silent`.
36
+
37
+ Fail-soft: an absent `plans/` or `decisions/` directory is not a gap to surface and never a STOP —
38
+ record `intent: silent — no decomposition record` and proceed.
39
+
40
+ ## The six lenses
41
+
42
+ - **Scalable** — supports growth in users, data, throughput, geography without an architectural rewrite. Trap: over-engineering for scale that never arrives, or under-engineering for scale that's on the roadmap.
43
+ - **Maintainable** — can be understood, modified, and extended later (including by agents) without prohibitive effort. Standard patterns over bespoke abstractions; mind the refactoring blast radius and eventual hand-off.
44
+ - **Available** — reachable and functional when needed, including under partial failure. Watch single points of failure, bundled-dependency failure, recovery time. Do not conflate availability with high availability.
45
+ - **Reliable** — correct, predictable, durable outcomes. ACID where it matters (the decision log, audit events), idempotency, state consistency, recovery without corruption.
46
+ - **Testable** — validated by deterministic, fast tests that cover real failure modes. Unit + integration + contract; mind mockability and test-data isolation. "Tests later" is a Weak verdict.
47
+ - **Securable** — enables the project's security posture (per `<project-root>/.codearbiter/security-controls.md`) without retrofit. Authentication, authorization, audit, secret management, attack surface, default-deny stance, supply-chain integrity.
48
+
49
+ ## Cell rules (hard)
50
+
51
+ Each SMARTS cell is a constraint, not a guideline. A non-conformant cell is rejected.
52
+
53
+ 1. **Length cap** — at most 25 words per cell.
54
+ 2. **Verdict-first** — every cell opens with one verdict word: `Strong` (performs well), `Adequate` (acceptable), `Weak` (poor), `Indifferent` (this lens does not differentiate the options at the current scale).
55
+ 3. **Justification follows** — at most 20 words after the verdict.
56
+ 4. **No hedging adverbs** — forbidden: potentially, might, arguably, perhaps, generally, tends to, could be, may. If genuinely uncertain, the verdict is `Indifferent`.
57
+ 5. **Evidence specificity** — "industry standard," "best practice," "widely adopted" are not evidence. Cite a specific property of the option, a specific project constraint, or a specific failure mode.
58
+
59
+ ## Strength of recommendation
60
+
61
+ Every recommendation carries exactly one strength label:
62
+
63
+ - **strong** — multiple dominant lenses align cleanly on one option; non-SMARTS factors confirm.
64
+ - **moderate** — dominant lenses align with caveats, or a single lens dominates.
65
+ - **tied** — no preferred option emerges. A legitimate output: "This is a coin flip under SMARTS — your call."
66
+
67
+ There is no `weak` level — a slight edge is `moderate`. When lenses conflict with no winner, state it
68
+ plainly, surface which lens the user has emphasized in prior decisions as input, and mark `tied`.
69
+ The `Precedent:` line under each table (decision-variance Phase 3) is how that emphasis is surfaced
70
+ systematically: 1–3 most-similar prior decisions by ID plus the observed lens pattern, or
71
+ `Precedent: none on record` when history is thin — never an invented pattern.
72
+
73
+ SMARTS does not cover cost, time-to-market, team-skill fit, vendor lock-in, or political
74
+ acceptability. When these matter, surface them as **non-SMARTS considerations** alongside the table;
75
+ they supplement, never replace, the analysis.
76
+
77
+ ## Worked example
78
+
79
+ **Variance:** authorization engine bundled in the deployment package vs. customer-provided.
80
+
81
+ | Lens | Bundled | External |
82
+ |---|---|---|
83
+ | Scalable | Adequate. Sub-ms decisions sufficient at 50-user scale. | Adequate. Same ceiling, adds a network hop. |
84
+ | Maintainable | Strong. One package owns versioning and integration. | Weak. Two release cycles must coordinate. |
85
+ | Available | Strong. Available whenever the system is. | Weak. Depends on customer infrastructure. |
86
+ | Reliable | Strong. Failure contained in the deployment boundary. | Weak. Failure surface includes customer network. |
87
+ | Testable | Strong. Local test env is one package install. | Weak. Requires standing up two services. |
88
+ | Securable | Strong. Self-contained mandate satisfied. | Weak. Cross-service auditing is harder. |
89
+
90
+ **Recommendation:** Bundle the engine. Strength: **strong** — Securable and Available dominate cleanly; no lens favors external enough to override.
@@ -0,0 +1,56 @@
1
+ # SMARTS decision-log format
2
+
3
+ The append-only decision-log entry schema. Loaded only by the skills/agents that WRITE a log line —
4
+ `decision-variance`, `decision-lifecycle`, and the `grader`. The six lenses, cell rules, and strength
5
+ labels live in [`core.md`](core.md); read that for the scoring itself.
6
+
7
+ Path: `<project-root>/.codearbiter/decisions/decision-log.md`. **Strictly append-only** — no
8
+ edits to a prior entry, ever (not typos, not formatting). Read prior entries; never rewrite them. To
9
+ supersede, append a new entry whose `Supersedes:` references the prior one. Traversal is forward-only:
10
+ to find whether an entry was superseded, scan forward for a later entry that references it. No
11
+ backward `Superseded by:` field is maintained.
12
+
13
+ Entries are numbered sequentially (`DECISION-0001`, …; no gaps) and separated by `---`:
14
+
15
+ ```markdown
16
+ ## DECISION-<NNNN> — <Decision ID> — <one-line summary>
17
+
18
+ **Date:** YYYY-MM-DD
19
+ **Status:** accepted | superseded | deferred
20
+ **Supersedes:** DECISION-NNNN | none
21
+ **Decided by:** <user identifier> | "user during arbitration session" | "User explicitly accepted recommendation as their decision"
22
+ **Decision category:** <category>
23
+ **Artifact-section-hash:** <SHA-256 of the cited artifact section, heading inclusive, HTML comments stripped — or "n/a">
24
+
25
+ ### Variance summary
26
+ - **Artifact position:** [one sentence]
27
+ - **Scaffold position:** [one sentence]
28
+ - **Status type:** divergent | scaffold-silent | artifact-silent | same-level-conflict-resolution | open-decision-closure
29
+
30
+ ### Decision
31
+ [The user's choice. 2–4 sentences. What was decided, not what was discussed.]
32
+
33
+ ### SMARTS rationale
34
+ [Which lenses drove it. 2–6 sentences.]
35
+
36
+ ### Implementation implication
37
+ [What changes — specific scaffold files, ADRs, or artifact sections to update.]
38
+
39
+ ### Re-evaluation trigger (deferred only)
40
+ [The event that should reopen this. Omit unless status is deferred.]
41
+
42
+ ### Resolves same-level conflict between (when applicable)
43
+ [Name both conflicting sources. Omit otherwise.]
44
+
45
+ ---
46
+ ```
47
+
48
+ **Artifact-section-hash** — record the SHA-256 of the artifact section that defined the artifact's
49
+ position at decision time (section heading inclusive to the next same-or-higher heading exclusive,
50
+ HTML comments stripped, UTF-8, full 64-char hex). It is `n/a` for `artifact-silent` variances,
51
+ open-decision closures, and process decisions with no artifact source. The Phase 1 stale check
52
+ recomputes it on later sessions.
53
+
54
+ **Never:** edit a prior entry; compress multiple variances into one entry; record "no decision
55
+ needed"; omit the SMARTS rationale; omit the hash field (write `n/a`, do not drop it); write a
56
+ decision the user did not explicitly make.
@@ -0,0 +1,32 @@
1
+ # skills — catalog (surface scan)
2
+
3
+ Skill bodies load on routing only. This index is the surface scan; never bulk-read
4
+ `skills/*/SKILL.md`. Each skill is an orchestrator routine with gated phases, routed to, never
5
+ "triggered." This index lists what each skill OWNS; to decide WHERE a trigger routes, load
6
+ `<plugin-root>/includes/routing-table.md` (the authoritative trigger→route surface).
7
+
8
+ | Skill | Routed to by | Owns |
9
+ |---|---|---|
10
+ | [tdd](tdd/SKILL.md) | `/feature` (after spec approval), `/fix`, `/refactor` | The test-first gate: six phases — obligation scan → red → green → obligation verify → coverage → lint. No implementation before Phase 1; no path to `commit-gate` until all six gates are green. |
11
+ | [commit-gate](commit-gate/SKILL.md) | `/commit` | The commit gate: nine phases — permission, branch, classification, verification, behavioral proof, diff review, selective stage, message, commit. No commit while the suite is red, the behavior unproven, or secrets/cruft present. |
12
+ | [decision-variance](decision-variance/SKILL.md) | `/reconcile` | SMARTS 6-lens arbitration of project/ADR conflicts; append-only, user-attributed decision log + audit trail. Never decides alone — every choice carries user attribution. |
13
+ | [debug](debug/SKILL.md) | `/debug` | Investigate-then-decide root-cause analysis: five phases. Investigation only, no code change here; forces one named exit — `/fix`, `/adr`, or a no-action close. |
14
+ | [refactor](refactor/SKILL.md) | `/refactor` | Behavior-preserving change behind a parity-coverage proof gate; routes to `tdd` Phase 1 only when new test seams are needed. |
15
+ | [context-creation](context-creation/SKILL.md) | `/create-context` (brownfield) | Back-fills `.codearbiter/` from existing source via parallel scouts; writes `CONTEXT.md` (`arbiter: enabled` + `stage:`) and locks it `<!--INITIALIZED-->`. |
16
+ | [decompose](decompose/SKILL.md) | greenfield startup, `/decompose` | Six-layer senior-architect interview, compaction-resilient via per-layer disk drafts + DRAFT ADRs; populates `.codearbiter/` and locks it initialized. |
17
+ | [brainstorming](brainstorming/SKILL.md) | `/feature` (front), `/sprint` planning | Socratic idea→spec: split bundles, shape the approach, then decide parameters / ask forks in full; adversarial self-review before approval; writes `specs/<slug>.md` whose acceptance criteria become `tdd` obligations. Hard-gate: no code until the spec is approved. |
18
+ | [writing-plans](writing-plans/SKILL.md) | `/feature`, `/sprint` (after the spec) | Decomposes an approved spec into small tasks, each with a path + a verification that maps to a `tdd` obligation; writes `plans/<slug>.md` with bijective criterion↔task coverage. |
19
+ | [executing-plans](executing-plans/SKILL.md) | `/feature` | Checkpoint coordinator — groups tasks into batches, delegates each to `subagent-driven-development` (fresh author agent per task, full review chain), stops for user acknowledgement between batches. |
20
+ | [subagent-driven-development](subagent-driven-development/SKILL.md) | `/sprint` (engine), `executing-plans` (batch scope) | Fresh subagent per task → spec-compliance then quality review → fresh-run verification; accepts only on proof. Hard-stops on `tdd` BLOCK, security CRITICAL, `[CONFIRM-NN]`. |
21
+ | [dispatching-parallel-agents](dispatching-parallel-agents/SKILL.md) | `subagent-driven-development`, `/sprint`, parallel `/review` | Reusable fan-out primitive: bound concurrency, collect, dedupe, funnel through `finding-triage`→`checkpoint-aggregator`. Results unused until the funnel runs. |
22
+ | [finishing-a-development-branch](finishing-a-development-branch/SKILL.md) | `/feature`, `/sprint` (terminal) | The terminal step after `commit-gate`: open-PR / merge-via-PR / discard. No direct-to-main, no force-push; `/sprint` auto-selects open-PR and never merges. |
23
+ | [using-git-worktrees](using-git-worktrees/SKILL.md) | `subagent-driven-development`, `dispatching-parallel-agents` (opt-in) | OPTIONAL per-unit filesystem isolation for parallel work; integrates accepted units back onto the caller's working branch for its single `commit-gate` + finish. Never the default path. |
24
+ | [secret-handling](secret-handling/SKILL.md) | changed code reads/writes/passes a secret | The secret-source gate: identify → source → sinks/persistence. Secrets only from the approved store in `security-controls.md`; never in source, log, error, telemetry, image, or LLM prompt. Dispatches `auth-crypto-reviewer`. |
25
+ | [crypto-compliance](crypto-compliance/SKILL.md) | changed code uses crypto/hashing/signing/TLS/random | The banned-primitive gate: one scan. Rejects broken primitives, disabled TLS verification, home-rolled crypto; approved list lives in `security-controls.md`. Dispatches `auth-crypto-reviewer`. |
26
+ | [skill-author](skill-author/SKILL.md) | `/new-skill "<gap>"` | The only path to a new skill: five phases — gap evidence, scope, authoring, self-review against the v2 house style, routing integration. No skill written until the gap is proven uncovered; none shipped without gated phases, hard rules, and an `INDEX.md` + routing entry. |
27
+ | [decision-lifecycle](decision-lifecycle/SKILL.md) | `/adr`, `/adr-status` | Lean ADR author + status: author a numbered, dated, user-attributed ADR under `.codearbiter/decisions/`; list/status; forward-only supersede chains. Optional `decision-challenger`. Log-entry format lives in `includes/smarts/decision-log-format.md`. ADRs only via `/adr`, with user attribution. |
28
+ | [release](release/SKILL.md) | `/release` | Lean SemVer release, three phases: derive the bump from Conventional-Commits since the last tag + roll `CHANGELOG.md`; cut the annotated tag + report; publish (push tag + `gh release create`) on explicit authorization. No tag on a red suite; no direct-to-main/force-push; nothing published unbidden; a release commit routes through `commit-gate`. |
29
+ | [security-architecture](security-architecture/SKILL.md) | `/threat-model` (optional) | OPTIONAL lightweight STRIDE pass for sensitive features: attack surface → STRIDE → findings, governed by `security-controls.md`. MAY dispatch `security-reviewer` / `auth-crypto-reviewer`. Not a routine gate; hard-STOPs only on a critical unmitigated threat. |
30
+ | [context-check](context-check/SKILL.md) | `/context-check` | OPTIONAL manual drift audit: load `.codearbiter/.provenance/` via `load_provenance_dir` + `compute_drift`, report stale docs, then per stale doc: re-scout / re-baseline (`rebaseline`) / defer. Not the daily loop — commit-gate auto-heal owns routine maintenance. |
31
+ | [post-merge-cleanup](post-merge-cleanup/SKILL.md) | `/ca-cleanup` | The already-merged branch transition: fetch, prove `HEAD` is contained in the fetched default (SHA-ancestry, or a squash-merge proven by the merged PR record), classify every dirty/untracked artifact as unique/redundant/superseded, resolve each under its own confirmation, fast-forward the local default ref then `--ff-only` onto it, then `branch -d` the merged local branch. Unique or unclassifiable artifacts are never discarded unbidden; the remote branch is never touched; never routes to `/ca-override`. |
32
+ | [tribunal](tribunal/SKILL.md) | `/ca-tribunal` | The deep, rarely-convened whole-codebase audit lane: seven gated phases across eleven specialist lenses, each finding persisted to its own file (plus append-only triage/run logs) under `.codearbiter/reports/<run-id>/`, resumable from disk, filing approved findings as GitHub issues; never a required gate. |
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: brainstorming
3
+ description: The Socratic spec-refinement front of /feature, and the planning front of /sprint. Routed to BEFORE any code — it takes a one-line idea and drives it to an approved, concrete spec with testable acceptance criteria. Five gated phases — frame, shape, refine, write, review-and-approve. No implementation and no handoff to tdd until the spec is on disk and approved; each acceptance criterion becomes one tdd Phase 1 obligation.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # brainstorming
8
+
9
+ Refine the idea before it touches code. Routed to by `/feature` (before `tdd`) and by `/sprint` (the planning front).
10
+
11
+ ## Pre-flight
12
+
13
+ Read these, or STOP and surface the gap — never guess scope or stack:
14
+
15
+ - `<project-root>/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value), domain vocabulary, and what the project is NOT building.
16
+ - `<project-root>/.codearbiter/tech-stack.md` — the stack the feature must fit; rule out incompatible designs early.
17
+ - `<project-root>/.codearbiter/open-questions.md` — existing `[CONFIRM-NN]` items; new ones number sequentially from here.
18
+
19
+ **Recorded intent — fail-soft, exempt from the read-or-STOP rule above (ADR-0025).** Also
20
+ consult, when present: the `decisions/` index (titles via `decision-log.md` or the filename
21
+ listing — load a full ADR body only when its subject touches this feature) and
22
+ `plans/02-phased-build-plan.md`'s section headings (plus `plans/01-architecture-breakdown.md`
23
+ when the feature touches component boundaries or integrations). Index-first, never a bulk read.
24
+ A missing file or directory here is NOT a gap to surface and never a STOP: record
25
+ `intent: silent — no decomposition record` in the running notes and proceed.
26
+
27
+ Per-feature and light. NOT decompose's whole-project six-layer interview — one feature, five phases. Depth scales with the feature, not the ceremony: a small feature earns a short pass through every phase, never a skipped one. A spec can be five sentences; it cannot be zero — smallness changes the spec's length, not its existence.
28
+
29
+ ## Phase 1 — Frame the problem · gate: BLOCK
30
+
31
+ Take the one-line idea and pin its boundaries before designing or asking anything:
32
+
33
+ - State the problem in one sentence — the concrete pain, not the proposed solution.
34
+ - Name the user or caller who feels it, and what "done" looks like to them.
35
+ - Name what this feature explicitly does NOT do — the boundary that keeps scope honest.
36
+ - Check the framing against `CONTEXT.md`: it never contradicts the NOT-building list or redefines domain vocabulary. A contradiction is a conflict — surface it, do not reconcile it silently.
37
+ - Check the framing against the recorded intent (pre-flight, when present): an idea that resurrects a capability `plans/02` records as deferred, or that duplicates a backlog item, is a fork to ask — lead with the recorded deferral rationale and your recommendation; never proceed on it silently (ADR-0025).
38
+ - **Split before you spend.** If the idea bundles more than one independently shippable concern — distinct callers, acceptance criteria that would partition into disjoint sets, separable data or surfaces — say so NOW and negotiate the split with the user before any refinement effort is spent on one piece. Each surviving piece is its own spec and its own run of this skill. A bundle discovered in Phase 4 has already wasted every question asked about the piece that gets cut.
39
+
40
+ Gate: problem, caller, and out-of-scope boundary stated and consistent with `CONTEXT.md`, and the idea is confirmed to be ONE feature — or the split is agreed and this run proceeds on exactly one piece.
41
+
42
+ ## Phase 2 — Shape the approach · gate: BLOCK
43
+
44
+ Before drilling into details, establish WHICH design the details belong to:
45
+
46
+ - Propose the genuine candidate approaches — usually two or three — each with its real trade-off stated (`X gives you A but costs B`). Recommend exactly one, with the reasoning that picks it. The user chooses under `/feature`; under `/sprint`, SMARTS chooses and the choice is logged with its scoring.
47
+ - **Never manufacture alternatives.** When only one sane approach exists, say so and say why — a padded list of straw options is noise wearing the costume of rigor, and it trains the reader to skim the one section that matters.
48
+ - **Check each candidate against accepted ADRs** (the pre-flight index; ADR-0025). A contradicting candidate is surfaced WITH the ADR citation, never silently dropped — and it may not be recommended except paired with a supersession fork via `/adr`. When the contradicting candidate is the only sane approach, that IS the fork: present it (the user rules under `/feature`; under `/sprint` this surfaces at the interactive Phase 1 gate, where the user is present to rule).
49
+ - Apply the isolation lens to the recommended shape while it is still soft: can each part be understood without reading its internals, and can its internals change without breaking its consumers? A design that fails this here fails it again in review, after the code exists.
50
+ - Apply the YAGNI lens: strike anything the Phase 1 problem statement does not demand. A capability the caller never asked for is scope creep with a head start.
51
+
52
+ Gate: one approach chosen (user-chosen, or SMARTS-chosen and logged), its trade-off stated, and nothing in it the problem does not require.
53
+
54
+ ## Phase 3 — Socratic refinement loop · gate: BLOCK
55
+
56
+ Turn the chosen approach concrete. The discipline is decide-or-ask, never drift:
57
+
58
+ - **Decide the parameters; ask the forks.** A parameter-level choice — a naming, a default, a threshold, an ordering with one sensible answer — is yours to make: decide it and record it in this phase's running notes; every recorded decision lands in the spec's **Decided parameters** section when Phase 4 writes the file, which is where the user reads them at approval. A genuine fork — a real trade-off, a scope boundary, anything irreversible or user-visible — is the user's: ask it IN FULL the first time, leading with your recommendation and its reasoning. Never merely mention that an open decision exists; a named-but-unasked question is an omission wearing a disclaimer.
59
+ - **Batch what is independent.** Forks whose answers do not depend on each other are asked together, not serialized into rounds. One round of three real questions beats three rounds of one.
60
+ - Run every answer through three lenses:
61
+ - **Vague language** — force concrete nouns, numbers, and verbs. "Manage", "handle", "support" are not verbs. "Fast", "secure", "scalable" are not specifications. "We'll figure it out later" is not an answer — every "later" becomes a `[CONFIRM-NN]`.
62
+ - **Hidden complexity** — name what the user assumes is easy but is hard: state, concurrency, edge cases, failure modes, validation, idempotency, migration of existing data. Surface it now or it surfaces in `tdd`.
63
+ - **Trade-off forcing** — when a real decision exists, frame it with a recommendation and let the user rule. Do not pick for the user; do not hide that a pick exists.
64
+ - **The loop has a breaker.** When refinement stops converging — an answer contradicts an earlier one, or the same fork resurfaces after being answered — STOP the loop: restate the contradiction plainly, force one adjudication (a user ruling, or a recorded `[CONFIRM-NN]`), and only then continue. A loop that circles is not being thorough; it is failing to close.
65
+ - **Closure is a checklist, not a feeling.** The reasons to stop asking that do not count, each with why:
66
+ - *"The feature is simple enough."* — Simplicity shortens the spec; it does not waive it. The five-sentence spec still names its criteria.
67
+ - *"I've asked enough questions."* — Question fatigue is not an exit condition. The exit is the Phase 5 review passing.
68
+ - *"The user seems eager to move on."* — Eagerness is a signal to compress the asking (decide more parameters, batch harder), never to skip an unresolved fork.
69
+ - *"We can settle it during implementation."* — Every deferral is a `[CONFIRM-NN]` on record, or it is a guess that `tdd` will faithfully implement.
70
+
71
+ Record every genuinely-unresolved unknown as `[CONFIRM-NN]` in `<project-root>/.codearbiter/open-questions.md`, numbered sequentially. A finding that belongs to a different feature or a future scope gets an inline `[NEEDS-TRIAGE]` marker in the notes — never route it to a ticket.
72
+
73
+ **Before closing this loop, check the criteria decided so far against their own stated intent, not merely against each other** (#566: `writing-plans` Phase 4 proves BIJECTION between a plan's tasks and the `AC-NN` ledger — every criterion has a task, every task has a criterion — and that proves the two AGREE, never that the ledger itself is COMPLETE. A criterion missed by both sides passes that check cleanly; catching the miss belongs here, at the source, before Phase 4 writes anything to freeze it in place.) Assemble a scratch file outside the working tree (`mktemp`) shaped like the spec sections Phase 4 is about to write — a `## Scope` heading over the Phase 1 framing, and an `## Acceptance criteria` heading over every criterion decided in this phase's running notes so far — and, when this feature traces to a GitHub issue, its body into a second scratch file (`gh issue view <N> --json body -q .body > <scratch-file>`; omitted when there is no linked issue). Run `"$PY" "<plugin-root>/hooks/_intentlib.py" uncovered-intent <scope-and-criteria-file> [--issue-body <scratch-file>]`. A non-empty result names an in-scope bullet or an issue acceptance checkbox no criterion's text cites — add the missing criterion now, or record it as a `[CONFIRM-NN]` if it is genuinely undecided, never carry it forward uncited. This mechanical pass is the CHEAP half; it catches only an uncited bullet or checkbox.
74
+
75
+ Then ask the half it cannot mechanize, explicitly, as its own step: **if every criterion decided so far passed and nothing else changed, what would still be broken?** A real answer names a criterion the ledger is still missing even though every scope bullet and checkbox is technically cited — a bullet reading "fix all three contaminated skills" against criteria for two of the three passes the citation check above cleanly, and only this question catches it. Finding nothing broken is a reportable result, stated in one line, never a silent skip.
76
+
77
+ Gate: every vague term made concrete; every fork resolved by the user or recorded as `[CONFIRM-NN]`; every parameter decision recorded in the running notes that seed Phase 4's **Decided parameters** section; no unresolved "later" outside a `[CONFIRM-NN]`; the `uncovered_intent` backstop returns empty or every finding is resolved; and the negative question above has been asked and answered, not merely named. A blocking `[CONFIRM-NN]` that gates the spec's core stops the loop — surface it and STOP.
78
+
79
+ ## Phase 4 — Write the spec · gate: BLOCK
80
+
81
+ Write the agreed spec to `<project-root>/.codearbiter/specs/<slug>.md`. The slug is derived from the feature. The spec holds:
82
+
83
+ - **Problem** — the Phase 1 framing in final form.
84
+ - **Approach** — the Phase 2 choice and the trade-off that picked it, in two or three sentences.
85
+ - **Scope** — what is in, and the explicit out-of-scope boundary.
86
+ - **Decided parameters** — the parameter-level choices made in Phase 3, each in one line, so the approval reads them instead of discovering them in code review.
87
+ - **Acceptance criteria** — a numbered list, each criterion concrete and testable: a specific input, the observable output, the boundary or failure behavior. Each criterion is verifiable by a single test. "It works well" is not a criterion. These become `tdd` Phase 1 obligations — one obligation per criterion, so an untestable criterion is a defect to fix here, not in `tdd`.
88
+ - **Open questions** — every `[CONFIRM-NN]` raised, cross-referenced to `open-questions.md`.
89
+ - **Governs** *(optional)* — a spec-header line `**Governs:** <comma-separated globs>` that enrolls the approved spec in file-scoped just-in-time context injection: on a Read of any file matching one of the listed globs, a pointer to this spec is surfaced to the agent (tier 3 of the file→knowledge map). Adding the line is sufficient to enroll; no other change required.
90
+
91
+ Gate: the spec file exists on disk under `specs/`, with at least one acceptance criterion and every criterion individually testable.
92
+
93
+ ## Phase 5 — Review, approval & handoff · gate: STOP
94
+
95
+ The spec earns its approval; it is not waved through. Two passes over the FILE as written, then the stop:
96
+
97
+ 1. **Mechanical self-review** — one pass, fix inline, no re-review: no placeholder text (`TBD`, `???`, an unfilled section); no criterion that contradicts the scope; nothing that crosses the `CONTEXT.md` NOT-building boundary; no criterion that contradicts an accepted ADR or `plans/01`'s recorded component boundaries (ADR-0025); every criterion still testable by a single test after the edits; the vague-language lens applied to the spec's own prose.
98
+ 2. **Adversarial pass** — build the strongest case AGAINST the design before the user reads it: the failure mode most likely to be real, the criterion most likely to be wrong, the assumption that would invalidate the approach if false. Present what survives WITH the spec at approval — the user rules on a challenged design, not a defended one. Finding nothing is a reportable result, stated in one line, not a silent skip.
99
+ 3. **Approval:**
100
+ - **Under `/feature`** — present the spec and the adversarial findings, and request explicit user approval. Iterate on the file in place until the user approves. A blocking `[CONFIRM-NN]` must be resolved by the user before approval — never auto-resolve it.
101
+ - **Under `/sprint`** — approval may be granted automatically by SMARTS scoring, logged to the `.codearbiter/` audit trail. A blocking `[CONFIRM-NN]` is never auto-approvable; it escalates to the user and STOPs the sprint flow.
102
+
103
+ On approval, hand off to the `tdd` skill (`<plugin-root>/routines/tdd/SKILL.md`), which enters Phase 1 against the approved spec — one obligation per acceptance criterion.
104
+
105
+ Gate: both review passes run against the file on disk, adversarial findings presented, and the spec approved (by the user under `/feature`, or by logged SMARTS auto-approval under `/sprint`) with no unresolved blocking `[CONFIRM-NN]`. Only then does control pass to `tdd`.
106
+
107
+ ## Hard rules
108
+
109
+ - MUST NOT write implementation code or route to `tdd` before the spec is on disk under `specs/` AND approved.
110
+ - MUST NOT refine a bundle — an idea holding more than one independently shippable concern splits in Phase 1, before any question budget is spent.
111
+ - MUST NOT manufacture alternatives in Phase 2 — when one sane approach exists, say so and why.
112
+ - MUST NOT write an acceptance criterion that cannot be verified by a single test.
113
+ - MUST decide parameter-level choices and record them in the spec; MUST ask genuine forks in full, with a recommendation, the first time — never name an open decision without asking it.
114
+ - MUST stop a non-converging refinement loop and force one adjudication — a contradiction or a resurfacing fork is a breaker, not a prompt to circle.
115
+ - MUST run the `uncovered_intent` mechanical backstop and ask the negative-judgment question ("if every criterion passed and nothing else changed, what would still be broken?") before closing Phase 3 — bijective coverage in `writing-plans` proves the plan and the ledger agree with each other, never that the ledger is complete (#566).
116
+ - MUST run the Phase 5 mechanical self-review and adversarial pass against the file as written, and present the adversarial findings at approval.
117
+ - MUST NOT resolve a `[CONFIRM-NN]` by guessing — surface it and record it in `open-questions.md`.
118
+ - MUST NOT auto-approve a spec carrying a blocking `[CONFIRM-NN]`, even under `/sprint` — it escalates to the user.
119
+ - MUST NOT contradict the NOT-building list or redefine domain vocabulary in `CONTEXT.md` — a contradiction is a conflict to surface, not reconcile.
120
+ - MUST NOT run decompose's six-layer whole-project interview — this is one feature, five phases.
121
+ - MUST log a `/sprint` auto-approval to the `.codearbiter/` audit trail.
122
+ - MUST, at exit, run the follow-up harvest (`<plugin-root>/includes/harvest.md`) over any `[NEEDS-TRIAGE]` notes raised this run — batch-confirm promoting them to `open-tasks.md` (work) or `open-questions.md` (decisions) so out-of-scope ideas don't vanish.