Before You Code
Read.cursor/rules/ docs before touching their domains. The index is .cursor/rules/rules-index-authoring-guide.mdc.
| Domain | Read First |
|---|---|
| Popups, toasts, sheets | .cursor/rules/popup-toast-sheet-guidelines.mdc |
| Mnemonic, keys, secure storage | .cursor/rules/secure-storage-key-derivation.mdc |
| Text component, fonts, skeletons | .cursor/rules/text-typography-skeleton-guidelines.mdc |
| Theme, colors, tokens | .cursor/rules/theme-system-architecture.mdc |
| Zustand stores, profile scope | .cursor/rules/zustand-store-scoping.mdc |
| Git, commits, PRs, issues | .cursor/rules/git-github-workflow.mdc |
Execution Sequence
Search First
Find existing patterns in
components/, hooks/, helper/ before creating anything new. Investigate deeply. Be 100% sure before implementing.No Assumptions
Only use: files you’ve read, user messages, tool results. Missing info? Search, then ask.
Architecture Boundaries
Sovran follows a strict layered architecture:app/
Routes + orchestration only. Screens stay thin.
components/ui/
Primitives.
components/blocks/ for composed product UI.hooks/coco/
Compose coco-cashu-react hooks for UX needs. Never reimplement coco internals.
helper/coco/
Non-React coco integration glue.
stores/
Zustand state management. Check
.cursor/rules/zustand-store-scoping.mdc before adding or modifying stores.coco-cashu-core
Source of truth for Cashu types. Import from coco, not
@cashu/cashu-ts.Directory Structure
Naming Conventions
| Type | Convention | Example |
|---|---|---|
| Route groups | (thing-flow) kebab-case | (mint-flow), (send-flow) |
| Screens | index.tsx, descriptive names | detail.tsx, add.tsx |
| Components | PascalCase.tsx | WalletHeader.tsx |
| Hooks | useThing.ts | useNostrProfile.ts |
| Helpers | camelCase.ts | keyDerivation.ts |
| Handlers | handleX | handleSubmit |
| Callbacks | onX | onPress |
| Booleans | isX/hasX/shouldX | isLoading, hasBalance |
| Constants | SCREAMING_SNAKE | MAX_RETRIES |
Import Order (Strict)
Maintain this exact import order:Security — Absolute Rules
- Never store secrets in Zustand. Use
expo-secure-store. - Never change key derivation outputs, parameters, or serialization without reading
.cursor/rules/secure-storage-key-derivation.mdc. - Never commit mnemonics, nsec, private keys, API tokens,
.envcontents.
Never Commit
Scan diffs before staging. Refuse to commit if found:- Passwords, API keys, tokens, session cookies
- Mnemonics (12–24 words),
xprv, WIF, raw private keys - Nostr secrets (
nsec1...), hex private keys .envcontents, credential files
Rule Documentation Improvement Protocol
When you encounter any of these situations, update.cursor/rules/ in the same PR:
Gap
You needed info that wasn’t documented → add it to the relevant doc, or create a new one following
.cursor/rules/rules-index-authoring-guide.mdc.Missing Pattern
You discovered a convention by reading code that future agents would benefit from → append it to the appropriate doc.
.cursor/rules/rules-index-authoring-guide.mdc.
Self-Check Before Submitting
Before submitting a PR, verify:- ✅ Does the diff only contain changes required by the task?
- ✅ Are loading states layout-shift free?
- ✅ Are coco types imported from coco, not redefined?
- ✅ Are new stores registered in profile-switch and reset contracts (if profile-scoped)?
- ✅ Would a future agent understand why this code exists?
- ✅ All quality checks pass? (See Code Quality)
Support
GitHub Issues
Bug reports and feature requests
Nostr
Direct messaging via Nostr protocol
@KevinKelbie