Blueprint-to-plan package scaffolding, auditing, dependency guide/version pulling,
complete guide mirroring, and fleet-wide shared-file upkeep for the @orkestrel line.
npm install -D @orkestrel/scaffold# from a checkout (after npm run build)
node ./dist/bin/scaffold.js new
# once installed
npx scaffold newRun any verb bare on a terminal and it guides you: it prompts for whatever's
missing, previews what it's about to do, and ASKS before writing anything
(destructive extras like --prune are a second, separate question) — hit
ctrl-c at any prompt and nothing is written. Prefer scripting instead? Every
flag from the guided flow works standalone:
npx scaffold new mypackage --src core --app core,browser,server --apply
# refresh every published Orkestrel package guide in the current target
npx scaffold mirror --apply --yes
# the same command from this checkout, after npm run build
node ./dist/bin/scaffold.js mirror --apply --yesIn scripts, every verb is dry-run by default and fully non-interactive —
add --apply and/or --yes to make it write, --json for one machine-readable
value instead of prose. Every write destination resolves under the current
directory — equal to it or nested beneath — so the CLI is safe to run as a
global command anywhere; --from may point anywhere (read-only).
Windows/PowerShell: invoke as node ./dist/bin/scaffold.js … or npx scaffold …
directly — PowerShell mangles npm's -- passthrough, so avoid
npm run scaffold -- … there.
TLS: when the running Node release exposes system-CA controls, the CLI adds
the operating-system certificate store. Earlier supported Node 22 releases use
Node's default roots. NODE_EXTRA_CA_CERTS adds custom PEMs in either case.
scaffold new [name] [--src <list>] [--app <list>] [--deps <list>] [--apply] [--yes] [--json]
scaffold pull [--apply] [--yes] [--json]
scaffold mirror [--apply] [--yes] [--json]
scaffold audit [--live] [--json]
scaffold repair [--prune] [--apply] [--yes] [--json]
scaffold fleet [--apply] [--yes] [--json]
scaffold catalog [--from <path> ...] [--target <repo>] [--offline] [--apply] [--yes] [--json]Run bare, every verb above guides you interactively; the flags shown are the
scripting form. Exit codes: 0 clean/success, 1 drift or failure, 2 usage
error.
new [name]— drafts aBlueprintand compiles it into aPlan; dry-run by default (prints a review),--applywrites the workspace to disk.--srcselects published source environments and--appindependently selects private application environments; at least one is required. App-only workspaces are unscoped and"private": true, while mixed workspaces retain the published@orkestrel/*package boundary.--depsnames@orkestrel/*runtime dependencies (installed asdependencies), resolving an absent@rangeto the registry'slatest; run bare on a terminal, it lands as an interactive question. Other npm packages are not anew-time flag — hand-add them to the generatedpackage.json'sdevDependenciesafter scaffolding;auditderives its plan from yourpackage.jsonand stays clean over the addition.pull— fetches the latest vendored dependency guides and registry versions for an existing package and reports drift.mirror— discovers the exact published@orkestrel/*package set from npm and refreshes every package's GitHub guide in deterministic name order. It never fetches registry versions or overwrites the target package's own guide, and it applies nothing when any guide fetch fails.audit— a conformance report over the artifacts the plan actually gates: the shared host-origin files (presence, or exact bytes once hydrated) AND the generated configs/manifest (exact UTF-8 bytes); reports drift as data, findings and all; exits nonzero the moment any drift is found. Starter files — source/test stubs, starter guides, README — are written once at scaffold time and are legitimately outgrown, so they are birth-only and never audited; the build and parity gates police their substance instead.--liveadditionally checks upstream guide/version freshness —auditis the ONLY verb that carries--live.repair— restores the shared HOST set only (generated source/tests/configs are never touched); re-derives the plan from the audit and re-applies only the drifted host artifacts; dry-run by default,--applywrites the fixes,--prunealso removes target-only files the plan no longer declares (asked as a separate destructive question when run bare).fleet— audits/repairs the shared, host-owned files (AGENTS.md,CLAUDE.md,.agents/skills,.claude/,.codex/,scripts/, the shared dotfiles, …) across every@orkestrelrepo that is an IMMEDIATE CHILD of the current directory — no root flag; the scope is always your checkouts folder, socdthere first (repairis the single-repo counterpart, run from inside one repo); dry-run by default,--applywrites.catalog— regenerates the orkestrel agent's package catalog; the npm registry is the AUTHORITATIVE package list by default (unauthenticated — every fleet repo is public), each--from <path>ADDS local-only discoveries on top of it,--offlinesources the--frompath(s) only, and the table writes into--target's.claude/agents/orkestrel.md; dry-run by default,--applywrites, and a shrink warning prints whenever the new table would have fewer rows than the currently-embedded one.
import { blueprint, createCompiler } from '@orkestrel/scaffold'
const draft = blueprint('example', {
src: ['core'],
app: ['core', 'browser', 'server'],
})
const compiler = createCompiler()
const scaffolding = compiler.compile(draft)
scaffolding.plan?.artifacts.length
compiler.destroy()@orkestrel/scaffold/server carries the impure API — createMaterializer
(writes a Plan to disk) and createSync (the only part of the system that
touches the network, fetching dependency guides, fleet guide mirrors, and registry versions).
The built host uses an exact { entries, roots } manifest. Staging preflights
containment and portable file-tree collisions, builds in a temporary sibling,
and swaps only after completion. Reading validates that every declared storage
file exists, every staged file is declared, and every destination root is
complete; a present but corrupt or truncated manifest fails closed.
For the full API, see guides/src/scaffold.md.