@structor-dev/cli 0.1.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.
- package/LICENSE +21 -0
- package/README.md +405 -0
- package/bin/structor.mjs +576 -0
- package/docs/INIT.md +109 -0
- package/docs/adr/0001-default-generated-repo-name.md +9 -0
- package/docs/issues/0001-structor-doctor.md +39 -0
- package/examples/frontend-backend/harness.config.json +35 -0
- package/examples/openai-and-anthropic/harness.config.json +28 -0
- package/examples/single-repo/harness.config.json +26 -0
- package/harness.config.example.json +38 -0
- package/package.json +58 -0
- package/schemas/contract-manifest.schema.json +18 -0
- package/schemas/harness-config.schema.json +85 -0
- package/schemas/task-brief.schema.json +37 -0
- package/scripts/check-config.mjs +76 -0
- package/scripts/check-contract-manifests.mjs +85 -0
- package/scripts/check-model-overlays.mjs +30 -0
- package/scripts/check-placeholders.mjs +48 -0
- package/scripts/check-task-template.mjs +53 -0
- package/scripts/check-template-files.mjs +110 -0
- package/scripts/init-harness.mjs +270 -0
- package/scripts/lib.mjs +190 -0
- package/scripts/smoke-template.mjs +309 -0
- package/scripts/validate-governance.mjs +3 -0
- package/scripts/validate-template.mjs +16 -0
- package/template/.claude/CLAUDE.md.tpl +12 -0
- package/template/.claude/rules/harness-client-surfaces.md.tpl +20 -0
- package/template/.claude/settings.json.tpl +10 -0
- package/template/.codex/hooks.json.tpl +77 -0
- package/template/AGENTS.md.tpl +22 -0
- package/template/CLAUDE.md.tpl +16 -0
- package/template/README.md.tpl +109 -0
- package/template/ai/AGENT-GARBAGE-COLLECTION.md.tpl +18 -0
- package/template/ai/AGENTS.md.tpl +36 -0
- package/template/ai/ARCHITECTURE.md.tpl +35 -0
- package/template/ai/CODEX-HOOKS.md.tpl +23 -0
- package/template/ai/DECISIONS.md.tpl +22 -0
- package/template/ai/DESIGN.md.tpl +22 -0
- package/template/ai/HARNESS-ENGINEERING.md.tpl +107 -0
- package/template/ai/HARNESS.md.tpl +53 -0
- package/template/ai/HUB.md.tpl +53 -0
- package/template/ai/PRODUCT-SUMMARY.md.tpl +28 -0
- package/template/ai/PRODUCT.md.tpl +32 -0
- package/template/ai/QUALITY.md.tpl +37 -0
- package/template/ai/READINESS.md.tpl +39 -0
- package/template/ai/RUNNER-READINESS.md.tpl +14 -0
- package/template/ai/RUNNER-SAFETY.md.tpl +21 -0
- package/template/ai/VERSIONING.md.tpl +16 -0
- package/template/ai/WORKFLOW.md.tpl +42 -0
- package/template/ai/context.md.tpl +17 -0
- package/template/ai/contracts/README.md.tpl +23 -0
- package/template/ai/contracts/api-boundary.contract.json.tpl +11 -0
- package/template/ai/contracts/api-boundary.md.tpl +17 -0
- package/template/ai/contracts/app-legibility.contract.json.tpl +11 -0
- package/template/ai/contracts/app-legibility.md.tpl +24 -0
- package/template/ai/contracts/codex-hooks.contract.json.tpl +15 -0
- package/template/ai/contracts/codex-hooks.md.tpl +18 -0
- package/template/ai/contracts/github-safety.contract.json.tpl +11 -0
- package/template/ai/contracts/github-safety.md.tpl +15 -0
- package/template/ai/contracts/release-flow.contract.json.tpl +12 -0
- package/template/ai/contracts/release-flow.md.tpl +15 -0
- package/template/ai/contracts/repo-boundaries.contract.json.tpl +12 -0
- package/template/ai/contracts/repo-boundaries.md.tpl +18 -0
- package/template/ai/contracts/security-boundary.contract.json.tpl +11 -0
- package/template/ai/contracts/security-boundary.md.tpl +19 -0
- package/template/ai/knowledge-manifest.json.tpl +149 -0
- package/template/ai/model-overlays/anthropic/CLAUDE.md.tpl +14 -0
- package/template/ai/model-overlays/openai/AGENTS.md.tpl +13 -0
- package/template/ai/plans/README.md.tpl +10 -0
- package/template/ai/plans/tech-debt.md.tpl +7 -0
- package/template/ai/skills/README.md.tpl +15 -0
- package/template/ai/skills/review-architecture.md.tpl +41 -0
- package/template/ai/skills/review-contract-drift.md.tpl +41 -0
- package/template/ai/skills/review-governance-drift.md.tpl +42 -0
- package/template/ai/skills/review-security.md.tpl +40 -0
- package/template/ai/specs/README.md.tpl +14 -0
- package/template/ai/templates/README.md.tpl +13 -0
- package/template/ai/templates/fixtures/issues/invalid-placeholder.md.tpl +20 -0
- package/template/ai/templates/fixtures/issues/invalid-protected-surface.md.tpl +21 -0
- package/template/ai/templates/fixtures/issues/valid-ready.md.tpl +105 -0
- package/template/ai/templates/issue-template.md.tpl +107 -0
- package/template/ai/templates/task-brief-template.md.tpl +185 -0
- package/template/ai/workspace/LOCAL-STACK.md.tpl +21 -0
- package/template/ai/workspace/REPOS.md.tpl +19 -0
- package/template/ai/workspace/SESSION-BOOTSTRAP.md.tpl +27 -0
- package/template/ai/workspace/SYSTEM-MAP.md.tpl +19 -0
- package/template/ai/workspace/TEST-STRATEGY.md.tpl +22 -0
- package/template/consumer/.claude/CLAUDE.md.tpl +14 -0
- package/template/consumer/AGENTS.md.tpl +23 -0
- package/template/consumer/CLAUDE.md.tpl +15 -0
- package/template/scripts/bootstrap-codex-worktree.mjs.tpl +52 -0
- package/template/scripts/bootstrap-workspace.mjs.tpl +100 -0
- package/template/scripts/check-claude-compatibility.mjs.tpl +120 -0
- package/template/scripts/check-codex-hooks.mjs.tpl +190 -0
- package/template/scripts/check-contract-manifests.mjs.tpl +81 -0
- package/template/scripts/check-garbage-collection.mjs.tpl +25 -0
- package/template/scripts/check-html-views.mjs.tpl +60 -0
- package/template/scripts/check-issue-template.mjs.tpl +167 -0
- package/template/scripts/check-knowledge-manifest.mjs.tpl +82 -0
- package/template/scripts/check-overlay-drift.mjs.tpl +49 -0
- package/template/scripts/check-plans.mjs.tpl +70 -0
- package/template/scripts/check-readiness.mjs.tpl +130 -0
- package/template/scripts/check-review-skills.mjs.tpl +48 -0
- package/template/scripts/check-task-template.mjs.tpl +63 -0
- package/template/scripts/check-template-governance.mjs.tpl +161 -0
- package/template/scripts/check-workspace.mjs.tpl +212 -0
- package/template/scripts/check-worktree-bootstrap-fixtures.mjs.tpl +122 -0
- package/template/scripts/check-worktrees.mjs.tpl +69 -0
- package/template/scripts/fixtures/worktrees/README.md.tpl +4 -0
- package/template/scripts/generate-html-views.mjs.tpl +189 -0
- package/template/scripts/hooks/codex-hook.mjs.tpl +21 -0
- package/template/scripts/hooks/lib/codex-hooks-core.mjs.tpl +114 -0
- package/template/scripts/lib/worktree-bootstrap.mjs.tpl +388 -0
- package/template/scripts/validate-governance.mjs.tpl +78 -0
- package/template/workspace/.claude/CLAUDE.md.tpl +9 -0
- package/template/workspace/.claude/rules/harness-client-surfaces.md.tpl +15 -0
- package/template/workspace/.claude/settings.json.tpl +10 -0
- package/template/workspace/AGENTS.md.tpl +17 -0
- package/template/workspace/CLAUDE.md.tpl +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nicolay Camacho
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# Structor
|
|
2
|
+
|
|
3
|
+
> Experimental. Early infrastructure for harness engineering. The API,
|
|
4
|
+
> generated layout, and config shape may change.
|
|
5
|
+
|
|
6
|
+
Structor generates a repository-local AI engineering harness for your project:
|
|
7
|
+
a versioned policy layer that gives Codex, Claude Code, and similar agents a
|
|
8
|
+
shared, enforceable set of rules for context routing, contracts, task shape,
|
|
9
|
+
review, and validation.
|
|
10
|
+
|
|
11
|
+
It is a generator, not a runtime. Structor scaffolds the harness; it never runs
|
|
12
|
+
agents, polls sessions, automates pull requests, or touches external services.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Run Structor from the workspace folder that contains your consumer repos:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx @structor-dev/cli init
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
During local development from a clone of this repo, use
|
|
23
|
+
`node ./structor/bin/structor.mjs init` from the parent workspace instead.
|
|
24
|
+
|
|
25
|
+
`init` is local-only and deterministic. It detects sibling repos, asks a few
|
|
26
|
+
questions, previews every file it would write, and generates nothing until you
|
|
27
|
+
confirm. No network calls, no LLM calls, no installs.
|
|
28
|
+
|
|
29
|
+
## What You Get
|
|
30
|
+
|
|
31
|
+
Running `init` produces a generated harness repo as a sibling of your code:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
workspace/
|
|
35
|
+
my-app-structor/ # generated harness: policy, contracts, validation
|
|
36
|
+
my-app-frontend/ # your code
|
|
37
|
+
my-app-backend/ # optional second repo
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Inside `my-app-structor/`:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
ai/ canonical policy: context routing, contracts, task templates,
|
|
44
|
+
review skills, quality tracking, decisions
|
|
45
|
+
AGENTS.md thin Codex entrypoint -> routes into ai/
|
|
46
|
+
CLAUDE.md thin Claude Code entrypoint -> routes into ai/
|
|
47
|
+
scripts/ validation that mechanically enforces the rules above
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Optional consumer repo pointer files can route agents back to the generated
|
|
51
|
+
harness from each code repo.
|
|
52
|
+
|
|
53
|
+
## Why It Exists
|
|
54
|
+
|
|
55
|
+
Most AI coding workflow tooling is a pile of prompts and rules with nothing
|
|
56
|
+
enforcing them. Structor's bet is that reliable agentic engineering needs
|
|
57
|
+
context architecture plus mechanical enforcement. The generated harness ships
|
|
58
|
+
with validators that fail when policy drifts: overlay drift checks, contract
|
|
59
|
+
manifest checks, task-shape checks, and hook guardrails.
|
|
60
|
+
|
|
61
|
+
## Manual Setup
|
|
62
|
+
|
|
63
|
+
If you prefer the conservative manual path, create `harness.config.json` and
|
|
64
|
+
run:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
npx @structor-dev/cli generate --config harness.config.json --dry-run
|
|
68
|
+
npx @structor-dev/cli generate --config harness.config.json --install-consumer-entrypoints
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
See `docs/INIT.md` for the exact safety model, read/write behavior, and
|
|
72
|
+
recovery expectations.
|
|
73
|
+
|
|
74
|
+
## Codex And Claude Support
|
|
75
|
+
|
|
76
|
+
Structor uses a hybrid model for client support:
|
|
77
|
+
|
|
78
|
+
- Concrete template files provide the stable structure, safety defaults, and
|
|
79
|
+
validators.
|
|
80
|
+
- The initialization agent may customize project-specific wording, deny-rule
|
|
81
|
+
descriptions, and review guidance after inspecting the consumer repos.
|
|
82
|
+
- The initialization agent should not invent the client-support structure from
|
|
83
|
+
scratch.
|
|
84
|
+
|
|
85
|
+
This keeps generated harnesses consistent while still allowing each project to
|
|
86
|
+
adapt the guidance to its own domain.
|
|
87
|
+
|
|
88
|
+
Generated Codex support can include:
|
|
89
|
+
|
|
90
|
+
- `AGENTS.md`
|
|
91
|
+
- `ai/model-overlays/openai/AGENTS.md`
|
|
92
|
+
- `.codex/hooks.json`
|
|
93
|
+
- `scripts/hooks/codex-hook.mjs`
|
|
94
|
+
- `scripts/hooks/lib/codex-hooks-core.mjs`
|
|
95
|
+
- `scripts/check-codex-hooks.mjs`
|
|
96
|
+
|
|
97
|
+
Generated Claude Code support can include:
|
|
98
|
+
|
|
99
|
+
- `CLAUDE.md`
|
|
100
|
+
- `.claude/CLAUDE.md`
|
|
101
|
+
- `.claude/settings.json`
|
|
102
|
+
- `.claude/rules/harness-client-surfaces.md`
|
|
103
|
+
- `ai/model-overlays/anthropic/CLAUDE.md`
|
|
104
|
+
- `scripts/check-claude-compatibility.mjs`
|
|
105
|
+
|
|
106
|
+
Default behavior:
|
|
107
|
+
|
|
108
|
+
- `models.openai: true` generates Codex entrypoints and Codex hook scaffolding.
|
|
109
|
+
- `models.anthropic: true` generates Claude entrypoints, settings, and project
|
|
110
|
+
rules.
|
|
111
|
+
- Claude hooks and Claude skills are reserved for future support. Keep those
|
|
112
|
+
flags false or omit them.
|
|
113
|
+
|
|
114
|
+
Optional config:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
"clientSupport": {
|
|
118
|
+
"codex": {
|
|
119
|
+
"hooks": true
|
|
120
|
+
},
|
|
121
|
+
"claude": {
|
|
122
|
+
"rules": true,
|
|
123
|
+
"hooks": false,
|
|
124
|
+
"skills": false
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Codex hooks generated by this template are intentionally conservative: they are
|
|
130
|
+
local, deterministic, bounded to short timeouts, and validated to avoid network
|
|
131
|
+
calls, external writes, and runtime-state mutation. They are harness policy
|
|
132
|
+
guardrails, not a runner or a complete security boundary. They catch common
|
|
133
|
+
high-risk operations and provide contextual reminders, but they do not replace
|
|
134
|
+
sandboxing, permission controls, code review, CI policy, or secret management.
|
|
135
|
+
|
|
136
|
+
## Deferred Or Missing Surfaces
|
|
137
|
+
|
|
138
|
+
These boundaries are intentional in the current template:
|
|
139
|
+
|
|
140
|
+
- Claude hooks are deferred. Keep `clientSupport.claude.hooks` false or omit it
|
|
141
|
+
until hook templates and fixture-backed validators are added.
|
|
142
|
+
- Claude skills are deferred. Keep `clientSupport.claude.skills` false or omit
|
|
143
|
+
it until committed `.claude/skills/*/SKILL.md` templates and validation are
|
|
144
|
+
added.
|
|
145
|
+
- The initializer creates a repo-shaped harness folder, but it does not run
|
|
146
|
+
`git init`, create remotes, install dependencies, publish branches, or modify
|
|
147
|
+
external services.
|
|
148
|
+
- Consumer repo entrypoints are installed during
|
|
149
|
+
`structor generate --config harness.config.json --install-consumer-entrypoints`.
|
|
150
|
+
The generated workspace
|
|
151
|
+
bootstrap script installs workspace-level pointers and verifies consumer
|
|
152
|
+
routing; it does not repair missing consumer pointers after initialization.
|
|
153
|
+
- Runner behavior remains out of scope. Polling, PR automation, dashboards,
|
|
154
|
+
auto-merge, repair loops, and CI shepherding belong in a separate runner or
|
|
155
|
+
orchestration layer.
|
|
156
|
+
|
|
157
|
+
## Out-of-the-Box Flow
|
|
158
|
+
|
|
159
|
+
The supported happy path is:
|
|
160
|
+
|
|
161
|
+
1. Clone this template repo into the same workspace folder as the consumer repos.
|
|
162
|
+
2. Generate the project harness as a sibling of the consumer repos.
|
|
163
|
+
3. Install consumer repo entrypoints during initialization.
|
|
164
|
+
4. Run the generated harness workspace bootstrap script.
|
|
165
|
+
5. Start Codex or Claude Code from the workspace, generated harness, or a
|
|
166
|
+
bootstrapped consumer repo.
|
|
167
|
+
|
|
168
|
+
The sibling layout matters. The generated harness scripts assume the harness
|
|
169
|
+
repo and consumer repos share one parent workspace folder.
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
workspace/
|
|
173
|
+
structor/ # this repo
|
|
174
|
+
project-structor/ # generated harness output
|
|
175
|
+
project-frontend/ # consumer repo
|
|
176
|
+
project-backend/ # optional consumer repo
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
With that layout, the current flow can bootstrap consumer repos out of the box
|
|
180
|
+
when their agent pointer files are missing. For safety, existing consumer
|
|
181
|
+
`AGENTS.md`, `CLAUDE.md`, and `.claude/CLAUDE.md` files are skipped unless
|
|
182
|
+
`--force` is explicitly passed. If you generate the harness somewhere else,
|
|
183
|
+
move or copy it into the sibling workspace layout before running the generated
|
|
184
|
+
workspace bootstrap scripts.
|
|
185
|
+
|
|
186
|
+
## Agent-Assisted Manual Setup
|
|
187
|
+
|
|
188
|
+
When you want an agent to drive the conservative manual path, run the
|
|
189
|
+
initialization prompt in Codex or Claude Code from the root of this template
|
|
190
|
+
repo. The agent should inspect the sibling consumer repos, create
|
|
191
|
+
`harness.config.json`, preview writes, generate the harness, install consumer
|
|
192
|
+
pointers, and validate the result with evidence.
|
|
193
|
+
|
|
194
|
+
### Preconditions
|
|
195
|
+
|
|
196
|
+
- Node.js 20 or newer is available.
|
|
197
|
+
- This template repo is cloned locally.
|
|
198
|
+
- Consumer repos are already cloned as siblings, or their intended sibling
|
|
199
|
+
folder names are known.
|
|
200
|
+
- The generated harness output path will be a sibling of the consumer repos.
|
|
201
|
+
- Existing consumer `AGENTS.md`, `CLAUDE.md`, and `.claude/*` files have been
|
|
202
|
+
reviewed before using `--force`.
|
|
203
|
+
|
|
204
|
+
### Initialization Prompt
|
|
205
|
+
|
|
206
|
+
Paste this into Codex or Claude Code from the root of this template repo:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
Use this repo to create a project-specific AI engineering harness.
|
|
210
|
+
|
|
211
|
+
Project facts:
|
|
212
|
+
- Project name: <fill in>
|
|
213
|
+
- Harness repo folder name: <fill in, for example project-structor>
|
|
214
|
+
- Consumer repos: <fill in sibling repo folder names and purposes>
|
|
215
|
+
- Models to support: OpenAI/Codex and Anthropic/Claude Code unless I say otherwise
|
|
216
|
+
- Client support: generate Codex hooks and Claude rules unless I say otherwise;
|
|
217
|
+
do not generate Claude hooks or Claude skills unless I explicitly request them
|
|
218
|
+
|
|
219
|
+
Rules:
|
|
220
|
+
- Read AGENTS.md, README.md, harness.config.example.json, template/ai/AGENTS.md.tpl,
|
|
221
|
+
template/ai/HUB.md.tpl, template/README.md.tpl, scripts/init-harness.mjs,
|
|
222
|
+
template/scripts/bootstrap-workspace.mjs.tpl, and
|
|
223
|
+
template/scripts/check-workspace.mjs.tpl before editing.
|
|
224
|
+
- Keep the template generic; do not add product-specific content to active
|
|
225
|
+
templates.
|
|
226
|
+
- Create or update harness.config.json for this workspace.
|
|
227
|
+
- Set output.path so the generated harness repo is a sibling of the consumer repos.
|
|
228
|
+
- Use concrete template-provided client-support files. Do not invent Codex or
|
|
229
|
+
Claude Code surfaces from scratch.
|
|
230
|
+
- If customizing Codex hook rules, keep them deterministic, local, read-only,
|
|
231
|
+
short-timeout, and fixture-validated.
|
|
232
|
+
- If customizing Claude Code support, keep `.claude/**` thin and routed to
|
|
233
|
+
canonical `ai/*` docs. Do not add Claude hooks without a validator.
|
|
234
|
+
- Run npm run check:ci before generating anything; use npm run validate when you
|
|
235
|
+
want the full local smoke suite.
|
|
236
|
+
- Run npm run generate -- --config harness.config.json --dry-run and summarize the
|
|
237
|
+
planned writes before writing files.
|
|
238
|
+
- If the dry run is correct, run npm run generate -- --config harness.config.json
|
|
239
|
+
--install-consumer-entrypoints.
|
|
240
|
+
- Do not overwrite existing consumer AGENTS.md, CLAUDE.md, or .claude/* files
|
|
241
|
+
unless I explicitly approve --force.
|
|
242
|
+
- In the generated harness, run node scripts/validate-governance.mjs.
|
|
243
|
+
- If Codex hooks are enabled, confirm node scripts/check-codex-hooks.mjs passed.
|
|
244
|
+
- If Claude support is enabled, confirm node scripts/check-claude-compatibility.mjs passed.
|
|
245
|
+
- Confirm node scripts/check-overlay-drift.mjs passed.
|
|
246
|
+
- From the generated harness, run node scripts/bootstrap-workspace.mjs --dry-run
|
|
247
|
+
and summarize planned workspace pointer writes.
|
|
248
|
+
- If the workspace bootstrap preview is safe, run node scripts/bootstrap-workspace.mjs.
|
|
249
|
+
- From the generated harness, run node scripts/check-workspace.mjs.
|
|
250
|
+
- Report commands run, files changed, generated temp or output paths, skipped
|
|
251
|
+
files, failures, and remaining manual follow-ups.
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
The generated harness includes starter product, architecture, design, contract,
|
|
255
|
+
review, quality, decision, task-template, and workspace-bootstrap files. The
|
|
256
|
+
agent should fill obvious project-specific facts from `harness.config.json` and
|
|
257
|
+
consumer repo inspection, then leave explicit starter sections for facts that
|
|
258
|
+
require human input.
|
|
259
|
+
|
|
260
|
+
## Manual Setup
|
|
261
|
+
|
|
262
|
+
Use these commands when you want to operate the template without an
|
|
263
|
+
agent-assisted prompt.
|
|
264
|
+
|
|
265
|
+
Copy and edit the example config:
|
|
266
|
+
|
|
267
|
+
```sh
|
|
268
|
+
cp harness.config.example.json harness.config.json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Set:
|
|
272
|
+
|
|
273
|
+
- `project.name`, `project.slug`, and `project.harnessRepoName`
|
|
274
|
+
- `output.path` to a generated harness repo path that is a sibling of the
|
|
275
|
+
consumer repos, for example `../project-structor`
|
|
276
|
+
- `models.openai` and `models.anthropic`
|
|
277
|
+
- optional `clientSupport.codex.hooks`
|
|
278
|
+
- optional `clientSupport.claude.rules`; keep `clientSupport.claude.hooks` and
|
|
279
|
+
`clientSupport.claude.skills` false or omitted until those surfaces are added
|
|
280
|
+
- each consumer `name`, sibling `path`, `purpose`, and validation commands
|
|
281
|
+
|
|
282
|
+
Validate the template and config shape:
|
|
283
|
+
|
|
284
|
+
```sh
|
|
285
|
+
npm run check:ci
|
|
286
|
+
node scripts/check-config.mjs --config harness.config.json --require-existing-consumers
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Use `npm run validate` when you want the full local smoke suite, including
|
|
290
|
+
generated harness checks.
|
|
291
|
+
|
|
292
|
+
Preview generation:
|
|
293
|
+
|
|
294
|
+
```sh
|
|
295
|
+
npm run generate -- --config harness.config.json --dry-run
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Generate the harness and install missing consumer entrypoints:
|
|
299
|
+
|
|
300
|
+
```sh
|
|
301
|
+
npm run generate -- --config harness.config.json --install-consumer-entrypoints
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Then validate and bootstrap from the generated harness:
|
|
305
|
+
|
|
306
|
+
```sh
|
|
307
|
+
cd ../<harness-repo-folder>
|
|
308
|
+
node scripts/validate-governance.mjs
|
|
309
|
+
node scripts/bootstrap-workspace.mjs --dry-run
|
|
310
|
+
node scripts/bootstrap-workspace.mjs
|
|
311
|
+
node scripts/check-workspace.mjs
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Use `--force` only after reviewing existing consumer or workspace entrypoints
|
|
315
|
+
that would be overwritten.
|
|
316
|
+
|
|
317
|
+
## Consumer Repo Entrypoints
|
|
318
|
+
|
|
319
|
+
Each configured consumer repo should have short pointer files:
|
|
320
|
+
|
|
321
|
+
- `AGENTS.md` for OpenAI/Codex-compatible agents
|
|
322
|
+
- `CLAUDE.md` for Anthropic/Claude-compatible agents
|
|
323
|
+
- `.claude/CLAUDE.md` for Claude Code project memory
|
|
324
|
+
|
|
325
|
+
These files point to the generated harness and may include only minimal
|
|
326
|
+
repo-local facts such as repository purpose and validation commands. They
|
|
327
|
+
should not copy canonical harness policy.
|
|
328
|
+
|
|
329
|
+
After initialization, an agent starting inside a consumer repo should read the
|
|
330
|
+
local pointer file first, then follow the harness route through `ai/HUB.md`.
|
|
331
|
+
Consumer repos still own implementation, runtime behavior, local tests, and
|
|
332
|
+
deployment checks.
|
|
333
|
+
|
|
334
|
+
### Claude Code Skills Boundary
|
|
335
|
+
|
|
336
|
+
Claude Code discovers project skills from `.claude/skills/*/SKILL.md` in the
|
|
337
|
+
current repo, parent repos up to the repo root, and configured global or
|
|
338
|
+
additional directories. A consumer `CLAUDE.md` pointer to a sibling generated
|
|
339
|
+
harness does not make harness-local `.claude/skills` available when Claude Code
|
|
340
|
+
starts inside the consumer repo.
|
|
341
|
+
|
|
342
|
+
If consumer repo sessions need Claude Code skills, install or copy those skills
|
|
343
|
+
into each consumer repo under `.claude/skills`, install them globally under
|
|
344
|
+
`~/.claude/skills`, or start Claude Code with the harness added as an additional
|
|
345
|
+
directory. Do not put reusable Claude Code skills in `ai/skills`; that directory
|
|
346
|
+
is reserved for harness review guidance and is not a Claude Code skill discovery
|
|
347
|
+
path.
|
|
348
|
+
|
|
349
|
+
If you do not want the script to write into consumer repos, create the files
|
|
350
|
+
manually using:
|
|
351
|
+
|
|
352
|
+
- `template/consumer/AGENTS.md.tpl`
|
|
353
|
+
- `template/consumer/CLAUDE.md.tpl`
|
|
354
|
+
- `template/consumer/.claude/CLAUDE.md.tpl`
|
|
355
|
+
|
|
356
|
+
## Validation
|
|
357
|
+
|
|
358
|
+
Run:
|
|
359
|
+
|
|
360
|
+
```sh
|
|
361
|
+
npm run check:ci
|
|
362
|
+
npm run validate
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
`npm run check:ci` covers the cheap structural checks that feed both local
|
|
366
|
+
development and CI: config examples, required template files, task template
|
|
367
|
+
structure, contract manifest schema, placeholder hygiene, and model overlay
|
|
368
|
+
thinness.
|
|
369
|
+
|
|
370
|
+
The placeholder check has no hardcoded private project names. If you are
|
|
371
|
+
extracting a harness from a private codebase, opt into leak detection with a
|
|
372
|
+
comma-separated list:
|
|
373
|
+
|
|
374
|
+
```sh
|
|
375
|
+
HARNESS_FORBIDDEN_PROJECT_TERMS="Internal Product,private-api" npm run check:placeholders
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
`npm run validate` adds the smoke-tested initialization flow and is the
|
|
379
|
+
default push/PR GitHub Actions path. The smoke test
|
|
380
|
+
creates disposable workspaces, generates harnesses for OpenAI-only,
|
|
381
|
+
Anthropic-only, and combined model settings, installs consumer entrypoints,
|
|
382
|
+
runs generated governance validation, bootstraps workspace pointers, and
|
|
383
|
+
verifies workspace layout.
|
|
384
|
+
|
|
385
|
+
Generated harness validation includes client-support checks when the relevant
|
|
386
|
+
surfaces are enabled:
|
|
387
|
+
|
|
388
|
+
- `scripts/check-codex-hooks.mjs` for generated Codex hooks
|
|
389
|
+
- `scripts/check-claude-compatibility.mjs` for generated Claude Code surfaces
|
|
390
|
+
- `scripts/check-overlay-drift.mjs` for model overlay routing
|
|
391
|
+
|
|
392
|
+
For a real project config, require configured consumer repo paths to exist:
|
|
393
|
+
|
|
394
|
+
```sh
|
|
395
|
+
node scripts/check-config.mjs --config harness.config.json --require-existing-consumers
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## Non-Goals
|
|
399
|
+
|
|
400
|
+
- No runner or orchestration runtime.
|
|
401
|
+
- No Linear, GitHub, Claude hook, or CI automation.
|
|
402
|
+
- No Codex runner automation beyond local harness hook guardrails.
|
|
403
|
+
- No dashboards, polling loops, session control, auto-merge, or repair daemons.
|
|
404
|
+
- No consumer implementation logic.
|
|
405
|
+
- No source-project or other project-specific content in active templates.
|