Extracted strict typing standards and response protocol into separate files in .claude-docs/ directory for better maintainability and reduced duplication. CLAUDE.md now serves as a lightweight index with references to detailed documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.0 KiB
Markdown
42 lines
1.0 KiB
Markdown
# Strict Typing - NO EXCEPTIONS
|
|
|
|
**Claude must ALWAYS use explicit types in ALL code. The use of `any` type is FORBIDDEN.**
|
|
|
|
## Rules:
|
|
1. **Every variable must have an explicit type annotation**
|
|
2. **Every function parameter must be typed**
|
|
3. **Every function return value must be typed**
|
|
4. **Never use `any`, `dynamic` (in Dart), or equivalent loose types**
|
|
5. **Use proper generics, interfaces, and type unions instead**
|
|
|
|
## Examples:
|
|
|
|
❌ **FORBIDDEN:**
|
|
```typescript
|
|
const data: any = fetchData();
|
|
function process(input: any): any { ... }
|
|
```
|
|
|
|
```dart
|
|
dynamic value = getValue();
|
|
void handleData(var data) { ... }
|
|
```
|
|
|
|
✅ **REQUIRED:**
|
|
```typescript
|
|
const data: UserData = fetchData();
|
|
function process(input: UserInput): ProcessedOutput { ... }
|
|
```
|
|
|
|
```dart
|
|
UserData value = getValue();
|
|
void handleData(RequestData data) { ... }
|
|
```
|
|
|
|
**This rule applies to:**
|
|
- TypeScript/JavaScript
|
|
- Dart/Flutter
|
|
- Python (use type hints)
|
|
- All statically-typed languages
|
|
- Even when interfacing with external APIs - create proper type definitions
|