Skip to content

notque/vexjoy-agent / skills/meta/do

Classify user requests and route to the correct skill, pipeline, and stack. Primary entry point for all delegated work.

references/hooks-guide.md

View on GitHub
# Hooks System

## Event Types

| Event | When Fires | Use Case |
|-------|------------|----------|
| `SessionStart` | Session begins | Load context, sync files |
| `UserPromptSubmit` | Before processing prompt | Inject context, score the pending routing outcome |
| `PreToolUse` | Before tool execution | Gate dangerous ops, warm-start subagents |
| `PostToolUse` | After tool execution | Record routing decisions, lint, security scan |
| `PreCompact` | Before context compression | Archive the session transcript |
| `PostCompact` | After context compression | Re-inject plan context |
| `SubagentStart` | Before a subagent starts | Inject parent-session context |
| `SubagentStop` | After subagent finishes | Enforce branch safety, reviewer contracts |
| `StopFailure` | Session ends with error | Record the failure as a routing outcome |
| `Stop` | After every turn | Generate summary, score errored or stale (over 6 hours) routing outcomes |
| `SessionEnd` | Session ends | Resolve every routing outcome still pending |

## Key Hook Features

| Feature | Description |
|---------|-------------|
| `once: true` | Hook runs only once per session |
| `timeout` | Maximum execution time in ms |
| Cascading output | Hooks can inject context into prompts |

## Routing outcome capture

The routing hooks automatically:
1. Record each dispatch as `{agent}:{skill}` at `PostToolUse:Agent` (or `PostToolUse:invoke_subagent|run_workflow` on Antigravity CLI via `hooks/agy-hook-adapter.py`)
2. Mark the outcome pending at `SubagentStop`
3. Score it on the next user turn (`UserPromptSubmit` / `PreInvocation`): failure on errors or rejection, success on explicit acceptance, neutral otherwise
4. Fall back to a `Stop`-time score when no user turn follows

## Antigravity CLI (`agy`) Hook Translation

On Antigravity CLI (`~/.gemini/config/hooks.json`), `scripts/generate-agy-hooks-json.py` compiles `scripts/agy-hooks-allowlist.txt` into the `"vexjoy-agent"` hook group and routes every hook through `hooks/agy-hook-adapter.py`:
- **Flat events** (`SessionStart`, `PreInvocation`, `PostInvocation`, `Stop`) emit `injectSteps` or continuation decisions (`{"decision": "continue", "reason": "..."}` for `/goal` and drift guards).
- **Grouped events** (`PreToolUse`, `PostToolUse`) match native Antigravity tool names (`run_command`, `write_file`, `edit_file`, `read_file`, `invoke_subagent`, `run_workflow`) and translate them to Claude tool contracts (`Bash`, `Write`, `Edit`, `Read`, `Agent`, `Workflow`).
- **Deferred `PostToolUse` advisories**: Because Antigravity requires `PostToolUse` stdout to be `{}` (`EmptyHookOutput`), `hooks/agy-hook-adapter.py` queues `PostToolUse` advisory outputs per `conversationId` and drains them as `injectSteps` on the next `PreInvocation`.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall