> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloak.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Windsurf setup

> Windsurf workflow for complete Cloak SDK app integrations

Use this as a practical Windsurf playbook for shipping SDK-powered privacy apps. The prompts below target the TypeScript SDK (`@cloak.dev/sdk`).

<Tip>
  For Rust integrations, start with [`/sdk/rust/llms.txt`](/sdk/rust/llms.txt) and [the Rust quickstart](/sdk/rust/quickstart) — the TS prompts below assume `npx tsx` CLI shape and won't translate.
</Tip>

## Quick launch

<CardGroup cols={3}>
  <Card title="Use in Cursor" icon="arrow-pointer" href="/ai-tools/cursor#2-starter-prompt">
    Open the Cursor starter prompt.
  </Card>

  <Card title="Use in Claude Code" icon="message-bot" href="/ai-tools/claude-code#2-starter-prompt">
    Open the Claude starter prompt.
  </Card>

  <Card title="Use in Windsurf" icon="wind" href="/ai-tools/windsurf#2-starter-prompt">
    Open the Windsurf starter prompt.
  </Card>
</CardGroup>

## 1) Rules file

Create `.windsurf/rules.md`:

<Accordion title="View .windsurf/rules.md template">
  # Windsurf Rules for SDK

  We integrate `@cloak.dev/sdk`.

  ## Constants

  * Program ID: `zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW`
  * Circuit base URL: `https://cloak-circuits.s3.us-east-1.amazonaws.com/circuits/0.1.0`

  ## Capability groups (must check all)

  1. Note API
  2. UTXO API
  3. Scanner/compliance
  4. Viewing keys + metadata encryption
  5. Relay/proof/Merkle helpers
  6. Utility modules (fees/errors/network/wallet/storage)

  ## Runtime rules

  * Prefer UTXO flows for new features.
  * Keep transaction amounts as `bigint`.
  * Enforce viewing-key registration before actions.
  * Build cache-first history with explicit rescan.

  ## Security rules

  * Never output secrets in logs.
  * Never include raw private material in telemetry.
  * Transaction signatures are public and can be logged for support/debugging.
  * Use SDK defaults for program, relay, and circuits. Do not expose these as user-facing config.

  ## Docs

  * `/llms.txt`
  * `/llms-full.txt`
  * `/sdk/llms.txt`
  * `/sdk/api-reference`
  * `/sdk/utxo-transactions`
  * `/sdk/error-handling`
</Accordion>

## 2) Starter prompt

<Accordion title="Copy starter prompt">
  Implement this feature using the complete `@cloak.dev/sdk` model.

  Step 1: output a capability matrix (all 6 groups) with used/not-used + reason.

  Step 2: implement with:

  * bigint-safe logic
  * wallet-adapter-compatible flow
  * keypair-bytes fallback where relevant
  * scanner/compliance handling
  * robust error UX; rely on SDK stale-root retries by default

  Step 3: run checks and return changed files + rationale + verification summary.
</Accordion>

## 3) Prompt pack

<AccordionGroup>
  <Accordion title="Scaffold feature-complete integration">
    Generate deposit/send/withdraw/swap handlers, history scanner integration, cache, and CSV export.
  </Accordion>

  <Accordion title="Refactor existing codebase">
    Patch existing app code to current SDK contracts with minimal UI churn.
  </Accordion>

  <Accordion title="Reliability and UX pass">
    Improve error categorization, progress states, stale-root handling, and operational resilience.
  </Accordion>
</AccordionGroup>

## Related docs

* [AI Integration](/ai-tools/ai-integration)
* [LLM Index](/llms.txt)
* [LLM Full Export](/llms-full.txt)
* [LLM Reference](/sdk/llms.txt)
* [API Reference](/sdk/api-reference)
* [Wallet Integration](/sdk/wallet-integration)
