@sassywares/skills 0.11.22 → 0.12.1
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 +36 -22
- package/README.md +42 -33
- package/package.json +1 -1
- package/skills/sassy-goal/SKILL.md +5 -5
- package/skills/sassy-goal/references/close.md +4 -4
- package/skills/sassy-goal/references/goal-format.md +27 -4
- package/skills/sassy-goal/references/next.md +2 -1
- package/skills/sassy-goal/references/write.md +2 -2
- package/skills/sassy-lfg/SKILL.md +2 -2
- package/skills/sassy-overview/SKILL.md +52 -0
- package/skills/sassy-overview/references/identify.md +82 -0
- package/skills/sassy-overview/scripts/identify.sh +83 -0
- package/skills/sassy-overview/scripts/lib.sh +334 -0
- package/skills/sassy-plan/SKILL.md +5 -5
- package/skills/sassy-plan/references/plan-format.md +34 -6
- package/skills/sassy-setup/SKILL.md +8 -8
- package/skills/sassy-setup/assets/dogfood-recipe.md +1 -1
- package/skills/sassy-setup/assets/lifecycle/down +29 -0
- package/skills/sassy-setup/assets/lifecycle/up +34 -0
- package/skills/sassy-setup/assets/roster +1 -0
- package/skills/sassy-setup/assets/sassywares-readme.md +5 -4
- package/skills/sassy-setup/assets/worktree/_lib.sh +52 -213
- package/skills/sassy-setup/assets/worktree/create +18 -33
- package/skills/sassy-setup/assets/worktree/list +20 -54
- package/skills/sassy-setup/assets/worktree/prune +13 -9
- package/skills/sassy-setup/assets/worktree/remove +83 -26
- package/skills/sassy-setup/references/branching.md +7 -3
- package/skills/sassy-setup/references/config.md +105 -24
- package/skills/sassy-setup/references/dogfood.md +11 -17
- package/skills/sassy-setup/references/init.md +18 -4
- package/skills/sassy-setup/references/workspace.md +27 -34
- package/skills/sassy-setup/references/worktree.md +66 -75
- package/skills/sassy-setup/scripts/detect.sh +112 -103
- package/skills/sassy-setup/scripts/hash-skill.mjs +31 -18
- package/skills/sassy-setup/scripts/worktree-check.mjs +89 -0
- package/skills/sassy-ship/SKILL.md +1 -1
- package/skills/sassy-work/SKILL.md +2 -2
- package/skills/sassy-worktree/SKILL.md +17 -21
- package/skills/sassy-worktree/references/create.md +3 -3
- package/skills/sassy-worktree/references/list.md +2 -2
- package/skills/sassy-worktree/references/prune.md +4 -4
- package/skills/sassy-worktree/references/remove.md +8 -6
- package/skills/sassy-setup/assets/worktree/stop +0 -65
- package/skills/sassy-worktree/references/preview.md +0 -17
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Read the shared sections in `SKILL.md` first. This file is the remove path only.
|
|
4
4
|
|
|
5
|
-
1. **
|
|
6
|
-
2. **
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
1. **Run `.sassywares/worktree/remove <slug>`.** It refuses first — dirty, unpushed, the main checkout — before it stops anything.
|
|
6
|
+
2. **Then, in this order:** a top-level `down:` naming a script is run by the script itself, in the checkout; a `down:` naming a skill is not, so it joins the hooks in the exit-3 handshake. That exit is the handshake, not an error to route around: it lists every obligation still owed in one round — that `down`, and every declared `hooks.worktree.before_remove` — so dispatch them all, one `worker` per hook briefed with the `WT_*` block and that the checkout is about to go (drop the derived database, shut the simulator), then re-run once with `--hook-ok`. That re-run skips a script `down` that already ran: it continues the same removal, so nothing is stopped twice. A `down:` whose value is path-shaped but has no executable in the checkout is a mistake, not a skill, and `remove` refuses naming both the value and the checkout.
|
|
7
|
+
|
|
8
|
+
A generated stub exits `78` to mean **unimplemented**. `remove` warns loudly, names the `down:` key, and removes anyway; any other non-zero status aborts before the handshake. Drop the key if nothing needs stopping, or implement the stub.
|
|
9
|
+
3. **Say what survives.** `remove` deletes the checkout; the **branch stays**, so the work is still reachable. Naming that stops someone assuming the deletion took their commits with it.
|
|
10
|
+
4. **Give a refusal verbatim and stop.** Dirty tree, unpushed commits, the main checkout: each is a real reason, and `--force` is the user's call, never yours. On success say which path went.
|
|
9
11
|
|
|
10
12
|
| Rule | Requirement |
|
|
11
13
|
|------|-------------|
|
|
12
|
-
| The branch outlives the checkout |
|
|
13
|
-
| A refusal is information |
|
|
14
|
+
| The branch outlives the checkout | Say that the branch survived. A removal the user reads as a data loss is a removal that gets skipped next time. |
|
|
15
|
+
| A refusal is information | Give dirty, unpushed, or main-checkout verbatim. Never route around `--hook-ok`, and never clear the objection yourself. |
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Stop whatever is listening on a worktree's port.
|
|
3
|
-
#
|
|
4
|
-
# By port, not by pid file: a preview that already died leaves nothing to
|
|
5
|
-
# believe, and a port that answers is the only proof that something is running.
|
|
6
|
-
#
|
|
7
|
-
# Usage: .sassywares/worktree/stop <slug|branch> [--version]
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
-
# shellcheck source=./_lib.sh
|
|
12
|
-
source "$SCRIPT_DIR/_lib.sh"
|
|
13
|
-
|
|
14
|
-
usage() {
|
|
15
|
-
cat <<'EOF'
|
|
16
|
-
Usage: .sassywares/worktree/stop <slug|branch>
|
|
17
|
-
|
|
18
|
-
Kill the processes listening on the address this checkout advertises — its claimed
|
|
19
|
-
port if it has one, otherwise the port its recipe's preview line names. Nothing
|
|
20
|
-
listening is a success with a note, so stopping twice is safe. A preview that names
|
|
21
|
-
no port at all (a simulator, a window) is the project's to stop.
|
|
22
|
-
EOF
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
case "${1:-}" in
|
|
26
|
-
-h|--help) usage; exit 0 ;;
|
|
27
|
-
--version) printf '%s\n' "$WT_VERSION"; exit 0 ;;
|
|
28
|
-
"") usage >&2; exit 2 ;;
|
|
29
|
-
esac
|
|
30
|
-
|
|
31
|
-
need_git
|
|
32
|
-
rec="$(wt_require "$1")" || exit 1
|
|
33
|
-
path="${rec%%$'\t'*}"
|
|
34
|
-
branch="${rec##*$'\t'}"
|
|
35
|
-
slug="$(wt_slug "$branch")"
|
|
36
|
-
|
|
37
|
-
wt_is_main "$path" && die "the main checkout is not a worktree — nothing to stop"
|
|
38
|
-
wt_managed "$path" || die "'$1' is not managed here — it is outside the worktree home, or it was cut before the wiring"
|
|
39
|
-
port="$(wt_live_port "$slug")"
|
|
40
|
-
[ -n "$port" ] || die "no address to stop — worktrees.ports is unset and the preview line names no port"
|
|
41
|
-
|
|
42
|
-
if ! tcp_up "$port"; then
|
|
43
|
-
ok status "nothing listening on :$port"
|
|
44
|
-
exit 0
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
|
-
command -v lsof >/dev/null 2>&1 || die "lsof not found — stop the process on :$port yourself"
|
|
48
|
-
|
|
49
|
-
pids="$(lsof -ti "tcp:$port" 2>/dev/null | tr '\n' ' ' || true)"
|
|
50
|
-
[ -n "$pids" ] || die "something answers on :$port but lsof cannot name it — is it yours?"
|
|
51
|
-
|
|
52
|
-
n="$(printf '%s' "$pids" | wc -w | tr -d ' ')"
|
|
53
|
-
kill -TERM $pids 2>/dev/null || true
|
|
54
|
-
for _ in 1 2 3 4 5; do
|
|
55
|
-
sleep 1
|
|
56
|
-
tcp_up "$port" || break
|
|
57
|
-
done
|
|
58
|
-
if tcp_up "$port"; then
|
|
59
|
-
kill -KILL $pids 2>/dev/null || true
|
|
60
|
-
sleep 1
|
|
61
|
-
tcp_up "$port" && die ":$port still answers after SIGKILL (pids: $pids)"
|
|
62
|
-
ok stopped "$n process(es) on :$port (SIGKILL)"
|
|
63
|
-
else
|
|
64
|
-
ok stopped "$n process(es) on :$port"
|
|
65
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
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. |
|