Windsurf Rules for MoneyGraph: Cascade-Style Payment Integration
Configure Windsurf (Codeium) for MoneyGraph payment integrations. Learn how our Cascade rules teach Windsurf the SDK architecture and compliance patterns.
Windsurf (powered by Codeium) is the fastest-growing alternative to Cursor, known for its Cascade rules engine. MoneyGraph SDK v2.2 includes a comprehensive .windsurfrules.md file that teaches Windsurf our entire SDK architecture.
What Makes Windsurf Rules Special
Windsurf uses XML-style tags to organize rules into categories. Our rules file includes:
| Tag | Purpose | What It Contains |
|---|---|---|
| `<coding>` | Code Standards | Strict TypeScript patterns for MoneyGraph |
| `<architecture>` | System Design | Namespace hierarchy and domain mapping |
| `<task_mapping>` | Workflows | Step-by-step flows for common operations |
| `<compliance>` | Rules | KYC, FX, and payout requirements |
`<coding>` Rules
Strict TypeScript patterns for MoneyGraph integration.
`<architecture>` Namespace Mapping
Windsurf learns our entire namespace hierarchy with domain mapping for each area:
| Namespace | Domain | Sub-Namespaces | Purpose |
|---|---|---|---|
| `mg.customers` | Customer Onboarding | `kyc`, `directors` | Create and manage customers |
| `mg.fx` | Foreign Exchange | `rates` | Quotes, rates, confirmations |
| `mg.payouts` | Outbound Payments | `swift`, `mobileMoney`, `crypto` | Send money globally |
| `mg.wallets` | Multi-Currency Wallets | Balance management | |
| `mg.transfers` | Internal Transfers | Customer-to-customer | |
| `mg.cards` | Card Issuance | Virtual and physical cards | |
| `mg.payments` | Accept Payments | Card processing | |
| `mg.r3` | Route Optimization | Best route selection |
`<task_mapping>` Flows
Step-by-step flows for common tasks like sending international payments:
mg.customers.kyc.canPayout()- Verify KYCmg.fx.quote()- Get FX quotemg.fx.confirm()- Lock the ratemg.payouts.create()- Execute payout
How Windsurf Uses These Rules
When you ask Windsurf to build a payment feature, it:
- Reads the architecture — Understands which namespace to use
- Follows the task flow — Executes steps in order
- Applies coding rules — Uses strict types and patterns
- Checks compliance — Adds KYC verification automatically
Example: Ask Windsurf to Build a Payout
Prompt: "Build a function to send money to Kenya via M-Pesa"
Windsurf generates:
import { MoneyGraph } from '@moneygraph/sdk';
import type { Payout } from '@moneygraph/sdk';async function sendToKenyaMpesa(
customerId: string,
amount: number,
phoneNumber: string
): Promise
// Step 1: Verify KYC
const status = await mg.customers.kyc.canPayout(customerId);
if (!status.allowed) {
throw new Error(KYC not approved: ${status.status});
}
// Step 2: Get FX quote const quote = await mg.fx.quote({ from: 'USD', to: 'KES', amount, });
// Step 3: Lock the rate await mg.fx.confirm(quote.id);
// Step 4: Execute payout via mobile money return mg.payouts.mobileMoney.create({ quote_id: quote.id, customer_id: customerId, recipient: { name: 'Recipient', mobile_network: 'MPESA', mobile_number: phoneNumber, }, }); } ```
Notice how Windsurf:
- ✅ Used
mg.payouts.mobileMoney(correct namespace from architecture) - ✅ Followed the 4-step flow (from task_mapping)
- ✅ Added TypeScript types (from coding rules)
- ✅ Included KYC check (from compliance rules)
Setup
Installation:
``bash
npm install @moneygraph/sdk
``
How It Works: Windsurf automatically reads .windsurfrules.md from your project's node_modules/@moneygraph/sdk folder. The Cascade engine applies rules to all code files.
Quick Start Prompt
Ask Windsurf:
Build a function to send money to Kenya via M-Pesa using MoneyGraph SDK.Requirements: - npm install @moneygraph/sdk first - Check KYC before sending - Get FX quote from USD to KES - Use mg.payouts.mobileMoney namespace - Add TypeScript types - Handle all errors ```
Windsurf's Cascade engine will generate compliant code following all payment flow patterns!
Next Steps:
- Windsurf IDE Download - Get started with Windsurf
- MoneyGraph SDK Docs - Complete API reference
- Cascade Rules Guide - Advanced configuration
Why Windsurf + MoneyGraph
Windsurf's Cascade engine excels at understanding hierarchical systems. Our SDK's namespace structure (mg.module.submodule.method) maps perfectly to Cascade's mental model.
Perfect For: Complex fintech applications with multiple payment rails, compliance requirements, and international transactions.
Ready to Get Started?
Install MoneyGraph SDK and start building AI-native payment applications today