Engineering playbook

Efficient Compound Workflow

A practical, cost-aware way to ship repeatable work, build new features, and review PRs without wasting context, agent runs, or verification cycles.

Claude Code workflow4 execution lanesPlan → Work → Verify → Review
01

Classify the task first

Lane A

Port / repeat

A finished feature is a close template. Use one direct prompt.

Low Low–medium cost
Lane B

New feature

New behavior, API contract, schema, or multiple folders.

Medium Medium–high cost
Lane C

Risky change

Tenancy, billing, authentication, or cross-cutting behavior.

High Highest assurance cost
Lane D

Batch a PR

Several similar ports on one branch; review once at the end.

Batch One final review
Core principle: match the workflow to the risk and novelty of the task. Do not run the full pipeline for mechanical work.
02

Lane A · Porting or repeat work

No plan and no agents. Use the closest finished feature as the implementation template.

Start with a clean context
/clear
One focused prompt
Port <feature> from <source path> to store-admin/src/app/features/<x>/.
Follow the pattern in features/<finished-feature>/. Wire route, nav item and
reports hub if relevant. Then run: .claude/compound/qa.sh store-admin
  1. Skim git diff --stat and inspect the changed files yourself.
  2. Run the scoped QA script and commit.
  3. Skip per-feature /compound-review; batch review later in Lane D.
Batch similar ports in one prompt — for example, “port A, B, C in order, one commit each” — to avoid repeated cold starts.
03

Lane B · New feature

1

Explore (optional)

Ask a focused question without creating files: /compound-ask how does <area> work today? The plan step can reuse the conversation.

2

Plan

/compound-plan <feature, constraints, known file paths>. Give precise paths to focus the maximum two research agents. Read plans/<name>.md and trim scope yourself.

3

Clear, then work

Run /clear, then /compound-work plans/<name>.md. Five files or fewer: Solo mode. Fan out only when more than five files span several areas. Split large work into 2–3 plans.

4

Verify, scoped

Use /compound-verify tests only store-admin (or the relevant area). Avoid the expensive full union unless needed.

5

Review once per PR

/compound-review --task <slug> writes reports to reports/<slug>/ and keeps the main context small.

6

Capture only novel lessons

Run /compound-learnings <topic hint> only when the fix or discovery is non-obvious. Skip routine work.

04

Lane C · Risky or cross-cutting work

Follow Lane B, with two deliberate changes:

Planning

Use Opus for the plan

Switch to Opus (/model) only for /compound-plan.

Implementation

Use Sonnet for the work

Switch back to Sonnet for /compound-work.

Run /compound-verify unscoped once, just before the PR. Security, billing, and tenancy decisions still require human judgment and review.
05

Lane D · Batch a PR

1

Complete each port using Lane A

One commit per port, with qa.sh <area> run for each area.

2

Verify once at the end

/compound-verify tests only

3

Review the branch once

/compound-review --task <branch-slug>

4

Fix exact findings

Use /compound-fix <exact finding> — no teams and no new plans.

06

Stacked PRs · Review the dependency chain

When a feature is split across dependent pull requests, review the stack as one delivery sequence while keeping each PR independently understandable.

1

Make the stack explicit

Document the order and dependency of each PR (for example, PR 1 → PR 2 → PR 3). Each PR description should state its parent/base branch, what it adds, and what is intentionally deferred.

2

Review bottom-up

Start with the foundational PR, then review its child PRs in dependency order. Do not approve a child before the parent behavior and contract are understood.

3

Review the correct diff

For each stacked PR, inspect only the changes introduced by that PR relative to its parent branch — not the entire accumulated stack. Confirm the PR base is correct.

4

Check integration across the stack

After individual reviews, verify shared API contracts, migrations, types, and caller updates across the complete stack. Run the relevant tests against the integrated head.

5

Update the stack safely

When a parent changes, rebase or update child branches in order, resolve conflicts, and re-run affected checks. Keep each PR description and review status current.

6

Merge in dependency order

Merge the base PR first, then retarget or update the next PR to the new base, continuing until the stack is complete. Avoid merging dependent PRs out of order.

Review rule: one review pass per PR stack is efficient, but it does not mean one approval for the whole stack. Each PR still needs its own focused review and required checks; add a final integrated verification for the stack.
07

Rules that save the most

RulePractical effect
/clear between phasesPlan, work, and review start with clean context; files preserve the work.
Scope every verifyPrefer store-admin only or tests only.
Give plan file pathsSpecific inputs reduce unnecessary research reads.
Do not rerun all QA manuallyUse qa.sh <area> --failed; run --arch once at the end.
Fix findings directlyUse /compound-fix instead of re-planning.
Sonnet by defaultUse Opus for planning only; low effort for mechanical work.
Keep CLAUDE.md shortAgents re-read these files on cold starts.
Check /usageBefore Lane B/C. Near the limit, do Lane A or write plans; verify and review after reset.

Fast commands

/compound-ask
/compound-fix
/compound-plan
/compound-work
/compound-verify
/compound-review --task <slug>
 /compound-learnings

Cheat sheet

Unsure how it works? /compound-ask

Bug or polish? /compound-fix

Template exists? Direct prompt + qa.sh

New contract? Plan → clear → work → scoped verify → review once

PR ready? Tests-only verify → task review → fix → learnings if novel

08

Analyse first — before using Claude

Spend about ten minutes on human judgment before starting code generation. This is usually cheaper than asking an agent to discover the basics.

1

Write the goal in one sentence

Read the issue or requirement (for example, the analysis in ecom-fullstack#137).

2

Identify the folders

api/, storefront/, store-admin/, platform-admin/. An API contract change means updating the API and its callers together.

3

Find the closest finished feature

Use git log --oneline and the matching features/ folder.

4

Read local guidance and pitfalls

Open the feature's CLAUDE.md; search docs/solutions/ with grep -ri <keyword> docs/solutions.

5

Locate source and check Git state

Note the source implementation path. Check git status and confirm the correct branch.

6

Know what “done” looks like

Inspect the running app or design yourself and write observable acceptance checks.

Output to carry into your prompt: goal, folders, template feature, source path, and acceptance checks.
09

Where Claude is — and is not — useful

Use Claude for

  • Boilerplate that follows a template: components, routes, nav items, services, DTOs, tests.
  • Porting a screen or endpoint from a source project.
  • Understanding unfamiliar code with /compound-ask.
  • Debugging a concrete error or stack trace.
  • Planning a new cross-folder feature.
  • One review before a PR.
  • Writing DbUp SQL after you specify the schema — raw SQL only, never dotnet ef migrations add.

Do it yourself

  • Decide what to build, scope, and acceptance criteria.
  • Choose the template and read the requirement.
  • One-line fixes, renames, copy changes, and config values.
  • Search for a string or symbol with IDE search or grep.
  • Run builds, tests, and lint; share only failures.
  • Read a small diff and perform familiar Git operations.
  • Make security, billing, and tenancy decisions; a human must own these.
10

Start-work checklist

0 of 8 completed

11

Reusable prompt template

Fill in the specifics before handing the task to Claude. Keep the scope explicit.

Copy-ready template
Goal: <one sentence>
Folders: <store-admin | api | ...>
Template to follow: <path to a finished similar feature>
Source to port from: <path>
Acceptance: <2–3 observable checks>
Constraints: <e.g. raw SQL via DbUp, no EF migrations; update API and caller together>
Run when done: .claude/compound/qa.sh <area>
Do not: explore unrelated folders, refactor beyond this task.
12

Measure whether it is really cheaper

Savings are reasoned estimates, except Solo mode and qa.sh, which are based on measurements recorded in .claude/compound/qa.sh and compound-work.md.

1

Record the baseline

Note /usage before starting a task.

2

Compare similar work

Complete one task with the old workflow and a similar task with this workflow.

3

Compare usage deltas

Measure the difference, then keep the steps that actually help.

Trade-offs: skipping per-feature review may catch bugs later, and Lane A skips the docs/solutions/ search. If the area has known pitfalls, run /compound-ask first.