AgentStack
SKILL verified MIT Self-run

Create Cqrs Queries

skill-jeffsenso-prestashop-skills-create-cqrs-queries · by jeffsenso

>

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-jeffsenso-prestashop-skills-create-cqrs-queries

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Create Cqrs Queries? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

create-cqrs-queries

Read [CQRS/CONTEXT.md](../../CONTEXT.md) for conventions (scalar inputs/VO getters, QueryResult scalar-only rule).

1. Get-for-editing query

Create src/Core/Domain/{Domain}/Query/Get{Domain}ForEditing.php:

  • Constructor takes int $id (scalar)
  • Getter returns VO: getId(): {Domain}Id
  • Queries are read-only data objects — no side effects

2. Result DTO

Create src/Core/Domain/{Domain}/QueryResult/Editable{Domain}.php:

  • Constructor parameters: all fields the edit form needs to pre-fill (scalar types only — see CONTEXT.md)
  • Public getter for every field
  • Immutable: no setters, all values set at construction

Reference: src/Core/Domain/Tax/QueryResult/EditableTax.php (simple), src/Core/Domain/Manufacturer/QueryResult/EditableManufacturer.php (with associations)

3. List query (assess first)

Most PS grids use SearchCriteria + grid QueryBuilder directly — no explicit CQRS query class needed.

Check the domain convention before creating a list query:

  • If the domain uses SearchCriteria + QueryBuilder in the grid: skip this step
  • If the domain uses an explicit query: create Get{Domain}sForListing.php with SearchCriteria parameter

Reference: Most domains (Tax, Manufacturer, Category) use the grid QueryBuilder pattern without an explicit list query.

4. Query handler interfaces

Create in src/Core/Domain/{Domain}/QueryHandler/:

  • Get{Domain}ForEditingHandlerInterface with handle(Get{Domain}ForEditing $query): Editable{Domain}
  • If list query exists, create corresponding interface
  • Query handlers always return data (typed DTO or array) — never void

Rules

Conventions (scalar-only DTOs, read-only queries) are in [CQRS/CONTEXT.md](../../CONTEXT.md). Skill-specific reminders:

  • Map ALL editable fields in the DTO — missing fields cause empty form fields on edit
  • Return typed DTOs, not ObjectModel instances

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.