@@ -12,14 +12,17 @@ This project uses the **4-Layer Orchestra Architecture** for efficient multi-age
1212## Critical Principles
1313
1414### 1. API Priority Order (NON-NEGOTIABLE)
15+
1516When implementing features, favor in this order:
17+
16181 . ** WebCrypto API** - Modern standard, best for ` subtle.* ` methods
17192 . ** Node.js Implementation** - Use ` $REPOS/node/deps/ncrypto ` as reference
18203 . ** ncrypto** - submodule code reference at ` $REPOS/ncrypto ` (do work w/ OpenSSL)
1921
2022** Always check Node.js ` deps/ncrypto ` before implementing new features.**
2123
2224### 2. Modern Stack Required
25+
2326- ** React Native** - Mobile framework
2427- ** TypeScript** - Type system (strict mode, no ` any ` )
2528- ** Nitro Modules** - Native bridging
@@ -28,12 +31,21 @@ When implementing features, favor in this order:
2831- ** Bun 1.3+** - TypeScript package manager
2932
3033### 3. Code Philosophy
34+
3135- Minimize code rather than add more
3236- Prefer iteration and modularization over duplication
3337- No comments unless code is sufficiently complex
3438- Code should be self-documenting
3539
36- ### 4. Security is Critical
40+ ### 4. Never Commit to Main
41+
42+ - ** ALWAYS** create a feature branch before the first commit
43+ - Branch naming: ` feat/<name> ` , ` fix/<name> ` , ` refactor/<name> `
44+ - All changes go through PRs — never push directly to main
45+ - If you find yourself on main, create a branch before committing
46+
47+ ### 5. Security is Critical
48+
3749- Constant-time comparisons for authentication tags
3850- Cryptographically secure randomness (RAND_bytes)
3951- AEAD modes preferred (AES-GCM)
@@ -45,6 +57,7 @@ When implementing features, favor in this order:
4557For full details, see ` .claude/rules/*.xml ` :
4658
4759### architecture.xml
60+
4861- Project context and goals
4962- API priority order (WebCrypto → Node.js → ncrypto)
5063- Tech stack requirements
@@ -53,6 +66,7 @@ For full details, see `.claude/rules/*.xml`:
5366- Local codebase references
5467
5568### code-typescript.xml
69+
5670- No ` any ` or ` unknown ` casts
5771- Interfaces over types
5872- Named exports only (no default)
@@ -62,6 +76,7 @@ For full details, see `.claude/rules/*.xml`:
6276- React best practices (minimal useEffect)
6377
6478### code-cpp.xml
79+
6580- C++20 minimum with modern features
6681- Smart pointers for all ownership
6782- OpenSSL 3.6+ EVP APIs only (no deprecated)
@@ -70,6 +85,7 @@ For full details, see `.claude/rules/*.xml`:
7085- Memory safety (no leaks, no raw ownership)
7186
7287### crypto-security.xml
88+
7389- Cryptographic correctness (match specs)
7490- No timing attacks (CRYPTO_memcmp)
7591- Secure RNG (RAND_bytes)
@@ -79,6 +95,7 @@ For full details, see `.claude/rules/*.xml`:
7995- No key material in errors
8096
8197### ci-caching.xml
98+
8299- iOS Pods/DerivedData cache consistency (exact-match Pods, no restore-keys)
83100- Cache key design (no version suffixes, use hashFiles)
84101- Android Maestro patterns (don't launch app before Maestro)
@@ -87,12 +104,14 @@ For full details, see `.claude/rules/*.xml`:
87104## When to Use Orchestration
88105
89106### Use Orchestrator For:
107+
90108- ✅ Tasks touching 3+ files
91109- ✅ Cross-language changes (TypeScript + C++)
92110- ✅ New crypto features (API + implementation)
93111- ✅ Complex refactoring
94112
95113### Work Directly For:
114+
96115- ✅ Single file changes
97116- ✅ Simple bug fixes
98117- ✅ Type updates
@@ -111,14 +130,17 @@ For full details, see `.claude/rules/*.xml`:
111130Use these instead of web searches:
112131
113132- ** Node.js** : ` $REPOS/node `
133+
114134 - ` deps/ncrypto ` - Use as bible for crypto operations
115135 - May need updating to OpenSSL 3.6+ patterns
116136
117137- ** ncrypto** : ` $REPOS/ncrypto `
138+
118139 - separate crypto lib broken out from Node.js
119140 - Patterns and tools to access OpenSSL
120141
121142- ** Nitro** : ` $REPOS/nitro `
143+
122144 - iOS CI caching patterns (super-fast builds)
123145 - Nitro Modules bridging examples
124146
@@ -128,7 +150,7 @@ Use these instead of web searches:
128150
129151## Testing
130152
131- Tests run in the React Native example app environment, not standard Node.js test runners.
153+ Tests run in the React Native example app environment, not standard Node.js test runners.
132154
133155Don't ask to run tests - they must be executed in the example React Native application.
134156
@@ -139,6 +161,7 @@ Metro output is tee'd to `/tmp/rnqc-metro.log`. When debugging test failures, re
139161## Quality Checks
140162
141163Before committing:
164+
142165- [ ] Type safety (no ` any ` , proper interfaces)
143166- [ ] Memory safety (smart pointers, RAII)
144167- [ ] Cryptographic correctness (test vectors)
0 commit comments