@sassywares/skills 0.11.13 → 0.11.15
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/CONCEPTS.md +5 -1
- package/README.md +16 -10
- package/package.json +1 -1
- package/skills/sassy-dogfood/SKILL.md +10 -64
- package/skills/sassy-dogfood/references/check.md +12 -0
- package/skills/sassy-dogfood/references/discover.md +59 -0
- package/skills/sassy-dogfood/references/run.md +54 -0
- package/skills/sassy-handoff/SKILL.md +3 -2
- package/skills/sassy-handoff/references/write.md +1 -1
- package/skills/sassy-setup/SKILL.md +20 -77
- package/skills/sassy-setup/references/branching.md +19 -7
- package/skills/sassy-setup/references/check.md +15 -0
- package/skills/sassy-setup/references/config.md +11 -5
- package/skills/sassy-setup/references/init.md +88 -0
- package/skills/sassy-setup/references/worktree.md +12 -3
- package/skills/sassy-setup/scripts/detect.sh +6 -5
- package/skills/sassy-skill/SKILL.md +5 -1
- package/skills/sassy-skill/references/retune.md +2 -1
- package/skills/sassy-skill/references/verify.md +2 -2
- package/skills/sassy-work/SKILL.md +15 -17
- package/skills/sassy-worktree/SKILL.md +13 -51
- package/skills/sassy-worktree/references/create.md +13 -0
- package/skills/sassy-worktree/references/list.md +12 -0
- package/skills/sassy-worktree/references/preview.md +17 -0
- package/skills/sassy-worktree/references/prune.md +13 -0
- package/skills/sassy-worktree/references/remove.md +13 -0
|
@@ -77,18 +77,30 @@ config. This applies to every token these skills forward, not just `branch`.
|
|
|
77
77
|
"release" is not a neutral name.
|
|
78
78
|
5. If the name already exists: reuse it when it descends from `start-point`;
|
|
79
79
|
stop and ask when it has diverged.
|
|
80
|
-
6. **Create the branch — in a worktree
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
6. **Create the branch — in place, or in a worktree if the user says so.**
|
|
81
|
+
`worktrees.enabled: true` (per `worktree.md`) means this project *allows* a
|
|
82
|
+
checkout. It is permission, not a default: two runs only collide when they are
|
|
83
|
+
actually parallel, so guessing wrong moves the work to another directory,
|
|
84
|
+
leaves the uncommitted tree behind, and spends the `after_create` setup on a
|
|
85
|
+
checkout nobody needed. Ask once, here, with the branch named — *this
|
|
86
|
+
checkout, or a worktree of its own?* — and take the answer. Silence is not a
|
|
87
|
+
yes, and never ask when the answer cannot matter: a run standing on a non-base
|
|
88
|
+
branch reuses its branch and its checkout (`reuse`), and a human who wanted a
|
|
89
|
+
checkout already ran `sassy-worktree create`. With the config off, do not ask:
|
|
90
|
+
a user who wants a checkout anyway gets `sassy-worktree`'s refusal and the
|
|
91
|
+
switch that turns it on.
|
|
92
|
+
|
|
93
|
+
On yes, run the `sassy-worktree` skill's `create` for this run instead of
|
|
94
|
+
checking out in place: it cuts the branch and the checkout together, so the
|
|
95
|
+
branch can never be held twice, and it prints the `WT_*` namespace the run
|
|
96
|
+
inherits. Two things follow, and both are the orchestrator's to carry:
|
|
86
97
|
- **Every step from here on works in `WT_PATH`,** and every delegated brief
|
|
87
98
|
names that absolute path. The main checkout is read-only for the rest of the
|
|
88
99
|
run — config, listing, nothing else.
|
|
89
100
|
- **A dirty tree does not come along,** unlike a checkout: the worktree starts
|
|
90
101
|
clean from `start-point`. Say in the gate summary that uncommitted work stays
|
|
91
102
|
behind, because that is a change in what a run means.
|
|
103
|
+
|
|
92
104
|
Otherwise `git checkout -b <name> <start-point>` here, and uncommitted work
|
|
93
105
|
comes along — say so in the gate summary if the tree was dirty.
|
|
94
106
|
7. Report the branch, the start point, `pr-base`, and the checkout it landed in.
|
|
@@ -97,7 +109,7 @@ config. This applies to every token these skills forward, not just `branch`.
|
|
|
97
109
|
|
|
98
110
|
Report `head` and the checkout you are in, and carry on. Do **not** re-cut because
|
|
99
111
|
`commit.branch` is `new`:
|
|
100
|
-
a second phase, a resumed run, or
|
|
112
|
+
a second phase, a resumed run, or `sassy-lfg` after `sassy-work` is already standing on
|
|
101
113
|
the branch the first one cut. That is the whole reason this is inferred rather
|
|
102
114
|
than forced. It is also what keeps a run inside its own worktree: it finds itself
|
|
103
115
|
on a non-base branch and reuses it rather than nesting another checkout.
|
|
@@ -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. |
|
|
@@ -84,7 +84,7 @@ hooks:
|
|
|
84
84
|
# after_create: [] # derive .env, seed, copy the session
|
|
85
85
|
# before_remove: [] # drop the database, shut the device
|
|
86
86
|
worktrees:
|
|
87
|
-
enabled: false # true = a run may
|
|
87
|
+
enabled: false # true = a run may offer its own checkout
|
|
88
88
|
dir: ~/.sassywares/worktrees # parent of the per-repo folder; ~ is allowed here
|
|
89
89
|
ports: 3000-3099 # optional; delete for a non-port preview
|
|
90
90
|
dogfood:
|
|
@@ -117,7 +117,7 @@ dogfood:
|
|
|
117
117
|
| `dogfood.recipe` | `.sassywares/dogfood/recipe.md` | The stored procedure `sassy-dogfood` executes. Its `Prove it:` step is the verdict |
|
|
118
118
|
| `dogfood.reports` | `.sassywares/dogfood/reports` | Where a run writes its summary, step logs, and artifacts. Must be gitignored |
|
|
119
119
|
| `dogfood.timeout` | `900` | Wall-clock for one run. A timeout is a failure, never a hang |
|
|
120
|
-
| `worktrees.enabled` | `false` | `true` lets a run
|
|
120
|
+
| `worktrees.enabled` | `false` | `true` lets a run *offer* its own checkout; it asks, and the run stays in this one unless you say yes. Needs `commit.branch: new` |
|
|
121
121
|
| `worktrees.dir` | `~/.sassywares/worktrees` | Parent of the per-repo worktree folder. The one path here that may be absolute or `~/` |
|
|
122
122
|
| `worktrees.ports` | `3000-3099` | The range a checkout claims its private port from. **Optional**: without it a checkout holds no port and is addressed by the recipe's preview line — which is how a mobile, desktop, or CLI project previews |
|
|
123
123
|
|
|
@@ -196,8 +196,8 @@ branch from `origin/<base>` then leaves them behind entirely.
|
|
|
196
196
|
| `new` (default) | Never commit on a base branch. Cut one first, then stay on it for the rest of the run |
|
|
197
197
|
|
|
198
198
|
A branch that is already checked out and is **not** a base is reused, whatever
|
|
199
|
-
the config says. That is what makes a second phase, a resumed run, or
|
|
200
|
-
|
|
199
|
+
the config says. That is what makes a second phase, a resumed run, or
|
|
200
|
+
`sassy-lfg` after `sassy-work` converge on the branch the first one cut instead of cutting
|
|
201
201
|
another.
|
|
202
202
|
|
|
203
203
|
A base is **any `base_map` value**, plus the remote default — not the remote
|
|
@@ -409,6 +409,12 @@ worktrees:
|
|
|
409
409
|
Three keys, no commands. The scripts in `.sassywares/worktree/` own the
|
|
410
410
|
mechanics and `sassy-worktree` orchestrates them.
|
|
411
411
|
|
|
412
|
+
**`enabled: true` is permission, not a default.** It makes a checkout available;
|
|
413
|
+
`branching.md` still asks before a run takes one, and the run works in the main
|
|
414
|
+
checkout until the answer is yes. Two runs only collide when they are actually
|
|
415
|
+
parallel, and an unasked checkout relocates the work, leaves the uncommitted tree
|
|
416
|
+
behind, and pays the setup hooks for a checkout nobody needed.
|
|
417
|
+
|
|
412
418
|
**A port is a resource, not the model.** Delete `ports` for an app whose preview
|
|
413
419
|
is not a URL: no port is derived, `WT_PORT` and `WT_BASE_URL` are absent, and
|
|
414
420
|
`list` shows the recipe's `**Preview:**` line instead. `dir` is the one path in this
|
|
@@ -418,7 +424,7 @@ something a teammate clones.
|
|
|
418
424
|
**Two conditions.**
|
|
419
425
|
|
|
420
426
|
- `enabled: true` needs `commit.branch: new`. Under `current` a run commits where
|
|
421
|
-
it stands and never cuts a branch, so nothing would ever
|
|
427
|
+
it stands and never cuts a branch, so nothing would ever offer a worktree;
|
|
422
428
|
`--check` says so rather than leaving a switch that does nothing.
|
|
423
429
|
- It needs the `repo` topology. A `workspace` root and a `none` folder have no
|
|
424
430
|
git to cut a checkout from.
|
|
@@ -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 *offer* a checkout and takes one only on your yes, 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 the user — a run only asks.
|
|
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. |
|
|
@@ -10,8 +10,15 @@ nested repo carries its own config, so there is nothing to cut a checkout from;
|
|
|
10
10
|
says why, `--check` reports an `enabled: true` as drift, and the scripts refuse
|
|
11
11
|
with that reason rather than "not a git repository".
|
|
12
12
|
|
|
13
|
-
Read this when the project has `worktrees.enabled: true`,
|
|
14
|
-
to run two agents in one project.
|
|
13
|
+
Read this when the project has `worktrees.enabled: true`, when a run is about to
|
|
14
|
+
cut a branch, or when the user asks to run two agents in one project.
|
|
15
|
+
|
|
16
|
+
**`enabled: true` is permission, not a default.** A run asks before it takes a
|
|
17
|
+
checkout and stays in the main one otherwise: two runs only collide when they are
|
|
18
|
+
actually parallel, and one taken unasked moves the work to another directory,
|
|
19
|
+
leaves the uncommitted tree behind, and spends the `after_create` setup on a
|
|
20
|
+
checkout nobody needed. `branching.md` owns that ask. `sassy-worktree` runs after
|
|
21
|
+
the answer is yes, or when a human asks for a checkout outright.
|
|
15
22
|
|
|
16
23
|
## Install
|
|
17
24
|
|
|
@@ -192,6 +199,8 @@ implied.
|
|
|
192
199
|
- **One worktree per run.** `references/branching.md` decides; a run already on
|
|
193
200
|
a non-base branch reuses it, so a second `sassy-work` in the same checkout does
|
|
194
201
|
not nest another worktree.
|
|
202
|
+
- **Enabled is permission, not a default.** A run offers a checkout and takes one
|
|
203
|
+
only on the user's yes; the main checkout is where work happens until then.
|
|
195
204
|
- **Never operate on another worktree.** A delegation brief carries the absolute
|
|
196
205
|
path of the checkout it may touch; `MAIN` is for reading config and listing.
|
|
197
206
|
- **Never `git stash`.** It is repository-global: a stash taken in one worktree
|
|
@@ -202,5 +211,5 @@ implied.
|
|
|
202
211
|
through one checkout corrupts the other. Let the package manager's store do
|
|
203
212
|
the deduplicating.
|
|
204
213
|
- **`worktrees.enabled` needs `commit.branch: new`.** Under `current` a run
|
|
205
|
-
commits where it stands and never cuts a branch, so no run would ever
|
|
214
|
+
commits where it stands and never cuts a branch, so no run would ever offer a
|
|
206
215
|
worktree; `--check` notes the combination.
|
|
@@ -778,7 +778,7 @@ if (( CHECK )); then
|
|
|
778
778
|
note " worktrees: no port resource — a checkout is addressed by the recipe's preview line"
|
|
779
779
|
fi
|
|
780
780
|
if [[ "$(yflat "commit${US}branch" 2>/dev/null || true)" == "current" ]]; then
|
|
781
|
-
note " worktrees.enabled with commit.branch: current — a run never cuts a branch, so no run
|
|
781
|
+
note " worktrees.enabled with commit.branch: current — a run never cuts a branch, so no run offers a checkout"
|
|
782
782
|
fi
|
|
783
783
|
|
|
784
784
|
wt_lib="$ROOT/.sassywares/worktree/_lib.sh"
|
|
@@ -1377,9 +1377,10 @@ cat <<'EOF'
|
|
|
1377
1377
|
# --- Worktrees ------------------------------------------------------------
|
|
1378
1378
|
# Parallel work in one repo: a checkout per branch, each with its own derived
|
|
1379
1379
|
# namespace, so two runs never fight over one working tree. enabled: true lets a
|
|
1380
|
-
# run
|
|
1381
|
-
#
|
|
1382
|
-
# mechanics; nothing else
|
|
1380
|
+
# run offer one instead of working here — the run asks, and stays here unless the
|
|
1381
|
+
# answer is yes. It needs commit.branch: new, because `current` never cuts a
|
|
1382
|
+
# branch. The scripts in .sassywares/worktree/ own the mechanics; nothing else
|
|
1383
|
+
# reads these values.
|
|
1383
1384
|
#
|
|
1384
1385
|
# Repo topology only: a workspace root has no repo to cut a checkout from, and a
|
|
1385
1386
|
# `none` folder has no git at all.
|
|
@@ -1389,7 +1390,7 @@ cat <<'EOF'
|
|
|
1389
1390
|
# preview line instead (`$WT_NAMESPACE` names a simulator, a window, a path).
|
|
1390
1391
|
worktrees:
|
|
1391
1392
|
EOF
|
|
1392
|
-
kv enabled false 34 '# true = a run may
|
|
1393
|
+
kv enabled false 34 '# true = a run may offer its own checkout'
|
|
1393
1394
|
kv dir '~/.sassywares/worktrees' 34 '# parent of the per-repo folder; ~ is allowed'
|
|
1394
1395
|
kv ports 3000-3099 34 '# a private port per checkout; delete for non-port previews'
|
|
1395
1396
|
cat <<'EOF'
|
|
@@ -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,
|
|
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
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
name: sassy-work
|
|
3
3
|
description: >-
|
|
4
4
|
Execute exactly one phase of a sassy plan by delegating to sassy-cycle, then
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
The orchestrator only coordinates.
|
|
5
|
+
commit it (or close out via sassy-ship if it was the last). The next phase is
|
|
6
|
+
a run of its own when the user starts one. Also runs one settled in-context
|
|
7
|
+
brief and stops before ship. The orchestrator only coordinates.
|
|
8
8
|
argument-hint: "<plan path | brief> [phase:<n>] [branch:infer|current|new]"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Sassy Work
|
|
12
12
|
|
|
13
|
-
**Outcome:** one phase run through `sassy-cycle`, findings fixed, then a single gate that carries both the code approval and the phase's QA checklist (`Manual` rows from the user, `Auto` rows from a `sassy-dogfood` report), marked `Done` only when both pass, committed via `sassy-commit`; then
|
|
13
|
+
**Outcome:** one phase run through `sassy-cycle`, findings fixed, then a single gate that carries both the code approval and the phase's QA checklist (`Manual` rows from the user, `Auto` rows from a `sassy-dogfood` report), marked `Done` only when both pass, committed via `sassy-commit`; then the run ends, or a `sassy-ship` close-out when this was the last phase.
|
|
14
14
|
|
|
15
15
|
**Brief input** runs one cycle, presents the code approval gate, commits, and **stops before shipping**.
|
|
16
16
|
|
|
@@ -50,7 +50,7 @@ Always gate before committing. The cycle has already fixed and verified its find
|
|
|
50
50
|
1. **Load the phase.** Read the plan and only the selected phase's section. If it is already `Done`, stop and report.
|
|
51
51
|
|
|
52
52
|
If the phase is `In progress`, an earlier run was interrupted before both gates passed. Ask one question — resume at the gate, or re-run the cycle from scratch — and take the answer. Resuming skips the cycle and goes straight to step 5, but **still resolve the branch at step 2 first**: on `reuse` it is a no-op, and on `create` it is the difference between committing on the base and not.
|
|
53
|
-
2. **Resolve the branch, before touching code.** Follow the `sassy-setup` skill's `references/branching.md` with this run's `branch:` token, if any. On `create`, cut the branch now — not at commit time — so no change ever exists on a base branch. On `reuse`, stay where you are, which is how a
|
|
53
|
+
2. **Resolve the branch, before touching code.** Follow the `sassy-setup` skill's `references/branching.md` with this run's `branch:` token, if any. On `create`, cut the branch now — not at commit time — so no change ever exists on a base branch. On `reuse`, stay where you are, which is how a later phase or a resumed run lands on the branch the first phase cut. On `stop-and-ask`, present the choice and wait. Carry the branch and its start point into every gate summary you present.
|
|
54
54
|
3. **Run the cycle.** Set the phase `In progress` in the Phase tracking table, then load the `sassy-cycle` skill and follow it, with:
|
|
55
55
|
- work brief = the phase's goal, work items, and "Done when" criteria
|
|
56
56
|
- intent reference = the plan path and phase
|
|
@@ -60,21 +60,18 @@ Always gate before committing. The cycle has already fixed and verified its find
|
|
|
60
60
|
5. **Present the phase gate.** Report the phase, what changed, findings raised and resolved (with the fix passes it took), the simplifications applied, the validator grade, the reviewer summary, and the reviewer's suggestions as options the user may pick. Then give the QA checklist verbatim: each row's ID, check, `Mode`, and — for `Manual` — how to run it and what passing looks like, and for `Auto` — the dogfood verdict and run id, with unreported rows `Pending`. Ask for both decisions — code approval (or the changes wanted, including any suggestions picked) and the result per `Manual` row. Wait.
|
|
61
61
|
6. **Resolve the gate.** Three outcomes, nothing in between:
|
|
62
62
|
- **Code approved and every QA row passes** → go to step 7.
|
|
63
|
-
- **Code approved, `Manual` rows still pending** → record that code is approved but leave the phase `In progress`, tick nothing, commit nothing,
|
|
63
|
+
- **Code approved, `Manual` rows still pending** → record that code is approved but leave the phase `In progress`, tick nothing, commit nothing, and report that the phase is waiting on manual QA plus the command that resumes it.
|
|
64
64
|
- **Changes requested, or any row fails** → a rework cycle: load `sassy-cycle` with the requested changes and the failing rows as its findings, and the plan path and phase as the intent reference. On `done`, re-prove the `Auto` rows (step 4) and present the gate again from step 5; on `blocked`, mark the phase `Blocked` and stop. A QA row that fails again after its rework is `Blocked` with the reason and stops the phase. Change requests have no cap — each one is the user's call.
|
|
65
65
|
7. **Commit the phase.** On both gates passing, first mark the phase's QA rows `Done` — `Manual` rows with the user's notes, `Auto` rows with the verdict and run id from the report — and the phase `Done` in the Phase tracking table, then persist according to `git.repo`:
|
|
66
66
|
|
|
67
67
|
- **A remote** — dispatch a `worker` whose task is: *load the `sassy-commit` skill and follow it with `branch:current`*, naming that the commit must include the phase's code changes, the QA table results, and the now-updated Phase tracking table. It returns the hash and subject. The branch already exists: step 2 cut it, so committing on it is the point of `branch:current` here.
|
|
68
68
|
- **`workspace`** — dispatch a `worker` per affected repo to commit that repo's code on the run's shared branch, then run `.sassywares/workspace/snapshot` for the plan, QA results, and docs at the root. The gate's approval is the commit approval; the snapshot runs right after it and is never skipped. A missing or outdated `.sassywares/workspace/snapshot` is a blocker — say to run `sassy-setup`.
|
|
69
|
-
- **`none`** — nothing is persisted. Report that the phase's work is uncommitted and stop;
|
|
69
|
+
- **`none`** — nothing is persisted. Report that the phase's work is uncommitted and stop; nothing follows an uncommitted phase.
|
|
70
70
|
|
|
71
|
-
Do not
|
|
71
|
+
Do not close out until the commit or snapshot succeeds.
|
|
72
72
|
8. **On commit success:**
|
|
73
|
-
- **A next phase exists** → load the `sassy-handoff` skill in `mode:write` with the goal *Execute phase <next> of <plan> by invoking `sassy-work <plan> phase:<next>`*. It writes the handoff file and gives the user a `sassy-handoff mode:read <path>` command; the next phase starts when they run it in a fresh session and pick it.
|
|
74
|
-
|
|
75
73
|
- **This was the last phase** → run the close-out: load the `sassy-ship` skill and follow it (under `commit.branch: current` ship commits and pushes, with no PR).
|
|
76
|
-
|
|
77
|
-
**Why a fresh session:** one phase per context keeps every phase's context small. A skill cannot start a session itself, so the handoff file is the bridge and the user opens the session.
|
|
74
|
+
- **Any phase is left** → report the commit and stop. Name the next phase and the command that picks it up — `sassy-work <plan>` takes the first phase that is not `Done` — and never start it in this session. Continuing, stopping for now, or choosing another executor is the user's call; do not offer or write a handoff.
|
|
78
75
|
|
|
79
76
|
## Brief input
|
|
80
77
|
|
|
@@ -93,8 +90,9 @@ When the argument is not a plan path, it is one settled brief:
|
|
|
93
90
|
| Orchestrator only | Delegate all implementation and quality work to `sassy-cycle`. |
|
|
94
91
|
| Branch before code | Resolve the branch per the `sassy-setup` skill's `references/branching.md` before the cycle runs, so no change ever lands on a base branch. |
|
|
95
92
|
| One phase per run | Do exactly one phase. Never continue into the next phase in this session. |
|
|
96
|
-
| Gate before commit and
|
|
97
|
-
| Commit per phase | Commit the phase, its QA results, and the plan update via `sassy-commit` before
|
|
93
|
+
| Gate before commit and close-out | Do not commit or close out until the user approves the code and the phase QA rows pass. |
|
|
94
|
+
| Commit per phase | Commit the phase, its QA results, and the plan update via `sassy-commit` before close-out. |
|
|
95
|
+
| Handing off is the user's | Never write a handoff or suggest one. The run ends at its report; `sassy-handoff` is invoked by the user, in their own session and on their own initiative. |
|
|
98
96
|
| Done needs both gates | Mark a phase `Done` only when the user approves the code and every QA row for that phase is `Done`, never before. |
|
|
99
97
|
| QA rows follow their mode | Tick a `Manual` row `Done` only from the user's explicit confirmation, and an `Auto` row only from a passing dogfood report; keep unreported rows `Pending`; a failed row is a finding for a rework cycle. |
|
|
100
98
|
| Send-backs are rework | Requested changes and failed QA rows go through `sassy-cycle` as findings — verified, two fix passes at most — never a direct edit. |
|
|
@@ -103,7 +101,7 @@ When the argument is not a plan path, it is one settled brief:
|
|
|
103
101
|
## Failure handling
|
|
104
102
|
|
|
105
103
|
- `sassy-cycle` returns `blocked` → mark the phase `Blocked`, stop, report the open findings and the diagnostic.
|
|
106
|
-
- QA stays pending, or a row fails again after its rework → keep the phase `In progress` (or `Blocked` with the reason), commit nothing,
|
|
107
|
-
- `sassy-commit` fails or leaves the phase changes uncommitted → stop and report; never
|
|
108
|
-
- The validator returns **Blocked — insufficient grounding** → treat it as a real blocker; do not advance
|
|
104
|
+
- QA stays pending, or a row fails again after its rework → keep the phase `In progress` (or `Blocked` with the reason), commit nothing, and report.
|
|
105
|
+
- `sassy-commit` fails or leaves the phase changes uncommitted → stop and report; never close out on top of uncommitted phase work.
|
|
106
|
+
- The validator returns **Blocked — insufficient grounding** → treat it as a real blocker; do not advance.
|
|
109
107
|
- Ambiguous or unsafe failure → stop and ask.
|
|
@@ -5,7 +5,8 @@ description: >-
|
|
|
5
5
|
worktree per branch, each with its own derived namespace and port, created and
|
|
6
6
|
torn down safely. `mode:preview` brings a checkout up so you can look at it
|
|
7
7
|
without setting it up by hand. Use when asked for parallel work, a second
|
|
8
|
-
checkout, or to see what a worktree looks like
|
|
8
|
+
checkout, or to see what a worktree looks like, and when a run offers one and
|
|
9
|
+
the user accepts.
|
|
9
10
|
argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
|
|
10
11
|
---
|
|
11
12
|
|
|
@@ -13,7 +14,7 @@ argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
|
|
|
13
14
|
|
|
14
15
|
**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
16
|
|
|
16
|
-
**Config.** Resolve `.sassywares/config.yaml` (nearest, walking up) per the `sassy-setup` skill's `references/config.md`. `worktrees.enabled` decides whether
|
|
17
|
+
**Config.** Resolve `.sassywares/config.yaml` (nearest, walking up) per the `sassy-setup` skill's `references/config.md`. `worktrees.enabled` decides whether a checkout is available at all — permission, never an instruction to take one; `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
18
|
|
|
18
19
|
**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
20
|
|
|
@@ -21,66 +22,27 @@ argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
|
|
|
21
22
|
|
|
22
23
|
## Modes
|
|
23
24
|
|
|
24
|
-
| Mode |
|
|
25
|
-
|
|
26
|
-
| `list` (default) |
|
|
27
|
-
| `create` |
|
|
28
|
-
| `preview` |
|
|
29
|
-
| `remove` |
|
|
30
|
-
| `prune` |
|
|
25
|
+
| Mode | Load | It ends with |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `list` (default) | `references/list.md` | the table of managed checkouts, as it prints |
|
|
28
|
+
| `create` | `references/create.md` | a ready checkout, its address, and its hooks |
|
|
29
|
+
| `preview` | `references/preview.md` | a checkout left running, and how to see it |
|
|
30
|
+
| `remove` | `references/remove.md` | a deleted checkout, a released port, a surviving branch |
|
|
31
|
+
| `prune` | `references/prune.md` | the removed checkouts, and why each skipped row was skipped |
|
|
31
32
|
|
|
32
|
-
`
|
|
33
|
+
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
34
|
|
|
34
|
-
##
|
|
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
|
|
35
|
+
## Hard rules — every mode
|
|
72
36
|
|
|
73
37
|
| Rule | Requirement |
|
|
74
38
|
|------|-------------|
|
|
75
39
|
| 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
40
|
| 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. |
|
|
41
|
+
| Enabled is permission | `worktrees.enabled: true` lets a run *offer* a checkout. `create` runs on the user's yes, or on a human asking outright — never because the config allowed it. |
|
|
78
42
|
| 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
43
|
| 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
44
|
| 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
45
|
| 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
46
|
| No verdicts | This skill never says whether the work is correct. That is `sassy-dogfood`'s job, with a report. |
|
|
85
47
|
| No state of its own | Liveness is probed at read time. There is no registry, no pid file, and nothing to go stale. |
|
|
86
48
|
| 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. |
|