mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10:19:43 +00:00
2.0 KiB
2.0 KiB
Shared Package - Agent Guidelines
STRICT RULES - DO NOT VIOLATE
Architecture
This is a shared TypeScript package (@sauci/shared) containing:
- Types: Shared TypeScript type definitions
- Package Name:
@sauci/shared
Directory Structure
src/
index.ts # Main export file
types/ # Type definitions
package.json # Package configuration
tsconfig.json # TypeScript config
Critical Rules
Purpose
This package exists ONLY for sharing types across apps. It should contain:
- TypeScript interfaces
- Type definitions
- Enums
- Constants (if truly shared)
NO runtime code - types only.
Exports
All exports must go through src/index.ts:
export * from './types';
Usage in Apps
Import in consuming apps:
import type { Profile, Couple, Match } from '@sauci/shared';
Type Definitions
Types should match database schema. Core entities:
Profile- User profile extending Supabase authCouple- Two users linked via invite codeQuestionPack- Collection of questionsQuestion- Individual question with intensityResponse- User's answer (yes/no/maybe)Match- Created when both partners answer positively
Adding Types
When adding new types:
- Add to appropriate file in
src/types/ - Export from
src/types/index.ts - Re-export from
src/index.ts - Run
npm run buildfrom root to verify
Versioning
Types are internal - no npm publishing. Changes propagate automatically via Turborepo workspace linking.
Forbidden Actions
- DO NOT add runtime code (functions, classes with logic)
- DO NOT add dependencies (except dev dependencies)
- DO NOT create circular dependencies between types
- DO NOT duplicate types that exist in Supabase generated types
- DO NOT break backwards compatibility without updating all consumers
- DO NOT add app-specific types (keep them generic/shared)