feat: add setup skill/hooks and update shadow (task 0018) #19
Reference in New Issue
Block a user
Delete Branch "task-0018-setup-skill-and-hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0018-setup-skill-and-hooks.mdSummary
Distributes gitea-axi's ambient context through explicit user actions (ADRs 0009 and 0013) — no postinstall script.
skills/gitea-axi/SKILL.md, shipped via a new"skills"entry inpackage.json'sfiles. It is a minimal pointer (trigger description, when-to-use overtea/raw API/git, command-group one-liners, and dashboard/--helpdiscovery pointers), not a command reference.gitea-axi setupinstalls the skill into~/.claude/skills/idempotently, reportinginstalled/updated/unchanged.gitea-axi setup hooksregisters a SessionStart hook (running the bare dashboard) for Claude Code, Codex, and OpenCode via the SDK'sinstallSessionStartHooks(), updating managed entries in place on re-run.gitea-axi updateshadows the SDK's built-in self-update: it fails withVALIDATION_ERRORand a help line pointing atnpm install -g gitea-axi@latest, so the SDK'sUPDATE_ERRORnever surfaces and the ten-code error list stays intact.Integration tests drive all three at the CLI seam against a temporary HOME, asserting the real skill file and the three managed hook configs are written and updated in place. These commands make no Gitea API calls, so there is no live-Gitea e2e case.
Deviations
setup hookspassesshouldInstall: () => truetoinstallSessionStartHooks(): the SDK's auto-install safety gate is tuned for an inferreddist/bin/<name>.jsentrypoint that gitea-axi does not use (its entrypoint isdist/main.js), and this is an explicit user command, so gating on the entrypoint layout is inappropriate.setupfor discoverability. That is not in this task's acceptance criteria and would touch task 0017'sdashboard.ts, so it is left as a follow-up;setupis currently discoverable via the top-level--help.Review
Risk
Overall: Medium
cli.ts; no existing behavior modified.package.jsonfilesentry); trivially revertible, no migrations or published-schema changes.updateare all covered.setup/setup hookswrite into~/.claude,~/.codex, and~/.config/opencode, modifying user agent config outside the repo.Standards / Spec findings left unaddressed
axiError(..., "VALIDATION_ERROR", ...)throw shape recurs acrosssetup.tsandlabel.ts. Left as-is: it is a pre-existing repo-wide dispatch pattern, not a diff-local defect, so it should be addressed repo-wide if at all.setupHooksuses an inlinestatus: "installed"string while the skill path has aSkillStatusunion type. Left as-is: the hooks status is an always-fixed literal, not a computed enum, so a shared type would be unwarranted ceremony.setupdiscovery hint from ADR 0009 — see the out-of-scope follow-up above.