Skip to content

Commit e9e013e

Browse files
roodboiclaude
andcommitted
docs: non-negotiable docs-currency rule across instruction surfaces
Interface/behavior changes must update docs in the same patch; CLI reference regenerates via bun run docs:cli-reference; agent-facing phrasing changes go through instruction-source + setup sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4709d89 commit e9e013e

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

.codex/skills/hack-cli/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Use `hack` as the primary interface for local-first development.
6363
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
6464
- Managed via CLI: `.hack/.internal/extra-hosts.json` (use `hack internal extra-hosts ...` commands).
6565
- Lifecycle runtime files: `.hack/.internal/lifecycle/state.json`, `.hack/.internal/lifecycle/*.log`.
66+
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
6667

6768
## Linked git worktrees
6869

@@ -172,13 +173,15 @@ Use `hack` as the primary interface for local-first development.
172173
- Audit integration state only: `hack setup sync --all-scopes --check`
173174
- Remove generated integration artifacts: `hack setup sync --all-scopes --remove`
174175
- After upgrading CLI: `hack update` then `hack setup sync --all-scopes`
176+
- When changing hack itself: interface or behavior changes must update docs/ in the same change (regenerate the CLI reference with `bun run docs:cli-reference`).
175177

176178
## Agent setup (CLI-first)
177179

178180
- Cursor rules: `hack setup cursor`
179181
- Claude hooks: `hack setup claude`
180182
- Codex skill: `hack setup codex`
181183
- Refresh all local agent integrations: `hack setup sync --all-scopes`
184+
- Agent-assisted onboarding: `hack init --with claude|codex|both` (new repos) or `hack agent onboard` (existing projects) print/hand off the full setup prompt; the `/hack-init` skill and the `hack-init` MCP prompt return the same content.
182185
- Init prompt: `hack agent init` (use --client cursor|claude|codex to open)
183186
- Init patterns: `hack agent patterns`
184187
- MCP (no-shell only): `hack setup mcp`

.cursor/rules/hack.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Prefer `hack` when shell access is available. Use MCP only when shell access is
2929
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
3030
- Managed via CLI: `.hack/.internal/extra-hosts.json` (use `hack internal extra-hosts ...` commands).
3131
- Lifecycle runtime files: `.hack/.internal/lifecycle/state.json`, `.hack/.internal/lifecycle/*.log`.
32+
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
3233

3334
## Linked git worktrees
3435

@@ -77,6 +78,7 @@ Prefer `hack` when shell access is available. Use MCP only when shell access is
7778
- Audit integration state only: `hack setup sync --all-scopes --check`
7879
- Remove generated integration artifacts: `hack setup sync --all-scopes --remove`
7980
- After upgrading CLI: `hack update` then `hack setup sync --all-scopes`
81+
- When changing hack itself: interface or behavior changes must update docs/ in the same change (regenerate the CLI reference with `bun run docs:cli-reference`).
8082

8183
## Optional extensions
8284

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ Never use any types and always default to leveraging generics and smart types to
5555

5656
## Verification Guardrails
5757

58+
- Docs currency is non-negotiable: ANY interface or behavior change (commands, flags, config keys, file layouts, env vars, defaults) must update the affected docs/ pages in the same patch — no matter what.
59+
- The CLI reference is generated: after changing the CLI surface, run `bun run docs:cli-reference` and commit `docs/reference/cli.md` (a drift test fails otherwise).
60+
- Agent-facing behavior phrasing lives in `src/agents/instruction-source.ts`; update it (not the generated surfaces) and run `hack setup sync --all-scopes`.
5861
- If a change affects `hack run`, `hack exec`, env resolution, runtime-state reconciliation, or lifecycle shell/process semantics, the patch must include both targeted tests and matching docs updates.
5962
- For env-sensitive command changes, verify the requested env, effective env, cached runtime-state env, and target-service-running matrix instead of a single happy path.
6063
- For lifecycle changes, verify `sh -c` semantics, process-group cleanup, stale pane/process metadata reconciliation, and interactive stdin behavior.
64+
- Real end-to-end coverage lives in `tests/e2e/` (`bun run test:e2e:local`, docker tier via `test:e2e:local:docker`) — extend it when adding user-facing workflows.
6165
- When a semantic contract changes, update the closest durable doc or skill instruction in the same patch so future work starts from the current rules.
6266

6367
## Command Complexity
@@ -251,6 +255,7 @@ Project files (managed vs generated):
251255
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
252256
- Managed via CLI: `.hack/.internal/extra-hosts.json` (use `hack internal extra-hosts ...` commands).
253257
- Lifecycle runtime files: `.hack/.internal/lifecycle/state.json`, `.hack/.internal/lifecycle/*.log`.
258+
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
254259

255260
Linked git worktrees:
256261
- Secret key inherits from the primary checkout automatically through the shared git common dir; set `HACK_ENV_SECRET_KEY` for CI or detached environments.
@@ -345,12 +350,14 @@ Agent integration maintenance:
345350
- Audit integration state only: `hack setup sync --all-scopes --check`
346351
- Remove generated integration artifacts: `hack setup sync --all-scopes --remove`
347352
- After upgrading CLI: `hack update` then `hack setup sync --all-scopes`
353+
- When changing hack itself: interface or behavior changes must update docs/ in the same change (regenerate the CLI reference with `bun run docs:cli-reference`).
348354

349355
Agent setup (CLI-first):
350356
- Cursor rules: `hack setup cursor`
351357
- Claude hooks: `hack setup claude`
352358
- Codex skill: `hack setup codex`
353359
- Refresh all local agent integrations: `hack setup sync --all-scopes`
360+
- Agent-assisted onboarding: `hack init --with claude|codex|both` (new repos) or `hack agent onboard` (existing projects) print/hand off the full setup prompt; the `/hack-init` skill and the `hack-init` MCP prompt return the same content.
354361
- Init prompt: `hack agent init` (use --client cursor|claude|codex to open)
355362
- Init patterns: `hack agent patterns`
356363
- MCP (no-shell only): `hack setup mcp`

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ TypeScript (strict). Runtimes: Bun 1.3+, Node 23. Prettier: 2 spaces, no semicol
3838
Always default to useing named paramaters in functions eg myFunction({ ctx, other }) vs myFunction(ctx, other)
3939
Never use any types and always default to leveraging generics and smart types to sensure the best possible tpye inference across the project.
4040

41+
## Docs Currency (non-negotiable)
42+
43+
- ANY interface or behavior change (commands, flags, config keys, file layouts, env vars, defaults) must update the affected docs/ pages in the same patch.
44+
- The CLI reference is generated: after changing the CLI surface, run `bun run docs:cli-reference` and commit `docs/reference/cli.md` (a drift test fails otherwise).
45+
- Agent-facing behavior phrasing lives in `src/agents/instruction-source.ts`; update it (not the generated surfaces) and run `hack setup sync --all-scopes`.
46+
- Real end-to-end coverage lives in `tests/e2e/` (`bun run test:e2e:local`) — extend it when adding user-facing workflows.
47+
4148
## Project Notes (Obsidian)
4249

4350
This project uses Obsidian for project context, specs, research, and progress tracking.
@@ -118,6 +125,7 @@ Project files (managed vs generated):
118125
- Generated (do not hand-edit): `.hack/.internal/compose.override.yml`, `.hack/.internal/compose.env.override.yml`, `.hack/.branch/compose.<branch>.override.yml`.
119126
- Managed via CLI: `.hack/.internal/extra-hosts.json` (use `hack internal extra-hosts ...` commands).
120127
- Lifecycle runtime files: `.hack/.internal/lifecycle/state.json`, `.hack/.internal/lifecycle/*.log`.
128+
- Ignore rules: hack owns a committed `.hack/.gitignore` (self-healing on init/up) covering machine-local generated files (`.internal/`, `.branch/`, `.env`, `.env.state.json`, `hack.env*.local.yaml`); keep it committed, and if generated files leaked into git, `hack doctor --fix` untracks them (files stay on disk).
121129

122130
Linked git worktrees:
123131
- Secret key inherits from the primary checkout automatically through the shared git common dir; set `HACK_ENV_SECRET_KEY` for CI or detached environments.
@@ -212,12 +220,14 @@ Agent integration maintenance:
212220
- Audit integration state only: `hack setup sync --all-scopes --check`
213221
- Remove generated integration artifacts: `hack setup sync --all-scopes --remove`
214222
- After upgrading CLI: `hack update` then `hack setup sync --all-scopes`
223+
- When changing hack itself: interface or behavior changes must update docs/ in the same change (regenerate the CLI reference with `bun run docs:cli-reference`).
215224

216225
Agent setup (CLI-first):
217226
- Cursor rules: `hack setup cursor`
218227
- Claude hooks: `hack setup claude`
219228
- Codex skill: `hack setup codex`
220229
- Refresh all local agent integrations: `hack setup sync --all-scopes`
230+
- Agent-assisted onboarding: `hack init --with claude|codex|both` (new repos) or `hack agent onboard` (existing projects) print/hand off the full setup prompt; the `/hack-init` skill and the `hack-init` MCP prompt return the same content.
221231
- Init prompt: `hack agent init` (use --client cursor|claude|codex to open)
222232
- Init patterns: `hack agent patterns`
223233
- MCP (no-shell only): `hack setup mcp`

src/agents/instruction-source.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ export const INSTRUCTION_SECTIONS: readonly InstructionSection[] = [
281281
"Audit integration state only: `hack setup sync --all-scopes --check`",
282282
"Remove generated integration artifacts: `hack setup sync --all-scopes --remove`",
283283
"After upgrading CLI: `hack update` then `hack setup sync --all-scopes`",
284+
"When changing hack itself: interface or behavior changes must update docs/ in the same change (regenerate the CLI reference with `bun run docs:cli-reference`).",
284285
],
285286
},
286287
{

0 commit comments

Comments
 (0)