claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior. Use when adding safety guardrails or preventing specific commands.
$ npx -y skills add athola/claude-night-market --skill writing-rules --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/writing-rulesContext preview
The summary Claude sees to decide when to auto-load this skill.
Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior. Use when adding safety guardrails or preventing specific commands.
name: writing-rules description: Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior. Use when adding safety guardrails or preventing specific commands. alwaysApply: false category: hook-development tags: - hookify - rules - patterns - validation - safety dependencies: [] estimated_tokens: 2500 complexity: beginner model_hint: fast provides: patterns: - rule-writing - pattern-matching - condition-building infrastructure: - rule-validation usage_patterns: - creating-rules - pattern-matching - behavioral-enforcement
Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in `.claude/hookify.{rule-name}.local.md` files.
Create `.claude/hookify.dangerous-rm.local.md`:
--- name: dangerous-rm enabled: true event: bash pattern: rm\s+-rf action: block --- 🛑 **Dangerous rm command detected!** This command could delete important files.
**Verification:** Run the command with `--help` flag to verify availability.
The rule activates immediately - no restart needed!
**name** (required): Unique identifier (kebab-case) **enabled** (required): `true` or `false` **event** (required): `bash`, `file`, `stop`, `prompt`, or `all` **action** (optional): `warn` (default) or `block` **pattern** (simple): Regex pattern to match
For multiple field checks:
---
name: warn-env-edits
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
🔐 **API key in .env file!**
Ensure file is in .gitignore.**bash events:** `command` **file events:** `file_path`, `new_text`, `old_text`, `content` **prompt events:** `user_prompt` **stop events:** `transcript`
rm\s+-rf → rm -rf console\.log\( → console.log( chmod\s+777 → chmod 777
python3 -c "import re; print(re.search(r'pattern', 'text'))"
--- name: block-destructive enabled: true event: bash pattern: rm\s+-rf|dd\s+if=|mkfs action: block --- 🛑 **Destructive operation blocked!** Can cause data loss.
--- name: warn-debug enabled: true event: file pattern: console\.log\(|debugger; action: warn --- 🐛 **Debug code detected!** Remove before committing.
---
name: require-tests
enabled: true
event: stop
action: warn
conditions:
- field: transcript
operator: not_contains
pattern: pytest|npm test
---
⚠️ **Tests not run!**
Please verify changes.---
name: protect-prod
enabled: true
event: file
action: block
conditions:
- field: file_path
operator: regex_match
pattern: /production/|\.prod\.
---
🚨 **Production file!**
Requires review.**Enable/Disable:** Edit `.local.md` file: `enabled: false`
**Delete:**
rm .claude/hookify.my-rule.local.md
**List:**
/hookify:list
1. Start with simple patterns 2. Test regex thoroughly 3. Use clear, helpful messages 4. Prefer warnings over blocks initially 5. Name rules descriptively 6. Document intent in messages
If a rule doesn't trigger, verify that the `event` type matches the tool being used (e.g., use `bash` for command line tools). Check that the regex `pattern` is valid and matches the target text by testing it with a short Python script. If you encounter permission errors when creating rule files in `.claude/`, ensure that the directory is writable by your user.
with all required frontmatter fields present: `name` (kebab-case), `enabled`, `event`, and either `pattern` or `conditions`
`python3 -c "import re; print(re.search(r'<pattern>',
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily commands; use night-market-operations.
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use night-market-debugging-playbook.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use night-market-validation-and-qa.