|
| 1 | +# CLAUDE.md - AI Assistant Instructions |
1 | 2 |
|
2 | | -## Language & Security Policy (RSR) |
| 3 | +## Language Policy (Hyperpolymath Standard) |
3 | 4 |
|
4 | | -### Allowed Languages (Primary → Fallback) |
5 | | -- **Systems/ML**: Rust |
6 | | -- **Web/Scripts**: ReScript → TypeScript (legacy only) |
7 | | -- **TUI**: Ada/SPARK |
8 | | -- **WordPress**: PHP (with security CI) |
9 | | -- **LSP**: Java (exception for IDE compatibility) |
| 5 | +### ALLOWED Languages & Tools |
10 | 6 |
|
11 | | -### Banned Languages |
12 | | -- Python (except SaltStack) |
13 | | -- Ruby (use Rust/Ada/Crystal) |
14 | | -- Perl (use Rust) |
15 | | -- New Java/Kotlin (except LSP) |
| 7 | +| Language/Tool | Use Case | Notes | |
| 8 | +|---------------|----------|-------| |
| 9 | +| **ReScript** | Primary application code | Compiles to JS, type-safe | |
| 10 | +| **Deno** | Runtime & package management | Replaces Node/npm/bun | |
| 11 | +| **Rust** | Performance-critical, systems, WASM | Preferred for CLI tools | |
| 12 | +| **Tauri 2.0+** | Mobile apps (iOS/Android) | Rust backend + web UI | |
| 13 | +| **Dioxus** | Mobile apps (native UI) | Pure Rust, React-like | |
| 14 | +| **Gleam** | Backend services | Runs on BEAM or compiles to JS | |
| 15 | +| **Bash/POSIX Shell** | Scripts, automation | Keep minimal | |
| 16 | +| **JavaScript** | Only where ReScript cannot | MCP protocol glue, Deno APIs | |
| 17 | +| **Python** | SaltStack only | No other Python permitted | |
| 18 | +| **Nickel** | Configuration language | For complex configs | |
| 19 | +| **Guile Scheme** | State/meta files | STATE.scm, META.scm, ECOSYSTEM.scm | |
| 20 | +| **Julia** | Batch scripts, data processing | Per RSR | |
| 21 | +| **OCaml** | AffineScript compiler | Language-specific | |
| 22 | +| **Ada** | Safety-critical systems | Where required | |
| 23 | + |
| 24 | +### BANNED - Do Not Use |
| 25 | + |
| 26 | +| Banned | Replacement | |
| 27 | +|--------|-------------| |
| 28 | +| TypeScript | ReScript | |
| 29 | +| Node.js | Deno | |
| 30 | +| npm | Deno | |
| 31 | +| Bun | Deno | |
| 32 | +| pnpm/yarn | Deno | |
| 33 | +| Go | Rust | |
| 34 | +| Python (general) | ReScript/Rust | |
| 35 | +| Java/Kotlin | Rust/Tauri/Dioxus | |
| 36 | +| Swift | Tauri/Dioxus | |
| 37 | +| React Native | Tauri/Dioxus | |
| 38 | +| Flutter/Dart | Tauri/Dioxus | |
| 39 | + |
| 40 | +### Mobile Development |
| 41 | + |
| 42 | +**No exceptions for Kotlin/Swift** - use Rust-first approach: |
| 43 | + |
| 44 | +1. **Tauri 2.0+** - Web UI (ReScript) + Rust backend, MIT/Apache-2.0 |
| 45 | +2. **Dioxus** - Pure Rust native UI, MIT/Apache-2.0 |
| 46 | + |
| 47 | +Both are FOSS with independent governance (no Big Tech). |
| 48 | + |
| 49 | +### Enforcement Rules |
| 50 | + |
| 51 | +1. **No new TypeScript files** - Convert existing TS to ReScript |
| 52 | +2. **No package.json for runtime deps** - Use deno.json imports |
| 53 | +3. **No node_modules in production** - Deno caches deps automatically |
| 54 | +4. **No Go code** - Use Rust instead |
| 55 | +5. **Python only for SaltStack** - All other Python must be rewritten |
| 56 | +6. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus |
16 | 57 |
|
17 | 58 | ### Package Management |
| 59 | + |
18 | 60 | - **Primary**: Guix (guix.scm) |
19 | 61 | - **Fallback**: Nix (flake.nix) |
| 62 | +- **JS deps**: Deno (deno.json imports) |
20 | 63 |
|
21 | 64 | ### Security Requirements |
| 65 | + |
22 | 66 | - No MD5/SHA1 for security (use SHA256+) |
23 | 67 | - HTTPS only (no HTTP URLs) |
24 | 68 | - No hardcoded secrets |
| 69 | +- SHA-pinned dependencies |
| 70 | +- SPDX license headers on all files |
0 commit comments