You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agents): single instruction source with drift detection
All agent instruction surfaces (AGENTS.md/CLAUDE.md snippet, Codex skill,
Cursor rules, primer) now render from src/agents/instruction-source.ts.
setup sync --check detects stale marker content, not just marker presence.
Tickets removed from default instructions; linked-worktree guidance added.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
'- Dispatch command to remote workspace: `hack dispatch run --project <name|id> --node default --branch <branch> --runner generic -- "pwd"`.',
212
-
"",
213
-
"## Lifecycle + Startup",
214
-
"",
215
-
"- Put host setup in `.hack/hack.config.json` under `startup` / `lifecycle`.",
216
-
"- Use lifecycle processes for long-running host tasks, not ad-hoc terminals.",
217
-
'- For fixed-port host helpers such as SSM tunnels or local proxies, set `singleton.ports` and usually `onConflict: "adopt"` so Hack reuses a healthy existing listener instead of starting duplicate tunnel stacks.',
218
-
"- `singleton` is a listener guard, not process ownership transfer; adopted external processes are left running on `hack down`.",
219
-
"- Inspect via `hack projects --details` and `hack logs <service-or-process>`.",
220
-
"",
221
-
"## Verification Loops",
222
-
"",
223
-
"- For `hack run` / `hack exec` / env-resolution changes, verify the effective env transition matrix in",
message: "Cursor rules content is out of date. Run: hack setup cursor",
104
+
};
105
+
}
106
+
89
107
return{scope: opts.scope,status: "noop", path };
90
108
}
91
109
@@ -117,81 +135,20 @@ export async function removeCursorRules(opts: {
117
135
118
136
/**
119
137
* Render the Cursor rules template for hack CLI usage.
138
+
*
139
+
* Marker framing lives here; the instructional content is the `rules`-tagged
140
+
* sections from the shared instruction source.
120
141
*/
121
142
exportfunctionrenderCursorRules(): string{
122
143
constlines=[
123
144
"# hack CLI",
124
145
"# Auto-generated by 'hack setup cursor' - do not remove these markers",
125
146
MARKER_START,
126
147
"",
127
-
"This project uses `hack` for local runtime orchestration (compose + DNS/TLS + logs + sessions).",
148
+
"Hack v3 is local-first. This project uses `hack` for local runtime orchestration (compose + DNS/TLS + logs + sessions).",
128
149
"Prefer `hack` when shell access is available. Use MCP only when shell access is unavailable.",
129
150
"",
130
-
"Hack v3 is local-first. Supported core commands are `hack init`, `up/down/restart`, `open`, `logs`, `env`, `host exec/shell`, `session`, `doctor`, `daemon`, and optional local `tickets`.",
131
-
"Do not assume hosted auth, a web dashboard, built-in GitHub workflows, or built-in Linear sync exist. Remote/gateway/node/dispatch commands are unsupported experimental unless explicitly requested.",
132
-
"",
133
-
"## Core Rules",
134
-
"- Use `hack` CLI for start/stop/open/logs/run/session/tickets workflows.",
135
-
"- Do not run raw `docker compose up/down/logs` for normal project operations.",
136
-
"- Treat `.hack/.internal` and `.hack/.branch` as hack-managed artifacts; avoid manual edits there.",
137
-
"- Use lifecycle/startup config in `.hack/hack.config.json` instead of ad-hoc host process tabs.",
138
-
"- Use `--json` for machine-readable output when available.",
139
-
"- If state is inconsistent, run `hack doctor` then `hack doctor --fix` before manual repairs.",
140
-
"- For hostname routing, only services with Caddy labels on `hack-dev` are exposed (not every compose service).",
141
-
"- Use `.hack.gy` alias hosts for OAuth-style callback validation when `.hack` is rejected by providers.",
"- Put long-running host helpers in `.hack/hack.config.json` under `lifecycle.processes` or `startup` with `persistent: true`.",
151
-
'- For fixed-port helpers such as SSM tunnels or local proxies, use `singleton.ports` with `onConflict: "adopt"` when Hack should reuse an already-running equivalent listener.',
152
-
"- `singleton` adoption is not process ownership transfer; Hack leaves adopted external processes alone on `hack down`.",
153
-
"",
154
-
"## Quick Reference",
155
-
"```bash",
156
-
"hack init",
157
-
"hack up --detach",
158
-
"hack up -d",
159
-
"hack open --json",
160
-
"hack open <sub>",
161
-
"hack logs --pretty",
162
-
"hack logs <service>",
163
-
"hack logs --json --no-follow",
164
-
"hack logs --loki --since 2h --pretty",
165
-
"hack run <service> <cmd...>",
166
-
"hack restart",
167
-
"hack down",
168
-
"hack global status",
169
-
"hack session",
170
-
"hack tickets list",
171
-
"hack host exec --env qa --scope api -- bun db:migrate",
0 commit comments