agentleFS
eristoddleeristoddle/agent-skills/skills/modular-skill-creator/SKILL.md

modular-skill-creator

Skill4 starsChanged 9 days agoMITView on GitHub

Build or convert skills into a modular, lazy-loading multi-workflow architecture. Use for "modular skill", "router skill", or splitting a monolithic skill into sub-workflows. For simple single-file skills, use skill-creator instead.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are 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.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every modular skill has three layers:

    line 10
  2. Very specific:

    Router stays thin: If you catch yourself writing multi-step procedure logic in SKILL.md, it belongs in a workflow file.

    line 20
  3. Very specific:

    References are one level deep: Every file in references/ is named in SKILL.md.

    line 23
  4. Very specific:

    Read workflows/design-modular-skill.md — run the interview to produce the skill spec.

    line 53
  5. Very specific:

    Read workflows/scaffold-router.md — generate the SKILL.md router from the spec.

    line 54
  6. Very specific:

    Read workflows/scaffold-workflows.md — generate each workflows/*.md file from the spec.

    line 55
  7. Distinctive:

    Write all files to the save location confirmed in intake.

    line 56
  8. Very specific:

    Read workflows/refactor-monolithic-skill.md.

    line 60

≈ “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

<essential_principles>

Architecture This Skill Produces

Every modular skill has three layers:

  1. Router (SKILL.md) — loaded at invocation, under ~150 lines. Contains frontmatter, essential principles, intake logic, and routing rules only. No workflow prose lives here.
  2. Workflows (workflows/*.md) — loaded on demand when the router decides which branch to execute. Each file is fully self-contained: it states its own inputs, prerequisites, steps, outputs, and done criteria.
  3. References (references/*.md) — single-purpose data files (blacklists, templates, taxonomies, examples). Loaded by workflows when needed. Never contain procedural logic. Every reference is also named in SKILL.md's Reference Materials list, so it is reachable one level from the router — a workflow may point at it too, but never as the only path.

Core Rules

  1. Router stays thin. If you catch yourself writing multi-step procedure logic in SKILL.md, it belongs in a workflow file.
  2. Each workflow owns its scope. A workflow file should not need to read another workflow file to complete its job — unless the skill is explicitly a stage-pipeline where step N hands off to step N+1.
  3. References are data, not logic. A reference file contains lookup tables, lists, templates, or examples. It never says "now do X."
  4. References are one level deep. Every file in references/ is named in SKILL.md. A file reachable only through a workflow gets previewed with head, never read in full, and its tail is silently lost.
  5. Long files carry a ## Contents block. Any workflow or reference file over 100 lines opens with a ## Contents block listing its sections, so a partial read still shows the whole scope.
  6. Always ask project vs global. Per the user's global preference, never assume a save location — always ask before writing files.

</essential_principles>

<intake>

Before anything else, ask where to save the output skill using AskUserQuestion:

"Where should the new skill be saved?"

  • Project-level — ./.claude/skills/<skill-name>/ in the current repo
  • User-level — your global skills directory, e.g. ~/.claude/skills/<skill-name>/ (or wherever your skill manager keeps shared skills)

Then ask what the user wants to do:

"What would you like to do?"

  • Build a new modular skill — design it from scratch with router + workflows + references
  • Convert an existing skill — refactor a single-file SKILL.md into the modular pattern

Route based on the answer.

</intake><instructions>

Workflow Routing

If user wants to build a new modular skill:

  1. Read workflows/design-modular-skill.md — run the interview to produce the skill spec.
  2. Read workflows/scaffold-router.md — generate the SKILL.md router from the spec.
  3. Read workflows/scaffold-workflows.md — generate each workflows/*.md file from the spec.
  4. Write all files to the save location confirmed in intake.

If user wants to convert an existing skill:

Read workflows/refactor-monolithic-skill.md. This workflow handles the full refactor end-to-end.

Reference Materials

  • references/router-patterns.md — read this during scaffold-router to get the correct template for the chosen routing pattern (menu-driven, input-shape detection, or stage-pipeline)
  • references/frontmatter-conventions.md — read this to use only fields the user's existing skills use; prevents spurious fields from appearing in generated skills
  • references/examples.md — read this when you need a concrete canonical example to explain the pattern to the user or sanity-check your output against

Quality Checklist

Before reporting done:

  • Router SKILL.md is under ~150 lines
  • Router contains zero step-by-step procedure prose
  • Every workflow file is self-contained (inputs, steps, outputs, done criteria all present)
  • Every file in references/ is named in SKILL.md's Reference Materials list (none reachable only through a workflow)
  • Every workflow and reference file over 100 lines opens with a ## Contents block
  • No allowed-tools field in frontmatter (not part of this user's convention)
  • Description field is pushy and trigger-rich (50-100 words, lists trigger phrases)
  • Save location was confirmed with user before any files were written
</instructions>

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.