🎯

hooks-builder

🎯Skill

from bsamiee/parametric_forge

VibeIndex|
What it does

Builds and configures lifecycle hooks for Claude Code, enabling deterministic automation across agent events with precise control and validation.

πŸ“¦

Part of

bsamiee/parametric_forge(19 items)

hooks-builder

Installation

Install ScriptRun install script
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
git cloneClone repository
git clone https://github.com/bsamiee/Parametric_Forge.git ~/Parametric_Forge
πŸ“– Extracted from docs: bsamiee/parametric_forge
3Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

>-

Overview

# [H1][HOOKS-BUILDER]

>Dictum: Deterministic behavior requires hooks; prompts fail execution guarantees.


Build Claude Code hooksβ€”shell commands execute at agent lifecycle events.

Tasks:

  1. Read [index.md](./index.md) β€” Reference file listing for navigation
  2. Read [lifecycle.md](./references/lifecycle.md) β€” Event table, input schemas, exit codes
  3. Read [schema.md](./references/schema.md) β€” Configuration structure, matchers, JSON responses
  4. (integration) Read [integration.md](./references/integration.md) β€” Environment variables, context injection
  5. (scripting) Read [scripting.md](./references/scripting.md) β€” Python standards, security patterns
  6. (recipes) Read [recipes.md](./references/recipes.md) β€” Proven implementation patterns
  7. (troubleshooting) Read [troubleshooting.md](./references/troubleshooting.md) β€” Known issues, platform workarounds
  8. (prose) Load style-standards skill β€” Voice, formatting, constraints
  9. Validate β€” Quality gate; see Β§VALIDATION

Scope:

  • Event Selection: Choose hook type by automation goal (blocking vs observing).
  • Configuration: Author settings.json entries with matchers and timeouts.
  • Response Handling: Control agent via exit codes, JSON responses, or prompt evaluation.

[REFERENCE]: [index.md](./index.md) β€” Complete reference file listing

---

[1][EVENT_SELECTION]

>Dictum: Automation goal determines hook type; blocking capability varies by event.


Decision Gate:

  • Intercept before execution? β†’ PreToolUse (validate/block/modify parameters)
  • Control permission dialogs? β†’ PermissionRequest (auto-approve/deny)
  • React after completion? β†’ PostToolUse (format, lint, add context)
  • Inject at session boundaries? β†’ SessionStart (context), UserPromptSubmit (per-message)
  • Evaluate task completion? β†’ Stop/SubagentStop (prompt type for LLM judgment)

Blocking vs Observing:

  • Blocking (exit 2): PreToolUse, PermissionRequest, PostToolUse, UserPromptSubmit, Stop, SubagentStop
  • Observing only: Notification, PreCompact, SessionStart, SessionEnd

---

[2][CONFIGURATION]

>Dictum: Centralized configuration enables scope-aware hook precedence.


| [INDEX] | [SCOPE] | [PATH] | [USE] | [GIT] |

| :-----: | ------- | ----------------------------- | -------------------- | :----: |

| [1] | User | ~/.claude/settings.json | Global, all projects | N/A |

| [2] | Project | .claude/settings.json | Shared, committed | Commit |

| [3] | Local | .claude/settings.local.json | Personal, testing | Ignore |

Precedence: Local > Project > User.

---

[3][IMPLEMENTATION]

>Dictum: Deterministic and evaluative patterns require distinct execution modes.


| [INDEX] | [TYPE] | [USE_CASE] | [TIMEOUT] | [CHARACTERISTICS] |

| :-----: | ------- | -------------------------------- | :-------: | ----------------------- |

| [1] | command | Validation, formatting, rules | 60s | Deterministic, fast |

| [2] | prompt | Complex evaluation, LLM judgment | 30s | Context-aware, flexible |

Prompt Type Scope: Stop and SubagentStop events only; Haiku provides fast LLM evaluation.

Guidance:

  • Command hooks β€” Deterministic scripts receive JSON stdin; return exit codes + optional JSON stdout.
  • Prompt hooks β€” LLM evaluates decisions; response schema: {"decision": "approve"|"block", "reason": "..."}.
  • Blocking β€” Exit code 2 blocks action; stderr routes to Claude. Exit 1 also blocks (known bug #4809).

---

[4][SCRIPTING]

>Dictum: Hook reliability requires functional pipeline patterns.


Python 3.14+ with strict typing. Zero imperative patterns.

---

[5][VALIDATION]

>Dictum: Gates prevent incomplete artifacts.


[VERIFY] Completion:

  • [ ] Event: Selected correct hook type for automation goal.
  • [ ] Schema: Configuration structure validated per schema.md.
  • [ ] Integration: Environment variables and context injection applied.
  • [ ] Scripting: Security patterns and tooling gates passed.
  • [ ] Quality: JSON syntax valid, timeouts appropriate.

[REFERENCE] Operational checklist: [β†’validation.md](./references/validation.md)