Skip to content

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.

Under every skill
From idea to spec
  1. Your idea(optional) Boundary map
  2. shape-boundaries
  3. Boundary changes
  4. slice
  5. Slices
  6. refine
  7. Expected behavior and design decisions
  8. to-issues
  9. Issues
Boundary map maintenance (optional)
Behavior
  1. 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?"

  2. Clarify the behavior changes, from the outside in

    shape-boundaries turns 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?
  3. Group the changes into increments you can observe

    slice groups 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 by interface.

    Increment 1 · Pay on the web
    NEWGift card
    MODIFIEDCharge order
    MODIFIEDRefund order
    SPLITPlace orderweb shop
    Increment 2 · See the balance
    NEWSee gift card balance
    Increment 3 · Pay in the app
    SPLITPlace ordermobile app
  4. Settle the details of each increment

    refine settles 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 web
    Expected behavior

    A 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 behavior

    Canceling 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.
  5. Turn each increment into an issue

    to-issues turns 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 web

    Proof of done: pay an order with a gift card in the web shop and see its balance go down.

    IssueSee a gift card's balance

    Proof of done: open a gift card and see what is left on it.

    IssuePay with a gift card in the app

    Proof of done: pay an order with a gift card in the mobile app.

Implementation details
  1. Start from your code

    A repository, with whatever documentation it has.

    store/web/app/storefront/payments/docs/
  2. Draft a map from the code

    extract-boundaries reads the code one level at a time, checks each boundary against it, and drafts the map.

    Map DRAFTCONSUMERShopperPROVIDERStoreStorefrontPayments

    Each part cites its files: storefront/checkout.ts, payments/charge.ts

  3. Review it with you, screen by screen

    review-boundaries shows 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 3

    Is Payments one component, or two: running charges and scoring fraud?

    SUGGESTEDTwo. Fraud check alone decides a payment's score.

  4. Bring it up to date after changes land

    update-boundaries sorts the files changed since the map's revision by the part of the map they touch, and you review only what changed.

    Changed files
    • Paymentspayments/gift-cards.tsadded
    • Paymentspayments/charge.ts
    • Storefrontstorefront/checkout.ts
    Map changes
    • NEWcomponentGift cards
    • MODIFIEDcapabilityCharge order
    • MODIFIEDcapabilityPlace order