LogoSkills

feature:create

Full Feature creation orchestration from Serverpod backend to Flutter frontend

ํ•ญ๋ชฉ๋‚ด์šฉ
Invoke/feature:create
Aliases/feature, /feature:new
Categorypetmedi-workflow
Complexitycomplex
MCP Serversserena, sequential, context7, magic

/feature:create#

Context Framework Note: This behavioral instruction activates when Claude Code users type /feature:create patterns.

Triggers#

  • When creating a new Feature from start to finish
  • When implementing Serverpod backend and Flutter frontend simultaneously
  • When a complete Clean Architecture workflow is needed

Context Trigger Pattern#

/feature:create {feature_name} {entity_name} [--options]

Parameters#

ParameterRequiredDescriptionExample
feature_name โœ… Feature module name (snake_case) community, chat, wallet
entity_name โœ… Entity name (PascalCase) Post, Message, Transaction
--location โŒ Location application , common , console (default: application )
--caching โŒ Caching strategy swr, cache-first, none (default: swr)
--endpoint-type โŒ Endpoint type app, console, both (default: app)
--fields โŒ Field Definition "title:String, content:String"
--with-bdd โŒ BDD Test Generation true, false (default: true)
--bdd-from โŒ BDD Scenario source claudedocs/{feature}/bdd/

Execution Flow#

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 1: Requirements gathering (Interactive)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  1. Feature/Entity ์ด๋ฆ„ ํ™•์ธ                              โ”‚
โ”‚  2. ํ•„๋“œ ์ •์˜ ์ˆ˜์ง‘                                        โ”‚
โ”‚  3. CRUD ๋ฉ”์„œ๋“œ ๋ฒ”์œ„ ํ™•์ธ                                  โ”‚
โ”‚  4. ์บ์‹ฑ ์ „๋žต ์„ ํƒ                                        โ”‚
โ”‚  5. BDD ํ…Œ์ŠคํŠธ ํฌํ•จ ์—ฌ๋ถ€ ํ™•์ธ                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 2: Backend implementation                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Step 1: /serverpod:model                                โ”‚
โ”‚  Step 2: /serverpod:endpoint                             โ”‚
โ”‚  Step 3: melos run backend:pod:generate                  โ”‚
โ”‚  Step 4: ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ (ํ•„์š” ์‹œ)                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 3: Frontend implementation                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Step 5: /feature:domain                                 โ”‚
โ”‚  Step 6: /feature:data                                   โ”‚
โ”‚  Step 7: /feature:presentation                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 4: BDD ํ…Œ์ŠคํŠธ ์ƒ์„ฑ (--with-bdd true ์‹œ) โญ          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Step 8: /bdd:generate {feature_name}                    โ”‚
โ”‚  Step 9: melos run test:bdd:generate --scope={feature}   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 5: Integration and verification                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Step 10: DI ๋“ฑ๋ก ํ™•์ธ                                    โ”‚
โ”‚  Step 11: Route ๋“ฑ๋ก ํ™•์ธ                                  โ”‚
โ”‚  Step 12: melos run build                                โ”‚
โ”‚  Step 13: melos run analyze                              โ”‚
โ”‚  Step 14: melos run test --scope={feature}               โ”‚
โ”‚  Step 15: melos run test:bdd --scope={feature}           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Phase 1: Requirements Gathering#

Interactive Mode#

## Feature Creation Requirements

### default ์ •๋ณด
- **Feature name**: {feature_name}
- **Entity name**: {entity_name}
- **Location**: application / common / console

### Entity Fields
| Field Name | Type | Required | Description |
|--------|------|------|------|
| title | String | โœ… | Title |
| content | String | โœ… | Content |
| category | Enum | โœ… | Category |

### CRUD Methods
- [x] List query (pagination)
- [x] Single item query
- [x] Create
- [x] Update
- [x] Delete

### Caching Strategy
- [x] SWR (Stale-While-Revalidate)
- [ ] Cache-First
- [ ] None

Phase 2: Backend Implementation#

Step 1: Serverpod Model#

# Run /serverpod:model command
/serverpod:model {feature_name} {entity_name}
  --fields  " {fields} " 
   --has-crud true

Generated Files:

  • backend/.../model/entities/{entity_name}.spy.yaml
  • backend/.../model/dto/...
  • backend/.../model/enum/...

Step 2: Serverpod Endpoint#

# Run /serverpod:endpoint command
/serverpod:endpoint {feature_name} {entity_name}
  --type {endpoint_type}

Generated Files:

  • backend/.../endpoint/{feature_name}_endpoint.dart
  • backend/.../service/{feature_name}_service.dart

Step 3: Code Generation#

melos run backend:pod:generate

Step 4: Migration#

melos run backend:pod:create-migration
melos run backend:pod:run-migration

Phase 3: Frontend Implementation#

Step 5: Domain Layer#

# Run /feature:domain command
/feature:domain {feature_name} {entity_name}
  --location {location}

Generated Files:

  • Entity, Repository Interface, UseCase
  • UseCase Test

Step 6: Data Layer#

# Run /feature:data command
/feature:data {feature_name} {entity_name}
  --location {location}
  --caching {caching}

Generated Files:

  • Repository Implementation์ฒด, Serverpod Mixin
  • Cache Strategy, Local DB (Drift)

Step 7: Presentation Layer#

# Run /feature:presentation command
/feature:presentation {feature_name} {entity_name}
  --location {location}

Generated Files:

  • BLoC (Event, State), BLoC Test
  • Page, Widget, Widget Test
  • Route, Widgetbook UseCase

Phase 4: BDD Test Generation#

--with-bdd true (default) executed:

Step 8: BDD Scenario and Step Generation#

# Run /bdd:generate command
/bdd:generate {feature_name}
  --entity-name {entity_name}
  --location {location}
  --from-claudedocs true  # claudedocs์— BDD ํŒŒ์ผ์ด ์žˆ๋Š” ๊ฒฝ์šฐ

Generated Files:

feature/{location}/{feature_name}/
โ”œโ”€โ”€ build.yaml                    # BDD ๋นŒ๋” ์„ค์ •
โ””โ”€โ”€ test/src/bdd/
    โ”œโ”€โ”€ {feature}_list.feature
    โ”œโ”€โ”€ {feature}_detail.feature
    โ”œโ”€โ”€ {feature}_form.feature
    โ”œโ”€โ”€ step/
    โ”‚   โ”œโ”€โ”€ common_steps.dart     # ๊ณต์šฉ ์Šคํ… import
    โ”‚   โ””โ”€โ”€ {feature}_steps.dart  # Feature ์ „์šฉ ์Šคํ…
    โ””โ”€โ”€ hooks/
        โ””โ”€โ”€ hooks.dart            # Setup/Teardown

Step 9: Generate BDD test code#

# Run bdd_widget_test builder
melos run test:bdd:generate --scope={feature_name}

Generation result: Auto-generated test code from .feature files

Phase 5: Integration and Verification#

Step 10: Dependency Wiring Verification#

Items to verify: No di/ folder, no getIt usage, direct BlocProvider creation

// ํŽ˜์ด์ง€์—์„œ BLoC ์ง์ ‘ ์ƒ์„ฑ
BlocProvider(create: (_) => {Feature}Bloc())

Step 9: Route Registration Verification#

File to verify: app/petmedi/lib/src/route/app_router.dart

Step 10-12: Build and test#

melos run build
melos run analyze
melos run test --scope={feature_name}

TodoWrite Template#

TodoWrite([
  // Backend
  {"content": "Generate Serverpod model", "status": "pending", "activeForm": "Generate Serverpod model in progress"},
  {"content": "Generate Serverpod endpoint", "status": "pending", "activeForm": "Generate Serverpod endpoint in progress"},
  {"content": "backend:pod:generate ์‹คํ–‰", "status": "pending", "activeForm": "backend:pod:generate running"},

  // Frontend - Domain
  {"content": "Generate Domain Entity", "status": "pending", "activeForm": "Generate Domain Entity in progress"},
  {"content": "Generate Repository Interface", "status": "pending", "activeForm": "Generate Repository Interface in progress"},
  {"content": "Generate UseCase", "status": "pending", "activeForm": "Generate UseCase in progress"},
  {"content": "Generate UseCase tests", "status": "pending", "activeForm": "Generate UseCase tests in progress"},

  // Frontend - Data
  {"content": "Generate Repository implementation", "status": "pending", "activeForm": "Generate Repository implementation in progress"},
  {"content": "Generate Serverpod Mixin", "status": "pending", "activeForm": "Generate Serverpod Mixin in progress"},

  // Frontend - Presentation
  {"content": "Generate BLoC", "status": "pending", "activeForm": "Generate BLoC in progress"},
  {"content": "Generate BLoC tests", "status": "pending", "activeForm": "Generate BLoC tests in progress"},
  {"content": "Generate Page/Widget", "status": "pending", "activeForm": "Generate Page/Widget in progress"},
  {"content": "Generate Widget tests", "status": "pending", "activeForm": "Generate Widget tests in progress"},
  {"content": "Define Routes", "status": "pending", "activeForm": "Define Routes in progress"},
  {"content": "Generate Widgetbook UseCase", "status": "pending", "activeForm": "Generate Widgetbook UseCase in progress"},

  // BDD ํ…Œ์ŠคํŠธ (--with-bdd true ์‹œ)
  {"content": "Generate BDD .feature files", "status": "pending", "activeForm": "Generate BDD .feature files in progress"},
  {"content": "Generate BDD Step definitions", "status": "pending", "activeForm": "Generate BDD Step definitions in progress"},
  {"content": "Configure BDD Hooks", "status": "pending", "activeForm": "Configure BDD Hooks in progress"},
  {"content": "Generate BDD test code", "status": "pending", "activeForm": "Generate BDD test code in progress"},

  // Integration
  {"content": "Code generation and analysis", "status": "pending", "activeForm": "Code generation and analysis in progress"},
  {"content": "Run unit tests", "status": "pending", "activeForm": "Run unit tests in progress"},
  {"content": "Run BDD tests", "status": "pending", "activeForm": "Run BDD tests in progress"},
])

MCP Integration#

PhaseMCP ServerPurpose
Requirements analysisSequentialComplex analysis and planning
BackendSerena, Context7Pattern analysis, Serverpod Document
DomainSerena, Context7UseCase Pattern, Clean Architecture
DataSerena, Context7Mixin Pattern, Drift Document
PresentationMagic, SerenaUI generation, BLoC Pattern
VerificationSerenaSymbol search, reference verification

Reference Agents#

Reference ~/.claude/commands/agents/feature-orchestrator-agent.md for detailed implementation rules

Examples#

Create Community Post Feature#

/feature:create community Post
  --location application
  --caching swr
  --endpoint-type app
  --fields  " title:String, content:String, category:PostCategory, imageUrls:List < String > ? "

Create Chat Message Feature#

/feature:create chat Message
  --location application
  --caching cache-first
  --endpoint-type app
  --fields  " content:String, senderId:int, chatRoomId:int, readAt:DateTime? "

Create Admin Dashboard Feature#

/feature:create dashboard Stats
  --location console
  --caching none
  --endpoint-type console
  --fields  " totalUsers:int, totalPosts:int, activeUsers:int "

Success Criteria#

  1. โœ… All files generated in correct locations
  2. โœ… melos run analyze No errors
  3. โœ… melos run test --scope={feature_name} Passes
  4. โœ… melos run test:bdd --scope={feature_name} Passes (--with-bdd true when)
  5. โœ… DI Registration complete
  6. โœ… Route Registration complete
  7. โœ… Components verifiable from Widgetbook
  8. โœ… BDD .feature File Gherkin ๋ฌธ๋ฒ• ์ค€์ˆ˜

Core Rules Summary#

Backend#

  • Korean comments on all fields
  • Follow import order
  • Separate business logic into Service

Domain#

  • UseCase const constructor + Optional Constructor Injection
  • getIt/@injectable prohibited
  • All UseCase tests required

Data#

  • Serverpod Mixin as pod namespace required
  • SWR/Cache-First caching strategy

Presentation#

  • BLoC Event: sealed class + private implementation
  • UseCase Optional Constructor Injection (Bloc(useCase: mockUseCase) Test)
  • Widget super.key last position
  • BLoC/Widget tests required
  • Widgetbook reflection required