03
How the skills work together
The skills serve 2 purposes. The main one is to go from idea to spec. The second is to maintain the boundary model of the system. The second is optional: the idea to spec skills work without a map.
Two jobs
Section titled “Two jobs”- Your idea(optional) Boundary map
shape-boundaries- Boundary changes
slice- Slices
refine- Expected behavior and design decisions
to-issues- Issues
extract-boundariesDrafts a map of your system from its code.review-boundariesReviews the map with you, screen by screen.update-boundariesBrings the map up to date after the code changes.
From idea to spec
Section titled “From idea to spec”Start from your intended changes
A request in your own words, with several changes tangled together.
"Shoppers should be able to pay with gift cards and see what's left on them. In the app too. And can they pay part of an order with a card?"
Clarify the behavior changes, from the outside in
shape-boundariesturns your request into boundary changes, marked against the map: first between your users and the system, then between the parts inside it. Questions about details wait.External boundaryShopper ↔ StoreMODIFIED- NEWresourceGift card
- MODIFIEDcapabilityPlace ordermutates Gift card
- NEWcapabilitySee gift card balanceobserves Gift card
Internal boundaryStorefront ↔ PaymentsMODIFIED- MODIFIEDcapabilityCharge ordermutates Gift card
- MODIFIEDcapabilityRefund ordermutates Gift card
Details, for laterWhat do gift card codes look like?What if two orders spend the same card at once?Group the changes into increments you can observe
slicegroups the boundary changes into slices, each an increment people can observe once it lands. It compares ways to split the change and recommends one, here byinterface.Increment 1 · Pay on the webNEWGift cardMODIFIEDCharge orderMODIFIEDRefund orderSPLITPlace orderweb shopIncrement 2 · See the balanceNEWSee gift card balanceIncrement 3 · Pay in the appSPLITPlace ordermobile appSettle the details of each increment
refinesettles each increment's details, starting from the questions set aside: what people can observe once it works, and how it is built.Increment 1 · Pay on the webExpected behaviorA shopper pays for an order in the web shop with a gift card code.
Design decisions- Codes are 16 characters, without look-alikes such as 0 and O.
- Payments locks the card while it charges, so two orders cannot spend the same balance.
- Codes are stored hashed, never in plain text.
Expected behaviorCanceling the order puts the money back on the gift card.
Design decisions- Each balance is kept as a list of adjustments, so a refund adds one back.
- A refund reuses its charge's id, so it can never run twice.
Turn each increment into an issue
to-issuesturns each increment into an issue that carries its expected behavior and its proof of done, so an agent can build from it.IssuePay with a gift card on the webProof of done: pay an order with a gift card in the web shop and see its balance go down.
IssueSee a gift card's balanceProof of done: open a gift card and see what is left on it.
IssuePay with a gift card in the appProof of done: pay an order with a gift card in the mobile app.
Boundary map maintenance
Section titled “Boundary map maintenance”Start from your code
A repository, with whatever documentation it has.
store/web/app/storefront/payments/docs/Draft a map from the code
extract-boundariesreads the code one level at a time, checks eachboundaryagainst it, and drafts the map.Map DRAFTEach part cites its files:
storefront/checkout.ts,payments/charge.tsReview it with you, screen by screen
review-boundariesshows one screen at a time and asks a few short questions, each with a suggestion. The map is saved when the review ends.Level 2 · Question 1 of 3Is Payments one component, or two: running charges and scoring fraud?
SUGGESTEDTwo. Fraud check alone decides a payment's score.
Bring it up to date after changes land
update-boundariessorts the files changed since the map's revision by the part of the map they touch, and you review only what changed.Changed files- Payments
payments/gift-cards.tsadded - Payments
payments/charge.ts - Storefront
storefront/checkout.ts
Map changes- NEWcomponentGift cards
- MODIFIEDcapabilityCharge order
- MODIFIEDcapabilityPlace order
- Payments