Rule file
Create.windsurf/rules.md:
View .windsurf/rules.md template
View .windsurf/rules.md template
Cloak SDK Rules (Current)
Project uses@cloak.ag/sdk for private Solana transactions.Use these APIs by default
transactpartialWithdrawfullWithdrawswapWithChange
Mandatory behavior
- Enforce viewing-key registration before protocol actions.
- Keep compliance history cache encrypted in localStorage.
- Prefer scanner-based history (chain-native) for user-facing flows.
Security
- Never print secret keys, viewing keys, signatures, or note payload secrets.
- Never add debug logs containing transaction private inputs.
Program + fee constants
- Program ID:
c1oak6tetxYnNfvXKFkpn1d98FxtK7B68vBQLYQpWKp - Fee fixed:
5_000_000 - Fee variable:
amount * 3 / 1000
Error policy
- Retry stale-root failures with fresh Merkle data.
- Retry transient RPC/network errors with backoff.
- Return user-safe error messages in UI.
References
/sdk/quickstart/sdk/utxo-transactions/sdk/wallet-integration/sdk/api-reference/services/relay-api/architecture/viewing-keys-compliance
Prompt templates
Scaffold a complete app integration
Scaffold a complete app integration
Build a production-ready Cloak integration layer for this app:
- wallet adapter wiring
- deposit/send/withdraw/swap handlers
- compliance history fetch + cache + CSV export
- typed status/progress state
Implement transaction handlers
Implement transaction handlers
Implement transaction handlers using current SDK APIs with:
- bigint-safe parsing
- retry policy for stale roots
- clear error categories for UI
- no secret leakage in logs
Ship-ready refactor pass
Ship-ready refactor pass
Audit my existing code and refactor it to current Cloak runtime behavior.Constraints:
- keep existing UX behavior unless broken
- minimize API surface changes in UI components
- include a migration note per changed module