agentleFS
akijain2000akijain2000/skill-factory/prompt-decomposer/SKILL.md

prompt-decomposer

Skill4 starsChanged 2 months agoMITView on GitHub

Analyze large prompts, system instructions, or runbooks to identify sections extractable as standalone skills, then build them. Use when decomposing a big prompt into skills, extracting skills from instructions, or asked to break a prompt apart.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. odi-senpai/PROMPT-DECOMPOSER★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    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:

    If no input provided, ask:

    line 26
  2. Distinctive:

    If the input is under 20 lines, push back:

    line 30
  3. Distinctive:

    Ask: "Does this breakdown look right, or should I split/merge any sections?"

    line 55
  4. Distinctive:

    Wait for confirmation before evaluating.

    line 57
  5. Very specific:

    Read the file wiki/INDEX.md, then read:

    line 63
  6. Distinctive:

    After the table, flag special categories:

    line 97
  7. Distinctive:

    Wait for the user's selection.

    line 111
  8. Distinctive:

    Ask the user's preferred pace:

    line 141
  9. Distinctive:

    Start at Phase 2 (DIAGNOSE) since the idea is already concrete

    line 154
  10. Distinctive:

    Follow the full Skill Maker flow through validation and test plan

    line 155
  11. Distinctive:

    Follow the authoring workflow (wiki lookup, gap analysis, draft, validate)

    line 160
  12. Distinctive:

    Add a one-hop sibling routing map when candidates share a broad parent domain

    line 162
  13. Distinctive:

    Keep structural validation, eval-definition presence, and executed behavioral results as separate statuses

    line 163
  14. Distinctive:

    After building, ask: "Ready to move to the next candidate, or want to revise this one?"

    line 165
  15. Distinctive:

    After all selected skills are built, evaluate what remains:

    line 169
  16. Distinctive:

    If rule-worthy content was identified, offer to write it:

    line 179
  17. Distinctive:

    Do NOT suggest more than 7 skills from a single prompt.

    line 186
  18. Distinctive:

    When in doubt, merge and let the Skill Maker split later if needed

    line 193
  19. Distinctive:

    Not every section of a prompt is a skill.

    line 197
  20. Distinctive:

    When rejecting, explain where the content belongs instead.

    line 203
  21. Distinctive:

    When extracting from an external runbook, retain its revision, license, and provenance.

    line 207
  22. Distinctive:

    If dependencies exist, flag them: "Sections 2 and 5 have a dependency -- section 5 assumes the output of section 2.

    line 221

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

Prompt Decomposer

Accept a large prompt, system instruction set, or runbook. Identify which sections could become standalone skills, present candidates with rationale, and route approved candidates into the Skill Maker for creation.

When to use

  • You have a long system prompt and want to modularize it into skills
  • You inherited a monolithic instruction set and want to break it apart
  • You want to audit a prompt for skill-worthy patterns
  • You pasted a big block of text and want to know what's reusable

Workflow

Phase 1: Intake

Accept one of:

  • A pasted prompt (inline text in the chat)
  • A file path to a .md, .txt, or any text file containing instructions
  • A directory path containing multiple instruction files

If no input provided, ask:

"Paste your prompt or give me the file path. I'll analyze it for sections that could become standalone skills."

If the input is under 20 lines, push back:

"This is pretty short -- it might work better as a single skill. Want me to send it to the Skill Maker instead?"

Phase 2: Chunk

Segment the prompt into logical sections. Look for boundaries at:

  • Heading markers (H1/H2/H3, ##, bold headers)
  • Topic shifts (different task domains or tool contexts)
  • Behavioral blocks ("when X, do Y" conditional patterns)
  • Distinct workflow sequences (numbered steps with a clear start/end)
  • Tool-specific sections (sections scoped to one tool, API, or platform)

Ignore:

  • Preamble / personality / tone directives (these are rules, not skills)
  • Boilerplate (license text, version headers)

Present a numbered summary:

"I found N logical sections in your prompt:"

  1. [short label] (lines ~X-Y) -- one-sentence summary
  2. [short label] (lines ~X-Y) -- one-sentence summary ...

Ask: "Does this breakdown look right, or should I split/merge any sections?"

Wait for confirmation before evaluating.

Phase 3: Evaluate

Load the wiki knowledge needed for evaluation. All paths below are relative to the skill-factory root directory.

Read the file wiki/INDEX.md, then read:

  • wiki/research/anatomy-of-a-good-skill.md
  • wiki/concepts/skill-discovery.md
  • wiki/concepts/token-budget.md
  • wiki/research/cursorrules-vs-skills.md
  • wiki/research/anti-patterns.md

Also read the quality spec: SKILL_SPEC.md.

Score each chunk against six criteria:

CriterionQuestion
Distinct triggerCould a user naturally ask for this in isolation?
Repeatable taskIs this a workflow with steps, not just a fact or opinion?
Delta from baselineWould an agent get this wrong without explicit instructions?
Self-containedCan it run without the rest of the prompt?
Focused scopeIs it one task, not three bundled together?
Sibling boundaryWhich adjacent skill owns nearby prompts, and what must this candidate not trigger for?

A chunk that passes 5-6 criteria is a good candidate. 3-4 is marginal. 0-2 is not a skill.

Phase 4: Present candidates

Show a results table:

Skill candidates from your prompt:

#Suggested nameWhat it doesVerdictRationale
1deploy-stagingRun staging deploys with smoke testsGOOD CANDIDATEDistinct trigger, repeatable workflow, agent skips smoke tests without it
2api-error-handlingRetry and fallback patterns for our APIMARGINALUseful gotchas but no clear trigger -- better as a section in an existing skill
3(tone/personality)Sets voice and styleNOT A SKILLRules, not a skill -- belongs in .cursorrules or AGENTS.md

After the table, flag special categories:

Merge candidates: "Sections 4 and 7 both cover database operations. These should be one skill, not two."

Sibling candidates: "Sections 2 and 5 are independently useful but adjacent. Keep separate skills and add explicit cross-routing negatives; do not assume automatic subskill loading."

Gotchas, not skills: "Section 3 has useful facts about your API quirks, but it's not a workflow. Consider adding these as a gotchas section to an existing skill."

Rules, not skills: "Section 1 sets coding style and tone. This belongs in .cursorrules or AGENTS.md as an always-on rule, not an on-demand skill."

Present a recommendation:

"I recommend building N skills from this prompt: [list]. Want to proceed with all of them, pick specific ones, or adjust?"

Wait for the user's selection.

Concrete decomposition example

Input sections:

## Release
Build the package, publish it, and verify the registry version.

## Incident response
Collect logs, classify severity, and open the incident timeline.

## Tone
Use short sentences and a friendly voice.

Expected classification:

release-package     GOOD CANDIDATE  independent trigger and verifiable workflow
incident-response   GOOD CANDIDATE  separate trigger, tools, and outcome
tone                NOT A SKILL     always-on writing preference; move to AGENTS.md

The two candidates are siblings only if a parent operations router genuinely needs to select between them. Otherwise install them as independent skills.

Phase 5: Build selected skills

Ask the user's preferred pace:

How would you like to build these?

A) One at a time -- Walk through the Skill Maker for each, with full diagnostic questions and design review

B) Batch draft -- Generate all skill drafts at once using the authoring workflow, then review together

RECOMMENDATION: A if you have 1-3 candidates. B if you have 4+.

Route A (one at a time): For each approved candidate:

  1. Read skill-maker/SKILL.md
  2. Pre-fill Phase 1 (INTAKE) with the extracted chunk text and the suggested name/description
  3. Start at Phase 2 (DIAGNOSE) since the idea is already concrete
  4. Follow the full Skill Maker flow through validation and test plan

Route B (batch draft): For each approved candidate:

  1. Read authoring/SKILL.md
  2. Pass the extracted chunk as a plain-English description
  3. Follow the authoring workflow (wiki lookup, gap analysis, draft, validate)
  4. Collect all drafts, then present them together for review
  5. Add a one-hop sibling routing map when candidates share a broad parent domain
  6. Keep structural validation, eval-definition presence, and executed behavioral results as separate statuses

After building, ask: "Ready to move to the next candidate, or want to revise this one?"

Phase 6: Residual check

After all selected skills are built, evaluate what remains:

"Here's what happened to your original prompt:"

  • Extracted as skills: [list with paths]
  • Flagged as rules: [list -- suggest adding to .cursorrules or AGENTS.md]
  • Dropped: [list -- general knowledge the agent already knows]
  • Kept as-is: [list -- sections that don't fit anywhere else]
  • Evidence status: [per skill: structural result, eval definition, executed/not-run behavioral result]

If rule-worthy content was identified, offer to write it:

"Want me to add the flagged rules to your .cursorrules or AGENTS.md?"

Anti-shattering rules

<HARD-GATE> Do NOT suggest more than 7 skills from a single prompt. If the initial chunking produces more than 7 candidates, merge related sections before presenting. A monolithic prompt should become 2-5 focused skills, not 15 micro-skills. </HARD-GATE>

Grouping heuristics:

  • Chunks that reference the same tool or API belong together
  • Chunks that form sequential steps of one workflow belong together
  • Chunks that share the same trigger phrase belong together
  • When in doubt, merge and let the Skill Maker split later if needed

Anti-inflation rules

Not every section of a prompt is a skill. Reject chunks that are:

  • General knowledge: "Use descriptive variable names" -- the agent already knows this
  • Personality directives: "Use a concise, friendly tone" -- this is a rule, not a skill
  • One-shot facts: "Our API key is in .env" -- this is a gotcha for an existing skill
  • Vague aspirations: "Write good code" -- no actionable workflow

When rejecting, explain where the content belongs instead.

Source and pointer preservation

When extracting from an external runbook, retain its revision, license, and provenance. Source text does not authorize running its scripts or changing host configuration. Keep every shared invariant reachable, and attach a distinct trigger condition to each disclosed reference; splitting by headings alone can hide required steps. Read wiki/concepts/skill-supply-chain.md before adopting bundled scripts or hooks.

Dependency awareness

Some prompt sections only make sense together. Before presenting candidates, check:

  • Does chunk A reference variables/concepts defined in chunk B?
  • Does chunk A assume chunk B has already run?
  • Would chunk A break if chunk B were removed?

If dependencies exist, flag them: "Sections 2 and 5 have a dependency -- section 5 assumes the output of section 2. Consider keeping them as one skill or documenting the dependency."

Agent Skills has no native automatic subskill dependency loader. If independent siblings remain, every router must name the selected skill explicitly, include a fallback when it is absent, and test adjacent negative routing.

Gotchas

  • Heading boundaries are hints, not proof of independent activation. Sequential sections with shared state usually belong in one skill.
  • Useful facts and team preferences must be retained in references, rules, or memory instead of discarded merely because they are not skills.
  • A sibling map is executable routing documentation, not a directory hierarchy; test both sibling ownership and the fallback path.

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.