@sassywares/skills 0.11.11 → 0.11.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassywares/skills",
3
- "version": "0.11.11",
3
+ "version": "0.11.14",
4
4
  "description": "Lean, explicit-invocation Agent Skills for shipping fast: plan, work, review, validate, ship.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@ argument-hint: "[section:<name>] [mode:run|discover|check]"
13
13
 
14
14
  # Sassy Dogfood
15
15
 
16
- **Outcome:** a report with a verdict — `pass`, `failed` with the failing step and its output tail, or `env`/`recipe` explaining why the run could not judge the work — in `.sassywares/dogfood/reports/<run-id>/`, plus, in `mode:discover`, a `recipe.md` that a fresh agent can follow with no other context.
16
+ **Outcome:** a report with a verdict — `pass`, `failed` with the failing step and its output tail, or `env`/`recipe` explaining why the run could not judge the work — in `.sassywares/dogfood/reports/<run-id>/`; or, in `mode:discover`, a `recipe.md` a fresh agent can follow with no other context; or, in `mode:check`, a lint and the last verdict, printed.
17
17
 
18
18
  **A procedure is the artifact.** The project stores how to dogfood itself in `.sassywares/dogfood/recipe.md`: ordered steps, each with an observable expectation, ending in one `Prove it:` step whose exit code is the verdict. The config points at it; it never restates it. Read the `sassy-setup` skill's `references/dogfood.md` first — it owns the recipe format, the report layout, and the verdict classes, and this skill only executes them.
19
19
 
@@ -25,80 +25,26 @@ argument-hint: "[section:<name>] [mode:run|discover|check]"
25
25
 
26
26
  ## Modes
27
27
 
28
- | Mode | What it does |
29
- |------|--------------|
30
- | `run` (default) | Preflight, execute the procedure from the recipe, write the report, classify, report back |
31
- | `discover` | Build or repair the recipe: probe the repo, try the cheapest proof that could work, write down what actually worked |
32
- | `check` | Lint the config and the recipe and print the last report's verdict; runs nothing, changes nothing |
28
+ | Mode | Load | It ends with |
29
+ |---|---|---|
30
+ | `run` (default) | `references/run.md` | a verdict from a report, returned compactly |
31
+ | `discover` | `references/discover.md` | a `recipe.md` proven by a clean run, with every gap visible |
32
+ | `check` | `references/check.md` | a printed lint and the last verdict; nothing written |
33
33
 
34
- `run` never edits the recipe. `discover` never gates anything: it produces a
35
- recipe, and the next `run` is what proves it.
34
+ Resolve the mode: an explicit `mode:` token wins. With none, it is `run`; a request to check or lint the setup is `check`, and a request to build, repair, or set up the procedure is `discover`. Read the one reference for that mode **and only that one**.
36
35
 
37
- ## Steps — `mode:run`
36
+ `run` never edits the recipe, and `discover` never gates anything: it produces a recipe, and the next `run` is what proves it. Only `discover` improvises; a run executes what the recipe names, classifies what it cannot, and stops.
38
37
 
39
- 1. **Resolve the target.** Read the `dogfood:` block. If `enabled` is not `true`, stop with one line: reporting is not enabled, and enabling it is `sassy-setup mode:init`. Load the recipe; a section the caller names (`section:<name>`) is the target, otherwise every section. A missing recipe, or one whose section has no `Prove it:` step, stops the run and names `mode:discover`. A section whose `**Prove it:**` says `none` is refused with one line — it has no machine verdict by design, so its QA rows are `Manual`, and running it would only manufacture an opinion. Never guess a verdict from a procedure that has none.
40
- 2. **Open the report.** Create `<reports>/<YYYYMMDD-HHMMSS>/` with `steps/` and `artifacts/`, and write `summary.md` with `status: running`, the class blank, the recipe path with the current commit, and the start time. Prune older run directories down to ten.
41
- 3. **Preflight, then the bring-up.** Preflight checks presence only: each env var the recipe **names** (never print a value), a session it refers to — only when it refers to one — actually sitting in `.sassywares/session/`, and the commands' entry points existing. A missing entry point, a tool not on `PATH`, or an absent env var is `class: env` — write the report, report it, and stop.
42
-
43
- Then **run the recipe's *Set up once*.** It is the bring-up, not a checklist: install frozen where the project has a lockfile, and continue. That is the only installing a run does — never install something the recipe does not name, never `docker pull`, never mutate the environment to make a step pass.
44
-
45
- 4. **Execute in order, stopping at the first broken expectation.** Per step: write `steps/<section>-<NN>.log`, capped head-and-tail, with the command and its output, values of every env var the recipe names masked, and the exit code. `Do` is a command *or* an instruction — satisfy it with whatever is available, and judge it only against its `Expect`. The step's own shell mechanics are part of the step: backgrounding a server, redirecting its output, creating the directory a log path lives in. Improvisation is what the recipe does **not** name. A step whose expectation fails ends that section: record it, keep everything already written, and skip to the report. Resume at the failed step on the next run, never from the top: the summary's `Next:` line says which.
46
- 5. **Take the verdict from the prove step.** The section's `Prove it:` step decides: exit 0 is `pass`, non-zero is `failed`. A failure earlier in the section is `failed` regardless. This skill holds no opinion about the work — a check it judged by reading instead of running is not a verdict.
47
- **The deadline is yours to hold.** Track wall-clock from the start and stop at `dogfood.timeout`, filing the run as `failed` with `class: env` and the step it stopped in. A step that can hang states its own bound in its `Expect`; the recipe-wide deadline is the backstop, not a substitute.
48
-
49
- 6. **Classify.** `env` when the environment cannot produce a verdict: exit 75 or 127, a missing dependency, or **a service nobody in this run controls** being down (a third-party API, a shared backend). That last one is neither `code` nor `recipe` — report it, name the dependency, and stop. The line between the two is whose text is wrong: the named toolchain is right but absent → `env`; the recipe names the wrong version, script, or URL → `recipe`, because the procedure itself is what failed; `recipe` when a step cannot be followed at all (a script renamed, a URL that no longer exists, a UI that no longer matches) — that is the procedure being stale, not the code being wrong; `code` otherwise. When in doubt between `recipe` and `code`, ask: could a person follow this step as written and still be testing the app? If not, it is `recipe`.
50
- 7. **Finalize and report.** A preflight or bring-up failure has no step id, so it logs to `steps/00-setup.log` and the summary's table row reads `setup`. Write the final `summary.md` (`status`, `class`, the per-step table, artifacts, `Next:`), then return compactly: verdict, class, section, failing step id, the last ~600 characters of that step's log, the report path, and — for `recipe` — the one-line diff you propose. Never paste a whole log to the caller.
51
- 8. **On `recipe`, propose and stop.** Show the diff that would make the procedure followable and ask before writing it. Never edit the recipe to turn a red run green: the cheapest way to pass a check must not be to weaken it.
52
-
53
- ## Steps — `mode:discover`
54
-
55
- 1. **Read what the project already says.** The existing recipe, the config, and the manifest's scripts (`package.json`, `Makefile`, `pyproject.toml`, `deno.json`, a CI workflow). **Reading is not deciding** — what exists is the starting point, never the target.
56
- 2. **Find the surfaces.** Read `**Out of scope:**` first and drop those from the
57
- list — they were decided against, and asking again is how a decision gets
58
- reopened every week. `**Uncovered:**` surfaces stay: they still want a path.
59
- Then: what is this product? A web app, an API, a CLI, a library, a desktop app, a mobile app in a simulator, several of them. Each surface that a change can break gets its own answer — in a monorepo especially, one app having a suite says nothing about its siblings. **A surface is something this repository serves**; a backend it calls is not a surface — record it as `**Upstream:**` and let its outages be `env`.
60
- 3. **Classify each surface, honestly.** Three classes and no fourth:
61
-
62
- | Class | Means | Becomes |
63
- |---|---|---|
64
- | `runtime` | something already drives the running product — e2e, integration, a smoke script | a section that wraps it |
65
- | `unit-only` | tests exist, but they never start the product | an **uncovered** section |
66
- | `none` | nothing | an **uncovered** section |
67
-
68
- **A unit test is not a dogfood path**, and neither is `lint`, `tsc`, or `build`: they never start the product. Recording one as coverage is the failure this step exists to prevent — it makes an untested app look tested, and nobody can tell afterwards that the gap was never closed.
69
- 4. **Ask, one surface at a time — and stop until answered.** With what you found: *"`web`, `api`, and `admin` have no runtime path — `web` has Playwright, the other two only unit tests. Set up a runtime check for `api` and `admin`?"* The options are wrap an existing suite, add a small runtime check, or leave it uncovered and say so. **This step blocks steps 5–8**: the answer decides what gets written, so with no user to ask, stop and report the question verbatim — never write a recipe on a guessed answer. Never leave a surface uncovered silently, and never fill the gap with what happens to exist.
70
-
71
- A **small runtime check is in scope**: a boot plus one assertion, a `curl`, a screenshot diff — written into the recipe as steps. That is not a test framework, and it is the only check this skill authors. Installing a driver or a runner to make one possible is out of bounds; without one already present, the surface is uncovered.
72
- 5. **Write the draft, one section per surface, gaps included.** With more than one surface, that surface's `**Preview:**` and `**Upstream:**` go **inside its own section** — a file-level address on a multi-app project can only describe one app. With exactly one surface, keep the file flat. Every surface in the inventory gets a section: an uncovered one ends with `**Prove it:** none`, explicitly, so a plan keeps its rows `Manual`; an out-of-scope one gets no section at all. Name both lists in the header (`**Uncovered:** api (unit tests only)` / `**Out of scope:** admin`) so the gaps are visible without reading every section.
73
- 6. **Run it, and log every deviation.** Bring the product up and run the draft. Anything you do that is **not a step in the recipe** — an install, an export, a patch, a workaround, a second terminal — is a *deviation*, written down as you go. This is the only step where improvising is allowed, and it is never silent.
74
- 7. **Reconcile.** Every deviation becomes exactly one of two things: a step in the recipe, or the reason this surface is unprovable (`**Prove it:** none`). A recipe whose check passed only with help the recipe does not contain is wrong. If you cannot capture a deviation as a step, the surface is uncovered — say so rather than shipping a procedure nobody else can follow.
75
- 8. **Prove the procedure, not the day — with a fresh agent.** Hand the recipe to a run that has **nothing but the recipe and the config**: a new session, or a dispatched agent, but never this one. It is run once from a clean checkout, allowing no deviation. If you cannot get one, say the recipe is **unverified** rather than claiming it. That second run is the artifact. If it needs improvising, the recipe is wrong: fix it and repeat once; still failing means uncovered and visible.
76
- 9. **Report.** Per surface: its class, its proof, whether it was asked about, the deviations you reconciled, and what is still unknown. Mark a check you wrote as **unproven** if you never watched it fail — breaking the thing once is the way to earn that. Say plainly that `sassy-setup` flips `dogfood.enabled` and that the switch alone changes nothing.
77
-
78
- ## Steps — `mode:check`
79
-
80
- Run the `sassy-setup` skill's `scripts/detect.sh --root <path> --check` and report the `dogfood` and recipe lines verbatim; print the newest report's `status`, `class`, and timestamp, or that there is none. Write nothing.
81
-
82
- ## Hard rules
38
+ ## Hard rules — every mode
83
39
 
84
40
  | Rule | Requirement |
85
41
  |------|-------------|
86
42
  | The verdict is an exit code | A section's `Prove it:` step decides. Never a judgement, a screenshot someone liked, or "looks right". |
87
43
  | No tooling, no installs | Never name or require a browser, driver, emulator, or MCP server. **What the recipe names is allowed** — if *Set up once* says `bun install --frozen-lockfile` or downloads the browser its suite declares, that is the project's declared bring-up and a run executes it. Installing anything the recipe does not name is out of bounds, and so is choosing a tool the project has not committed to. A permitted command's own lifecycle hooks (a `postinstall`) come with it; the run adds none of its own. |
88
44
  | Never production | Local or staging only. A recipe step pointing at production is refused and reported, not run. |
89
- | The run may not edit the check | A red run never fixes itself by editing the recipe or its expectations. Propose the diff, ask, stop. |
90
- | Reports stay local | Never commit `reports/`. Never paste a full log to a caller, a plan, or a PR. |
91
45
  | No secrets, ever | Env var **names** only, and session material stays in the gitignored `.sassywares/session/`. Mask values before a log is written, and never echo one in a report. |
92
- | Env is not code | Exit 75/127, a missing dependency, or an unreachable service is `env`: report and park. Looping on a broken toolchain burns a run for nothing. |
93
- | Resume, don't restart | Re-run from the failed step; the summary says where. Starting over hides the state that made the failure happen. |
94
- | Reports are disposable | Pruned to ten. The durable record is the QA row's note, which names the verdict and the run id, never a path that will vanish. |
95
- | Never promote what exists | A unit test, `lint`, or `build` is not a dogfood path. Discovery records what the product needs, and says so when that is nothing yet. |
96
- | Improvise out loud, or not at all | Discovery may improvise, never silently: every action that is not a step is a deviation, and every deviation is promoted into a step or kills the surface. A run never improvises — it classifies and stops. |
97
- | The second run is the artifact | A recipe is proven by a clean checkout that has nothing but the recipe. If it only works with the discoverer's context, it does not work. |
98
- | Ask about every gap | Each uncovered surface gets one question: wrap a suite, add a runtime check, or leave it uncovered and visible. Silence is how a gap becomes a false green. |
99
46
  | No third-party mutation | A run never registers a user, sends mail, charges a card, or writes to a service it does not own — a public demo API is somebody else's database. **A project-owned test environment is the exception**: an E2E deployment the project built, seeded by its own provisioning script and named in `**Upstream:**`, is the project's call. Production never is. |
100
- | No dependency churn | A bring-up never changes a lockfile. Install frozen where the project has one; a broken lockfile is `env`, not something to repair mid-run. |
101
- | Not a test framework | If the project has a suite, the recipe wraps it. This skill never grows assertions of its own beyond a step's `Expect`. |
47
+ | Reports stay local and disposable | Never commit `reports/`, which are pruned to ten. Never paste a full log to a caller, a plan, or a PR. The durable record is the QA row's note, which names the verdict and the run id, never a path that will vanish. |
102
48
 
103
49
  ## What dogfood is not
104
50
 
@@ -0,0 +1,12 @@
1
+ # Mode: check — lint the setup, print the last verdict, change nothing
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the check path only, and it is four lines long for a reason.
4
+
5
+ 1. **Lint.** Run the `sassy-setup` skill's `scripts/detect.sh --root <path> --check` and report the `dogfood` and recipe lines verbatim.
6
+ 2. **Report the last run.** Print the newest report's `status`, `class`, and timestamp, or that there is none. Read the summary only — never a step log.
7
+ 3. **Name the fix, don't make it.** Drift and a missing recipe are reported with the mode that fixes them: a skeleton or a stale procedure is `mode:discover`, and a config that forbids runs is `sassy-setup mode:init`.
8
+ 4. **Write nothing.** No report directory, no recipe edit, no config edit. A check that "just fixes a line while it is there" has become a discover run without the evidence to earn it.
9
+
10
+ | Rule | Requirement |
11
+ |------|-------------|
12
+ | Check writes nothing | Verdicts come from a `run`, procedures from a `discover`, config from `sassy-setup mode:init`. Check only reports. |
@@ -0,0 +1,59 @@
1
+ # Mode: discover — build or repair the recipe from what really worked
2
+
3
+ Read the shared sections in `SKILL.md` first (the recipe artifact, config, no-tooling, and the every-mode rules). This file is the discover path only. The recipe format is the `sassy-setup` skill's `references/dogfood.md`; you are writing that file, not executing it.
4
+
5
+ ## 1. Read what the project already says
6
+
7
+ The existing recipe, the config, and the manifest's scripts (`package.json`, `Makefile`, `pyproject.toml`, `deno.json`, a CI workflow). **Reading is not deciding** — what exists is the starting point, never the target.
8
+
9
+ ## 2. Find the surfaces
10
+
11
+ Read `**Out of scope:**` first and drop those from the list — they were decided against, and asking again is how a decision gets reopened every week. `**Uncovered:**` surfaces stay: they still want a path.
12
+
13
+ Then: what is this product? A web app, an API, a CLI, a library, a desktop app, a mobile app in a simulator, several of them. Each surface that a change can break gets its own answer — in a monorepo especially, one app having a suite says nothing about its siblings. **A surface is something this repository serves**; a backend it calls is not a surface — record it as `**Upstream:**` and let its outages be `env`.
14
+
15
+ ## 3. Classify each surface, honestly
16
+
17
+ | Class | Means | Becomes |
18
+ |---|---|---|
19
+ | `runtime` | something already drives the running product — e2e, integration, a smoke script | a section that wraps it |
20
+ | `unit-only` | tests exist, but they never start the product | an **uncovered** section |
21
+ | `none` | nothing | an **uncovered** section |
22
+
23
+ **A unit test is not a dogfood path**, and neither is `lint`, `tsc`, or `build`: they never start the product. Recording one as coverage is the failure this step exists to prevent — it makes an untested app look tested, and nobody can tell afterwards that the gap was never closed.
24
+
25
+ ## 4. Ask, one surface at a time — and stop until answered
26
+
27
+ With what you found: *"`web`, `api`, and `admin` have no runtime path — `web` has Playwright, the other two only unit tests. Set up a runtime check for `api` and `admin`?"* The options are wrap an existing suite, add a small runtime check, or leave it uncovered and say so. **This step blocks steps 5–8**: the answer decides what gets written, so with no user to ask, stop and report the question verbatim — never write a recipe on a guessed answer. Never leave a surface uncovered silently, and never fill the gap with what happens to exist.
28
+
29
+ A **small runtime check is in scope**: a boot plus one assertion, a `curl`, a screenshot diff — written into the recipe as steps. That is not a test framework, and it is the only check this skill authors. Installing a driver or a runner to make one possible is out of bounds; without one already present, the surface is uncovered.
30
+
31
+ ## 5. Write the draft, one section per surface, gaps included
32
+
33
+ With more than one surface, that surface's `**Preview:**` and `**Upstream:**` go **inside its own section** — a file-level address on a multi-app project can only describe one app. With exactly one surface, keep the file flat. Every surface in the inventory gets a section: an uncovered one ends with `**Prove it:** none`, explicitly, so a plan keeps its rows `Manual`; an out-of-scope one gets no section at all. Name both lists in the header (`**Uncovered:** api (unit tests only)` / `**Out of scope:** admin`) so the gaps are visible without reading every section.
34
+
35
+ ## 6. Run it, and log every deviation
36
+
37
+ Bring the product up and run the draft. Anything you do that is **not a step in the recipe** — an install, an export, a patch, a workaround, a second terminal — is a *deviation*, written down as you go. This is the only step where improvising is allowed, and it is never silent.
38
+
39
+ ## 7. Reconcile
40
+
41
+ Every deviation becomes exactly one of two things: a step in the recipe, or the reason this surface is unprovable (`**Prove it:** none`). A recipe whose check passed only with help the recipe does not contain is wrong. If you cannot capture a deviation as a step, the surface is uncovered — say so rather than shipping a procedure nobody else can follow.
42
+
43
+ ## 8. Prove the procedure, not the day — with a fresh agent
44
+
45
+ Hand the recipe to a run that has **nothing but the recipe and the config**: a new session, or a dispatched agent, but never this one. It is run once from a clean checkout, allowing no deviation. If you cannot get one, say the recipe is **unverified** rather than claiming it. That second run is the artifact. If it needs improvising, the recipe is wrong: fix it and repeat once; still failing means uncovered and visible.
46
+
47
+ ## 9. Report
48
+
49
+ Per surface: its class, its proof, whether it was asked about, the deviations you reconciled, and what is still unknown. Mark a check you wrote as **unproven** if you never watched it fail — breaking the thing once is the way to earn that. Say plainly that `sassy-setup` flips `dogfood.enabled` and that the switch alone changes nothing.
50
+
51
+ ## Rules for this path
52
+
53
+ | Rule | Requirement |
54
+ |------|-------------|
55
+ | Improvise out loud, or not at all | Discovery may improvise, never silently: every action that is not a step is a deviation, and every deviation is promoted into a step or kills the surface. |
56
+ | The second run is the artifact | A recipe is proven by a clean checkout that has nothing but the recipe. If it only works with the discoverer's context, it does not work. |
57
+ | Ask about every gap | Each uncovered surface gets one question: wrap a suite, add a runtime check, or leave it uncovered and visible. Silence is how a gap becomes a false green. |
58
+ | Never promote what exists | A unit test, `lint`, or `build` is not a dogfood path. Discovery records what the product needs, and says so when that is nothing yet. |
59
+ | Not a test framework | If the project has a suite, the recipe wraps it. Discovery never grows assertions of its own beyond a step's `Expect`. |
@@ -0,0 +1,54 @@
1
+ # Mode: run — execute the procedure, return a verdict
2
+
3
+ Read the shared sections in `SKILL.md` first (the recipe artifact, config, no-tooling, and the every-mode rules). This file is the run path only. The recipe format, report layout, and verdict classes are the `sassy-setup` skill's `references/dogfood.md`.
4
+
5
+ ## 1. Resolve the target
6
+
7
+ Read the `dogfood:` block. If `enabled` is not `true`, stop with one line: reporting is not enabled, and enabling it is `sassy-setup mode:init`. Load the recipe; a section the caller names (`section:<name>`) is the target, otherwise every section. A missing recipe, or one whose section has no `Prove it:` step, stops the run and names `mode:discover`. A section whose `**Prove it:**` says `none` is refused with one line — it has no machine verdict by design, so its QA rows are `Manual`, and running it would only manufacture an opinion. Never guess a verdict from a procedure that has none.
8
+
9
+ ## 2. Open the report
10
+
11
+ Create `<reports>/<YYYYMMDD-HHMMSS>/` with `steps/` and `artifacts/`, and write `summary.md` with `status: running`, the class blank, the recipe path with the current commit, and the start time. Prune older run directories down to ten.
12
+
13
+ ## 3. Preflight, then the bring-up
14
+
15
+ Preflight checks presence only: each env var the recipe **names** (never print a value), a session it refers to — only when it refers to one — actually sitting in `.sassywares/session/`, and the commands' entry points existing. A missing entry point, a tool not on `PATH`, or an absent env var is `class: env` — write the report, report it, and stop.
16
+
17
+ Then **run the recipe's *Set up once*.** It is the bring-up, not a checklist: install frozen where the project has a lockfile, and continue. That is the only installing a run does — never install something the recipe does not name, never `docker pull`, never mutate the environment to make a step pass.
18
+
19
+ ## 4. Execute in order, stopping at the first broken expectation
20
+
21
+ Per step: write `steps/<section>-<NN>.log`, capped head-and-tail, with the command and its output, values of every env var the recipe names masked, and the exit code. `Do` is a command *or* an instruction — satisfy it with whatever is available, and judge it only against its `Expect`. The step's own shell mechanics are part of the step: backgrounding a server, redirecting its output, creating the directory a log path lives in. Improvisation is what the recipe does **not** name. A step whose expectation fails ends that section: record it, keep everything already written, and skip to the report. Resume at the failed step on the next run, never from the top: the summary's `Next:` line says which.
22
+
23
+ ## 5. Take the verdict from the prove step
24
+
25
+ The section's `Prove it:` step decides: exit 0 is `pass`, non-zero is `failed`. A failure earlier in the section is `failed` regardless. This skill holds no opinion about the work — a check it judged by reading instead of running is not a verdict.
26
+
27
+ **The deadline is yours to hold.** Track wall-clock from the start and stop at `dogfood.timeout`, filing the run as `failed` with `class: env` and the step it stopped in. A step that can hang states its own bound in its `Expect`; the recipe-wide deadline is the backstop, not a substitute.
28
+
29
+ ## 6. Classify
30
+
31
+ | Class | When |
32
+ |---|---|
33
+ | `env` | The environment cannot produce a verdict: exit 75 or 127, a missing dependency, or **a service nobody in this run controls** being down (a third-party API, a shared backend). Report it, name the dependency, and stop. |
34
+ | `recipe` | The procedure itself is what failed: a step cannot be followed at all (a script renamed, a URL that no longer exists, a UI that no longer matches), or the recipe names the wrong version, script, or URL. |
35
+ | `code` | Everything else. |
36
+
37
+ The line between the last two is whose text is wrong: the named toolchain is right but absent → `env`; the recipe's own instructions cannot be followed or name the wrong thing → `recipe`. When in doubt, ask: could a person follow this step as written and still be testing the app? If not, it is `recipe`.
38
+
39
+ ## 7. Finalize and report
40
+
41
+ A preflight or bring-up failure has no step id, so it logs to `steps/00-setup.log` and the summary's table row reads `setup`. Write the final `summary.md` (`status`, `class`, the per-step table, artifacts, `Next:`), then return compactly: verdict, class, section, failing step id, the last ~600 characters of that step's log, the report path, and — for `recipe` — the one-line diff you propose. Never paste a whole log to the caller.
42
+
43
+ ## 8. On `recipe`, propose and stop
44
+
45
+ Show the diff that would make the procedure followable and ask before writing it. Never edit the recipe to turn a red run green: the cheapest way to pass a check must not be to weaken it.
46
+
47
+ ## Rules for this path
48
+
49
+ | Rule | Requirement |
50
+ |------|-------------|
51
+ | The run may not edit the check | A red run never fixes itself by editing the recipe or its expectations. Propose the diff, ask, stop. |
52
+ | Env is not code | Exit 75/127, a missing dependency, or an unreachable service is `env`: report and park. Looping on a broken toolchain burns a run for nothing. |
53
+ | Resume, don't restart | Re-run from the failed step; the summary says where. Starting over hides the state that made the failure happen. |
54
+ | No dependency churn | A bring-up never changes a lockfile. Install frozen where the project has one; a broken lockfile is `env`, not something to repair mid-run. |
@@ -12,89 +12,40 @@ argument-hint: "[path] [mode:init|check]"
12
12
 
13
13
  # Sassy Setup
14
14
 
15
- **Outcome:** `.sassywares/config.yaml` at the project root matching the tree it describes, the dogfood scaffold when agent QA was asked for, the skills installed in user or project scope and visible to the harness, the sassy-agents roster installed for the running harness, the snapshot tooling installed in `workspace` mode, and every file setup wrote committed — so the project is wired and the user is good to go in one run.
15
+ **Outcome:** `.sassywares/config.yaml` at the project root matching the tree it describes, the dogfood scaffold when agent QA was asked for, the skills installed in user or project scope and visible to the harness, the sassy-agents roster installed for the running harness, the snapshot tooling installed in `workspace` mode, and every file setup wrote committed — so the project is wired and the user is good to go in one run. A `check` run produces the same knowledge as a report, and changes nothing except committing setup-owned files that were already dirty.
16
16
 
17
17
  **Read `references/config.md` first.** It is the schema and the resolution rules; this skill only decides and writes.
18
18
 
19
19
  **Never a repo by force.** Setup records topology, it does not change it. No `git init`, ever.
20
20
 
21
- **Harness.** Loading another skill, dispatching an agent, and any command you hand the user follow `references/harness.md`; the agent wiring in step 5 uses its tables.
21
+ **Harness.** Loading another skill, dispatching an agent, and any command you hand the user follow `references/harness.md`; the agent wiring in step 5 of the init path uses its tables.
22
22
 
23
- ## Modes
24
-
25
- | Mode | What it does |
26
- |------|--------------|
27
- | `init` (default) | Detect, ask, write, wire, verify, commit, report |
28
- | `check` | Verify an existing setup against the tree and report |
29
-
30
- The argument names the mode: `mode:init`, `mode:check` (or `--check`, the older spelling). A run with no mode that finds a `.sassywares/config.yaml` walking up is a **check** run — a folder that is already wired is verified, never rebuilt from detection.
31
-
32
- A check run never edits the config and never rewrites the tree: it prints what `detect.sh --check` says, and its only possible write is step 8 committing setup-owned files that were already dirty. A fix is an `init` run, where each change is shown and approved first.
33
-
34
- ## Steps
35
-
36
- 1. **Resolve the start and the mode.** The path argument, else the working directory; the mode per above. On `check`, run steps 7 → 8 → 9 and stop.
37
- 2. **Detect.** Run `scripts/detect.sh --root <path>`. It prints a proposed config: topology (`repo`, `workspace`, `none`), the remote name, a probed base branch, and nested repos with their bases.
38
-
39
- **A config that already exists is the proposal.** When `.sassywares/config.yaml` is found — an explicit `init` on a project that is already wired — the detector's output is only the starting point: take every value it **probes** (`git.repo`, `base_map`'s `"*"`, `repos`), and take every value it **emits as a default** from the existing file instead — the other `base_map` rungs, `hooks.*`, `worktrees.*`, `dogfood.*`, `pr.*`, `commit.branch`, `knowledge.*`, `artifacts.*`. A default is not an answer: writing the blank slate here would retarget `"*"` away from the integration branch the project actually uses and delete its hooks. Present the result as a **diff against the file, key by key**, and ask before writing.
40
- 3. **Ask only what detection cannot answer.** Never re-ask what the tree already said.
41
- - **`workspace`** — the snapshot mirror: create a **private** GitHub repo, or connect an existing one? Creating it needs explicit approval and a named slug first.
42
- - **`none`** — confirm the intent: this folder is deliberately outside git, so commit, PR, and babysit refuse here.
43
- - **Artifacts** — offer the detected paths as the default; take overrides.
44
- - **Knowledge** — `knowledge.read` defaults to the solutions dir plus the concepts file. Ask whether there are extra folders to read (a hand-written `notes/learnings/`, a `docs/adr/`).
45
- - **Base map** — detection proposes `"*"` from the probed remote default. Ask where ordinary work branches from, and whether the default branch itself releases to another branch (a `staging: main` rung). Never write `main` as a guess. In `workspace` mode, show the `repos` map and get a yes on every row — a probed base is only the remote's default.
46
- - **`commit.branch`** — default `new`: the run cuts a branch before the first change and never commits on a base branch. Offer `current` for a repo that genuinely wants work committed where it stands, and say plainly that `current` lets a run commit onto its base branch and push it, with no PR (`pr.*` and `hooks.pr` are ignored; `hooks.push` runs). Under `mode:auto` with `current` on a base branch, ship pushes to that base with no gate.
47
- - **`pr.*`** — default `babysit: true`, `merge: false`, `delete_branch: false`. Say plainly that `merge: true` authorizes merging every babysat PR in this project without asking.
48
- - **Hooks** — offer, do not impose. Ask whether the project wants steps injected at `before_create`, `after_create`, `before_merge`, or `after_merge` (or `hooks.push` `after_push`, for `commit.branch: current` only), and under which head branch (`"*"` for all). Entries may carry args (`<skill> <args…>`); a hook skill's args are its own vocabulary. Leave them `[]` when there is nothing to add. **Never write a hook skill yourself** — hooks are project skills, and copying one of ours into that role is the fork this mechanism exists to prevent.
49
- - **Worktrees** — ask whether the project wants parallel work in this repo: a checkout per branch, each with its own derived namespace and port, so two runs never fight over one working tree. Say plainly what it costs and what it needs. `false` — the run works here, which is today's behaviour. `true` — a run may create a checkout, and `sassy-worktree` gains `create`, `list`, `preview`, `remove`, and `prune`. It needs `commit.branch: new`: under `current` nothing ever cuts a branch, so the switch would do nothing — say so and leave it `false` rather than writing a setting that cannot fire. In `workspace` or `none` topology, say it is not available and write `false`. Read `references/worktree.md`. **Say what a checkout will need for this project** — install, `.env` derivation, a per-namespace database, a simulator, the session — and offer to create the hook with `sassy-skill`; **never write its body yourself**. With no hook, say plainly that every new checkout starts empty and the first preview will show it.
50
- - **Dogfood** — ask whether the project wants agent QA: a stored procedure that proves a change works in the running product, which then lets `sassy-plan` write `Mode: Auto` QA rows instead of manual ones. Say plainly what each answer means. `false` — every QA row stays a human's, which is today's behavior. `true` — a plan may write Auto rows, but only for a recipe section that carries a `Prove it:` step, so the switch alone never makes a gate prove something. Write the answer explicitly either way; never leave it to inference. On yes, scaffold per step 4 and offer to run the first `sassy-dogfood mode:discover` before this run ends: yes means do it now (it is the only step that knows how to bring this app up), no means hand over the command and say the recipe stays a skeleton until it runs. Read `references/dogfood.md` and **never** write a command into the block or author the procedure: the recipe is the project's, and its first real content comes from a `sassy-dogfood mode:discover` run.
51
- 4. **Write the config.** Build the file from the proposal plus the answers. It is written **fully commented**: every key keeps a description and its allowed values, exactly as the detector emits them. Never strip those comments to save lines — for a teammate opening the file, the comments are the documentation. If a config already exists, show what changes and ask before writing — never silently overwrite. Keep every key; an unset key falls back to its documented default, so a short file is legal when nothing deviates.
52
-
53
- **The dogfood scaffold, only when the answer was yes.** Create `.sassywares/dogfood/` holding `recipe.md` copied verbatim from `assets/dogfood-recipe.md`, and `.sassywares/.gitignore` with two lines — `/session/` and `/dogfood/reports/` — adding them to a `.gitignore` that already exists rather than replacing it. Never overwrite an existing recipe — show it and ask. The skeleton is deliberately incomplete: it carries the shape and the rules and fills in nothing, because `sassy-dogfood mode:discover` writes the procedure from what actually worked. Say so in the report — `enabled: true` is a permission, not a promise that a check exists.
54
- 5. **Wire the skills and the agents.** Both install the same way: if they are already there in either scope, report which and move on; if not, ask once where to install, recommending user scope.
55
-
56
- - **Skills.** The suite comes from upstream with the open `skills` CLI. Never copy skill files in by hand, never add the suite as a dependency.
57
-
58
- **Installed** means the `sassy-*` skills exist in the project scope (`.agents/skills/sassy-*`, pinned in `skills-lock.json`) or the user scope (`~/.agents/skills/`, plus `~/.claude/skills/` for Claude Code). If they do, report which scope and move on. If not, ask once where to install, recommending user scope:
59
-
60
- - **User scope** — every project on this machine, nothing committed, updated with `npx skills update -g`. Run `npx -y skills add sassywares/sassy-skills -g -y`, which writes `~/.agents/skills/sassy-*`, the `~/.claude/skills/sassy-*` links, and `~/.agents/.skill-lock.json`.
61
- - **Project scope** — only this project, pinned with it. Run `npx -y skills add sassywares/sassy-skills -y`, which writes `.agents/skills/sassy-*` (real files), per-agent links such as `.claude/skills/sassy-*`, and `skills-lock.json`. The vendored folders and the lock are the pin and join step 8's commit list, so a clone needs no network. Ignore `.claude/skills` only — it is a link created at install time. Create `.gitignore` only when there is none, and in `workspace` topology never touch the project's root `.gitignore` at all.
62
-
63
- A project that wants its own pin on a machine that already has the user-scope suite can install in project scope too — say that Claude Code prefers the user-scope copy, so the project's pin does not decide what Claude Code runs there.
23
+ **The rest of the suite's shared references.** `references/branching.md` is how a run picks a branch and a base — setup records it here, every run reads it there. On the init path, `references/init.md` points at `references/worktree.md`, `references/dogfood.md`, and `references/workspace.md` when an answer or a topology needs them; a check run needs none of the three.
64
24
 
65
- **Do not wire updates.** How and when the suite is refreshed is the user's or the project's decision, not setup's: no `skills:*` scripts, no `postinstall` edit. Mention the update command for the chosen scope and stop there. Note for yourself that `npx skills check` is an alias of `update` — it is not a validator, and running it here would silently move the pin.
66
-
67
- - **Write `.sassywares/README.md`** from `assets/sassywares-readme.md` when absent. Never overwrite it — it may carry project notes.
68
- - **Agents.** The skills dispatch five subagents by name — `scout`, `worker`, `reviewer`, `simplifier`, `validator` — from [`sassy-agents`](https://github.com/sassywares/sassy-agents), which keeps one folder per harness. Use the row for the harness you are running in:
69
-
70
- | Harness | sassy-agents folder | User scope | Project scope |
71
- |---|---|---|---|
72
- | pi | `pi/` | `~/.pi/agent/agents/` | `.pi/agents/` |
73
- | Claude Code | `claude/` | `~/.claude/agents/` | `.claude/agents/` |
74
-
75
- A harness with no row has no folder in sassy-agents: say so, skip the agents, and name it in the report. Never translate another harness's folder by hand.
25
+ ## Modes
76
26
 
77
- **Installed** means all five `<name>.md` files exist in the user scope or the project scope. If they do, report which scope and move on. If any are missing, ask once where to install, recommending user scope:
27
+ | Mode | Load | It ends with |
28
+ |---|---|---|
29
+ | `init` (default) | `references/init.md` — steps 1–6, then the shared steps below | a wired, verified, committed project |
30
+ | `check` | `references/check.md` — step 7 onward, its own way | a report of drift and scope; no config and no tree written |
78
31
 
79
- - **User scope** — every project on this machine, updated by `git pull`. Reuse the user's sassy-agents checkout if they have one; otherwise ask where to clone it (`git clone https://github.com/sassywares/sassy-agents.git <dir>`). Then run `<dir>/scripts/install.sh <folder>`, which symlinks the folder into the user scope and never overwrites a differing file.
80
- - **Project scope** — only this project, pinned with it. Shallow-clone into its own `mktemp -d` under `/tmp/sassywares/scratch/` (two runs share that folder now, per `references/harness.md`), copy `<folder>/*.md` into the project scope directory, delete the clone. Never overwrite an existing agent file that differs: show it and ask. The copies join step 8's commit list.
32
+ The argument names the mode: `mode:init`, `mode:check` (or `--check`, the older spelling). A run with no mode that finds a `.sassywares/config.yaml` walking up is a **check** run — a folder that is already wired is verified, never rebuilt from detection. Read the one reference for that mode **and only that one**; steps 7–9 below are shared and run in both.
81
33
 
82
- - **Tell the user to `/reload`** (or restart the harness). The skills and agents are invisible to the harness until it rescans.
34
+ A check run never edits the config and never rewrites the tree. Its only possible write is step 8 committing setup-owned files that were already dirty. A fix is an `init` run, where each change is shown and approved first.
83
35
 
84
- 6. **Install the git tooling.** Two independent sets, each only when its answer was yes.
36
+ ## Steps 7–9 — shared by both modes
85
37
 
86
- - **Worktrees, `repo` topology and `worktrees.enabled: true`.** Copy every file in `assets/worktree/` flat into `.sassywares/worktree/` and make the five scripts executable, then add one `worktree:<script>` alias per script to the project's manifest, append-only, exactly as the workspace aliases are. **Prove the merge**: the file must still parse (`node -p "require('./package.json')"`, or the manifest's own syntax check) and `git diff` must show only added lines plus at most one trailing comma — anything else is a rewrite, so restore the file from `HEAD` and insert again. Report the `worktree-version` you installed. **Ask before overwriting any of them when they already exist** — from the first install they are the project's files. Read `references/worktree.md`. Do not create a worktree, and do not run a script: installing is the whole job, and the first `create` belongs to a run or to the user.
87
- - **Workspace, `workspace` topology only.** The snapshot plus the `branches` / `pull` / `checkout-bases` git helpers, and one `workspace:<script>` alias per script in the project's own manifest. Read `references/workspace.md` and follow it.
88
38
  7. **Verify.** Run `scripts/detect.sh --root <path> --check`. It validates the config against the tree — topology and remotes, `base_map` shape and cycles, `repos` against each nested repo, hooks, artifacts paths, `knowledge`, `pr.*` booleans, `commit.branch`, the `worktrees` block, the `dogfood` block, any unknown key, and in `workspace` mode the installed snapshot's version — plus, for a project-scope install, the pin: every suite-skill folder in `.agents/skills` (a name in the suite's roster, `assets/roster` in sassy-setup, not any `sassy-` prefix) hashed against `skills-lock.json`, the lock's coverage both ways, and whether git carries the lock. A user-scope install has no pin here; the check notes the scope it found. Report every `drift:` line verbatim, or that the config matches the tree. Drift blocks step 8.
89
39
 
90
40
  The `worktrees` half checks what a run would read: the switch and the port range, that the tooling is installed at the shipped version, that no checkout sits inside the working tree, that none holds a branch `base_map` names as a base, and that no port is still claimed by a worktree that no longer exists.
91
41
 
92
42
  The `dogfood` half is structural and never runs the product: `enabled` and `timeout` are in range, the two paths are relative and stay inside the project, `reports` and `.sassywares/session` are gitignored in a `repo` topology, and the recipe has a `**Prove it:**` line per section with an `**Expect**` per step and no secret-shaped string. A recipe that does not exist yet is a note, not drift — unless `enabled` is `true`, which is the one combination that would let a planner write Auto rows against a check nobody has.
93
43
 
94
- Then check the skills and the agents exactly as step 5's **Installed** rules say, and report the scope each was found in or what is missing. A check run never installs them; a missing suite or roster is reported with the fix (`mode:init`), and it does not block step 8.
44
+ Then check the skills and the agents exactly as step 5's **Installed** rules say, and report the scope each was found in or what is missing. Step 7 never installs anything: a missing suite or roster is reported with the fix (`mode:init`), and it does not block step 8.
45
+
95
46
  8. **Commit what setup owns.** `repo` topology only, and only when step 7 is clean. The file list is exactly what setup wrote or found unwritten:
96
47
 
97
- `.sassywares/config.yaml`, `.sassywares/README.md`, `.sassywares/dogfood/recipe.md` and `.sassywares/.gitignore` when step 4 created them, `.sassywares/worktree/*` and `package.json` when step 6 installed the tooling and added its aliases, `.agents/skills/sassy-*` and `skills-lock.json` when the suite is in project scope, the project-scope agent files when step 5 copied them, and `.gitignore` when step 5 created it. Named files only — never `git add -A`, never `git add .`. The reports directory is never in this list: it is gitignored, and nothing setup writes lives there.
48
+ `.sassywares/config.yaml`, `.sassywares/README.md`, `.sassywares/dogfood/recipe.md` and `.sassywares/.gitignore` when step 4 created them, `.sassywares/worktree/*` and `package.json` when step 6 installed the tooling and added its aliases, `.agents/skills/sassy-*` and `skills-lock.json` when the suite is in project scope, the project-scope agent files when step 5 copied them, and a root `.gitignore` when step 5 created one. Named files only — never `git add -A`, never `git add .`. The reports directory is never in this list: it is gitignored, and nothing setup writes lives there.
98
49
 
99
50
  Dispatch `sassy-commit` with that list and `branch:current`. The token is explicit, not this skill's default: wiring is a one-time bootstrap commit, and cutting a branch would leave the project configured but uncommitted until someone ships it. Name the branch it landed on, base branch included.
100
51
 
@@ -105,31 +56,23 @@ A check run never edits the config and never rewrites the tree: it prints what `
105
56
 
106
57
  9. **Report.** The config path, the topology, the resolved artifact and knowledge paths, whether agent QA is **off** — one line saying every QA row stays a human's, with no suggestion attached — or on, and then whether the recipe is ready or still a skeleton until `sassy-dogfood mode:discover` runs, where the skills are installed (scope) and where the agents are (scope and harness), or why either is not, the commit (hash and branch) or why there is none, and in `workspace` mode what was installed, with versions (`snapshot vN`, `workspace-git vN`), and the manifest the `workspace:*` aliases went into — naming it as created when there was no script surface to begin with. Remind: `/reload` so the harness rescans. Close with what is left over — at most dirt setup deliberately did not commit — and nothing else: a clean setup leaves the user good to go.
107
58
 
108
- ## Hard rules
59
+ ## Hard rules — every mode
109
60
 
110
61
  | Rule | Requirement |
111
62
  |------|-------------|
112
63
  | No `git init` | Setup never turns a folder into a repo, and never does remote or ref surgery. The step 8 commit is its only git write. |
113
- | Commit only what setup owns | The config, the setup README, the vendored `sassy-*` folders and `skills-lock.json` (project scope), the project-scope agent files, and a `.gitignore` setup created. Never a file the user wrote or the repo already had, unless they name it. |
114
64
  | Verify before commit | A config that fails `--check` is reported, never committed. |
115
- | Approval to create a remote | Creating the mirror repo needs an explicit yes and a named slug first. |
65
+ | Commit only what setup owns | The config, the setup README, the vendored `sassy-*` folders and `skills-lock.json` (project scope), the project-scope agent files, and a `.gitignore` setup created. Never a file the user wrote or the repo already had, unless they name it. |
116
66
  | No silent overwrite | An existing config or an existing `.sassywares/workspace/snapshot` is shown and asked about, never replaced blind. |
117
- | Version is reported | Setup names the snapshot and `workspace-git` versions it installed; `--check` flags an installed copy older than the skill's. |
67
+ | Write boundary | Only `.sassywares/` (the config, the setup README, the dogfood scaffold, and the worktree tooling), the skills and agent files step 5 installed in the scope the user chose, `skills-lock.json` (project scope), `.sassywares/.gitignore` with its two lines, and at most one root `.gitignore` line that step 5 created. Never `package.json` outside step 6's `worktree:*` and `workspace:*` aliases, never a root `.gitignore` in a workspace. Workspace git helpers land in `.sassywares/workspace/`, never in a project's `bin/`. |
68
+ | Install the tooling, never use it | Setup copies `.sassywares/worktree/` and wires the aliases. It never creates a checkout, never claims a port, and never runs a script — those are a run's or the user's. |
118
69
  | Skills come from upstream | Install with `npx skills add`, `-g` for user scope; never hand-copy skill files or maintain the links yourself. |
119
70
  | Agents come from sassy-agents | Only the running harness's folder, as-is: linked by `install.sh` (user scope) or copied verbatim (project scope). Never edit, merge, or overwrite a differing agent file without asking. |
120
71
  | Never edit the manifest | No dependencies, no `postinstall`, no `skills:*` scripts. The one exception is step 6's `worktree:*` and `workspace:*` aliases: appended or corrected, never removed, and nothing else in the file touched. Setup installs the suite; the user or project decides how it updates. |
121
- | Write boundary | Only `.sassywares/` (the config, the setup README, the dogfood scaffold, and the worktree tooling), the skills and agent files step 5 installed in the scope the user chose, `skills-lock.json` (project scope), and one `.gitignore` line — and the project-scope part of that list is step 8's commit. Never `package.json` outside step 6's `worktree:*` and `workspace:*` aliases, never a root `.gitignore` in a workspace. Workspace git helpers land in `.sassywares/workspace/`, never in a project's `bin/`. |
122
- | Detect, don't guess | An unknown base branch stays unknown and gets asked about. A probed value is reported as probed. |
123
- | A re-apply is a diff | On a project that already has a config, every key the detector only *defaults* keeps its value from that file. Changing one needs the user to say so — never a detector default, and never a silent deletion. |
124
- | Comments are part of the file | Every key keeps its description and allowed values. A stripped config is an incomplete config. |
125
- | Hooks are named, not written | Setup records hook skill names. Creating those skills is the project's work. |
126
- | Dogfood is a pointer | The block names a recipe, a reports path, a timeout, and whether Auto rows are allowed — four keys. Never a command and never a tool: a copied command duplicates the manifest and cannot express step order. |
127
- | The recipe is the project's | Setup scaffolds the skeleton and stops. Authoring or "fixing" a procedure is `sassy-dogfood mode:discover`'s job, and a run may never edit the recipe to make its own failure pass. |
128
72
  | Run output and sessions never ship | `.sassywares/.gitignore` holds `/session/` and `/dogfood/reports/`. Never remove a line, never add anything from either path to the commit, and never write a credential anywhere else. |
129
73
  | No secrets in setup's writes | Env var names only, in the config and in the skeleton. A credential never lands in a file setup commits. |
130
- | Worktrees need `new` | `worktrees.enabled: true` with `commit.branch: current` is refused, not written: nothing cuts a branch there, so the switch could never fire. |
131
- | Install the tooling, never use it | Setup copies `.sassywares/worktree/` and wires the aliases. It never creates a checkout, never claims a port, and never runs a script — those are a run's or the user's. |
132
- | Repair is `check` | Run against an existing config, setup reports drift — it does not rewrite the file without approval. |
74
+ | Version is reported | Setup names the snapshot and `workspace-git` versions it installed; `--check` flags an installed copy older than the skill's. |
75
+ | Repair is `init` | `check` reports drift and never rewrites; closing it is `mode:init`, where every change is shown and approved first. |
133
76
 
134
77
  ## What setup is not
135
78
 
@@ -10,11 +10,11 @@
10
10
  # 3. Everything resolves against the MAIN checkout, so running any of these
11
11
  # from inside a worktree behaves identically.
12
12
  #
13
- # worktree-version: 6
13
+ # worktree-version: 7
14
14
 
15
15
  set -euo pipefail
16
16
 
17
- WT_VERSION="6"
17
+ WT_VERSION="7"
18
18
  WT_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
19
 
20
20
  log() { printf '%s\n' "$*"; }
@@ -372,7 +372,7 @@ _wt_preview_block() {
372
372
  # section is the answer; with several, nothing is returned rather than guessing which
373
373
  # app a checkout is serving.
374
374
  wt_preview() {
375
- local slug="$1" sect="${2:-}" recipe line="" n first port base
375
+ local slug="$1" sect="${2:-}" recipe line="" cand count sl port base
376
376
  recipe="$(wt_flat | awk -F'\t' -v p="dogfood${WLIB_US}recipe" '$1 == p { print $2; exit }')"
377
377
  recipe="${recipe:-.sassywares/dogfood/recipe.md}"
378
378
  case "$recipe" in /*) ;; *) recipe="$MAIN/$recipe" ;; esac
@@ -380,11 +380,18 @@ wt_preview() {
380
380
  if [ -n "$sect" ]; then line="$(_wt_preview_block "$recipe" "$sect")"; fi
381
381
  if [ -z "$line" ]; then line="$(_wt_preview_block "$recipe" "")"; fi
382
382
  if [ -z "$line" ]; then
383
- n="$(grep -c '^## ' "$recipe" 2>/dev/null || true)"
384
- if [ "${n:-0}" = "1" ]; then
385
- first="$(sed -n 's/^## \([^ ]*\).*/\1/p' "$recipe" | head -n 1)"
386
- [ -n "$first" ] && line="$(_wt_preview_block "$recipe" "$first")"
387
- fi
383
+ # Fall back to the single section that *declares* an address. Counting sections
384
+ # would fail on a recipe with one app and one uncovered surface, which is a
385
+ # perfectly ordinary shape: only the app has somewhere to look.
386
+ count=0; cand=""
387
+ while IFS= read -r sl; do
388
+ [ -n "$sl" ] || continue
389
+ cand="$(_wt_preview_block "$recipe" "$sl")"
390
+ [ -n "$cand" ] || continue
391
+ count=$((count + 1))
392
+ line="$cand"
393
+ done < <(sed -n 's/^## \([^ ]*\).*/\1/p' "$recipe")
394
+ [ "$count" -eq 1 ] || line=""
388
395
  fi
389
396
  [ -n "$line" ] || return 0
390
397
  port=""
@@ -0,0 +1,15 @@
1
+ # Mode: check — verify an existing setup, write nothing
2
+
3
+ Read the shared sections in `SKILL.md` first, including steps 7–9. This file is only what a check run does differently: it enters at step 7 and never runs steps 1–6.
4
+
5
+ 1. **Enter at step 7.** No detection, no questions, no config write: a folder that is already wired is verified, never rebuilt from detection. Run `scripts/detect.sh --root <path> --check` exactly as step 7 says, and report every `drift:` line verbatim, or that the config matches the tree.
6
+ 2. **Report the scope you found.** Check the skills and the agents exactly as step 5's **Installed** rules say, and report the scope each was found in or what is missing. **Check installs nothing** — a missing suite or roster is reported with the fix, and it does not block step 8.
7
+ 3. **Commit only dirty setup-owned files.** Step 8 applies only when something setup already owns is uncommitted — an edited config, a scaffold nobody committed, a pin that drifted — and only when step 7 is clean. Nothing dirty, nothing to commit.
8
+ 4. **Report as step 9 says,** then name what closes each finding: the drift line, the missing scope, and the mode that fixes it.
9
+
10
+ A check run never edits the config, never installs a skill or an agent, never rewrites the tree, and never scaffolds a recipe. A check that "just fixes it while it is there" has become an unapproved `init`.
11
+
12
+ | Rule | Requirement |
13
+ |------|-------------|
14
+ | Check reports, init repairs | Every finding is reported with `mode:init` as its fix. Nothing is corrected in place, approved or not. |
15
+ | No detection | A check compares the file to the tree; it never re-derives the config from the tree and calls the difference drift. |
@@ -0,0 +1,88 @@
1
+ # Mode: init — detect, ask, write, wire
2
+
3
+ Read the shared sections in `SKILL.md` first (config-first, never-a-repo, harness, the modes, and steps 7–9). This file is steps 1–6. When step 6 is done, return to `SKILL.md` for steps 7–9: verify, commit, report.
4
+
5
+ ## 1. Resolve the start
6
+
7
+ The path argument, else the working directory. `init` is the default mode; the mode rules live in `SKILL.md`.
8
+
9
+ ## 2. Detect
10
+
11
+ Run `scripts/detect.sh --root <path>`. It prints a proposed config: topology (`repo`, `workspace`, `none`), the remote name, a probed base branch, and nested repos with their bases.
12
+
13
+ **A config that already exists is the proposal.** When `.sassywares/config.yaml` is found — an explicit `init` on a project that is already wired — the detector's output is only the starting point: take every value it **probes** (`git.repo`, `base_map`'s `"*"`, `repos`), and take every value it **emits as a default** from the existing file instead — the other `base_map` rungs, `hooks.*`, `worktrees.*`, `dogfood.*`, `pr.*`, `commit.branch`, `knowledge.*`, `artifacts.*`. A default is not an answer: writing the blank slate here would retarget `"*"` away from the integration branch the project actually uses and delete its hooks. Present the result as a **diff against the file, key by key**, and ask before writing.
14
+
15
+ ## 3. Ask only what detection cannot answer
16
+
17
+ Never re-ask what the tree already said.
18
+
19
+ - **`workspace`** — the snapshot mirror: create a **private** GitHub repo, or connect an existing one? Creating it needs explicit approval and a named slug first.
20
+ - **`none`** — confirm the intent: this folder is deliberately outside git, so commit, PR, and babysit refuse here.
21
+ - **Artifacts** — offer the detected paths as the default; take overrides.
22
+ - **Knowledge** — `knowledge.read` defaults to the solutions dir plus the concepts file. Ask whether there are extra folders to read (a hand-written `notes/learnings/`, a `docs/adr/`).
23
+ - **Base map** — detection proposes `"*"` from the probed remote default. Ask where ordinary work branches from, and whether the default branch itself releases to another branch (a `staging: main` rung). Never write `main` as a guess. In `workspace` mode, show the `repos` map and get a yes on every row — a probed base is only the remote's default.
24
+ - **`commit.branch`** — default `new`: the run cuts a branch before the first change and never commits on a base branch. Offer `current` for a repo that genuinely wants work committed where it stands, and say plainly that `current` lets a run commit onto its base branch and push it, with no PR (`pr.*` and `hooks.pr` are ignored; `hooks.push` runs), and that a later `sassy-ship` run in `mode:auto` will then push to that base with no gate.
25
+ - **`pr.*`** — default `babysit: true`, `merge: false`, `delete_branch: false`. Say plainly that `merge: true` authorizes merging every babysat PR in this project without asking.
26
+ - **Hooks** — offer, do not impose. Ask whether the project wants steps injected at `before_create`, `after_create`, `before_merge`, or `after_merge` (or `hooks.push` `after_push`, for `commit.branch: current` only), and under which head branch (`"*"` for all). Entries may carry args (`<skill> <args…>`); a hook skill's args are its own vocabulary. Leave them `[]` when there is nothing to add. **Never write a hook skill yourself** — hooks are project skills, and copying one of ours into that role is the fork this mechanism exists to prevent.
27
+ - **Worktrees** — ask whether the project wants parallel work in this repo: a checkout per branch, each with its own derived namespace and port, so two runs never fight over one working tree. Say plainly what it costs and what it needs. `false` — the run works here, which is today's behaviour. `true` — a run may create a checkout, and `sassy-worktree` gains `create`, `list`, `preview`, `remove`, and `prune`. It needs `commit.branch: new`: under `current` nothing ever cuts a branch, so the switch would do nothing — say so and leave it `false` rather than writing a setting that cannot fire. In `workspace` or `none` topology, say it is not available and write `false`. Read `references/worktree.md`. **Say what a checkout will need for this project** — install, `.env` derivation, a per-namespace database, a simulator, the session — and offer to create the hook with `sassy-skill`; **never write its body yourself**. With no hook, say plainly that every new checkout starts empty and the first preview will show it.
28
+ - **Dogfood** — ask whether the project wants agent QA: a stored procedure that proves a change works in the running product, which then lets `sassy-plan` write `Mode: Auto` QA rows instead of manual ones. Say plainly what each answer means. `false` — every QA row stays a human's, which is today's behavior. `true` — a plan may write Auto rows, but only for a recipe section that carries a `Prove it:` step, so the switch alone never makes a gate prove something. Write the answer explicitly either way; never leave it to inference. On yes, scaffold per step 4 and offer to run the first `sassy-dogfood mode:discover` before this run ends: yes means do it now (it is the only step that knows how to bring this app up), no means hand over the command and say the recipe stays a skeleton until it runs. Read `references/dogfood.md` and **never** write a command into the block or author the procedure: the recipe is the project's, and its first real content comes from a `sassy-dogfood mode:discover` run.
29
+
30
+ ## 4. Write the config
31
+
32
+ Build the file from the proposal plus the answers. It is written **fully commented**: every key keeps a description and its allowed values, exactly as the detector emits them. Never strip those comments to save lines — for a teammate opening the file, the comments are the documentation. If a config already exists, show what changes and ask before writing — never silently overwrite. Keep every key; an unset key falls back to its documented default, so a short file is legal when nothing deviates.
33
+
34
+ **The dogfood scaffold, only when the answer was yes.** Create `.sassywares/dogfood/` holding `recipe.md` copied verbatim from `assets/dogfood-recipe.md`, and `.sassywares/.gitignore` with two lines — `/session/` and `/dogfood/reports/` — adding them to a `.gitignore` that already exists rather than replacing it. Never overwrite an existing recipe — show it and ask. The skeleton is deliberately incomplete: it carries the shape and the rules and fills in nothing, because `sassy-dogfood mode:discover` writes the procedure from what actually worked. Say so in the report — `enabled: true` is a permission, not a promise that a check exists.
35
+
36
+ ## 5. Wire the skills and the agents
37
+
38
+ Both install the same way: report the scope if the pieces are present, otherwise ask once where to install, recommending user scope.
39
+
40
+ - **Skills.** The suite comes from upstream with the open `skills` CLI. Never copy skill files in by hand, never add the suite as a dependency.
41
+
42
+ **Installed** means the `sassy-*` skills exist in the project scope (`.agents/skills/sassy-*`, pinned in `skills-lock.json`) or the user scope (`~/.agents/skills/`, plus `~/.claude/skills/` for Claude Code).
43
+
44
+ - **User scope** — every project on this machine, nothing committed, updated with `npx skills update -g`. Run `npx -y skills add sassywares/sassy-skills -g -y`, which writes `~/.agents/skills/sassy-*`, the `~/.claude/skills/sassy-*` links, and `~/.agents/.skill-lock.json`.
45
+ - **Project scope** — only this project, pinned with it. Run `npx -y skills add sassywares/sassy-skills -y`, which writes `.agents/skills/sassy-*` (real files), per-agent links such as `.claude/skills/sassy-*`, and `skills-lock.json`. The vendored folders and the lock are the pin and join step 8's commit list, so a clone needs no network. Ignore `.claude/skills` only — it is a link created at install time. Create `.gitignore` only when there is none, and in `workspace` topology never touch the project's root `.gitignore` at all.
46
+
47
+ A project that wants its own pin on a machine that already has the user-scope suite can install in project scope too — say that Claude Code prefers the user-scope copy, so the project's pin does not decide what Claude Code runs there.
48
+
49
+ **Do not wire updates.** How and when the suite is refreshed is the user's or the project's decision, not setup's: no `skills:*` scripts, no `postinstall` edit. Mention the update command for the chosen scope and stop there. Note for yourself that `npx skills check` is an alias of `update` — it is not a validator, and running it here would silently move the pin.
50
+
51
+ - **Write `.sassywares/README.md`** from `assets/sassywares-readme.md` when absent. Never overwrite it — it may carry project notes.
52
+ - **Agents.** The skills dispatch five subagents by name — `scout`, `worker`, `reviewer`, `simplifier`, `validator` — from [`sassy-agents`](https://github.com/sassywares/sassy-agents), which keeps one folder per harness. Use the row for the harness you are running in:
53
+
54
+ | Harness | sassy-agents folder | User scope | Project scope |
55
+ |---|---|---|---|
56
+ | pi | `pi/` | `~/.pi/agent/agents/` | `.pi/agents/` |
57
+ | Claude Code | `claude/` | `~/.claude/agents/` | `.claude/agents/` |
58
+
59
+ A harness with no row has no folder in sassy-agents: say so, skip the agents, and name it in the report. Never translate another harness's folder by hand.
60
+
61
+ **Installed** means all five `<name>.md` files exist in the user scope or the project scope.
62
+
63
+ - **User scope** — every project on this machine, updated by `git pull`. Reuse the user's sassy-agents checkout if they have one; otherwise ask where to clone it (`git clone https://github.com/sassywares/sassy-agents.git <dir>`). Then run `<dir>/scripts/install.sh <folder>`, which symlinks the folder into the user scope and never overwrites a differing file.
64
+ - **Project scope** — only this project, pinned with it. Shallow-clone into its own `mktemp -d` under `/tmp/sassywares/scratch/` (two runs share that folder now, per `references/harness.md`), copy `<folder>/*.md` into the project scope directory, delete the clone. Never overwrite an existing agent file that differs: show it and ask. The copies join step 8's commit list.
65
+
66
+ - **Tell the user to `/reload`** (or restart the harness). The skills and agents are invisible to the harness until it rescans.
67
+
68
+ ## 6. Install the git tooling
69
+
70
+ Two independent sets, each only when its answer was yes.
71
+
72
+ - **Worktrees, `repo` topology and `worktrees.enabled: true`.** Copy every file in `assets/worktree/` flat into `.sassywares/worktree/` and make the five scripts executable, then add one `worktree:<script>` alias per script to the project's manifest, append-only, exactly as the workspace aliases are. **Prove the merge**: the file must still parse (`node -p "require('./package.json')"`, or the manifest's own syntax check) and `git diff` must show only added lines plus at most one trailing comma — anything else is a rewrite, so restore the file from `HEAD` and insert again. Report the `worktree-version` you installed. **Ask before overwriting any of them when they already exist** — from the first install they are the project's files. Read `references/worktree.md`. Do not create a worktree, and do not run a script: installing is the whole job, and the first `create` belongs to a run or to the user.
73
+ - **Workspace, `workspace` topology only.** The snapshot plus the `branches` / `pull` / `checkout-bases` git helpers, and one `workspace:<script>` alias per script in the project's own manifest. Read `references/workspace.md` and follow it.
74
+
75
+ Then return to `SKILL.md` for steps 7–9.
76
+
77
+ ## Rules for this path
78
+
79
+ | Rule | Requirement |
80
+ |------|-------------|
81
+ | Detect, don't guess | An unknown base branch stays unknown and gets asked about. A probed value is reported as probed. |
82
+ | A re-apply is a diff | On a project that already has a config, every key the detector only *defaults* keeps its value from that file. Changing one needs the user to say so — never a detector default, and never a silent deletion. |
83
+ | Approval to create a remote | Creating the mirror repo needs an explicit yes and a named slug first. |
84
+ | Comments are part of the file | Every key keeps its description and allowed values. A stripped config is an incomplete config. |
85
+ | Hooks are named, not written | Setup records hook skill names. Creating those skills is the project's work. |
86
+ | Dogfood is a pointer | The block names a recipe, a reports path, a timeout, and whether Auto rows are allowed — four keys. Never a command and never a tool: a copied command duplicates the manifest and cannot express step order. |
87
+ | The recipe is the project's | Setup scaffolds the skeleton and stops. Authoring or "fixing" a procedure is `sassy-dogfood mode:discover`'s job, and a run may never edit the recipe to make its own failure pass. |
88
+ | Worktrees need `new` | `worktrees.enabled: true` with `commit.branch: current` is refused, not written: nothing cuts a branch there, so the switch could never fire. |
@@ -205,12 +205,17 @@ recipe_lint() {
205
205
  if (index($0, "-->")) incomment = 0
206
206
  next
207
207
  }
208
- # The two inventories are file level: names of surfaces, not a surface.
209
- index($0, "**Uncovered:**") {
210
- line = $0; sub(/^\*\*Uncovered:\*\*[[:space:]]*/, "", line); inventory(line, "unc"); next
211
- }
212
- index($0, "**Out of scope:**") {
213
- line = $0; sub(/^\*\*Out of scope:\*\*[[:space:]]*/, "", line); inventory(line, "oos"); next
208
+ # The two inventories are file level: names of surfaces, not a surface. Inside a
209
+ # section they are a mistake — a section states its own answer with **Prove it:**.
210
+ index($0, "**Uncovered:**") || index($0, "**Out of scope:**") {
211
+ if (sec != "") {
212
+ printf "\"**Uncovered:**\" and \"**Out of scope:**\" are file level only — section \"%s\" states its own answer with **Prove it:** none\n", sname
213
+ next
214
+ }
215
+ line = $0
216
+ if (index($0, "**Uncovered:**")) { sub(/^\*\*Uncovered:\*\*[[:space:]]*/, "", line); inventory(line, "unc") }
217
+ else { sub(/^\*\*Out of scope:\*\*[[:space:]]*/, "", line); inventory(line, "oos") }
218
+ next
214
219
  }
215
220
  index($0, "**Prove it:**") {
216
221
  prove = 1
@@ -67,8 +67,10 @@ Paths in the table are the defaults. `.agents/skills/` is read by pi and others;
67
67
  - **One `SKILL.md` is the default, but it is a decision, not a reflex.** Length never decides the shape; the paths do.
68
68
  - **Split whenever the skill branches into paths that end differently.** A mode, trigger, or branch that writes a different thing, forbids a different thing, or is never needed in the same run as its sibling gets its own `references/<path>.md` — **even at three paragraphs**. How small each path is does not matter: what matters is that a model running path A never reads path B's instructions next to A's. Divergent outcomes sharing one file bleed into each other, and the bleed looks like helpfulness until it has already written the wrong thing. Think ahead when you write it, not after the first misfire. This skill is shaped by its own rule.
69
69
  - **Never split a shared surface.** What every path needs — ids, board or table values, hard rules, API quirks, house style — stays in `SKILL.md`, or each path pays to load it and they drift apart. One reference per **outcome**, never one per **section**: `references/` holding five short topic files is the oversplit, and it makes routing vaguer, not sharper.
70
+ - **A gate or a picker is not a path.** A mode that only changes *who* approves — `manual` asks, `auto` proceeds, `return` reports — while the steps and the artifacts stay the same belongs in the body, as a one-line gate table. So does a picker: mutually exclusive choices the user picks from, each a line that hands off to another skill or stops, is read as a whole on purpose, because presenting the choice is the work. Neither has path-specific instructions to bleed, so splitting them produces empty files and a vaguer body. `sassy-review`, `sassy-simplify`, `sassy-validate`, `sassy-ship`, `sassy-compound`, and `sassy-debug`'s Phase-2 options are shaped this way on purpose. Split when the steps or the ending differ and the user does not choose between them at read time.
71
+ - **Suite-wide facts live in one place, outside the body.** Config resolution, harness commands, and branch policy are read by every skill, and they live once in the `sassy-setup` skill's `references/` (`config.md`, `harness.md`, `branching.md`, `worktree.md`, `dogfood.md`). Pointing a skill's body at them is correct; copying them into each body is the drift the shared-surface rule exists to prevent. `sassy-dogfood` reading `references/dogfood.md` on every run is the same case, and these are not "topic files" for the oversplit rule — they are one surface owned by one skill.
70
72
  - **`SKILL.md` becomes routing.** State the dispatch explicitly — a table naming exactly one reference per path, plus "read that one only". That sentence is what prevents the bleed; a pointer buried in a paragraph does not.
71
- - A reference that is read on *every* run saves nothing and may cost a little, so it belongs in the body.
73
+ - A reference that is read on *every* run saves nothing and may cost a little, so it belongs in the body — unless it is a suite-wide surface, which stays where the suite keeps it.
72
74
  - Keep `SKILL.md` an index: outcome → hard rules → workflow → explicit pointers ("read `references/x.md` before doing Y"). Never bury path-specific detail in a monolithic file.
73
75
 
74
76
  ## Self-check checklist
@@ -80,7 +82,9 @@ The gate for a new or edited skill, and the instrument in `mode:verify`.
80
82
  - [ ] Frontmatter is valid YAML with the required fields.
81
83
  - [ ] Every `references/…` path exists and is pointed to explicitly in the body.
82
84
  - [ ] Each outcome path that ends differently has its own reference, and the body dispatches to exactly one of them per run.
85
+ - [ ] Gate-only modes (who approves) and pickers (the user chooses) stayed in the body; only paths that change the steps or the ending and are not chosen at read time were split.
83
86
  - [ ] No reference exists merely because its content was a separate section — that is oversplitting, not shaping.
87
+ - [ ] A suite-wide surface is named as the `sassy-setup` skill's reference, not copied into the body.
84
88
  - [ ] The body is lean; no always-read detail needlessly hidden in a reference.
85
89
  - [ ] No secrets, and no capability the skill cannot actually use.
86
90
 
@@ -13,6 +13,7 @@ Read the skill and say which of these it is, in one line. "It feels long" is not
13
13
  | **Won't trigger** | Rewrite the description: what + when, concrete verbs, the user's own words. Not the body. |
14
14
  | **Fires when it shouldn't** | Tighten the description's *when* half, or add `disable-model-invocation: true` if it is an explicit-only skill. |
15
15
  | **One path's rules bleed into another's** (a mode doing the neighbouring mode's job) | A shape bug, not a wording bug: split the divergent outcomes into `references/`, one file per path, and give the body a dispatch table naming exactly one file per mode. Rewording the paragraph does not fix adjacency. |
16
+ | **Two modes' steps interleaved through one body** (every step carries a "on `check`, do this instead") | Route it: one reference per mode, a dispatch table naming exactly one per run, and the genuinely shared steps left in the body once. Interleaved branches are how two modes drift into contradicting each other. |
16
17
  | **Too long / bloated** | Extract conditional content to `references/`, or delete what never gets used. Never delete a hard rule to save lines. |
17
18
  | **Wrong or stale steps** | Correct the workflow against the current tree — read the files the steps name before trusting them. |
18
19
  | **Wrong scope** | Move it between project and user: into the project when the team needs it, out to the user when only one person does. |
@@ -24,7 +25,7 @@ If the request names no failure, ask for one. A retune without a failure is a re
24
25
 
25
26
  - One failure, the smallest edit that kills it, no drive-by rewrites or tidy-ups.
26
27
  - Re-read the surrounding lines so the fix does not contradict a rule elsewhere in the file.
27
- - If the fix moves content into `references/`, the body must dispatch to it by name and say to read only that one.
28
+ - If the fix moves content into `references/`, the body must dispatch to it by name and say to read only that one. Gate-only modes stay in the body: splitting an approver is not a retune.
28
29
 
29
30
  ## 4. Save and re-verify
30
31
 
@@ -16,8 +16,8 @@ Walk the shared **Self-check checklist** item by item. For each, the evidence is
16
16
 
17
17
  - Description: quote it and count the characters; does it name the *moment* it fires?
18
18
  - References: every pointer resolves to a file that exists, and the body says read only one at a time.
19
- - Shape: do the divergent paths sit in separate files, and is each shared surface back in the body?
20
- - Leanness: is anything in the body only sometimes needed, or anything in a reference read on every run?
19
+ - Shape: do the divergent paths sit in separate files, is each shared surface back in the body, and did gate-only modes (who approves) stay in the body?
20
+ - Leanness: is anything in the body only sometimes needed, or anything in a reference read on every run — other than a suite-wide surface such as `config.md` or `harness.md`?
21
21
 
22
22
  ## 3. Run the skill, if it is installed
23
23
 
@@ -13,7 +13,7 @@ argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
13
13
 
14
14
  **Outcome:** a checkout per branch that a run or a human can use without touching the main one — created, addressed, previewed, and removed without losing work — or a table saying what exists and what is safe to delete.
15
15
 
16
- **Config.** Resolve `.sassywares/config.yaml` (nearest, walking up) per the `sassy-setup` skill's `references/config.md`. `worktrees.enabled` decides whether any of this runs; `dir` and `ports` are read by the scripts, not by you. Precedence: explicit token > session instruction > config > skill default. Read `references/worktree.md` in the `sassy-setup` skill before the first mode.
16
+ **Config.** Resolve `.sassywares/config.yaml` (nearest, walking up) per the `sassy-setup` skill's `references/config.md`. `worktrees.enabled` decides whether any of this runs; `dir` and `ports` are read by the scripts, not by you. Precedence: explicit token > session instruction > config > skill default. Read the `sassy-setup` skill's `references/worktree.md` before the first mode: it owns the directory, port, refusal, and hook rules the scripts implement.
17
17
 
18
18
  **The scripts do the git.** `.sassywares/worktree/{create,list,stop,remove,prune}` are installed by `sassy-setup` and own the mechanics: `git worktree`, the port claim, the refusals. This skill never runs `git worktree` itself, never invents a port, and never deletes a directory.
19
19
 
@@ -21,66 +21,26 @@ argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
21
21
 
22
22
  ## Modes
23
23
 
24
- | Mode | What it does |
25
- |------|--------------|
26
- | `list` (default) | The table: branch, worktree, how to see it, liveness, last dogfood verdict. Only managed checkouts appear; others are counted in a footer |
27
- | `create` | Add a worktree for the run's branch, claim its port, dispatch `after_create` |
28
- | `preview` | Bring that checkout up and print how to see it; leave it running. `stop` reaps it |
29
- | `remove` | Dispatch `before_remove`, then delete after the script's refusals pass |
30
- | `prune` | Show merged-or-gone worktrees that are safe to delete, then remove what you approve |
24
+ | Mode | Load | It ends with |
25
+ |---|---|---|
26
+ | `list` (default) | `references/list.md` | the table of managed checkouts, as it prints |
27
+ | `create` | `references/create.md` | a ready checkout, its address, and its hooks |
28
+ | `preview` | `references/preview.md` | a checkout left running, and how to see it |
29
+ | `remove` | `references/remove.md` | a deleted checkout, a released port, a surviving branch |
30
+ | `prune` | `references/prune.md` | the removed checkouts, and why each skipped row was skipped |
31
31
 
32
- `list` is the default because it is the only mode that changes nothing.
32
+ Resolve the mode: an explicit `mode:` token wins. With none, it is `list` — the only mode that changes nothing; a request to add a checkout is `create`, to bring one up is `preview`, to delete one is `remove`, and to sweep the safe ones is `prune`. Read the one reference for that mode **and only that one**.
33
33
 
34
- ## `create`
35
-
36
- 1. **Resolve the branch and its start point first**, through the `sassy-setup` skill's `references/branching.md`, exactly as `sassy-work` does. A run that reaches here has already decided; the branch is not created twice. When a human asks for one by hand with no branch named, ask for the branch name — never derive one.
37
- 2. **Run `.sassywares/worktree/create <branch> --from <start-point>`** with the resolved start point. It is idempotent: an existing worktree for that branch is reported, a branch held by the main checkout is refused, and a port is claimed either way. On `--env` it prints the `WT_*` block alone.
38
- 3. **Dispatch the declared hooks.** The script prints one line per `hooks.worktree.after_create` entry; it cannot dispatch a skill, so you do. One `worker` each, in declared order: *load the project skill at `.agents/skills/<name>/SKILL.md` and follow it*, briefed with the `WT_*` block and the fact that the checkout now exists. A missing skill or a `blocked` result stops here — the checkout is real but unprepared, and saying so is the report.
39
- 4. **Report** the path, branch, namespace, port, address, the preview line, and the hooks that ran or that none are declared. If the caller is a run, tell it to work in `WT_PATH` from now on.
40
-
41
- ## `list`
42
-
43
- Paths in the table are shortened to `~`; `--path <slug>` prints the real absolute path, which is what you hand a user who wants to open the checkout in an editor.
44
-
45
- Run `.sassywares/worktree/list` and present it as it prints — branch, worktree, how to see it, live, last verdict. `--preview <slug>` prints how to see one checkout, `--path <slug>` its path, and `--address <slug>` its URL — from its claimed port, or the one its preview line names. Never summarise the table away: how to see it is the point.
46
-
47
- ## `preview`
48
-
49
- 1. **Resolve the target and the section.** `preview <slug>` uses that checkout; with none, ask which. `section:<name>` names a dogfood recipe section; with none, use the first.
50
- 2. **Read the recipe** at `dogfood.recipe`. Two things stop the run, and both are reported rather than worked around: no recipe (the project has no stored procedure — say to run `sassy-dogfood mode:discover`), or the section has no `Prove it:` step (nothing marks where bringing-up ends).
51
- 3. **Preflight the session.** If the recipe's *Working in a second checkout* or *Set up once* names a session artifact and `.sassywares/session/` in **that checkout** is empty, that is `class: env`: report it with the line that fixes it and stop. Never open a logged-out app and call it a preview — the human will read the login screen as a broken build.
52
- 4. **Run the bring-up.** In `WT_PATH`: the recipe's *Set up once* when the checkout is cold (no `.env`, no installed deps), then the section's steps in order **up to but not including** its `Prove it:` step. Judge each step by its `Expect`. A failure stops the preview and is reported with the step id and its output tail — a preview that half-started is not a preview.
53
- 5. **Leave it running and report how to see it.** `list --preview <slug>` prints the recipe's `**Preview:**` line with the namespace substituted — the *result*, a URL or a simulator name or a window, never the command that started it. Print exactly that; never build an address yourself, and never assume one is a URL. When the project has ports and the preview answers on one, say it is up; when it does not, say it is running and that stopping it is the project's job.
54
- 6. **To stop it,** run `.sassywares/worktree/stop <slug>`. It kills whatever answers on the address this checkout advertises — its claimed port, or the port its preview line names — so it works for a project with no port resource too. A preview that names no port at all is the project's to stop, and it says so.
55
-
56
- Preview never judges the work, never writes a report, never commits, and never returns a verdict. If the user wants to know whether it *works*, that is `sassy-dogfood mode:run`.
57
-
58
- ## `remove`
59
-
60
- 1. **Dispatch `before_remove` first**, one `worker` per declared entry, briefed with the `WT_*` block and that the checkout is about to go. Its job is the project's cleanup: drop the derived database, shut the simulator.
61
- 2. **Run `.sassywares/worktree/remove <slug> --hook-ok`.** Without `--hook-ok` it exits `3` by design when a hook is declared — that exit is the handshake, not an error to route around.
62
- 3. **Say what survives.** `remove` deletes the checkout and its port claim; the **branch stays**, so the work is still reachable. Naming that stops someone assuming the deletion took their commits with it.
63
- 4. **Report a refusal verbatim and stop.** Dirty tree, unpushed commits, a live preview, the main checkout: each is a real reason, and `--force` is the user's call, never yours. On success report the released port and the removed path.
64
-
65
- ## `prune`
66
-
67
- 1. Run `.sassywares/worktree/prune` with no flag and show the table.
68
- 2. Ask before removing. `--yes` removes only rows marked `removable`: merged into their upstream or whose upstream is gone, clean, fully pushed, not running, and no `before_remove` hook it would skip. Rows with a hook are reported so the user can run `remove <slug>` instead and get the cleanup.
69
- 3. Report the counts — removed, left, and why each skipped row was skipped.
70
-
71
- ## Hard rules
34
+ ## Hard rules — every mode
72
35
 
73
36
  | Rule | Requirement |
74
37
  |------|-------------|
75
38
  | The scripts do the git | Never run `git worktree`, never invent a port, never `rm -rf` a checkout. `.sassywares/worktree/*` owns all of it. |
76
- | One worktree per run | The branch decision belongs to `references/branching.md`. Never create a second worktree for a run already on its branch. |
77
39
  | Repo topology only | `git.repo: workspace` or `none` means no worktrees at all. Say so in one line and stop — never create a checkout inside a nested repo to work around it. |
78
40
  | Ours only | A checkout is managed when it sits under `worktrees.dir` **and** carries `.sassywares/config.yaml`. Never list, prune, stop, or remove one that is not — another tool made it, or it was cut before the wiring. `create` says so when that happens. |
79
41
  | Names come from the script | `WT_NAMESPACE` is derived once, and `WT_PORT` only when the project configured a range. Never build a database name, a compose project, or a device name by hand. |
80
- | A preview is not a URL | How to see a checkout is the recipe's preview line. A port is one resource among several; a mobile app's preview is a simulator, and this skill must not invent a URL for it. |
81
42
  | Hooks are dispatched, not skipped | A declared `after_create` or `before_remove` runs. `remove` exits `3` rather than skipping it, and that is deliberate. |
82
43
  | Never force on your behalf | `--force` skips the dirty and unpushed checks. Only the user's explicit instruction passes it. |
83
- | Preview is a promise | Report a URL only when something answers on it. A half-started app is a failure with a step id, not a preview — and an app without a port gets its preview line, not a fabricated address. |
84
44
  | No verdicts | This skill never says whether the work is correct. That is `sassy-dogfood`'s job, with a report. |
85
45
  | No state of its own | Liveness is probed at read time. There is no registry, no pid file, and nothing to go stale. |
86
46
  | Never production | A preview serves the local or staging app. A recipe step pointing at production is refused and reported. |
@@ -0,0 +1,13 @@
1
+ # Mode: create — add a checkout for a branch
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the create path only.
4
+
5
+ 1. **Resolve the branch and its start point first**, through the `sassy-setup` skill's `references/branching.md`, exactly as `sassy-work` does. A run that reaches here has already decided; the branch is not created twice. When a human asks for one by hand with no branch named, ask for the branch name — never derive one.
6
+ 2. **Run `.sassywares/worktree/create <branch> --from <start-point>`** with the resolved start point. It is idempotent: an existing worktree for that branch is reported, a branch held by the main checkout is refused, and a port is claimed either way. On `--env` it prints the `WT_*` block alone.
7
+ 3. **Dispatch the declared hooks.** The script prints one line per `hooks.worktree.after_create` entry; it cannot dispatch a skill, so you do. One `worker` each, in declared order: *load the project skill at `.agents/skills/<name>/SKILL.md` and follow it*, briefed with the `WT_*` block and the fact that the checkout now exists. A missing skill or a `blocked` result stops here — the checkout is real but unprepared, and saying so is the report.
8
+ 4. **Report** the path, branch, namespace, port, address, the preview line, and the hooks that ran or that none are declared. If the caller is a run, tell it to work in `WT_PATH` from now on.
9
+
10
+ | Rule | Requirement |
11
+ |------|-------------|
12
+ | One worktree per run | The branch decision belongs to the `sassy-setup` skill's `references/branching.md`. Never create a second worktree for a run already on its branch. |
13
+ | Never derive a branch | A human asking for a checkout by hand names its branch. Guessing one is how a checkout lands on a branch nobody is working. |
@@ -0,0 +1,12 @@
1
+ # Mode: list — the table, as it prints
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the list path only. `list` is the default because it is the only mode that changes nothing.
4
+
5
+ 1. Run `.sassywares/worktree/list` and present it as it prints — branch, worktree, how to see it, live, last verdict. Never summarise the table away: how to see it is the point.
6
+ 2. Paths in the table are shortened to `~`. `--path <slug>` prints the real absolute path, which is what you hand a user who wants to open the checkout in an editor.
7
+ 3. `--preview <slug>` prints how to see one checkout, and `--address <slug>` its URL — from its claimed port, or the one its preview line names. Use the script; never assemble an address yourself.
8
+ 4. Only managed checkouts appear. Anything else found under the worktrees directory is counted in a footer, never listed as if it were ours.
9
+
10
+ | Rule | Requirement |
11
+ |------|-------------|
12
+ | The table is the answer | A prose summary of the table throws away the column the user needed. Print it, then add at most one sentence. |
@@ -0,0 +1,17 @@
1
+ # Mode: preview — bring a checkout up, and leave it up
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the preview path only. Preview has no script of its own: it runs the recipe. `stop` is the script that reaps it.
4
+
5
+ 1. **Resolve the target and the section.** `preview <slug>` uses that checkout; with none, ask which. `section:<name>` names a dogfood recipe section; with none, use the first.
6
+ 2. **Read the recipe** at `dogfood.recipe`. Two things stop the run, and both are reported rather than worked around: no recipe (the project has no stored procedure — say to run `sassy-dogfood mode:discover`), or the section has no `Prove it:` step (nothing marks where bringing-up ends).
7
+ 3. **Preflight the session.** If the recipe's *Working in a second checkout* or *Set up once* names a session artifact and `.sassywares/session/` in **that checkout** is empty, that is `class: env`: report it with the line that fixes it and stop. Never open a logged-out app and call it a preview — the human will read the login screen as a broken build.
8
+ 4. **Run the bring-up.** In `WT_PATH`: the recipe's *Set up once* when the checkout is cold (no `.env`, no installed deps), then the section's steps in order **up to but not including** its `Prove it:` step. Judge each step by its `Expect`. A failure stops the preview and is reported with the step id and its output tail — a preview that half-started is not a preview.
9
+ 5. **Leave it running and report how to see it.** `list --preview <slug>` prints the recipe's `**Preview:**` line with the namespace substituted — the *result*, a URL or a simulator name or a window, never the command that started it. Print exactly that; never build an address yourself, and never assume one is a URL. When the project has ports and the preview answers on one, say it is up; when it does not, say it is running and that stopping it is the project's job.
10
+ 6. **To stop it,** run `.sassywares/worktree/stop <slug>`. It kills whatever answers on the address this checkout advertises — its claimed port, or the port its preview line names — so it works for a project with no port resource too. A preview that names no port at all is the project's to stop, and it says so.
11
+
12
+ Preview never judges the work, never writes a report, never commits, and never returns a verdict. If the user wants to know whether it *works*, that is `sassy-dogfood mode:run`.
13
+
14
+ | Rule | Requirement |
15
+ |------|-------------|
16
+ | A preview is not a URL | How to see a checkout is the recipe's preview line. A port is one resource among several; a mobile app's preview is a simulator, and this skill must not invent a URL for it. |
17
+ | Preview is a promise | Report a URL only when something answers on it. A half-started app is a failure with a step id, not a preview — and an app without a port gets its preview line, not a fabricated address. |
@@ -0,0 +1,13 @@
1
+ # Mode: prune — sweep the checkouts that are safe to delete
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the prune path only.
4
+
5
+ 1. Run `.sassywares/worktree/prune` with no flag and show the table.
6
+ 2. Ask before removing. `--yes` removes only rows marked `removable`: merged into their upstream or whose upstream is gone, clean, fully pushed, not running, and no `before_remove` hook it would skip.
7
+ 3. Rows with a declared hook are reported so the user can run `remove <slug>` instead and get the cleanup. Prune never skips a hook silently.
8
+ 4. Report the counts — removed, left, and why each skipped row was skipped.
9
+
10
+ | Rule | Requirement |
11
+ |------|-------------|
12
+ | Only `removable` rows | The script's marking is the safety proof. Never extend `--yes` to a row it left out, and never prune by hand. |
13
+ | A skipped row says why | `merged`, `dirty`, `unpushed`, `live`, or `hook`: name it. A bare count leaves the user unable to tell a safe sweep from a stuck one. |
@@ -0,0 +1,13 @@
1
+ # Mode: remove — delete a checkout, keep its work reachable
2
+
3
+ Read the shared sections in `SKILL.md` first. This file is the remove path only.
4
+
5
+ 1. **Dispatch `before_remove` first**, one `worker` per declared entry, briefed with the `WT_*` block and that the checkout is about to go. Its job is the project's cleanup: drop the derived database, shut the simulator.
6
+ 2. **Run `.sassywares/worktree/remove <slug> --hook-ok`.** Without `--hook-ok` it exits `3` by design when a hook is declared — that exit is the handshake, not an error to route around.
7
+ 3. **Say what survives.** `remove` deletes the checkout and its port claim; the **branch stays**, so the work is still reachable. Naming that stops someone assuming the deletion took their commits with it.
8
+ 4. **Report a refusal verbatim and stop.** Dirty tree, unpushed commits, a live preview, the main checkout: each is a real reason, and `--force` is the user's call, never yours. On success report the released port and the removed path.
9
+
10
+ | Rule | Requirement |
11
+ |------|-------------|
12
+ | The branch outlives the checkout | Report that the branch survived. A removal the user reads as a data loss is a removal that gets skipped next time. |
13
+ | A refusal is information | Report dirty, unpushed, or live-preview verbatim. Never route around `--hook-ok`, and never clear the objection yourself. |