Case study · AI automation

From escrow contracts to partner adapters

Turning domain expertise into a repeatable Claude-assisted engineering workflow, with people approving the requirements, the flow, and the API contract.

Context
Paykeeper · Fintech
Outcome
An estimated hundreds of development hours saved across partner adapters
Approach
Claude-assisted workflow, eight specialized agent roles, human approval gates
Resource
Two-page PDF (5 KB)

Outcome

Estimated outcome

Hundreds of development hours saved across partner adapter work.

An estimated, cumulative saving, based on my experience delivering the integrations. It comes from less repeated implementation and rework, not from skipping review. I’m not claiming a precise hour count or a per-adapter figure.

The challenge

Every partner arrived as a contract and had to leave as code

Each partner brought escrow terms, participants, fee rules, funding conditions, and payout requirements that had to become working integration code.

That takes two kinds of expertise at once: understanding the agreement, and translating it into the platform’s architecture and conventions. Done by hand, each new adapter meant re-deriving the same kinds of decisions, and re-learning the same review lessons.

01 · Contract clause

4.2 Release of Funds. Upon Buyer’s written acceptance of a Milestone, Escrow Agent shall release the Milestone Amount to Seller within five (5) Business Days, less a Platform Fee of 1.5%, not to exceed $250.

02 · Terms + open questions
trigger
buyer accepts milestone
release_to
seller
deadline
5 business days
fee
1.5%, max $250
fee_payer
seller (deducted)

Question for peoplePartial acceptance isn’t covered. Release the accepted portion, or hold the whole milestone?

03 · API contract excerpt
/milestones/{id}/release:
  post:
    summary: Release accepted funds
    description: >
      Seller receives the amount
      minus fee (1.5%, max 250.00)
    responses:
      '202': Release scheduled
      '409': Milestone not accepted

Drafted · awaiting internal and partner sign-off

Fig. 01 Synthetic example. The clause, terms, and API are invented to show the shape of the work. They don’t come from a real partner agreement or from Paykeeper’s API.

My contribution

What I built

I created a Claude-assisted workflow that interprets escrow contracts and partner requirements, identifies unanswered questions, and generates partner adapters.

The hard part wasn’t prompting. It was teaching the domain: I encoded the knowledge an experienced engineer brings to each integration into reusable guidance, and taught it through instructions, worked examples, specialized roles, and iterative feedback.

  1. 01
    Platform architecture and implementation patternsSo generated code fits the codebase it lands in.
  2. 02
    Reference adaptersWorking examples of what a finished integration looks like.
  3. 03
    Financial rules and fee handlingThe conventions that money movement has to follow.
  4. 04
    Testing expectationsWhat has to be proven before an adapter is ready for review.
  5. 05
    Lessons from code reviewFindings from earlier adapters, so they aren’t repeated.
Contract-to-adapter workflow Escrow contract and partner requirements lead to questions clarified by people, then an approved flow design, then an OpenAPI specification signed off internally and by the partner, then an adapter and tests generated by agents, then code review. Review lessons feed back into reusable guidance used for the next adapter. Eight agent roles support the stages: research, flow architecture, OpenAPI specification, fee calculation, endpoint implementation, testing, code review, and PR feedback. Reusable guidance architecture · implementation patterns · reference adapters · financial rules · testing expectations · review lessons next adapter review lessons people answer approved internal + partner sign-off code review Escrow contract + partner requirements Questions clarified before design Flow design on platform architecture OpenAPI specification approved contract Adapter + tests generated by agents Review & feedback lessons captured research flow architecture OpenAPI specification fee calculation endpoint implementation testing code review PR feedback Eight agent roles each with a bounded responsibility and an expected output human checkpoint agent-assisted Contract-to-adapter workflow Escrow contract and partner requirements lead to questions clarified by people, then an approved flow design, then an OpenAPI specification signed off internally and by the partner, then an adapter and tests generated by agents, then code review. Review lessons feed back into reusable guidance used for the next adapter. Reusable guidance architecture · patterns · reference adapters financial rules · tests · review lessons next adapter review lessons Escrow contract + partner requirements agent: research people answer Questions clarified before design agent: research approved Flow design on platform architecture agent: flow architecture internal + partner sign-off OpenAPI specification approved contract agent: OpenAPI specification Adapter + tests generated by agents agents: fee calculation, endpoint implementation, testing code review Review & feedback lessons captured agents: code review, PR feedback human checkpoint agent-assisted
Fig. 02 The contract-to-adapter workflow. Simplified and illustrative, not a full system architecture.

The agent workflow

Eight roles, each with a bounded job

Contract and requirements analysis fed a clarification step, then flow design and an OpenAPI specification. After approval, specialized agents generated fee logic, endpoint implementations, tests, and documentation.

  1. 01 · ResearchResearchReads the contract and requirements, and lists the terms and open questions.
  2. 02 · DesignFlow architectureShapes the escrow flow to fit the platform’s architecture.
  3. 03 · ContractOpenAPI specificationDocuments the API contract that people approve.
  4. 04 · BuildFee calculationImplements the fee rules from the agreed terms.
  5. 05 · BuildEndpoint implementationBuilds endpoints that follow the platform’s patterns.
  6. 06 · VerifyTestingWrites the tests, including fee boundaries.
  7. 07 · VerifyCode reviewChecks the change against conventions and past lessons.
  8. 08 · LearnPR feedbackWorks through review feedback on the pull request.

Each role had a bounded responsibility and an expected output. Claude received specific project context and constraints, not a generic instruction to “write an integration.”

Human gates

Keep decisions with people

The workflow drafts. People decide. Nothing moved to implementation until the right people had signed off, and generated code was validated like any other change.

  1. 01

    Clarify before design

    Rule

    Unresolved requirements became explicit questions, answered by people before any flow was designed. Contract interpretation went to people for review, not straight into design.

  2. 02

    Approve the flow

    Rule

    The flow design was approved before the API contract was written.

  3. 03

    Sign off the API contract

    Rule

    The OpenAPI specification needed internal and partner approval before implementation started.

  4. 04

    Validate like any other code

    Rule

    Fee logic, accounting consistency, permissions, type checks, and tests stayed part of engineering validation, and generated code went through code review.

Review lessons

Make review improve the next adapter

Recurring review findings were captured in shared lessons and implementation guidance.

Each new adapter could reuse both the patterns that worked and the corrections that were made, so the same constraints didn’t have to be rediscovered on every integration.

Business value

Repeated integration work became a reusable process

The estimated saving, hundreds of development hours across partner adapters, came from reducing repeated implementation and rework.

Human review of business assumptions, financial behavior, and API contracts stayed in place throughout.

Teach the conventions. Automate the repetition. Keep the decisions with people.

What this demonstrates

Next step

Where could this approach help your business?

Turn recurring expert work into a repeatable, reviewable workflow. I take on AI automation, custom software, and hands-on fractional CTO engagements.