Examples · Atlas Payments demo project

Example: add Apple Pay, from brief to built code

A developer takes one OpenSpec change from a short brief to committed, tested code. The agent writes the plan; Kitsune checks it and builds it task by task.

For
Developer
Time
About 30 minutes
Plan
Writing the brief and handing it to your agent work on Free. Check change and Build with agent need Solo Pro or Team.

Atlas Payments wants Apple Pay on its checkout before the holiday season: three large merchants asked for it, and mobile checkout drops 31% at the card form. This example follows the change add-apple-pay in the demo project from the first sentence of the brief to code on a branch. For every click in detail, follow the plan and build tutorial on your own project.

You start with: the Atlas Payments project linked in Kitsune, its checkout spec, and Claude Code connected in User settings → Agents.

1. Write the brief#

Choose New doc → Change brief, pick the project and the Full profile, since Apple Pay touches checkout, the payments API and the ledger. The creator asks why, what is in and out of scope, the decisions still open and the acceptance criteria in EARS form. Create runs openspec new change add-apple-pay and writes the proposal:

openspec/changes/add-apple-pay/proposal.md
## Why
Mobile checkout drops 31% at the card form. Apple Pay skips the form on supported devices, and three of our largest
merchants asked for it before the holiday season.

## What Changes
- Offer Apple Pay on checkout-web on supported devices and browsers
- Authorize Apple Pay tokens through the existing acquirer integration
- Record Apple Pay payments in the ledger like card payments, with the wallet as payment method

The criteria keep their error case. The agent turns it into a scenario:

openspec/changes/add-apple-pay/proposal.md
## Acceptance Criteria
- AC1: When a customer confirms the Apple Pay sheet, the system shall authorize the payment and show the receipt within
  3 seconds at p95.
  - Error: If the acquirer rejects the token, the system shall keep the cart and offer the card form.
- AC2: Where the device does not support Apple Pay, the system shall show only the card form.

The open questions go into the proposal too, assigned to the person who has to answer them, and show up in their Open questions page.

The reader showing the proposal of add-apple-pay, with its questions chip, the change list on the left and the inspector with status in-review and the assignee

2. Hand it to your agent#

After Create, Hand to your agent offers Start. Claude Code writes the delta spec, the design and the tasks. It can write only inside the change's folder and has no shell. The delta spec it wrote for checkout:

openspec/changes/add-apple-pay/specs/checkout/spec.md
## ADDED Requirements

### Requirement: Apple Pay
When a customer confirms the Apple Pay sheet, the system SHALL authorize the cart total with the Apple Pay token and
show the receipt within 3 seconds at p95.

#### Scenario: Paid with Apple Pay
- **WHEN** a customer on Safari for iOS confirms the sheet for a 42.00 EUR cart
- **THEN** the payment is authorized for 4200 minor units with payment method apple_pay and the receipt is shown

#### Scenario: Token rejected
- **WHEN** the acquirer rejects the Apple Pay token
- **THEN** the cart is kept and the card form is shown with "Apple Pay didn't go through — pay by card instead"

Every requirement has a SHALL and a scenario, and the rejected token from the brief became its own scenario.

3. Check the plan#

Before you approve it, Check change reads the planning files and lists findings by file: a requirement without SHALL or scenario, a task without a way to verify it, a risk without mitigation. The tasks of this change each carry a Verify line. A task without one gets the finding No Verify step:

openspec/changes/add-apple-pay/tasks.md
## 1. Checkout

- [x] 1.1 Show the Apple Pay button when `canMakePayments()` is true
  Verify: checkout-web unit test with ApplePaySession stubbed both ways
- [ ] 1.2 Open the payment sheet with the cart total and merchant name
  Verify: Playwright test on Safari with the Apple Pay sandbox
- [ ] 1.3 Fall back to the card form when the token is rejected

When a check does find something, Fix with agent sends the findings back for up to two rounds. Change check lists every finding.

4. Build it task by task#

With no warnings left, Build with agent shows the tasks, the branch kitsune/build/add-apple-pay, the check commands it found in the project (here npm test) and the limits per task. Then it works one task at a time in its own worktree. The agent writes the code, Kitsune runs npm test and Check change, and a task passes only when every check passes. Each passing task is ticked in tasks.md, committed as task 1.2: …, and the build waits for you.

The Build with agent sheet for add-apple-pay: the branch, five tasks with 1.1 done before and 1.2 committed, npm test and the document checks passed, the agent's summary and the diff

Choose Continue for the next task, or Retry task if the diff is not what you wanted. Kitsune never pushes or merges. When the last task is done, review the branch and merge it with your own Git.

What you have now#

  • openspec/changes/add-apple-pay/ with the proposal, the delta spec, the design and the tasks, all checked.
  • A branch with one commit per task, each one tested by your own checks.
  • The open questions tracked with the people who answer them.

Next: turn the specs into test cases. See Checkout test cases.