Index of every page on this site: llms.txt
All skills
dominiktobureto avatar

/hooksmith

@9125e02
Run it yourself

Use when designing or reviewing safe Grok Build hooks for linting, tests, formatting, notifications, command guards, lifecycle automation, or project hook trust decisions.

Use this Skill: https://skilld.dev/gh/dominiktobureto/awesome-grok-build/hooksmith

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈46 tokens for metadata: the name and description. ≈635 when used: this file. ≈1.1k more on demand in 1 file.

Description uses 2.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈183 characters, or 2.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Hooksmith

Design hooks as deterministic safety rails around agent work.

Grok Build Mode

  • Start with read-only analysis unless the user explicitly asks to create hook files.
  • Use Plan Mode before adding project hooks because Grok requires trust for .grok/hooks/.
  • Use subagents for hook reviews:
    • security: command injection, secrets, network exfiltration.
    • dx: runtime, noise, failure messages.
    • portability: Windows/macOS/Linux shell compatibility.
  • Arena-style comparison: compare 2-3 hook designs and choose the least powerful one that solves the workflow.

Mental Model

Hooks are automation triggered by agent lifecycle or tool events. They should be boring, transparent, and easy to disable.

Workflow

  1. Identify the event that should trigger the hook.
  2. Decide whether the hook should be:
    • read-only check;
    • formatter;
    • test runner;
    • notification;
    • policy guard.
  3. Prefer the smallest command that proves the intended condition.
  4. Document:
    • trigger event;
    • command;
    • files touched;
    • expected runtime;
    • failure behavior;
    • how to disable it.
  5. If the hook mutates files, make the mutation obvious and limited.

Safe Hook Ideas

  • After edit: run formatter on touched files.
  • After edit: run lint on touched files.
  • Before shell command: block commands matching dangerous patterns.
  • Stop event: summarize changed files and verification status.
  • Notification: send a local desktop notification when a long task completes.

Auto Lint/Test Pattern

Prefer repository-native commands discovered from config files:

  1. Find lint/test/typecheck commands.
  2. Start with a reporting hook.
  3. Add auto-format only after the team trusts it.
  4. Keep runtime short enough that agents do not learn to ignore it.

Red Flags

  • Hooks that run network commands without explanation.
  • Hooks that read .env or credential stores.
  • Hooks that rewrite broad directories.
  • Hooks that auto-commit or push.
  • Hooks that hide output from the user.

Example Prompts

Use hooksmith to design a read-only post-edit lint hook. Discover the repo's actual lint command and explain trust risks.
Review these Grok hooks before /hooks-trust. Flag secrets, network calls, broad file writes, and cross-platform problems.

Output Format

Hook: <name>
Trigger: <event>
Command: <command>
Risk: <low/medium/high>
Files touched: <none/list>
Failure behavior: <what happens>
Trust note: <why /hooks-trust is or is not appropriate>

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts4mo3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    The skill provides a framework for creating and auditing automation hooks in a development environment. It promotes security through a manual trust model and safety checklists. A potential issue was identified in the example scripts, which use shell variables like file names without proper quoting or escaping, creating a surface for command injection if the environment contains maliciously crafted file names.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: LOW · No issues

Signed by skilld at 9125e02. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago
version
2.0.0
author
awesome-grok-build

README badge

README badge for dominiktobureto/awesome-grok-build/hooksmith