primitive-classifier
Skill1 starsChanged 56 days agoMITView on GitHub
Audit a folder for Claude Code primitives (skills, MCP servers, subagents, hooks, settings.json, CLAUDE.md) and classify each item into the primitive that actually fits, cross-checked against Anthropic docs. Produces a self-contained interactive HTML report with KPI hero, today vs target layout tabs, an explicit migration list, the 7-question decision framework, and provenance badges flagging documented vs inferred vs org-specific claims. Use when the user says "audit primitives", "classify skills and MCP", "primitive audit", "where does this content belong", "is this stuff in the right place", "review my Claude setup", or after generating any deck or doc that asserts which primitive a piece of context belongs in.
In this repository64 other files it gives its agents.
- accioSkill
- anthropic-doc-validatorSkill
- archifySkill
- cavecrewSkill
- caveman-compressSkill
- caveman-exploreSkill
- caveman-helpSkill
- cavemanSkill
- codebase-designSkill
- conference-talk-deckSkill
- config-gcSkill
- context-budgetSkill
- domain-modelingSkill
- excalidrawSkill
- explain-yogi-like-he-is-5Skill
- field-guide-builderSkill
- gateguardSkill
- geo-contentSkill
- goal-creatorSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- hindsightSkill
- implementSkill
- improve-codebase-architectureSkill
- loop-design-checkSkill
- mental-modelsSkill
- migrationSkill
- modern-pythonSkill
- no-ai-slopSkill
- onboard-lightSkill
- onboard-repoSkill
- ponytail-auditSkill
- ponytail-reviewSkill
- ponytailSkill
- prompt-fixerSkill
- prompt-optimizerSkill
- prototypeSkill
- qa-deckSkill
- read-wikiSkill
- researchSkill
- resolving-merge-conflictsSkill
- safe-refactorSkill
- scope-creep-checkSkill
- sdd-workshop-walkthroughSkill
- setup-matt-pocock-skillsSkill
- skill-complySkill
- skill-scoutSkill
- smellsSkill
- spec-interviewSkill
- surgical-patchSkill
- teachSkill
- the-llm-councilSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- watchSkill
- wayfinderSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Run this whenever the user wants to know:
- Distinctive: line 117
Run the bundled build script to produce the HTML:
- Very specific: line 125
If you want to inspect or tweak the template directly (rare), it lives at template/primitives-categorization.template.html.
- Distinctive: line 184
No em dashes anywhere in the output: Use a colon, period, comma, "and", or rewrite.
- Distinctive: line 187
Cite, do not paraphrase silently: Every "Anthropic says X" claim needs a doc URL in the sources block.
- Very specific: line 188
Flag ambiguity loudly: If you find yourself unsure whether something is documented or inferred, mark it ambiguous and write a disclaimer.
≈ “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.
Files
Primitive classifier, audit a folder against the six Anthropic primitives
Produces an interactive HTML report classifying every skill, MCP tool, hook, subagent, settings entry and CLAUDE.md file in a target folder against the six Anthropic primitives, with provenance and migration recommendations. Its companion is onboard-repo/references/mechanism-table.md: that table settles enforcement versus advisory placement (hook or permission rule when an instruction must hold every time), while this skill settles which primitive a piece of context belongs in.
When to use
Run this whenever the user wants to know:
- Are my skills, MCP servers, hooks, etc. in the right primitives?
- What's misplaced today, what should move where, and how many things are we talking about?
- Is the architecture being asserted in this deck / doc / repo grounded in Anthropic docs or are we extrapolating?
The output is one HTML file that lays out today vs target, lists the explicit migrations, runs the decision framework, cites Anthropic's canonical docs, and flags every claim's provenance.
Triggers: "audit primitives", "classify skills", "primitive audit", "where does this belong", "review my Claude setup", "check our Claude Code architecture".
What this skill produces
A single self-contained HTML file (typically 100kb+, no external assets) with six tabs:
| Tab | Content |
| Overview | KPI hero (today vs after migration), before/after movement table, headline verdicts, phase plan |
| Today's layout | Six buckets populated by current location |
| Target layout | Six buckets populated by recommended location |
| Migrations | Flat list of items that need action, with from → to and reasoning |
| Decision framework | The 7 questions, each citing the Anthropic doc that grounds it |
| Sources & disclaimers | Verbatim Anthropic doc quotes + extrapolation flags |
Workflow
Five phases. Do them in order.
Phase 1, discovery
Inventory the target folder. Read reference/discovery-targets.md for the exact patterns to scan.
Standard inventory:
# Skills
find "$TARGET" -name "SKILL.md" -o -name "skill.md"
# MCP servers (look for src/main/java for Java MCP, or .mcp.json, or mcp-server/)
find "$TARGET" -name ".mcp.json" -o -name "mcp.json"
find "$TARGET" -path "*mcp-server*" -name "*.java" | head -5
# Subagents
find "$TARGET" -path "*.claude/agents/*.md"
# CLAUDE.md hierarchy
find "$TARGET" -maxdepth 3 -name "CLAUDE.md" -o -name "CLAUDE.local.md"
# Settings
find "$TARGET" -path "*.claude/settings*.json"
# Hook scripts
find "$TARGET" -path "*.claude/hooks/*"
# Guideline files served by an MCP server (common Acme pattern)
find "$TARGET" -path "*resources/guidelines*.md"For each found item, capture:
name(file path or canonical id likemcp:get-guideline)kind(skill / mcp-tool / subagent / hook / setting / claude-md / guideline)currentLocation(one-line factual description, e.g. "MCP guideline served via get-guideline")- relevant body text (first 50 lines is usually enough to judge content vs procedural)
Phase 2, classification
For each inventoried item, walk the decision framework (reference/decision-framework.md). The framework is seven yes/no questions. First YES wins. The output is one of the six primitive buckets: claudemd, subagents, skills, hooks, settings, mcp.
Then assign one of these statuses by comparing current vs recommended:
| Status | Meaning |
correct | Current bucket = recommended bucket, content is shaped right |
borderline | Current = recommended, but the content shape could be sharper |
misplaced | Current ≠ recommended; the item lives in the wrong primitive and should move |
stub (rendered as "Reshape in place") | Current = recommended, but the scope or content split is wrong (e.g., a skill that delegates its body to MCP, or an MCP tool that exposes static content) |
missing | The item should exist in the recommended bucket but does not exist anywhere |
The label "Reshape in place" is the user-facing rendering of the internal stub status. Internal class names, JSON keys, and CSS use stub; visible labels say "Reshape in place".
Phase 3, cross-check against Anthropic
Fetch each canonical doc from reference/anthropic-sources.md. Use WebFetch or curl. For each doc:
- Capture a verbatim quote that grounds the primitive's purpose
- Note the URL
- Mark which classifications in your inventory the doc supports
The Mintlify .md endpoint (e.g. .../skills/overview.md) is the stable variant. Avoid the rendered HTML.
Phase 4, provenance
For every item, classify the strength of evidence behind its placement:
| Provenance | When to use |
documented | Anthropic explicitly states the rule that drives this placement |
inferred | A defensible reading of the docs, but not stated in one verbatim line |
org-specific | Org context, not Anthropic's call |
ambiguous | Docs do not address; this is a judgment call |
Then write disclaimers (reference/disclaimer-templates.md) for the most important extrapolations. The goal: a future reader should never confuse a doc-grounded claim with a judgment call.
Phase 5, render
Run the bundled build script to produce the HTML:
node "${CLAUDE_SKILL_DIR}/scripts/build-html.js" --data audit-data.json --out primitives-categorization.htmlThe script takes a JSON file matching reference/output-shape.md, substitutes the data into the template, and writes a self-contained HTML.
If you want to inspect or tweak the template directly (rare), it lives at template/primitives-categorization.template.html.
Output JSON shape
The build script consumes a single JSON file. Minimum required keys:
{
"title": "Acme primitives audit, what belongs where",
"lede": "One paragraph framing the audit.",
"meta": "Sources, scope, date.",
"verdicts": [
{ "tone": "good|warn|miss|info", "title": "...", "body": "html allowed" }
],
"buckets": [
{
"id": "claudemd|subagents|skills|hooks|settings|mcp",
"title": "CLAUDE.md",
"isFor": "...",
"isNot": "..."
}
],
"items": [
{
"name": "acme:ddd-patterns",
"kind": "skill",
"recommendedBucket": "skills",
"currentLocation": "Skill (66 lines, body delegates to MCP)",
"currentBucket": "skills",
"status": "stub",
"reasoning": "...",
"provenance": {
"level": "documented|inferred|org-specific|ambiguous",
"sources": ["skills-cc", "skills-best"],
"note": "..."
}
}
],
"sources": [
{ "id": "skills-overview", "group": "Agent Skills", "title": "...", "url": "...", "quote": "..." }
],
"decisions": [
{
"q": "Does this need to BLOCK a tool call deterministically?",
"yes": { "bucket": "hooks", "label": "Hook", "detail": "..." },
"no": "Continue.",
"cite": { "source": "hooks" }
}
],
"disclaimers": [
{ "level": "documented|inferred|org-specific|ambiguous", "title": "...", "body": "html allowed" }
]
}For the full schema with optional fields, see reference/output-shape.md.
Iron rules
- No em dashes anywhere in the output. Use a colon, period, comma, "and", or rewrite. The skill applies this to every generated string.
- Group items by
recommendedBucketin the target tab and bycurrentBucket(or kind-derived default) in the today tab. A misplaced item should appear under its current location in "Today" and its target location in "Target". The migrations tab shows both via from → to. - Internal STATUS value stays
stub; visible label is "Reshape in place". The build script handles the rendering. Do not rename the JSON key. - Cite, do not paraphrase silently. Every "Anthropic says X" claim needs a doc URL in the sources block.
- Flag ambiguity loudly. If you find yourself unsure whether something is documented or inferred, mark it
ambiguousand write a disclaimer. The skill's value is in the honest map, not the false confidence.
Quick start
audit primitives in ~/code/example-platform/digital-skills 1/Claude reads this skill, walks the five phases, and writes primitives-categorization.html next to the target folder.
Reference files (one level deep)
reference/discovery-targets.md: glob patterns and file shapes to scan in phase 1reference/decision-framework.md: the 7 questions verbatim with citation URLsreference/anthropic-sources.md: canonical doc URLs to fetch in phase 3reference/output-shape.md: the full JSON schema the build script acceptsreference/disclaimer-templates.md: common extrapolation patterns to flagtemplate/primitives-categorization.template.html: the HTML scaffold; do not edit unless adding new sectionsscripts/build-html.js: substitutes a JSON data file into the templateexamples/acme-output-summary.md: what an audit produced on a placeholder stack (for orientation)
Anti-patterns
- Don't classify by file location alone. A
.mdfile undermcp-server/resources/is delivered as MCP content today, but if its body is a procedural playbook ("how to write a hexagonal adapter") it belongs in skills. Classify by content shape, not directory. - Don't use "stub" as a user-visible label. It is the internal status; the UI says "Reshape in place".
- Don't bake migration order into the framework. Phase order is a recommendation, not Anthropic doctrine. Mark migration plans as
org-specificprovenance unless the user explicitly asks for an org-neutral output. - Don't bloat the verdicts. Four cards max on the overview tab; if a fifth point matters, it goes in the migration narrative.
- Don't fetch Anthropic docs blindly each run. Cache the source quotes in the JSON. Re-fetch only when the user asks for a fresh check.
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
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.

