- Home
- Skills
- Prompt & Skill Engineering
- Turn Markdown Rules into Deterministic Claude Code Hooks
More screenshots
Works with the AI Agents you already use
Turn Markdown Rules into Deterministic Claude Code Hooks
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
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.pyin 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 filesscripts/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
- Read the guides and choose a strength for one narrow rule.
- Run the scaffold in a new output directory.
- Replace the TODO checks with project-specific ones and add blocking and allowed cases.
- Run the harness before reviewing any settings change by hand.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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+