@orkestrel/scaffold 0.0.23 → 0.0.24
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.
- package/README.md +84 -99
- package/dist/bin/main.js +1094 -0
- package/dist/bin/main.js.map +1 -0
- package/dist/host/CLAUDE.md +3 -1
- package/dist/host/agents/orchestration.md +61 -4
- package/dist/host/agents/skills/orkestrel-align-packages/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +7 -5
- package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden-package/references/contract.md +1 -1
- package/dist/host/claude/agents/orkestrel.md +4 -4
- package/dist/host/claude/rules/architecture.md +45 -3
- package/dist/host/claude/rules/quality.md +4 -0
- package/dist/host/claude/rules/tests.md +57 -1
- package/dist/host/claude/rules/workspace.md +50 -17
- package/dist/host/codex/agents/orkestrel.toml +1 -1
- package/dist/host/configs/helpers.ts +762 -0
- package/dist/host/dotfiles/oxlintrc.json +2 -1
- package/dist/host/guides/scaffold.md +862 -0
- package/dist/host/manifest.json +40 -33
- package/dist/host/tests/config.test.ts +544 -0
- package/dist/host/tests/policy.test.ts +46 -0
- package/dist/host/tests/setupPolicy.ts +529 -701
- package/dist/src/core/index.cjs +3568 -10576
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +2361 -2800
- package/dist/src/core/index.d.ts +2361 -2800
- package/dist/src/core/index.js +3512 -10440
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +2855 -3765
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +1915 -1330
- package/dist/src/server/index.d.ts +1915 -1330
- package/dist/src/server/index.js +2812 -3680
- package/dist/src/server/index.js.map +1 -1
- package/package.json +16 -23
- package/dist/bin/scaffold.js +0 -1896
- package/dist/bin/scaffold.js.map +0 -1
- package/dist/host/guides/src/scaffold.md +0 -2922
- /package/dist/host/guides/{src/guide.md → guide.md} +0 -0
package/README.md
CHANGED
|
@@ -1,140 +1,125 @@
|
|
|
1
1
|
# @orkestrel/scaffold
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Compile a workspace specification into an ordered list of files, compare that list to a real
|
|
4
|
+
directory, and write the difference.
|
|
5
|
+
|
|
6
|
+
Every `@orkestrel` repository shares one toolchain, one set of agent instructions, and one set of
|
|
7
|
+
root dotfiles. Scaffold ships that shared set as data inside the package and gives it verbs: create
|
|
8
|
+
a workspace from it, report how a workspace differs from it, and write the difference back.
|
|
5
9
|
|
|
6
10
|
## Install
|
|
7
11
|
|
|
8
12
|
```sh
|
|
9
|
-
npm install -
|
|
13
|
+
npm install --save-dev @orkestrel/scaffold
|
|
10
14
|
```
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
The executable needs Node 22.12 or newer. Run it without installing anything:
|
|
13
17
|
|
|
14
18
|
```sh
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
npx @orkestrel/scaffold --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Verbs
|
|
23
|
+
|
|
24
|
+
Five verbs. Authority is the verb's: every verb except `audit` writes when it is typed, and no
|
|
25
|
+
option grants a write. Exit codes are `0` clean, `1` drift or failure, and `2` usage error.
|
|
26
|
+
|
|
27
|
+
`--target <path>` points any verb at another directory; the working directory is the default.
|
|
28
|
+
`--json` replaces the report with one machine-readable value on standard output.
|
|
29
|
+
|
|
30
|
+
### `new` — scaffold a workspace
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
npx scaffold new
|
|
32
|
+
```sh
|
|
33
|
+
npx scaffold new router --src core,server
|
|
20
34
|
```
|
|
21
35
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
Writes a complete workspace into `./router`: its manifest, its build configuration, empty barrels
|
|
37
|
+
for each selected environment, its tests, its documentation, and every shared file. `--app` selects
|
|
38
|
+
private application environments on an independent axis, and `--deps` names `@orkestrel/*` runtime
|
|
39
|
+
dependencies, each pinned to the registry's latest release. `--bin` adds the command-line entry, its
|
|
40
|
+
test, and its scoped build configuration.
|
|
41
|
+
|
|
42
|
+
### `audit` — report how a target compares to its plan
|
|
27
43
|
|
|
28
44
|
```sh
|
|
29
|
-
npx scaffold
|
|
45
|
+
npx scaffold audit --groups configs,orchestration
|
|
46
|
+
```
|
|
30
47
|
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
Writes nothing. Reports one row per path that differs, and exits `1` when anything does. Omit
|
|
49
|
+
`--groups` to cover every group.
|
|
33
50
|
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
### `repair` — write back what drifted
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npx scaffold repair
|
|
36
55
|
```
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
directory — equal to it or nested beneath — so the CLI is safe to run as a
|
|
42
|
-
global command anywhere; `--from` may point anywhere (read-only).
|
|
57
|
+
Restores each planned path the target is missing or has let drift, then re-audits. A file the
|
|
58
|
+
workspace owns — its manifest, its source, its tests, its README — is written once at creation and
|
|
59
|
+
is never rewritten here.
|
|
43
60
|
|
|
44
|
-
|
|
45
|
-
directly — PowerShell mangles npm's `--` passthrough, so avoid
|
|
46
|
-
`npm run scaffold -- …` there.
|
|
61
|
+
### `catalog` — refresh the package table and the guide mirrors
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
```sh
|
|
64
|
+
npx scaffold catalog --all
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Reads the organization's published package list, rewrites the marker-bounded table in
|
|
68
|
+
`.claude/agents/orkestrel.md`, and fetches each package's guide into its local mirror. Without
|
|
69
|
+
`--all` it fetches only the guides the target declares as dependencies.
|
|
51
70
|
|
|
52
|
-
|
|
71
|
+
### `overwrite` — repair, catalog, delete, and re-pin
|
|
53
72
|
|
|
54
73
|
```sh
|
|
55
|
-
scaffold
|
|
56
|
-
scaffold pull [--apply] [--yes] [--json]
|
|
57
|
-
scaffold mirror [--apply] [--yes] [--json]
|
|
58
|
-
scaffold audit [--live] [--json]
|
|
59
|
-
scaffold repair [--prune] [--apply] [--yes] [--json]
|
|
60
|
-
scaffold fleet [--apply] [--yes] [--json]
|
|
61
|
-
scaffold catalog [--from <path> ...] [--target <repo>] [--offline] [--apply] [--yes] [--json]
|
|
74
|
+
npx scaffold overwrite --dirty
|
|
62
75
|
```
|
|
63
76
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- **`new [name]`** — drafts a `Blueprint` and compiles it into a `Plan`; dry-run by
|
|
69
|
-
default (prints a review), `--apply` writes the workspace to disk. `--src`
|
|
70
|
-
selects published source environments and `--app` independently selects private application
|
|
71
|
-
environments; at least one is required. App-only workspaces are unscoped and `"private": true`,
|
|
72
|
-
while mixed workspaces retain the published `@orkestrel/*` package boundary. `--deps` names
|
|
73
|
-
`@orkestrel/*` runtime dependencies (installed as `dependencies`), resolving an
|
|
74
|
-
absent `@range` to the registry's `latest`; run bare on a terminal, it lands as an
|
|
75
|
-
interactive question. Other npm packages are not a `new`-time flag — hand-add them to
|
|
76
|
-
the generated `package.json`'s `devDependencies` after scaffolding; `audit` derives
|
|
77
|
-
its plan from your `package.json` and stays clean over the addition.
|
|
78
|
-
- **`pull`** — fetches the latest vendored dependency guides and registry versions
|
|
79
|
-
for an existing package and reports drift.
|
|
80
|
-
- **`mirror`** — discovers the exact published `@orkestrel/*` package set from npm and refreshes
|
|
81
|
-
every package's GitHub guide in deterministic name order. It never fetches registry versions or
|
|
82
|
-
overwrites the target package's own guide, and it applies nothing when any guide fetch fails.
|
|
83
|
-
- **`audit`** — a conformance report over the artifacts the plan actually gates: the
|
|
84
|
-
shared host-origin files (presence, or exact bytes once hydrated) AND the generated
|
|
85
|
-
configs/manifest (exact UTF-8 bytes); reports drift as data, findings and all; exits nonzero
|
|
86
|
-
the moment any drift is found. Starter files — source/test
|
|
87
|
-
stubs, starter guides, README — are written once at scaffold time and are
|
|
88
|
-
legitimately outgrown, so they are birth-only and never audited; the build and
|
|
89
|
-
parity gates police their substance instead. `--live` additionally checks upstream
|
|
90
|
-
guide/version freshness — `audit` is the ONLY verb that carries `--live`.
|
|
91
|
-
- **`repair`** — restores the shared HOST set only (generated source/tests/configs are
|
|
92
|
-
never touched); re-derives the plan from the audit and re-applies only the drifted
|
|
93
|
-
host artifacts; dry-run by default, `--apply` writes the fixes, `--prune` also removes
|
|
94
|
-
target-only files the plan no longer declares (asked as a separate destructive
|
|
95
|
-
question when run bare).
|
|
96
|
-
- **`fleet`** — audits/repairs the shared, host-owned files (`AGENTS.md`,
|
|
97
|
-
`CLAUDE.md`, `.agents/` skills, `.claude/`, `.codex/`, `scripts/`, the shared dotfiles, …) across every
|
|
98
|
-
`@orkestrel` repo that is an IMMEDIATE CHILD of the current directory — no root
|
|
99
|
-
flag; the scope is always your checkouts folder, so `cd` there first (`repair`
|
|
100
|
-
is the single-repo counterpart, run from inside one repo); dry-run by default,
|
|
101
|
-
`--apply` writes.
|
|
102
|
-
- **`catalog`** — regenerates the orkestrel agent's package catalog; the npm
|
|
103
|
-
registry is the AUTHORITATIVE package list by default (unauthenticated —
|
|
104
|
-
every fleet repo is public), each `--from <path>` ADDS local-only discoveries
|
|
105
|
-
on top of it, `--offline` sources the `--from` path(s) only, and the table
|
|
106
|
-
writes into `--target`'s `.claude/agents/orkestrel.md`; dry-run by default,
|
|
107
|
-
`--apply` writes, and a shrink warning prints whenever the new table would
|
|
108
|
-
have fewer rows than the currently-embedded one.
|
|
77
|
+
Everything `repair` and `catalog` do, plus the two steps only this verb carries: it deletes tracked
|
|
78
|
+
files the plan does not own, and it rewrites the `@orkestrel/*` ranges in the manifest to the
|
|
79
|
+
registry's latest releases. It needs a git repository, and it refuses a tree carrying uncommitted
|
|
80
|
+
changes unless `--dirty` waives that refusal.
|
|
109
81
|
|
|
110
82
|
## Library
|
|
111
83
|
|
|
84
|
+
Two entry points, split by host. `@orkestrel/scaffold` is host-independent: it compiles, gates, and
|
|
85
|
+
compares.
|
|
86
|
+
|
|
112
87
|
```ts
|
|
113
|
-
import {
|
|
88
|
+
import { createBlueprint, createCompiler } from '@orkestrel/scaffold'
|
|
114
89
|
|
|
115
|
-
const draft = blueprint('example', {
|
|
116
|
-
src: ['core'],
|
|
117
|
-
app: ['core', 'browser', 'server'],
|
|
118
|
-
})
|
|
119
90
|
const compiler = createCompiler()
|
|
120
|
-
const scaffolding = compiler.compile(
|
|
121
|
-
|
|
91
|
+
const scaffolding = compiler.compile(createBlueprint('router', { src: ['core', 'server'] }))
|
|
92
|
+
|
|
93
|
+
scaffolding.plan?.artifacts // every planned file, in group order
|
|
122
94
|
compiler.destroy()
|
|
123
95
|
```
|
|
124
96
|
|
|
125
|
-
`@orkestrel/scaffold/server`
|
|
126
|
-
|
|
127
|
-
|
|
97
|
+
`@orkestrel/scaffold/server` is Node-only and holds everything that touches the filesystem or the
|
|
98
|
+
network: `createMaterializer` writes a plan into a target, `createUpstream` reads the registry and
|
|
99
|
+
the guide host, and `WriteTransaction` stages and swaps a set of files with rollback.
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import type { Plan } from '@orkestrel/scaffold'
|
|
103
|
+
import { createMaterializer } from '@orkestrel/scaffold/server'
|
|
104
|
+
|
|
105
|
+
declare const plan: Plan
|
|
106
|
+
|
|
107
|
+
const materializer = createMaterializer()
|
|
108
|
+
const result = materializer.materialize(plan, './packages/router')
|
|
109
|
+
|
|
110
|
+
result.written // every path created
|
|
111
|
+
materializer.destroy()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Guide
|
|
128
115
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
and swaps only after completion. Reading validates that every declared storage
|
|
132
|
-
file exists, every staged file is declared, and every destination root is
|
|
133
|
-
complete; a present but corrupt or truncated manifest fails closed.
|
|
116
|
+
[`guides/scaffold.md`](guides/scaffold.md) documents every public export, the compile stages, the
|
|
117
|
+
vendored data root, and the generated file set.
|
|
134
118
|
|
|
135
|
-
##
|
|
119
|
+
## Notes
|
|
136
120
|
|
|
137
|
-
|
|
121
|
+
On Windows, run the executable as `npx scaffold …` or `node ./dist/bin/main.js …`. PowerShell
|
|
122
|
+
mangles npm's `--` passthrough, so avoid `npm run scaffold -- …` there.
|
|
138
123
|
|
|
139
124
|
## License
|
|
140
125
|
|