From build-like-amazon
Decomposes features into thin, deployable vertical slices with feature flags, safe defaults, and rollback safety. Use when starting implementation or when PRs exceed ~200 lines.
How this skill is triggered — by the user, by Claude, or both
Slash command
/build-like-amazon:incremental-implementationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Incremental implementation means decomposing any feature into the thinnest possible vertical slices—each of which is independently deployable, testable, and rollback-safe. Every slice passes through the full stack (API → logic → storage → observability) rather than building horizontal layers that only work when all layers are combined.
Incremental implementation means decomposing any feature into the thinnest possible vertical slices—each of which is independently deployable, testable, and rollback-safe. Every slice passes through the full stack (API → logic → storage → observability) rather than building horizontal layers that only work when all layers are combined.
At Amazon, this is not optional. A team that attempts a big-bang release—weeks of uncommitted code merged at once—will face pipeline rejection, delayed launches, and operational incidents. The one-slice-at-a-time principle ensures that at any point in time, main is deployable and the system is in a known-good state.
Amazon deploys million times per year across its services. This velocity is only possible because each deployment is small, reversible, and independent. The culture of "one commit per slice" emerged from painful lessons: large merges cause cascading failures, extended debugging sessions, and blocked pipelines.
Amazon's deployment system enforces bake times between stages. If your deployment contains 15 unrelated changes and one fails, all 15 roll back. This economic reality makes small, focused deployments the only rational strategy.
Feature flags let teams deploy code to production without exposing it to customers. This decouples deployment from release, allowing code to bake safely while business stakeholders decide when to activate.
Given a design document, decompose the feature into slices using these criteria:
| Criteria | Good Slice | Bad Slice |
|---|---|---|
| Vertical completeness | Touches API → logic → storage → test | Only adds a database table |
| Independent value | Works even if later slices are never built | Requires slice 3 and 5 to function |
| Size | 50-200 lines of production code | 1000+ lines |
| Reviewability | One reviewer can understand in 30 min | Requires 2-hour review meeting |
| Rollback safety | Can be reverted without data migration | Creates irreversible schema changes |
Each slice gets exactly one commit (or one squash-merged PR):
feat(orders): add feature flag for async-order-processing
feat(orders): add OrderEvent DynamoDB table with TTL
feat(orders): implement order placement behind flag
feat(orders): handle duplicate order submissions
feat(orders): add latency and error metrics for order flow
feat(orders): enable async-order-processing for 1% canary
Every behavioral change ships behind a flag:
# Safe default: feature OFF
if feature_flags.is_enabled("async-order-processing", default=False):
return await process_order_async(order)
else:
return process_order_sync(order) # existing path unchanged
Rules:
Every slice must answer: "How do I undo this in under 5 minutes?"
| Change Type | Rollback Strategy |
|---|---|
| New code behind flag | Turn off flag (seconds) |
| Database additive (new table/column) | Leave in place, stop writing |
| Database destructive (drop/rename) | NEVER in same slice as logic change |
| Config change | Revert config (deploy not needed) |
| API contract change | Version the API, keep old version alive |
Before merging each slice:
Incremental delivery is necessary but not sufficient. The code inside each slice must be readable, testable, and maintainable by an engineer who is not the author. Quality is not the polish phase — it is how the code is written from the first line.
This section is the bar the agent applies while writing code. The Code Review Bar Raiser will hold the same bar after the fact; meeting it during writing avoids the rework loop.
Paradigm choice is a tool, not an identity. Match it to the shape of the problem:
Reservation that moves through states, an Order that owns invariants, a Connection that holds resources. Prefer encapsulation, polymorphism for variant behavior, and dependency inversion at boundaries.The same codebase routinely mixes paradigms. A handler at the edge does I/O (procedural shell), calls pure functions for transformation (functional core), and persists to a domain entity (OO at the storage boundary). This is the functional core, imperative shell pattern, and it is the default when no other shape is forced by the problem.
Don't argue paradigms. Pick the one that makes this code clearer to read and easier to test, and move on.
SOLID is for the OO parts of the codebase. Apply each principle when it solves a real problem; don't apply them ceremonially.
The trap with SOLID is over-application. Three classes is not a hierarchy. One implementation behind an interface is premature abstraction. Add the interface when the second concrete implementation is real, not hypothetical.
These are not stylistic preferences — they are how the next engineer (or your future self at 3 AM) reads the code.
process tells you nothing; chargeCustomerWithRetry tells you what, who, and how. Variables named data, info, temp, result are red flags — they mean the author hadn't decided what the thing was.requests.HTTPError leak into your business logic.These are common shortcuts that look pragmatic in the moment and become someone else's incident later:
any / unknown / dynamic typing as escape hatches. They hide problems instead of solving them. Type the boundary.test-driven-development.)Each slice's code, before merge, should pass this read-aloud test:
"A teammate who didn't write this code can read the diff in 10 minutes, explain in their own words what changed, why it changed, and how to undo it — without asking the author."
If the answer is no, the code is not done. Rename until functions describe themselves. Extract until each piece does one thing. Delete the dead branch. Reduce the nesting. Then merge.
| Mechanism | What It Enforces | How |
|---|---|---|
| PR size limits | Max 400 lines per PR | CI check rejects oversized PRs |
| Feature flag registry | All new features gated | Deployment pipeline checks flag existence |
| Pipeline bake times | Each deployment observed before proceeding | Deploy canary stages |
| Commit message linting | One logical change per commit | Conventional commits enforced in CI |
| Deployment frequency dashboard | Teams track deployment cadence | Weekly metrics review surfaces stalled code |
| Rationalization | Why It's Wrong | What To Do Instead |
|---|---|---|
| "It's all one feature, it has to go together" | Features are always decomposable. If you can't find slices, you don't understand the feature yet. | Spend 30 more minutes on decomposition. Draw a dependency graph. The slices will appear. |
| "It's faster to build it all and test once" | It feels faster but isn't. Integration bugs compound. A 2-week big-bang becomes a 4-week debug session. | Track actual cycle time. Small slices shipped daily outperform weekly big merges every time. |
| "The feature flag adds complexity" | Flags add trivial complexity. Debugging a 2000-line merge at 2 AM adds real complexity. | The flag cost is 3 lines of code. The debugging cost is 3 hours of incident response. Choose. |
| "I need the database change and the logic together to test" | You can test writes to a new table without activating the feature. Separate deploy from release. | Deploy the table. Write integration tests that directly exercise it. Then deploy the logic that calls it. |
| "We'll just be careful with the big merge" | Hope is not a strategy. Every big-bang incident report starts with this sentence. | Mechanisms over good intentions. If the process allows big merges, someone will ship a broken one. |
main by more than 500 linesprocess, handle, do, or variables named data, info, temp survive into the merged coderequests.HTTPError, psycopg2.OperationalError) leak into business logicAfter implementing a feature incrementally, verify:
main, it's not ready. No exceptions.npx claudepluginhub robisson/build-like-amazon-agent-skillsGuides incremental shipping of large features, migrations, and refactors via vertical slices behind feature flags and refactor-with-evidence using test/perf deltas.
Breaks multi-file features into incremental slices. Implement, test, verify, then commit each vertical slice. Useful for large changes that should leave the system in working state.
Orchestrates end-to-end backend feature development from requirements through deployment, coordinating multi-phase delivery across teams and services.