This is a framework project - every change affects developers using YinzerFlow.
- Main Rules: See
.claude/rules/rules.mdfor complete project structure, type system, and coding conventions - Testing: See
.claude/rules/tests.mdfor testing standards (Bun test runner, integration-first approach) - Documentation: See
.claude/rules/docs.mdfor documentation standards and templates
- Framework First: Every decision considers the developer experience of framework users
- Type Safety: All types in
typedefs/, never in core implementation files - Security: Built-in security with sensible defaults (rate limiting, input validation, etc.)
- Performance: Lightweight and fast - optimize hot paths
- Developer Experience: Clear APIs, helpful errors, Pittsburgh personality
- NEVER define types in
app/core/files - ALL types go inapp/typedefs/ - Use utility types from
Generics.d.tsbefore creating new ones - Public types: no prefix | Internal types: "Internal" prefix
- Implementation:
app/core/(classes, functions, logic) - Types:
app/typedefs/(public, internal, constants) - Constants:
app/constants/(all useas const, all exported) - Exports:
app/index.ts(runtime values only, NO types)
- Hybrid imperative-modular: Main functions orchestrate, helpers are focused
- Private helpers: Use underscore prefix (
_helperFunction) - Use for...of: NEVER use forEach (causes stack trace issues)
- No console.log: Use
logutility from@core/utils/log.ts
- Bun test runner: Never use Jest or other frameworks
- Integration-first: Test real usage patterns, not implementation details
- Real implementations: Only mock external dependencies (DB, APIs, etc.)
- TSDoc for public APIs: Include examples, security notes, performance notes
- Use π‘οΈ emoji: For security features with Problem/Solution format
- Progressive examples: Dev β Production configurations
app/
βββ core/ # Implementation (NO TYPES HERE)
β βββ execution/ # Request/response handling
β βββ setup/ # Setup and routing
β βββ modules/ # Complex features (rateLimit, etc.)
β βββ utils/ # Simple utilities (log, cors, time)
β βββ YinzerFlow.ts
βββ typedefs/ # ALL TYPE DEFINITIONS
β βββ public/ # Exported types (for users)
β βββ internal/ # Internal types (prefixed "Internal")
β βββ constants/ # Constant types
βββ constants/ # Constant values (all exported)
βββ index.ts # Runtime exports (NO TYPES)
- Read the detailed rules in
.claude/rules/for the specific area you're working on - Investigate first: Examine existing patterns before making changes
- Challenge assumptions: Question and verify rather than assume
- Clean up: Remove unused code when changing direction
As a framework, we must protect users from common vulnerabilities:
- Input validation with strict limits
- Rate limiting (enabled by default)
- CORS protection (disabled by default, secure when enabled)
- Header validation and size limits
- Prototype pollution protection
For complete details on any topic, refer to:
.claude/rules/rules.md- Complete project ruleset.claude/rules/tests.md- Testing standards and patterns.claude/rules/docs.md- Documentation standards and templates