Sunday, April 5

Task Decomposition Expert: The Claude Code Agent That Turns Chaos Into Coordinated Workflows

Complex software projects don’t fail because developers lack skill. They fail because the cognitive overhead of orchestrating multiple tools, agents, data pipelines, and dependencies becomes unmanageable. You’re three hours into a task when you realize you missed a dependency, chose the wrong storage strategy, or built components in the wrong order. The rework is brutal.

The Task Decomposition Expert agent exists to solve exactly this problem. Before you write a single line of code on a complex initiative, this agent analyzes your goal, breaks it into a hierarchical execution plan, identifies the right tools and agents for each component, and builds the entire workflow architecture — including persistent storage via ChromaDB — so you’re executing against a coherent plan rather than improvising as you go.

For senior developers running multi-step AI workflows, data pipelines, or any project that touches several different capabilities simultaneously, this agent functions as a force multiplier. It doesn’t just help you do the work faster. It helps you do the right work in the right order, with the right tools, from the start.

When to Use the Task Decomposition Expert

Not every task needs decomposition. If you’re writing a single utility function or debugging a known issue, you don’t need an architect — you need a keyboard. But when projects reach a certain complexity threshold, the cost of skipping the planning step becomes enormous. Use this agent proactively in these situations:

  • Multi-agent orchestration projects: When your solution requires coordinating specialized agents — one for data ingestion, one for processing, one for output generation — you need explicit workflow architecture before you start wiring things together.
  • Document processing pipelines: Any time you’re ingesting, indexing, and querying large document sets, the agent will immediately identify where ChromaDB fits, how to structure collections, and how to sequence the processing steps.
  • Knowledge base construction: Building a searchable, semantically-indexed knowledge base involves storage design, ingestion workflows, query strategies, and metadata schemas. This agent handles all of it as an integrated design problem.
  • Cross-tool integrations: Projects that stitch together multiple APIs, databases, and processing layers benefit enormously from having the dependency graph and data flow mapped before implementation begins.
  • Ambiguous requirements with real constraints: When a stakeholder gives you a goal but not a spec, this agent asks the right clarifying questions to surface implicit requirements and edge cases before they become expensive surprises.
  • Time-sensitive projects with parallel execution potential: The agent explicitly identifies which tasks can run in parallel versus sequentially, which can dramatically compress delivery timelines.

What Makes This Agent Powerful

Hierarchical Task Decomposition

The agent doesn’t just produce a flat task list. It structures work into primary objectives, secondary supporting tasks, and atomic executable actions — each with explicit dependencies and sequencing requirements. This hierarchy maps cleanly onto how real projects are actually executed, making it straightforward to delegate, parallelize, or checkpoint progress.

ChromaDB-First Architecture

One of the agent’s most distinctive characteristics is its mandatory ChromaDB integration protocol. Before recommending any external search or storage solution, it first uses ChromaDB MCP tools directly — listing existing collections, querying documents, getting collection info. This isn’t just a preference; it’s baked into the agent’s decision framework. For developers building knowledge-intensive applications, this means you get concrete ChromaDB implementation patterns, not abstract recommendations. The agent shows you actual tool usage examples, not just conceptual architecture diagrams.

Workflow Architecture Design

Beyond breaking down tasks, the agent designs the execution strategy: which operations run sequentially, which can be parallelized, where decision points exist, and what the branching logic looks like. This is the kind of systems thinking that usually lives in an architect’s head and never gets written down until something goes wrong.

Proactive Clarification

The agent is explicitly designed to ask clarifying questions to uncover implicit requirements and edge cases. This is intentional — complex projects have hidden constraints that don’t surface until you’re deep in implementation. Surfacing them at planning time is orders of magnitude cheaper than discovering them during execution.

Optimization Recommendations

Beyond the initial plan, the agent provides ChromaDB query optimization strategies, indexing recommendations, efficiency improvements through automation, and risk mitigation through redundancy. You get not just a working plan but a good plan.

Implementation Roadmap with Validation Checkpoints

The agent produces a prioritized, sequenced implementation roadmap with validation checkpoints and success metrics baked in. You always know what “done” looks like for each phase, which makes it much easier to detect when something is off-track early.

Real-World Examples

Scenario 1: Building a Semantic Document Search System

A developer needs to build an internal tool that lets their team search across thousands of engineering documents, Confluence pages, and Slack exports using natural language queries. They’re not sure where to start.

<strong>Developer:</strong> I need to build a semantic search system over our engineering docs —
about 8,000 documents across Confluence, some PDFs, and Slack export files.
Users should be able to ask questions in natural language and get relevant
document chunks back. What's the plan?

<strong>Task Decomposition Expert:</strong> Before I build the architecture, let me check
what ChromaDB infrastructure is already available.

[Calls chroma_list_collections]
[Calls chroma_get_collection_info on existing collections]

Good — you have an empty ChromaDB instance running. Here's the decomposition:

PRIMARY OBJECTIVES:
1. Ingest and index all document sources into ChromaDB
2. Build a query interface that returns semantically relevant chunks
3. Expose this as an API your team can use

SECONDARY TASKS (with dependencies):
- Document parsing pipeline (PDF, HTML, plain text) → feeds objective 1
- Chunking strategy design (chunk size, overlap, metadata schema) → feeds objective 1
- Embedding model selection → feeds objectives 1 and 2
- ChromaDB collection design (single collection vs. source-separated) → feeds objective 1
- Query expansion and reranking logic → feeds objective 2
- API layer with authentication → feeds objective 3

IMMEDIATE CLARIFYING QUESTIONS:
- Do queries need to respect document-level permissions?
- Is freshness critical (live sync vs. periodic batch ingestion)?
- What's the expected query latency requirement?

RECOMMENDED COLLECTION STRUCTURE:
engineering_docs_v1 with metadata fields: source_type, document_id,
last_updated, author, permission_level

I'd start with the chunking strategy and collection design before writing
any ingestion code — these decisions are expensive to change later.
Shall I detail the chunking approach first?

Scenario 2: Orchestrating a Multi-Agent Data Processing Pipeline

A developer needs to build a pipeline that ingests raw customer feedback, classifies it by category, extracts action items, and stores structured results for downstream reporting.

<strong>Developer:</strong> I need a pipeline: raw customer feedback comes in via webhook,
gets classified (bug/feature/praise), action items get extracted from bugs
and features, and the structured output goes to our reporting database.
I want to use multiple specialized agents. How do I structure this?

<strong>Task Decomposition Expert:</strong> Classic fan-out / fan-in orchestration pattern.
Let me check ChromaDB first for any existing feedback collections.

[Calls chroma_list_collections]
[Calls chroma_query_documents on feedback_raw if it exists]

No existing collections. Here's the workflow architecture:

ORCHESTRATION PATTERN: Sequential with conditional fan-out

STAGE 1 — Ingestion Agent
Receives webhook payload, normalizes to schema, stores raw text to
ChromaDB collection: feedback_raw with metadata: timestamp, source, customer_id

STAGE 2 — Classification Agent (depends on Stage 1)
Queries feedback_raw for unclassified items, runs classification,
updates records with category field. Can process in batches of 50.

STAGE 3 — Conditional Fan-Out (depends on Stage 2)
IF category == "bug" OR "feature" → route to Action Item Extraction Agent
IF category == "praise" → route directly to Reporting Formatter

STAGE 4 — Action Item Extraction Agent
Queries ChromaDB for classified bugs/features, extracts structured
action items, stores to: feedback_processed collection

STAGE 5 — Reporting Formatter (depends on Stages 3 and 4)
Aggregates from feedback_processed, formats for downstream DB schema

PARALLEL EXECUTION OPPORTUNITY: Stages 3 and 4 can overlap — start
extracting action items from early batches while classification continues.

ERROR HANDLING: Dead letter queue for malformed webhooks,
idempotency keys to prevent duplicate processing on retry.

Want me to detail the ChromaDB schema for feedback_raw first?

How to Install the Task Decomposition Expert

Installing this agent in Claude Code takes under a minute. Claude Code automatically discovers and loads agent definitions stored in your project’s .claude/agents/ directory — no configuration files, no registration steps required.

Create the agent file at this path in your project:

.claude/agents/task-decomposition-expert.md

Paste the full system prompt (the agent body above, starting with “You are a Task Decomposition Expert…”) into that file and save it. The next time you open Claude Code in that project, the agent will be available. You can invoke it by name in your conversations, or Claude Code will suggest it proactively when it detects a task that matches the agent’s capabilities.

If you want this agent available across all projects rather than just one, place the file in your global Claude Code agents directory instead of a project-specific one. Check the Claude Code documentation for the global agents path on your operating system.

No dependencies to install, no API keys to configure. If you have ChromaDB MCP tools available in your Claude Code environment, the agent will use them immediately. If you don’t, the agent still functions for workflow architecture and decomposition — the ChromaDB integrations simply won’t execute until that MCP server is configured.

Practical Next Steps

Install the agent, then use it proactively on your next complex project — before you start implementation. The pattern is simple: describe your goal, answer the clarifying questions the agent asks, and work with the decomposition it produces before writing any code.

If you’re already mid-project and feeling the pain of uncoordinated complexity, it’s not too late. Describe your current state and your remaining objectives. The agent can decompose from where you are, not just from a clean start.

For teams, consider committing the agent file to your shared repository so every developer on the project has access to consistent workflow planning capabilities. The .claude/agents/ directory is designed to be version-controlled alongside your code.

The real leverage here is cultural as much as technical: building the habit of decomposing before implementing. This agent makes that habit frictionless enough to actually stick.

Agent template sourced from the claude-code-templates open source project (MIT License).

Share.
Leave A Reply