Claude Certified Architect - FoundationsCCAR-F Learning Guide
Domain 1 · Lesson 1.6 · 5 min read

Task Decomposition Strategies

Exam taskDesign task decomposition strategies for complex workflows

Use a fixed chain of steps when the work is predictable and an adaptive plan when each finding changes what to do next; split large reviews into per-file passes plus an integration pass.

What you need to know

Decomposition is how a large task becomes a set of smaller ones. The exam asks you to choose between two families.

Fixed sequential pipeline (prompt chaining)Dynamic, adaptive decomposition
ShapeThe same steps in the same order every timeThe next subtask is chosen from what the last one found
FitsPredictable, multi-aspect work: a review that always checks the same five thingsOpen-ended investigation: an incident, an unknown codebase
StrengthCheap, testable, easy to debugHandles what nobody anticipated
WeaknessCannot react to surprisesHarder to predict cost and time

Prompt chaining

A chain passes each step's output into the next. A code review chain might be: analyse each file on its own, then run one cross-file pass that checks how the files fit together. Each prompt is small and focused, and you can add a gate between steps: for example, if linting finds severe problems, skip type checks and go straight to the summary.

Splitting large reviews

A single prompt asked to review 20 files at once suffers attention dilution: some files get careful attention, others a skim, and findings can contradict each other. The fix is two kinds of pass:

  1. Per-file local passes, one file at a time, for local issues.
  2. A separate integration pass for cross-file concerns: data flow, interface mismatches, duplicated logic.

Adaptive investigation plans

Some tasks cannot be planned up front. "Add comprehensive tests to a legacy codebase" with no further detail is an example. A good decomposition does not start writing tests; it:

  1. Maps the structure: modules, entry points, dependencies, existing coverage.
  2. Identifies high-impact areas: code that changes often, handles money, or has no tests.
  3. Creates a prioritised plan, then adapts it as dependencies and surprises are discovered.

In the exam

Most stems describe a task and ask which decomposition fits, or describe a large review with inconsistent findings. Match predictable work to chaining, open-ended work to adaptive plans, and many-file reviews to per-file plus integration passes.

Check your understanding

Question 1

A team must review security, naming, error handling, tests and docs on every pull request. Which decomposition fits?

Show answer

Answer: B. The checks are the same every time, so a fixed sequential chain is cheaper, predictable and easy to test.

Question 2

Reviews of 25-file pull requests miss issues in some files and contradict themselves. What should change?

Show answer

Answer: A. Per-file passes give every file full attention; the integration pass handles cross-file concerns. That removes dilution and the contradictions it causes.

Question 3

An agent is told to "add comprehensive tests" to a legacy codebase with no further detail. What should it do first?

Show answer

Answer: D. Open-ended work needs mapping first: structure, dependencies, coverage and risk. The prioritised plan then adapts as the agent learns more.

Apply it: Plan Lakeshore's pricing tests

Exercise · about 15 minCase: Lakeshore Freight

An engineer asks Lakeshore's agent to "add tests to the pricing module". Coverage is about 9% and nobody knows the dependencies. Write the agent's decomposition.

  1. Choose the decomposition family and justify it in two sentences.
  2. Write the mapping phase. List what the agent must find out before writing any test.
  3. Write the prioritisation rule that turns the map into an ordered plan.
  4. Say how the plan adapts when the agent discovers that pricing depends on a currency service nobody mentioned.
Check your work
Show model answer

1. Family. Dynamic, adaptive decomposition. The work is open-ended and the right first test depends on what the map reveals, so a fixed chain would guess.

2. Mapping phase

  • Entry points of the pricing module and who calls them (Grep for the public classes).
  • Its dependencies: other modules, services, the database.
  • Existing tests and what they cover.
  • Change frequency from version history, and any open bugs tagged pricing.

3. Prioritisation. Score each unit by impact (money calculated, number of callers) times risk (no tests, frequent changes, open bugs). Plan tests from the highest score down, starting with pure calculation code that needs no external services.

4. Adapting. When the currency service appears, the agent adds a subtask: find how pricing calls it and whether a test double already exists. Units that depend on it move behind the creation of that double; units that do not keep their place. The plan is updated and shown to the engineer before continuing.

Sources

Go hands-on optional, needs a Claude API key

Runnable notebooks from Anthropic's Claude Cookbook that build the patterns in this lesson.