CODEX_ADK/FRONTEND/.claude-docs/strict-typing.md
Svrnty 229a0698a3 Initial commit: CODEX_ADK monorepo
Multi-agent AI laboratory with ASP.NET Core 8.0 backend and Flutter frontend.
Implements CQRS architecture, OpenAPI contract-first API design.

BACKEND: Agent management, conversations, executions with PostgreSQL + Ollama
FRONTEND: Cross-platform UI with strict typing and Result-based error handling

Co-Authored-By: Jean-Philippe Brule <jp@svrnty.io>
2025-10-26 23:12:32 -04:00

1.0 KiB

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:

const data: any = fetchData();
function process(input: any): any { ... }
dynamic value = getValue();
void handleData(var data) { ... }

REQUIRED:

const data: UserData = fetchData();
function process(input: UserInput): ProcessedOutput { ... }
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