@tyroneross/build-loop 0.35.0 → 0.36.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 (151) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +3 -3
  3. package/.claude-plugin/plugin.json +2 -2
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/AGENTS.md +67 -14
  6. package/README.md +208 -299
  7. package/agents/advisor.md +2 -0
  8. package/agents/alignment-checker.md +2 -0
  9. package/agents/api-assessor.md +3 -1
  10. package/agents/architecture-scout.md +2 -0
  11. package/agents/assessment-orchestrator.md +2 -0
  12. package/agents/build-orchestrator.md +13 -8
  13. package/agents/database-assessor.md +107 -3
  14. package/agents/design-contract-specialist.md +2 -0
  15. package/agents/fact-checker.md +2 -0
  16. package/agents/fix-critique.md +26 -5
  17. package/agents/frontend-assessor.md +3 -1
  18. package/agents/implementer.md +2 -0
  19. package/agents/independent-auditor.md +2 -0
  20. package/agents/mock-scanner.md +2 -0
  21. package/agents/optimize-runner.md +2 -0
  22. package/agents/overfitting-reviewer.md +2 -0
  23. package/agents/performance-assessor.md +3 -1
  24. package/agents/plan-critic.md +2 -0
  25. package/agents/promotion-reviewer.md +2 -0
  26. package/agents/recurring-pattern-detector.md +4 -1
  27. package/agents/retrospective-synthesizer.md +14 -0
  28. package/agents/root-cause-investigator.md +39 -2
  29. package/agents/scope-auditor.md +2 -0
  30. package/agents/security-reviewer.md +3 -0
  31. package/agents/self-improvement-architect.md +2 -0
  32. package/agents/synthesis-critic.md +2 -0
  33. package/agents/transcript-pattern-miner.md +2 -0
  34. package/agents/ui-validator.md +2 -0
  35. package/assets/build-loop-plugin-icon.png +0 -0
  36. package/bin/build-loop-install.js +234 -0
  37. package/commands/run.md +1 -1
  38. package/hooks/git/pre-commit +40 -0
  39. package/hooks/git/pre-push +35 -10
  40. package/hooks/hooks.json +42 -5
  41. package/hooks/pre-edit-architecture.sh +2 -2
  42. package/hooks/route-guard.sh +15 -0
  43. package/hooks/route_guard.py +221 -0
  44. package/hooks/session-start-extensions.sh +10 -0
  45. package/hooks/session-start-git-hooks.sh +6 -1
  46. package/hooks/session-start-rally-point.sh +23 -1
  47. package/hooks/test_session_start_rally_version.sh +123 -0
  48. package/package.json +7 -2
  49. package/plugin-artifacts/codex/.codex-plugin/plugin.json +1 -1
  50. package/plugin-artifacts/codex/AGENTS.md +67 -14
  51. package/plugin-artifacts/codex/README.md +208 -299
  52. package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
  53. package/plugin-artifacts/codex/references/backlog-system.md +285 -0
  54. package/plugin-artifacts/codex/references/capability-routing.md +49 -0
  55. package/plugin-artifacts/codex/references/coordination-rules.md +271 -2
  56. package/plugin-artifacts/codex/references/memory-systems.md +25 -2
  57. package/plugin-artifacts/codex/references/memory.md +14 -0
  58. package/plugin-artifacts/codex/references/model-tier-mapping.md +45 -6
  59. package/plugin-artifacts/codex/references/phase-1-assess.md +19 -1
  60. package/plugin-artifacts/codex/references/phase-2-plan.md +9 -1
  61. package/plugin-artifacts/codex/references/phase-3-execute.md +1 -1
  62. package/plugin-artifacts/codex/references/phase-4-review.md +20 -1
  63. package/plugin-artifacts/codex/references/phase-5-iterate.md +4 -3
  64. package/plugin-artifacts/codex/references/phase-6-learn.md +2 -0
  65. package/plugin-artifacts/codex/references/verify-dispatch.md +85 -0
  66. package/plugin-artifacts/codex/skills/build-loop/SKILL.md +19 -10
  67. package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +1 -1
  68. package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +49 -0
  69. package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +101 -0
  70. package/plugin-artifacts/codex/skills/build-loop/references/memory.md +14 -0
  71. package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +98 -5
  72. package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +19 -1
  73. package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +9 -1
  74. package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +1 -1
  75. package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +20 -1
  76. package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +4 -3
  77. package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +2 -0
  78. package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +85 -0
  79. package/scripts/build_codex_plugin_artifact.py +7 -0
  80. package/scripts/embed_backend.py +17 -13
  81. package/scripts/lessons_index/query.py +1 -1
  82. package/scripts/memory_graph/__init__.py +2 -2
  83. package/scripts/sync_navgator_lessons.py +4 -4
  84. package/skills/api-registry-bridge/SKILL.md +1 -1
  85. package/skills/auto-decision-capture/SKILL.md +4 -3
  86. package/skills/auto-finding-capture/SKILL.md +119 -0
  87. package/skills/build-loop/SKILL.md +19 -10
  88. package/skills/build-loop/fallbacks.md +1 -1
  89. package/skills/build-loop/references/capability-routing.md +49 -0
  90. package/skills/build-loop/references/experiment-results-template.md +101 -0
  91. package/skills/build-loop/references/memory.md +14 -0
  92. package/skills/build-loop/references/output-style.md +98 -5
  93. package/skills/build-loop/references/phase-1-assess.md +19 -1
  94. package/skills/build-loop/references/phase-2-plan.md +9 -1
  95. package/skills/build-loop/references/phase-3-execute.md +1 -1
  96. package/skills/build-loop/references/phase-4-review.md +20 -1
  97. package/skills/build-loop/references/phase-5-iterate.md +4 -3
  98. package/skills/build-loop/references/phase-6-learn.md +2 -0
  99. package/skills/build-loop/references/verify-dispatch.md +85 -0
  100. package/skills/debug-loop/SKILL.md +4 -2
  101. package/skills/debugging-memory/SKILL.md +24 -12
  102. package/skills/{debugging/assess/SKILL.md → debugging-memory/references/assess.md} +6 -13
  103. package/skills/{debugging/memory/SKILL.md → debugging-memory/references/search.md} +10 -17
  104. package/skills/{debugging/store/SKILL.md → debugging-memory/references/store.md} +5 -13
  105. package/skills/debugging-memory/references/subagent-integration.md +3 -3
  106. package/skills/defenseclaw-bridge/SKILL.md +1 -1
  107. package/skills/{loop-builder → focused-loop-builder}/SKILL.md +6 -6
  108. package/skills/ibr-bridge/SKILL.md +1 -1
  109. package/skills/knowledge/SKILL.md +13 -2
  110. package/skills/{knowledge-review/SKILL.md → knowledge/references/review-mode.md} +8 -20
  111. package/skills/logging-tracer/SKILL.md +20 -4
  112. package/skills/model-bakeoff/SKILL.md +44 -0
  113. package/skills/model-tiering/SKILL.md +55 -20
  114. package/skills/optimize/SKILL.md +2 -2
  115. package/skills/prd-bridge/SKILL.md +1 -1
  116. package/skills/recursive-retrospective/SKILL.md +46 -0
  117. package/skills/recursive-retrospective/references/01-retrospective.md +136 -0
  118. package/skills/recursive-retrospective/references/02-learning-capture.md +72 -0
  119. package/skills/recursive-retrospective/references/03-judge.md +45 -0
  120. package/skills/research/SKILL.md +1 -1
  121. package/skills/root-cause-analysis/SKILL.md +42 -0
  122. package/skills/security-methodology/SKILL.md +10 -1
  123. package/skills/security-scan/SKILL.md +55 -0
  124. package/skills/spec-writing/SKILL.md +42 -1
  125. package/skills/sync-skills/SKILL.md +8 -7
  126. package/commands/assess.md +0 -41
  127. package/commands/compose-handoff.md +0 -113
  128. package/commands/debug.md +0 -20
  129. package/commands/debugger-detail.md +0 -34
  130. package/commands/debugger-scan.md +0 -15
  131. package/commands/debugger-status.md +0 -20
  132. package/commands/debugger.md +0 -32
  133. package/commands/optimize-run.md +0 -31
  134. package/commands/promote-experiment.md +0 -129
  135. package/commands/rally-point.md +0 -301
  136. package/commands/research-run.md +0 -22
  137. package/commands/review-knowledge.md +0 -16
  138. package/commands/self-review.md +0 -51
  139. package/commands/setup-memory.md +0 -32
  140. package/commands/start-prd.md +0 -57
  141. package/commands/test.md +0 -34
  142. package/commands/verify-plan.md +0 -39
  143. package/skills/debugging/debug-loop/SKILL.md +0 -231
  144. package/skills/logging-tracer-bridge/SKILL.md +0 -70
  145. /package/skills/{loop-builder → focused-loop-builder}/presets/active-project-evidence.yaml +0 -0
  146. /package/skills/{loop-builder → focused-loop-builder}/presets/generic-artifact-loop.yaml +0 -0
  147. /package/skills/{loop-builder → focused-loop-builder}/presets/presentation-audit.yaml +0 -0
  148. /package/skills/{loop-builder → focused-loop-builder}/presets/research-synthesis.yaml +0 -0
  149. /package/skills/{loop-builder → focused-loop-builder}/presets/source-ingestion-raw-data-audit.yaml +0 -0
  150. /package/skills/{loop-builder → focused-loop-builder}/references/spec-format.md +0 -0
  151. /package/skills/{loop-builder → focused-loop-builder}/scripts/loop_builder.py +0 -0
package/README.md CHANGED
@@ -2,403 +2,312 @@
2
2
  <!-- canary-end -->
3
3
  # build-loop
4
4
 
5
- A plugin for Claude Code that turns big code changes into a checked, repeatable workflow.
5
+ A portable, multi-phase build loop for AI coding agents. It gives Claude Code, Codex, and any AGENTS.md-aware tool the same disciplined operating loop: assess, plan, execute, review, iterate, then learn.
6
6
 
7
- ## What it is
7
+ > **Summary:** build-loop helps AI coding agents and the developers who run them ship multi-step code changes by running every change through a planned, reviewed, verified loop. Best for non-trivial features, refactors, migrations, and bug hunts across more than one file. Skip it for one-line edits, pure Q&A, or status checks.
8
8
 
9
- Build-loop runs your code change through five phases — plan, execute, review, iterate — plus a mandatory Learn step that runs after every build. It splits the work into safe parallel chunks where it can. A critic reads the diff before tests run, so cheap checks catch the obvious mistakes first. Tests must actually pass. Every number on the page traces back to a real source. Fake data in production paths gets flagged. The build stops if what you shipped does not match what you said you would build. The plugin picks the right model for each task: a strong model to plan and review, a faster model to write code, a small model for pattern checks.
9
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
10
+ [![npm](https://img.shields.io/badge/npm-%40tyroneross%2Fbuild--loop-cb3837.svg)](https://github.com/tyroneross/build-loop/pkgs/npm/build-loop)
11
+ [![hosts](https://img.shields.io/badge/hosts-Claude_Code_%C2%B7_Codex_%C2%B7_AGENTS.md-5b21b6.svg)](#install)
10
12
 
11
- ## Why use it
13
+ ## Why build-loop
12
14
 
13
- Big changes break things. You forget an edge case. You skip the test pass. The diff drifts from the plan. The implementer makes a quiet design call you never see. Build-loop catches all of that before the change ships.
15
+ Hand an agent a multi-step task and it tends to dive straight into edits, with no plan, no scope boundary, and no independent check that the result matches the goal. The failures compound: wrong assumptions ride into code, fixes patch symptoms, and "it compiles" gets reported as "it works."
14
16
 
15
- - **One source of truth.** The plan lists every design decision up front. The implementer must say which decisions it made. A lint compares the claim to the actual diff. If the two do not match, the loop stops.
16
- - **Speed where you can, depth where you must.** Mechanical work runs in parallel on a fast model. Work with five or more design decisions auto-routes to the strong model in one pass. Five is the cutoff measured in our testing where the fast model lost cross-decision context.
17
- - **Real evidence, not vibes.** Every pass or fail has a code-based grader. Every metric on a page traces back to its data source. Tests must run. Output must render. Placeholders get flagged.
18
- - **Less rework.** A read-only critic runs before full validation. Cheap checks catch the obvious mistakes first.
19
- - **A way to actually improve a number.** Run multiple tests in a single experiment using Design of Experiments and other statistical methods. You can test six variables at once instead of one. The optimize mode plans the test matrix, runs each combination, and tells you which variable actually moved the number.
17
+ build-loop replaces that with a **structured loop every change runs through**: it assesses live repo state and memory, plans with explicit file ownership and pass/fail criteria, executes within scope, then runs an adversarial review (a critic, a fact-checker, a mock-data scanner) before iterating to green. The differentiator is portability and verification: the **same loop runs across Claude Code, Codex, and host-neutral AGENTS.md tools**, it is **multi-model by tier** (a frontier model plans and judges, a coding model executes), and **no completion claim ships without a verification step behind it**.
20
18
 
21
- You ship fewer regressions. You get a clean record of what changed and why. You can trust the workflow on changes that touch many files at once.
22
-
23
- ## Get started
24
-
25
- Install the plugin via the RossLabs AI Toolkit marketplace (recommended) or directly from the build-loop repo.
19
+ ## The loop
26
20
 
21
+ ```mermaid
22
+ flowchart LR
23
+ A[Assess] --> P[Plan]
24
+ P --> E[Execute]
25
+ E --> R[Review]
26
+ R -->|fail| I[Iterate]
27
+ I --> R
28
+ R -->|pass| L[Learn]
29
+ subgraph Review
30
+ direction LR
31
+ R1[Critic] --> R2[Validate] --> R3[Optimize] --> R4[Fact-Check] --> R5[Simplify] --> R6[Auto-Resolve] --> R7[Report]
32
+ end
27
33
  ```
28
- # Recommended — via the RossLabs AI Toolkit marketplace (includes companion plugins):
29
- /plugin marketplace add tyroneross/RossLabs-AI-Toolkit
30
- /plugin install build-loop@rosslabs-ai-toolkit
31
34
 
32
- # Or direct install from the build-loop source repo alone:
33
- /plugin marketplace add tyroneross/build-loop
34
- /plugin install build-loop@build-loop
35
- ```
35
+ Assess Plan Execute Review → Iterate (5x max) → Learn (always emits an outcome). Review runs seven ordered sub-steps; Iterate loops back to Review on failure.
36
36
 
37
- Run a build.
37
+ For the **living, auto-generated diagram** of how the loop actually wires up in this repo, covering every phase, gate, agent, skill, and script and regenerated from source so it cannot drift, open [`docs/build-loop-flow-mockup.html`](docs/build-loop-flow-mockup.html) in a browser. Format spec and drift gate: [`architecture/README.md`](architecture/README.md).
38
38
 
39
- ```
40
- /build-loop:run add user notification system with email and push
41
- ```
39
+ ## Quick start
42
40
 
43
- Skip the loop for small fixes (under about 20 lines, single file, no new endpoint). For everything else, run it through the loop. That includes features, refactors, migrations, schema changes, and anything that crosses a file or system boundary.
41
+ Install for all three host surfaces on macOS:
44
42
 
45
- Debug a failing system.
46
-
47
- ```
48
- /build-loop:debug tests pass locally but fail in CI
43
+ ```bash
44
+ npm install -g @tyroneross/build-loop@0.36.0
45
+ build-loop-install --host all
49
46
  ```
50
47
 
51
- Detail on each phase, the model tier rules, the synthesis-decision lint, the architecture engine, and the debugger is below.
52
-
53
- ## Phases
48
+ Then, in a Claude Code session inside your project, hand the loop a task:
54
49
 
55
- | # | Phase | Purpose |
56
- |---|-------|---------|
57
- | 1 | **Assess** | Understand state (project type, architecture, tools, prior state) AND define goal + 3-5 scoring criteria with pass/fail conditions |
58
- | 2 | **Plan** | Task breakdown with dependency order and parallel-safe groups |
59
- | 3 | **Execute** | Build it — parallel subagents for independent work |
60
- | 4 | **Review** | Critic → Validate → Optimize (opt-in) → Fact-Check → Simplify → Report — six ordered sub-steps, single exit point; routes to Iterate on failure |
61
- | 5 | **Iterate** | Fix Review failures, loop back to Review (max 5x) |
62
- | 6 | **Learn** *(mandatory)* | Always runs and always emits a `## Learn` outcome line in the Review-G report. Three states: `accruing` (`runs[] < 3` — detector + memory consolidation only), `deferred` (debug-only or budget-exhausted — writes a marker, skips Sonnet draft), or `full` (`runs[] >= 3` + a pattern crossed threshold — detector + Sonnet draft + Opus signoff). Reads two signal sources: `state.json.runs[]` and `proposals/enforce-from-retro/` (recurring enforce-candidates across runs). |
63
-
64
- ## Supply-chain: dependency cooldown
65
-
66
- Build-loop refuses to install third-party JS packages (or version bumps) until the resolved version has been published for at least **7 days**, mitigating smash-and-grab npm compromises (a malicious version published then yanked within hours-to-days never reaches your lifecycle scripts). Defense-in-depth, three layers:
67
-
68
- 1. **Native config injection** (primary gate) — Phase 1 Assess runs `scripts/inject_dependency_cooldown.py`, idempotently writing the package manager's native publish-age key: npm ≥ 11.10.0 → `.npmrc` `min-release-age` (days); pnpm → `pnpm-workspace.yaml` `minimumReleaseAge` (minutes) + `.npmrc` `minimum-release-age` for pnpm 10.x; yarn ≥ 4.10 → `.yarnrc.yml` `npmMinimalAgeGate` (numeric minutes). npm has **no** native exclude ([npm/cli#8994](https://github.com/npm/cli/issues/8994)) so the user-authored allowlist is enforced by layer 2 on npm; pnpm/yarn carry it natively.
69
- 2. **PreToolUse backstop hook** — for ungated projects, rewrites `npm`/`yarn add` with `--before=<7d ago>` and denies `npm ci`/`pnpm add` with an actionable message. On npm **with** native config it stays engaged for the allowlist: all-allowlisted installs get a command-scoped `--min-release-age=0`; third-party installs are left to the native gate (never `--before` — npm rejects it alongside native config).
70
- 3. **Constitution + commit-auditor** — `C-SUPPLY/dependency_cooldown` rule; advisory flag on `<7d`-old deps in lockfile diffs.
71
-
72
- User-authored scopes are exempt via a config-driven allowlist (`.build-loop/config.json` → `dependencyCooldown.allowlist`, default `["@tyroneross/*"]`). See KNOWN-ISSUES for the older-toolchain fallback caveat. pip/cargo not covered in v1.
73
-
74
- ## Installation
75
-
76
- ### From GitHub (recommended)
50
+ ```text
51
+ /build-loop:run add billing settings with tests
52
+ ```
77
53
 
78
- Via the RossLabs AI Toolkit marketplace (includes companion plugins such as bookmark, Coding Debugger, research, etc.):
54
+ What you observe: the agent prints a short status line per phase (`[Phase 1: Assess]`, `[Phase 2: Plan]`, `[Phase 3: Execute]`, then each Review sub-step), then ends with a scorecard marking every acceptance criterion ✅ / ⚠️ / ❓. Completed, verified work is committed automatically; the only human-confirmation gates are production push, irreversible delete, and major user-impacting decisions.
79
55
 
80
- ```
81
- /plugin marketplace add tyroneross/RossLabs-AI-Toolkit
82
- /plugin install build-loop@rosslabs-ai-toolkit
83
- ```
56
+ You do not pick a mode. `/build-loop:run` auto-routes build, fix, refactor, optimize, research, and test requests to the right path.
84
57
 
85
- Or direct from the build-loop source repo alone (build-loop only, no companions):
58
+ ## Install
86
59
 
87
- ```
88
- /plugin marketplace add tyroneross/build-loop
89
- /plugin install build-loop@build-loop
90
- ```
60
+ `build-loop-install` runs the package's helpers from the installed npm package:
91
61
 
92
- build-loop does not register its own MCP server. Deep debugging is native to the build-loop skills; cross-project incident memory can be supplied separately by the standalone Coding Debugger plugin when installed.
62
+ - Syncs the Claude Code cache from the package root.
63
+ - Syncs the Codex cache from `plugin-artifacts/codex`, the slim Codex install artifact.
64
+ - Bootstraps the build-loop memory root with public templates.
65
+ - Leaves publishing, GitHub releases, and production deploys to explicit release commands.
93
66
 
94
- ### Manual (local development)
67
+ For GitHub Packages, authenticate first and point the `@tyroneross` scope at the GitHub registry:
95
68
 
96
69
  ```bash
97
- git clone https://github.com/tyroneross/build-loop.git
70
+ npm config set @tyroneross:registry https://npm.pkg.github.com
71
+ npm login --scope=@tyroneross --registry=https://npm.pkg.github.com
72
+ npm install -g @tyroneross/build-loop@0.36.0
73
+ build-loop-install --host all
98
74
  ```
99
75
 
100
- Add to `~/.claude/settings.json`:
101
-
102
- ```json
103
- {
104
- "extraKnownMarketplaces": {
105
- "build-loop": {
106
- "source": {
107
- "source": "directory",
108
- "path": "/path/to/build-loop"
109
- }
110
- }
111
- },
112
- "enabledPlugins": {
113
- "build-loop@build-loop": true
114
- }
115
- }
116
- ```
76
+ Installer options:
117
77
 
118
- ### Memory setup (one-time, per machine)
78
+ | Option | Use |
79
+ |---|---|
80
+ | `--host claude` | Sync only the Claude Code cache. |
81
+ | `--host codex` | Sync only the Codex cache. |
82
+ | `--host all` | Sync both caches. This is the default. |
83
+ | `--project <slug>` | Ensure `projects/<slug>/raw/` exists in build-loop memory. Repeatable. |
84
+ | `--memory-dest <path>` | Override the memory root. |
85
+ | `--skip-memory` | Sync plugin caches only. |
86
+ | `--dry-run` | Show cache sync actions without writing. |
87
+ | `--json` | Emit one machine-readable result. |
119
88
 
120
- Build-loop's advisory judges read from the canonical `build-loop-memory` store
121
- (at `<memory-root>` — the neutral `~/.build-loop-memory` on a fresh install;
122
- see `docs/memory-setup.md` for the full resolution order). Plugin writers also
123
- maintain a global update ledger at `<memory-root>/indexes/updates.jsonl` for
124
- audit and freshness. Bootstrap with templates:
89
+ Local development install:
125
90
 
126
91
  ```bash
127
- python3 ${CLAUDE_PLUGIN_ROOT}/scripts/install_memory.py
128
- ```
129
-
130
- This seeds `constitution.md` + `MEMORY.md`; `indexes/updates.jsonl` is created on first memory mutation. The build-loop public repo ships only the templates — your actual lessons, constitution rules, and patterns belong in a private repo because they reference specific projects and decisions. See [`docs/memory-setup.md`](docs/memory-setup.md) for the full guide including private repos, root overrides, and repo-local ignored stores.
131
-
132
- ```bash
133
- # Status check anytime
134
- python3 ${CLAUDE_PLUGIN_ROOT}/scripts/install_memory.py --check
92
+ git clone https://github.com/tyroneross/build-loop.git
93
+ cd build-loop
94
+ npm install
95
+ npm run build
96
+ python3 scripts/sync_plugin_cache.py --source . --host claude
97
+ npm run codex:sync-cache
98
+ python3 scripts/install_memory.py --ensure-project build-loop
135
99
  ```
136
100
 
137
- ## Usage
101
+ ## Commands
138
102
 
139
- `/build-loop:run` is the one command for any coding task — build, fix, refactor, optimize, research, or test. The orchestrator reads your goal, classifies intent, and routes to the right mode. You don't choose the mode.
103
+ `/build-loop:run` is the only command. Describe the task in plain language — build, fix, refactor, optimize, research, debug, test, root-cause, retrospective, or plan and the orchestrator classifies intent and routes to the right internal mode. You never pick a mode or a flag.
140
104
 
141
- ```
142
- /build-loop:run [goal description]
105
+ ```text
106
+ /build-loop:run add billing settings with tests
107
+ /build-loop:run tests pass locally but fail in CI # routes to deep debugging
108
+ /build-loop:run reduce API latency # routes to the optimize loop
109
+ /build-loop:run compare queue providers # routes to research (no commits)
110
+ /build-loop:run self-improve against recent runs # runs Phase 6 Learn alone
143
111
  ```
144
112
 
145
- Examples:
113
+ Debugging is also auto-invoked by the loop itself on a review failure. The former mode and utility commands (`debug`, `research-run`, `test`, `self-improve`, `debugger*`, `assess`) are now internal, reached by intent rather than as separate commands.
146
114
 
147
- ```
148
- /build-loop:run add user notification system with email and push
149
- /build-loop:run refactor auth middleware to use JWT
150
- /build-loop:run migrate database from SQLite to PostgreSQL
151
- /build-loop:run tests pass locally but fail in CI
152
- /build-loop:run --parallel add billing settings
153
- ```
115
+ ## Host surfaces
154
116
 
155
- Skip the loop for single-file edits, config changes, or fixes under ~20 lines.
117
+ The repo ships three agent surfaces from one source:
156
118
 
157
- ### Advanced / direct-mode commands
119
+ - **Claude Code plugin**: plugin metadata, commands, hooks, and `agents/*.md`.
120
+ - **Codex plugin**: Codex metadata plus a slim public skill entrypoint (`plugin-artifacts/codex/`).
121
+ - **Host-neutral [`AGENTS.md`](AGENTS.md)**: the same loop methodology for any AGENTS.md-aware tool (Copilot, Cursor, and others), with no Claude-specific integration required.
158
122
 
159
- These commands force a specific mode. Normal usage only needs `/build-loop:run`.
123
+ Surface counts in this release: one command (`/build-loop:run`), 44 skills, 28 agents.
160
124
 
161
- **`/build-loop:debug <symptom>`** force debug mode directly. `/build-loop:run` auto-routes to this on symptom language ("broken", "doesn't work", "failing", etc.), so you usually don't need it. Useful when you want to skip the full loop and go straight to causal-tree investigation.
125
+ ## Agent start protocol
162
126
 
163
- Examples:
127
+ Start every build-loop repo session by checking Rally for coordination state: peers, claims, handoffs, and soft file conflicts. Rally verifies nothing on its own, so confirm code, package, version, and release truth from git, tests, manifests, registries, or GitHub directly.
164
128
 
129
+ ```bash
130
+ rally enter --tool claude_code --json
131
+ rally next --tool claude_code --json
132
+ rally check before-write --tool claude_code --path README.md --strict --json
165
133
  ```
166
- /build-loop:debug tests pass locally but fail in CI
167
- /build-loop:debug login works once then breaks on refresh
168
- /build-loop:debug API returns wrong data intermittently
169
- ```
170
-
171
- Runs deep iterative root-cause investigation (causal-tree analysis, fix, verify, critique — up to 5 iterations). The build orchestrator also auto-invokes `Skill("build-loop:debug-loop")` on Review-B Validate failures and Iterate retries (attempts 2 and 3) — you don't have to call it manually during a build.
172
-
173
- **`/build-loop:optimize-run [target]`** — force optimize mode. Auto-routed from `/build-loop:run` on metric-improvement language. (Renamed from `/build-loop:optimize` 2026-06-09 to clear the command↔skill namesake collision; `Skill("build-loop:optimize")` is unchanged.)
174
-
175
- **`/build-loop:research-run [topic]`** — force research mode. Auto-routed from `/build-loop:run` on evaluation/comparison language. (Renamed from `/build-loop:research` 2026-06-09; `Skill("build-loop:research")` is unchanged.)
176
-
177
- **`/build-loop:test [--strict] [test-name]`** — force plugin-test static analysis. Auto-routed from `/build-loop:run` on "test plugin"/"validate plugin" language.
178
134
 
179
- Quick incident-memory lookup: `/build-loop:debugger`. Multi-domain assessment: `/build-loop:assess`. Memory stats: `/build-loop:debugger-status`.
135
+ If the Rally binary is not installed, proceed without it. Full coordination rules: [`references/coordination-rules.md`](references/coordination-rules.md).
180
136
 
181
- ## Deployment Policy
137
+ Codex-specific delegation is opt-in. build-loop planning language such as "parallel-safe groups" does not by itself authorize Codex subagents. Spawn them only when the user explicitly asks for parallel delegation or passes a parallel flag.
182
138
 
183
- Build-loop uses a repo-local policy before running push/deploy commands. If `.build-loop/config.json` is absent, the default is:
139
+ ## How it works
184
140
 
185
- ```json
186
- {
187
- "deploymentPolicy": {
188
- "preview": "auto",
189
- "testflight": "auto",
190
- "production": "confirm",
191
- "unknown": "confirm"
192
- }
193
- }
194
- ```
195
-
196
- Meaning: preview deploys and TestFlight/App Store Connect upload/export flows can run automatically after review passes; production deploys, releases, publishes, protected-branch pushes, and unknown targets require explicit confirmation. Repos can override each target with `auto`, `confirm`, or `block`.
197
-
198
- ## Components
141
+ build-loop routes work through a lead orchestrator, invokes bounded subagents with scoped context, and accepts output only after verification. It is **multi-model by tier**: each role maps to an abstract tier (Frontier / Thinking / Code / Pattern), and any model that meets the tier's benchmark contract can fill it. The Anthropic mapping is the default; equivalents from other providers substitute when their benchmarks meet the tier contract.
199
142
 
200
- ### Intent Capability Pack
143
+ | Phase | Agent obligation |
144
+ |---|---|
145
+ | Assess | Read live repo state, tooling, memory, Rally, and current docs. Define the goal and pass/fail criteria. |
146
+ | Plan | Produce a dependency-ordered plan with MECE file ownership, validation gates, and approach tradeoffs. |
147
+ | Execute | Implement the accepted plan. Keep edits scoped to owned files. |
148
+ | Review | Run critic, validate, fact-check, simplify, auto-resolve, and report steps. |
149
+ | Iterate | Fix review failures until pass or a real blocker is reached. |
150
+ | Learn | Always emit the Learn outcome and capture durable lessons when warranted. |
201
151
 
202
- Build-loop captures a north star before planning: app/repo purpose, primary users, core jobs, update intent, user value, and non-goals. It writes this to `.build-loop/intent.md` and passes a compact intent packet to every subagent.
152
+ <details>
153
+ <summary><strong>Agent roles (full index)</strong></summary>
203
154
 
204
- Decision rule: prefer the simplest durable approach that creates user value. UI work should be intentional and polished in the basics: every button, option, nav item, chart, and message must have meaning and working behavior. Preview or prototype-looking surfaces must not use fake data in production/user decision paths.
155
+ These tables index agent roles. None of them are commands you run directly. Core authority follows [`references/agent-role-taxonomy.md`](references/agent-role-taxonomy.md): an agent is **core** when a pipeline step is contingent on its verdict, regardless of whether it is top-level or expensive. Model tier follows role; it does not define authority. Deterministic judge surfaces also exist outside `agents/` (`scripts/plan_verify.py`, `scripts/judgment_gate.py`, release verifiers); the tables below are the LLM-side surfaces.
205
156
 
206
- ### Modular Systems Pack
157
+ Each agent declares a `(segment, tier)` role that resolves to a concrete model at dispatch. Selection runs on two axes: a work-role **segment** (Generative Reasoning, Agentic Execution, Representation/Retrieval, Governance/Evaluation, plus dormant Realtime, Perception, and Generative Media lanes) and a seven-rung **capability tier** ladder (T0 through T5, plus T-S for specialist infrastructure). Both axes are encoded as data in [`references/model-taxonomy.json`](references/model-taxonomy.json), the **index** that is the durable source of truth. The `(segment, tier)` role is the KEY into that index; an agent's `model:` frontmatter is the index-DERIVED recommended fallback for the active host, kept in sync by [`scripts/sync_agent_model_defaults.py`](scripts/sync_agent_model_defaults.py) (never hand-edited). At dispatch the orchestrator resolves the role LIVE through [`scripts/resolve_agent_model.py`](scripts/resolve_agent_model.py) and OVERRIDES the frontmatter, so the running model always reflects the current index + availability. The `Tier` column below shows the legacy token (`Frontier`, `Thinking`, `Code`, `Pattern`), which aliases onto `T1`, `T2`, `T3`, `T4`, and the concrete model is an Anthropic fresh-install default. The index is **user-editable and chat-maintainable**: a new or different-provider model is adopted by classifying it once and reordering the cell, with no agent edits. Then `sync_agent_model_defaults.py --apply` regenerates the recommended `model:` values. Full mapping: [`references/model-tier-mapping.md`](references/model-tier-mapping.md).
207
158
 
208
- Build-loop defaults to modular, scalable, MECE structure: high cohesion, loose coupling, stable interfaces, and one clear owner per changed file. Plans and reports use pyramid structure: governing thought first, MECE support lines second, evidence/details third.
159
+ Resolution is availability-aware across dispatches: a model observed unavailable at dispatch (a provider outage) is recorded so the role falls back to the next host-reachable model in its tier a frontier/judgment role degrades at most to the thinking tier, and a model the current host cannot dispatch is never offered. Outage records carry a timestamp and auto-expire after a TTL (`BUILD_LOOP_OUTAGE_TTL_SECONDS`, default 1800s), so a recovered model is picked up again without a manual clear. Recording and clearing run through [`scripts/dispatch_fallback.py`](scripts/dispatch_fallback.py); expiry is pruned on read in [`scripts/model_resolver.py`](scripts/model_resolver.py).
209
160
 
210
- This is a decision rule, not architecture for its own sake. When a simpler or more integrated approach is better for the use case, the plan records `MODULARITY EXCEPTION: <reason>` and explains the user, performance, clarity, or delivery benefit.
161
+ ### Lead / workflow agents
211
162
 
212
- ### Agents
163
+ | Agent | Description | Tier |
164
+ |---|---|---|
165
+ | `build-orchestrator` | Lead workflow owner for Assess → Plan → Execute → Review → Iterate → Learn; owns dispatch, phase transitions, commits, and report. | Thinking |
166
+ | `assessment-orchestrator` | Multi-domain debugging coordinator for unclear symptoms across database, frontend, API, and performance lanes. | Thinking |
167
+ | `optimize-runner` | Optimization-loop coordinator for metric-driven experiments, measurement, and regression handling. | Code |
213
168
 
214
- | Agent | Role | Model |
215
- |-------|------|-------|
216
- | **build-orchestrator** | Drives the 5-phase loop plus mandatory Phase 6 Learn, dispatches subagents | opus (overridable) |
217
- | **commit-auditor** | Advisory judge — chunk scope (Phase 3) + build scope (Phase 4-A, replaces retired sonnet-critic) | opus |
218
- | **fact-checker** | Traces rendered metrics to data sources | inherit (sonnet recommended) |
219
- | **mock-scanner** | Scans for placeholder/fake data in production code | haiku |
169
+ ### Judgment / review agents
220
170
 
221
- **Pin vs inherit philosophy**: pin when the task has a clear right tier (critic needs Sonnet, mock-scanner needs Haiku, orchestrator benefits from Opus judgment). Use `inherit` when user intent should flow through (fact-checker — recommended Sonnet, but respects main-session choice). Override an agent's pin by passing `model:` at spawn time or editing frontmatter.
171
+ | Agent | Description | Tier |
172
+ |---|---|---|
173
+ | `advisor` | Frontier planning author or re-planner when Phase 2 needs deeper synthesis. | Frontier |
174
+ | `plan-critic` | Plan critique for dependencies, scope drift, validation, ownership, alternatives, and MECE quality. | Frontier |
175
+ | `scope-auditor` | Plan-to-Execute boundary check and public-signature caller coverage. | Frontier |
176
+ | `independent-auditor` | Independent adversarial review for chunk and build-scope completion claims. | Frontier |
177
+ | `fix-critique` | Root-cause and regression pressure-test after a proposed fix. | Frontier |
178
+ | `fact-checker` | Claim, metric, and rendered-data provenance checks before completion. | Frontier |
179
+ | `security-reviewer` | Security review for auth, secrets, trust boundaries, injection, and adjacent risks. | Frontier |
180
+ | `overfitting-reviewer` | Optimization review for test gaming, Goodhart effects, and overfitting. | Frontier |
181
+ | `promotion-reviewer` | Review of proposed skill, agent, or enforcement promotions before activation. | Frontier |
182
+ | `synthesis-critic` | Advisory coherence review for synthesis-heavy outputs across multiple dimensions. | Code |
183
+ | `alignment-checker` | Advisory queue-item alignment check against current intent, goal, and non-goals. | Code |
222
184
 
223
- ### Model Tiering
185
+ ### Worker / specialist agents
224
186
 
225
- Build-loop assigns models per task, not per phase, guided by the `model-tiering` skill:
187
+ | Agent | Description | Tier |
188
+ |---|---|---|
189
+ | `implementer` | Bounded coding worker for one Phase 5 fix plan or criterion-targeted implementation packet. | Code |
190
+ | `api-assessor` | API, route, auth, rate-limit, CORS, and request/response failure assessment. | Code |
191
+ | `database-assessor` | Query, migration, schema, connection, vector index, and data integrity failure assessment. | Code |
192
+ | `frontend-assessor` | React, rendering, hydration, state, component, and client performance assessment. | Code |
193
+ | `performance-assessor` | Latency, memory, CPU, timeout, and bottleneck assessment. | Code |
194
+ | `architecture-scout` | Read-only architecture baseline, impact, rules, iterate subgraph, and learn-sync tasks. | Code |
195
+ | `design-contract-specialist` | UI/data input-output contracts, design direction, and traceability artifacts. | Code |
196
+ | `ui-validator` | UI behavior, state, accessibility, layout, console, and rendering evidence validation. | Code |
197
+ | `root-cause-investigator` | Causal-tree investigation for persistent or ambiguous failures. | inherit |
198
+ | `mock-scanner` | Production-path scan for placeholder, fake, fixture, and mock data. | Pattern |
226
199
 
227
- - **Opus** at boundaries: planning, final review, novel architecture, ambiguity resolution, user-visible prose
228
- - **Sonnet** inside: bounded code execution, adversarial critic, first-pass debugging, fact-checking
229
- - **Haiku** for pattern-matching only (mock scanning)
200
+ ### Learning agents
230
201
 
231
- Escalation triggers (mid-flow switch to Opus): 2 consecutive failures, ambiguous spec, cross-file architectural decision, critic `strong-checkpoint` finding, novel error, user-visible prose. See `skills/model-tiering/SKILL.md` and `agents/build-orchestrator.md §Escalation Triggers`.
202
+ | Agent | Description | Tier |
203
+ |---|---|---|
204
+ | `recurring-pattern-detector` | Repeated run-pattern and Learn-candidate detection from run history and retro signals. | Pattern |
205
+ | `retrospective-synthesizer` | Background post-build retrospective and enforce-candidate summary. | Code |
206
+ | `self-improvement-architect` | Experimental skill, agent, and workflow drafts from recurring lessons. | Code |
207
+ | `transcript-pattern-miner` | Transcript mining for repeated patterns and self-improvement candidates. | Pattern |
232
208
 
233
- The pattern amortizes Opus cost across many Sonnet subagents. Typical build: Opus plans once, 6 to 12 Sonnet implementer runs, 1 Sonnet critic per chunk, Opus final review. Estimated 4x cheaper than single-pass Opus end-to-end.
209
+ </details>
234
210
 
235
- ### Eval Methodology
211
+ ## FAQ
236
212
 
237
- - **Binary pass/fail only** no partial credit, no Likert scales
238
- - **Code-based graders first** — test pass/fail, lint, type check, build (fast, deterministic)
239
- - **LLM-as-judge second** — for nuanced criteria code can't evaluate
240
- - **One evaluator per dimension** — no multi-dimension "God Evaluator"
241
- - **Pytest-collection gate at Review-B** — `scripts/pytest_collect_gate.py` runs `pytest --collect-only` (with `PYTHONPATH` stripped) on Python-bearing repos before LLM judges. The bar is collection only — db/live tests still skip at execution time via their markers — but every test module must *load*. A run can't report success while any test module fails to import. Closes the silent-coverage-loss gap where a broken import quietly removes whole modules from coverage. Skipped on library-only repos with no test paths.
213
+ ### What problem does it solve?
242
214
 
243
- ### Iteration Rules
215
+ Agents handed multi-step work tend to skip planning and verification, so wrong assumptions ride into code and "it compiles" gets reported as "it works." build-loop forces every change through a planned, reviewed, verified loop and refuses to claim completion without evidence behind it.
244
216
 
245
- - Diagnose root cause before fixing
246
- - Re-validate only failed criteria
247
- - 3 failures on same criterion with same cause → escalate to user
248
- - Fixing one criterion breaks another → stop, reassess
249
- - No improvement after 2 consecutive iterations → change strategy
250
- - **Hard stop at 5 iterations**
217
+ ### Who is it for, and who is it not for?
251
218
 
252
- ### Post-build retrospective & backlog drain
219
+ It is for developers running AI coding agents on non-trivial changes: features, refactors, migrations, and bug hunts that touch more than one file. It is not for one-line edits, pure Q&A, or status checks; those skip the loop by design.
253
220
 
254
- - **Post-push retrospective** — after the Phase 4 Report closing push, the `retrospective-synthesizer` agent runs non-gating in the background and writes a 9-section lessons-learned file (`.build-loop/retrospectives/<YYYY-MM-DD>/<run-id>.md`) plus a ≤5-line summary surfaced inline. Anything prompted ≥2× in the thread, or surfaced for "what should be enforced", becomes an auto-drafted enforce-candidate at `.build-loop/proposals/enforce-from-retro/` — a candidate for human review, never silently promoted. The closing run does not wait for it.
255
- - **Backlog auto-iterate** — product-impacting work that gets descoped during a build is triaged on capture (via `scripts/backlog/triage.py` + `assess.py`) into `.build-loop/backlog/<id>.md` using `templates/backlog-item.md` (mandatory `repo` + `branch` segmentation keys plus `classify`, `effort`, `status`). Phase 5 Iterate drains the backlog at end-of-run alongside `issues/` and `ux-queue/` by default; the durable cross-run backlog of record lives at `build-loop-memory/projects/<slug>/backlog.md`. Cross-repo items are never mixed into one tracker.
256
- - **Retro → Learn wiring** — `scripts/enforce_retro_signals.py` normalizes the enforce-candidates and counts recurrence across distinct run-ids; the `recurring-pattern-detector` agent reads it as a second signal source (alongside `state.json.runs[]`) and emits `enforce_recurrence` patterns when the same candidate signature appears across ≥2 runs. Delivers "anything prompted or needed repeatedly → enforce" across sessions, not just within one.
221
+ ### What is the fastest way to try it?
257
222
 
258
- ## Native Architecture & Debugging Skills
223
+ `npm install -g @tyroneross/build-loop@0.36.0`, then `build-loop-install --host all`, then `/build-loop:run <your task>` inside a project. See [Quick start](#quick-start).
259
224
 
260
- Architecture and debugging are used on nearly every build, so build-loop ships native skills under:
225
+ ### How is it different from just letting an agent code directly?
261
226
 
262
- - `skills/architecture/{scan,impact,trace,rules,dead,review}/` sourced from NavGator
263
- - `skills/debugging/{memory,store,assess,debug-loop}/` — build-loop-native RCA, investigation, memory, and storage workflows adapted from the debugger lineage
227
+ A direct agent edit has no scope boundary and no independent check. build-loop adds explicit file ownership, pass/fail criteria, an adversarial review pass (critic, fact-checker, mock-data scanner), and automatic iteration to green. It also runs the same loop across Claude Code, Codex, and AGENTS.md tools, and routes planning/judging to a frontier model while execution runs on a coding model.
264
228
 
265
- Each sourced native SKILL.md frontmatter carries `source:` (relative path from the sibling-repos root) and `source_hash:` (SHA-256 at copy time). The orchestrator calls them directly in Phase 1 Assess, Review-B Validate, Review-D Fact-Check, Review-F Report, and Phase 5 Iterate cross-layer pre-step.
229
+ ## Runtime data
266
230
 
267
- Deep debugging remains first-class inside build-loop: causal-tree investigation, 5 Whys, fishbone categories, fault-tree branching, Kepner-Tregoe style problem boundaries, hypothesis falsification, fix verification, scorecards, and critique all live in native skills rather than an MCP process.
231
+ Consumer projects store run state under `.build-loop/`:
268
232
 
269
- Drift detection is a deliberate, opt-in pass:
270
-
271
- ```bash
272
- python3 scripts/sync_skills.py
273
- # or
274
- Skill("build-loop:sync-skills")
233
+ ```text
234
+ .build-loop/
235
+ goal.md
236
+ intent.md
237
+ config.json
238
+ state.json
239
+ feedback.md
240
+ evals/
241
+ issues/
242
+ backlog/
275
243
  ```
276
244
 
277
- The script recomputes each `source_hash` against the canonical upstream file and reports drift. Read-only never auto-updates a SKILL.md. The legacy `skills/navgator-bridge/` and `skills/debugger-bridge/` deprecation stubs were removed in v0.10.0 — the orchestrator and downstream skills call the native skills directly.
278
-
279
- ## Architecture awareness
245
+ Add `.build-loop/` to a consumer project's `.gitignore` unless the repo intentionally tracks selected backlog or plan files.
280
246
 
281
- Build-loop owns native architecture awareness end-to-end. NavGator is now an optional escalation adapter, not a hard dependency.
282
-
283
- **Native engine** (`src/build_loop/architecture/`)
284
- Python-native scanner: `.gitignore`-aware walk, Python via `ast`, TS/JS via tree-sitter, plus Gator-style runtime edges for manifest package use, Next.js frontend API fetches, path-alias imports, and conservative service/LLM calls. Pure-function `compute_impact / trace_dataflow / check_rules / find_dead`. Output schema-parity with NavGator (component/connection JSON shapes verbatim) under `.build-loop/architecture/`.
247
+ build-loop memory defaults to `~/.build-loop-memory` on a fresh machine, or an existing `~/dev/git-folder/build-loop-memory` when present. Bootstrap or inspect it:
285
248
 
286
249
  ```bash
287
- uv run python -m build_loop.architecture {scan|impact|trace|rules|dead|connections|acp|acp-slice|llm-map|schema|diagram} \
288
- [--mode auto|native|navgator] [--json] [--incremental|--full]
250
+ python3 scripts/install_memory.py
251
+ python3 scripts/install_memory.py --check
289
252
  ```
290
253
 
291
- **`architecture-scout` subagent** (`agents/architecture-scout.md`)
292
- Sonnet, read-only, dispatched by the orchestrator at six phase points with one of five task types: `baseline`, `chunk-impact`, `review-rules`, `iterate-subgraph`, `learn-sync`. Decides native-vs-NavGator escalation per task. Returns ≤500-word JSON envelope; owns architecture-related side effects (violation capture, lessons sync).
293
-
294
- **Architecture Context Pack (ACP)** (`scripts/build_acp.py`, `scripts/slice_acp.py`)
295
- Compact JSON summary of current architecture state: top hotspots, recent violations, lessons-in-scope. Sliceable per file set with reverse-deps depth=1 + 4 KB cap. Embedded in subagent briefs at Phase 2 / 3 / 4 / 5.
296
-
297
- **Aggressive freshness** (`hooks/session-start-architecture.sh`, `hooks/pre-edit-architecture.sh`)
298
- SessionStart fires an incremental scan when manifest > 24 h old. PreToolUse Edit/Write triggers an async incremental scan when the touched file is parseable (extension allowlist: `.py .ts .tsx .js .jsx .mjs .cjs`); single-flight via `fcntl.flock`. Doc-only edits never fire scans.
299
-
300
- **Capability registry + ≤8 shortlist** (`scripts/build_capability_registry.py`, `scripts/capability_shortlist.py`, `skills/capabilities/SKILL.md`)
301
- 116 capabilities indexed across 6 kinds (agent / skill / command / hook / mcp_tool / script) and 10 categories. Phase 1 invocation is **mandatory** — populates `state.json.activeCapabilities[<phase>]` with ≤8 relevant entries via plugin-surface collapse + trigger-aware demotion, keeping the orchestrator below the empirical tool-selection ceiling. Phase 2 / 3 dispatchers read the cache instead of re-scoring.
302
-
303
- **Memory facade** (`scripts/memory_facade.py`)
304
- Unified `recall(query, kind, project, limit, skip_postgres)` over file-backed and optional database surfaces — `state.json.runs[]` · canonical `<memory-root>/projects/<project>/decisions/` plus migration-mode legacy decisions · local SQLite `indexes/semantic_facts.sqlite` · optional Postgres `semantic_facts` mirror. Debugging incident recall is native and file-backed by default; standalone Coding Debugger can provide cross-project MCP-backed recall when installed separately. Graceful degradation throughout; CLI accepts both `memory_facade.py --query ...` and the compatibility form `memory_facade.py recall --query ...`, including `--skip-postgres` for the optional Postgres path.
305
-
306
- **Backend health probe** (`scripts/backend_health.py`)
307
- Phase 1 sub-step probes each memory backend with per-backend 5 s timeout. Output: `runs: OK N | decisions: OK <legacy> + <canonical> | semantic: ok|down | debugger: ok|down`. Envelope cached at `state.json.architecture.backendHealth`. Phase 5 Iterate consumes it to short-circuit Postgres lookups when down.
308
-
309
- **Plan-verify rules** (`scripts/plan_verify.py`)
310
- Now includes `schema-migration-full-chain` — flags any commit touching writer/storage/schema files without matching test fixture or reader-path co-change. Catches the recurring drift pattern where writer keys diverge from reader expectations.
311
-
312
- **Web deploy verification** (`scripts/verify_deploy.py`)
313
- Phase 4 Review-B gate that runs after a deploy actually executed. Detects a Vercel link (`.vercel/project.json` or `vercel.json`), resolves the latest production deployment, polls `vercel inspect` to a terminal state, then probes the prod root + each changed route. An auth-gated `401`/`403` on a protected route is treated as **healthy** (the function deployed and is running) — only a `5xx`/build-error fails. Infra trouble (CLI missing, not authed) returns `skipped` and never blocks the build. Optional preferred-tier upgrade: the remote Vercel MCP, only if the user adds it to `.mcp.json` (build-loop does not add it). Inline degraded path: `fallbacks.md#web-deploy-verify`.
314
-
315
- **Decision capture loop**
316
- Every architecture violation surfaced by `rules` becomes a deduplicated decision in the canonical episodic store via `scripts/capture_arch_violation.py`. Recurring violations (≥3× across runs) get promoted to project-local lessons by `scripts/promote_violation_to_lesson.py` and one-way-synced into local SQLite `semantic_facts` for cross-project recall by `scripts/sync_navgator_lessons.py`. Postgres mirroring is explicit with `--postgres-mirror`.
317
-
318
- ## External Skill Dependencies
319
-
320
- These skills enhance the loop when available but are not required:
254
+ ## Codex surface
321
255
 
322
- | Skill | Used In | Without It |
323
- |-------|---------|------------|
324
- | `writing-plans` | Phase 2 (Plan) | Write plan directly with file paths and dependency order |
325
- | `subagent-driven-development` | Phase 3 (Execute) | Dispatch parallel agents manually |
326
- | `calm-precision` | Phase 3 (Execute, UI) | Use standard UI best practices |
327
- | `verification-before-completion` | Phase 4 (Review sub-step B) | Run test/build/lint and confirm output manually |
328
-
329
- ## Cross-Tool Support
330
-
331
- This repo includes `AGENTS.md` — the open-standard version of the build loop methodology. If you use Codex, Copilot, Cursor, Jules, or any other AI coding tool, that file provides the same 5-phase + mandatory Phase 6 Learn workflow without Claude-specific integration.
332
-
333
- Codex-specific subagent behavior lives in `skills/build-loop/references/codex-subagents.md` and `skills/build-loop/templates/codex-worker-prompt.md`. These files are additive: Claude Code continues to use the existing `agents/*.md` runtime, while Codex maps Build Loop ownership packets to explorer/worker-style delegation only when the user explicitly authorizes subagents or parallel work.
334
-
335
- ## Project Data
336
-
337
- Build loop stores runtime data in `.build-loop/` within consumer projects:
256
+ The Codex package exposes one public entrypoint skill through the slim artifact:
338
257
 
339
- ```
340
- .build-loop/
341
- ├── goal.md # Current build goal
342
- ├── intent.md # North star, update intent, user value, non-goals
343
- ├── config.json # Optional repo flags, including deploymentPolicy
344
- ├── state.json # Iteration state, including compact intent/structure summaries
345
- ├── feedback.md # Post-build lessons
346
- ├── evals/ # Scorecard archives
347
- └── issues/ # Discovered issues
258
+ ```text
259
+ plugin-artifacts/codex/
260
+ .codex-plugin/plugin.json
261
+ skills/build-loop/SKILL.md
348
262
  ```
349
263
 
350
- Add `.build-loop/` to your project's `.gitignore`.
264
+ The full `skills/` tree still ships for Claude Code and for internal references. Codex loads helper instructions only when the public build-loop skill asks for them.
351
265
 
352
- ## License & Attribution
266
+ Check installed cache sync and prune stale versions:
353
267
 
354
- This project is licensed under the [Apache License 2.0](LICENSE).
355
-
356
- - [`LICENSE`](LICENSE) full license text.
357
- - [`NOTICE`](NOTICE) attribution notices that, per Apache 2.0 §4(d), must travel with any redistribution of this work.
358
- - [`CONTRIBUTING.md`](CONTRIBUTING.md) — contribution conventions: per-file SPDX headers (REUSE 3.3), AI co-author trailer, signed commits, conventional commits.
268
+ ```bash
269
+ python3 scripts/check_cache_sync.py --host codex --source plugin-artifacts/codex
270
+ python3 scripts/check_cache_sync.py --host claude --source .
271
+ python3 scripts/prune_plugin_cache.py --source . --host all --apply
272
+ ```
359
273
 
360
- Per-file `SPDX-FileCopyrightText` and `SPDX-License-Identifier` headers are required on shipped source files. Files that cannot carry inline comments (JSON, generated assets) are annotated in [`REUSE.toml`](REUSE.toml). Validate compliance locally with `uvx reuse lint`.
274
+ ## Release checklist
361
275
 
362
- ## Codex
276
+ For a plugin/package release, keep these version surfaces in lockstep:
363
277
 
364
- This package now ships an additive Codex plugin surface alongside the existing Claude Code package. The Claude package remains authoritative for Claude behavior; the Codex package adds a parallel `.codex-plugin/plugin.json` install surface without changing the Claude runtime.
278
+ - `package.json`
279
+ - `package-lock.json`
280
+ - `.claude-plugin/plugin.json`
281
+ - `.claude-plugin/marketplace.json`
282
+ - `.codex-plugin/plugin.json`
283
+ - `.agents/plugins/marketplace.json`
284
+ - `plugin-artifacts/codex/.codex-plugin/plugin.json`
365
285
 
366
- Package root for Codex installs:
367
- - the repository root (`.`)
286
+ Build and verify, then verify the release surface after tag/push:
368
287
 
369
- Primary Codex surface:
370
- - public entrypoint skills from `./codex-skills` when present
371
- - public entrypoint skill metadata only; build-loop does not expose a Codex MCP server
288
+ ```bash
289
+ npm run build
290
+ python3 scripts/test_plugin_manifest.py
291
+ python3 scripts/test_agent_surface_policy.py
292
+ npm run codex:build-artifact
293
+ npm pack --dry-run --json
294
+ python3 scripts/verify_release_surface.py --version v0.36.0 --branch main --remote origin --json
295
+ ```
372
296
 
373
- Codex adapter files:
374
- - `skills/build-loop/references/codex-subagents.md`
375
- - `skills/build-loop/templates/codex-worker-prompt.md`
297
+ Publishing to GitHub Packages, npmjs, or GitHub Releases is a release action. Run it only when explicitly requested by the human owner.
376
298
 
377
- The full `./skills` tree still ships with the package for Claude Code and for
378
- Build Loop's internal references. Codex only exposes the compact public
379
- entrypoint set in `./codex-skills` so helper skills do not crowd the `#` picker.
380
- Claude Code keeps the full tree addressable for commands/orchestrator internals,
381
- but helper skills are marked `user-invocable: false`. Cursor and other
382
- AGENTS.md-style tools should follow [`docs/agent-surface-policy.md`](docs/agent-surface-policy.md).
299
+ ## Limitations and known issues
383
300
 
384
- Install the package from this package root using your current Codex plugin install flow. The Codex package is additive only: Claude-specific hooks, slash commands, and agent wiring remain unchanged for Claude Code.
301
+ See [`KNOWN-ISSUES.md`](KNOWN-ISSUES.md). Notably, the bare `/build-loop` command form is deprecated in favor of `/build-loop:run` because of a namesake collision with the skill of the same qualified name.
385
302
 
386
- To check whether an installed Codex cache is using the current source instructions:
303
+ ## Architecture
387
304
 
388
- ```bash
389
- python3 scripts/check_cache_sync.py --host codex --source .
390
- ```
305
+ Short overview: [`ARCHITECTURE.md`](ARCHITECTURE.md). The living, auto-generated diagram and its drift gate are described under [The loop](#the-loop). Regenerate the diagram with `python3 scripts/architecture_diagram/generate.py`.
391
306
 
392
- To remove stale Claude Code and Codex cache versions after a marketplace
393
- upgrade installs the current version:
307
+ ## Contributing
394
308
 
395
- ```bash
396
- python3 scripts/prune_plugin_cache.py --source . --apply
397
- ```
309
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md). Agent build/test conventions for this repo live in [`AGENTS.md`](AGENTS.md) and [`CLAUDE.md`](CLAUDE.md).
398
310
 
399
- Host-specific variants are also available:
311
+ ## License
400
312
 
401
- ```bash
402
- python3 scripts/prune_plugin_cache.py --source . --host codex --apply
403
- python3 scripts/prune_plugin_cache.py --source . --host claude --apply
404
- ```
313
+ Apache-2.0. See [`LICENSE`](LICENSE), [`NOTICE`](NOTICE), and [`CONTRIBUTING.md`](CONTRIBUTING.md).