AI Playbook中文

Coding agents

End-to-end pipeline: a small in-app purchase feature, from plan and dual-agent review to a cloud build

Verification

Tested on
2026-11-23
What was tested
Plan phase (2 review rounds), code phase (2 review rounds), Flutter analyze/tests and one macOS simulator build were run on the real feature in 2026-11-22..23. NOT done: real sandbox/TestFlight purchase, store submission, release. Token usage was not logged: all cost numbers below are estimates.
Evidence level
Dated run records or re-runnable tests
Status
Published
Version
0.1.0
Updated
2026-11-29
Source commit
a8fb8db149
Tools
Claude Code, Codex CLI, Orca (multi-agent IDE), Codemagic (macOS cloud CI), GitHub Actions, Flutter
Models
Claude Sonnet 5.5, GPT-based Codex
Audience
developers
Availability in mainland China
Partly available
Alternatives for mainland China
Writer/reviewer: any two different coding agents, e.g. Kimi Code, GLM Coding Plan, Qwen Code, Codex, Cloud iOS build: any macOS CI or your own Mac

Framing: a solo developer's workflow. Any pair of coding agents works; Claude and Codex are just the pair we used. Wherever Claude is mentioned: Anthropic has not supported mainland China, Hong Kong and Macau since 2026-11-12 (verified 2026-11-23: https://www.anthropic.com/legal/supported-regions). Scope: a design-and-export example, not a hosted runtime. Numbers are orders of magnitude or estimates; anything not run is marked "not tested".

Situation

What the pipeline does (requirement → spec)

Requirement: "add one purely voluntary tip purchase to stl2stp (an iOS app converting STL to STEP/IGES); it unlocks nothing." Walked through the seven-step method from our own task of 2026-11-22..23 (internal task folder, redacted, not published verbatim).

Method step What we did Record you can point to
1 Intake Scope from the owner; open questions listed in the plan, answered one by one: D1 one tier, USD base price, unlocks nothing; D2 the old one-time Pro is no longer sold to new users; D3 iOS-native StoreKit 2 only; D4 only code is authorized — no upload, submission or release decision list in the plan
2 Decompose 10 stages, each code / model / human (table above, yaml) stages in pipeline.yaml
3 Pattern workflow:evaluator: fixed order with an independent read-only reviewer per phase; no parallel multi-agent code writing pattern_reason
4 Spec the writer drafts PLAN.md/TASKS.md (scope, prohibitions, test matrix, store-console steps), self-reviews, hands over plan + state file
5 Gates plan: static checks → review (≤3 rounds) → owner approval; code: analyzer + tests → review (≤3 rounds) → cloud macOS simulator build → owner reads the diff one verdict file per round
6 Reliable runs verdicts saved per round, never overwritten; builds watched read-only via the relay protocol; code that cannot compile locally is BLOCKED_ENV, never PASS state file + build registry
7 Cost see ROI below; token usage was not logged, so all numbers are estimates cost_roi

Pipeline spec: pipelines/e2e/e2e-tip-iap-ship-pipeline.pipeline.yaml, filled from the template; a design document, not executable. The stage table above (Chinese section) lists all 10 stages and their gates.

Real timeline (dated)

Date Event Result
2026-11-22 plan review round 1 CHANGES: 1 major (a reconciliation gap for refunded legacy purchases made while the app was closed); the author revised only that
2026-11-22..23 plan review round 2 APPROVE (0 blocker / 0 major). Codex quota was 0, so review went to a separate read-only Claude worker (see quota-based-model-routing; Grok is not used for in-app purchase)
2026-11-23 owner approved the plan; code written code round 1 APPROVE (5 minors; 4 fixed after review)
2026-11-23 owner answered open questions: nobody ever bought the legacy Pro the whole reconciliation/migration code was deleted; because code changed materially, a second code review → APPROVE (4 minors); tests +85 pass
2026-11-23 owner authorized pushing only a feat/ branch (not master); cloud ios-simulator build started manually build passed in about 46 minutes: the first time the native Swift code was ever compiled (no Xcode locally)
later sandbox purchase, TestFlight, submission not done (not authorized; no record in what we read). Whether it shipped: not verified

Filled eval checklist (following the template)

Eval plan, sample table and gold cases G1–G5 are in the Chinese section above. In short: gold set tip-iap-pipeline-gold-v0 has only 5 cases (template suggests ≥20; stated honestly), all from real events: a normal pass (G1); a plan review that must say CHANGES on the refund-reconciliation gap (G2); native code that cannot compile locally must be BLOCKED_ENV, not PASS (G3); code edited after approval must be re-reviewed (G4); outdated environment facts must be re-checked (G5). Actual N for error analysis is one full run. min_pass_rate 0.8 counts trial slots (design target, not measured).

ROI estimate (all estimates, not measured; token usage was not logged)

Failure cases

China alternatives

Safety notes

Test notes

Related recipes (not repeated here)

dual-agent-write-review-loop · quota-based-model-routing · agent-task-approval-gate · ci-build-monitor-relay · review-kit-bootstrap · coordinator-agent-specs

来源 / Sources

Related recipes

Pipeline design: End-to-end pipeline: a small in-app purchase feature, from plan and dual-agent review to a cloud build

Export to your agent

Path: e2e-tip-iap-ship-pipeline/SKILL.md

Preview
---
name: e2e-tip-iap-ship-pipeline
description: "End-to-end pipeline: a small in-app purchase feature, from plan and dual-agent review to a cloud build. Use when the user asks for help with this task."
metadata:
  version: "0.1.0"
  status: "published"
  source-commit: "5f7272be13826bec473d6f2e073c82a5a620f1d2"
---

# End-to-end pipeline: a small in-app purchase feature, from plan and dual-agent review to a cloud build

- Version: 0.1.0
- Status: published
- Tested on: 2026-11-23
- Tested scope: Plan phase (2 review rounds), code phase (2 review rounds), Flutter analyze/tests and one macOS simulator build were run on the real feature in 2026-11-22..23. NOT done: real sandbox/TestFlight purchase, store submission, release. Token usage was not logged: all cost numbers below are estimates.
- Evidence level: field-use-logged
- Source commit: 5f7272be13826bec473d6f2e073c82a5a620f1d2

> Reference playbook: follow it only when the user asks for this task, and ask a human before running commands or irreversible actions.

## English

> **Framing: a solo developer's workflow.** Any pair of coding agents works; Claude and Codex are just the pair we used. Wherever Claude is mentioned: **Anthropic has not supported mainland China, Hong Kong and Macau since 2026-11-12 (verified 2026-11-23: <https://www.anthropic.com/legal/supported-regions>).**
> Scope: a **design-and-export** example, not a hosted runtime. Numbers are **orders of magnitude or estimates**; anything not run is marked "not tested".

### Situation
- **Who:** a solo developer adding a **money-touching feature** (tip, subscription, in-app purchase) to an existing app, who cannot verify everything locally (no Xcode here) and does not want one agent to write and approve its own work.
- **When:** payment, permission or data-migration code, where mistakes are expensive.
- **Not for:** one-line or copy-only changes (use the light mode of `dual-agent-write-review-loop`); cases where nobody will read the final diff.

### What the pipeline does (requirement → spec)
Requirement: "add one **purely voluntary tip** purchase to stl2stp (an iOS app converting STL to STEP/IGES); it unlocks nothing." Walked through the seven-step method from our own task of 2026-11-22..23 (internal task folder, redacted, not published verbatim).

| Method step | What we did | Record you can point to |
|---|---|---|
| 1 Intake | Scope from the owner; open questions listed in the plan, answered one by one: **D1** one tier, USD base price, unlocks nothing; **D2** the old one-time Pro is no longer sold to new users; **D3** iOS-native StoreKit 2 only; **D4** only code is authorized — no upload, submission or release | decision list in the plan |
| 2 Decompose | 10 stages, each `code` / `model` / `human` (table above, yaml) | `stages` in `pipeline.yaml` |
| 3 Pattern | `workflow:evaluator`: fixed order with an **independent read-only reviewer** per phase; no parallel multi-agent code writing | `pattern_reason` |
| 4 Spec | the writer drafts `PLAN.md`/`TASKS.md` (scope, prohibitions, test matrix, store-console steps), self-reviews, hands over | plan + state file |
| 5 Gates | plan: static checks → review (≤3 rounds) → **owner approval**; code: analyzer + tests → review (≤3 rounds) → cloud macOS simulator build → **owner reads the diff** | one verdict file per round |
| 6 Reliable runs | verdicts saved per round, never overwritten; builds watched read-only via the relay protocol; code that cannot compile locally is `BLOCKED_ENV`, never PASS | state file + build registry |
| 7 Cost | see ROI below; token usage was not logged, so all numbers are estimates | `cost_roi` |

**Pipeline spec:** `pipelines/e2e/e2e-tip-iap-ship-pipeline.pipeline.yaml` (pipeline spec: e2e-tip-iap-ship-pipeline), filled from the template; a design document, not executable. The stage table above (Chinese section) lists all 10 stages and their gates.

### Real timeline (dated)
| Date | Event | Result |
|---|---|---|
| 2026-11-22 | plan review round 1 | **CHANGES**: 1 major (a reconciliation gap for refunded legacy purchases made while the app was closed); the author revised only that |
| 2026-11-22..23 | plan review round 2 | **APPROVE** (0 blocker / 0 major). **Codex quota was 0, so review went to a separate read-only Claude worker** (see `quota-based-model-routing`; Grok is not used for in-app purchase) |
| 2026-11-23 | owner approved the plan; code written | code round 1 **APPROVE** (5 minors; 4 fixed after review) |
| 2026-11-23 | owner answered open questions: nobody ever bought the legacy Pro | the whole reconciliation/migration code was deleted; because code changed materially, **a second code review → APPROVE** (4 minors); tests +85 pass |
| 2026-11-23 | owner authorized pushing only a `feat/` branch (not master); cloud `ios-simulator` build started **manually** | build passed in about **46 minutes**: the first time the native Swift code was ever compiled (no Xcode locally) |
| later | sandbox purchase, TestFlight, submission | **not done** (not authorized; no record in what we read). Whether it shipped: not verified |

### Filled eval checklist (following the template)
Eval plan, sample table and gold cases G1–G5 are in the Chinese section above. In short: gold set `tip-iap-pipeline-gold-v0` has **only 5 cases** (template suggests ≥20; stated honestly), all from real events: a normal pass (G1); a plan review that must say CHANGES on the refund-reconciliation gap (G2); native code that cannot compile locally must be `BLOCKED_ENV`, not PASS (G3); code edited after approval must be re-reviewed (G4); outdated environment facts must be re-checked (G5). Actual N for error analysis is one full run. `min_pass_rate` 0.8 counts trial slots (design target, not measured).

### ROI estimate (**all estimates, not measured**; token usage was not logged)
- Tokens: about 10^6–10^7 raw tokens per feature (from document sizes and multi-turn loops; not recorded).
- Cash-price proxy: roughly 1–20 USD per feature at API list prices. **Prices come from secondary aggregators and were not verified against the official page** (<https://platform.claude.com/docs/en/about-claude/pricing>; re-check and date it yourself). We actually used subscription quota: **not free**, usage not recorded.
- Time: about 2 calendar days (11-22..23) plus a 46-minute build; the owner's own time was **not timed**.
- Baseline without agents: 8–24 hours (estimate, **not measured**). If it holds, break-even is under one month — **do not read this as a forecast**: it is driven by the unmeasured human baseline, not by token cost.
- Value not in the numbers: the review caught a major in the plan phase; the cloud build exposed the "Swift never compiled" blind spot.

### Failure cases
- **The major was moot:** the round-1 major concerned legacy Pro refunds; the owner later confirmed none were ever sold and the code was removed. Lesson: **ask business-fact questions before review** (list them in intake).
- **No Xcode, no "pass":** reviewers can only read native code; the cloud build is the first real compile.
- **Hard-coded simulator name:** on another branch the same week, the native test step failed because a hard-coded iPhone 16 simulator was missing in the new image; the step was non-fatal so the build looked green. Later fixed by picking an available simulator. **Read every step, not just the overall status.**
- **Quota ran out:** review was rerouted to avoid a stall; the gate standard was not lowered.

### China alternatives
- `china_availability: partial`. Claude is unavailable in the mainland, Hong Kong and Macau; use Kimi Code, GLM Coding Plan, Qwen Code or similar. **What matters is two different agents, not a vendor.** We did not run the complete flow with these substitutes (not tested).
- Any macOS CI or your own Mac works for the iOS build; mainland App Store release has extra requirements (ICP filing etc.) outside this recipe. We do not teach circumventing region or terms limits.

### Safety notes
- **For money-touching code, don't use the weakest model as the reviewer.** In our routing table, in-app purchase and payment changes are never reviewed by Grok.
- Sandbox account passwords, certificates, signing files and webhooks never go in docs or chat; record only "created / date".
- Push only `feat/` branches; the TestFlight workflow (uploads to the store console) needs a fresh approval every time.
- The cloud build is **started by hand**; a push does not trigger it — on purpose, so a human sits in front of the spending step.

### Test notes
- Tool versions: Codex CLI 0.171.0 (2026-11-23 environment); Claude Sonnet 5.5 as one of the writer/reviewers; Flutter 3.38.7 and an Xcode 26.6 image (from our internal CI notes, 2026-11-23).
- **Not tested:** sandbox/real-device purchase, submission, the China-side substitute pairing, `pass^k`.

### Related recipes (not repeated here)
dual-agent-write-review-loop (recipe: dual-agent-write-review-loop) · quota-based-model-routing (recipe: quota-based-model-routing) · agent-task-approval-gate (recipe: agent-task-approval-gate) · ci-build-monitor-relay (recipe: ci-build-monitor-relay) · review-kit-bootstrap (recipe: review-kit-bootstrap) · coordinator-agent-specs

## 来源 / Sources

- Anthropic supported regions (checked 2026-11-23): <https://www.anthropic.com/legal/supported-regions>
- Apple, in-app purchase and StoreKit documentation: <https://developer.apple.com/documentation/storekit>
- Apple App Review Guidelines 3.1.1: <https://developer.apple.com/app-store/review/guidelines/>
- Anthropic pricing (official; **not verified for the numbers above**): <https://platform.claude.com/docs/en/about-claude/pricing>