Enhance user prompts by analyzing project context (code structure, dependencies, conventions, existing patterns)...
Transform brief development requests into clear, detailed requirements by analyzing project context. Present the enhanced requirements to the user for confirmation before implementation.
Use this skill when:
Check for uploaded files:
view /mnt/user-data/uploads
Gather key information:
From the user's brief request, identify:
Create a structured requirement document with:
# [๊ธฐ๋ฅ๋ช
] ๊ตฌํ ์๊ตฌ์ฌํญ
## ๐ ํ๋ก์ ํธ ์ปจํ
์คํธ
- Framework: [detected framework and version]
- Architecture: [detected pattern]
- State Management: [detected library]
- Key Libraries: [list relevant dependencies]
## ๐ฏ ๊ตฌํ ๋ฒ์
### ์ฃผ์ ๊ธฐ๋ฅ
1. [Main feature 1]
2. [Main feature 2]
3. [Main feature 3]
### ํ์ผ ๊ตฌ์กฐ
[Expected file structure based on project]
## ๐ ์์ธ ์๊ตฌ์ฌํญ
### 1. [Layer/Component Name]
- **์์น**: [File path]
- **๋ชฉ์ **: [What it does]
- **๊ตฌํ ๋ด์ฉ**:
- [Specific requirement 1]
- [Specific requirement 2]
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: [Reference to existing pattern]
### 2. [Next Layer/Component]
...
## โ
์ฑ๊ณต ๊ธฐ์ค
- [ ] [Acceptance criteria 1]
- [ ] [Acceptance criteria 2]
- [ ] [Acceptance criteria 3]
- [ ] ๊ธฐ์กด ์ฝ๋ ์คํ์ผ ๋ฐ ์ํคํ
์ฒ ์ผ๊ด์ฑ ์ ์ง
- [ ] ๋ชจ๋ ์ฃผ์ ๊ธฐ๋ฅ์ ๋ํ ํ
์คํธ ์์ฑ
## ๐ ํ์ธ ์ฌํญ
- [Any questions or clarifications needed]
- [Assumptions made]
---
์ด ์๊ตฌ์ฌํญ์ผ๋ก ์งํํ ๊น์? ์์ ์ด ํ์ํ ๋ถ๋ถ์ด ์๋ค๋ฉด ๋ง์ํด์ฃผ์ธ์.
Important: After creating the enhanced requirements, present them to the user and ask for confirmation:
์ ์๊ตฌ์ฌํญ์ ๋ถ์ํด์ ์ ๋ฆฌํ์ต๋๋ค.
์ด๋๋ก ์งํํด๋ ๋ ๊น์?
์์ ํ๊ฑฐ๋ ์ถ๊ฐํ ๋ด์ฉ์ด ์์ผ๋ฉด ๋ง์ํด์ฃผ์ธ์!
Do NOT implement until the user confirms. The goal is to clarify requirements first.
Detect: pubspec.yaml, lib/ directory
Key context to gather:
Enhanced requirements should include:
## ๊ตฌํ ๋ฒ์
### Presentation Layer
- ํ๋ฉด: lib/presentation/[feature]/[screen]_screen.dart
- ์ํ: [StateNotifier/Bloc/Controller] with [state pattern]
- ์์ ฏ: ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ ์ปดํฌ๋ํธ
### Domain Layer
- Entity: lib/domain/entities/[name].dart
- UseCase: lib/domain/usecases/[action]_usecase.dart
- Repository Interface: lib/domain/repositories/
### Data Layer
- Model: lib/data/models/[name]_model.dart (fromJson/toJson)
- Repository Implementation: lib/data/repositories/
- DataSource: lib/data/datasources/
### Navigation
- Route: [route path]
- Navigation method: [context.go/push based on router]
## ์ฑ๊ณต ๊ธฐ์ค
โ
[State management]๋ก ์ํ ๊ด๋ฆฌ
โ
[Existing widget] ์คํ์ผ ์ผ๊ด์ฑ ์ ์ง
โ
API ์๋ต ์๋ฌ ์ฒ๋ฆฌ
โ
๋ก๋ฉ ์ํ ํ์
โ
Widget test ์์ฑ
Detect: package.json with "next" or "react"
Key context to gather:
Enhanced requirements should include:
## ๊ตฌํ ๋ฒ์
### UI Components
- ์ปดํฌ๋ํธ: [path]/[ComponentName].tsx
- Props interface: [existing pattern]
- Styling: [Tailwind classes/CSS modules]
### State Management
- Store: [existing state structure]
- Actions: [action naming convention]
### API Layer
- Endpoint: [app/api or external]
- Method: [GET/POST/PUT/DELETE]
- Response type: [TypeScript interface]
### Routing
- Route: [app/[route] or pages/[route]]
- Dynamic segments: [if needed]
## ์ฑ๊ณต ๊ธฐ์ค
โ
TypeScript ํ์
์์ ์ฑ
โ
[Existing components] ์ฌ์ฌ์ฉ
โ
๋ฐ์ํ ๋์์ธ (๋ชจ๋ฐ์ผ/๋ฐ์คํฌํฑ)
โ
SEO ์ต์ ํ (๋ฉํ๋ฐ์ดํฐ)
โ
Unit test + Integration test
Detect: requirements.txt, manage.py, main.py
Key context to gather:
Enhanced requirements should include:
## ๊ตฌํ ๋ฒ์
### Models/Schema
- Model: [app]/models.py or schemas/[name].py
- Fields: [field definitions with types]
- Relationships: [ForeignKey/relationships]
### Views/Endpoints
- Route: [path]
- Method: [HTTP method]
- Request/Response schema: [Pydantic models]
### Business Logic
- Service: [if applicable]
- Validation: [input validation]
### Database
- Migration: [migration command]
## ์ฑ๊ณต ๊ธฐ์ค
โ
API documentation ์๋ ์์ฑ
โ
Request validation
โ
Error handling with proper status codes
โ
Unit test + Integration test
โ
[Authentication] ์ ์ฉ
User input:
๋ก๊ทธ์ธ ๊ธฐ๋ฅ ๊ตฌํํด์ค
Skill output:
# ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ๊ตฌํ ์๊ตฌ์ฌํญ
## ๐ ํ๋ก์ ํธ ์ปจํ
์คํธ
- Framework: Flutter 3.16.0 with null safety
- Architecture: Clean Architecture
- State Management: Riverpod (StateNotifier pattern)
- Network: Dio 5.3.0
- Storage: flutter_secure_storage
- Navigation: go_router
## ๐ฏ ๊ตฌํ ๋ฒ์
### ์ฃผ์ ๊ธฐ๋ฅ
1. ์ด๋ฉ์ผ/๋น๋ฐ๋ฒํธ ๋ก๊ทธ์ธ ํผ
2. JWT ํ ํฐ ๊ธฐ๋ฐ ์ธ์ฆ
3. ๋ก๊ทธ์ธ ์ฑ๊ณต ์ ํ ํ๋ฉด ์ด๋
4. ์๋ฌ ์ฒ๋ฆฌ ๋ฐ ์ฌ์ฉ์ ํผ๋๋ฐฑ
### ํ์ผ ๊ตฌ์กฐ
lib/ โโโ presentation/ โ โโโ auth/ โ โโโ login_screen.dart โ โโโ login_notifier.dart โ โโโ login_state.dart โโโ domain/ โ โโโ entities/user.dart โ โโโ usecases/login_usecase.dart โ โโโ repositories/auth_repository.dart โโโ data/ โโโ models/ โ โโโ user_model.dart โ โโโ login_response.dart โโโ repositories/auth_repository_impl.dart โโโ datasources/auth_remote_datasource.dart
## ๐ ์์ธ ์๊ตฌ์ฌํญ
### 1. Presentation Layer - ๋ก๊ทธ์ธ ํ๋ฉด
- **์์น**: lib/presentation/auth/login_screen.dart
- **๋ชฉ์ **: ์ฌ์ฉ์ ๋ก๊ทธ์ธ UI ์ ๊ณต
- **๊ตฌํ ๋ด์ฉ**:
- ConsumerStatefulWidget ์ฌ์ฉ
- Email TextFormField (์ด๋ฉ์ผ ํ์ ๊ฒ์ฆ)
- Password TextFormField (8์ ์ด์, obscureText)
- ๋ก๊ทธ์ธ PrimaryButton
- ํ์๊ฐ์
๋งํฌ
- ๋ก๋ฉ ์ํ ์ ์ค๋ฒ๋ ์ด ํ์
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: core/widgets/custom_text_field.dart ์คํ์ผ ์ฌ์ฉ
### 2. State Management
- **์์น**: lib/presentation/auth/login_notifier.dart
- **๋ชฉ์ **: ๋ก๊ทธ์ธ ์ํ ๊ด๋ฆฌ
- **๊ตฌํ ๋ด์ฉ**:
- StateNotifier<LoginState> ์์
- login(email, password) ๋ฉ์๋
- ์ฑ๊ณต ์ ํ ํฐ ์ ์ฅ ํ ์ํ ์
๋ฐ์ดํธ
- ์๋ฌ ์ ์๋ฌ ๋ฉ์์ง ์ํ ์ค์
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: ๋ค๋ฅธ notifier๋ค๊ณผ ๋์ผํ ํจํด
### 3. Domain Layer - ์ํฐํฐ
- **์์น**: lib/domain/entities/user.dart
- **๋ชฉ์ **: ์ฌ์ฉ์ ๋๋ฉ์ธ ๋ชจ๋ธ
- **๊ตฌํ ๋ด์ฉ**:
- Freezed๋ก ๋ถ๋ณ ํด๋์ค ์์ฑ
- id, email, name, profileImageUrl ํ๋
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: ๋ค๋ฅธ entity๋ค๊ณผ ๋์ผํ ๊ตฌ์กฐ
### 4. Domain Layer - UseCase
- **์์น**: lib/domain/usecases/login_usecase.dart
- **๋ชฉ์ **: ๋ก๊ทธ์ธ ๋น์ฆ๋์ค ๋ก์ง
- **๊ตฌํ ๋ด์ฉ**:
- call(LoginParams) ๋ฉ์๋
- Either<Failure, User> ๋ฐํ
- repository ์์กด์ฑ ์ฃผ์
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: ๋จ์ผ ์ฑ
์ UseCase ํจํด
### 5. Data Layer - API ํต์
- **์์น**: lib/data/datasources/auth_remote_datasource.dart
- **๋ชฉ์ **: ๋ก๊ทธ์ธ API ํธ์ถ
- **๊ตฌํ ๋ด์ฉ**:
- POST /api/auth/login
- Request: {"email": string, "password": string}
- Response: LoginResponse (accessToken, refreshToken, user)
- Dio instance ์ฌ์ฌ์ฉ
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: ๊ธฐ์กด datasource๋ค์ ์๋ฌ ์ฒ๋ฆฌ ๋ฐฉ์
### 6. Data Layer - Repository ๊ตฌํ
- **์์น**: lib/data/repositories/auth_repository_impl.dart
- **๋ชฉ์ **: Repository ์ธํฐํ์ด์ค ๊ตฌํ
- **๊ตฌํ ๋ด์ฉ**:
- login ๋ฉ์๋ ๊ตฌํ
- ํ ํฐ ์ ์ฅ (TokenStorage ์ฌ์ฉ)
- DioException ์ฒ๋ฆฌ
- UserModel์ User entity๋ก ๋ณํ
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: try-catch-Either ํจํด
### 7. Navigation ์ค์
- **์์น**: lib/core/router/app_router.dart
- **๋ชฉ์ **: ๋ก๊ทธ์ธ ๋ผ์ฐํธ ์ถ๊ฐ
- **๊ตฌํ ๋ด์ฉ**:
- /login ๋ผ์ฐํธ ์ถ๊ฐ
- ๋ก๊ทธ์ธ ์ฑ๊ณต ์ /home์ผ๋ก ๋ฆฌ๋ค์ด๋ ํธ
- ์ธ์ฆ ๊ฐ๋ ๋ก์ง
- **๊ธฐ์กด ํจํด ๋ฐ๋ฅด๊ธฐ**: ๊ธฐ์กด go_router ์ค์ ๋ฐฉ์
## โ
์ฑ๊ณต ๊ธฐ์ค
- [ ] ์ฌ์ฉ์๊ฐ ์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ ์
๋ ฅ
- [ ] ๋ก๊ทธ์ธ ๋ฒํผ ํด๋ฆญ ์ API ํธ์ถ
- [ ] ์ฑ๊ณต ์ ํ ํฐ ์ ์ฅ ๋ฐ ํ ํ๋ฉด ์ด๋
- [ ] ์คํจ ์ ์ ์ ํ ์๋ฌ ๋ฉ์์ง ํ์ (SnackBar)
- [ ] ๋ก๋ฉ ์ค ๋ฒํผ ๋นํ์ฑํ ๋ฐ ๋ก๋ฉ ์ธ๋์ผ์ดํฐ
- [ ] ์ด๋ฉ์ผ ํ์ ๋ฐ ๋น๋ฐ๋ฒํธ ๊ธธ์ด ๊ฒ์ฆ
- [ ] ๊ธฐ์กด ์ฝ๋ ์คํ์ผ ๋ฐ ์ํคํ
์ฒ ์ผ๊ด์ฑ ์ ์ง
- [ ] Widget test ์์ฑ (๋ก๊ทธ์ธ ํ๋ฉด)
- [ ] Repository test ์์ฑ (mock API)
- [ ] UseCase test ์์ฑ
## ๐ ํ์ธ ์ฌํญ
- API ์๋ํฌ์ธํธ ์ฃผ์๊ฐ `https://api.example.com`์ด ๋ง๋์?
- ํ ํฐ ๋ง๋ฃ ์ ์๋ ๊ฐฑ์ ๊ธฐ๋ฅ์ด ํ์ํ๊ฐ์?
- ์์
๋ก๊ทธ์ธ(๊ตฌ๊ธ, ์ ํ ๋ฑ)๋ ํจ๊ป ๊ตฌํํ ๊น์?
- "๋น๋ฐ๋ฒํธ ์ฐพ๊ธฐ" ๊ธฐ๋ฅ์ด ํ์ํ๊ฐ์?
---
์ ์๊ตฌ์ฌํญ์ผ๋ก ์งํํ ๊น์? ์์ ์ด ํ์ํ ๋ถ๋ถ์ด ์๋ค๋ฉด ๋ง์ํด์ฃผ์ธ์!
If the project context is unclear or insufficient:
ํ๋ก์ ํธ ํ์ผ์ ์
๋ก๋ํด์ฃผ์๋ฉด ๋ ์ ํํ ์๊ตฌ์ฌํญ์ ๋ง๋ค ์ ์์ต๋๋ค.
๋๋ ๋ค์ ์ ๋ณด๋ฅผ ์๋ ค์ฃผ์ธ์:
- ์ฌ์ฉ ์ค์ธ ํ๋ ์์ํฌ
- ์ํ ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- ๊ธฐ์กด ํ๋ก์ ํธ ๊ตฌ์กฐ
When helpful, mention existing screens/components:
๊ธฐ์กด ProfileScreen๊ณผ ์ ์ฌํ ๋ ์ด์์์ผ๋ก ๊ตฌํ
- AppBar ์คํ์ผ ๋์ผ
- TextFormField ๋์์ธ ์ฌ์ฌ์ฉ
- PrimaryButton ์ปดํฌ๋ํธ ์ฌ์ฉ
## ๐ ์ฐ๊ด ๊ธฐ๋ฅ
- UserRepository: ์ฌ์ฉ์ ์ ๋ณด ์กฐํ์ ์ฌ์ฌ์ฉ
- TokenStorage: ๊ธฐ์กด ํ ํฐ ์ ์ฅ ๋ก์ง ํ์ฉ
- ErrorHandler: ๊ณตํต ์๋ฌ ์ฒ๋ฆฌ ์ ์ฉ
For detailed patterns: