Логотип Hatch3r Hooks

Hatch3r Hooks

Організація
hatch3r
hatch3r-hooks

Define, edit, and manage event-driven hooks that activate agents on project events. Tool-agnostic — adapters translate hook definitions into tool-native configurations during `npx hatch3r sync`.

Огляд

Видавецьhatch3r
Репозиторійhatch3r
Назва навичкиhatch3r-hooks
Зірки
26
Форки
7
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: hatch3r. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Hatch3r Hooks у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/hatch3r/hatch3r/tree/main/skills/hatch3r-hooks
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hatch3r/hatch3r.git /tmp/hatch3r
mkdir -p .claude/skills
cp -r /tmp/hatch3r/skills/hatch3r-hooks .claude/skills/hatch3r-hooks
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Hatch3r Hooks в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Hatch3r Hooks, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Hatch3r Hooks не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Hooks — Event-Driven Agent Activation

Quick Start

Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Discover current state
- [ ] Step 2: Define a hook (add) — select event, agent, conditions, write definition file
- [ ] Step 3: Edit an existing hook
- [ ] Step 4: Remove a hook
- [ ] Step 5: Sync hooks to tools

Step 0 — Detect Ambiguity (P8 B1)

Before any action, scan the user's request and provided context for unresolved questions in scope, acceptance criteria, irreversibility, or constraint conflicts (contradictory inputs, missing target, unknown convention). If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md — do not proceed under silent assumption. This is the default path, not an exception. Acceptable to proceed without asking ONLY when scope is single-target, single-concern, and the brief alone is testable. Any residual ambiguity discovered mid-workflow invokes the same protocol.

Learnings Consultation

If .hatch3r/learnings/ exists, scan for learnings related to hook configurations, event trigger patterns, or prior hook issues before starting.

Step 1: Discover Current State

  1. Check hooks/ for existing hook definition files (.md files with frontmatter).
  2. Read .hatch3r/hatch.json for configured tools and features.
  3. List existing hooks with their event, agent, and conditions.

Present the current state:

Current Hooks: {list with id, event, agent — or "none"}
Configured Tools: {tools from hatch.json}
Hooks Feature: {enabled/disabled}

ASK: "Current hooks: {list or 'none'}. Tools: {list}. What would you like to do? (a) Add a new hook, (b) Edit existing hook, (c) Remove a hook, (d) List all hooks, (e) Sync hooks to tools"

Step 2: Define Hook

For adding a new hook:

2a. Select Event

Present available events with descriptions:

EventDescriptionUse Cases
pre-commitTriggered before a commit is createdLint checks, secret scanning, test running
post-mergeTriggered after a branch mergeDependency updates, migration checks, notification
ci-failureTriggered when CI/CD pipeline failsAuto-diagnosis, fix suggestions
file-saveTriggered when a file is savedAuto-formatting, auto-testing, live validation
session-startTriggered when a new coding session startsContext loading, status checks
pre-pushTriggered before pushing to remoteFull test suite, build verification
pre-implementationTriggered before implementing a sub-issueContext loading, spec review, learning consultation
post-implementationTriggered after implementing a sub-issueLearning capture, code quality check, doc updates
pre-reviewTriggered before code review startsChecklist generation, context preparation
post-reviewTriggered after code review completesFix tracking, learning capture, approval notifications
pre-releaseTriggered before a release workflowChangelog verification, version validation, dependency audit
post-releaseTriggered after a release completesMonitoring setup, notification, deploy verification
pre-testTriggered before test executionTest environment setup, fixture preparation
post-testTriggered after test execution completesCoverage reporting, flaky test detection, result analysis
on-errorTriggered when any workflow step failsError diagnosis, auto-retry, escalation, incident logging
on-context-switchTriggered when agent context is refreshed or delegatedState persistence, handoff documentation
on-dependency-changeTriggered when dependencies are added/updated/removedSecurity audit, compatibility check, license validation
on-security-findingTriggered when a security issue is discoveredAlert escalation, auto-fix suggestions, incident creation

[!IMPORTANT] Claude Code only maps session-start → SessionStart semantically. Every other event above (pre-commit, post-merge, ci-failure, file-save, pre-push, etc.) is a git/project lifecycle event with NO native Claude Code mapping — the adapter emits a no-op or alternative strategy, NOT a PreToolUse/PostToolUse binding. If the user picks one of these and targets Claude Code, say so before writing the definition. Full detail: the "Claude Code event mapping" note in Step 2d below.

ASK: "Select an event for this hook."

2b. Select Agent

First run ls agents/ to read the current agent roster. The list below is the canonical set at authoring time, but agents may be added or renamed — verify each id against the live roster before presenting, and drop any that no longer resolve to agents/<id>.md. Present available hatch3r agents (every id below carries the hatch3r- prefix and must exist as agents/<id>.md):

  • hatch3r-lint-fixer — Automatic lint error resolution
  • hatch3r-testability — Test generation for new or changed code
  • hatch3r-reviewer — Code review and quality checks
  • hatch3r-security — Security vulnerability scanning
  • hatch3r-ci-watcher — CI/CD pipeline monitoring and diagnosis
  • hatch3r-ui — Accessibility and UI-quality checks
  • hatch3r-performance — Performance analysis and optimization
  • hatch3r-dependency-drafter — Dependency security and update checks
  • hatch3r-docs-writer — Documentation generation and updates

If the user names an agent not shown, confirm it against the ls agents/ roster: accept a real id, and warn that any name absent from agents/ must be created there before the hook can fire. The agent: value is emitted verbatim into the hook definition — no id normalization resolves a short or misspelled name, so a value that is not an exact agents/<id>.md id activates nothing.

ASK: "Select an agent to activate when this event fires."

2c. Define Conditions (Optional)

  • Glob patterns: Which files trigger this hook (e.g., src/**/*.ts, *.css)
  • Branch patterns: Which branches (e.g., main, release/*)

ASK: "Add conditions? (glob patterns, branch patterns, or skip for 'always activate')"

2d. Write Hook Definition File

Generate the hook definition file at hooks/{event}-{agent-short-name}.md:

markdown
---
id: {event}-{agent-short-name}
type: hook
event: {selected-event}
agent: {selected-agent}
description: {user-provided or auto-generated description}
globs: {comma-separated glob patterns, if any}
branches: {comma-separated branch patterns, if any}
---
# Hook: {event} → {agent}

{Description of what this hook does and when it activates.}

## Activation

- **Event:** {event}
- **Agent:** {agent}
- **Conditions:** {glob patterns, branch patterns, or "always"}

## Tool-Specific Behavior

- **Claude Code:** For session-start → SessionStart. For pre-commit, post-merge, ci-failure, file-save, pre-push: no native mapping — adapter may use no-op or alternative strategy (see mapping note below).
- **Cursor:** Maps to glob-based rule activation in `.cursor/rules/`
- **Others:** Hook definition stored; sync when adapter support is added

Claude Code event mapping: Claude Code's native hook events (PreToolUse, PostToolUse, SubagentStart, SessionStart) are tool-lifecycle events and do NOT map to git/project events. PreToolUse fires before every tool call; PostToolUse fires after every tool completes; SubagentStart fires when a subagent spawns. Only session-start → SessionStart is semantically correct. For pre-commit, post-merge, ci-failure, file-save, and pre-push, the Claude Code adapter may use a no-op or alternative strategy (e.g., Cursor rules) — do not map these to PreToolUse/PostToolUse/SubagentStart, as that would cause hooks to fire on every tool invocation instead of the intended event.

ASK: "Hook definition: {summary}. Create? (yes / adjust / cancel)"

Step 3: Edit Existing Hook

For editing an existing hook:

  1. List all hooks and ask which to edit.
  2. Show current definition.
  3. Ask what to change (event, agent, conditions, description).
  4. Update the hook file in hooks/.

ASK: "Updated hook: {summary}. Save? (yes / revert / cancel)"

Step 4: Remove a Hook

  1. List all hooks and ask which to remove.
  2. Show the hook definition.

ASK: "Remove hook '{id}'? This will delete hooks/{filename}. (yes / cancel)"

  1. Delete the file. Warn that tool-specific generated files (e.g., .cursor/rules/hatch3r-hook-*.mdc) will be cleaned up on the next npx hatch3r sync.

Step 5: Sync Hooks to Tools

  1. Read all hook definitions from hooks/.
  2. For each configured tool in hatch.json, describe what will be generated:
    • Claude Code: Hook documentation appended to managed section of CLAUDE.md
    • Cursor: Glob-based .mdc rule files in .cursor/rules/hatch3r-hook-*.mdc
    • Others: No-op (hook definitions stored for future adapter support)
  3. Present the list of files that will be generated/updated.

[!IMPORTANT] For Claude Code, only session-start becomes an executable native hook. Git/project-event hooks (pre-commit, post-merge, ci-failure, file-save, pre-push, etc.) are written to CLAUDE.md as documentation, NOT registered as native Claude Code hooks — they do not fire on the named event. State this explicitly when listing the generated Claude Code output (see the "Claude Code event mapping" note in Step 2d).

ASK: "Hooks will generate these files: {list}. Run npx hatch3r sync to apply. (understood / sync now)"

If user chooses "sync now", instruct them to run npx hatch3r sync in the terminal.

Hook Definition Schema (implemented surface)

A hook is a single canonical artifact: one event fires one agent, optionally narrowed by conditions. The fields below are the complete config that adapters honor today (src/hooks/types.ts HookDefinition + HookCondition):

FieldRequiredMeaning
idyesUnique hook identifier (sanitized for shell safety).
eventyesLifecycle event from the events table in Step 2a.
agentyesAgent ID dispatched when the event fires.
descriptionyesHuman-readable purpose.
globsnoFile glob patterns — hook fires only when matching files are affected.
branchesnoBranch name patterns — hook fires only on matching branches.
labelsnoIssue/PR labels — hook fires only when matching labels are present.

There is no chaining, custom-event, priority, timeout, or parallel-by-priority config: each hook is independent, the adapter emits one tool-native entry per hook, and ordering across multiple hooks on the same event is the tool's own (Claude Code stacks matcher entries; Cursor stacks .cursor/hooks.json entries). Do not author hooks.chains, hooks.customEvents, emit-hook, priority:, or timeout: — no code consumes them.

Error Handling

  • hooks/ doesn't exist: create it automatically.
  • Invalid event type: warn and show the valid events table.
  • Agent not found in agents/: warn but allow (agent may be added later).
  • Adapter doesn't support hooks: generate hook definition file anyway, warn that sync for that tool is a no-op.
  • Duplicate hook ID: warn and ask the user to choose a different name or overwrite.

Guardrails

  • Never skip ASK checkpoints.
  • Hook definitions are tool-agnostic — the adapters handle translation.
  • Never delete hook files without explicit user confirmation.
  • Always validate event names against the known events list.
  • Hook IDs must be unique across all hook definitions.
  • The skill creates hook DEFINITIONS only — actual hook registration happens via npx hatch3r sync.
  • Do not modify adapter output files directly — they are managed by the sync pipeline.

Поширені запитання

Що робить навичка ШІ Hatch3r Hooks?

Define, edit, and manage event-driven hooks that activate agents on project events. Tool-agnostic — adapters translate hook definitions into tool-native configurations during `npx hatch3r sync`.

Навіщо використовувати Hatch3r Hooks у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Hatch3r Hooks — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Hatch3r Hooks у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/hatch3r/hatch3r/tree/main/skills/hatch3r-hooks. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Hatch3r Hooks?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Hatch3r Hooks?

Зі скількома забажаєте. У TypingMind ви можете використовувати Hatch3r Hooks із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Hatch3r Hooks?

Так. На GitHub цю навичку публікує hatch3r за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇