create-hook — community create-hook, taskgraph, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Ideal for Cursor-based agents requiring customized lifecycle event handling and automation Task Graph is for Centaur Development

danalexilewis danalexilewis
[0]
[0]
Updated: 3/3/2026

Agent Capability Analysis

The create-hook skill by danalexilewis is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Ideal for Cursor-based agents requiring customized lifecycle event handling and automation

Core Value

Empowers agents to execute scripts at specific lifecycle events, leveraging hooks.json configuration and .cursor/hooks/ directory management, enabling seamless integration with project-level workflows

Capabilities Granted for create-hook

Registering hooks for agent initialization
Automating tasks on agent shutdown
Debugging agent events using custom hooks

! Prerequisites & Limits

  • Project-level hooks only
  • Requires .cursor/hooks/ and .cursor/hooks.json setup
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

create-hook

Install create-hook, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Create Hook

You (the lead) do the work. Do not dispatch sub-agents.

Type: Utility skill (procedural, no agentic lead or sub-agents).

Adds a Cursor lifecycle hook: a script that runs when a specific agent event fires. Hooks are project-level only (.cursor/hooks/ and .cursor/hooks.json).

1. Choose the lifecycle event

Register the hook under one of these keys in hooks.json:

EventWhen it runs
stopWhen the agent stops (end of turn)
afterFileEditAfter the agent edits a file
afterAgentResponseAfter the agent sends a response
beforeSubmitPromptBefore the user's prompt is submitted
beforeReadFile / afterShellExecution / etc.See Cursor docs for full list

2. Add the script

  • Path: .cursor/hooks/<name>.js (or .sh if shell). Use a clear name (e.g. memory-reminder.js, on-stop.js).
  • Runtime: Node.js is typical; command in hooks.json is run with Cursor's working directory set so that node hooks/<name>.js resolves (run from .cursor).
  • Input: The hook receives a single JSON object on stdin. Read it like this:
javascript
1let input = ""; 2process.stdin.setEncoding("utf8"); 3process.stdin.on("data", (chunk) => { 4 input += chunk; 5}); 6process.stdin.on("end", () => { 7 const payload = JSON.parse(input); 8 const roots = payload.workspace_roots || [process.cwd()]; 9 const root = path.resolve(roots[0]); // repo root 10 // ... use root for paths like path.join(root, '.cursor', 'next-step.md') 11});
  • Payload: Often includes workspace_roots (array of repo roots). Use the first root as the project root for paths. Event-specific payloads may include file_path, prompt, etc.
  • Output: Hook can write files (e.g. .cursor/next-step.md), log to stderr, or exit; avoid writing to stdout if the protocol expects JSON there.
  • Shebang: Start Node scripts with #!/usr/bin/env node.

3. Register in hooks.json

  • Path: .cursor/hooks.json
  • Format:
json
1{ 2 "version": 1, 3 "hooks": { 4 "stop": [ 5 { "command": "node hooks/on-stop.js" }, 6 { "command": "node hooks/my-new-hook.js" } 7 ] 8 } 9}
  • Append to the array for the chosen event; do not remove existing hooks unless the user asks to replace them.

Checklist

  • Script created under .cursor/hooks/<name>.js (or .sh)
  • Script reads JSON from stdin and uses workspace_roots for repo root when needed
  • Entry added to .cursor/hooks.json under the correct event key
  • Command is node hooks/<name>.js (or ./hooks/<name>.sh); path is relative to .cursor

Reference

  • Existing hooks in this repo: .cursor/hooks/on-stop.js, .cursor/hooks/after-file-edit.js, .cursor/hooks/memory-reminder.js — use them as patterns for stdin handling and path.join(root, ...).
  • Project memory (.cursor/memory.md) notes that new hooks should be added under .cursor/hooks/ and registered in .cursor/hooks.json.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is create-hook?

Ideal for Cursor-based agents requiring customized lifecycle event handling and automation Task Graph is for Centaur Development

How do I install create-hook?

Run the command: npx killer-skills add danalexilewis/taskgraph/create-hook. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for create-hook?

Key use cases include: Registering hooks for agent initialization, Automating tasks on agent shutdown, Debugging agent events using custom hooks.

Which IDEs are compatible with create-hook?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for create-hook?

Project-level hooks only. Requires .cursor/hooks/ and .cursor/hooks.json setup.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add danalexilewis/taskgraph/create-hook. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use create-hook immediately in the current project.

Related Skills

Looking for an alternative to create-hook or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI