@sassywares/skills 0.11.21 → 0.12.0
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 +33 -19
- package/README.md +33 -24
- package/package.json +1 -1
- package/skills/sassy-cycle/SKILL.md +7 -6
- package/skills/sassy-lfg/SKILL.md +1 -1
- 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 +4 -4
- 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/config.md +99 -17
- 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-work/SKILL.md +1 -1
- 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
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Helpers for sassy-overview's identify.sh.
|
|
3
|
+
#
|
|
4
|
+
# Read-only file inspection and nothing else: no network, no executing the
|
|
5
|
+
# project's tooling (not even `make -n`), no writes. Every helper answers from a
|
|
6
|
+
# file's bytes or not at all — "unknown" is the honest answer, never a guess.
|
|
7
|
+
#
|
|
8
|
+
# Sourced by identify.sh, never run directly. It is a query, so it is invoked by
|
|
9
|
+
# path from the skill directory and is never installed into a project's
|
|
10
|
+
# `.sassywares/`.
|
|
11
|
+
|
|
12
|
+
# The key list, in table order, defined once: id_scan initialises every key from
|
|
13
|
+
# it and identify.sh validates and prints from it.
|
|
14
|
+
ID_KEYS="stack runner install up down test compose env wired"
|
|
15
|
+
|
|
16
|
+
# One value and one source per key, as plain variables: bash 3.2 has no
|
|
17
|
+
# associative arrays, and this runs on a stock macOS shell.
|
|
18
|
+
id_v() { printf -v "ID_V_$1" '%s' "$2"; }
|
|
19
|
+
id_s() { printf -v "ID_S_$1" '%s' "${2:--}"; }
|
|
20
|
+
id_set() { id_v "$1" "$2"; id_s "$1" "${3:--}"; }
|
|
21
|
+
id_unknown() { id_set "$1" unknown; }
|
|
22
|
+
id_value() { local n="ID_V_$1"; printf '%s' "${!n}"; }
|
|
23
|
+
id_source() { local n="ID_S_$1"; printf '%s' "${!n}"; }
|
|
24
|
+
|
|
25
|
+
# The first candidate that exists under ID_ROOT, printed relative to it.
|
|
26
|
+
id_first_file() {
|
|
27
|
+
local f
|
|
28
|
+
for f in "$@"; do
|
|
29
|
+
[ -f "$ID_ROOT/$f" ] && { printf '%s' "$f"; return 0; }
|
|
30
|
+
done
|
|
31
|
+
return 1
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# The nearest `.sassywares/config.yaml`, walking up from ID_ROOT the way
|
|
35
|
+
# `sassy-setup`'s detect.sh resolves it. Printed relative to ID_ROOT when it is
|
|
36
|
+
# there, and as an absolute path when it belongs to a parent directory.
|
|
37
|
+
id_config() {
|
|
38
|
+
local probe="$ID_ROOT"
|
|
39
|
+
while :; do
|
|
40
|
+
if [ -f "$probe/.sassywares/config.yaml" ]; then
|
|
41
|
+
if [ "$probe" = "$ID_ROOT" ]; then
|
|
42
|
+
printf '%s' .sassywares/config.yaml
|
|
43
|
+
else
|
|
44
|
+
printf '%s' "$probe/.sassywares/config.yaml"
|
|
45
|
+
fi
|
|
46
|
+
return 0
|
|
47
|
+
fi
|
|
48
|
+
[ "$probe" = / ] && return 1
|
|
49
|
+
probe="$(dirname "$probe")"
|
|
50
|
+
done
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# The node package manager, from its lockfile and then the manifest's
|
|
54
|
+
# `packageManager` field. Sets ID_PM and ID_PM_SRC.
|
|
55
|
+
id_node_pm() {
|
|
56
|
+
local pair
|
|
57
|
+
for pair in "bun.lockb:bun" "bun.lock:bun" "pnpm-lock.yaml:pnpm" "yarn.lock:yarn"; do
|
|
58
|
+
if [ -f "$ID_ROOT/${pair%%:*}" ]; then
|
|
59
|
+
ID_PM="${pair#*:}"; ID_PM_SRC="${pair%%:*}"; return 0
|
|
60
|
+
fi
|
|
61
|
+
done
|
|
62
|
+
# An unreadable or missing manifest leaves the value empty rather than killing
|
|
63
|
+
# the run: identify's own exit codes are 0, 3 and 2, never a shell's 1.
|
|
64
|
+
ID_PM="$(sed -n 's/.*"packageManager"[[:space:]]*:[[:space:]]*"\([a-z]*\)@.*/\1/p' "$ID_ROOT/package.json" 2>/dev/null | head -n 1)" || ID_PM=""
|
|
65
|
+
[ -n "$ID_PM" ] || ID_PM="npm"
|
|
66
|
+
ID_PM_SRC="package.json"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# One named entry from a JSON object such as package.json's `scripts` or
|
|
70
|
+
# deno.json's `tasks`. Prints its command, and nothing when the object or the
|
|
71
|
+
# name is absent. The block-opening brace is found on the same line, so both a
|
|
72
|
+
# pretty-printed and a single-line object are read.
|
|
73
|
+
id_json_block_script() { # <file> <block> <name>
|
|
74
|
+
awk -v block="$2" -v want="$3" '
|
|
75
|
+
function emit(line, i, rest, out, j, c) {
|
|
76
|
+
i = index(line, "\"" want "\"")
|
|
77
|
+
if (!i) return
|
|
78
|
+
rest = substr(line, i + length(want) + 2)
|
|
79
|
+
if (!match(rest, /^[ \t]*:[ \t]*"/)) return
|
|
80
|
+
rest = substr(rest, RLENGTH + 1)
|
|
81
|
+
out = ""
|
|
82
|
+
for (j = 1; j <= length(rest); j++) {
|
|
83
|
+
c = substr(rest, j, 1)
|
|
84
|
+
if (c == "\\") { out = out c substr(rest, j + 1, 1); j++; continue }
|
|
85
|
+
if (c == "\"") break
|
|
86
|
+
out = out c
|
|
87
|
+
}
|
|
88
|
+
if (out != "") found = out
|
|
89
|
+
}
|
|
90
|
+
# Where the `scripts` block closes on this text, or 0 when it does not. The
|
|
91
|
+
# block-opening brace is already behind us, so the first unmatched `}` ends
|
|
92
|
+
# it — which is what keeps a neighbouring object'"'"'s `test` out of reach.
|
|
93
|
+
# A brace inside a string is data, not structure: without quote and escape
|
|
94
|
+
# state a command like `echo }hi` closes the block early and hides every
|
|
95
|
+
# task after it. JSON strings do not span lines, so both reset per line.
|
|
96
|
+
function block_end(text, i, c, depth, q, esc) {
|
|
97
|
+
depth = 0; q = 0; esc = 0
|
|
98
|
+
for (i = 1; i <= length(text); i++) {
|
|
99
|
+
c = substr(text, i, 1)
|
|
100
|
+
if (q) {
|
|
101
|
+
if (esc) { esc = 0; continue }
|
|
102
|
+
if (c == "\\") { esc = 1; continue }
|
|
103
|
+
if (c == "\"") q = 0
|
|
104
|
+
continue
|
|
105
|
+
}
|
|
106
|
+
if (c == "\"") { q = 1; continue }
|
|
107
|
+
if (c == "{") depth++
|
|
108
|
+
else if (c == "}") { if (depth == 0) return i; depth-- }
|
|
109
|
+
}
|
|
110
|
+
return 0
|
|
111
|
+
}
|
|
112
|
+
{
|
|
113
|
+
if (!inb) {
|
|
114
|
+
i = index($0, "\"" block "\"")
|
|
115
|
+
if (i) {
|
|
116
|
+
rest = substr($0, i + length(block) + 2)
|
|
117
|
+
if (match(rest, /^[ \t]*:[ \t]*\{/)) {
|
|
118
|
+
inb = 1
|
|
119
|
+
rest = substr(rest, RLENGTH + 1)
|
|
120
|
+
cut = block_end(rest)
|
|
121
|
+
if (cut) { emit(substr(rest, 1, cut - 1)); inb = 0 }
|
|
122
|
+
else emit(rest)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
next
|
|
126
|
+
}
|
|
127
|
+
cut = block_end($0)
|
|
128
|
+
if (cut) { emit(substr($0, 1, cut - 1)); inb = 0 }
|
|
129
|
+
else emit($0)
|
|
130
|
+
}
|
|
131
|
+
END { if (found != "") print found }
|
|
132
|
+
' "$1" 2>/dev/null
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
# A package.json `scripts` entry, through the shared JSON block reader above.
|
|
136
|
+
id_pkg_script() { # <package.json> <script name>
|
|
137
|
+
id_json_block_script "$1" scripts "$2"
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
# Whether a JSON object declares a block at all — an empty `"tasks": {}` is a
|
|
141
|
+
# declared block, so this cannot be answered by looking for an entry in it.
|
|
142
|
+
id_json_has_block() { # <file> <block>
|
|
143
|
+
awk -v block="$2" '
|
|
144
|
+
{
|
|
145
|
+
i = index($0, "\"" block "\"")
|
|
146
|
+
if (!i) next
|
|
147
|
+
rest = substr($0, i + length(block) + 2)
|
|
148
|
+
# Set the flag and keep reading: exiting here closes the pipe on the
|
|
149
|
+
# producer, and under `set -o pipefail` its SIGPIPE (141) reports a
|
|
150
|
+
# declared block as absent. Let END decide, after the input is drained.
|
|
151
|
+
if (match(rest, /^[ \t]*:[ \t]*\{/)) found = 1
|
|
152
|
+
}
|
|
153
|
+
END { exit(found ? 0 : 1) }
|
|
154
|
+
' "$1" 2>/dev/null
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# A JSONC manifest with its comments removed, one line at a time. A character
|
|
158
|
+
# scanner, not a regex: `//` and `/* */` are dropped only outside a string, so a
|
|
159
|
+
# `"https://..."` value and an escaped quote stay intact. Commented-out JSON is
|
|
160
|
+
# not a declaration, and this is what makes that true for `.jsonc`.
|
|
161
|
+
id_strip_jsonc() { # <file>
|
|
162
|
+
awk '
|
|
163
|
+
{
|
|
164
|
+
line = $0; n = length(line); out = ""; i = 1
|
|
165
|
+
while (i <= n) {
|
|
166
|
+
c = substr(line, i, 1)
|
|
167
|
+
if (in_block) {
|
|
168
|
+
if (c == "*" && substr(line, i + 1, 1) == "/") { in_block = 0; i += 2; continue }
|
|
169
|
+
i++; continue
|
|
170
|
+
}
|
|
171
|
+
if (in_str) {
|
|
172
|
+
out = out c
|
|
173
|
+
if (c == "\\") { out = out substr(line, i + 1, 1); i += 2; continue }
|
|
174
|
+
if (c == "\"") in_str = 0
|
|
175
|
+
i++; continue
|
|
176
|
+
}
|
|
177
|
+
if (c == "\"") { in_str = 1; out = out c; i++; continue }
|
|
178
|
+
if (c == "/" && substr(line, i + 1, 1) == "/") break
|
|
179
|
+
if (c == "/" && substr(line, i + 1, 1) == "*") { in_block = 1; i += 2; continue }
|
|
180
|
+
out = out c; i++
|
|
181
|
+
}
|
|
182
|
+
print out
|
|
183
|
+
}
|
|
184
|
+
' "$1" 2>/dev/null
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
# A declaration line, not an assignment: `dev:` is a target, `dev:=1` is not.
|
|
188
|
+
id_make_target() { # <Makefile> <target>
|
|
189
|
+
grep -qE "^$2[[:space:]]*:([^=]|$)" "$1" 2>/dev/null
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
# A recipe (`dev:` or `dev arg="x":`) or an alias — never an assignment
|
|
193
|
+
# (`dev := "x"`), which no runner would accept as a task.
|
|
194
|
+
id_just_recipe() { # <justfile> <recipe>
|
|
195
|
+
grep -qE "^@?$2([[:space:]]+[^:]*)?[[:space:]]*:([^=]|$)" "$1" 2>/dev/null
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# A deno.json/deno.jsonc block, with its comments stripped first. Node and PHP
|
|
199
|
+
# manifests never come through here: package.json is strict JSON, and their
|
|
200
|
+
# answers must stay byte-identical.
|
|
201
|
+
id_deno_has_block() { # <deno.json|deno.jsonc> <block>
|
|
202
|
+
id_strip_jsonc "$1" | id_json_has_block - "$2"
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
# A declared deno.json `tasks` entry — an absent block, a commented-out one, or
|
|
206
|
+
# an absent name declares nothing.
|
|
207
|
+
id_deno_task() { # <deno.json|deno.jsonc> <task>
|
|
208
|
+
[ -n "$(id_strip_jsonc "$1" | id_json_block_script - tasks "$2")" ]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
id_has_flutter() { # <pubspec.yaml>
|
|
212
|
+
grep -qE '^[[:space:]]*flutter:' "$1" 2>/dev/null
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
# The first candidate the predicate recognizes, as `<runner> <candidate>`.
|
|
216
|
+
id_task() { # <runner> <file> <predicate> <candidate>...
|
|
217
|
+
local runner="$1" file="$2" pred="$3" c
|
|
218
|
+
shift 3
|
|
219
|
+
for c in "$@"; do
|
|
220
|
+
if "$pred" "$ID_ROOT/$file" "$c"; then printf '%s %s' "$runner" "$c"; return 0; fi
|
|
221
|
+
done
|
|
222
|
+
return 1
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
# Walk the manifest table once and fill every key. Order is the table order in
|
|
226
|
+
# references/identify.md: the first stack manifest found wins, and a declared
|
|
227
|
+
# task runner (just, then make) outranks the ecosystem's own commands.
|
|
228
|
+
id_scan() {
|
|
229
|
+
local py deno makefile justfile compose rc envfile
|
|
230
|
+
|
|
231
|
+
for k in $ID_KEYS; do id_unknown "$k"; done
|
|
232
|
+
id_set wired no "-"
|
|
233
|
+
|
|
234
|
+
# --- stack and its ecosystem commands -----------------------------------
|
|
235
|
+
if [ -f "$ID_ROOT/go.mod" ]; then
|
|
236
|
+
id_set stack go go.mod
|
|
237
|
+
id_set runner go go.mod
|
|
238
|
+
id_set install "go mod download" go.mod
|
|
239
|
+
id_set test "go test ./..." go.mod
|
|
240
|
+
elif [ -f "$ID_ROOT/package.json" ]; then
|
|
241
|
+
id_node_pm
|
|
242
|
+
id_set stack node package.json
|
|
243
|
+
id_set runner "$ID_PM" "$ID_PM_SRC"
|
|
244
|
+
id_set install "$ID_PM install" "$ID_PM_SRC"
|
|
245
|
+
rc="$(id_pkg_script "$ID_ROOT/package.json" test || true)"
|
|
246
|
+
if [ -n "$rc" ]; then id_set test "$ID_PM test" package.json; fi
|
|
247
|
+
elif deno="$(id_first_file deno.json deno.jsonc)"; then
|
|
248
|
+
# The manifest has no dependency-install step of its own — imports are
|
|
249
|
+
# resolved by the runtime — so `install` stays unknown rather than invented.
|
|
250
|
+
id_set stack deno "$deno"
|
|
251
|
+
if id_deno_has_block "$ID_ROOT/$deno" tasks; then
|
|
252
|
+
id_set runner "deno task" "$deno"
|
|
253
|
+
if rc="$(id_task 'deno task' "$deno" id_deno_task dev start up serve)"; then id_set up "$rc" "$deno"; fi
|
|
254
|
+
if rc="$(id_task 'deno task' "$deno" id_deno_task down stop)"; then id_set down "$rc" "$deno"; fi
|
|
255
|
+
if id_deno_task "$ID_ROOT/$deno" test; then id_set test "deno task test" "$deno"; fi
|
|
256
|
+
else
|
|
257
|
+
id_set runner deno "$deno"
|
|
258
|
+
fi
|
|
259
|
+
elif py="$(id_first_file pyproject.toml requirements.txt setup.py)"; then
|
|
260
|
+
id_set stack python "$py"
|
|
261
|
+
if [ -f "$ID_ROOT/poetry.lock" ]; then
|
|
262
|
+
id_set runner poetry poetry.lock
|
|
263
|
+
id_set install "poetry install" poetry.lock
|
|
264
|
+
elif [ -f "$ID_ROOT/uv.lock" ]; then
|
|
265
|
+
id_set runner uv uv.lock
|
|
266
|
+
id_set install "uv sync" uv.lock
|
|
267
|
+
else
|
|
268
|
+
id_set runner pip "$py"
|
|
269
|
+
if [ "$py" = "requirements.txt" ]; then
|
|
270
|
+
id_set install "pip install -r requirements.txt" requirements.txt
|
|
271
|
+
else
|
|
272
|
+
id_set install "pip install -e ." "$py"
|
|
273
|
+
fi
|
|
274
|
+
fi
|
|
275
|
+
elif [ -f "$ID_ROOT/pubspec.yaml" ]; then
|
|
276
|
+
id_set stack dart pubspec.yaml
|
|
277
|
+
if id_has_flutter "$ID_ROOT/pubspec.yaml"; then
|
|
278
|
+
id_set runner flutter pubspec.yaml
|
|
279
|
+
id_set install "flutter pub get" pubspec.yaml
|
|
280
|
+
id_set test "flutter test" pubspec.yaml
|
|
281
|
+
else
|
|
282
|
+
id_set runner dart pubspec.yaml
|
|
283
|
+
id_set install "dart pub get" pubspec.yaml
|
|
284
|
+
id_set test "dart test" pubspec.yaml
|
|
285
|
+
fi
|
|
286
|
+
elif [ -f "$ID_ROOT/Cargo.toml" ]; then
|
|
287
|
+
id_set stack rust Cargo.toml
|
|
288
|
+
id_set runner cargo Cargo.toml
|
|
289
|
+
id_set install "cargo fetch" Cargo.toml
|
|
290
|
+
id_set test "cargo test" Cargo.toml
|
|
291
|
+
elif [ -f "$ID_ROOT/composer.json" ]; then
|
|
292
|
+
id_set stack php composer.json
|
|
293
|
+
id_set runner composer composer.json
|
|
294
|
+
id_set install "composer install" composer.json
|
|
295
|
+
rc="$(id_pkg_script "$ID_ROOT/composer.json" test || true)"
|
|
296
|
+
if [ -n "$rc" ]; then id_set test "composer test" composer.json; fi
|
|
297
|
+
elif [ -f "$ID_ROOT/Gemfile" ]; then
|
|
298
|
+
id_set stack ruby Gemfile
|
|
299
|
+
id_set runner bundle Gemfile
|
|
300
|
+
id_set install "bundle install" Gemfile
|
|
301
|
+
fi
|
|
302
|
+
|
|
303
|
+
# --- declared task runners: make, then just (just wins on a clash) ------
|
|
304
|
+
if makefile="$(id_first_file Makefile makefile GNUmakefile)"; then
|
|
305
|
+
id_set runner make "$makefile"
|
|
306
|
+
if rc="$(id_task make "$makefile" id_make_target dev start up serve)"; then id_set up "$rc" "$makefile"; fi
|
|
307
|
+
if rc="$(id_task make "$makefile" id_make_target down stop)"; then id_set down "$rc" "$makefile"; fi
|
|
308
|
+
if id_make_target "$ID_ROOT/$makefile" test; then id_set test "make test" "$makefile"; fi
|
|
309
|
+
fi
|
|
310
|
+
if justfile="$(id_first_file justfile Justfile .justfile)"; then
|
|
311
|
+
id_set runner just "$justfile"
|
|
312
|
+
if rc="$(id_task just "$justfile" id_just_recipe dev start up serve)"; then id_set up "$rc" "$justfile"; fi
|
|
313
|
+
if rc="$(id_task just "$justfile" id_just_recipe down stop)"; then id_set down "$rc" "$justfile"; fi
|
|
314
|
+
if id_just_recipe "$ID_ROOT/$justfile" test; then id_set test "just test" "$justfile"; fi
|
|
315
|
+
fi
|
|
316
|
+
|
|
317
|
+
# --- docker compose: the last word on up/down, and a runner of last resort
|
|
318
|
+
if compose="$(id_first_file compose.yaml compose.yml docker-compose.yml docker-compose.yaml)"; then
|
|
319
|
+
id_set compose "$compose" "$compose"
|
|
320
|
+
if [ "$(id_value up)" = unknown ]; then id_set up "docker compose up" "$compose"; fi
|
|
321
|
+
if [ "$(id_value down)" = unknown ]; then id_set down "docker compose down" "$compose"; fi
|
|
322
|
+
if [ "$(id_value runner)" = unknown ]; then id_set runner docker "$compose"; fi
|
|
323
|
+
fi
|
|
324
|
+
|
|
325
|
+
# --- environment files ---------------------------------------------------
|
|
326
|
+
if envfile="$(id_first_file .env .env.local .env.example .env.sample)"; then
|
|
327
|
+
id_set env "$envfile" "$envfile"
|
|
328
|
+
fi
|
|
329
|
+
|
|
330
|
+
# --- wired for the suite -------------------------------------------------
|
|
331
|
+
if rc="$(id_config)"; then
|
|
332
|
+
id_set wired yes "$rc"
|
|
333
|
+
fi
|
|
334
|
+
}
|
|
@@ -51,8 +51,8 @@ Only when the read-back is confirmed with zero open items — and no `out:` was
|
|
|
51
51
|
```text
|
|
52
52
|
Settled. Pick one:
|
|
53
53
|
1. Write the plan — <artifacts.plans>/<slug>.md
|
|
54
|
-
2. Start working via
|
|
55
|
-
3. Implement and ship it via
|
|
54
|
+
2. Start working via sassy-work
|
|
55
|
+
3. Implement and ship it via sassy-lfg
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
The user must pick explicitly. There is no default and no auto-selection. If no human is present to answer (rare, e.g. a scripted invocation), take option 2 and say so; every branch you resolved without the user is recorded as an assumption, never as a decision.
|
|
@@ -63,8 +63,8 @@ Read `references/plan-format.md` and write the plan, including the per-phase QA
|
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
Plan written to <absolute path>. Pick one, or stop here:
|
|
66
|
-
1. Start working via
|
|
67
|
-
2. Implement and ship it via
|
|
66
|
+
1. Start working via sassy-work
|
|
67
|
+
2. Implement and ship it via sassy-lfg
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Wait for the user. A pick loads that skill with the plan path as its argument — `sassy-work` runs the next phase, `sassy-lfg` runs every phase and ships. Anything else, or no human present, ends here with the plan written. Do not recommend one, and do not implement or commit before a pick.
|
|
@@ -35,9 +35,9 @@ A check run never edits the config and never rewrites the tree. Its only possibl
|
|
|
35
35
|
|
|
36
36
|
## Steps 7–9 — shared by both modes
|
|
37
37
|
|
|
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.
|
|
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 top-level `up`/`down` pair (accepted there, and a stray nested `up.*`/`down.*` is an unknown key), 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.
|
|
39
39
|
|
|
40
|
-
The `worktrees` half checks what a run would read: the switch
|
|
40
|
+
The `worktrees` half checks what a run would read: the switch, that the tooling is installed with the shipped bytes, that no checkout sits inside the working tree, and that none holds a branch `base_map` names as a base.
|
|
41
41
|
|
|
42
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.
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ A check run never edits the config and never rewrites the tree. Its only possibl
|
|
|
45
45
|
|
|
46
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:
|
|
47
47
|
|
|
48
|
-
`.sassywares/config.yaml`, `.sassywares/README.md`, `.sassywares/dogfood/recipe.md` and `.sassywares/.gitignore` when step 4 created them, `.sassywares/worktree/*`
|
|
48
|
+
`.sassywares/config.yaml`, `.sassywares/README.md`, `.sassywares/dogfood/recipe.md` and `.sassywares/.gitignore` when step 4 created them, the `up`/`down` stubs step 4 wrote (only those two named scripts — never their directory), `.sassywares/worktree/*` when step 6 installed the tooling, the runner file when the user accepted aliases in it, `.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.
|
|
49
49
|
|
|
50
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.
|
|
51
51
|
|
|
@@ -54,7 +54,7 @@ A check run never edits the config and never rewrites the tree. Its only possibl
|
|
|
54
54
|
- **`workspace`** — nothing to commit: the root is not a repo, and `references/workspace.md` forbids running the snapshot here. Say the root config and the pin land with the project's next snapshot.
|
|
55
55
|
- **`none`** — nothing to commit, deliberately.
|
|
56
56
|
|
|
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
|
|
57
|
+
9. **Report.** The config path, the topology, the resolved artifact and knowledge paths, the lifecycle — the two values `up` and `down` name, or one line saying the project declares **no lifecycle** because the keys are absent, with no suggestion attached — 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 where the `worktree:*` / `workspace:*` aliases went, or that none were wired because the project has no command-building file to put them in — naming the scripts' path instead, since that is how they are run either way. 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.
|
|
58
58
|
|
|
59
59
|
## Hard rules — every mode
|
|
60
60
|
|
|
@@ -62,13 +62,13 @@ A check run never edits the config and never rewrites the tree. Its only possibl
|
|
|
62
62
|
|------|-------------|
|
|
63
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. |
|
|
64
64
|
| Verify before commit | A config that fails `--check` is reported, never committed. |
|
|
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. |
|
|
65
|
+
| Commit only what setup owns | The config, the setup README, the `up`/`down` stubs step 4 wrote, 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. |
|
|
66
66
|
| No silent overwrite | An existing config or an existing `.sassywares/workspace/snapshot` is shown and asked about, never replaced blind. |
|
|
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
|
|
67
|
+
| Write boundary | Only `.sassywares/` (the config, the setup README, the dogfood scaffold, and the worktree tooling), the two `up`/`down` stubs step 4 wrote at their probed path, 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 offers the aliases. It never creates a checkout, never runs a script, and never starts or stops the project's stack — `up` is the project's or the user's, and `down` runs only from `remove`. |
|
|
69
69
|
| Skills come from upstream | Install with `npx skills add`, `-g` for user scope; never hand-copy skill files or maintain the links yourself. |
|
|
70
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. |
|
|
71
|
-
| Never edit the manifest | No dependencies, no `postinstall`, no `skills:*` scripts.
|
|
71
|
+
| Never edit the manifest | No dependencies, no `postinstall`, no `skills:*` scripts. Step 6's `worktree:*` and `workspace:*` aliases may be added, and only into a file that already carries named commands: appended or corrected, never removed, nothing else in the file touched, and **never a manifest created to hold them**. A project with no such file gets no aliases and loses nothing — the scripts are run by path. Setup installs the suite; the user or project decides how it updates. |
|
|
72
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. |
|
|
73
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. |
|
|
74
74
|
| Version is reported | Setup names the snapshot and `workspace-git` versions it installed; `--check` flags an installed copy older than the skill's. |
|
|
@@ -8,7 +8,7 @@ never values>
|
|
|
8
8
|
**Reset:** <the product back to a known state — a database, a cache, a temp dir.
|
|
9
9
|
Never `reports/`: evidence must outlive the run that made it>`
|
|
10
10
|
|
|
11
|
-
**Preview:** <what you look at once it is up —
|
|
11
|
+
**Preview:** <what you look at once it is up — a URL, a simulator name, a window. Not the command; that is a step below.>
|
|
12
12
|
|
|
13
13
|
<!--
|
|
14
14
|
Incomplete on purpose. sassy-setup writes this skeleton so the shape is visible;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# down — how this project's stack stops.
|
|
3
|
+
#
|
|
4
|
+
# sassy-setup wrote this stub and will never edit it again: replace the body below
|
|
5
|
+
# with this project's real stop command. The suite reads the `down:` key in
|
|
6
|
+
# .sassywares/config.yaml, not this file's name, so keep the two in step if you
|
|
7
|
+
# rename the file.
|
|
8
|
+
#
|
|
9
|
+
# Unimplemented: this stub exits 78. Implement it, or delete the `down:` key if
|
|
10
|
+
# nothing needs stopping.
|
|
11
|
+
#
|
|
12
|
+
# The contract:
|
|
13
|
+
# * Terminate what `up` started, then exit: no daemon left behind, nothing else
|
|
14
|
+
# still holding this checkout.
|
|
15
|
+
# * Idempotent. A stack that is already down is not an error.
|
|
16
|
+
# * It runs from inside the checkout, before the folder is deleted, after the
|
|
17
|
+
# guards have passed — so a failure here aborts the removal rather than
|
|
18
|
+
# leaving something running in a directory nobody owns. Until this stub is
|
|
19
|
+
# real, that is what it does: it refuses, because how this project stops is
|
|
20
|
+
# still unknown. Delete the `down:` key instead if nothing needs stopping.
|
|
21
|
+
# * These are exported: WT_PATH (this checkout), WT_BRANCH, WT_SLUG, and
|
|
22
|
+
# WT_NAMESPACE (the derived database / compose project / device name).
|
|
23
|
+
set -euo pipefail
|
|
24
|
+
|
|
25
|
+
printf 'down: not implemented yet — this project has not said how its stack stops.\n' >&2
|
|
26
|
+
printf ' Read the contract at the top of %s, then replace this body.\n' "$0" >&2
|
|
27
|
+
printf ' WT_PATH=%s\n WT_BRANCH=%s\n WT_SLUG=%s\n WT_NAMESPACE=%s\n' \
|
|
28
|
+
"${WT_PATH:-<unset>}" "${WT_BRANCH:-<unset>}" "${WT_SLUG:-<unset>}" "${WT_NAMESPACE:-<unset>}" >&2
|
|
29
|
+
exit 78
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# up — how this project's stack starts.
|
|
3
|
+
#
|
|
4
|
+
# sassy-setup wrote this stub and will never edit it again: replace the body below
|
|
5
|
+
# with this project's real start command. The suite reads the `up:` key in
|
|
6
|
+
# .sassywares/config.yaml, not this file's name, so keep the two in step if you
|
|
7
|
+
# rename the file.
|
|
8
|
+
#
|
|
9
|
+
# Unimplemented: this stub exits 78. Implement it, or delete the `up:` key if
|
|
10
|
+
# nothing needs starting.
|
|
11
|
+
#
|
|
12
|
+
# The contract:
|
|
13
|
+
# * Run in the FOREGROUND. This process owns the stack until it is stopped, so a
|
|
14
|
+
# detached or daemonized app outlives the call and holds the checkout — which
|
|
15
|
+
# is exactly what `down` then cannot kill.
|
|
16
|
+
# * Stop on SIGTERM (and Ctrl-C) and reap the children you started before you
|
|
17
|
+
# exit. `down` is the other half of the pair: it must terminate what this one
|
|
18
|
+
# started, and it runs before a checkout is deleted.
|
|
19
|
+
# * These are exported by whoever runs this, so a checkout stays distinct from
|
|
20
|
+
# its siblings. Derive names from them, never build one by hand:
|
|
21
|
+
# WT_PATH this checkout
|
|
22
|
+
# WT_BRANCH the branch it holds
|
|
23
|
+
# WT_SLUG the branch, filesystem-safe
|
|
24
|
+
# WT_NAMESPACE the derived name for a database, a compose project, a device
|
|
25
|
+
# * Ports are this project's business: the suite derives none, so two checkouts
|
|
26
|
+
# running the same app collide on a fixed port. Hash WT_SLUG into one instead,
|
|
27
|
+
# e.g. PORT=$(( 3000 + $(printf '%s' "$WT_SLUG" | cksum | cut -d' ' -f1) % 100 )).
|
|
28
|
+
set -euo pipefail
|
|
29
|
+
|
|
30
|
+
printf 'up: not implemented yet — nothing here starts this project.\n' >&2
|
|
31
|
+
printf ' Read the contract at the top of %s, then replace this body.\n' "$0" >&2
|
|
32
|
+
printf ' WT_PATH=%s\n WT_BRANCH=%s\n WT_SLUG=%s\n WT_NAMESPACE=%s\n' \
|
|
33
|
+
"${WT_PATH:-<unset>}" "${WT_BRANCH:-<unset>}" "${WT_SLUG:-<unset>}" "${WT_NAMESPACE:-<unset>}" >&2
|
|
34
|
+
exit 78
|
|
@@ -59,10 +59,11 @@ across the sibling repos, next to the `snapshot` that versions the glue:
|
|
|
59
59
|
.sassywares/workspace/snapshot # commit + push the glue
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
Run them by path from the root — that is all they need, and it works in every
|
|
63
|
+
shell. If this project already had a file carrying named commands, the same
|
|
64
|
+
scripts are also wired into it as `workspace:<script>` (`workspace:pull`,
|
|
65
|
+
`workspace:snapshot`, …), so your runner reaches them too. The aliases are a
|
|
66
|
+
convenience; the paths are the contract.
|
|
66
67
|
|
|
67
68
|
They read the repo inventory and the PR bases from `repos:` in `config.yaml`, so
|
|
68
69
|
there is no second base map to keep in step. They are this project's files:
|