decomposition

A planning guide for splitting a large software task into smaller tasks that multiple coding agents can handle. It maps dependencies so tasks happen in a workable order.

In plain words
What is it for?
Use it to create delegation specifications, resolve task dependencies, build phased plans, assign work, and define acceptance criteria for subtasks.
Why use it?
It prevents agents from starting work before required pieces are ready and makes parallel work easier to coordinate. It also identifies circular dependencies that would otherwise stop progress.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/monkilabs/opencastle/decomposition
Any agent
npx skills add monkilabs/opencastle --skill decomposition
Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.00919
Opus 5 $0.00031 $0.00460
Sonnet 5 $0.00012 $0.00184
Haiku 4.5 $0.00006 $0.00092

Measured yesterday against content hash d12c5ba1c782, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

decomposition scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/orchestrator/skills/decomposition/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Task Decomposition

Dependency Resolution

TaskB → TaskA = B depends on A (must finish first).

Topological sort: No-dep tasks → Phase 1. Tasks depending only on Phase N → Phase N+1. Same-phase tasks with no mutual deps run in parallel.

Cycle detection: If A → B → C → A, split one task into independent part + dependent part.

Graph:        Plan:
E → C → A    Phase 1: A, B (parallel)
D → B        Phase 2: C, D (parallel)
F → C, D     Phase 3: E, F (parallel)

Delegation Spec

For score 1-3, objective + files + criteria is sufficient. Full template:

## Delegation Spec: [Task Title]
**Tracker Issue:** TAS-XX — [Title]
**Complexity:** [score]/13 → [tier] tier
**Agent:** [Agent Name]

### Objective
1-3 sentences: what to build/change and why.

### Context
- Key files: [list]
- Related patterns: [file:line references]
- Prior phase output: [compacted summary if applicable]
- Relevant lessons: [LES-XXX from LESSONS-LEARNED.md]

### Constraints
- File partition: Only modify files under [paths]
- Do NOT modify: [explicit exclusions]
- Dependencies: Requires [TAS-XX] Done first

### Acceptance Criteria
- [ ] Criterion 1

### Expected Output
Files changed · Verification (lint/test/build) · AC status (✅/❌) · Discovered issues · Lessons applied

Read .opencastle/LESSONS-LEARNED.md before starting. Add lesson if you retry any approach.

Prompt Quality

Quality Example
Strong (score 2) "TAS-42 — Fix token refresh. Users get 'Invalid token' after 30 min. JWT 1h expiry in libs/auth/src/server.ts. Fix refresh logic. Only libs/auth/. Run auth tests."
Strong (score 8) Use Delegation Spec Template above (all sections).
Weak "Fix the authentication bug."

Delegation Mechanism

Need result immediately?
 YES → Is dependency for next step?
         YES → Sub-Agent (inline)
         NO  → Sub-Agent or Background (if large)
 NO  → Expected > 5 min?
         YES → Background Agent
         NO  → Sub-Agent (sequential)

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 104 lines · 62 tokens per session scan A d12c5ba1c782

Subscribe to this mod's changes

decomposition is a skill published in the GitHub repository monkilabs/opencastle (61 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 919 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

product-architect

Complete product development system with 64 agents and 35 frameworks. Use when the user wants to build a product, write a PRD, plan an MVP or roadmap, design an app, research a market or check whether a feature already exists or is novel, do competitive analysis, run a security audit, build a financial model, plan…

ankitjha67/product-architect · 211 tokens

codex-delegation

Use when a coding task would benefit from delegating work to Codex in the background — a deep independent second opinion, security or architecture analysis, or a parallel implementation running while the session continues. Lets Claude drive the codex companion itself (task, review, status --wait, result) without the…

zebbern/agent-collab · 74 tokens

cursor-delegation

Use when a coding task would benefit from delegating work to Cursor in the background — fast parallel implementation, scaffolding, or an everyday review running while the session continues. Lets Claude drive the cursor companion itself (task, review, status --wait, result) without the user typing /cursor: commands.

zebbern/agent-collab · 66 tokens

cursor-cli-runtime

Internal helper contract for calling the cursor-companion runtime from Claude Code.

zebbern/agent-collab · 17 tokens

cursor-prompting

Internal guidance for composing cursor-agent prompts and picking models for coding, review, diagnosis, and research tasks inside the Cursor Claude Code plugin.

zebbern/agent-collab · 31 tokens

cursor-result-handling

Internal guidance for presenting Cursor helper output back to the user.

zebbern/agent-collab · 16 tokens