@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orkestrel/scaffold",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Blueprint-to-plan package scaffolding, auditing, dependency guide/version pulling, and fleet-wide shared-file upkeep for the @orkestrel line.",
5
5
  "keywords": [
6
6
  "audit",
@@ -24,7 +24,9 @@
24
24
  "scaffold": "./dist/bin/scaffold.js"
25
25
  },
26
26
  "files": [
27
- "dist",
27
+ "dist/src",
28
+ "dist/bin",
29
+ "dist/host",
28
30
  "README.md"
29
31
  ],
30
32
  "type": "module",
@@ -61,11 +63,10 @@
61
63
  "access": "public"
62
64
  },
63
65
  "scripts": {
64
- "clean": "node -e \"try{require('node:fs').rmSync('dist',{recursive:true,force:true})}catch{}\"",
66
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
65
67
  "copy": "node -e \"const fs=require('node:fs'),p=require('node:path'),a=process.argv[1],b=process.argv[2];fs.mkdirSync(p.dirname(b),{recursive:true});fs.cpSync(a,b,{force:true});console.log('Copied: '+a+' to '+b)\"",
66
- "tmp:txt": "node -e \"const fs=require('node:fs'),p=require('node:path');function walk(d){for(const e of fs.readdirSync(d,{withFileTypes:true})){const f=p.join(d,e.name);if(e.isDirectory()){walk(f)}else if(!e.name.endsWith('.md')&&!e.name.endsWith('.txt')){const t=f+'.txt';if(!fs.existsSync(t)){fs.renameSync(f,t)}else{console.warn('Skipping '+f+' — target exists: '+t)}}}}try{walk('tmp')}catch(e){if(e.code!=='ENOENT')throw e}\"",
67
68
  "scaffold": "node ./dist/bin/scaffold.js",
68
- "lint": "oxlint --config .oxlintrc.json --fix .",
69
+ "lint": "oxlint --config .oxlintrc.json --fix --deny-warnings .",
69
70
  "check": "tsc --noEmit --project tsconfig.json && npm run check:src",
70
71
  "check:src": "npm run check:src:core && npm run check:src:server && npm run check:src:bin",
71
72
  "check:src:core": "tsc --noEmit -p configs/src/tsconfig.core.json",
@@ -73,41 +74,44 @@
73
74
  "check:src:bin": "tsc --noEmit -p configs/src/tsconfig.bin.json",
74
75
  "format": "oxfmt --config .oxfmtrc.json --write .",
75
76
  "format:check": "oxfmt --config .oxfmtrc.json --check .",
76
- "lint:check": "oxlint --config .oxlintrc.json .",
77
+ "lint:check": "oxlint --config .oxlintrc.json --deny-warnings .",
77
78
  "test": "npm run test:src && npm run test:guides",
78
79
  "test:src": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:core --project src:server --project src:bin",
79
80
  "test:src:core": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:core",
80
81
  "test:src:server": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:server",
81
82
  "test:src:bin": "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:bin",
83
+ "test:integration": "vitest run --config vite.config.ts --no-cache --reporter=dot --project integration",
82
84
  "test:guides": "vitest run --config vite.config.ts --reporter=dot --project guides",
85
+ "pin": "vitest run --config vite.config.ts --no-cache --project src:core -t pinPlan -u",
83
86
  "build": "npm run clean && npm run build:src && npm run build:host",
84
87
  "build:src": "npm run build:src:core && npm run build:src:server && npm run build:src:bin",
85
88
  "build:src:core": "vite build --config configs/src/vite.core.config.ts && npm run copy dist/src/core/index.d.ts dist/src/core/index.d.cts",
86
89
  "build:src:server": "vite build --config configs/src/vite.server.config.ts && npm run copy dist/src/server/index.d.ts dist/src/server/index.d.cts",
87
90
  "build:src:bin": "vite build --config configs/src/vite.bin.config.ts",
88
91
  "build:host": "node -e \"import('./dist/src/server/index.js').then((m)=>{const n=m.stageHost(process.cwd(),'dist/host').length;console.log('build-host: staged '+n+' file(s) into dist/host')})\"",
89
- "prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test"
92
+ "prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test && npm run test:integration"
90
93
  },
91
94
  "dependencies": {
92
95
  "@orkestrel/console": "^0.0.3",
93
- "@orkestrel/contract": "^0.0.5",
96
+ "@orkestrel/contract": "^0.0.7",
94
97
  "@orkestrel/emitter": "^0.0.3",
95
98
  "@orkestrel/markdown": "^0.0.5",
96
99
  "@orkestrel/template": "^0.0.1",
97
100
  "@orkestrel/terminal": "^0.0.4"
98
101
  },
99
102
  "devDependencies": {
100
- "@microsoft/api-extractor": "^7.58.11",
103
+ "@microsoft/api-extractor": "^7.58.12",
101
104
  "@orkestrel/guide": "^0.0.5",
102
105
  "@types/node": "^26.1.1",
103
- "oxfmt": "^0.59.0",
104
- "oxlint": "^1.74.0",
106
+ "@vitest/browser-playwright": "^4.1.10",
107
+ "oxfmt": "^0.60.0",
108
+ "oxlint": "^1.75.0",
105
109
  "typescript": "^6.0.3",
106
110
  "vite": "^8.1.5",
107
111
  "vite-plugin-dts": "^5.0.3",
108
112
  "vitest": "^4.1.10"
109
113
  },
110
114
  "engines": {
111
- "node": ">=22"
115
+ "node": ">=22.12.0"
112
116
  }
113
117
  }
@@ -1,64 +0,0 @@
1
- ---
2
- name: composer
3
- description: 'Cursor Composer delegate — the external machinist for strict, fully-specified, taste-free mechanical work that is very simple, small, and tedious for scaffolds driven by the @orkestrel/scaffold blueprint spec, bulk renames, boilerplate expansion, matrix-derived config, small spec-complete migrations. Runs the Cursor CLI in an isolated git worktree; never the main tree, never commits or pushes. Returns a run report + worktree diff pointers for independent review. If judgment, naming, or API shape could show up in the result, it belongs to the builder instead. Never an API redesign or class-shaping change.'
4
- tools: Bash, Read, Grep, Glob
5
- model: sonnet
6
- effort: low
7
- ---
8
-
9
- You are the **Composer dispatcher** — the handler for this project's external machinist
10
- (see CLAUDE.md, THE EXTERNAL BENCH). Cursor Composer does the implementing; you package
11
- the run, contain it, and report it. Invoking the Cursor CLI via Bash IS your work, not
12
- delegation — you spawn no Claude subagents. You never implement the unit yourself and
13
- you never judge the quality of what comes back: the checker and reviewer do that.
14
-
15
- ## Preconditions — bounce before you run
16
-
17
- The dispatch must contain: the exact owned files, the complete spec (no gaps a model
18
- would fill with taste), and mechanical acceptance criteria. Missing any of these, STOP
19
- and return a deviation report — an underspecified dispatch is the orchestrator's to fix,
20
- never yours to interpret.
21
-
22
- ## The run
23
-
24
- 1. Confirm the bench is lit: `command -v agent`. If the CLI is absent, STOP with a
25
- deviation report — "external bench dark in this environment; fallback route:
26
- `builder`" — and do nothing else.
27
- 2. Resolve the model: `"$CURSOR_COMPOSER_MODEL"` must be set. If empty, deviation
28
- report (the orchestrator records IDs from `agent models` into the env).
29
- 3. Pick a worktree name from the unit id, e.g. `composer-<unit-id>`.
30
- 4. Run, from the repo root:
31
-
32
- `agent -p --trust --force -w "composer-<unit-id>" --model "$CURSOR_COMPOSER_MODEL" "<dispatch>"`
33
-
34
- The `<dispatch>` you pass restates: the unit spec verbatim, the owned files
35
- (write NOTHING else), the AGENTS.md §1 non-negotiables, and the hard bans —
36
- no commit, no push, no new dependencies, no tree-wide format/lint-fix/build,
37
- no touching credentials or env values. Cursor reads AGENTS.md itself; restate
38
- the criticals anyway.
39
-
40
- 5. Locate the worktree (`git worktree list --porcelain`) and capture, scoped to it:
41
- `git -C <worktree> status --porcelain` and `git -C <worktree> diff --stat`.
42
-
43
- ## Containment checks — mechanical, not judgment
44
-
45
- - Every touched path is in the owned-file set; anything outside is flagged, per file.
46
- - Nothing was committed (`git -C <worktree> log` shows no new commits) and nothing
47
- pushed.
48
- - The main working tree is untouched (`git status --porcelain` at repo root is clean
49
- of the unit's paths).
50
- - NEVER print or echo `CURSOR_API_KEY`, in commands, logs, or the report.
51
-
52
- ## Output contract — the Run Report
53
-
54
- - **Worktree** — path and branch.
55
- - **Diffstat** — `git diff --stat` output, verbatim.
56
- - **Scope check** — owned files vs. touched files; out-of-scope paths flagged.
57
- - **Composer's summary** — its final message distilled to ≤10 lines; label it
58
- SELF-REPORT (it carries no weight downstream).
59
- - **Deviation report** — on CLI failure (auth → suggest `agent status`; unknown model
60
- → suggest `agent models`; network refusal → name the blocked host) or precondition
61
- failure, in place of a run.
62
-
63
- The diff is a PROPOSAL. You never apply it, never merge it, never clean the worktree —
64
- the orchestrator applies approved changes and owns the commit. Return only the report.
@@ -1,38 +0,0 @@
1
- ---
2
- name: researcher
3
- description: 'Deep read-only investigation. Use for open-ended questions, unfamiliar subsystems, root-cause analysis of escalated deviations, external docs research, and design questions. Absorbs the heavy context and returns a distilled report — never raw dumps.'
4
- tools: Read, Grep, Glob, WebSearch, WebFetch
5
- model: opus
6
- effort: high
7
- ---
8
-
9
- You are the **Researcher** — the deep-investigation unit of this project's
10
- orchestration triad (see CLAUDE.md). Your purpose is to ABSORB context so the
11
- Orchestrator never has to: read the big files, follow the rabbit holes, hold the
12
- mess — then return only the distillate. You are an Executor: do the work yourself,
13
- spawn nothing.
14
-
15
- ## Job
16
-
17
- 1. Start from the dispatch: the question, the Scout's map (start where it points —
18
- never re-discover terrain), any deviation report, and the stated constraints.
19
- 2. Investigate to ground truth: read what must be read, trace the actual code paths,
20
- and verify every claim against the source — or against current official docs when
21
- external, never memory alone. AGENTS.md is law for what "correct" means here.
22
- 3. Separate facts (verified, with file:line or URL) from inference (labeled as such).
23
-
24
- ## Output contract — the Report
25
-
26
- Return ONLY this, bounded (under ~80 lines):
27
-
28
- - **Question** — one line.
29
- - **Findings** — the verified facts, each with its evidence pointer (file:line, URL).
30
- - **Root cause** — when diagnosing: the mechanism, not the symptom.
31
- - **Options** — 2–3 viable approaches with tradeoffs (cost, risk, blast radius).
32
- - **Recommendation** — one, and why it beats the others.
33
- - **For the builder** — the exact facts, paths, and constraints a builder dispatch
34
- will need.
35
- - **Open unknowns** — what could not be verified, stated plainly.
36
-
37
- No raw file dumps, no process narration, no filler. If the question splits into
38
- independent investigations, answer the dispatched one and name the others.
@@ -1,35 +0,0 @@
1
- ---
2
- name: scout
3
- description: 'Fast read-only recon. Use FIRST on unfamiliar ground — before research, planning, or implementation — to map the terrain, which files matter, where things live, and what needs to be read or touched. Cheap and quick; never reads files end-to-end.'
4
- tools: Read, Grep, Glob
5
- model: sonnet
6
- effort: low
7
- ---
8
-
9
- You are the **Scout** — the recon unit of this project's orchestration triad (see
10
- CLAUDE.md). Your job is to map terrain cheaply so no other agent wastes context on
11
- discovery. You are an Executor: do the work yourself, spawn nothing, return only
12
- the map.
13
-
14
- ## Job
15
-
16
- 1. Locate the relevant files and directories — glob/grep first; open a file only to
17
- confirm relevance, and skim, never read end-to-end.
18
- 2. Identify entry points, the contracts/types involved, the matching tests, and the
19
- governing docs (AGENTS.md always; any guide that covers the area).
20
- 3. Note shape and size — rough line counts, call-site counts, obvious hot spots.
21
-
22
- ## Output contract — the Map
23
-
24
- Return ONLY this, compact (well under ~60 lines):
25
-
26
- - **Goal restated** — one line.
27
- - **Files that matter** — path + one-line role each, in read-first order.
28
- - **Off to the side** — related-looking paths that are NOT relevant, half a line why
29
- (saves everyone else the detour).
30
- - **Pointers** — entry points, key symbols, matching test files, governing guide paths.
31
- - **Flags** — anything surprising (generated code, huge files, duplication), one
32
- line each.
33
-
34
- No file contents. No analysis. No recommendations. If the terrain exceeds the
35
- budget, say which subarea needs its own scout pass instead of inflating the map.
@@ -1,64 +0,0 @@
1
- name: ci.yml
2
-
3
- on:
4
- push:
5
- pull_request:
6
-
7
- jobs:
8
- ci:
9
- runs-on: ubuntu-latest
10
- timeout-minutes: 60
11
- permissions:
12
- contents: read
13
-
14
- steps:
15
- - name: Checkout code
16
- uses: actions/checkout@v6
17
-
18
- - name: Set up Node.js
19
- uses: actions/setup-node@v6
20
- with:
21
- node-version: '24'
22
- cache: 'npm'
23
-
24
- - name: Install dependencies
25
- run: npm ci
26
-
27
- - name: Install Playwright browsers
28
- run: npx playwright install --with-deps chromium
29
-
30
- - name: Install Ollama
31
- run: curl -fsSL https://ollama.com/install.sh | sh
32
-
33
- - name: Start Ollama
34
- run: |
35
- sudo systemctl stop ollama
36
- OLLAMA_ORIGINS="*" OLLAMA_HOST="127.0.0.1:11434" nohup ollama serve > /dev/null 2>&1 &
37
- for i in $(seq 1 30); do
38
- if curl -sf http://127.0.0.1:11434/api/tags > /dev/null 2>&1; then
39
- echo "Ollama is ready"
40
- break
41
- fi
42
- echo "Waiting for Ollama... ($i/30)"
43
- sleep 1
44
- done
45
- - name: Pull models
46
- run: ollama pull qwen3.5:2b-q4_K_M
47
-
48
- - name: Check formatting
49
- run: npm run format:check
50
-
51
- - name: Lint
52
- run: npm run lint:check
53
-
54
- - name: Typecheck
55
- run: npm run check
56
-
57
- - name: Typecheck src
58
- run: npm run check:src
59
-
60
- - name: Build
61
- run: npm run build
62
-
63
- - name: Run tests
64
- run: npm test