@iceinvein/agent-skills 0.1.40 → 0.3.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/README.md +18 -2
- package/dist/cli/index.js +115 -34
- package/package.json +1 -1
- package/skills/index.json +14 -2
- package/skills/magpie/SKILL.md +118 -40
- package/skills/magpie/bin/magpie.ts +43 -0
- package/skills/magpie/fixtures/fake-gh-nodiff.sh +38 -0
- package/skills/magpie/package.json +1 -1
- package/skills/magpie/references/peer-review.md +7 -2
- package/skills/magpie/references/specialists.md +38 -7
- package/skills/magpie/scripts/__tests__/cli.test.ts +101 -1
- package/skills/magpie/scripts/__tests__/dedupe-cmd.test.ts +187 -0
- package/skills/magpie/scripts/__tests__/diff-chunks.test.ts +51 -0
- package/skills/magpie/scripts/__tests__/filter-diff-preservation.test.ts +54 -0
- package/skills/magpie/scripts/__tests__/findings-files.test.ts +35 -0
- package/skills/magpie/scripts/__tests__/gh.test.ts +69 -0
- package/skills/magpie/scripts/__tests__/git-diff.test.ts +83 -0
- package/skills/magpie/scripts/__tests__/helpers/git-fixture.ts +47 -0
- package/skills/magpie/scripts/__tests__/path-filter.test.ts +27 -0
- package/skills/magpie/scripts/__tests__/render-cmd.test.ts +95 -0
- package/skills/magpie/scripts/__tests__/render-findings.test.ts +33 -0
- package/skills/magpie/scripts/__tests__/render-progress.test.ts +42 -0
- package/skills/magpie/scripts/__tests__/setup-cmd.test.ts +83 -1
- package/skills/magpie/scripts/__tests__/shard.test.ts +165 -0
- package/skills/magpie/scripts/__tests__/skill-lint.test.ts +96 -1
- package/skills/magpie/scripts/dedupe-cmd.ts +58 -3
- package/skills/magpie/scripts/diff-chunks.ts +28 -0
- package/skills/magpie/scripts/findings-files.ts +32 -0
- package/skills/magpie/scripts/gh.ts +64 -13
- package/skills/magpie/scripts/git-diff.ts +111 -0
- package/skills/magpie/scripts/path-filter.ts +9 -5
- package/skills/magpie/scripts/refresh.ts +8 -0
- package/skills/magpie/scripts/render-cmd.ts +28 -9
- package/skills/magpie/scripts/render-findings.ts +11 -1
- package/skills/magpie/scripts/render-progress.ts +6 -1
- package/skills/magpie/scripts/setup-cmd.ts +38 -1
- package/skills/magpie/scripts/shard.ts +171 -0
- package/skills/magpie/scripts/status-cmd.ts +4 -1
- package/skills/magpie/skill.json +2 -2
- package/skills/magpie/templates/styles.css +5 -0
- package/skills/migrate/README.md +194 -0
- package/skills/migrate/SKILL.md +197 -0
- package/skills/migrate/bin/migrate +15 -0
- package/skills/migrate/bin/migrate.ts +309 -0
- package/skills/migrate/biome.json +35 -0
- package/skills/migrate/bun.lock +24 -0
- package/skills/migrate/docs/architecture.md +294 -0
- package/skills/migrate/docs/reference.md +590 -0
- package/skills/migrate/fixtures/tiny-express/GROUND-TRUTH.md +39 -0
- package/skills/migrate/fixtures/tiny-express/app.js +29 -0
- package/skills/migrate/fixtures/tiny-express/cron.js +6 -0
- package/skills/migrate/fixtures/tiny-express/reports/daily-users.json +6 -0
- package/skills/migrate/fixtures/tiny-express/schema.sql +12 -0
- package/skills/migrate/fixtures/tiny-express/settings.json +4 -0
- package/skills/migrate/fixtures/tiny-express/views/users.html +9 -0
- package/skills/migrate/fixtures/tiny-webforms/Controllers/UsersController.cs +68 -0
- package/skills/migrate/fixtures/tiny-webforms/Default.aspx +7 -0
- package/skills/migrate/fixtures/tiny-webforms/Default.aspx.cs +14 -0
- package/skills/migrate/fixtures/tiny-webforms/GROUND-TRUTH.md +50 -0
- package/skills/migrate/fixtures/tiny-webforms/Integrations/BillingClient.cs +16 -0
- package/skills/migrate/fixtures/tiny-webforms/Jobs/NightlyDigestJob.cs +33 -0
- package/skills/migrate/fixtures/tiny-webforms/Reports/DailyUsers.rdl +11 -0
- package/skills/migrate/fixtures/tiny-webforms/Schema.sql +12 -0
- package/skills/migrate/fixtures/tiny-webforms/Site.master +16 -0
- package/skills/migrate/fixtures/tiny-webforms/Users.aspx +8 -0
- package/skills/migrate/fixtures/tiny-webforms/Users.aspx.cs +14 -0
- package/skills/migrate/fixtures/tiny-webforms/web.config +10 -0
- package/skills/migrate/install.sh +68 -0
- package/skills/migrate/package.json +17 -0
- package/skills/migrate/references/phases/enumerate.md +291 -0
- package/skills/migrate/references/phases/extract.md +652 -0
- package/skills/migrate/references/phases/parity.md +275 -0
- package/skills/migrate/references/phases/probe.md +135 -0
- package/skills/migrate/references/phases/queue.md +242 -0
- package/skills/migrate/references/phases/seam.md +416 -0
- package/skills/migrate/references/recipes/README.md +116 -0
- package/skills/migrate/references/recipes/aspnet.md +287 -0
- package/skills/migrate/references/run-ops.md +280 -0
- package/skills/migrate/scripts/__tests__/census.test.ts +775 -0
- package/skills/migrate/scripts/__tests__/check.test.ts +458 -0
- package/skills/migrate/scripts/__tests__/citations.test.ts +156 -0
- package/skills/migrate/scripts/__tests__/cli.test.ts +183 -0
- package/skills/migrate/scripts/__tests__/concurrency.test.ts +164 -0
- package/skills/migrate/scripts/__tests__/config.test.ts +112 -0
- package/skills/migrate/scripts/__tests__/e2e-express.test.ts +1093 -0
- package/skills/migrate/scripts/__tests__/e2e-webforms.test.ts +1276 -0
- package/skills/migrate/scripts/__tests__/e2e.test.ts +320 -0
- package/skills/migrate/scripts/__tests__/ids.test.ts +38 -0
- package/skills/migrate/scripts/__tests__/import.test.ts +155 -0
- package/skills/migrate/scripts/__tests__/init.test.ts +192 -0
- package/skills/migrate/scripts/__tests__/leaks.test.ts +176 -0
- package/skills/migrate/scripts/__tests__/lock.test.ts +183 -0
- package/skills/migrate/scripts/__tests__/paths.test.ts +129 -0
- package/skills/migrate/scripts/__tests__/phase-cmd.test.ts +151 -0
- package/skills/migrate/scripts/__tests__/phases.test.ts +70 -0
- package/skills/migrate/scripts/__tests__/queue.test.ts +475 -0
- package/skills/migrate/scripts/__tests__/report.test.ts +150 -0
- package/skills/migrate/scripts/__tests__/run-state.test.ts +136 -0
- package/skills/migrate/scripts/__tests__/status-reset.test.ts +318 -0
- package/skills/migrate/scripts/__tests__/store.test.ts +132 -0
- package/skills/migrate/scripts/__tests__/validate.test.ts +54 -0
- package/skills/migrate/scripts/census-cmd.ts +109 -0
- package/skills/migrate/scripts/census.ts +342 -0
- package/skills/migrate/scripts/check-cmd.ts +24 -0
- package/skills/migrate/scripts/check.ts +376 -0
- package/skills/migrate/scripts/citations.ts +92 -0
- package/skills/migrate/scripts/config.ts +237 -0
- package/skills/migrate/scripts/ids.ts +31 -0
- package/skills/migrate/scripts/import-cmd.ts +141 -0
- package/skills/migrate/scripts/init-cmd.ts +118 -0
- package/skills/migrate/scripts/leaks.ts +184 -0
- package/skills/migrate/scripts/lock.ts +188 -0
- package/skills/migrate/scripts/paths.ts +103 -0
- package/skills/migrate/scripts/phase-cmd.ts +63 -0
- package/skills/migrate/scripts/phases.ts +113 -0
- package/skills/migrate/scripts/queue-cmd.ts +98 -0
- package/skills/migrate/scripts/queue.ts +258 -0
- package/skills/migrate/scripts/report-cmd.ts +47 -0
- package/skills/migrate/scripts/report.ts +131 -0
- package/skills/migrate/scripts/reset-cmd.ts +120 -0
- package/skills/migrate/scripts/status-cmd.ts +52 -0
- package/skills/migrate/scripts/store.ts +159 -0
- package/skills/migrate/scripts/types.ts +137 -0
- package/skills/migrate/scripts/validate.ts +221 -0
- package/skills/migrate/skill.json +33 -0
- package/skills/migrate/templates/config.toml +27 -0
- package/skills/migrate/templates/queue-item.md +17 -0
- package/skills/migrate/tsconfig.json +18 -0
- package/skills/migrate/uninstall.sh +31 -0
- package/skills/sluice/SKILL.md +95 -0
- package/skills/sluice/references/deep-channel.md +114 -0
- package/skills/sluice/references/finish.md +37 -0
- package/skills/sluice/references/intent.md +29 -0
- package/skills/sluice/references/meter.md +38 -0
- package/skills/sluice/references/review.md +42 -0
- package/skills/sluice/references/root-cause.md +38 -0
- package/skills/sluice/references/show-or-say.md +36 -0
- package/skills/sluice/references/test-first.md +35 -0
- package/skills/sluice/references/verify.md +26 -0
- package/skills/sluice/scripts/run-stats.sh +236 -0
- package/skills/sluice/skill.json +33 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Print the run ledger: what this piece of work actually cost.
|
|
3
|
+
#
|
|
4
|
+
# The run starts at the channel announcement, not at the session, so a session
|
|
5
|
+
# holding three unrelated tasks reports each one separately. A previous ledger
|
|
6
|
+
# ends the run before it. `bypass` announces nothing and so prints nothing.
|
|
7
|
+
#
|
|
8
|
+
# Usage: run-stats.sh [--tests "<what the suite reported>"] [--base <git-ref>]
|
|
9
|
+
# [--transcript <path>]
|
|
10
|
+
#
|
|
11
|
+
# Exit 0 printed a ledger, 1 could not read a transcript, 2 no run to report.
|
|
12
|
+
|
|
13
|
+
set -uo pipefail
|
|
14
|
+
|
|
15
|
+
TESTS=""
|
|
16
|
+
BASE=""
|
|
17
|
+
TRANSCRIPT=""
|
|
18
|
+
|
|
19
|
+
while [ $# -gt 0 ]; do
|
|
20
|
+
case "$1" in
|
|
21
|
+
--tests) TESTS="${2-}"; shift 2 ;;
|
|
22
|
+
--base) BASE="${2-}"; shift 2 ;;
|
|
23
|
+
--transcript) TRANSCRIPT="${2-}"; shift 2 ;;
|
|
24
|
+
-h|--help) sed -n '2,11p' "$0" | cut -c3-; exit 0 ;;
|
|
25
|
+
*) echo "run-stats: unknown argument '$1'" >&2; exit 1 ;;
|
|
26
|
+
esac
|
|
27
|
+
done
|
|
28
|
+
|
|
29
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
30
|
+
echo "run-stats: jq is required and was not found on PATH" >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ -z "$TRANSCRIPT" ]; then
|
|
35
|
+
sid="${CLAUDE_CODE_SESSION_ID:-}"
|
|
36
|
+
if [ -z "$sid" ]; then
|
|
37
|
+
echo "run-stats: no --transcript given and CLAUDE_CODE_SESSION_ID is unset" >&2
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
# The session id is unique across projects, so glob rather than guess the slug.
|
|
41
|
+
TRANSCRIPT="$(ls "$HOME"/.claude/projects/*/"$sid".jsonl 2>/dev/null | head -1)"
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
if [ -z "$TRANSCRIPT" ] || [ ! -f "$TRANSCRIPT" ]; then
|
|
45
|
+
echo "run-stats: transcript not found (looked for '${TRANSCRIPT:-<unresolved>}')" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
SUMMARY="$(jq -s '
|
|
50
|
+
# ---- what counts as a real turn ----------------------------------------
|
|
51
|
+
# Transcript stamps carry milliseconds, which fromdateiso8601 will not take.
|
|
52
|
+
def ts: sub("\\.[0-9]+Z$"; "Z") | fromdateiso8601;
|
|
53
|
+
def is_meta: (.isMeta == true) or (.isSidechain == true);
|
|
54
|
+
def texts: [ .message.content[]? | select(.type == "text") | .text ] | join("\n");
|
|
55
|
+
# The channel is stated in one line before proceeding, so the announcement
|
|
56
|
+
# opens the message. Anchoring there is what separates it from prose that
|
|
57
|
+
# merely discusses a channel, which a session about sluice is full of.
|
|
58
|
+
def marker: "^[*_#>[:space:]]*(?<c>fast|main|deep)[[:space:]]+channel";
|
|
59
|
+
def announces: (.type == "assistant") and (is_meta | not)
|
|
60
|
+
and (texts | test(marker; "i"));
|
|
61
|
+
def chan: texts | capture(marker; "i") | .c | ascii_downcase;
|
|
62
|
+
def is_stats_call: (.type == "assistant") and ([
|
|
63
|
+
.message.content[]? | select(.type == "tool_use" and .name == "Bash")
|
|
64
|
+
| select((.input.command // "") | test("run-stats\\.sh"))
|
|
65
|
+
] | length > 0);
|
|
66
|
+
# Waiting is any turn the partner had to take: a prompt, or an answer to a
|
|
67
|
+
# question you put to them. Leaving the latter out understates the wait on
|
|
68
|
+
# exactly the runs that stopped to ask, which are the ones worth pricing.
|
|
69
|
+
def is_prompt: (.type == "user") and (is_meta | not)
|
|
70
|
+
and (((.message.content | type) == "string"
|
|
71
|
+
or ((.message.content | type) == "array"
|
|
72
|
+
and ([ .message.content[]? | select(.type == "tool_result") ] | length == 0)))
|
|
73
|
+
or ((.toolUseResult | type) == "object" and (.toolUseResult | has("answers"))));
|
|
74
|
+
|
|
75
|
+
. as $all
|
|
76
|
+
| [ range(0; $all | length) ] as $ix
|
|
77
|
+
| [ $ix[] | select($all[.] | announces) ] as $ann
|
|
78
|
+
| if ($ann | length) == 0 then { empty: true } else
|
|
79
|
+
|
|
80
|
+
# A previous ledger closes the run before it. The call running right now has
|
|
81
|
+
# no announcement after it, so it is skipped rather than closing this run.
|
|
82
|
+
([ $ix[] | select($all[.] | is_stats_call) ]
|
|
83
|
+
| map(select(. < ($ann | max)))
|
|
84
|
+
| if length == 0 then -1 else max end) as $boundary
|
|
85
|
+
| [ $ann[] | select(. > $boundary) ] as $ann
|
|
86
|
+
| ($ann | min) as $from
|
|
87
|
+
| [ $all[$from:][] | select(.timestamp) ] as $run
|
|
88
|
+
|
|
89
|
+
# ---- channel, and the trail if it escalated ----------------------------
|
|
90
|
+
| ([ $ann[] | $all[.] | chan ]
|
|
91
|
+
| reduce .[] as $c ([]; if (. | last) == $c then . else . + [$c] end)) as $trail
|
|
92
|
+
|
|
93
|
+
# ---- clocks ------------------------------------------------------------
|
|
94
|
+
| ($run | map(.timestamp) | min) as $start
|
|
95
|
+
| ($run | map(.timestamp) | max) as $end
|
|
96
|
+
| (($end | ts) - ($start | ts)) as $elapsed
|
|
97
|
+
| ([ range(1; $run | length)
|
|
98
|
+
| select($run[.] | is_prompt)
|
|
99
|
+
| ($run[.].timestamp | ts) - ($run[. - 1].timestamp | ts) ]
|
|
100
|
+
| add // 0) as $waiting
|
|
101
|
+
|
|
102
|
+
# ---- tools and tokens, main loop only ----------------------------------
|
|
103
|
+
| [ $run[] | select((.type == "assistant") and (is_meta | not))
|
|
104
|
+
| .message.content[]? | select(.type == "tool_use") | .name ] as $tools
|
|
105
|
+
| ([ $run[] | select((.type == "assistant") and (is_meta | not))
|
|
106
|
+
| .message.usage.output_tokens // 0 ] | add // 0) as $out_tok
|
|
107
|
+
| ([ $run[] | select((.type == "assistant") and (is_meta | not))
|
|
108
|
+
| .message.usage.cache_read_input_tokens // 0 ] | add // 0) as $cache_tok
|
|
109
|
+
|
|
110
|
+
# ---- dispatched agents -------------------------------------------------
|
|
111
|
+
| ([ $run[] | select(.type == "assistant") | .message.content[]?
|
|
112
|
+
| select(.type == "tool_use" and (.name == "Agent" or .name == "Task"))
|
|
113
|
+
| { key: .id, value: (.input.description // .input.subagent_type // "agent") } ]
|
|
114
|
+
| from_entries) as $labels
|
|
115
|
+
# toolUseResult is whatever the tool returned: object, array or string.
|
|
116
|
+
| [ $run[] | select((.toolUseResult | type) == "object") | select(.toolUseResult.agentId)
|
|
117
|
+
| { label: ($labels[[ .message.content[]? | select(.type == "tool_result") | .tool_use_id ][0]] // "agent"),
|
|
118
|
+
model: (.toolUseResult.resolvedModel // "?"),
|
|
119
|
+
status: (.toolUseResult.status // "?"),
|
|
120
|
+
tokens: (.toolUseResult.totalTokens // 0),
|
|
121
|
+
ms: (.toolUseResult.totalDurationMs // 0),
|
|
122
|
+
tools: (.toolUseResult.totalToolUseCount // 0) } ] as $agents
|
|
123
|
+
|
|
124
|
+
| { empty: false,
|
|
125
|
+
trail: ($trail | join(" → ")),
|
|
126
|
+
elapsed: $elapsed, waiting: $waiting,
|
|
127
|
+
tool_total: ($tools | length),
|
|
128
|
+
tool_top: ([ $tools | group_by(.)[] | { n: length, name: (.[0] | ascii_downcase | split("__") | last) } ]
|
|
129
|
+
| sort_by(-.n) | .[0:3]),
|
|
130
|
+
out_tok: $out_tok, cache_tok: $cache_tok,
|
|
131
|
+
agents: $agents,
|
|
132
|
+
agent_tokens: ([ $agents[].tokens ] | add // 0),
|
|
133
|
+
agent_ms: ([ $agents[].ms ] | add // 0) }
|
|
134
|
+
end
|
|
135
|
+
' "$TRANSCRIPT" 2>/dev/null)"
|
|
136
|
+
|
|
137
|
+
if [ -z "$SUMMARY" ]; then
|
|
138
|
+
echo "run-stats: could not parse '$TRANSCRIPT'" >&2
|
|
139
|
+
exit 1
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
if [ "$(jq -r '.empty' <<<"$SUMMARY")" = "true" ]; then
|
|
143
|
+
exit 2
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
# ---- formatting -------------------------------------------------------------
|
|
147
|
+
|
|
148
|
+
dur() { # seconds -> 1h05m | 3m11s | 42s
|
|
149
|
+
local s=${1%.*} h m
|
|
150
|
+
h=$((s / 3600)); m=$(((s % 3600) / 60)); s=$((s % 60))
|
|
151
|
+
if [ "$h" -gt 0 ]; then printf '%dh%02dm' "$h" "$m"
|
|
152
|
+
elif [ "$m" -gt 0 ]; then printf '%dm%ds' "$m" "$s"
|
|
153
|
+
else printf '%ds' "$s"; fi
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
tok() { # tokens -> 1.2M | 313k | 51.0k | 350
|
|
157
|
+
local n=$1
|
|
158
|
+
if [ "$n" -ge 1000000 ]; then awk -v n="$n" 'BEGIN{printf "%.1fM", n/1000000}'
|
|
159
|
+
elif [ "$n" -ge 100000 ]; then awk -v n="$n" 'BEGIN{printf "%dk", n/1000}'
|
|
160
|
+
elif [ "$n" -ge 1000 ]; then awk -v n="$n" 'BEGIN{printf "%.1fk", n/1000}'
|
|
161
|
+
else printf '%d' "$n"; fi
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
g() { jq -r "$1" <<<"$SUMMARY"; }
|
|
165
|
+
|
|
166
|
+
printf '─── run %s\n' "$(printf '─%.0s' $(seq 1 36))"
|
|
167
|
+
printf 'channel %s\n' "$(g '.trail')"
|
|
168
|
+
|
|
169
|
+
elapsed=$(g '.elapsed'); waiting=$(g '.waiting')
|
|
170
|
+
if [ "${waiting%.*}" -gt 0 ]; then
|
|
171
|
+
printf 'elapsed %s · %s of that waiting on you\n' "$(dur "$elapsed")" "$(dur "$waiting")"
|
|
172
|
+
else
|
|
173
|
+
printf 'elapsed %s\n' "$(dur "$elapsed")"
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
top="$(g '[.tool_top[] | "\(.n) \(.name)"] | join(" · ")')"
|
|
177
|
+
if [ -n "$top" ]; then
|
|
178
|
+
printf 'tools %s · %s\n' "$(g '.tool_total')" "$top"
|
|
179
|
+
else
|
|
180
|
+
printf 'tools %s\n' "$(g '.tool_total')"
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
printf 'tokens %s out · %s cache read\n' "$(tok "$(g '.out_tok')")" "$(tok "$(g '.cache_tok')")"
|
|
184
|
+
printf 'tests %s\n' "${TESTS:-not reported}"
|
|
185
|
+
|
|
186
|
+
# The diff is the branch as a whole against where it left the base, working
|
|
187
|
+
# tree included, because uncommitted work is still work this run produced.
|
|
188
|
+
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
189
|
+
if [ -z "$BASE" ]; then
|
|
190
|
+
for cand in main master; do
|
|
191
|
+
if git rev-parse --verify --quiet "$cand" >/dev/null 2>&1; then
|
|
192
|
+
BASE="$(git merge-base HEAD "$cand" 2>/dev/null)" && break
|
|
193
|
+
fi
|
|
194
|
+
done
|
|
195
|
+
[ -z "$BASE" ] && BASE="HEAD"
|
|
196
|
+
fi
|
|
197
|
+
stat="$(git diff --shortstat "$BASE" 2>/dev/null | sed 's/^ *//')"
|
|
198
|
+
files="$(git diff --name-only "$BASE" 2>/dev/null | wc -l | tr -d ' ')"
|
|
199
|
+
# awk, not sed: BSD sed has no \+ and silently matches nothing.
|
|
200
|
+
ins="$(awk '{for(i=1;i<=NF;i++) if($i ~ /^insertion/) print $(i-1)}' <<<"$stat")"
|
|
201
|
+
del="$(awk '{for(i=1;i<=NF;i++) if($i ~ /^deletion/) print $(i-1)}' <<<"$stat")"
|
|
202
|
+
ins=${ins:-0}; del=${del:-0}
|
|
203
|
+
|
|
204
|
+
# A file the run created is not in the diff until it is staged, and staging
|
|
205
|
+
# it here would be a side effect on someone else's index. Count it instead.
|
|
206
|
+
while IFS= read -r f; do
|
|
207
|
+
[ -n "$f" ] || continue
|
|
208
|
+
files=$((files + 1))
|
|
209
|
+
ins=$((ins + $(wc -l <"$f" 2>/dev/null || echo 0)))
|
|
210
|
+
done < <(git ls-files --others --exclude-standard 2>/dev/null)
|
|
211
|
+
|
|
212
|
+
[ "$files" -gt 0 ] && printf 'diff +%s −%s across %s files\n' "$ins" "$del" "$files"
|
|
213
|
+
fi
|
|
214
|
+
|
|
215
|
+
count=$(g '.agents | length')
|
|
216
|
+
if [ "$count" -eq 0 ]; then
|
|
217
|
+
printf 'agents none dispatched\n'
|
|
218
|
+
else
|
|
219
|
+
printf 'agents %s dispatched · %s tok · %s wall\n' \
|
|
220
|
+
"$count" "$(tok "$(g '.agent_tokens')")" "$(dur "$(( $(g '.agent_ms') / 1000 ))")"
|
|
221
|
+
|
|
222
|
+
# Up to a dozen rows read as the narrative of the plan. Past that the order
|
|
223
|
+
# stops helping, so show what the run actually spent on and say what is cut.
|
|
224
|
+
if [ "$count" -le 12 ]; then rows='.agents[]'; else rows='(.agents | sort_by(-.tokens) | .[0:10][])'; fi
|
|
225
|
+
while IFS=$'\t' read -r label model status tokens ms tools; do
|
|
226
|
+
model="${model#claude-}"; model="$(sed 's/-[0-9]\{8\}$//' <<<"$model")"
|
|
227
|
+
[ "$status" = "completed" ] && status="" || status=" ($status)"
|
|
228
|
+
printf ' %-22.22s %-10s %6s %7s %s tools%s\n' \
|
|
229
|
+
"$label" "$model" "$(tok "$tokens")" "$(dur "$((ms / 1000))")" "$tools" "$status"
|
|
230
|
+
done < <(g "$rows | [.label, .model, .status, .tokens, .ms, .tools] | @tsv")
|
|
231
|
+
|
|
232
|
+
if [ "$count" -gt 12 ]; then
|
|
233
|
+
printf ' +%s more · %s tok (dearest 10 shown)\n' \
|
|
234
|
+
"$((count - 10))" "$(tok "$(g '(.agents | sort_by(-.tokens) | .[10:] | map(.tokens) | add) // 0')")"
|
|
235
|
+
fi
|
|
236
|
+
fi
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sluice",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries seven rules as one-liners in the router and the full treatment in references read only on friction, and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what every dispatched agent cost. Claude Code only; conflicts with the superpowers plugin.",
|
|
5
|
+
"author": "iceinvein",
|
|
6
|
+
"type": "prompt",
|
|
7
|
+
"tools": [
|
|
8
|
+
"claude"
|
|
9
|
+
],
|
|
10
|
+
"files": {
|
|
11
|
+
"prompt": "SKILL.md"
|
|
12
|
+
},
|
|
13
|
+
"bundle": {
|
|
14
|
+
"include": [
|
|
15
|
+
"references",
|
|
16
|
+
"scripts"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"install": {
|
|
20
|
+
"claude": {
|
|
21
|
+
"prompt": ".claude/skills/sluice/SKILL.md",
|
|
22
|
+
"bundleRoot": ".claude/skills/sluice"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"activation": {
|
|
26
|
+
"modes": [
|
|
27
|
+
"session",
|
|
28
|
+
"global"
|
|
29
|
+
],
|
|
30
|
+
"default": "global",
|
|
31
|
+
"claudeHookDirective": "Before acting on a request that changes code, pick a sluice channel and state which one."
|
|
32
|
+
}
|
|
33
|
+
}
|