@orkestrel/scaffold 0.0.2 → 0.0.4

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 (82) hide show
  1. package/README.md +29 -15
  2. package/dist/bin/scaffold.js +1162 -1200
  3. package/dist/bin/scaffold.js.map +1 -1
  4. package/dist/host/AGENTS.md +124 -925
  5. package/dist/host/CLAUDE.md +335 -495
  6. package/dist/host/agents/skills/orkestrel-align-packages/SKILL.md +53 -0
  7. package/dist/host/agents/skills/orkestrel-align-packages/agents/openai.yaml +4 -0
  8. package/dist/host/agents/skills/orkestrel-align-packages/references/fleet.md +50 -0
  9. package/dist/host/agents/skills/orkestrel-align-packages/references/integration.md +56 -0
  10. package/dist/host/agents/skills/orkestrel-build-application/SKILL.md +64 -0
  11. package/dist/host/agents/skills/orkestrel-build-application/agents/openai.yaml +4 -0
  12. package/dist/host/agents/skills/orkestrel-build-application/references/application.md +129 -0
  13. package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +64 -0
  14. package/dist/host/agents/skills/orkestrel-harden-package/agents/openai.yaml +4 -0
  15. package/dist/host/agents/skills/orkestrel-harden-package/references/centralization.md +85 -0
  16. package/dist/host/agents/skills/orkestrel-harden-package/references/contract.md +57 -0
  17. package/dist/host/agents/skills/orkestrel-harden-package/references/hardening.md +93 -0
  18. package/dist/host/agents/skills/orkestrel-harden-package/references/research.md +61 -0
  19. package/dist/host/claude/agents/application.md +30 -0
  20. package/dist/host/claude/agents/builder.md +10 -7
  21. package/dist/host/claude/agents/checker.md +14 -8
  22. package/dist/host/claude/agents/codex.md +94 -0
  23. package/dist/host/claude/agents/grok.md +37 -34
  24. package/dist/host/claude/agents/implementer.md +40 -0
  25. package/dist/host/claude/agents/orkestrel.md +88 -223
  26. package/dist/host/claude/agents/planner.md +13 -34
  27. package/dist/host/claude/agents/reviewer.md +38 -24
  28. package/dist/host/claude/agents/verifier.md +14 -10
  29. package/dist/host/claude/rules/application.md +57 -0
  30. package/dist/host/claude/rules/architecture.md +180 -0
  31. package/dist/host/claude/rules/browser.md +28 -0
  32. package/dist/host/claude/rules/documentation.md +64 -0
  33. package/dist/host/claude/rules/names.md +209 -0
  34. package/dist/host/claude/rules/patterns.md +130 -0
  35. package/dist/host/claude/rules/quality.md +45 -0
  36. package/dist/host/claude/rules/styles.md +64 -0
  37. package/dist/host/claude/rules/tests.md +123 -0
  38. package/dist/host/claude/rules/typescript.md +78 -0
  39. package/dist/host/claude/rules/workspace.md +180 -0
  40. package/dist/host/claude/settings.json +112 -0
  41. package/dist/host/claude/skills/orkestrel-align-packages/SKILL.md +10 -0
  42. package/dist/host/claude/skills/orkestrel-build-application/SKILL.md +12 -0
  43. package/dist/host/claude/skills/orkestrel-harden-package/SKILL.md +10 -0
  44. package/dist/host/codex/agents/analyst.toml +15 -0
  45. package/dist/host/codex/agents/application.toml +25 -0
  46. package/dist/host/codex/agents/builder.toml +24 -0
  47. package/dist/host/codex/agents/checker.toml +15 -0
  48. package/dist/host/codex/agents/grok.toml +17 -0
  49. package/dist/host/codex/agents/implementer.toml +17 -0
  50. package/dist/host/codex/agents/opus.toml +25 -0
  51. package/dist/host/codex/agents/orkestrel.toml +16 -0
  52. package/dist/host/codex/agents/planner.toml +20 -0
  53. package/dist/host/codex/agents/reviewer.toml +18 -0
  54. package/dist/host/codex/agents/verifier.toml +14 -0
  55. package/dist/host/codex/config.toml +66 -0
  56. package/dist/host/cursor/mcp.json +12 -0
  57. package/dist/host/dotfiles/mcp.json +8 -0
  58. package/dist/host/dotfiles/oxlintrc.json +307 -1
  59. package/dist/host/guides/src/scaffold.md +2059 -2007
  60. package/dist/host/manifest.json +376 -137
  61. package/dist/host/scripts/codex.sh +49 -0
  62. package/dist/host/scripts/cursor.sh +33 -47
  63. package/dist/host/scripts/deps.sh +34 -16
  64. package/dist/host/scripts/ollama.sh +6 -149
  65. package/dist/host/tests/setupPolicy.ts +390 -0
  66. package/dist/src/core/index.cjs +6603 -1200
  67. package/dist/src/core/index.cjs.map +1 -1
  68. package/dist/src/core/index.d.cts +802 -267
  69. package/dist/src/core/index.d.ts +802 -267
  70. package/dist/src/core/index.js +6521 -1192
  71. package/dist/src/core/index.js.map +1 -1
  72. package/dist/src/server/index.cjs +3132 -593
  73. package/dist/src/server/index.cjs.map +1 -1
  74. package/dist/src/server/index.d.cts +643 -95
  75. package/dist/src/server/index.d.ts +643 -95
  76. package/dist/src/server/index.js +3054 -594
  77. package/dist/src/server/index.js.map +1 -1
  78. package/package.json +16 -12
  79. package/dist/host/claude/agents/composer.md +0 -64
  80. package/dist/host/claude/agents/researcher.md +0 -38
  81. package/dist/host/claude/agents/scout.md +0 -35
  82. package/dist/host/github/workflows/ci.yml +0 -64
@@ -1,47 +1,61 @@
1
1
  ---
2
2
  name: reviewer
3
- description: 'Judgment review of implemented work — correctness, design fit, security, and the conformance a checklist cannot catch. Use after any non-trivial build, alongside the checker. Read-only; describes required changes with evidence, never makes them. Also the mandatory judgment gate for external (Cursor) delegate output — same bar, zero trust.'
3
+ description: 'Subjective design-fit review of implemented work — API feel, vocabulary, architecture shape, guide voice, and conceptual coherence. Reads the actual diff after any non-trivial build, alongside the Sol correctness audit and mechanical checker. Never edits.'
4
4
  tools: Read, Grep, Glob
5
5
  model: opus
6
6
  effort: high
7
+ permissionMode: dontAsk
7
8
  ---
8
9
 
9
- You are the **Reviewer** — the judgment auditor of this project's orchestration
10
- triad (see CLAUDE.md). You are independent of the builder: their self-assessment
11
- carries no weight with you. You are an Executor: do the audit yourself, spawn
12
- nothing.
10
+ You are the **Reviewer** — the subjective design-fit auditor in this project's
11
+ role set (see CLAUDE.md). You are independent of the builder: their
12
+ self-assessment carries no weight with you. You are an Executor: do the audit
13
+ yourself, spawn nothing.
13
14
 
14
15
  ## Job
15
16
 
16
- Audit the changed work against, in order:
17
-
18
- 1. **The acceptance criteria** in the dispatch — actually met, not nearly met.
19
- 2. **Correctness** does it do the thing, including edge cases and failure paths?
20
- Verify against the source; never take the builder's summary as fact.
21
- 3. **Design** — does it fit the architecture and patterns of AGENTS.md and the
22
- governing guides: right layer, right abstraction, composes what exists instead of
23
- duplicating it?
24
- 4. **Security & safety** — inputs, boundaries, secrets, injection, unsafe defaults.
25
- 5. **Diff honesty** — nothing smuggled outside the owned scope, no suppressions, no
26
- drive-by changes.
17
+ Read `AGENTS.md`, every rule applicable to the changed paths/concepts, the
18
+ dispatch-named skill and required references, the governing guide/spec, the actual
19
+ diff and status evidence supplied by the Orchestrator, and enough surrounding
20
+ source to judge it. If the dispatch omits the diff, return a deviation instead of
21
+ reconstructing it with a shell.
22
+
23
+ Audit the changed work only through Opus 5's subjective and creative lens:
24
+
25
+ 1. **Design acceptance criteria** — the requested experience, shape, and voice are
26
+ actually present, not merely approximated.
27
+ 2. **API and vocabulary** — names, ergonomics, conceptual boundaries, and the
28
+ single shared language feel deliberate and coherent.
29
+ 3. **Architecture fit** — the work belongs at the chosen layers and abstractions,
30
+ composes naturally, and does not introduce awkward conceptual machinery.
31
+ 4. **Simplification** — the design earns each concept and wrapper and leaves the
32
+ package easier for a human to understand.
33
+ 5. **Guide voice and product coherence** — documentation reads as the package's
34
+ current, self-contained human guide and matches the experience the code presents.
27
35
 
28
36
  Read the actual diff plus enough surrounding code to judge it in context.
37
+ Correctness, security, dependency constraints, test sufficiency, and mechanical
38
+ conformance belong to the independent Sol analyst and checker. If you notice a
39
+ possible objective defect, report it as a specifically evidenced **Analyst
40
+ referral** rather than adjudicating it.
29
41
 
30
42
  ## External input
31
43
 
32
- - A composer worktree diff in the dispatch is audited like any builder's work in the
33
- worktree path given, against the same five lenses. External origin raises the bar; it
34
- never lowers it.
35
- - Grok findings included in the dispatch are HYPOTHESES: verify each against the
36
- source, then either confirm it into Required changes / Advisories with your own
37
- evidence, or strike it explicitly. Your verdict is the only one that counts.
44
+ - A Cursor or Codex diff is audited like any builder's work, at the given
45
+ path and against the same review lenses. External origin raises no authority.
46
+ - Cursor or Codex design findings are **proposals**. Test each against the actual
47
+ product shape; retain or strike it explicitly. Your verdict is authoritative only
48
+ as input to the Orchestrator.
38
49
 
39
50
  ## Output contract — the Verdict
40
51
 
41
- - **Verdict** — PASS or FAIL. Any required change means FAIL.
52
+ - **Verdict** — PASS or FAIL for subjective design fit. Any required design change
53
+ means FAIL.
42
54
  - **Required changes** — each with file:line, what is wrong, why it matters, and
43
55
  what right looks like — actionable enough to re-dispatch verbatim.
56
+ - **Analyst referrals** — specifically evidenced objective questions for Sol, with
57
+ no verdict from you.
44
58
  - **Advisories** — improvements that do not block.
45
- - **Confirmations** — each acceptance criterion checked, one line each.
59
+ - **Confirmations** — each design criterion checked, one line each.
46
60
 
47
61
  You are read-only: you never edit. Return only the verdict, never your process.
@@ -1,25 +1,29 @@
1
1
  ---
2
2
  name: verifier
3
- description: 'Runs the authoritative quality gates — format, check, build, targeted tests — or the exact scoped gate set / evidence commands the dispatch names, and reports true pass/fail per gate with exact failure excerpts. Independent of every builder; its report is the source of truth for green. Never fixes anything.'
3
+ description: 'Runs the exact authoritative quality gates or evidence commands named by the dispatch and reports exit-code truth with exact failure excerpts. Defaults to source-nonmutating check variants before build/test. Independent of every executor; never fixes.'
4
4
  tools: Read, Grep, Glob, Bash
5
5
  model: sonnet
6
6
  effort: low
7
+ permissionMode: default
7
8
  ---
8
9
 
9
- You are the **Verifier** — the gate-runner of this project's orchestration triad
10
- (see CLAUDE.md). Independence is the point: no builder's self-report counts, yours
11
- does. You are an Executor: run the gates yourself, spawn nothing.
10
+ You are the **Verifier** — the independent gate runner in this project's role set
11
+ (see CLAUDE.md). No builder's self-report counts as gate evidence. You are an
12
+ Executor: run the gates yourself, spawn nothing.
12
13
 
13
14
  ## Job
14
15
 
15
- 1. Run EXACTLY the commands the dispatch names, in order. The default authoritative
16
- sweep, when the dispatch says so: `format` → `check` → `build` → the targeted
17
- test project(s) it names. Never invent broader or narrower gates than dispatched.
18
- 2. Evidence runs count as gates: when dispatched to reproduce a failure, run the
16
+ 1. Read `AGENTS.md`, applicable rules, the dispatch-named skill and required
17
+ references, and the governing guide/spec.
18
+ 2. Run exactly the commands the dispatch names, in order. When asked for the default
19
+ independent sweep, use `npm run format:check` `npm run lint:check`
20
+ `npm run check` → `npm run build` → `npm test`. These do not rewrite source;
21
+ build artifacts are allowed. Never invent a different gate set.
22
+ 3. Evidence runs count as gates: when dispatched to reproduce a failure, run the
19
23
  named command and capture its exact output — reproduce, capture, bisect
20
24
  mechanically if told to; nothing more.
21
- 3. Record each gate's TRUE outcome by exit code. A gate that "mostly passes" FAILED.
22
- 4. On failure, capture the exact failing excerpt — trimmed to the failure, not the
25
+ 4. Record each gate's TRUE outcome by exit code. A gate that "mostly passes" FAILED.
26
+ 5. On failure, capture the exact failing excerpt — trimmed to the failure, not the
23
27
  noise — and the file:line it points to.
24
28
 
25
29
  ## Output contract — the Gate Report
@@ -0,0 +1,57 @@
1
+ ---
2
+ paths:
3
+ - 'app/**/*'
4
+ - 'tests/app/**/*'
5
+ - 'configs/app/**/*'
6
+ - 'package.json'
7
+ - 'tsconfig.json'
8
+ - 'vite.config.ts'
9
+ - '.oxlintrc.json'
10
+ ---
11
+
12
+ # Application composition
13
+
14
+ - Select only needed app environments; app-only, src-only, and mixed workspaces
15
+ are first-class.
16
+ - The CLI names the independent selections `--src` and `--app`.
17
+ `--surfaces` is not an alias and must fail as an unknown option.
18
+ - Core-only, browser-only, and server-only applications are valid. A combined
19
+ browser+server application includes app/core for shared contracts.
20
+ - Every selected environment has an `index.ts` barrel. `main.ts` is an executable
21
+ entry and never owns reusable declarations.
22
+ - app/core is host-independent and check/test-only.
23
+ - app/browser uses app/core contracts, Vue 3 when selected, an `index.html`
24
+ entry, `vue-tsc`, and real Chromium tests.
25
+ - app/server uses app/core contracts, parses environment values before binding,
26
+ defaults to loopback, emits `dist/app/server/main.cjs`, and keeps only
27
+ `node:*` external.
28
+ - Browser/server integration crosses a contract/transport boundary. Neither
29
+ environment imports the other's implementation. `.oxlintrc.json`
30
+ `no-restricted-imports` enforces declared package, alias, and conventional
31
+ relative import direction. Scoped TypeScript configurations remove Node/DOM
32
+ globals from the wrong environment. Vite's actual browser and server builds
33
+ resolve Vue, assets, CSS, workers, and runtime module graphs. Generated
34
+ consumers must pass lint, scoped typechecking, production builds, and real
35
+ integration tests. Do not introduce a custom parser or source-language
36
+ analyzer to duplicate the project toolchain.
37
+ - Scoped checks include `.ts`, `.tsx`, `.mts`, and `.cts`. Vue SFCs and CSS
38
+ belong to browser environments; SCSS requires an authorized compiler dependency.
39
+ - Published `src` environments never import private `app` modules. Src core is
40
+ host-independent; src browser/server may import src core but never one
41
+ another's implementation. Apply the same environment law to
42
+ `@orkestrel/<package>/browser` and `/server` exports.
43
+ - App-only manifests are unscoped and `private: true`, with no package export
44
+ map or publish configuration. Mixed manifests publish only `dist/src`, and
45
+ Vue remains development-only because app output is never published.
46
+ - app/server process signals belong to a tested, explicitly stoppable,
47
+ generation-safe runner whose stale failures cannot release a newer run;
48
+ convenience startup returns the runner so normal cleanup cannot be hidden.
49
+ `ApplicationServerRunner` lives alone in `ApplicationServerRunner.ts`, and the
50
+ `startApplicationServer` convenience factory belongs in `factories.ts`.
51
+ `main.ts` invokes it and owns no reusable declarations or duplicated signal
52
+ handling.
53
+ - Do not add showcase, auth, storage, proxy, CSS framework, or other product
54
+ policy unless the request requires it.
55
+ - Test repeated lifecycle, concurrent calls, malformed environment input,
56
+ protocol rejection, abort/cleanup where applicable, and cross-environment
57
+ contract parity using real hosts.
@@ -0,0 +1,180 @@
1
+ ---
2
+ paths:
3
+ - 'src/**/*.ts'
4
+ - 'app/**/*.{ts,vue}'
5
+ - 'tests/**/*.ts'
6
+ - 'configs/**/*.ts'
7
+ - 'vite.config.ts'
8
+ - 'tsconfig.json'
9
+ - 'package.json'
10
+ ---
11
+
12
+ # Architecture and placement rules
13
+
14
+ ## Centralized-file pattern
15
+
16
+ | Content | Sole location |
17
+ | ------------------------- | -------------------------------------------- |
18
+ | Interfaces/types | `*/types.ts` |
19
+ | Constants/data | `*/constants.ts` |
20
+ | Pure helpers | `*/helpers.ts` |
21
+ | Guards | `*/validators.ts` |
22
+ | Guard combinators | `*/combinators.ts` |
23
+ | Owned snapshots | `*/cloners.ts` |
24
+ | Coercers | `*/parsers.ts` |
25
+ | Shape values | `*/shapers.ts` |
26
+ | Value inferers | `*/inferers.ts` |
27
+ | Shape/algorithm compilers | `*/compilers.ts` |
28
+ | Entity/value factories | `*/factories.ts` |
29
+ | Middleware factories | `*/middlewares.ts` |
30
+ | Seeders | `*/seeders.ts` |
31
+ | Schemas | `*/schemas.ts` |
32
+ | Relations | `*/relations.ts` |
33
+ | Error classes/guards | `*/errors.ts` |
34
+ | Public exports | `*/index.ts` |
35
+ | Implementations | `*/[domain]/[Entity].ts`, one class per file |
36
+
37
+ Use only the centralized files an environment needs.
38
+
39
+ ## Declaration placement
40
+
41
+ - An implementation file contains imports and exactly one class implementation with `#` fields.
42
+ - It contains no module-scope interface, type, constant, or free function—even when private to that file.
43
+ - Extract local declarations by kind. “Only used here” and “not exported” are not exemptions.
44
+ - Every declaration in a centralized file is exported. Fold away a trivial single-use declaration or export/test it; never leave it hidden.
45
+ - The only permitted non-exported module-scope declarations are in a runtime entrypoint that must be self-contained and cannot import siblings, such as raw source loaded in a worker. Explain that necessity in a comment.
46
+ - Perform a cleanup sweep after implementation: no stray implementation-file declarations, non-exported/wrong-kind centralized declarations, prohibited nested declarations, duplicate implementations, compatibility aliases, superfluous wrappers, stale imports/barrel rows, or untested extracted functions.
47
+
48
+ ## Kind purity
49
+
50
+ - Each centralized file contains only its named kind.
51
+ - Module-scope constants live only in `constants.ts`, use UPPER_SNAKE_CASE, and freeze object/array data with `Object.freeze`.
52
+ - A camelCase namespace containing functions is helper behavior, not constant data; place it in `helpers.ts`.
53
+ - `helpers.ts` is exported reusable infrastructure. A reusable regex, parser, header flattener, signer, or similar fragment has one implementation used by source, tests, and fixtures.
54
+ - A would-be helper has two outcomes:
55
+ - trivial and genuinely single-use → fold into its caller;
56
+ - non-trivial or reusable → extract, export, unit-test, and route every duplicate through it.
57
+ - `factories.ts`, `compilers.ts`, and `parsers.ts` are centralized files, not hiding places. Factory glue extracts to `helpers.ts`; pure compiler/parser recursion remains exported in its own kind file.
58
+
59
+ ## Wrapper test
60
+
61
+ A wrapper survives only when it adds a real boundary, invariant, composition, translation, lifecycle, or materially narrower contract.
62
+
63
+ - Delete one-line delegates, pass-through factories, rename-only helpers/getters, compatibility aliases, and wrappers around semantically identical platform or declared-dependency primitives.
64
+ - Rename or import the real symbol and update every consumer atomically. Do not preserve a wrapper to avoid downstream edits.
65
+ - Do not re-export a dependency's symbol from this package.
66
+ - A public class method composes real entity behavior; it never exists only to forward 1:1 to a helper.
67
+ - Audit callers and callees after every extraction so the old path and duplicate implementation do not remain.
68
+
69
+ ## Functions and orchestration
70
+
71
+ - Never declare or assign a function inside another function or method.
72
+ - This bans local `function`, `function*`, and `const fn = () => ...`, regardless of caller count.
73
+ - The only in-body function expressions allowed are an anonymous callback passed directly as an argument and an anonymous function returned directly as the result (the factory/combinator pattern).
74
+ - Instance-bound work that reaches state or sibling methods is a method, not a free function.
75
+
76
+ Separate three roles:
77
+
78
+ 1. **Public method:** implements the interface and genuinely composes behavior; never forwards 1:1 to one helper.
79
+ 2. **`#` private method:** stateful/instance-bound orchestration or the class's defining recursive/compositional algorithm.
80
+ 3. **Centralized helper:** pure referentially transparent leaf, independently understandable/testable without class knowledge.
81
+
82
+ Apply the leaf test:
83
+
84
+ 1. Reaches `#` state or a sibling method → private method.
85
+ 2. Pure self-contained computation (key, format, compare, convert, lookup, projection, one unification) → exported helper.
86
+ 3. Recursive spine or composition of leaves (`solve`, `isolate`, `prove`, chaining, relational join), even if pure → private method.
87
+ 4. Defining engine internals remain methods when extraction would hollow the class into a thin delegate.
88
+
89
+ Extract pure leaves aggressively; keep the class's actual behavior.
90
+
91
+ ## Class order
92
+
93
+ 1. `#` private fields: context, options, state/result, child managers.
94
+ 2. Constructor: initialize context/options and instantiate child managers.
95
+ 3. Public interface: getters, then methods.
96
+ 4. `#` private methods.
97
+
98
+ Store child managers in `#` fields and expose readonly getters typed as their interfaces.
99
+
100
+ ## Middleware
101
+
102
+ - Middleware is behavior `(context, next) => ...`, never a class with one `handle` method.
103
+ - Place middleware factories in `middlewares.ts` as `createX(options): Middleware`; keep them distinct from entity/value factories.
104
+ - Keep middleware-local state closure-private.
105
+ - If consumers must address, share, inspect, or replace that state, extract the state to a pluggable class supplied as an option, with an in-memory default.
106
+ - Extract reusable cross-middleware machinery to helpers/classes.
107
+ - `MiddlewareManager` is the sole manager of the middleware composition chain; do not create one manager per middleware.
108
+
109
+ ## Environment/module placement
110
+
111
+ - Shared cross-environment logic belongs in the central core/shared layer. Other environments import core; core imports neither browser nor server.
112
+ - An environment with multiple modules keeps cross-module types/helpers at the environment root and module-specific declarations inside the module.
113
+ - Promote a declaration to the environment root only when at least two modules use it.
114
+ - The environment barrel re-exports root files and module barrels.
115
+ - Cover cross-cutting environment-root helpers with behavioral tests; each module API receives its own guide parity.
116
+
117
+ ### Entity subfolders
118
+
119
+ - When one entity grows a family (entity + manager or sibling implementations), nest only its class files in a lowercase plural folder.
120
+ - Keep its interfaces in module-root `types.ts`, factories in module-root `factories.ts`, and exports in the module barrel.
121
+ - Entity subfolders never grow their own centralized files.
122
+
123
+ ### Extension categories
124
+
125
+ - A designed extension point—drivers, stores, transports—gets its category folder even with one concrete class.
126
+ - This applies both to consumer implementations of another domain's contract and default implementations beside the defining contract.
127
+ - The contract remains in module-root `types.ts`; only concrete classes nest.
128
+ - Nest because the category is a designed growth seam, not because a class name happens to end in `Store` or `Driver`.
129
+ - Co-equal native-object wrappers that are core primitives stay flat.
130
+
131
+ ### Stores
132
+
133
+ Choose the access shape:
134
+
135
+ - **Point access:** `get`, `set`, `delete`.
136
+ - **Bulk restore:** `save`, `load`, `remove`, `clear`.
137
+
138
+ Both obey:
139
+
140
+ - The stored value carries its own id; do not pass a separate id to `set`/`save`.
141
+ - Every primitive is async and returns a `Promise`.
142
+ - Deleting/removing a missing key is a no-op.
143
+ - Concrete stores live in `stores/`; the interface stays in module-root `types.ts`; `create*Store` factories stay in `factories.ts`.
144
+
145
+ ## Barrel exports
146
+
147
+ - `*/index.ts` is the sole public barrel.
148
+ - Only an `index.ts` may re-export.
149
+ - A barrel contains only `export * from './module.js'` declarations. Do not use
150
+ named, default, namespace, or type-only barrel exports.
151
+ - A star-export collision is a design failure: rename the conflicting concept
152
+ at its owner and update consumers. Never hide the collision with a selective
153
+ barrel row.
154
+ - Never re-export a symbol originating in another package; fix consumer imports to the originating package.
155
+ - Implementation files export their own classes directly.
156
+ - When a symbol moves, update every import; never leave a compatibility re-export.
157
+
158
+ ```ts
159
+ export * from './types.js'
160
+ export * from './constants.js'
161
+ export * from './errors.js'
162
+ export * from './validators.js'
163
+ export * from './helpers.js'
164
+ export * from './factories.js'
165
+ export * from './greeters/Greeter.js'
166
+ ```
167
+
168
+ ## System constraints
169
+
170
+ - Build a capability with its first real consumer; do not speculate.
171
+ - Keep interfaces to the smallest primitives the capability requires.
172
+ - For multiple backends, implement shared querying/paging/aggregation in one engine over those primitives. A backend may override an operation only with a genuine native fast path and otherwise falls back to the engine.
173
+ - Centralize any pattern repeated twice.
174
+ - Keep everything generic/reusable and free of unrelated-project logic.
175
+ - Do not expand public API without concrete multi-site need.
176
+ - Do not remove structural files because they are currently empty.
177
+ - Prefer the smallest complete implementation that preserves architecture.
178
+ - No deprecation aliases, compatibility shims, or backward-compatibility branches; update all consumers atomically.
179
+ - No polling/busy loops or recursive microtasks as architecture. Park idle work on an event/abort wakeup and yield long work in cooperative quanta.
180
+ - Framework/server utilities provide mechanism—HMAC, CORS, parsing, sessions, cookies, CSRF, static serving—not product policy such as user models, login flow, or authorization.
@@ -0,0 +1,28 @@
1
+ ---
2
+ paths:
3
+ - 'src/browser/**/*.ts'
4
+ - 'app/browser/**/*.{ts,vue}'
5
+ - 'tests/{src,app}/browser/**/*'
6
+ - 'tests/setupBrowser.ts'
7
+ ---
8
+
9
+ # Vue and browser rules
10
+
11
+ - Never use Vue `$emit`.
12
+ - Coordinate reactivity through props, controllers, stores, services, and composables.
13
+ - A composable exposes readonly refs plus methods; consumers never mutate returned refs directly:
14
+
15
+ ```ts
16
+ function useTheme(): {
17
+ readonly mode: Readonly<Ref<ThemeMode>>
18
+ toggle(): void
19
+ }
20
+ ```
21
+
22
+ - Use utility classes for layout: flex, gap, spacing, sizing.
23
+ - Use the framework's token-backed semantic classes for color/chrome: `.surface`, `.button`, `.muted`, `.accent`.
24
+ - A `[data-theme]` change must retheme the whole interface through tokens.
25
+ - Add custom SCSS only when no utility provides the behavior.
26
+ - Integrate through the framework's Sass variables/functions instead of hand-rolled values.
27
+ - Never write literal colors.
28
+ - Prefer native platform APIs—Popover, `<dialog>`, `hashchange` routing, native events/storage/observers—over custom replacements or added dependencies.
@@ -0,0 +1,64 @@
1
+ ---
2
+ paths:
3
+ - '*.md'
4
+ - 'guides/**/*.md'
5
+ - 'tests/guides/**/*.ts'
6
+ - 'src/**/types.ts'
7
+ - 'src/**/index.ts'
8
+ - 'app/**/types.ts'
9
+ - 'app/**/index.ts'
10
+ - 'src/styles/**/*'
11
+ - '.agents/skills/**/*.md'
12
+ - '.claude/skills/**/*.md'
13
+ ---
14
+
15
+ # Documentation and parity rules
16
+
17
+ Documentation is an enforced contract, not explanatory decoration.
18
+
19
+ ## Authority and workflow
20
+
21
+ - Read the matching spec/guide before code, form the intended design, then compare implementation. Existing code is a verification target, not ground truth.
22
+ - `AGENTS.md` and its linked rules are the sole convention source. Do not create competing instruction copies in guides.
23
+ - `guides/README.md` is the map: maintain both a concept index (`spec ↔ source ↔ tests ↔ showcase`) and directory index.
24
+ - `ROADMAP.md` is the sequenced plan of record. Each chunk reaches green before the next.
25
+ - A showcase is executable proof of public API. A missing demonstration is a missing feature, detectable by parity.
26
+
27
+ ## Parity
28
+
29
+ - Every backticked API in a guide resolves to a real public export.
30
+ - Every public export is documented.
31
+ - TypeScript, SCSS, Markdown, tests, and showcase remain aligned.
32
+ - A parity failure identifies drift; never suppress or weaken the test.
33
+
34
+ For behavioral interfaces/classes:
35
+
36
+ - Document public methods under `## Methods`.
37
+ - Use one method table per interface, keyed by its backticked name.
38
+ - The table's methods exactly match the interface's call-signature members.
39
+ - Readonly data properties remain in the interface's `## Surface` row.
40
+ - Each implementing class exposes exactly its interface methods—no missing or extra public behavior.
41
+
42
+ Parity scope:
43
+
44
+ - Normally scope a guide to one module directory.
45
+ - A layer concept may include the core module and backend modules implementing it.
46
+ - Cross-cutting environment-root helpers are covered by behavioral tests rather than forced into one module guide.
47
+
48
+ ## Guide examples
49
+
50
+ Code fences import through the package's published specifier:
51
+
52
+ - primary/core API: `@orkestrel/<name>`;
53
+ - secondary environment API: `@orkestrel/<name>/<environment>`.
54
+
55
+ Never use in-repository `@src/*` aliases in public guide examples; reserve them for source/tests.
56
+
57
+ ## Workflow skills
58
+
59
+ - Skills prescribe reusable process; they do not copy naming, placement, syntax, lifecycle, or test laws from `AGENTS.md` and rules.
60
+ - Keep `SKILL.md` concise and route conditional detail to one-level `references/`.
61
+ - Frontmatter contains only `name` and a trigger-focused `description`.
62
+ - Do not put model routing or package version catalogs in a skill.
63
+ - Validate every referenced resource and `agents/openai.yaml`; do not leave template TODOs or auxiliary README/changelog files.
64
+ - Keep provider bridges minimal: they load one canonical workflow and add no competing instructions.