# My Development Memory## Code Style Preferences### General- I prefer functional programming patterns over OOP- I like early returns to reduce nesting- I use 2-space indentation (but defer to project config)### TypeScript- I prefer `interface` over `type` for object shapes- I use strict mode always- I avoid `enum` in favor of `as const` objects### React- Functional components only- I prefer Zustand over Redux for state- I use React Query for server state## Tool Preferences- Package manager: pnpm (prefer) > npm > yarn- Testing: Vitest > Jest- Formatting: Prettier with defaults- Linting: ESLint with strict TypeScript rules## Communication Style- I prefer concise explanations over verbose ones- Show me the code first, explain after if needed- When debugging, show me your reasoning## Past Decisions (Personal Projects)- [2024-01] Switched from Create React App to Vite- [2024-02] Adopted Tailwind CSS as default styling- [2024-03] Using Supabase for personal projects
## Personal PreferencesMy coding preferences and tool choices are documented in `~/.factory/memories.md`.Refer to this file when making decisions about code style, architecture, or tooling.
# Project Memory## Project Context- **Name**: Acme Dashboard- **Type**: B2B SaaS application- **Stack**: Next.js 14, TypeScript, Prisma, PostgreSQL- **Started**: January 2024## Architecture Decisions### 2024-01-15: Database Choice**Decision**: PostgreSQL over MongoDB**Reasoning**: Strong relational data model, ACID compliance needed for financial data**Trade-offs**: More rigid schema, but better for reporting queries### 2024-02-01: Authentication Approach**Decision**: NextAuth.js with custom credentials provider**Reasoning**: Need to integrate with existing enterprise LDAP**Implementation**: See `src/lib/auth/` for setup### 2024-02-20: State Management**Decision**: Zustand for client state, React Query for server state**Reasoning**: Simpler than Redux, better separation of concerns**Pattern**: Store files in `src/stores/`, queries in `src/queries/`## Known Technical Debt- [ ] Auth refresh token logic needs refactoring (#234)- [ ] Dashboard queries should be optimized with proper indexes- [ ] Legacy API endpoints in `/api/v1/` need deprecation## Domain Knowledge### Business Rules- Users belong to Organizations (multi-tenant)- Subscription tiers: Free, Pro, Enterprise- Free tier limited to 3 team members- Data retention: 90 days for Free, unlimited for paid### Key Entities- `User`: Individual accounts, can belong to multiple orgs- `Organization`: Tenant container, has subscription- `Project`: Work container within an org- `Task`: Work items within projects## Team Conventions- PR titles follow conventional commits- All PRs need at least one approval- Deploy to staging on merge to `develop`- Deploy to production on merge to `main`
## Project MemoryArchitecture decisions, domain knowledge, and project history are documented in `.factory/memories.md`.Always check this file before making significant architectural or design decisions.
---description: Save a memory to your memories fileargument-hint: <what to remember>---Add this to my memories file (~/.factory/memories.md):$ARGUMENTSFormat it appropriately based on whether it's a preference, decision, or learning. Include today's date.
その後、/remember we chose PostgreSQL for better ACID complianceを使用してメモリをオンデマンドで取得します。
# memories.md## Current Decisions[active decisions here]## Archive (2023)<details><summary>Archived decisions from 2023</summary>### 2023-06: Original Auth System**Decision**: Custom JWT implementation**Status**: Replaced by NextAuth.js in 2024-02**Reason for change**: Maintenance burden, security updates</details>
---name: context-aware-implementationdescription: Implement features using project memory and conventions.---# Context-Aware ImplementationBefore implementing any feature:1. **Check project memory** (`.factory/memories.md`): - What architecture decisions apply? - What patterns should I follow? - What constraints exist?2. **Check personal preferences** (`~/.factory/memories.md`): - What code style does the user prefer? - What tools should I use?3. **Check rules** (`.factory/rules/`): - What conventions apply to this file type? - What testing requirements exist?Then implement following all discovered context.