Design and restructure Claude Code plugins. Use when applying the five restructure principles, adding agents, or packaging a plugin. It does not write a kit SKILL.md (that's `skill-craft`).
66
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Build Claude Code plugins the modern way: skills as the primary orchestration layer, agents only for high-agency specialists, reference material aggressively externalized, and commands reduced to structural compatibility shims. This is the post-restructure model proven in devex-kit and the authstack consolidation.
This skill covers the full lifecycle of creating or refactoring effective plugins:
| Phase | What you do | Key question |
|---|---|---|
| Model | Classify work as skill orchestration, agent specialist, or pure reference data | Does this belong in a lean SKILL.md, a spawnable agent, or a references/ file? |
| Craft | Write lean SKILL.md using devex-kit patterns + extract to references/ | Does the main file stay focused and delegate via load calls? |
| Specialize | Design and implement focused agents with rich example blocks | Is this truly narrow, high-agency, and self-contained enough to spawn independently? |
| Structure | Lay out the plugin with skills/ primary and intentionally empty commands/agents/ where appropriate | Does the tree signal the 5 principles at a glance? |
| Package | Add README, plugin.json, tile.json (if devex), examples, validation | Can another developer (or agent) land here and immediately understand the architecture? |
State the phase you are in, or describe the plugin or skill you are building: the skill routes accordingly.
These five points define current best practice. Every decision in this skill and every plugin you build with it must honor them.
For the full expanded explanation with authstack before/after, migration tactics, and anti-patterns, load
references/restructure-best-practices.md.
Internalize these before you write a single line of a new SKILL.md or agent.
The official Claude Code docs also provide a clear decision table for plugins vs standalone .claude/ configuration. Load the details (including when to start in .claude/ and when to convert) from references/plugin-structure.md.
Follow the layout used by restructured authstack plugins and the clean docs-engineering example.
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── skills/ # The only place new logic belongs
│ └── core-skill/
│ ├── SKILL.md # Lean, imperative, load references
│ ├── references/ # Or sibling .md files (AUDIT-CHECKLIST.md, *-reference.md)
│ └── examples/
├── agents/ # 0–6 or intentionally empty
├── commands/ # Present but empty or .deleted shims only
├── docs/ # Canonical durable content (link from skills with ../../)
├── references/ # Plugin-wide shared refs (optional)
├── rules/ # Cross-cutting (optional)
├── README.md
└── tile.json # When shipping via devex-kitFor the complete tree, plugin.json example, legacy-vs-restructured comparison table, rules about empty dirs, official plugin vs standalone guidance, local development with
--plugin-dir,claude plugin init, complex components (LSP/monitors/settings), and migration steps, loadreferences/plugin-structure.md.
Empty commands/ and agents/ directories are correct and intentional. They satisfy Claude Code layout expectations while signaling that logic lives in skills/.
Skills are the entry point users invoke (/plugin-craft, /sdk-craft, etc.). They must be lean, imperative, and delegate.
Follow these devex-kit conventions exactly:
license: MIT and metadata block.> For expanded ... load references/xxx.md`` blockquotes for every heavy section.For the exact frontmatter template, description best practices, full body organization, subagent handoff rules, common mistakes, and a ready-to-copy skeleton, load
references/skill-development.md.
Keep each SKILL.md body at or under 200 lines. Everything beyond that lives in references/.
Agents are for narrow, high-agency, spawnable specialists. They are not the default.
Use the pr-review-toolkit pattern as the canonical illustration: a skill (or thin shim) classifies the request, then spawns only the relevant subset of agents (code-reviewer, silent-failure-hunter, etc.) via the Task tool. The old approach of one giant command is deprecated.
Agent files live under agents/ (preferred) or inside a skill. Each must have:
description containing 2–4 concrete <example> blocks (Context / user / assistant / commentary).model (sonnet or opus).tools list.color.For the complete agent frontmatter shape, when-to-use criteria, orchestration-from-skill guidance, model/tool advice, color assignments, and checklist, load
references/agent-development.md.
Many excellent plugins have zero agents (see docs-engineering). Add agents only when the work genuinely benefits from isolation and focused context.
skills/, empty commands/, empty agents/, docs/, references/, rules/ as appropriate.references/skill-development.md. Frontmatter first.tile.json if this skill will live in devex-kit.claude --plugin-dir ./your-plugin (or point at a zip), then invoke the namespaced skill (/your-plugin:your-skill-name). Use /reload-plugins after edits. See the full local testing workflow and --plugin-url / multi-plugin options in references/examples-and-packaging.md.commands/review-foo.deleted.md (keep for history and compat).skills/review-foo/SKILL.md that performs the classification and orchestration.agents/.<example> blocks drawn from the scenarios the old command handled.references/REFERENCE.md or references/COMMON-MISTAKES.md (or equivalent) and move the data.For more migration and externalization patterns drawn from the actual authstack restructure, load
references/restructure-best-practices.md.
A plugin is not complete until it is self-documenting for both humans and future agents.
Required artifacts:
README.md at plugin root that explains the canonical content layer (docs/, skills/, rules/) vs the Claude adapters (commands/, agents/, hooks/), states the 5 principles, and gives real invocation examples.tile.json (exact shape used by every skill in this devex-kit) when the skill is part of devex-kit.examples/ demonstrating good usage.docs/.For the two primary study examples (pr-review-toolkit as agents+skill instead of command; docs-engineering as skills+refs+examples), the full authstack restructure trees, the packaging checklist, official quickstart, detailed local testing with
--plugin-dir//reload-plugins/--plugin-url, and migration from standalone.claude/, loadreferences/examples-and-packaging.md.
After any write or edit of a skill or plugin, run the doraval gate. Do not report done while the exit code is 1 or 2. If dora is missing, use npx @hacksmith/doraval in place of dora.
dora review <path> --format jsondora fix <path> --dry-run, then dora fix <path> --yes. Hand-edit judgement items from dora fix <path> --brief.dora review <path> --format json until exit 0.dora review <path> --quick must also exit 0.<path> is the skill directory (the folder that holds SKILL.md) or the plugin root.
If review output says the judge was delegated, read the emitted rubric, judge the skill, and fix findings before reporting done.
For the full review, fix, memory, and reconcile loop, load the installed
doravalskill.
Model → Craft: Have you classified every piece of functionality using the 5 principles? Is the primary deliverable a lean skill rather than a command or a monolithic agent?
Craft → Specialize: SKILL.md written and already delegating via load references calls? Heavy data extracted before the main file grew too large?
Specialize → Structure: Any agents have rich descriptions with concrete <example> blocks? Are they narrow enough that a one-sentence handoff produces reliable output? Commands/ and agents/ dirs intentionally minimal?
Structure → Package: Plugin root has README explaining the layers and the 5 principles? examples/ and references/ populated? Empty dirs documented as intentional? Tile.json present if this is a devex-kit skill? dora review <path> --format json exits 0?
Before declaring the plugin or skill complete:
> For expanded ... load references/...``claude --plugin-dir ./plugin, /reload-plugins, namespaced /plugin:skill invocations, and optionally --plugin-url or multiple --plugin-dir flags). Run claude plugin validate before distribution.dora review <path> --format json exits 0. On a kit skill, dora review <path> --quick also exits 0. Use npx @hacksmith/doraval if dora is missing.At the end of every session, ask: "Did this solve what you were trying to do?"
This skill itself follows the model it teaches. The authoritative patterns live in the references/ directory and in the live restructured plugins (authstack, skillkit examples). When official Claude Code plugin guidance (https://code.claude.com/docs/en/plugins, full index at https://code.claude.com/docs/llms.txt) or devex-kit conventions change, update the references first, then the orchestration in this SKILL.md.
When you create a new plugin using this skill, you are also contributing to the living catalog of good examples. Add it to the references when it demonstrates a new successful variation.
State the phase or the concrete task. Load the relevant reference. Build correctly.
df60de1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.