agentleFS
MrCipherSmithMrCipherSmith/goodai-base/skills/hookify/SKILL.md

hookify

Skill0 starsChanged 5 months agoMITView on GitHub

Use when adding automated hook behavior to Claude Code or Cursor from a natural language description.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create agent hooks from natural language descriptions.

    line 20
  2. Distinctive:

    Check for existing hooks to avoid conflicts.

    line 42
  3. Distinctive:

    Verify command exists and is executable

    line 61
  4. Distinctive:

    Test standalone if safe

    line 62
  5. Distinctive:

    Check for conflicts with existing hooks

    line 63
  6. Distinctive:

    After confirmation, merge into settings.

    line 75
  7. Distinctive:

    Notify on done: Stop → notification command

    line 92
  8. Distinctive:

    ALWAYS preview before applying

    line 96
  9. Distinctive:

    NEVER overwrite existing hooks — merge or ask

    line 97
  10. Distinctive:

    Keep timeouts reasonable (10-60s)

    line 98
  11. Distinctive:

    Test commands before adding as hooks

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Hookify

Create agent hooks from natural language descriptions.

Arguments

  • /hookify <description> — create hook from description
  • /hookify --list — show all current hooks
  • /hookify --remove <event> — remove a hook

Workflow

Step 1: Parse Request

Understand from natural language:

  • When: what event triggers it (before edit, after bash, on stop)
  • What: what should happen (run command, check, notify)
  • Condition: optional matcher (specific tool, file pattern)

Examples:

  • "Run lint after every file edit" → PostToolUse + Edit matcher + lint command
  • "Notify me when done" → Stop + notification command
  • "Check types before committing" → PreToolUse + Bash(git commit) + tsc

Step 2: Read Current Settings

Check for existing hooks to avoid conflicts.

Step 3: Generate Hook Config

{
  "hooks": {
    "<event>": [
      {
        "matcher": "<tool name or pattern>",
        "command": "<shell command>",
        "timeout": 60000
      }
    ]
  }
}

Step 4: Validate

  1. Verify command exists and is executable
  2. Test standalone if safe
  3. Check for conflicts with existing hooks

Step 5: Preview & Apply

🔧 New hook:
  Event: PostToolUse (Edit)
  Command: npm run lint --fix
  Timeout: 30s

Add to settings.json? [confirm]

After confirmation, merge into settings.

Hook Event Reference

EventWhenMatcher
PreToolUseBefore tool runsTool name: Edit, Bash, Write
PostToolUseAfter tool runsTool name
NotificationAgent notifies—
StopResponse complete—
SubagentStopSub-agent done—

Common Patterns

  • Auto-lint: PostToolUse(Edit) → eslint --fix $FILE
  • Auto-format: PostToolUse(Write) → prettier --write $FILE
  • Type-check gate: PreToolUse(Bash:git commit) → npx tsc --noEmit
  • Notify on done: Stop → notification command

Rules

  • ALWAYS preview before applying
  • NEVER overwrite existing hooks — merge or ask
  • Keep timeouts reasonable (10-60s)
  • Warn if hook could slow down every tool call
  • Test commands before adding as hooks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.