create-hooks

Configure Opencode hooks for event-driven workflows across PreToolUse, PostToolUse, Stop, and SessionStart events.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/aaronvstory/taches-oc-prompts-opencode --skill create-hooks-aaronvstory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hooks
Source: https://github.com/aaronvstory/taches-oc-prompts-opencode/tree/main/skills/create-hooks
Command: npx skills add https://github.com/aaronvstory/taches-oc-prompts-opencode --skill create-hooks-aaronvstory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Streamline automation by creating, configuring, and maintaining Opencode hooks to automate responses to tool usage, events, and workflows.

Core Features & Use Cases

  • Create and configure PreToolUse, PostToolUse, Stop, and other hooks to enforce validation, logging, and context injection.
  • Provide patterns and templates for common use cases, including matcher patterns, input/output schemas, and safe defaults.
  • Reference a library of example configurations and best practices to accelerate hook implementation.

Quick Start

Create a new hooks file at .config/opencode/hooks.json and copy the recommended templates to begin defining event-driven actions.

Frequently Asked Questions about create-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate workflows with Opencode hooks?

Configure Opencode hooks in a .config/opencode/hooks.json file to automate event-driven workflows. This approach enables automated input validation, logging, notifications, and session context injection across PreToolUse and PostToolUse events.

What is a PreToolUse hook used for in event handling?

A PreToolUse hook handles event-driven validation by intercepting tool actions before execution. It enforces safe patterns and input validation to ensure robust, production-ready automated workflows.

Can I inject session context automatically when a session starts?

Yes, you can inject session context automatically by configuring a SessionStart hook. This event-driven pattern populates necessary context immediately when an Opencode session initializes.

How do I configure matcher patterns for Opencode event hooks?

Configure matcher patterns for Opencode event hooks by applying provided templates and input schemas to your hooks configuration. These patterns ensure hooks trigger safely for specific tool events.

What are the limitations or safe patterns for building production-ready hooks?

Production-ready hooks require adhering to safe default patterns to prevent workflow disruptions. Limitations include ensuring matchers are precise and avoiding unsafe configurations that bypass intended validation or logging behaviors.