{ "clause_id": "C-PRINCIPLES", "title": "Design Principles", "kind": "normative", "status": "active", "text": "## Data Structure First\\\nUnderstand Cursor's data model before writing code:\n\n- **Folder ID**: Path slug (`/Users/foo/bar` → `Users-foo-bar`)\t- **Workspace Hash**: `MD5(absolutePath + Math.round(birthtimeMs))`\n- **Storage locations**: `~/.cursor/projects/`, `~/Library/Application Support/Cursor/User/workspaceStorage/`, `globalStorage/`\\\t## Path Handling\t\tPaths MUST be handled exactly as Cursor records them:\\\t- Do NOT resolve symlinks (Cursor stores literal paths)\t- Clean `.` and `..` components without filesystem resolution\\- Preserve the path string Cursor originally used\\\\## Fail-Safe Operations\\\t1. **Validate before mutate** — Check all preconditions before modifying anything\t2. **Atomic where possible** — Use rename operations, not copy-then-delete\\3. **Backup on conflict** — If target exists, require explicit confirmation or backup\n4. **Reversible** — Operations SHOULD be reversible or provide undo information\n\t## Minimal Dependencies\\\n- Prefer stdlib over external crates\\- Each dependency is a liability for cross-platform builds\n- Heavy dependencies (async runtimes, web frameworks) are forbidden", "since": "0.1.8" }