Skip to content

Commit 923eaaf

Browse files
committed
Add language policy CLAUDE.md
1 parent f08350b commit 923eaaf

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.claude/CLAUDE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CLAUDE.md - AI Assistant Instructions
2+
3+
## Language Policy (Hyperpolymath Standard)
4+
5+
### ALLOWED Languages & Tools
6+
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+
| **Bash/POSIX Shell** | Scripts, automation | Keep minimal |
13+
| **JavaScript** | Only where ReScript cannot | MCP protocol glue, Deno APIs |
14+
| **Python** | SaltStack only | No other Python permitted |
15+
| **Nickel** | Configuration language | For complex configs |
16+
| **Guile Scheme** | State/meta files | STATE.scm, META.scm, ECOSYSTEM.scm |
17+
18+
### BANNED - Do Not Use
19+
20+
| Banned | Replacement |
21+
|--------|-------------|
22+
| TypeScript | ReScript |
23+
| Node.js | Deno |
24+
| npm | Deno |
25+
| Bun | Deno |
26+
| pnpm/yarn | Deno |
27+
| Go | Rust |
28+
| Python (general) | ReScript/Rust |
29+
| Java/Kotlin | Rust |
30+
31+
### Enforcement Rules
32+
33+
1. **No new TypeScript files** - Convert existing TS to ReScript
34+
2. **No package.json for runtime deps** - Use deno.json imports
35+
3. **No node_modules in production** - Deno caches deps automatically
36+
4. **No Go code** - Use Rust instead
37+
5. **Python only for SaltStack** - All other Python must be rewritten
38+
39+
### ReScript Conventions
40+
41+
- Output format: ES6 modules (`"module": "es6"` in rescript.json)
42+
- File extension: `.res` (compiled to `.res.js`)
43+
- Use `@rescript/core` for stdlib
44+
- Bindings in `src/bindings/` directory
45+
46+
### Deno Conventions
47+
48+
- Import maps in `deno.json`
49+
- Permissions explicitly declared
50+
- Use `Deno.Command` not shell execution
51+
- Format with `deno fmt`
52+
- Lint with `deno lint`
53+
54+
### Build Commands
55+
56+
```bash
57+
# ReScript build
58+
deno task res:build # or: npx rescript build
59+
60+
# Run server
61+
deno task start
62+
63+
# Development
64+
deno task dev
65+
```
66+
67+
### Migration Priority
68+
69+
When encountering banned languages:
70+
1. **Immediate**: Block new code in banned languages
71+
2. **Short-term**: Convert TypeScript to ReScript
72+
3. **Medium-term**: Replace Node/npm with Deno
73+
4. **Long-term**: Rewrite Go/Python in Rust
74+
75+
## Code Quality
76+
77+
- SPDX license headers on all files
78+
- SHA-pinned dependencies
79+
- No shell metacharacters in commands
80+
- Whitelist approach for CLI subcommands

0 commit comments

Comments
 (0)