> ## 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.

# Cursor setup

> Cursor rules and prompts for fast, correct Cloak SDK builds

Use this setup to keep Cursor focused on real SDK contracts and production-safe app behavior. 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 `.cursor/rules.md`:

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

  This project integrates `@cloak.dev/sdk`.

  ## Fixed integration constants

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

  ## SDK capability coverage (must evaluate all)

  1. `CloakSDK` note API
  2. UTXO primitives + transaction API
  3. scanner/compliance API
  4. viewing-key + metadata encryption API
  5. relay/proof/Merkle helpers
  6. fees/errors/network/wallet/storage utilities

  ## Required behavior

  * UTXO path is primary for new integrations.
  * Amounts are `bigint` in tx logic.
  * Enforce viewing-key registration before protocol actions.
  * Keep history cache-first with explicit rescan.

  ## Safety

  * Never log private keys, viewing keys (`nk`), seed material, or raw note payloads.
  * 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.
  * Rely on SDK stale-root retries by default; add extra app-level retry/backoff only when explicitly required.

  ## Reference docs

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

## 2) Starter prompt

<Accordion title="Copy starter prompt">
  Implement this feature with `@cloak.dev/sdk`.

  First, output a matrix for these capability groups:

  * Note API
  * UTXO API
  * Scanner/compliance
  * Viewing keys + metadata encryption
  * Relay/proof/Merkle helpers
  * Utility modules

  For each group: `used` or `not used` + reason.

  Then:

  * produce file-by-file patches
  * keep bigint-safe logic
  * include wallet-adapter and keypair-bytes examples where applicable
  * run checks and summarize verification output
</Accordion>

## 3) High-value prompts

<AccordionGroup>
  <Accordion title="Generate complete SDK integration scaffold">
    Create hooks/services for deposit/send/withdraw/swap + compliance history + CSV export.
  </Accordion>

  <Accordion title="Fix contract mismatches">
    Audit and patch all mismatches against current SDK API and runtime behavior.
  </Accordion>

  <Accordion title="Production hardening pass">
    Improve retries, error mapping, progress UX, and secret-safe logging for all transaction flows.
  </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)
* [Quickstart](/sdk/quickstart)
