agentleFS
blamechrisblamechris/chroxy/.claude/skills/decompose-issue/SKILL.md

decompose-issue

Skill8 starsChanged 9 days agoMITView on GitHub

Break a single GitHub issue that is too large into 2-5 independently implementable sub-issues.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    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:

    If a prior decomposition exists:

    line 54
  2. Very specific:

    Look up each sub-issue's state (open / closed) and any linked PR.

    line 57
  3. Distinctive:

    Before proposing a breakdown, decide whether the issue actually needs decomposing.

    line 63
  4. Very specific:

    If the issue looks implementable as-is and --force was not passed, output a brief explanation and exit:

    line 71
  5. Distinctive:

    Stop here. Do not create sub-issues.

    line 81
  6. Distinctive:

    Read the parent body, then explore the codebase enough to understand the work:

    line 85
  7. Distinctive:

    Read CLAUDE.md for project conventions if not already in context.

    line 88
  8. Distinctive:

    This is the only confirmation point: Wait for the user. If they request changes, revise the table and confirm again before creating.

    line 113
  9. Very specific:

    After approval, create each sub-issue.

    line 117
  10. Distinctive:

    Verify labels exist: before applying them. Skip any that don't exist in the repo rather than failing:

    line 167
  11. Very specific:

    After all sub-issues are created, comment on the parent with the canonical "Decomposed into" line so future runs of this skill and …

    line 176
  12. Very specific:

    Confirmation gate is mandatory: Never create sub-issues without explicit user approval of the proposed breakdown.

    line 212
  13. Distinctive:

    Parent stays open: Do not close the parent — it tracks the broader scope until all sub-issues merge.

    line 213
  14. Distinctive:

    Don't re-decompose: If a prior "Decomposed into" comment exists, report the existing sub-issues and exit.

    line 214
  15. Distinctive:

    Cross-link both directions: Every sub-issue body says "Part of #N".

    line 216
  16. Very specific:

    NO attribution: Follow the project's attribution policy.

    line 219

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

/decompose-issue

Break a single GitHub issue that is too large into 2-5 independently implementable sub-issues. This is the manual triage counterpart to the auto-decomposition baked into /autonomous-dev-flow and /parallel-dev — use it when a human reads an issue and decides it needs splitting before any implementation runs.

The skill always pauses for user confirmation of the proposed breakdown before creating any sub-issues.

Arguments

  • $ARGUMENTS - Issue number (required). Accepts #15 or 15. Optionally followed by flags:
    • --force — Skip the "this looks implementable as-is" early-out and decompose anyway.
    • --label NAME — Additional label applied to every sub-issue (repeatable).

Examples:

/decompose-issue #15
/decompose-issue 15 --force
/decompose-issue #42 --label area:auth

Instructions

1. Parse Arguments and Read the Parent

REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
PARENT_NUM=$(echo "$ARGUMENTS" | grep -oE '[0-9]+' | head -1)

if [ -z "$PARENT_NUM" ]; then
  echo "Error: issue number required, e.g. /decompose-issue #15"
  exit 1
fi

# Fetch the full parent context
gh issue view "$PARENT_NUM" --json number,title,state,labels,body,comments,assignees

Confirm the issue exists and is open. If closed, ask the user whether to reopen before continuing — decomposing a closed issue is almost always wrong.

2. Prior-Decomposition Guard

Scan the parent's comments for an existing "Decomposed into" comment from a previous run (manual or auto):

gh issue view "$PARENT_NUM" --json comments \
  | jq -r '.comments[].body' \
  | grep -E 'Decomposed into #[0-9]+' || true

If a prior decomposition exists:

  1. Extract the sub-issue numbers from the comment.
  2. Look up each sub-issue's state (open / closed) and any linked PR.
  3. Report the existing breakdown to the user — do not create new sub-issues.
  4. Exit unless the user explicitly says "decompose again" (rare; usually means the prior split was wrong).

3. Assess Complexity (early-out)

Before proposing a breakdown, decide whether the issue actually needs decomposing. Read the body and consider:

  • Single-file, single-behavior change → likely implementable as-is.
  • Acceptance criteria is one checkbox or a tight cluster → likely implementable as-is.
  • Body explicitly enumerates multiple independent deliverables → good decomposition candidate.
  • Touches several subsystems / multiple test surfaces / cross-cutting concerns → good decomposition candidate.
  • No acceptance criteria at all → needs requirements before it can be decomposed (recommend the user fill in criteria first).

If the issue looks implementable as-is and --force was not passed, output a brief explanation and exit:

## #${PARENT_NUM} looks implementable as-is

**Why:** [single-file change / tight acceptance criteria / etc.]

If you still want to break it up, re-run with `--force`.

Stop here. Do not create sub-issues.

4. Explore Scope and Propose Sub-Issues

Read the parent body, then explore the codebase enough to understand the work:

  • Grep for files / symbols the issue names.
  • Read CLAUDE.md for project conventions if not already in context.
  • Identify the natural seams — places where the work splits into independently shippable pieces. Use commit scopes (server, app, desktop, tunnel, ws, cli, dashboard) to find natural seams.

Propose 2-5 sub-issues. Each sub-issue must be:

  • Independently implementable — a separate PR could merge it without the others.
  • Low or medium complexity — if any sub-issue is still high-complexity, split further.
  • Tied to specific acceptance criteria — vague sub-issues defeat the point.

Present the proposed breakdown to the user as a table and wait for confirmation:

## Proposed decomposition of #${PARENT_NUM} — ${PARENT_TITLE}

| # | Proposed Title | Scope | Complexity |
|---|----------------|-------|------------|
| 1 | type(scope): … | Files: src/a.ts, src/b.ts | low |
| 2 | type(scope): … | Files: src/c.ts; new test surface | medium |
| 3 | type(scope): … | Migration + backfill | medium |

**Labels each sub-issue will receive:** enhancement (plus from-review when the parent carries it), plus any `--label` flags

Approve to create these 3 sub-issues, or reply with changes (e.g. "merge 1 and 2", "drop 3", "add a sub-issue for X").

This is the only confirmation point. Wait for the user. If they request changes, revise the table and confirm again before creating.

5. Create Sub-Issues

After approval, create each sub-issue. Mirror the body template used by /autonomous-dev-flow so downstream skills can consume them consistently:

for SUB in "${PROPOSED_SUBS[@]}"; do
  SUB_URL=$(gh issue create \
    --title "${SUB_TITLE}" \
    --label "${SUB_LABELS}" \
    --body "$(cat <<EOF
## Context

Filed from: #${PARENT_NUM}

## Summary

${SUB_DESCRIPTION}

Part of #${PARENT_NUM}

## Implementation Plan

- Files to modify: \`${SUB_FILES}\`
- Test strategy: ${SUB_TEST_STRATEGY}
- Approach: ${SUB_APPROACH}

## Acceptance Criteria

- [ ] ${SUB_CRITERION_1}
- [ ] ${SUB_CRITERION_2}
EOF
)")
  SUB_NUM=$(echo "$SUB_URL" | grep -oE '[0-9]+$')
  CREATED_NUMS+=("$SUB_NUM")
done

Label set for each sub-issue:

# Default sub-issue labels: enhancement, plus from-review if parent has it
SUB_LABELS="enhancement"
if gh issue view "$PARENT_NUM" --json labels -q '.labels[].name' | grep -q '^from-review$'; then
  SUB_LABELS="$SUB_LABELS,from-review"
fi

# Add any --label flags the user passed
for extra in "${EXTRA_LABELS[@]}"; do
  SUB_LABELS="$SUB_LABELS,$extra"
done

Verify labels exist before applying them. Skip any that don't exist in the repo rather than failing:

EXISTING_LABELS=$(gh label list --json name -q '.[].name')
# Filter SUB_LABELS to only those in EXISTING_LABELS

6. Comment on Parent and Cross-Link

After all sub-issues are created, comment on the parent with the canonical "Decomposed into" line so future runs of this skill and /autonomous-dev-flow's prior-decomposition guard both detect it:

SUB_LIST=$(printf '#%s, ' "${CREATED_NUMS[@]}" | sed 's/, $//')

gh issue comment "$PARENT_NUM" --body "$(cat <<EOF
Decomposed into ${SUB_LIST} — each independently implementable.

Parent stays open until all sub-issues merge.
EOF
)"

Do NOT close the parent. It stays open until every sub-issue is merged, so the broader scope remains tracked.

7. Report to User

Output a summary table as the primary result:

## Decomposed #${PARENT_NUM} — ${PARENT_TITLE}

| Sub-issue | Title | Labels |
|-----------|-------|--------|
| #${SUB_1} | … | enhancement |
| #${SUB_2} | … | enhancement |
| #${SUB_3} | … | enhancement |

**Parent:** #${PARENT_NUM} (stays open)
**Comment posted on parent:** ✓

Next: `/autonomous-dev-flow #${SUB_1} #${SUB_2} #${SUB_3}` to implement them, or pick them up manually.

Critical Rules

  1. Confirmation gate is mandatory. Never create sub-issues without explicit user approval of the proposed breakdown. This is the difference between this skill and the inline decomposition in /autonomous-dev-flow (which runs unattended).
  2. Parent stays open. Do not close the parent — it tracks the broader scope until all sub-issues merge.
  3. Don't re-decompose. If a prior "Decomposed into" comment exists, report the existing sub-issues and exit. Only re-decompose on explicit user request.
  4. Each sub-issue must be independently implementable. A separate PR could ship it. If a sub-issue depends on another sub-issue's code, you split wrong — re-think the seams.
  5. Cross-link both directions. Every sub-issue body says "Part of #N". The parent gets a single "Decomposed into #A, #B, #C" comment.
  6. 2-5 sub-issues. Fewer than 2 means the parent wasn't actually too complex (recommend --force exit instead). More than 5 means the work is unbounded and probably needs a design doc, not decomposition.
  7. Respect labels that don't exist. Skip missing labels gracefully — don't fail the run because the repo doesn't use a label.
  8. NO attribution. Follow the project's attribution policy. No "Generated with Claude" / Co-Authored-By lines in issue bodies or comments.

When NOT to use this skill

  • The parent has no acceptance criteria → fix the criteria first; you can't split work that isn't defined.
  • The parent describes a single atomic operation (a migration, a one-line config change, a single test) → it doesn't decompose, it just gets done.
  • The parent already has a "Decomposed into" comment → use the existing sub-issues unless they're wrong.
  • The work spans multiple repos → that's a coordination problem, not a decomposition problem. Open issues in each repo separately.

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.