Workflow·E-commerce

Create CQRS Commands

Set up the full domain layer for a CQRS entity: identity value object, additional value objects, exception hierarchy, commands (Add, Edit…

You say
Install this skill Read the source first Free Written by PrestaShop · unverified publisher
Context cost
1.4k tokensestimated from the bundle, loaded when it triggers
Bundle
1 file · 5.7 kBtext throughout, nothing executable
Licence
OSL-3.0free to use
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Set up the full domain layer for a CQRS entity: identity value object, additional value objects, exception hierarchy, commands (Add, Edit, Delete, Toggle, sub-resource, or any custom domain action), and handler interfaces. Covers everything in src/Core/Domain/{Domain}/. Trigger: "create CQRS commands for {Domain}", "set up domain layer for {Domain}".

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Workflow

Runs a procedure end to end.

prestashopcqrssymfonyphp
Filed under

E-commerce

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md5.7 kB · 132 lines
--- name: create-cqrs-commands description: > Set up the full domain layer for a CQRS entity: identity value object, additional value objects, exception hierarchy, commands (Add, Edit, Delete, Toggle, sub-resource, or any custom domain action), and handler interfaces. Covers everything in src/Core/Domain/{Domain}/. Trigger: "create CQRS commands for {Domain}", "set up domain layer for {Domain}". needs: [] produces: "Complete src/Core/Domain/{Domain}/ layer: ValueObject/, Command/, CommandHandler/, Exception/" subagent: optional ---
14# create-cqrs-commands
15
16This skill creates the entire domain layer for an entity. It covers the Core side only
17(interfaces and data objects) — handler implementations live in implement-cqrs-handlers.
18
19Read [CQRS/CONTEXT.md](../../CONTEXT.md) for conventions (scalar inputs/VO getters, exception hierarchy, handler rules).
20
21## 1. Identity Value Object
22
23Create src/Core/Domain/{Domain}/ValueObject/{Domain}Id.php:
24
25- Constructor takes int $value, validates $value > 0, throws {Domain}Exception if not
26- Single getter: getValue(): int
27- No Symfony/Doctrine dependencies — pure PHP
28
29**Reference:** src/Core/Domain/Tax/ValueObject/TaxId.php (simple), src/Core/Domain/Carrier/ValueObject/CarrierId.php (complex domain)
30
31## 2. Additional Value Objects (if needed)
32
33For fields with non-trivial validation or domain meaning (not just string/int):
34
35- Enum-like fields: class with constants + fromInt()/fromString() factory
36- URL fields: validate format in constructor
37- Constrained numbers: range checks in constructor
38
39Not every field needs a VO — only those with invariants beyond primitive type checking.
40
41For has-many relations, create typed collections implementing \Countable and \IteratorAggregate.
42
43## 3. Exception Hierarchy
44
45Create in src/Core/Domain/{Domain}/Exception/ following the hierarchy documented in [CQRS/CONTEXT.md](../../CONTEXT.md#exception-hierarchy): base, not-found, per-action, and constraint classes.
46
47**Reference:** src/Core/Domain/Tax/Exception/ (simple), src/Core/Domain/Carrier/Exception/ (many constraint codes)
48
49## 4. Commands
50
51All commands live in src/Core/Domain/{Domain}/Command/.
52
53### 4.1 Add command
54
55Add{Domain}Command.php:
56
57- Constructor takes all **required** fields as scalar typed parameters
58- Optional fields use nullable types with defaults
59- Multilingual fields: array $localizedValues keyed by language ID
60- Validate primitives in constructor (non-empty strings, positive ints)
61- Getters can return VOs built from the scalar inputs
62- Sub-resource fields are NOT included — they get their own command (see 4.5)
63
64**Reference:** src/Core/Domain/Tax/Command/AddTaxCommand.php (simple), src/Core/Domain/Carrier/Command/AddCarrierCommand.php (many fields)
65
66### 4.2 Edit command (partial-update pattern)
67
68Edit{Domain}Command.php — follows the partial-update pattern from [CQRS/CONTEXT.md](../../CONTEXT.md#commands):
69
70- Constructor takes **only** the entity ID (as int)
71- Every editable field: private ?Type $field = null
72- Fluent setter: public function setName(string $name): self { $this->name = $name; return $this; }
73- Nullable getter: public function getName(): ?string { return $this->name; }
74- Do NOT include fields that are immutable after creation
75
76**Reference:** src/Core/Domain/Tax/Command/EditTaxCommand.php (simple), src/Core/Domain/Manufacturer/Command/EditManufacturerCommand.php (with image)
77
78### 4.3 Delete command
79
80Delete{Domain}Command.php:
81
82- Single constructor parameter: int $id (scalar)
83- Getter returns VO: getId(): {Domain}Id
84- No other properties — existence/constraint checks happen in the handler
85
86### 4.4 Toggle status command
87
88Toggle{Domain}StatusCommand.php (if entity has an active/enabled boolean):
89
90- Constructor takes int $id and optionally bool $expectedStatus
91- Handler reads current status and flips it, or sets to $expectedStatus if provided
92- Used by the grid toggle switch (AJAX)
93
94### 4.5 Sub-resource commands (if entity has has-many relations)
95
96Set{Domain}{SubResource}sCommand.php — one command per sub-resource type:
97
98- Constructor takes the entity int $id and the full replacement collection (as array of scalars)
99- Getters return VOs as appropriate
100- One command per sub-resource type
101
102**Reference:** src/Core/Domain/Carrier/Command/SetCarrierRangesCommand.php
103
104### 4.6 Custom domain actions
105
106Any domain action that doesn't fit CRUD follows the same pattern: a command class with scalar constructor parameters and getters. The naming convention is {Verb}{Domain}Command.php.
107
108## 5. Handler Interfaces
109
110Create in src/Core/Domain/{Domain}/CommandHandler/:
111
112- One interface per command: Add{Domain}HandlerInterface, Edit{Domain}HandlerInterface, etc.
113- Single method: public function handle({Action}{Domain}Command $command): void
114- Exception: Add{Domain}HandlerInterface::handle() returns {Domain}Id (the new entity's ID)
115- All other handlers return void
116
117The concrete implementations live in src/Adapter/{Domain}/CommandHandler/ (see implement-cqrs-handlers skill).
118
119## 6. Domain Interfaces (if needed)
120
121For abstractions that cross the Core/Adapter boundary beyond the repository:
122
123- File uploader: {Domain}LogoFileUploaderInterface in Core, implemented in Adapter
124- Use only Core domain types in signatures — no Doctrine/ObjectModel types
125
126## Rules
127
128All conventions (scalar inputs/VO getters, exception hierarchy, handler rules) are in [CQRS/CONTEXT.md](../../CONTEXT.md). Skill-specific reminders:
129
130- All validation failures throw domain exceptions from the constructor
131- One handler interface per command — never combine multiple commands
132
In the file
SKILL.md657 words
Files1
LicenceOSL-3.0
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈140
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
1,285
on trigger
The instruction body, read only when the skill fires.
0.71%
of a 200k window
Ten skills this size would take about 7% of the window before you open a file.
050k100k150k200k context window

1.4k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Middling. Fine to keep on in a project where you use it weekly, worth unloading in one where you never do.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

1 file, 5.7 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md5.7 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 1 file you can review in full before installing. The OSL-3.0 licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

# Create CQRS Commands · 1.4k tokens when loaded npx mcprush@latest skill add prestashop/create-cqrs-commands

Writes to .claude/skills/create-cqrs-commands/ in the current project. Add --global to put it in your home directory instead, for every project.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
PriceFree
Referenceprestashop/create-cqrs-commands

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Who wrote it

PR
PrestaShop

Publishes on mcprush.

0 servers listed1 skill listednot claimed
Profile
Publisher
Servers0
Claim this skill