test-v174-hook-count

Verify that a PostToolUse hook fires once for a Write matcher.

3|1|Updated Dec 2, 2024
One-click install
npx skills add https://github.com/faisalanjum/EventTrader --skill test-v174-hook-count
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-v174-hook-count
Source: https://github.com/faisalanjum/EventTrader/tree/main/.claude/skills/test-v174-hook-count
Command: npx skills add https://github.com/faisalanjum/EventTrader --skill test-v174-hook-count

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill is designed to test and verify a fix for a bug where skill hooks might fire more than once.

Core Features & Use Cases

  • Hook Execution Verification: Ensures that specific hooks, like PostToolUse, are triggered exactly once when expected.
  • Bug Regression Testing: Acts as a safeguard against the reintroduction of the double-firing bug in future updates.
  • Use Case: After a code change intended to fix hook behavior, this skill can be run to confirm the fix is effective and no longer causes hooks to execute multiple times.

Quick Start

Run the test-v174-hook-count skill to verify the hook execution count.

Frequently Asked Questions about test-v174-hook-count

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

FAQPage Schema
Why does my PostToolUse hook fire multiple times for a single Write tool execution?

A double-fire bug in skill hooks causes the PostToolUse hook to trigger more than once for a single Write matcher. This skill verifies the execution count and validates the fix by checking a counter file to confirm the hook triggers only once.

How do I verify a hook execution count fix after debugging my automation script?

To verify a hook execution count fix, run this test skill to validate that the PostToolUse hook executes exactly once for a Write matcher. It checks the counter file and reports whether the hook double-firing is resolved.

What is hook double-firing in testing and how do scripts detect it?

Hook double-firing in testing occurs when a hook like PostToolUse executes multiple times for one event. Scripts detect it by writing to a counter file on each execution and then checking the final count to verify it matches the expected single trigger.

Can I use this hook verification test as a regression safeguard for future updates?

Yes, you can use this hook verification test as a regression safeguard. Running it after code changes confirms the PostToolUse double-fire fix remains effective and prevents the bug from reappearing in future updates.

What do I need to set up before testing PostToolUse hook execution counts?

Before testing PostToolUse hook execution counts, you need the hook configured with a Write matcher and a counter file to track triggers. The test skill then runs the verification and reports the outcome based on the counter file's value.