From rockets-sdk-config
This skill should be used when implementing business logic beyond standard CRUD — state machines, approval workflows, event-driven automation, notifications, file uploads, external API integration, or cross-entity orchestration. Use after CRUD modules are generated. Also covers the foundational rule that application services must inject model services, never repositories.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rockets-sdk-config:rockets-business-logicThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implements business logic patterns that go beyond standard CRUD. This is a conceptual skill — the AI adapts parameterized templates from `BUSINESS_LOGIC_PATTERNS_GUIDE.md` to the domain.
Implements business logic patterns that go beyond standard CRUD. This is a conceptual skill — the AI adapts parameterized templates from BUSINESS_LOGIC_PATTERNS_GUIDE.md to the domain.
This skill covers all non-CRUD endpoint/workflow logic plus service-boundary enforcement. It also covers general custom code patterns (model service injection, cross-module dependencies).
Apply these rules before any pattern implementation:
@InjectRepository(...) is forbidden in custom/workflow/non-CRUD services.Create a model service for a module when:
Modules with only standard CRUD may omit the model service.
// ✅ ReportService — injects model services only
@Injectable()
export class ReportService {
constructor(
private readonly userModelService: UserModelService,
private readonly taskModelService: TaskModelService,
) {}
async getUsersWithTaskCount(): Promise<UserTaskReportItemDto[]> {
const users = await this.userModelService.find({ order: { email: 'ASC' } });
// ... for each user: taskModelService.find({ where: { userId: user.id } })
}
}
// ❌ Wrong — direct repository in application service
@Injectable()
export class ReportService {
constructor(
@InjectRepository(UserEntity) private userRepo: Repository<UserEntity>,
@InjectRepository(TaskEntity) private taskRepo: Repository<TaskEntity>,
) {}
}
After CRUD modules are generated (rockets-crud-generator), use this skill to implement:
What does the SBVR rule describe?
|
+-- Entity has status field with enumerated values?
| -> Pattern 1: State Machine + History
|
+-- Non-CRUD verb on entity (approve, cancel, assign, complete)?
| -> Pattern 2: Custom CRUD Actions
|
+-- Workflow crosses 3+ entities in sequence?
| -> Pattern 3: Cross-Service Orchestration
| +-- All entities in same DB and atomicity needed?
| -> Also add Pattern 9: Transactional Multi-Entity
|
+-- "System does X when Y happens" (decoupled side effect)?
| -> Pattern 4: Event-Driven Automation
|
+-- "System sends email/notification when..."?
| -> Pattern 5: Email Notification + Audit
|
+-- File format/size rules, role-based upload restrictions?
| -> Pattern 6: File Upload Pipeline
|
+-- "System queries/retrieves from external API"?
| -> Pattern 7: External API Provider
|
+-- "Check if exists locally, create if not" (reference data sync)?
| -> Pattern 8: Deduplication / Reference Sync
|
+-- Read-heavy joins, dashboard data, role-based filtering?
| -> Pattern 10: Denormalized View
{entity}-status.constants.ts{entity}-status.service.ts injecting model service{workflow}-workflow.service.ts@nestjs/event-emitter if not presentEventEmitterModule.forRoot() to AppModuleevents/ directorylisteners/ directory@nestjs/axios if not present{provider}-http.service.ts with timeout and error handlingConfigService (never hardcoded)syncFromApi() to model serviceDataSource in workflow servicedataSource.transaction()@ViewEntity with SQL expressionTypeOrmModule.forFeature() and ormconfig.tsAfter implementing business logic patterns:
yarn build — zero TypeScript errorsdevelopment-guides/BUSINESS_LOGIC_PATTERNS_GUIDE.md — canonical pattern templatesdevelopment-guides/SBVR_EXTRACTION_GUIDE.md — rule classification and extractiondevelopment-guides/CRUD_PATTERNS_GUIDE.md — CRUD foundation (generate first)development-guides/SDK_SERVICES_GUIDE.md — model service rulesnpx claudepluginhub btwld/skills --plugin rockets-sdk-configGenerates backend service implementations with business logic from OpenAPI specs, data models, and scaffold stubs. Use when implementing service layers from TODO stubs.
Implements backend services, APIs, and business logic. Builds features, fixes bugs, refactors code from specifications.
Encapsulates business logic in @Injectable services with repository pattern separation for NestJS applications. Useful for reusable logic, database interaction, and testable code.