dabydat/alpha-omega/nestjs-cqrs-commands
Claude Code and agent skill by dabydat/alpha-omega
- community
Checking that the SKILL.md file is still in the repository.
CQRS Command patterns for NestJS. Covers command definitions, command handlers, transaction execution, parallel operations, and write operation patterns. Use when implementing create/update/delete operations, command handlers, or any write-side CQRS patterns.
Install
npx vskill@latest install dabydat/alpha-omega/nestjs-cqrs-commandsSKILL.md
NestJS CQRS Commands
Commands represent intent to change state. They are the write side of CQRS. A command says "do something" - creating, updating, or deleting an aggregate.
Production patterns for: Command handlers, transaction execution, parallel operations, write-side CQRS
Agent collaboration: Backend Dev (parallel execution, repository pattern, max 30-line functions), Architect (CQRS pattern selection)
Core Principle: Commands are Intent, Not Data
See references/why-commands.md for the INCORRECT (carries state like a DTO) vs CORRECT (represents business intent) comparison.
Command Definition
Anatomy of a Command
See references/command-definition.md.
Full examples: See references/command-examples.md (create, update, process, delete commands).
Command Handler
Handler Structure
See references/command-handler.md.
Full examples: See references/handler-examples.md (transaction, domain events, transactional, idempotent handlers).
Parallel Execution (Backend Dev Non-Negotiable)
See references/parallel-execution.md for the Promise.all pattern and the parallel-queries example.
Idempotent Commands
See references/idempotent-command.md for the ProcessPaymentHandler.
Anti-Patterns
See references/anti-patterns.md for the three ❌ examples (business logic outside aggregate, repo in constructor, swallowing exceptions).
Handler Responsibilities
| Responsibility | Location | |
|---|---|---|
| Validate preconditions | Handler (check if aggregate exists) | |
| Create value objects | Handler (translate primitives to VOs) | |
| Create/load aggregate | Handler (factory or repository) | |
| Enforce invariants | Aggregate (domain logic) | |
| Persist aggregate | Handler -> Repository | |
| Emit domain events | Aggregate -> EventPublisher | |
| Parallel execution | Handler (Promise.all for independent ops) |
Golden rule: If it could be a domain invariant, it belongs in the aggregate. Handler orchestrates, aggregate decides.
Quality Checklist
Related Skills
nestjs-ddd-patterns- AggregateRoot and domain eventsnestjs-cqrs-queries- Query handlers for read operationsnestjs-repository-pattern- Data persistencenestjs-guards-filters- Exception handlingnestjs-event-driven-architecture- Async event handling
Commands vs Queries
| Aspect | Command | Query | |
|---|---|---|---|
| Intent | Change state | Read state | |
| Returns | Entity or void | DTO or paginated result | |
| Side effects | Yes | No | |
| Concurrency | Optimistic locking | Read consistency | |
| Failures | Domain exceptions | Not found exceptions |
Why separate: Commands and queries have different consistency requirements, different optimization paths, different scaling characteristics. CQRS allows optimizing each side independently.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/nestjs/nestjs-cqrs-commands/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dabydat/alpha-omega/nestjs-cqrs-commands)