More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Turn Markdown Rules into Deterministic Claude Code Hooks

    1

    This package helps you turn one repeatable failure into a reviewed checklist, warn, or block gate, and check it against allowed and blocked examples before you install anything.

    $25

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Turn Markdown Rules into Deterministic Claude Code Hooks

    Turn Markdown Rules into Deterministic Claude Code Hooks

    Example session with this skill installed

    Run the hook harness on the included sample cases and tell me which PreToolUse and Stop cases pass, and what each one proves.

    • Read your context and instructions
    • Compiled the turn markdown rules

    Summary

    The harness ran 11 cases against the two included templates. All 11 passed, so each blocked case was blocked and each allowed case was allowed.

    HookHarness: sample_hook_cases.json | total=11 | passed=11 | failed=0 | status=PASS
    Cases:
    - [PASS] pretooluse_block_deep_url (expected=2, actual=2) -> PreToolUse blocked a direct deep link
    - [PASS] pretooluse_allow_root_and_localhost (expected=0, actual=0) -> PreToolUse allowed a trusted entry or local address
    - [PASS] stop_block_unbacked_future_declaration (expected=2, actual=2) -> Stop caught an unexecuted future action
    - [PASS] stop_allow_quoted_or_past_report (expected=0, actual=0) -> Stop exempted a past-tense report and quoted text
    - [PASS] stop_allow_when_stop_hook_active_true (expected=0, actual=0) -> Stop exited cleanly to prevent a loop
    - [PASS] stop_warn_non_gate_permission_ask (expected=0, actual=0) -> Warn reports a routine review and allows work to continue
    - [PASS] stop_transcript_blocks_unbacked_future_declaration (expected=2, actual=2) -> Stop reads the final assistant text from transcript_path
    - [PASS] stop_transcript_allows_same_message_tool_use (expected=0, actual=0) -> A tool_use block in the final assistant message is evidence
    - [PASS] stop_transcript_active_prevents_loop (expected=0, actual=0) -> An active Stop hook exits before transcript inspection
    - [PASS] stop_transcript_skips_malformed_lines_and_allows_when_empty (expected=0, actual=0) -> Malformed lines are skipped and absent assistant text fails open
    - [PASS] stop_prefer_last_assistant_message_input (expected=2, actual=2) -> A provided final assistant message takes precedence
    Summary: 11 cases run, 11 passed, 0 failed
    

    Next steps

    • Pick one narrow rule and choose checklist, warn, or block.
    • Create a starter with scripts/rule_to_hook_scaffold.py in a new directory.
    • Add one blocking case and one allowed case, then run the harness with --hook path/to/hook.py.
    • Review any settings change by hand and keep a rollback copy.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    For Claude Code developers whose written rules keep slipping. This package helps you turn one repeatable failure into a reviewed checklist, warn, or block gate, and check it against allowed and blocked examples before you install anything.

    What you get

    • Four guides: strength selection, pre-action checks, stop checks, and a test-first rollout
    • scripts/rule_to_hook_scaffold.py: creates a reviewable starter kit without overwriting files
    • scripts/hook_harness_check.py: runs named fixtures against the included templates and prints text, JSON, CSV, or Markdown
    • Hook templates: a PreToolUse guard, a Stop guard, and a settings snippet
    • 29 offline self-tests using synthetic hook events and transcripts
    • Synthetic examples, including the byte-for-byte output of the first command below

    How it works

    1. Read the guides and choose a strength for one narrow rule.
    2. Run the scaffold in a new output directory.
    3. Replace the TODO checks with project-specific ones and add blocking and allowed cases.
    4. Run the harness before reviewing any settings change by hand.
    5. Keep a rollback copy and lower the strength if valid work is blocked.

    Quick check

    python3 scripts/hook_harness_check.py --cases examples/sample_hook_cases.json --format text --strict
    

    The quick check uses only the included sample data and does not read your project settings.

    Limits

    The included Stop example checks English phrases only, for example "I will fix this next" and "May I continue?". It does not detect equivalent Japanese phrasing. The templates demonstrate observable checks, not complete security enforcement, and they do not replace permission controls, process isolation, or human review. Complex shell syntax, paraphrase, and semantic intent are outside the example checks. A generated scaffold is a starting point: you review, implement, test, and install each hook yourself.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Prompt & Skill Engineering.

    The included Stop example checks English phrases only (for example "I will fix this next" and "May I continue?"); it does not detect equivalent Japanese phrasing or every paraphrase. The templates demonstrate observable checks and are not complete security enforcement: they do not replace permission controls, process isolation, or human review. Complex shell syntax and semantic intent are outside the example checks. Each generated hook needs your own review, tests, and manual installation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    Python 3.9+

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables
    Listedtoday

    What's inside

    Frequently Asked Questions

    A Markdown rule is text the agent may or may not follow. A hook is a script that runs on a Claude Code event and checks the event data you give it. This package helps you turn one repeatable, observable failure into a checklist, warn, or block hook, and check it against allowed and blocked example cases before you install it.

    Four guides (strength selection, pre-action checks, stop checks, test-first rollout), two Python CLI utilities (rule_to_hook_scaffold.py and hook_harness_check.py), a PreToolUse template, a Stop template, a settings snippet, synthetic example fixtures and transcripts, and 29 offline self-tests.

    Python 3.9 or newer. The scripts are plain Python files that run offline, and the settings snippet is for Claude Code hooks. The quick check in the README uses only the included sample data and does not read your project settings.

    No. You choose a strength for each rule: checklist for judgment, warn for uncertain matches, or block for a narrow boundary. Nothing is installed for you. You review the generated hook and any settings change by hand, keep a rollback copy, and lower the strength if valid work is blocked.

    Yes. hook_harness_check.py runs named JSON fixtures against the two included templates, or against a reviewed script you pass with --hook. The fixtures are data only and do not run shell commands. The sample command in the README prints 11 cases and shows all 11 passing.

    New in Prompt & Skill Engineering