Skip to content

Event-Driven Hooks Patterns #1269

Description

@ashleyshaw

Overview

Create docs/HOOKS_STANDARDS.md — event-driven hooks for agents, skills, and automation with idempotency and error resilience patterns.

Research & Content Creation

Planning Reference:

Research Prompt:

Document hooks standards. Create:

  1. Hook concept — Event-driven automation and handlers
  2. Hook types:
    • Startup/shutdown (initialization & cleanup)
    • Before-run/after-run (pre/post execution)
    • On-error (error handling)
    • On-success (success logging)
    • Custom hooks
  3. Folder structurehooks/{name}.js or hooks/{category}/{name}.js
  4. Hook implementation:
    • Function signature & context
    • Return values
    • Error handling (throw vs. warn vs. ignore)
    • Idempotency (safe to run multiple times)
  5. Hook registration — Agent config, workflows, plugins
  6. Best practices:
    • Idempotent design
    • Error resilience
    • Performance (avoid long operations)
    • Logging & observability
    • Testing hooks
  7. Real examples — From repo (branch-validation, template-enforcement)
  8. Anti-patterns — What NOT to do

Mermaid diagrams (2-3 required):

  • Hook lifecycle: event trigger → hook execution → result
  • Hook types & their triggers

Definition of Ready

  • Planning reviewed
  • Real hook examples from repo identified

Definition of Done

File: docs/HOOKS_STANDARDS.md
Epic: #1261 | PR: #1251

Metadata

Metadata

Assignees

Fields

Priority

None yet

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions