query-sub-agent

Design and validate CQRS Query read models for Information Display Frames.

2|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/knowlet/skills --skill query-sub-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-sub-agent
Source: https://github.com/knowlet/skills/tree/main/skills/query-sub-agent
Command: npx skills add https://github.com/knowlet/skills --skill query-sub-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill designs and reviews Query/Read Model patterns for the IDF frame, ensuring read models are efficient, testable, and decoupled from domain logic.

Core Features & Use Cases

  • Query Handler design: map inputs to read models.
  • Read Model & projection planning: define projections and caching.
  • Performance & tests: provide tests for queries and ensures acceptance criteria.

Quick Start

Provide a docs/specs/get-order-details.yaml and language preference to generate a GetOrderByIdQuery skeleton under src/application/queries/.

Frequently Asked Questions about query-sub-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a read model for displaying query results in CQRS?

A read model in CQRS is a denormalized data structure optimized for query performance. Design it by mapping query inputs to cached projections, defining which domain events populate the model, and applying caching strategies to meet acceptance criteria. This Skill generates read-model skeletons from your frame and requirements specs.

What's the difference between a query handler and a read model?

A query handler is the entry point that accepts a query request and routes it to the appropriate read model. The read model is the cached, denormalized data store backing that handler. Together they form the query side of CQRS, decoupling reads from domain logic.

How do I add caching strategies to query projections?

Caching strategies define how and when projections are refreshed. Specify cache duration, invalidation triggers, and storage location in your read-model design. This Skill reviews and validates caching decisions against performance constraints and generates tested query implementations.

Can I use this for non-CQRS architectures?

This Skill is purpose-built for CQRS query-side patterns within Information Display Frames. It requires frame.yaml specifications and reads machine/query.yaml configs. For non-CQRS query optimization, you'd need a different approach outside this pattern.

What input files do I need to provide?

Provide docs/specs/{feature-name}/ containing frame.yaml, requirements/, machine/query.yaml, read-model.yaml, and any cross-context files. The Skill reads these specs to generate or review query handler and read-model code skeletons with performance and caching details.

How does this Skill test query implementations?

The Skill generates test skeletons and validates query handlers against acceptance criteria from your requirements. It ensures projections are testable, caching is verifiable, and query performance meets specified constraints before deployment.