agentleFS
abhaylaabhayla/claude-best-practices/.claude/skills/pattern-quality/SKILL.md

pattern-quality

Skill9 starsChanged 7 months agoMITView on GitHub

Validate pattern files (skills, agents, rules) against quality, portability, structure, and curation standards. Run when editing or creating files in core/.claude/ or .claude/ pattern directories. Consolidates all pattern quality checks into one on-demand workflow. Structural FILE validation only — for trigger/output/behavioral evaluation use /skill-evaluator; for authoring or updating skill content use /writing-skills.

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 11 are distinctive, and 14 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the appropriate checklist reference file for the detailed requirements.

    line 36
  2. Very specific:

    Check name matches directory/filename (kebab-case)

    line 41
  3. Very specific:

    Check version is valid SemVer

    line 42
  4. Distinctive:

    Check total lines <= 500 (WARN at 500, FAIL at 1000)

    line 50
  5. Very specific:

    Verify ## CRITICAL RULES section exists (skills)

    line 52
  6. Distinctive:

    Check description starts with verb and includes "when" clause

    line 53
  7. Very specific:

    Read references/portability-rules.md and check:

    line 58
  8. Very specific:

    No hardcoded absolute paths (C:\, /home/, /Users/)

    line 60
  9. Distinctive:

    No project-specific references (specific class names, module paths)

    line 61
  10. Very specific:

    If pattern references other skills/agents via Skill(), Agent(), or /skill-name — verify targets exist on disk

    line 67
  11. Very specific:

    If in core/.claude/ — verify matching entry in registry/patterns.json with matching version

    line 68
  12. Very specific:

    If in .claude/ — check config/dual-home-resources.yml FIRST: a classified dual-home resource (synced/shared/divergent) legitimately HAS a …

    line 69
  13. Very specific:

    Check config/workflow-groups.yml for stale seeds if renaming/deleting

    line 70
  14. Distinctive:

    When the pattern change affects workflow connections:

    line 74
  15. Very specific:

    Read references/workflow-verification.md for full verification checklist

    line 76
  16. Very specific:

    Verify placement: distributable → core/.claude/ + registry.

    line 77
  17. Very specific:

    Check artifact convention compliance (test-results/{skill-name}.json)

    line 78
  18. Distinctive:

    After changes pass validation:

    line 87
  19. Distinctive:

    MUST run this skill when creating or modifying ANY pattern file

    line 121
  20. Very specific:

    MUST fail a NEW skill lacking the prerequisites contract (## Prerequisites or explicit none + STEP 0 preflight when prerequisites exist) — …

    line 122
  21. Distinctive:

    MUST NOT commit if the validator script fails

    line 123
  22. Distinctive:

    MUST verify cross-references exist on disk — do not assume from memory

    line 124
  23. Very specific:

    MUST check registry sync for core/.claude/ patterns

    line 125
  24. Distinctive:

    MUST regenerate docs after changes pass validation

    line 126
  25. Distinctive:

    Every pattern must be independently verifiable without relying on other patterns

    line 128

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Pattern Quality Gate

Validate patterns against portability, structure, self-containment, curation, and workflow integrity standards. Run this skill when creating or modifying any file in core/.claude/ or .claude/ pattern directories.

Request: $ARGUMENTS


STEP 1: Identify Pattern Type and Load Checklist

Determine the pattern type from the file path:

Path PatternTypeChecklist
skills/*/SKILL.mdSkillRead references/skill-checklist.md
agents/*.mdAgentRead references/agent-checklist.md
rules/*.mdRuleRead references/rule-checklist.md

Read the appropriate checklist reference file for the detailed requirements.

STEP 2: Validate Frontmatter and Structure

  1. Parse YAML frontmatter — verify all required fields present
  2. Check name matches directory/filename (kebab-case)
  3. Check version is valid SemVer
  4. For skills: verify numbered ## STEP N: sections (workflow type) or organized ## sections (reference type)
  5. For agents: verify model, color, ## Core Responsibilities, ## Output Format
  6. For rules: verify scope declaration (globs: or # Scope: global)

STEP 3: Check Content Quality

  1. Count content lines (excluding frontmatter, headings) — must be >= 30 for skills, >= 5 for rules
  2. Check total lines <= 500 (WARN at 500, FAIL at 1000)
  3. Scan for placeholder markers (<!-- TODO: -->, <!-- FIXME: -->)
  4. Verify ## CRITICAL RULES section exists (skills)
  5. Check description starts with verb and includes "when" clause
  6. For skills: verify the prerequisites contract — a ## Prerequisites section (or an explicit Prerequisites: none line); when any prerequisite is declared, a ## STEP 0: Preflight step that verifies every declared item (tools, credentials, files, services, AND user inputs/decisions) before STEP 1 and hard-stops with a complete missing-items list. NEW skills FAIL without it; skills predating 2026-07-26 WARN until the hub-wide sweep enrolls them

STEP 4: Validate Portability

Read references/portability-rules.md and check:

  1. No hardcoded absolute paths (C:\, /home/, /Users/)
  2. No project-specific references (specific class names, module paths)
  3. Stack-prefixed patterns only assume their stack's standard tools
  4. allowed-tools follows least-privilege per skill type

STEP 5: Verify Cross-References and Registry

  1. If pattern references other skills/agents via Skill(), Agent(), or /skill-name — verify targets exist on disk
  2. If in core/.claude/ — verify matching entry in registry/patterns.json with matching version
  3. If in .claude/ — check config/dual-home-resources.yml FIRST: a classified dual-home resource (synced/shared/divergent) legitimately HAS a registry entry (it tracks the core/ twin); only a genuinely hub-only pattern (unclassified there) must have NO entry in registry/patterns.json
  4. Check config/workflow-groups.yml for stale seeds if renaming/deleting

STEP 6: Validate Workflow Integrity

When the pattern change affects workflow connections:

  1. Read references/workflow-verification.md for full verification checklist
  2. Verify placement: distributable → core/.claude/ + registry; hub-only → .claude/ only
  3. Check artifact convention compliance (test-results/{skill-name}.json)
  4. Run the validator:
PYTHONPATH=. python scripts/workflow_quality_gate_validate_patterns.py

STEP 7: Regenerate Documentation

After changes pass validation:

# Regenerate workflow docs (picks up new connections)
PYTHONPATH=. python scripts/generate_workflow_docs.py

# Regenerate dashboard (after core/.claude/ changes only)
python scripts/generate_docs.py

STEP 8: Report

Output a structured quality report:

Pattern: <name>
Type: <skill|agent|rule>
Location: <core/.claude/ or .claude/>
Score: <0-100>
Grade: <A-F>

Checks:
  Frontmatter:    PASS/FAIL
  Structure:      PASS/FAIL
  Content:        PASS/FAIL
  Portability:    PASS/FAIL
  Cross-refs:     PASS/FAIL
  Registry sync:  PASS/FAIL

Issues: <list any failures>

CRITICAL RULES

  • MUST run this skill when creating or modifying ANY pattern file
  • MUST fail a NEW skill lacking the prerequisites contract (## Prerequisites or explicit none + STEP 0 preflight when prerequisites exist) — mid-run prerequisite discovery stalls unattended runs
  • MUST NOT commit if the validator script fails
  • MUST verify cross-references exist on disk — do not assume from memory
  • MUST check registry sync for core/.claude/ patterns
  • MUST regenerate docs after changes pass validation
  • Patterns in core/.claude/ are for downstream projects only — never use them in this hub repo
  • Every pattern must be independently verifiable without relying on other patterns

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.