agentleFS
MacHatter1MacHatter1/bb-plugin-hooks/skills/create-hook/SKILL.md

create-hook

Skill4 starsChanged 47 days agoMITView on GitHub

Guide the user from an idea ("tell me when a thread needs me", "block messages that mention production") to a working BB hook. Use when a thread is opened from the Hooks page's New hook button, when the user asks to create, set up, or automate a hook, or when they describe something that should happen automatically on a BB thread event. Ends with a tested, installed hook.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-bugbot, update-cli-config and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • 0mlkrizzz655335vSkill

    review-bugbot

    缺陷导向代码审查。用 Bugbot 子代理找 bug。

    Also in 5 projects that use this

  • PandelisZSkill

    update-cli-config

    View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.

    Also in 7 projects that use this

  • 32103210Skill

    migrate-to-skills

    Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.

    Also in 7 projects that use this

  • 32103210Skill

    update-cursor-settings

    Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.

    Also in 7 projects that use this

  • 0mlkrizzz655335vSkill

    origin

    origin CLI 管理。安装、登录、更新、修复 origin.cursor.com 的 CLI。"disabled-environments:

    Also in 3 projects that use this

  • Tsumugii24Skill

    split-to-prs

    Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.

    Also in 7 projects that use this

  • +2 more from 32103210
  • +2 more from 0mlkrizzz655335v

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the user has not said what should happen and when, ask, briefly:

    line 14
  2. Very specific:

    When: should it fire? Map their words to an event with bb hooks events: "finished" → thread.idle, "needs me / waiting" → …

    line 16
  3. Distinctive:

    What: should happen? A notification, a message to a service, a shell command, a follow-up thread, or a decision to block or hold a message.

    line 20
  4. Distinctive:

    Ask at most one round of questions.

    line 25
  5. Very specific:

    Run bb hooks templates --search <words> (also bb hooks marketplace search).

    line 30
  6. Very specific:

    If a template fits, install it with bb hooks use <ref> --set key=value …, adding --event, --title, --project, --text filters as needed.

    line 31
  7. Distinctive:

    Ask the user which they want when it matters, for example a reviewer on a different provider than the author.

    line 59
  8. Distinctive:

    Read the output; fix the command until it does what the user asked.

    line 65
  9. Distinctive:

    Do not install more than the user asked for.

    line 72

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “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

Create a hook with the user

You are turning a plain-language wish into an installed, tested hook. Work with the bb hooks CLI only; never edit the plugin's storage or settings files by hand. The user can watch the result appear on the Hooks page.

1. Understand what they want

If the user has not said what should happen and when, ask, briefly:

  • When should it fire? Map their words to an event with bb hooks events: "finished" → thread.idle, "needs me / waiting" → interaction.pending, "broke / failed" → thread.failed or turn.failed, "before a message goes to the agent" → message.dispatch (a gate).
  • What should happen? A notification, a message to a service, a shell command, a follow-up thread, or a decision to block or hold a message.
  • Which threads? Everything, or only some project, provider, or a title or text pattern.

Ask at most one round of questions. Prefer sensible defaults and say what you assumed.

2. Prefer a template

Run bb hooks templates --search <words> (also bb hooks marketplace search). If a template fits, install it with bb hooks use <ref> --set key=value …, adding --event, --title, --project, --text filters as needed. Credentials belong in --set values for secret params (stored encrypted) or in bb hooks secrets set <name> <value>; never paste a token into a command. A template from a catalog needs --yes; before adding it, show the user what bb hooks templates <ref> prints under "What it runs".

3. Otherwise write the hook

bb hooks add <id> --event <event> --command '<sh>' or --url <https://…>.

  • Commands run with /bin/sh on the machine hosting BB. The event arrives as JSON on stdin; BB_THREAD_TITLE, BB_THREAD_ID, BB_PROJECT_ID, BB_HOOK_EVENT, BB_SERVER_URL and BB_CLI (the bb binary) are in the environment. Use {{secret:name}} for credentials.
  • Webhooks: add --header 'name=value' and let the plugin send the event JSON, or shape it with a body template via bb hooks edit <id> --url … (bodies use {{thread.title}}, {{lastAssistantText|500}}).
  • Gate hooks (message.dispatch): exit 0 proceeds, 2 rejects with stderr as the reason, 3 queues; must answer within 8 seconds; use --on-error to choose what happens if the command fails.
  • Chaining agents: call "$BB_CLI" thread spawn … from the command; the follow-up and review templates show the pattern, including the guard that stops chains after one hop. Their agent setting decides who runs the new thread: --set agent=inherit (same provider, model and reasoning as the triggering thread; the plugin passes them as BB_MODEL, BB_REASONING_LEVEL, BB_SERVICE_TIER), --set agent=codex (a provider with its default model), or --set agent='{"providerId":"codex","model":"gpt-5.5","reasoningLevel":"high"}'. Ask the user which they want when it matters, for example a reviewer on a different provider than the author.

4. Test, then hand over

  1. bb hooks test <id> (add --thread $BB_THREAD_ID for a real payload). Read the output; fix the command until it does what the user asked.
  2. For a gate, test both directions: a message that should pass and one that should not.
  3. bb hooks show <id> and tell the user, in two or three sentences: what fires when, where to see runs (Hooks → Installed), and how to disable or remove it (bb hooks disable <id>, bb hooks remove <id>).

Do not install more than the user asked for. Do not leave test hooks behind.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.