assets/skills/feature/new/SKILL.md
DDD feature development workflow with phase-based checks and review loop. Use when implementing new features, building functionality, or when user says "implement feature", "add feature", "build feature", "create feature", "new feature".
npx skillsauth add phuthuycoding/moicle feature-newInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build a new feature following DDD layers with rule checks per phase and a final review loop until score ≥ B.
ARGUMENTS: <domain> <feature> — e.g., wallet savings, notification broadcast, catalog products
/fix-hotfix/research-web or /research-spike first/feature-refactorDetect stack via ~/.claude/architecture/_shared/stack-detection.md. Load ddd-architecture.md + the stack doc — extract directory layout, layer rules, forbidden imports, check scripts before any code.
1 PLAN → 2 DOMAIN → 3 INFRA → 4 APP → 5 WIRE → 6 TESTS → REVIEW LOOP
Pick the smallest existing module in the project as a template. Read ALL its files end-to-end:
Present to the user:
## Feature Plan: {domain}/{feature}
### Entities + fields
- `{Entity}` — {field: type, with constraint}
- ...
### Value Objects
- `{Status}` — states: {list}, transitions: {list}
- ...
### Endpoints / screens / commands
| Method | Path | Purpose |
|--------|------|---------|
| POST | /api/v1/wallets/:id/savings | Open savings account |
### Domain events
| Event | Triggered when | Listeners |
|-------|----------------|-----------|
| `SavingsAccountOpened` | After Account.open() succeeds | NotificationListener |
### Business rules
- Cannot open savings if main balance < min threshold
- Interest accrues nightly via scheduled job
- ...
### Files to create
- `domain/wallet/entities/savings_account.go`
- `domain/wallet/valueobjects/savings_status.go`
- `domain/wallet/ports/savings_store.go`
- `domain/wallet/usecases/open_savings.go`
- `application/ports/http/savings_handler.go`
- `infrastructure/database/savings_store.go`
- (+ tests for each domain file)
Build in order: value objects → entities → events → ports → usecases.
IsTerminal(), CanTransitionTo()). Stdlib imports only.isActive(), canXxx()) + business error types. Raise events on state change. Imports: stdlib + valueobjects + domain/shared.{build_domain} && echo PASS || echo FAIL
{grep_forbidden in domain/} && echo FAIL || echo PASS
{cross_domain_check} && echo FAIL || echo PASS
LOOP:
1. /review-architect {stack} {domain}
2. IF violations severity ≥ MEDIUM:
fix all → build → tests → GOTO 1
3. IF score ≥ B → BREAK
## Feature Complete: {domain}/{feature}
### Files
- Created: {N}, Modified: {N}
### Endpoints / Screens
| Method | Route | Description |
|--------|-------|-------------|
### Domain Events
| Event | Listeners |
|-------|-----------|
### Test coverage
- {N} test files, {M} cases — value objects + entities + usecases
### Review score: {A/B}
- Build / Lint / Domain purity / Tests: all PASS
| When | Use |
|------|-----|
| Don't know approach yet | /research-web → then this skill |
| Want to validate by prototyping | /research-spike → then this skill |
| Adding only an endpoint | /feature-api |
| Restructuring existing module | /feature-refactor |
| Architecture check (called automatically in Phase 7) | /review-architect |
| Write tests inline (TDD style) | /review-tdd |
| Phase | Agent | Purpose |
|-------|-------|---------|
| PLAN | @clean-architect | Architecture design |
| BUILD | Stack-specific dev agent | Implementation |
| BUILD | @db-designer | Schema if new tables needed |
| BUILD | @api-designer | API surface if exposed |
| TESTS | @test-writer | Domain tests |
| REVIEW | @code-reviewer | Code quality |
| REVIEW | @security-audit | Security check |
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
testing
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".