Build in the review tool.

This commit is contained in:
Greyson Parrelli
2026-08-24 09:24:01 -04:00
parent 4eef6a28d3
commit 407dd81512
55 changed files with 12932 additions and 40 deletions
+67
View File
@@ -1,6 +1,14 @@
# Nix supplies the whole toolchain (Zig, GTK, libadwaita), so there is
# nothing for mise to install; these tasks just drive it.
[tasks.web-deps]
description = "Install the review UI's npm dependencies"
run = "nix develop --command npm --prefix web install --no-audit --no-fund"
[tasks.web-dev]
description = "Hot-reloading review UI against a running playpen (open /t/<tabId>/)"
run = "nix develop --command npm --prefix web run dev"
[tasks.build]
description = "Build a release binary into zig-out/bin"
run = "nix develop --command zig build -Doptimize=ReleaseFast"
@@ -117,6 +125,65 @@ rm -f "$claude/hooks/playpen-status.sh"
echo "removed the hooks from $settings (previous version kept at $settings.playpen-backup)"
'''
[tasks.install-skills]
description = "Install the review skills so Claude can drive the review pane"
run = '''
#!/usr/bin/env bash
set -euo pipefail
claude="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
dest="$claude/skills"
# Outside the skills directory on purpose: anything under it is loaded as a
# skill, so a backup kept alongside would show up in the list as a second,
# stale copy of the thing it is a backup of.
backups="$claude/playpen-skill-backups"
mkdir -p "$dest" "$backups"
for name in address-review leave-review; do
src=".claude/skills/$name"
[ -d "$src" ] || { echo "missing $src" >&2; exit 1; }
# Anything already installed under this name is kept, not replaced. These are
# global names: the version being overwritten may be one that drives an
# entirely different tool, and losing it silently would be the worst kind of
# breakage — the skill still runs, against a server that is not there.
if [ -e "$dest/$name" ] && [ ! -L "$dest/$name" ]; then
rm -rf "$backups/$name"
cp -r "$dest/$name" "$backups/$name"
echo "kept the previous $name at $backups/$name"
fi
rm -rf "$dest/$name"
cp -r "$src" "$dest/$name"
echo "installed $dest/$name"
done
echo
echo "Open a new Claude session to pick them up — skills are read at startup."
'''
[tasks.uninstall-skills]
description = "Remove the review skills, restoring whatever they replaced"
run = '''
#!/usr/bin/env bash
set -euo pipefail
claude="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
dest="$claude/skills"
backups="$claude/playpen-skill-backups"
for name in address-review leave-review; do
rm -rf "$dest/$name"
if [ -d "$backups/$name" ]; then
mv "$backups/$name" "$dest/$name"
echo "restored the previous $name from the backup"
else
echo "removed $dest/$name"
fi
done
rmdir "$backups" 2>/dev/null || true
'''
[tasks.install]
description = "Install playpen into ~/.local with a desktop entry and icon"
depends = ["build"]