← The workflow

Worked examples

One requirement, every command, start to finish

Two requirements documents from a made-up Saudi wallet, followed through the whole team. Each step shows what you type, which architect picks it up, what it reads, what it writes, and where you decide.

  • Enterprise
  • Solution
  • Cloud and infra
  • Security
  • Research
  • The board
  • You decide

BRSD-014 · simulated run

Instant transfers to any Saudi bank

Samra Pay, a made-up Saudi wallet, wants customers to send money to any Saudi bank account in seconds. It reads like one feature, but it buys a fraud service, pays the bank per transfer and signs payment messages. So it goes through research and a demand assessment before anyone designs.

  • 10 steps
  • 8 commands
  • 2 decisions for you
  • 7 new documents
BRSD-014docs/brsd/BRSD-014-instant-transfers.pdf

Business requirements

  • BR-1A customer sends money from the wallet to any Saudi IBAN, at any hour, settled in seconds through the sponsor bank's instant payments link.
  • BR-2The recipient's name is shown before the customer confirms.
  • BR-3Every transfer is screened for fraud and sanctions in under 300 ms.
  • BR-4Customers can share a request-to-pay link with an amount.
  • BR-5Daily limit of SAR 20,000 per customer.
  • BR-6Compliance asks for transfer records to be kept for 10 years.

Non-functional

  • NFR-199.95% availability for sending.
  • NFR-2All customer data stays in the Kingdom.
docs/architecture/project.yaml
project:
  name: Samra Pay
  summary: Consumer wallet, licensed as a payments company
  stage: live, about 400,000 customers
  decision_maker: CTO; the MLRO for AML policy
stack:
  backend: Node 20, TypeScript, NestJS
  database: PostgreSQL 16 on Cloud SQL, HA
  auth: OIDC, device binding, step-up OTP
hosting:
  primary_cloud: GCP
  region: me-central2 (Dammam)
  residency_note: customer data stays in the Kingdom
integrations:
  - name: Sponsor bank
    purpose: IBAN accounts, instant payments
regulation:
  - SAMA rules for payment service providers
  - SAMA AML and CTF rules
  - Anti-Money Laundering Law
  - SAMA Cyber Security Framework
  - PDPL
data_protection:
  most_sensitive: national ID and Iqama numbers,
    IBANs, balances, screening results
  abuse_cases:
    - customer reads another customer's data
    - staff open a record not assigned to them
    - customer learns they were flagged
  log_rules: no ID numbers, IBANs or tokens

The company profile. It is the same for every BRSD; this one doesn't change it.

The route it took

A BRSD enters as a business requirement. It has a source to read and it buys things, so research and a demand assessment come before design. You decide twice.

  1. /arch-researchbrief, 6 questions
  2. /arch-enterpriseoutline, 3 options
  3. You decide: demandGo
  4. /arch-boardwhere it lives, sync or async
  5. /arch-docHLD
  6. /arch-docLLD, ADRs from 3 lanes
  7. You decide: designapprove, SAR 5,000 cap
  8. /arch-solutiona build question
  9. /arch-conform fixbefore the PR
  10. /arch-solutionmark Built

Stacked boxes run in parallelDashed boxes are your decisionsEach box jumps to its step

  1. 01

    Research

    Read the BRSD before anyone designs

    There is a source nobody has read in full, so research goes first. It checks the question bank for anything already answered, then separates what the BRSD proves from what it only claims.

    /arch-research docs/brsd/BRSD-014-instant-transfers.pdf

    → research-architect, in its own context

    Reads

    • project.yaml
    • practice/research/questions.yaml
    • practice/research/sources.yaml
    • the BRSD

    Writes

    • New: practice/research/2026-10-27-brsd-014.md
    • Changed: practice/research/questions.yaml (Q-001 to Q-006)
    • Changed: practice/research/sources.yaml (S-BRSD-014)
    Brief: facts vs claims
    StatementKind
    Daily limit SAR 20,000 (§3.1)Fact
    The sponsor bank screens every transfer (§5)Claim. No contract clause cited
    Settled within 10 secondsClaim. Rests on a bank SLA nobody has seen
    10 year retention (BR-6)Claim. Check against the regulation
    Questions, one owner each
    QuestionOwner
    Q-001 Does the bank contract include fraud screening, or only sanctions?Enterprise
    Q-002 Which payment message keys do we hold, and must they sit in an HSM?Security
    Q-003 Can the bank call us back, and does it need private connectivity?Cloud and infra
    Q-004 Is a transfer its own bounded context, or part of Wallet?Solution
    Q-005 What can someone do with a forged request-to-pay link?Security
    Q-006 What retention actually applies to transfer records?Enterprise
  2. 02

    Enterprise

    Should we do it, and buy or build the fraud screening?

    BR-3 needs a fraud service, the bank charges per transfer, and a bank integration is hard to undo. Any one of those calls for a demand assessment. You want the options first, so the enterprise architect writes an outline.

    /arch-enterprise Outline for BRSD-014: build, buy, or use the bank's fraud screening? Brief: practice/research/2026-10-27-brsd-014.md

    → enterprise-architect, answering Q-001 and Q-006 on the way

    Reads

    • the research brief
    • practice/ea-playbook.md §2
    • practice/templates/outline.md
    • visions/roadmaps/

    Writes

    • New: outlines/solutions/instant-transfers.md
    • Changed: questions.yaml (Q-001, Q-006 answered)
    Outline: options scored 1 to 5
    OptionFunctionFeasibilityFitCostNote
    A. Build a rules engine in house2454No device or network signals, so weak against account takeover
    B. Buy an in-Kingdom fraud scoring service, behind our own interface5442Recommended. Data stays in Saudi; the interface keeps A open
    C. Use the bank's screening only3535Q-001: the contract covers sanctions only. Keep it for sanctions
    You decide

    Go. Option B for fraud, with the bank's sanctions screening (C) alongside. Budget for 12 months, revisit at the vendor's renewal. On Q-006 the regulation sets the floor and BR-6's 10 years is a business choice, which you accept.

  3. 03

    The board

    Two questions that cross lanes

    Where does the transfer ledger live, and do we call the bank inside the customer's request? Solution, cloud and security each own part of the answer, so the board runs them in parallel and merges what they say.

    /arch-board Should instant transfers get their own service and database, and should we call the bank synchronously in the customer's request?

    → Picks solution, cloud and security. Enterprise sits out: no vendor, cost or roadmap change beyond the approved outline

    Reads

    • the outline
    • the research brief
    • src/wallet/ and src/ledger/

    Writes

    • Changed: questions.yaml (Q-004 answered)
    Solution

    A Transfers module inside the existing API, with its own schema and an outbox table. A worker submits to the bank. One deploy and one database to reason about.

    Security

    Whatever can sign a payment message is the crown jewel. If the main API is compromised, it must not be able to sign. Wants a separate service.

    Cloud and infra

    A second full service doubles the private connectivity and the on-call surface. Fine with a tiny service if it holds no business logic.

    The board's merged reply
    Recommendation  Transfers stays a module with an outbox. Bank submission is
                    async from a worker; the customer sees "Sending", then "Sent".
                    Signing moves to a small signer service, the only identity
                    allowed to use the HSM key.
    Disagreement    Security against solution on a separate service. Settled by
                    splitting out only the signer.
    Decision type   Technology and design (EA playbook). Settled in the HLD.
    Next            The solution architect writes the HLD.
  4. 04

    Solution

    The HLD: the design you say yes or no to

    /arch-doc hands the solution architect its solution-design skill and the HLD template. The approved outline and the board's answer go in as context, so the HLD builds on them instead of reopening them.

    /arch-doc feature Instant transfers to any Saudi bank (BRSD-014). Outline: outlines/solutions/instant-transfers.md. Board: module, outbox, separate signer.

    → solution-architect, with the solution-design skill, scope F (feature)

    Reads

    • practice/templates/hld.md (v4)
    • the outline and the brief
    • standards/guidelines/
    • src/wallet/, src/auth/ (cited by file:line)

    Writes

    • New: designs/solutions/instant-transfers/hld.md
    • Changed: questions.yaml (Q-007 for security, Q-008 for cloud)
    hld.md §4.1 Pillars
    1. Money is integer halalas, never a float.
    2. Every transfer has one idempotency key.
    3. A transfer is a state machine; the bank
       is the source of truth for "settled".
    4. Nothing signs except the signer.
    hld.md §7 Data governance
    DataClassKeptLeaves KSA
    Transfer recordConfidential10 yearsNo
    Recipient IBAN and namePersonal10 yearsNo
    Device signals sent to the fraud vendorPersonal90 days, at the vendorNo
    hld.md §8.2 Who can do what
    RoleCreate a transferRead a transfer
    CustomerFrom their own wallet onlyTheir own only
    Support agentNoMasked IBAN only
    Signer serviceSign onlyNo

    The HLD ends with a question for each of the next two architects: threat-model the flows and the request-to-pay link, and plan the bank link, the HSM, the worker and the cost. Those two run at the same time.

  5. 05

    Security

    Threat model, in parallel with the change plan

    The security architect models the HLD's flows, not the BRSD's wishes. It answers Q-002, Q-005 and Q-007, and names the abuse-case tests the build must contain.

    /arch-security Threat model the flows in designs/solutions/instant-transfers/hld.md, including request-to-pay links.

    → security-architect

    Reads

    • hld.md §6, §7, §8
    • practice/templates/threat-model.md
    • project.yaml regulation and abuse_cases

    Writes

    • New: designs/solutions/instant-transfers/threat-model.md
    • Changed: questions.yaml (Q-002, Q-005, Q-007 answered)
    threat-model.md, ranked
    RankThreatPlanned control
    1Account takeover, then the balance drained to a mule accountStep-up OTP for a new payee; a lower limit for 24 hours on a new device
    2A customer reads another customer's transfer by its idOwnership check in the service, not the route. Abuse test required
    3A replay or a double tap sends money twiceIdempotency key with a unique index; a replay returns the original
    4A forged request-to-pay link changes the amount or payeeSigned links; payee and amount come from the server, never the URL
    5Misuse of the signing keyKey in Cloud HSM, only the signer may use it, alert on volume spikes
    6A customer is talked into paying a scammerName check shown (BR-2); extra confirmation on a first large transfer
    threat-model.md · tests the build must contain
    customer_cannot_read_another_customers_transfer
    replayed_idempotency_key_returns_original_transfer
    request_to_pay_link_with_altered_amount_is_rejected
  6. 06

    Cloud and infra

    Change plan: what changes in the cloud, and what it costs

    The design adds a worker, a signer, a private link to the bank and an HSM key. The cloud and infra architect writes the steps, the cost and the rollback, and answers Q-003 and Q-008.

    /arch-cloud-infra Change plan for designs/solutions/instant-transfers/hld.md: private link to the sponsor bank, HSM signing, transfers worker, cost.

    → cloud-infra-architect

    Reads

    • hld.md §5, §10
    • practice/templates/change-plan.md
    • landscapes/infra/

    Writes

    • New: designs/solutions/instant-transfers/change-plan.md
    • Changed: questions.yaml (Q-003, Q-008 answered)
    change-plan.md · Steps
    1. Reserve a static egress IP (Cloud NAT)
       for the bank to allowlist.
    2. HA VPN to the bank, which requires
       IPsec. Q-003: it calls back over it.
    3. KMS key ring at HSM protection level in
       me-central2. Signer identity only.
    4. Deploy transfers-worker and signer on
       Cloud Run, minimum one instance each.
    5. Migrate the transfers schema.
    6. Scheduler: reconcile every 5 minutes.
    Monthly cost, illustrative
    ItemSAR
    HA VPN, 2 tunnels270
    Cloud NAT and static IP150
    Two always-on Cloud Run services400
    HSM key and operations50
    Total, before bank and vendor fees870

    Rollback: turn the feature flag off and let the worker drain the outbox. The VPN and the key stay, since they carry no customer traffic on their own.

  7. 07

    Solution

    The LLD (the SAD) and the ADRs

    With the threat model and the change plan in, the same command writes the software architecture document on arc42. Each lasting decision becomes an ADR written by the architect whose lane it is in, so the fraud vendor is enterprise's and the HSM signer is security's. Then you take the design decision.

    /arch-doc feature instant-transfers: write the LLD from the HLD, threat-model.md and change-plan.md

    → solution-architect, with the solution-design skill

    Reads

    • practice/templates/lld.md (v3, arc42)
    • hld.md, threat-model.md, change-plan.md

    Writes

    • New: designs/solutions/instant-transfers/lld.md
    • New: decisions/0001 to 0004
    • Changed: decisions/README.md
    • Changed: landscapes/app/ (logical view)
    ADRs, as Proposed
    ADRDecisionLane
    0001Submit to the bank through an outbox and a workerSolution
    0002Buy fraud scoring from an in-Kingdom vendorEnterprise
    0003Store money as integer halalasSolution
    0004Sign payment messages only in a separate signer with an HSM keySecurity
    lld.md §16 Rollout
    Phase 1  staff wallets only, 1 week
    Phase 2  5% of customers, SAR 5,000 a day
    Phase 3  everyone, SAR 5,000 a day
    Phase 4  SAR 20,000 a day (BR-5)
    
    Exit, each phase: no reconcile mismatches,
    fraud losses under the agreed threshold
    You decide

    Approve, with a condition. Launch at SAR 5,000 a day for 30 days before raising it to BR-5's SAR 20,000. The four ADRs move from Proposed to Accepted.

  8. 08

    Solution

    A question comes up while building

    You build with your coding assistant from lld.md. In staging, the bank's settlement callback sometimes arrives before the worker has committed. Ask the solution architect in its own context, so your coding chat stays clean.

    /arch-solution The bank's settlement callback sometimes arrives before our worker commits the submission. How should the state machine handle it?

    → solution-architect

    Reads

    • lld.md §6
    • ADR-0001
    • src/transfers/

    Writes

    • Changed: designs/solutions/instant-transfers/lld.md §6.3
    The reply
    Never answer the bank with a 404. Store the callback in bank_events, keyed by
    the bank's reference, and return 200. After the worker commits, it looks for an
    early event and applies it. The 5 minute reconcile job picks up anything left.
    
    This fits ADR-0001, so there is no new ADR. Added the runtime scenario
    "callback before commit" to lld.md §6.3, and the test
    early_settlement_callback_is_applied_after_commit.
  9. 09

    Solution

    Check the branch against the standards before the PR

    /arch-conform reads every guideline, the accepted ADRs and the threat model's required tests, and checks the branch against them. With fix, it repairs what it finds and keeps each guideline's Appendix A true.

    /arch-conform feature/instant-transfers fix

    → solution-architect, as a conformance check against main

    Reads

    • standards/guidelines/
    • decisions/0001 to 0004
    • threat-model.md
    • the diff against main

    Writes

    • Changed: src/ and test/ (5 fixes)
    • Changed: standards/guidelines/*.md Appendix A
    Breaches found and fixed
    SeverityWhereRuleResult
    Highsrc/transfers/transfer.service.ts:88Observability R7: logs the full recipient IBANFixed: logs transfer_id
    Highsrc/transfers/transfer.entity.ts:14ADR-0003: amount typed as a floatFixed: bigint halalas
    Hightest/transfers/Threat model: a required abuse test is missingFixed: test added
    Medsrc/transfers/transfers.controller.ts:41API layering R2: limit check in the controllerFixed: moved to the service
    Lowsrc/bank/callback.controller.ts:23Observability R4: a 4xx logged as an errorFixed: logged as info

    It also proposes two checks so nobody has to remember these: a lint rule that rejects number on any field named amount, and a CI step that fails when a threat model's required test is missing.

  10. 10

    Solution

    Ship, and make the documents true again

    The PR is reviewed against the design and export.py --check passes. After the merge, one command marks the design Built and updates every view that changed.

    /arch-solution mark instant-transfers Built

    → solution-architect

    Reads

    • the merged code
    • hld.md, lld.md
    • landscapes/

    Writes

    • Changed: hld.md, lld.md (status: Built)
    • Changed: landscapes/app/ integration view (bank, fraud vendor)
    • Changed: landscapes/inventory.md (2 vendors)
    • Changed: questions.yaml (Q-001 to Q-008 closed)

    Template gap reported: the HLD template has no prompt for money and rounding. It suggests adding one to practice/templates/hld.md as v5, with a changelog line.

Command coverage

All eight architect commands, each used when its trigger appeared. None of them committed anything.

CommandStepTriggered byLeft behind
/arch-research1A document nobody had read in fullA brief and 6 owned questions
/arch-enterprise2A purchase, a per-transfer fee, a bank link hard to undoAn outline with 3 scored options
/arch-board3A question three lanes each owned part ofOne recommendation, the disagreement settled
/arch-doc4, 7An approved demand that needs a designThe HLD, then the LLD (SAD), with 4 ADRs from three lanes
/arch-security5The HLD's question for securityA threat model and 3 required tests
/arch-cloud-infra6New infrastructure in the HLDA change plan with cost and rollback
/arch-solution8, 10A question during the build; then the mergeAn answer and an LLD update; status Built
/arch-conform9A branch about to become a PR5 breaches fixed, 2 checks proposed

Simulated. These are simulations. No agent ran. They are written from the kit's own commands, agents and templates, so the routing, file paths and document sections match what the team produces. Samra Pay, its vendors, the code paths and the costs are invented, and the regulatory details are illustrative. Before building either for real, run /arch-research on the current rules.