AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Hookify Create

skill-poorgramer-zack-copilot-cli-things-hookify-create · by Poorgramer-Zack

Hookify rule creation — analyze conversation for unwanted behaviors, generate `.local.md` rule files with regex patterns. Triggers on "create a hookify rule", "hookify this", "add a hook to prevent", "prevent behavior", or describing unwanted tool patterns.

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add skill-poorgramer-zack-copilot-cli-things-hookify-create

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-poorgramer-zack-copilot-cli-things-hookify-create)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Hookify Create? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Hookify - Create Hooks from Unwanted Behaviors

FIRST: Load the writing-rules skill using the skill tool to understand rule file format and syntax.

Create hook rules to prevent problematic behaviors by analyzing the conversation or from explicit user instructions.

Your Task

You will help the user create hookify rules to prevent unwanted behaviors.

Step 1: Gather Behavior Information

If $ARGUMENTS is provided:

  • User has given specific instructions: $ARGUMENTS
  • Still analyze recent conversation (last 10-15 user messages) for additional context
  • Look for examples of the behavior happening

If $ARGUMENTS is empty:

  • Launch the conversation-analyzer agent to find problematic behaviors
  • Agent will scan user prompts for frustration signals
  • Agent will return structured findings

To analyze conversation: Use the task/agent tool to launch conversation-analyzer agent:

{
  "subagent_type": "general-purpose",
  "description": "Analyze conversation for unwanted behaviors",
  "prompt": "You are analyzing a Copilot CLI conversation to find behaviors the user wants to prevent.

Read user messages in the current conversation and identify:
1. Explicit requests to avoid something (\"don't do X\", \"stop doing Y\")
2. Corrections or reversions (user fixing Copilot's actions)
3. Frustrated reactions (\"why did you do X?\", \"I didn't ask for that\")
4. Repeated issues (same problem multiple times)

For each issue found, extract:
- What tool was used (powershell, edit, create, etc.)
- Specific pattern or command
- Why it was problematic
- User's stated reason

Return findings as a structured list with:
- category: Type of issue
- tool: Which tool was involved
- pattern: Regex or literal pattern to match
- context: What happened
- severity: high/medium/low

Focus on the most recent issues (last 20-30 messages). Don't go back further unless explicitly asked."
}

Step 2: Present Findings to User

After gathering behaviors (from arguments or agent), present to user using ask_user:

Question 1: Which behaviors to hookify?

  • Header: "Create Rules"
  • multiSelect: true
  • Options: List each detected behavior (max 4)
  • Label: Short description (e.g., "Block rm -rf")
  • Description: Why it's problematic

Question 2: For each selected behavior, ask about action:

  • "Should this block the operation or just warn?"
  • Options:
  • "Just warn" (action: warn - shows message but allows)
  • "Block operation" (action: block - prevents execution)

Question 3: Ask for example patterns:

  • "What patterns should trigger this rule?"
  • Show detected patterns
  • Allow user to refine or add more

Step 3: Generate Rule Files

For each confirmed behavior, create a .github/hookify.{rule-name}.local.md file:

Rule naming convention:

  • Use kebab-case
  • Be descriptive: block-dangerous-rm, warn-console-log, require-tests-before-stop
  • Start with action verb: block, warn, prevent, require

File format:

---
name: {rule-name}
enabled: true
event: {bash|file|stop|prompt|all}
pattern: {regex pattern}
action: {warn|block}
---

{Message to show Copilot when rule triggers}

Action values:

  • warn: Show message but allow operation (default)
  • block: Prevent operation or stop session

For more complex rules (multiple conditions):

---
name: {rule-name}
enabled: true
event: file
conditions:
  - field: file_path
    operator: regex_match
    pattern: \.env$
  - field: new_text
    operator: contains
    pattern: API_KEY
---

{Warning message}

Step 4: Create Files and Confirm

IMPORTANT: Rule files must be created in the current working directory's .github/ folder, NOT the plugin directory.

Use the current working directory (where Copilot CLI was started) as the base path.

  1. Check if .github/ directory exists in current working directory
  • If not, create it first with: mkdir -p .github
  1. Use create tool to create each .github/hookify.{name}.local.md file
  • Use relative path from current working directory: .github/hookify.{name}.local.md
  • The path should resolve to the project's .github directory, not the plugin's
  1. Show user what was created:

``` Created 3 hookify rules:

  • .github/hookify.dangerous-rm.local.md
  • .github/hookify.console-log.local.md
  • .github/hookify.sensitive-files.local.md

These rules will trigger on:

  • dangerous-rm: powershell/execute commands matching "rm -rf"
  • console-log: Edits adding console.log statements
  • sensitive-files: Edits to .env or credentials files

```

  1. Verify files were created in the correct location by listing them
  1. Inform user: "Rules are active immediately - no restart needed!"

The hookify hooks are already loaded and will read your new rules on the next tool use.

Event Types Reference

  • bash: Matches powershell/execute tool commands
  • file: Matches edit, create tools
  • stop: Matches when agent wants to stop (use for completion checks)
  • prompt: Matches when user submits prompts
  • all: Matches all events

Pattern Writing Tips

Bash patterns:

  • Match dangerous commands: rm\s+-rf|chmod\s+777|dd\s+if=
  • Match specific tools: npm\s+install\s+|pip\s+install

File patterns:

  • Match code patterns: console\.log\(|eval\(|innerHTML\s*=
  • Match file paths: \.env$|\.git/|node_modules/

Stop patterns:

  • Check for missing steps: (check transcript or completion criteria)

Example Workflow

User says: "hookify-create Don't use rm -rf without asking me first"

Your response:

  1. Analyze: User wants to prevent rm -rf commands
  2. Ask: "Should I block this command or just warn you?"
  3. User selects: "Just warn"
  4. Create .github/hookify.dangerous-rm.local.md:

```markdown --- name: warn-dangerous-rm enabled: true event: bash pattern: rm\s+-rf ---

⚠️ Dangerous rm command detected

You requested to be warned before using rm -rf. Please verify the path is correct. ```

  1. Confirm: "Created hookify rule. It's active immediately - try triggering it!"

Important Notes

  • No restart needed: Rules take effect immediately on the next tool use
  • File location: Create files in project's .github/ directory (current working directory), NOT the plugin's .github/
  • Regex syntax: Use Python regex syntax (raw strings, no need to escape in YAML)
  • Action types: Rules can warn (default) or block operations
  • Testing: Test rules immediately after creating them

Troubleshooting

If rule file creation fails:

  1. Check current working directory with pwd
  2. Ensure .github/ directory exists (create with mkdir if needed)
  3. Use absolute path if needed: {cwd}/.github/hookify.{name}.local.md
  4. Verify file was created with glob or ls

If rule doesn't trigger after creation:

  1. Verify file is in project .github/ not plugin .github/
  2. Check file with read tool to ensure pattern is correct
  3. Test pattern with: python3 -c "import re; print(re.search(r'pattern', 'test text'))"
  4. Verify enabled: true in frontmatter
  5. Remember: Rules work immediately, no restart needed

If blocking seems too strict:

  1. Change action: block to action: warn in the rule file
  2. Or adjust the pattern to be more specific
  3. Changes take effect on next tool use

Use sql to track your progress through the steps.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.