Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/stuartshields-debug-rules
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/debug-rules
Tools it pre-approves 4
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Read,Grep,Glob,Bash
What's inside
- Skill name
debug-rules- Description
- Diagnose which rules loaded, which didn't, and why. Reads the InstructionsLoaded audit log and compares against expected rules.
- License
- MIT
- Allowed tools
- Read,, Grep,, Glob,, Bash
- Instructions
- 89 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves any shell command
Files (1)
- SKILL.md
SKILL.md (first lines)
<!-- Last updated: 2026-03-23T16:30+11:00 -->
# Skill: debug-rules
## When to Use
Use this skill when:
- Conditional rules don't seem to be loading
- Claude is ignoring instructions that should be in a rule file
- You changed rule frontmatter and want to verify it works
- You want to see what rules loaded in a specific session
## Prerequisites
This skill requires the `InstructionsLoaded` audit hook. The hook is **not registered by default** - it's an on-demand diagnostic tool you enable when needed.
### Setup (one-time)
The hook script `~/.claude/hooks/log-instructions.sh` should already exist. To enable logging, add this to `~/.claude/settings.json` under `"hooks"`:
```json
"InstructionsLoaded": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/log-instructions.sh"
}
]
}
]
```
Then start a new session, do some work that touches files matching your conditional rules, and run `/debug-rules` again.
**Remove the hook from settings.json when done** - it's lightweight but unnecessary for normal use.
## Step 1: Verify hook is active
1. Check `~/.claude/hooks/log-instructions.sh` exists and is executable
2. Check `~/.claude/settings.json` has an `InstructionsLoaded` entry pointing to it
3. Check `~/.claude/instruction-audit.log` exists and is non-empty
If the hook script is missing, tell the user and stop. If the hook script exists but isn't registered in settings.json, show them the setup instructions above. If the log doesn't exist or is empty, tell the user: "No audit log found. Register the hook, start a new session, do some work, then run `/debug-rules` again."
## Step 2: Read the audit log
Read `~/.claude/instruction-audit.log`. If the user provided a timestamp, filter to entries from that session. If they said "latest" or gave no argument, use the most recent session (group by timestamp - entries within 2 seconds of each other are the same session start).
## Step 3: Inventory expected rules
Read all files in `~/.claude/rules/`. For each file:
- If it has no `paths:` frontmatter → it should appear with `reason: session_start`
- If it has `paths:` frontmatter → it should appear with `reason: path_glob_match` only when matching files are read
Build a table of expected rules and their type (always-on vs conditional).
## Step 4: Compare and report
Present three sections:
### Rules that loaded correctly
Table with: file name, load reason, scope (User/Project). These are working as expected.
### Rules that did NOT load
For each missing rule:
- Name and expected load type
- If always-on: this is a problem - it should have loaded at session_start
- If conditional: list what glob patterns it expects, and check the log for any `trigger_file_path` entries that should have matched. If matching files were read but the rule didn't fire, flag it as **BROKEN** (likely the user-level paths: bug)
### Unexpected behaviour
Flag any of these:
- Conditional rules loading at `session_start` (should only load on `path_glob_match`)
- Files in `~/.claude/rules/` that aren't rule files (no frontmatter closing `---`) loading as rules
- Duplicate loads of the same file
## Step 5: Recommendations
Based on findings, suggest:
- If conditional rules aren't firing: check if `paths:` uses YAML array syntax (broken in user-level rules) vs CSV string format (works). Show the fix.
- If unexpected files are loading: suggest moving them out of `~/.claude/rules/`
- If everything looks correct: say so
## Rules
- **Read-only.** Do not modify any files. Report only.
- **Check the log, don't guess.** Every conclusion must be backed by a log entry or absence of one.
- **Show the raw log entries** for any problems found so the user can verify.From stuartshields/claude-setup, MIT.
More from stuartshields/claude-setup
- 0.507score
module-depth-review
stuartshields
Use when reviewing whether module boundaries earn their keep — finding shallow modules that should be consolidated into deep ones.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
debugging
stuartshields
Structured debugging protocol.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
swift-concurrency-review
stuartshields
Use when reviewing Swift 5.5+ code containing `await`, `actor`, `Task { }`, `@MainActor`, `@unchecked Sendable`, cancellable timer/deadline handles, or…
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
block-journey
stuartshields
Discover all files for a block or component, trace the editorial and front-end user journeys, and write a journey document to docs/journeys/.
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
clean-worktrees
stuartshields
Remove stale agent worktree directories and their orphaned branches.
SkillCFreshness: C★ 2Claude Code +9 - 0.502score
tool-usage
stuartshields
Recovery protocol for tool failures and search budgets.
SkillCFreshness: C★ 2Claude Code +9 - 0.482score
audit-vs-fix-discipline
stuartshields
Use when the user asks to audit, review, investigate, check, scan, "look at", or "find issues in" code — anything that sounds like a diagnostic request…
SkillCFreshness: C★ 2Claude Code +9 - 0.440score
playwright
stuartshields
Playwright MCP browser automation workflow.
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
qa-check
stuartshields
Auto-detects the project's tech stack, then audits for Accessibility, Performance, and Code Quality.
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
review-memory
stuartshields
Review auto-memory for the current project.
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
figma
stuartshields
Figma-to-code workflow using MCP tools.
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
vibe-user
stuartshields
Open an app in Playwright and explore it as a real user with no prior knowledge.
SkillDFreshness: D★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 26, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/stuartshields/claude-setup
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from stuartshields
- 0.507score
module-depth-review
stuartshields
Use when reviewing whether module boundaries earn their keep — finding shallow modules that should be consolidated into deep ones.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
debugging
stuartshields
Structured debugging protocol.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
swift-concurrency-review
stuartshields
Use when reviewing Swift 5.5+ code containing `await`, `actor`, `Task { }`, `@MainActor`, `@unchecked Sendable`, cancellable timer/deadline handles, or…
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
clean-worktrees
stuartshields
Remove stale agent worktree directories and their orphaned branches.
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
block-journey
stuartshields
Discover all files for a block or component, trace the editorial and front-end user journeys, and write a journey document to docs/journeys/.
SkillCFreshness: C★ 2Claude Code +9 - 0.502score
tool-usage
stuartshields
Recovery protocol for tool failures and search budgets.
SkillCFreshness: C★ 2Claude Code +9
Cite this page
debug-rules skill. Agent Mart. https://agentmart.dev/skills/stuartshields-debug-rules (last updated 2026-10-24)