bear2u

prompt-enhancer

710
189
# Install this skill:
npx skills add bear2u/my-skills --skill "prompt-enhancer"

Install specific skill from multi-skill repository

# Description

Enhance user prompts by analyzing project context (code structure, dependencies, conventions, existing patterns). Use when users provide brief development requests that would benefit from project-specific context to generate more accurate, contextually-aware prompts.

# SKILL.md


name: prompt-enhancer
description: Enhance user prompts by analyzing project context (code structure, dependencies, conventions, existing patterns). Use when users provide brief development requests that would benefit from project-specific context to generate more accurate, contextually-aware prompts.


Prompt Enhancer

Transform brief development requests into clear, detailed requirements by analyzing project context. Present the enhanced requirements to the user for confirmation before implementation.

When to Use This Skill

Use this skill when:
- User provides a brief development request like "๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ ๋งŒ๋“ค์–ด์ค˜", "API ์ถ”๊ฐ€ํ•ด์ค˜"
- Request lacks specific implementation details
- User uploads project files or mentions "the project"
- Task requires understanding project architecture

Core Workflow

Step 1: Analyze Project Context

Check for uploaded files:

view /mnt/user-data/uploads

Gather key information:
- Project structure and organization
- Technology stack (package.json, pubspec.yaml, requirements.txt, etc.)
- Existing patterns (state management, API calls, routing)
- Code conventions (naming, file structure)
- Similar existing features

Step 2: Extract Request Intent

From the user's brief request, identify:
- Feature type: New feature, bug fix, refactoring, API integration
- Scope: Single screen, full flow, backend + frontend
- Dependencies: Related features or systems

Step 3: Build Enhanced Requirements

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]

---
์ด ์š”๊ตฌ์‚ฌํ•ญ์œผ๋กœ ์ง„ํ–‰ํ• ๊นŒ์š”? ์ˆ˜์ •์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”.

Step 4: Present to User

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.

Analysis Patterns by Stack

Flutter Projects

Detect: pubspec.yaml, lib/ directory

Key context to gather:
- State management (Riverpod, Bloc, Provider, GetX)
- Architecture (Clean Architecture, MVVM, MVC)
- Navigation (go_router, auto_route, Navigator)
- Network (Dio, http)
- Local storage (Hive, SharedPreferences, SQLite)

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 ์ž‘์„ฑ

Next.js/React Projects

Detect: package.json with "next" or "react"

Key context to gather:
- Next.js version (App Router vs Pages Router)
- State management (Zustand, Redux, Context)
- Styling (Tailwind, CSS Modules, styled-components)
- API approach (Next.js API routes, external API)
- TypeScript usage

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

Python (Django/FastAPI) Projects

Detect: requirements.txt, manage.py, main.py

Key context to gather:
- Framework (Django, FastAPI, Flask)
- ORM (SQLAlchemy, Django ORM, Tortoise)
- Authentication approach
- API documentation (OpenAPI/Swagger)

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] ์ ์šฉ

Example Enhancement

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`์ด ๋งž๋‚˜์š”?
- ํ† ํฐ ๋งŒ๋ฃŒ ์‹œ ์ž๋™ ๊ฐฑ์‹  ๊ธฐ๋Šฅ์ด ํ•„์š”ํ•œ๊ฐ€์š”?
- ์†Œ์…œ ๋กœ๊ทธ์ธ(๊ตฌ๊ธ€, ์• ํ”Œ ๋“ฑ)๋„ ํ•จ๊ป˜ ๊ตฌํ˜„ํ• ๊นŒ์š”?
- "๋น„๋ฐ€๋ฒˆํ˜ธ ์ฐพ๊ธฐ" ๊ธฐ๋Šฅ์ด ํ•„์š”ํ•œ๊ฐ€์š”?

---
์œ„ ์š”๊ตฌ์‚ฌํ•ญ์œผ๋กœ ์ง„ํ–‰ํ• ๊นŒ์š”? ์ˆ˜์ •์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”!

Tips for Effective Enhancement

Always Ask for Clarification

If the project context is unclear or insufficient:

ํ”„๋กœ์ ํŠธ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•ด์ฃผ์‹œ๋ฉด ๋” ์ •ํ™•ํ•œ ์š”๊ตฌ์‚ฌํ•ญ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋˜๋Š” ๋‹ค์Œ ์ •๋ณด๋ฅผ ์•Œ๋ ค์ฃผ์„ธ์š”:
- ์‚ฌ์šฉ ์ค‘์ธ ํ”„๋ ˆ์ž„์›Œํฌ
- ์ƒํƒœ ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
- ๊ธฐ์กด ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

Include Visual Examples

When helpful, mention existing screens/components:

๊ธฐ์กด ProfileScreen๊ณผ ์œ ์‚ฌํ•œ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ๊ตฌํ˜„
- AppBar ์Šคํƒ€์ผ ๋™์ผ
- TextFormField ๋””์ž์ธ ์žฌ์‚ฌ์šฉ
- PrimaryButton ์ปดํฌ๋„ŒํŠธ ์‚ฌ์šฉ

Highlight Dependencies

## ๐Ÿ”— ์—ฐ๊ด€ ๊ธฐ๋Šฅ
- UserRepository: ์‚ฌ์šฉ์ž ์ •๋ณด ์กฐํšŒ์— ์žฌ์‚ฌ์šฉ
- TokenStorage: ๊ธฐ์กด ํ† ํฐ ์ €์žฅ ๋กœ์ง ํ™œ์šฉ
- ErrorHandler: ๊ณตํ†ต ์—๋Ÿฌ ์ฒ˜๋ฆฌ ์ ์šฉ

Reference Files

For detailed patterns:
- Enhancement patterns: references/enhancement-patterns.md
- Framework guides: references/framework-guides.md

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.