@wildorder/nightshift 0.1.0 → 0.2.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.
Files changed (41) hide show
  1. package/dist/cli.js +229 -10
  2. package/dist/cli.js.map +1 -1
  3. package/dist/config.d.ts +4 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +7 -0
  6. package/dist/config.js.map +1 -1
  7. package/dist/index.d.ts +5 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/init-project.d.ts +18 -0
  12. package/dist/init-project.d.ts.map +1 -0
  13. package/dist/init-project.js +259 -0
  14. package/dist/init-project.js.map +1 -0
  15. package/dist/install-prefs.d.ts +17 -0
  16. package/dist/install-prefs.d.ts.map +1 -0
  17. package/dist/install-prefs.js +55 -0
  18. package/dist/install-prefs.js.map +1 -0
  19. package/dist/install-skills.d.ts +83 -0
  20. package/dist/install-skills.d.ts.map +1 -0
  21. package/dist/install-skills.js +311 -0
  22. package/dist/install-skills.js.map +1 -0
  23. package/dist/install-wizard.d.ts +56 -0
  24. package/dist/install-wizard.d.ts.map +1 -0
  25. package/dist/install-wizard.js +166 -0
  26. package/dist/install-wizard.js.map +1 -0
  27. package/dist/package-assets.d.ts +3 -0
  28. package/dist/package-assets.d.ts.map +1 -0
  29. package/dist/package-assets.js +13 -0
  30. package/dist/package-assets.js.map +1 -0
  31. package/dist/skill-roots.d.ts +51 -0
  32. package/dist/skill-roots.d.ts.map +1 -0
  33. package/dist/skill-roots.js +181 -0
  34. package/dist/skill-roots.js.map +1 -0
  35. package/package.json +3 -1
  36. package/skills/init-project/SKILL.md +196 -0
  37. package/skills/plan-program/SKILL.md +274 -0
  38. package/templates/AGENTS.md +29 -0
  39. package/templates/CLAUDE.md +7 -0
  40. package/templates/universal-directives.md +50 -0
  41. package/templates/vision.md +46 -0
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: init-project
3
+ description: Initialize a new repository or adopt an existing one into the nightshift structure, including deriving the vision and as-built docs from existing code. Use when a user asks to set up, initialize, or onboard a project for nightshift.
4
+ argument-hint: "[project-root]"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Initialize or adopt a project
9
+
10
+ Use the supplied argument as the project root. When omitted, use the current
11
+ working directory.
12
+
13
+ ## Step 1 — Detect project type
14
+
15
+ Inspect the root. If it contains source code, a populated README, or other
16
+ project documentation, treat this as a **brownfield adoption**. An empty or
17
+ near-empty directory is a **greenfield initialization**.
18
+
19
+ ## Step 2 — Ask about version control upfront
20
+
21
+ Check whether the root is inside a git repository
22
+ (`git rev-parse --is-inside-work-tree`). Ask these questions now, alongside
23
+ the project questions — never defer them to a suggested next step:
24
+
25
+ 1. If it is **not** a repository: "Initialize a git repository here?" If yes,
26
+ run `git init` before any scaffolding so everything that follows is
27
+ tracked from the start.
28
+ 2. In all cases: "Commit the nightshift setup when finished?" If yes, plan to
29
+ commit at the end of this workflow.
30
+ 3. Brownfield with uncommitted changes: point out the dirty tree and confirm
31
+ that the final commit should include only the files this setup created or
32
+ modified, keeping the user's in-progress work out of it.
33
+
34
+ Record the answers and apply them in Step 6. Git is not optional decoration
35
+ for nightshift: the decision ledger tags commits and replays roll back to
36
+ them, so if the user declines a repository entirely, warn that decision
37
+ replay, rollback, and per-workstream checkpoints will all be unavailable,
38
+ then proceed.
39
+
40
+ ## Step 3 — Gather project information
41
+
42
+ The initializer resolves defaults on its own: name and description from
43
+ `package.json`, and the stack by scanning manifests (package.json,
44
+ tsconfig.json, pyproject.toml, go.mod, Cargo.toml).
45
+
46
+ - Greenfield: ask for the project name, stack, and one-line description, and
47
+ wait for the response.
48
+ - Brownfield: state the values you expect detection to produce and ask only
49
+ about gaps or corrections. Do not re-ask for what the repository already
50
+ declares.
51
+
52
+ ### Agent roles
53
+
54
+ Also ask which agent CLI (and model) fills each of nightshift's roles. Never
55
+ leave this implicit — it is the most consequential configuration in the
56
+ project. Each block in `nightshift.config.json` declares a command, args, and
57
+ prompt mode, spelled in that CLI's own vocabulary:
58
+
59
+ 1. **Implementer** (`agent`) — executes each workstream. A cheaper model is
60
+ usually the right call, for example
61
+ `{ "command": "claude", "args": ["-p", "--model", "sonnet"], "promptMode": "stdin" }`.
62
+ 2. **Decider** (`deciderAgent`) — makes, ratifies, or escalates the decisions
63
+ agents surface during a run, and composes the human notification when one
64
+ is warranted. Decisions are the highest-leverage, lowest-token work in a
65
+ run, so recommend the most capable model available here — and a
66
+ **different provider than the implementer**, because ratifying the
67
+ implementer's own choices with the implementer's own model re-creates the
68
+ self-grading conflict this role exists to remove. If the user picks the
69
+ same provider anyway, note the tradeoff and respect the choice.
70
+ 3. **Reviewer** (`reviewerAgent`) — the independent second opinion: spec
71
+ critique before build, test critique after each workstream, whole-program
72
+ review at the end. Recommend a different provider than the implementer.
73
+ Leave the model flag out of its args and let the external CLI run its own
74
+ default — the role wants an uncorrelated second opinion, which that
75
+ default already is, and a named model is one more thing to go stale.
76
+ 4. **Recovery** (`recoveryAgent`, optional) — retries failed workstreams. A
77
+ distinct provider also lets a run survive a primary quota, token, or
78
+ session failure. Skip it if the user has no second implementer available.
79
+
80
+ An absent `deciderAgent` does not break runs — implementer defaults simply
81
+ stand unratified, and the run report says so — but recommend configuring it:
82
+ it is the difference between "decisions were made" and "decisions were
83
+ reviewed". An absent `reviewerAgent` disables the review passes entirely and
84
+ is reported, never silently substituted.
85
+
86
+ If the user has no preference, record the host's current model for the
87
+ implementer and recommend a distinct decider and reviewer. Roles can be
88
+ filled in later, but say so explicitly in the report — a run started before
89
+ `agent` is set aborts immediately.
90
+
91
+ Ask the Step 2 and Step 3 questions together in one message when possible.
92
+
93
+ ## Step 4 — Run the deterministic initializer
94
+
95
+ ```sh
96
+ npx --yes @wildorder/nightshift init --cwd "{project-root}"
97
+ ```
98
+
99
+ Always invoke the CLI by its full package name. The executable is named
100
+ `nightshift`, but the package is `@wildorder/nightshift` — a bare
101
+ `npm exec nightshift` only resolves when the *shell's* working directory
102
+ already has the package installed, and otherwise queries the registry for the
103
+ unscoped name, which is not this package. That is the common case here,
104
+ because `init` usually targets a project root that has no `node_modules` yet.
105
+
106
+ Add `--name`, `--stack`, or `--description` only for values the user supplied
107
+ or detection cannot provide. Do not manually reproduce the templates; the CLI
108
+ is the canonical write path. It:
109
+
110
+ - creates the standard directories and any missing starter files without
111
+ overwriting existing ones;
112
+ - merges the universal directives into an existing `AGENTS.md` by adding or
113
+ refreshing only the marked `BEGIN/END UNIVERSAL` block, leaving all other
114
+ content untouched;
115
+ - prefills `verify` commands from `package.json` scripts and records existing
116
+ markdown documentation as `contextDocs` in `nightshift.config.json`.
117
+
118
+ The universal directives come from the packaged template by default; a user
119
+ override is honored from `~/.nightshift/universal-directives.md`, or pass
120
+ `--directives <path>` when the user names a directives file.
121
+
122
+ After the initializer runs, write the role decisions from Step 3 into
123
+ `nightshift.config.json`, for example:
124
+
125
+ ```json
126
+ "agent": { "command": "claude", "args": ["-p", "--model", "sonnet"], "promptMode": "stdin" },
127
+ "deciderAgent": { "command": "codex", "args": ["exec", "--model", "gpt-5.4"], "promptMode": "stdin" },
128
+ "reviewerAgent": { "command": "codex", "args": ["exec"] }
129
+ ```
130
+
131
+ Before moving on, re-read the file and confirm the blocks the user chose are
132
+ all present. When adopting a project whose `nightshift.config.json` already
133
+ existed, check it for the same blocks and add whichever the user asked for.
134
+
135
+ ## Step 5 — Confirm workflow skills are present
136
+
137
+ Check whether the project already contains installed nightshift skills
138
+ (`.cursor/skills/`, `.claude/skills/`, `skills/`, `.agents/skills/`, or
139
+ `.gemini/skills/`). If any target is present, the team has already chosen
140
+ its targets — do not install more, and do not re-run the installer.
141
+
142
+ Only when no target is installed at all (for example, when initializing a
143
+ different project root than the one this skill is running from), ask the
144
+ user which targets they want and run:
145
+
146
+ ```sh
147
+ npx --yes @wildorder/nightshift install --cwd "{project-root}" --targets {chosen}
148
+ ```
149
+
150
+ Never use `--force` unless the user explicitly approves replacing a reported
151
+ skill conflict.
152
+
153
+ ## Step 6 — Brownfield enrichment
154
+
155
+ Skip this step for greenfield projects.
156
+
157
+ 1. **Snapshot reality.** Scan the codebase — entry points, schema files,
158
+ route registrations, shared contracts, infrastructure config — and write
159
+ `docs/as-built.md`, noting it as the initial adoption snapshot. This
160
+ grounds all later planning in what actually exists.
161
+ 2. **Author the vision.** The CLI scaffolded `docs/vision.md` as a template.
162
+ Draft its real content from the as-built snapshot plus a short interview:
163
+ what the product is for, target users, where it is heading, and what is
164
+ explicitly out of scope. Write the draft directly to `docs/vision.md` —
165
+ the file is the review surface; do not paste the content into the
166
+ conversation for approval. Summarize briefly and invite edits, applying
167
+ them to the file in place.
168
+ 3. **Complete `AGENTS.md`.** Fill the project Conventions section from
169
+ observed practice — lint and formatter configs, test layout, naming
170
+ patterns — and confirm the generated dependency table reflects the
171
+ packages that matter.
172
+ 4. **Curate `contextDocs`.** Review the detected list in
173
+ `nightshift.config.json`: remove documents that are stale or irrelevant
174
+ and add any the user names. Planning reads every listed document, so the
175
+ list should be signal, not bulk.
176
+
177
+ ## Step 7 — Apply the version-control decisions
178
+
179
+ Execute what the user approved in Step 2:
180
+
181
+ - If a commit was approved, stage exactly the files this setup created or
182
+ modified and commit with a message like `chore: adopt nightshift`.
183
+ Do not stage unrelated in-progress changes.
184
+ - If the user declined, leave the working tree as is.
185
+
186
+ ## Step 8 — Report
187
+
188
+ Report:
189
+
190
+ 1. Files created, updated, and skipped.
191
+ 2. Skill conflicts, if any.
192
+ 3. Warnings from the initializer.
193
+ 4. The configured agent roles, and which roles were deferred.
194
+ 5. Brownfield: the as-built and vision drafts produced and any assumptions.
195
+ 6. Git actions taken (repository initialized, setup committed) or declined.
196
+ 7. Next step: invoke `/plan-program` for the first program.
@@ -0,0 +1,274 @@
1
+ ---
2
+ name: plan-program
3
+ description: Plan a new engineering program or product phase, define architecture changes and workstreams, and produce the canonical program document and manifest. Use when turning a feature set into an executable program plan.
4
+ argument-hint: "[program-id] [feature-set-or-phase]"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Plan a program
9
+
10
+ Plan a new feature set or phase for the current project. This is one of the
11
+ two places a human exercises judgment in nightshift; everything downstream is
12
+ a walk-away run, so the plan you produce here is the last routine chance to
13
+ shape the work interactively. Write every artifact for a human reader first —
14
+ the run's trust surface is its artifacts.
15
+
16
+ ## 1. Load project context
17
+
18
+ Read:
19
+
20
+ - The vision document at `visionPath` from `nightshift.config.json`, the
21
+ anchor product vision. Use `docs/vision.md` only when no configuration
22
+ exists.
23
+ - `docs/as-built.md`, when present, for current system state.
24
+ - `AGENTS.md` for repository directives and conventions.
25
+ - Every document listed in `contextDocs` from `nightshift.config.json`, when
26
+ present.
27
+ - When re-planning after a run, the program's run report and decision ledger
28
+ under `docs/programs/` — a prior run's parked workstreams, risk-accepted
29
+ findings, and recorded decisions are planning input, not noise. Plan from
30
+ the repository state that exists now, not from the original pre-program
31
+ design; treat work a prior run verified and committed as current
32
+ architecture rather than scheduling it again, and give replacement work new
33
+ workstream IDs and task-file paths so nothing overwrites the historical
34
+ record.
35
+
36
+ If no vision document exists at the resolved path, stop. Explain that it
37
+ should contain the product description, architecture, target users, API
38
+ surface, data model, phase scope, and technology stack. For a new repository,
39
+ suggest the `init-project` skill.
40
+
41
+ If `docs/as-built.md` is absent, note that this is likely the first program
42
+ and proceed.
43
+
44
+ ## 2. Gather requirements
45
+
46
+ Resolve these values from the arguments or ask for anything missing:
47
+
48
+ 1. The feature set or phase to build.
49
+ 2. A lowercase, hyphenated program ID, such as `phase-2-durable`.
50
+
51
+ Wait for the user's response when questions are required.
52
+
53
+ ### Select the execution mode
54
+
55
+ Choose the mode before decomposing the work and record the decision in both
56
+ artifacts. Default to `atomic` unless there is positive causal evidence that
57
+ orchestration is necessary.
58
+
59
+ - **`atomic`** — one cohesive agent working set, one implementation brief,
60
+ and one green commit. Choose this when a capable coding agent can own the
61
+ whole change coherently and intermediate checkpoints add no material safety
62
+ or parallelism.
63
+ - **`orchestrated`** — multiple independently-green workstreams executed as a
64
+ dependency graph. Choose this when the minimum static context physically
65
+ cannot fit one agent session, independent work provides material
66
+ parallelism, independently deployable service boundaries matter, or a
67
+ shared-contract migration requires expand → migrate consumers →
68
+ contract/delete ordering.
69
+
70
+ Do not choose orchestrated merely because the feature is important, spans
71
+ many files, or has a high estimated token count. State the concrete evidence
72
+ in `program.executionModeReason`. In atomic mode create exactly one
73
+ workstream covering the entire program, with no dependencies and task file
74
+ `tasks/{program-id}/implementation.md`. In orchestrated mode use the
75
+ decomposition and checkpoint rules below.
76
+
77
+ ## 3. Draft the program document
78
+
79
+ Inspect `docs/programs/` for an existing `*-program.md`. Match its structure
80
+ when one exists. Otherwise use:
81
+
82
+ ```markdown
83
+ # {Project Name} — Program Plan ({Program Name})
84
+
85
+ ## Program Overview
86
+ **Product:** [From the vision.]
87
+ **Program scope:** [What this program delivers.]
88
+
89
+ ## Execution Mode
90
+ **Mode:** atomic | orchestrated
91
+ **Reason:** [Concrete causal evidence for the choice.]
92
+
93
+ ## Strategic Goals
94
+ [Three to five outcome-focused bullets.]
95
+
96
+ ## Architecture Changes
97
+ [Changes from the system in as-built.md. For the first program, describe the full architecture.]
98
+
99
+ ## Technology Choices
100
+ [Only new choices. If none: "No new technology — uses existing stack."]
101
+
102
+ ## Anticipated Decisions
103
+ [Choices you can already see the run will face — API shapes, data-model
104
+ tradeoffs, library picks — with your leaning and why. The decider reads
105
+ these; a decision anticipated here is a decision the run handles better.]
106
+
107
+ ## Risk Register
108
+ | Risk | Impact | Mitigation |
109
+ |------|--------|------------|
110
+ [Key risks.]
111
+
112
+ ## Success Criteria, Workstreams, and Scope
113
+ Canonical in `docs/programs/{program-id}-manifest.json`: success-criteria
114
+ text, the workstream roster, dependencies, sizes, scope, and exclusions live
115
+ there and only there. This document refers to them by id (`SC-xx`, `WS-xx`)
116
+ and never restates their text.
117
+ ```
118
+
119
+ The program document carries only what the manifest cannot: narrative
120
+ architecture, causal reasoning, anticipated decisions, and risks. Success
121
+ criteria, the workstream table, the dependency graph, and scope in/out lists
122
+ are manifest data — do not reproduce them here. Two copies of the same fact
123
+ drift apart; one canonical home per fact is a founding rule of this system.
124
+ When this section's rule and an older program document's structure conflict,
125
+ this rule wins: delete the duplicated sections rather than matching them.
126
+
127
+ Write the draft directly to `docs/programs/{program-id}-program.md`. Do not
128
+ paste the document into the conversation or ask for approval before saving —
129
+ the file is the review surface, not the chat window.
130
+
131
+ ## 4. Generate the manifest
132
+
133
+ If `docs/programs/` contains an existing `*-manifest.json`, match its schema
134
+ exactly. Otherwise use:
135
+
136
+ ```json
137
+ {
138
+ "program": {
139
+ "id": "{program-id}",
140
+ "name": "{Program Name}",
141
+ "description": "{one-line description}",
142
+ "status": "planning",
143
+ "created": "{YYYY-MM-DD}",
144
+ "executionMode": "atomic|orchestrated",
145
+ "executionModeReason": "{concrete causal evidence}"
146
+ },
147
+ "technology": {},
148
+ "successCriteria": [
149
+ { "id": "SC-01", "description": "{verifiable outcome}" }
150
+ ],
151
+ "packages": [
152
+ {
153
+ "name": "{package-name}",
154
+ "path": "{relative-path}",
155
+ "description": "{purpose}"
156
+ }
157
+ ],
158
+ "workstreams": [
159
+ {
160
+ "id": "WS-01",
161
+ "name": "{Workstream Name}",
162
+ "taskFile": "tasks/{program-id}/{ws-id}-{slug}.md",
163
+ "status": "not_started",
164
+ "size": "S|M|L",
165
+ "scope": {
166
+ "summary": "{one line: what this workstream owns}",
167
+ "includes": ["{specific thing it covers}"],
168
+ "excludes": ["{specific thing it deliberately does not cover}"]
169
+ },
170
+ "dependencies": [],
171
+ "packages": []
172
+ }
173
+ ],
174
+ "outOfScope": []
175
+ }
176
+ ```
177
+
178
+ Save it directly to `docs/programs/{program-id}-manifest.json`.
179
+ Keep the manifest, program document, and every referenced `taskFile`
180
+ trackable by Git — nightshift tags decisions to commits and replays roll back
181
+ to them, so a plan that exists only in an ignored working tree is neither
182
+ reproducible nor replayable. If the repository ignores `tasks/` or
183
+ `docs/programs/`, remove those ignore rules or explicitly force-add these
184
+ canonical artifacts.
185
+
186
+ For `atomic`, the `workstreams` array contains exactly one whole-program
187
+ workstream (`WS-01`) whose `taskFile` is
188
+ `tasks/{program-id}/implementation.md`. For `orchestrated`, it contains the
189
+ dependency graph described in the program document.
190
+
191
+ ### Scope is load-bearing, not decoration
192
+
193
+ `scope` is required on every workstream, and the reason is worth
194
+ understanding before you write them.
195
+
196
+ Authoring spawns one clean agent per workstream, and every one of those
197
+ agents is handed the roster of the whole program — each workstream's id,
198
+ name, and scope, and nothing else. That roster is how an author discovers
199
+ that another workstream already owns something it was about to build, or
200
+ produces something it needs. An author that cannot tell what `WS-12` covers
201
+ will not merely omit a dependency; it will reimplement WS-12's work.
202
+
203
+ So write these for a reader who has no other information about that
204
+ workstream:
205
+
206
+ - **`summary`** — one line naming what it owns. "Auth improvements" tells an
207
+ author nothing. "Issues, rotates, and validates auth tokens" tells it
208
+ everything it needs to decide whether to depend on this.
209
+ - **`includes`** — the specific capabilities inside the boundary.
210
+ - **`excludes`** — the specific capabilities deliberately outside it. These
211
+ carry more weight than they look. An exclusion tells every other author
212
+ that something is *not* covered here, which prevents both duplicated work
213
+ and a requirement that silently belongs to nobody. If a workstream's
214
+ neighbors might reasonably assume it handles something, say that it does
215
+ not.
216
+
217
+ ### Every orchestrated workstream is an independently green checkpoint
218
+
219
+ Design the roster so that, starting from a green repository containing only
220
+ its declared dependencies, each workstream can finish with every configured
221
+ build, typecheck, test, and lint command still green. A later workstream must
222
+ never be required to repair an earlier checkpoint — and in nightshift this
223
+ matters doubly, because a failed workstream is parked while everything
224
+ outside its downstream cone still builds; a roster whose checkpoints lean on
225
+ later repair work turns one parked workstream into a broken partial build.
226
+
227
+ For a shared contract migration, prefer an explicit sequence:
228
+
229
+ 1. **Expand** — introduce the new contract while preserving compatibility.
230
+ 2. **Migrate** — move bounded consumer groups in independently green batches.
231
+ 3. **Contract/delete** — remove the compatibility surface only after every
232
+ consumer migration is complete.
233
+
234
+ The destructive cleanup depends on every migration workstream. Do not place
235
+ foundational deletion first merely because it is conceptually central.
236
+
237
+ ## 5. Hand off for review
238
+
239
+ Both files now exist on disk. Reply with a short summary only — program
240
+ scope in a sentence, selected execution mode and reason, workstream count,
241
+ critical path, and links to the two file paths — and invite the user to
242
+ review the files and request changes. Apply any requested edits to the files
243
+ in place.
244
+
245
+ Do not create workstream specs in this workflow, and do not offer to. Specs
246
+ are written by the packaged runner, one clean agent per workstream, as
247
+ narrative documents a human can review. Point the user at the run command
248
+ and stop:
249
+
250
+ ```sh
251
+ npx --yes @wildorder/nightshift run "{program-id}"
252
+ ```
253
+
254
+ Authoring a spec inside this session would write it in a context already
255
+ carrying the whole planning conversation, compose its own instructions, and
256
+ then grade its own output — which is what the command exists to prevent.
257
+
258
+ ## Rules
259
+
260
+ - Describe only new behavior. Reference `docs/as-built.md` for unchanged
261
+ capabilities.
262
+ - Keep each workstream completable in one agent session and independently
263
+ green; use causal boundaries instead of hard line-count or file-count
264
+ rules.
265
+ - List every package or directory each workstream touches.
266
+ - Use stable `SC-xx` success-criteria IDs for downstream traceability.
267
+ - The manifest is the single source of truth for success criteria,
268
+ workstreams, dependencies, and scope. The program document references them
269
+ by id and never restates their text.
270
+ - Give every workstream a `scope` with a specific `summary`, and state
271
+ `excludes` wherever a neighbor might reasonably assume coverage.
272
+ - Record anticipated decisions in the program document — the decider reads
273
+ them, and a decision anticipated at planning time is handled better at run
274
+ time.
@@ -0,0 +1,29 @@
1
+ <!-- BEGIN UNIVERSAL — source: {{UNIVERSAL_SOURCE}} -->
2
+ {{UNIVERSAL_DIRECTIVES}}
3
+ <!-- END UNIVERSAL -->
4
+
5
+ ---
6
+
7
+ ## Project: {{PROJECT_NAME}}
8
+
9
+ See `docs/vision.md` for the full product vision.
10
+ See `docs/programs/` for program plans and manifests.
11
+ See `tasks/{program-id}/` for workstream specs.
12
+
13
+ ### Tech Stack
14
+
15
+ {{STACK}}
16
+
17
+ ### Product
18
+
19
+ {{DESCRIPTION}}
20
+
21
+ ### Conventions
22
+
23
+ [Document project-specific module structure, naming, IDs, validation, testing, and delivery conventions.]
24
+
25
+ ### Dependency Versions (pin these)
26
+
27
+ | Package | Version |
28
+ |---------|---------|
29
+ {{DEPENDENCY_ROWS}}
@@ -0,0 +1,7 @@
1
+ # Agent Directives
2
+
3
+ The canonical agent directives, project context, conventions, and constraints for
4
+ {{PROJECT_NAME}} live in **`AGENTS.md`**.
5
+
6
+ **Read `AGENTS.md` now and follow it.** Do not maintain instructions in this file—
7
+ update `AGENTS.md` instead to keep a single source of truth.
@@ -0,0 +1,50 @@
1
+ # Agent Directives: Universal
2
+
3
+ These directives apply to every agent working in this repository, regardless
4
+ of provider or harness.
5
+
6
+ ## Scope and depth
7
+
8
+ 1. SPEC-FIRST: When a workstream spec exists under `tasks/`, read it before
9
+ implementing. Do not invent architecture that contradicts the spec or
10
+ `docs/vision.md`. If the spec is ambiguous, ask — do not guess.
11
+
12
+ 2. ROOT CAUSE OVER SYMPTOM: Prefer the smallest diff that fully solves the
13
+ root cause, not the smallest diff that makes symptoms disappear. When the
14
+ proper fix is out of scope, say so explicitly and propose it as a
15
+ follow-up instead of silently shipping a band-aid.
16
+
17
+ 3. STRUCTURAL FIXES STAY IN SCOPE: If architecture is flawed, state is
18
+ duplicated, or patterns are inconsistent inside the files the task already
19
+ touches, fix it. Do not expand into unrelated modules without asking. On
20
+ question-only or review-only tasks, answer — do not rewrite code unless
21
+ asked.
22
+
23
+ ## Verification
24
+
25
+ 4. VERIFY BEFORE CLAIMING COMPLETION: A successful file write proves nothing
26
+ about correctness. Before reporting a task complete, run the project's
27
+ configured build, type-check, test, and lint commands and fix every
28
+ resulting error. If one of those commands is not configured, state that
29
+ explicitly instead of claiming it passed.
30
+
31
+ ## Edit safety
32
+
33
+ 5. READ BEFORE EDITING: Read a file before modifying it, and re-read any file
34
+ you have not seen recently in a long session before editing it again.
35
+
36
+ 6. EXHAUSTIVE RENAMES: When renaming any function, type, or variable, search
37
+ for direct references, type-level references, string literals, dynamic
38
+ imports, re-exports, and test files. Do not assume one search pass caught
39
+ everything.
40
+
41
+ ## Large tasks
42
+
43
+ 7. WORK IN VERIFIABLE PHASES: Break multi-file work into phases that each
44
+ pass verification on their own. In interactive sessions, pause between
45
+ phases for review; in automated pipeline runs, complete and verify each
46
+ phase before starting the next.
47
+
48
+ 8. PARALLELIZE INDEPENDENT WORK: When the harness supports sub-agents and the
49
+ task spans many independent files, split the work rather than degrading a
50
+ single context; keep tightly coupled changes together.
@@ -0,0 +1,46 @@
1
+ # {{PROJECT_NAME}} — Vision Document
2
+
3
+ ## What Is {{PROJECT_NAME}}?
4
+ [One paragraph: what the product is and why it exists.]
5
+
6
+ **One-liner:** {{DESCRIPTION}}
7
+
8
+ ## The Problem
9
+ [What pain point does this solve? Who has this problem?]
10
+
11
+ ## The Solution
12
+ [High-level description of the approach.]
13
+
14
+ ## Architecture
15
+ [System architecture diagram or description. ASCII art is fine.]
16
+
17
+ ## Core Concepts
18
+ [Key abstractions, entities, or domain concepts.]
19
+
20
+ ## API Surface
21
+ [Public-facing interfaces: SDK methods, REST endpoints, CLI commands, etc.]
22
+
23
+ ## Data Model
24
+ [Key entities and their relationships.]
25
+
26
+ ## Target Users
27
+ [Primary and secondary personas.]
28
+
29
+ ## Technology Stack
30
+
31
+ **Primary stack:** {{STACK}}
32
+
33
+ | Layer | Choice | Rationale |
34
+ |-------|--------|-----------|
35
+ | [Layer] | [Technology] | [Why it fits] |
36
+
37
+ ## Scope: Phase 1
38
+
39
+ **Build:**
40
+ - [Phase 1 deliverable]
41
+
42
+ **Do not build in Phase 1:**
43
+ - [Explicitly deferred item]
44
+
45
+ ## Scope: Phase 2+
46
+ [Brief notes on future direction—enough to inform architectural decisions.]