agentic-team 0.0.0-stage → 6.2.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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -2
  3. package/bin/build-template.js +208 -0
  4. package/bin/index.js +1334 -0
  5. package/bin/platforms.js +510 -0
  6. package/package.json +41 -4
  7. package/template/.claude-plugin/plugin.json +10 -0
  8. package/template/.orchestra/README.md +391 -0
  9. package/template/.orchestra/blueprints/README.md +87 -0
  10. package/template/.orchestra/blueprints/api-only.md +46 -0
  11. package/template/.orchestra/blueprints/component-crud-resource.md +25 -0
  12. package/template/.orchestra/blueprints/saas-starter.md +69 -0
  13. package/template/.orchestra/config.yml +293 -0
  14. package/template/.orchestra/roles/orchestrator.md +105 -0
  15. package/template/.orchestra/roles/product-manager.md +439 -0
  16. package/template/.orchestra/scripts/compact-diff.awk +45 -0
  17. package/template/.orchestra/scripts/context.mjs +373 -0
  18. package/template/.orchestra/stacks/README.md +81 -0
  19. package/template/.orchestra/stacks/_lib/common.sh +3095 -0
  20. package/template/.orchestra/stacks/_repo/setup.sh +1113 -0
  21. package/template/.orchestra/stacks/backend-hono/claude/commands/endpoint.md +13 -0
  22. package/template/.orchestra/stacks/backend-hono/claude/skills/api-endpoint/SKILL.md +111 -0
  23. package/template/.orchestra/stacks/backend-hono/claude/skills/testing/SKILL.md +75 -0
  24. package/template/.orchestra/stacks/backend-hono/setup.sh +5945 -0
  25. package/template/.orchestra/stacks/backend-hono/stack.md +195 -0
  26. package/template/.orchestra/stacks/mobile-android-native/claude/commands/component.md +13 -0
  27. package/template/.orchestra/stacks/mobile-android-native/claude/skills/design-component/SKILL.md +58 -0
  28. package/template/.orchestra/stacks/mobile-android-native/setup.sh +607 -0
  29. package/template/.orchestra/stacks/mobile-android-native/stack.md +138 -0
  30. package/template/.orchestra/stacks/mobile-expo/claude/commands/component.md +12 -0
  31. package/template/.orchestra/stacks/mobile-expo/claude/skills/design-component/SKILL.md +92 -0
  32. package/template/.orchestra/stacks/mobile-expo/setup.sh +470 -0
  33. package/template/.orchestra/stacks/mobile-expo/stack.md +141 -0
  34. package/template/.orchestra/stacks/mobile-ios-native/claude/commands/component.md +12 -0
  35. package/template/.orchestra/stacks/mobile-ios-native/claude/skills/design-component/SKILL.md +58 -0
  36. package/template/.orchestra/stacks/mobile-ios-native/setup.sh +468 -0
  37. package/template/.orchestra/stacks/mobile-ios-native/stack.md +130 -0
  38. package/template/.orchestra/stacks/web-nextjs/claude/commands/component.md +12 -0
  39. package/template/.orchestra/stacks/web-nextjs/claude/skills/design-component/SKILL.md +100 -0
  40. package/template/.orchestra/stacks/web-nextjs/claude/skills/design-tokens/SKILL.md +61 -0
  41. package/template/.orchestra/stacks/web-nextjs/setup.sh +128 -0
  42. package/template/.orchestra/stacks/web-nextjs/stack.md +170 -0
  43. package/template/.orchestra/stacks/web-vite-react/claude/commands/component.md +12 -0
  44. package/template/.orchestra/stacks/web-vite-react/claude/skills/design-component/SKILL.md +100 -0
  45. package/template/.orchestra/stacks/web-vite-react/claude/skills/design-tokens/SKILL.md +61 -0
  46. package/template/.orchestra/stacks/web-vite-react/setup.sh +185 -0
  47. package/template/.orchestra/stacks/web-vite-react/stack.md +177 -0
  48. package/template/.orchestra/trackers/github.sh +467 -0
  49. package/template/CLAUDE.md +54 -0
  50. package/template/agents/architect.md +83 -0
  51. package/template/agents/engineer-high.md +17 -0
  52. package/template/agents/engineer-low.md +17 -0
  53. package/template/agents/engineer-max.md +17 -0
  54. package/template/agents/engineer-medium.md +17 -0
  55. package/template/agents/engineer-xhigh.md +17 -0
  56. package/template/agents/lead.md +925 -0
  57. package/template/agents/milestone-reviewer.md +65 -0
  58. package/template/agents/orchestrator.md +105 -0
  59. package/template/agents/product-manager.md +439 -0
  60. package/template/agents/re-reviewer.md +25 -0
  61. package/template/agents/reviewer.md +303 -0
  62. package/template/agents/scaffolder.md +206 -0
  63. package/template/agents/tracker.md +202 -0
  64. package/template/commands/blueprint.md +23 -0
  65. package/template/commands/create-role.md +64 -0
  66. package/template/commands/export.md +45 -0
  67. package/template/commands/help.md +56 -0
  68. package/template/commands/hotfix.md +14 -0
  69. package/template/commands/orchestrator.md +12 -0
  70. package/template/commands/pm.md +18 -0
  71. package/template/commands/rewind.md +63 -0
  72. package/template/commands/setup.md +15 -0
  73. package/template/commands/start.md +29 -0
  74. package/template/commands/status.md +11 -0
  75. package/template/commands/sync.md +76 -0
  76. package/template/commands/verifier.md +53 -0
  77. package/template/hooks/audit-context.sh +166 -0
  78. package/template/hooks/enforce-role.sh +193 -0
  79. package/template/hooks/protect-system-files.sh +123 -0
  80. package/template/hooks/review-rounds.sh +172 -0
  81. package/template/rules/acceptance-check.orchestra.md +11 -0
  82. package/template/rules/analytics-kpi.orchestra.md +56 -0
  83. package/template/rules/code-standards.orchestra.md +35 -0
  84. package/template/rules/comments.orchestra.md +77 -0
  85. package/template/rules/commit-format.orchestra.md +20 -0
  86. package/template/rules/dependency-upgrade.orchestra.md +112 -0
  87. package/template/rules/design-parity.orchestra.md +181 -0
  88. package/template/rules/observability.orchestra.md +121 -0
  89. package/template/rules/performance.orchestra.md +190 -0
  90. package/template/rules/phase-limits.orchestra.md +3 -0
  91. package/template/rules/pull-request.orchestra.md +218 -0
  92. package/template/rules/role-boundaries.orchestra.md +132 -0
  93. package/template/rules/security.orchestra.md +106 -0
  94. package/template/rules/stuck-detection.orchestra.md +25 -0
  95. package/template/rules/testing-standards.orchestra.md +219 -0
  96. package/template/rules/tracker-authority.orchestra.md +198 -0
  97. package/template/rules/verification-gate.orchestra.md +56 -0
  98. package/template/skills/accessibility/SKILL.md +31 -0
  99. package/template/skills/android-testing/SKILL.md +112 -0
  100. package/template/skills/architecture/SKILL.md +175 -0
  101. package/template/skills/auth-setup/SKILL.md +105 -0
  102. package/template/skills/best-practices/SKILL.md +29 -0
  103. package/template/skills/code-optimizer/SKILL.md +27 -0
  104. package/template/skills/core-web-vitals/SKILL.md +32 -0
  105. package/template/skills/crud-api/SKILL.md +32 -0
  106. package/template/skills/debug/SKILL.md +28 -0
  107. package/template/skills/deployment/SKILL.md +104 -0
  108. package/template/skills/error-handling/SKILL.md +154 -0
  109. package/template/skills/frontend-design/SKILL.md +30 -0
  110. package/template/skills/fullstack-infrastructure/SKILL.md +108 -0
  111. package/template/skills/ios-testing/SKILL.md +100 -0
  112. package/template/skills/mobile-testing/SKILL.md +102 -0
  113. package/template/skills/observability/SKILL.md +91 -0
  114. package/template/skills/project-structure/SKILL.md +114 -0
  115. package/template/skills/push-notifications/SKILL.md +146 -0
  116. package/template/skills/react-best-practices/SKILL.md +31 -0
  117. package/template/skills/realtime/SKILL.md +146 -0
  118. package/template/skills/review/SKILL.md +82 -0
  119. package/template/skills/testing/SKILL.md +45 -0
  120. package/template/skills/web-quality-audit/SKILL.md +47 -0
  121. package/template/skills/web-testing/SKILL.md +120 -0
@@ -0,0 +1,293 @@
1
+ # Orchestra Configuration
2
+ # Customize pipeline behavior, thresholds, and verification commands.
3
+
4
+ project:
5
+ # What this project builds for: web, expo, ios, android, backend. The
6
+ # installer installs only those platforms' stacks, skills and rule sections,
7
+ # and retires the rest on the next run. Empty means not decided yet: the
8
+ # installer detects the list from the repository and writes it here, and
9
+ # installs everything only when it finds nothing — an empty repo before
10
+ # /orchestra:setup. Edit it, or run `npx agentic-team --platforms ios,backend`,
11
+ # to change it; list all five to install everything on purpose.
12
+ platforms: []
13
+
14
+ pipeline:
15
+ # One model for every phase. There used to be a table mapping a phase's
16
+ # complexity to a model tier, and it stopped earning its place: on the
17
+ # current generation, effort moves quality and cost more than the tier
18
+ # does, and one model means one prompt cache.
19
+ model: opus
20
+
21
+ # How hard the sub-agent thinks, per phase. The PM writes one of the three
22
+ # names on the phase; lead maps it here. Pick by how expensive a wrong
23
+ # answer is to unwind — not by how long the work takes. Long and mechanical
24
+ # is light; short and load-bearing is complex.
25
+ effort:
26
+ # One right answer, and a test or a build says whether you hit it.
27
+ # a config value or an environment variable
28
+ # a copy or a translation change
29
+ # a dependency bump the seam tests cover
30
+ # a field added to a form that already exists, validated like the rest
31
+ # a new column that is nullable and read by nothing yet
32
+ # an analytics event on a screen that already reports others
33
+ light: medium
34
+ # A feature. Most phases live here.
35
+ # a new endpoint with validation, a query and a response shape
36
+ # a new screen from a design, with its states
37
+ # a background job with a retry policy
38
+ # a migration that adds a table and the code that reads it
39
+ # an integration behind a wrapper, with the wrapper's test
40
+ # a refactor that moves behaviour without changing it
41
+ # The shipped default is medium; a project that set high keeps it on
42
+ # upgrade. One run moved its later phases to medium and they were approved
43
+ # within three review rounds — one run, not a measurement. A phase that
44
+ # needs more says `effort: high` itself.
45
+ standard: medium
46
+ # Being wrong costs more than the tokens. A mistake here reaches
47
+ # production quietly or is expensive to unwind.
48
+ # sign-in, sessions, password reset, permissions
49
+ # anything that moves money or issues a refund
50
+ # a migration that rewrites or deletes data, or changes a type in place
51
+ # concurrency — a lock, a queue consumer, an idempotency key
52
+ # a change that touches many files at once
53
+ # a rate limit, a cache with invalidation, a retry with side effects
54
+ complex: xhigh
55
+ # When a phase says nothing.
56
+ default_effort: standard
57
+ # A phase can also write a raw level — effort: max — for the one place
58
+ # where correctness beats cost outright. The names above are the
59
+ # vocabulary; the five levels stay reachable.
60
+ # What happens to the design RFC before phases start.
61
+ # required — show it and wait for you
62
+ # optional — show it and continue
63
+ # skip — write it and never show it
64
+ #
65
+ # The default is optional because skip is the one setting with no upside:
66
+ # the architect still runs and still writes rfc.md on a complex milestone,
67
+ # so skip pays for the design and then throws away the only chance to read
68
+ # it before the code exists. required is the right choice when the work is
69
+ # unfamiliar enough that a wrong design is expensive to unwind.
70
+ rfc_approval: optional
71
+
72
+ # Code review: required | optional | skip
73
+ review: required
74
+
75
+ # Parallel phase execution: enabled | disabled
76
+ # When enabled, phases with depends_on: [] run in parallel
77
+ parallel: disabled
78
+
79
+ # Default pipeline when milestone Complexity is missing
80
+ default_pipeline: full # quick | standard | full
81
+
82
+ thresholds:
83
+ # Max retries before escalation: a stuck fix, a failed gate, and review
84
+ # rounds per phase — the last counted by .claude/hooks/review-rounds.sh.
85
+ stuck_retry_limit: 3
86
+
87
+ verification:
88
+ # Commands run before every commit, in order, stopping at the first failure.
89
+ #
90
+ # They execute in the directory of the app the phase is touching, not at the
91
+ # repo root. A multi-platform repo therefore needs each app to expose the
92
+ # same four entry points — that is what makes one command set work across
93
+ # npm, Gradle, and Xcode.
94
+ #
95
+ # If an app directory contains verify.sh, lead runs that instead of the four
96
+ # commands below. Non-npm stacks generate one; see .orchestra/stacks/.
97
+ #
98
+ # Customize these for your stack (Go, Python, Rust, etc.)
99
+ typecheck: "npx tsc --noEmit"
100
+ test: "npm test"
101
+ lint: "npm run lint"
102
+ # Coverage gate. The testing rule ("anything wrapping a dependency has a
103
+ # test") is unverifiable without it.
104
+ coverage: "npm run test:coverage"
105
+
106
+ # A production build. Typecheck is not a build: `tsc --noEmit` happily
107
+ # accepts a Next.js app that fails `next build` on a server/client boundary
108
+ # or a static-generation error, and neither tests nor lint load the
109
+ # bundler. Without this, "green" can mean an artifact that does not exist.
110
+ # Runs last because it is the slowest, so cheap checks fail first.
111
+ build: "npm run build"
112
+
113
+ # Optional, and skipped where the app has no such script. An Expo app has
114
+ # one, because a native module off the SDK's compatibility table is
115
+ # invisible to typecheck, lint and jest alike — and is exactly the kind of
116
+ # defect that passes CI and fails on a device.
117
+ doctor: "npm run doctor"
118
+
119
+ testing:
120
+ # Strategy lives in .claude/rules/testing-standards.orchestra.md. These are
121
+ # the knobs it refers to.
122
+ coverage:
123
+ # A single global percentage stops measuring test quality the moment it
124
+ # becomes a gate. Instead: never go down, and hold the new code to a real
125
+ # bar. Vitest's thresholds.autoUpdate writes the ratchet back to the
126
+ # config when coverage improves; a drop fails the run.
127
+ ratchet: true
128
+
129
+ # The gate that actually changes behaviour: branch coverage of the lines
130
+ # this change touched. Applies to a pull request, not to the repo.
131
+ diff_branch_threshold: 90
132
+
133
+ # The highest floor the ratchet is allowed to record.
134
+ #
135
+ # Without it the ratchet writes down whatever the code achieved, and a
136
+ # fresh scaffold is small enough to be perfect — so the floor becomes 100
137
+ # on day one and every line written afterwards must be covered or the
138
+ # build fails. Nobody chose that; it is an artifact of a 71-line app, and
139
+ # it is stricter than diff_branch_threshold, so the two gates disagree and
140
+ # the accidental one wins.
141
+ #
142
+ # The cost is explicit: between this number and whatever coverage actually
143
+ # is, a regression does not fail the build. The diff gate is the bar for
144
+ # new code; this only prevents falling off a cliff.
145
+ ratchet_ceiling: 90
146
+
147
+ # Modules that wrap a third-party library are where a dependency bump has
148
+ # to turn the suite red. They are small, so 100% is both achievable and
149
+ # meaningful — unlike a global 100%. Globs, relative to the app.
150
+ #
151
+ # Live rather than empty because the location is a convention, not
152
+ # something discovered later: anything wrapping a third party goes in
153
+ # src/integrations/<provider>/. See
154
+ # .claude/skills/project-structure/SKILL.md.
155
+ #
156
+ # It asks that the wrapper be exercised, not that a test file sit beside
157
+ # it — an integration test driving it through a faked HTTP boundary
158
+ # satisfies it. Do not add a unit test to repeat a route test.
159
+ seam_paths: ["src/integrations/**"]
160
+
161
+ # Counted against nothing. A design token file or a type-only module
162
+ # moves the number without saying anything about quality.
163
+ exclude:
164
+ - "**/*.d.ts"
165
+ - "**/*.test.*"
166
+ - "**/*.config.*"
167
+ - "**/index.ts"
168
+ - "**/design/tokens.*"
169
+
170
+ mutation:
171
+ # Coverage says a line ran. Mutation says it was checked.
172
+ # Runs per pull request over the files that PR changed — a full run takes
173
+ # hours and belongs on a schedule, not in a gate.
174
+ #
175
+ # Currently inert on any app using TypeScript 7: the Go compiler dropped
176
+ # the JS compiler API, and Stryker's sandbox preprocessor calls into it
177
+ # before reading any of its own options. Scaffolding detects this and
178
+ # skips the install rather than shipping a script that crashes. Every
179
+ # other piece is wired, so it starts working when Stryker catches up.
180
+ enabled: true
181
+
182
+ # Mutation score below this fails the run, on changed files only.
183
+ break_threshold: 70
184
+
185
+ dependencies:
186
+ # minor and patch on green is a merge — that is what the seam rule buys.
187
+ # A major is the maintainer saying the contract changed, and some of what
188
+ # changed is invisible to any test. A human reads those.
189
+ automerge: minor-and-patch # minor-and-patch | patch | none
190
+
191
+ delivery:
192
+ # Work always reaches you as one pull request per task. There used to be a
193
+ # `mode` here choosing between that and an agentic loop with no PR, and it
194
+ # stopped meaning anything: the loop is what `--auto` on /orchestra:start
195
+ # already gives you, and it gave it while leaving no reviewable trail. The
196
+ # flag decides whether a human gates the merge; nothing decides whether the
197
+ # work is visible.
198
+ #
199
+ # The branch every task branches off and squashes into. Asked at setup,
200
+ # never inferred: a repository's default branch is often not where work
201
+ # lands — one project integrates on `next` and releases from `main`, and a
202
+ # task built off `main` there opens its PR against the release branch.
203
+ base_branch: main
204
+
205
+ # How many times to iterate on a screen that does not match its design
206
+ # before giving up. Only reached under --auto, where nobody is watching to
207
+ # judge it.
208
+ max_design_iterations: 4
209
+
210
+ # What happens when those iterations are exhausted. Never silently accept.
211
+ on_parity_exhausted: tech-debt # tech-debt | fail
212
+
213
+ tracker:
214
+ # This key decides who owns requirements. There is deliberately no second
215
+ # knob: two settings that can disagree about the same question is the thing
216
+ # this system keeps arguing against.
217
+ #
218
+ # none — the markdown under .orchestra/milestones/ is
219
+ # the source of truth. Nothing is pushed and
220
+ # nothing is pulled.
221
+ # github | clickup — the tracker is canonical. The milestone
222
+ # directory holds pointers, not requirements,
223
+ # and lead reads the work from the provider.
224
+ #
225
+ # What choosing a provider costs, stated once so it is a decision rather
226
+ # than a surprise: lead cannot run while the API is down, rate-limited or
227
+ # unauthorised; a requirement change has no diff and no review; and git log
228
+ # stops answering "why did we build this". `none` keeps all three.
229
+ #
230
+ # See .claude/rules/tracker-authority.orchestra.md.
231
+ provider: none # none | github | clickup
232
+
233
+ # The board or project the tasks live on. Read at setup, not guessed —
234
+ # GitHub wants a Projects v2 number, ClickUp a list id.
235
+ board: ""
236
+
237
+ # ClickUp only: the space's wiki document, where an RFC is published as a
238
+ # page. Read at setup from the space rather than created — a team already
239
+ # has one, and a second wiki is worse than none.
240
+ #
241
+ # Pages nest project → milestone, so a repo with thirty milestones is thirty
242
+ # pages under one heading rather than thirty at the top level. Empty means
243
+ # RFCs are not published, and everything else still works.
244
+ wiki: ""
245
+
246
+ # Orchestra's internal states, mapped to what this project actually calls
247
+ # them. Discovered by reading the provider at setup and written here.
248
+ #
249
+ # It is not hardcoded because it cannot be: a GitHub Projects `Status` is a
250
+ # user-defined single-select, and a Jira status comes from the project's own
251
+ # workflow scheme. The defaults below are GitHub's stock board, which is a
252
+ # starting point and not an assumption — a provider whose statuses cannot be
253
+ # read is a setup failure, never a guess.
254
+ states:
255
+ # Where export lands a task. You move it to ready when lead may take it —
256
+ # lead never does that itself.
257
+ backlog: "backlog"
258
+ ready: "ready"
259
+ in_progress: "in progress"
260
+ in_review: "in review"
261
+ done: "done"
262
+ # Where lead parks a task in --auto that it cannot finish without an
263
+ # answer from you, rather than guessing. It moves on to the next task.
264
+ blocked: "blocked"
265
+ # A workaround it was forced into, recorded as its own task so the
266
+ # shortcut is visible instead of buried in a diff. See
267
+ # .claude/rules/tracker-authority.orchestra.md.
268
+ tech_debt: "tech debt"
269
+
270
+ # Whose comments the sync loop is allowed to act on.
271
+ #
272
+ # The loop turns text written on a board into code and a pull request, which
273
+ # makes it an instruction channel. Everything else here treats what arrives
274
+ # through a tool as data rather than as a command, and this is the one place
275
+ # that would otherwise break the rule. A comment from anyone not listed is
276
+ # reported to you and never acted on. Empty means nobody, which is why setup
277
+ # fills it in.
278
+ actors: []
279
+
280
+ # Export and sync are never automatic and have no toggle — they happen only
281
+ # when you run /orchestra:export or /orchestra:sync. See
282
+ # .claude/agents/tracker.md.
283
+
284
+ observability:
285
+ # Mandatory — see .claude/rules/observability.orchestra.md and
286
+ # .claude/rules/analytics-kpi.orchestra.md. These pick the provider;
287
+ # they do not make the capability optional.
288
+ errors: sentry # sentry | custom
289
+ analytics: posthog # posthog | custom
290
+ logging: pino # pino | custom
291
+
292
+ # Fail the verification gate if an app has no error monitoring wired.
293
+ require_before_release: true
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: orchestrator
3
+ description: "Maintains the Orchestra system itself — roles, rules, agents, skills, commands, stacks, config, docs. Changes it only in answer to a real failure, prefers a check over prose, and keeps one source for every fact. Use when modifying the Orchestra system."
4
+ ---
5
+
6
+ # Role: Orchestrator
7
+
8
+ ## Identity
9
+
10
+ You maintain the system the other roles run inside. Nothing you write ships
11
+ to a user directly; every line you change is a line an agent will read on
12
+ its next run and either follow or not. That is the whole job: making the
13
+ system one that agents actually follow, and knowing the difference between
14
+ that and one that merely says the right things.
15
+
16
+ ## Ownership
17
+
18
+ | Can Do | Scope |
19
+ |--------|-------|
20
+ | Create/edit/delete role files | `.orchestra/roles/*.md` |
21
+ | Edit config | `.orchestra/config.yml` |
22
+ | Edit CLAUDE.md | `CLAUDE.md` |
23
+ | Create/edit agents | `.claude/agents/*.md` |
24
+ | Create/edit rules | `.claude/rules/*.orchestra.md` |
25
+ | Create/edit skills | `.claude/skills/*/SKILL.md` |
26
+ | Create/edit blueprints | `.orchestra/blueprints/*.md` |
27
+ | Create/edit stacks | `.orchestra/stacks/**` |
28
+ | Create/edit commands | `.claude/commands/orchestra/*.md` |
29
+ | Create/edit hooks | `.claude/hooks/*` |
30
+ | Maintain documentation | `docs/*.md` |
31
+
32
+ ## Cannot Do
33
+
34
+ Write feature code, PRDs, RFCs, design specs, or review code. If asked,
35
+ refuse and name the correct role.
36
+
37
+ ## How you decide
38
+
39
+ These are the rules the system is built by. Each one is enforced by the
40
+ suite or by the way you work, and each exists because ignoring it produced
41
+ a real failure.
42
+
43
+ **A change answers a failure, or it is refused.** Every rule, check, hook
44
+ and agent in this system was written after something went wrong — a PM
45
+ opened a pull request, a phase shipped seven of fifteen components, a
46
+ review body listed everything it checked. When someone proposes a change
47
+ with no failure behind it, say so and propose the measurement instead: what
48
+ would we record, and what number would justify building it. Speculative
49
+ machinery is the most expensive kind, because it costs maintenance forever
50
+ and nobody can say whether it helped.
51
+
52
+ **A rule nothing checks is advice.** Before writing prose, ask what could
53
+ enforce it: a hook, a policy check, a consistency test, a script. Prose is
54
+ what is left after the mechanical part has been made mechanical. When a
55
+ rule must stay prose — a judgement no script can make — say so in the rule,
56
+ and tell the reviewer it is theirs.
57
+
58
+ **One source for every fact.** A number, a list, a vocabulary lives in one
59
+ file; everything else points at it. The re-review threshold was 30 in one
60
+ file and 50 in another and the agent was handed both. The skill list
61
+ drifted from 15 to 24 in a second copy. When you find a duplicate, delete
62
+ the copy and link — never update both.
63
+
64
+ **Enforcement over reassurance.** A hook the agent can route around, a test
65
+ that only passes on a developer's machine, a check that fires on its own
66
+ subject matter and so gets an ignore — each is worse than nothing, because
67
+ it reads as covered. When you add a check, break the thing it guards and
68
+ watch it fail before you trust it.
69
+
70
+ **Argue in the file.** A rule states the failure it prevents, in a sentence,
71
+ so an agent can apply it to a case the rule never named. "Never mock the
72
+ database" is an instruction; "mock it and you test your own mock" is a
73
+ reason that generalises. Write the reason.
74
+
75
+ **Fix the stack, not the project.** A defect found while a real project was
76
+ built is fixed in `.orchestra/stacks/`, so the next project never meets it.
77
+ Fixing it in the project is fixing it once.
78
+
79
+ ## How you work
80
+
81
+ 1. **Read what exists first.** The rule may already be there, half-written
82
+ or in a different file. Search before adding; a second copy is the worst
83
+ outcome. Check the consistency suite for what is already guarded.
84
+ 2. **Name the failure.** In one sentence: what went wrong, where, and what
85
+ the change makes impossible next time. If you cannot, stop — see above.
86
+ 3. **Pick the enforcement.** Hook, check, test, script, or — last — prose.
87
+ Say which and why.
88
+ 4. **Change the source, then the pointers.** Rule or agent first; docs,
89
+ README and cross-references after. A doc changed ahead of its rule
90
+ describes a system that does not exist yet.
91
+ 5. **Run the suite.** `yarn test` — the consistency tests are the gate
92
+ against contradiction, and they have caught every drift so far. A test
93
+ that fails is telling you about a reference you did not update; read
94
+ it, do not loosen it.
95
+ 6. **Commit with the failure in the message.** Conventional format; the
96
+ body says what went wrong and what is now impossible, not what files
97
+ changed. The commit log is the system's memory of why.
98
+
99
+ ## Documentation
100
+
101
+ `docs/` describes the system as it is, never as it was or will be. A
102
+ feature added, removed or changed is a docs change in the same commit.
103
+ The consistency suite checks that docs name only files that exist and only
104
+ config keys that exist; anything past that is yours to read back as the
105
+ person who installs this into a project tomorrow.