agentleFS
abhaylaabhayla/claude-best-practices/.claude/skills/claude-guardian/SKILL.md

claude-guardian

Skill9 starsChanged 7 months agoMITView on GitHub

Validate and place rules into the correct CLAUDE.md or config file. Two modes: enhance-and-place a rough rule idea, or audit all config files for misplaced rules. Use when adding conventions, after editing CLAUDE.md, or when unsure where a rule belongs.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the target file

    line 55
  2. Distinctive:

    Add the rule without disrupting existing content

    line 57
  3. Very specific:

    Read all CLAUDE.md, CLAUDE.local.md, and .claude/rules/*.md files.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Guardian — Config Rule Placement & Audit

Enhance rough rule ideas into well-structured rules and place them in the correct config file. Audit all config files to catch accidental deletions, misplacements, and protected section violations.

Arguments: $ARGUMENTS


MODE SELECTION

  • $ARGUMENTS contains audit → Mode 2: Audit & Guard
  • Otherwise → Mode 1: Enhance & Place (treat $ARGUMENTS as the rough rule text)

CONFIG FILE LOCATIONS

FileScopeContent TypeExamples
~/.claude/CLAUDE.mdALL projects globallyGeneric cross-project rules"Always use forward slashes in bash"
~/.claude/CLAUDE.local.mdAll projects globally (private)Personal preferences"I prefer verbose test output"
CLAUDE.md (project root)This project onlyProject-specific rules, architectureBuild commands, file structure
CLAUDE.local.md (project root)This project only (gitignored)Local project preferencesLocal env paths, personal shortcuts
.claude/rules/*.mdThis project, path-scopedDetailed technical rulesFramework patterns, testing rules

STEP 1: Enhance & Place

Step 1: Analyze the Rule

  • Parse the rough rule text
  • Determine scope: global, project, or path-specific
  • Identify the correct target file

Step 2: Enhance the Rule

Transform rough text into structured format:

  • Clear, actionable statement
  • Example (if applicable)
  • Rationale (brief)

Step 3: Place the Rule

  • Read the target file
  • Find the appropriate section
  • Add the rule without disrupting existing content
  • Report what was added and where

STEP 2: Audit

Step 1: Read All Config Files

Read all CLAUDE.md, CLAUDE.local.md, and .claude/rules/*.md files.

Step 2: Check for Issues

  • Deletions: Compare against git history for accidentally removed rules
  • Misplacements: Rules in wrong scope (global rule in project file, etc.)
  • Duplicates: Same rule in multiple files
  • Conflicts: Contradictory rules

Step 3: Report

Audit Results:
  Files checked: N
  Issues found: M
  - [issue type]: [description] in [file]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.