convention-cqs
CommunityEnforce clear separation of commands and queries.
AuthorsunLeee
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Commands and queries are mixed in the same functions, leading to side effects in read paths and making code harder to test. This skill enforces the Command-Query Separation by ensuring a function is either a Command (state-changing, no return) or a Query (data retrieval, no side effects).
Core Features & Use Cases
- Enforces strict separation of Command (state changes, no return) and Query (data retrieval, no side effects).
- Improves testability, readability, and maintainability of software components, APIs, and services.
- Use Case: design APIs and modules with predictable behavior and easier reasoning about data flow.
Quick Start
Refactor code so every function is either a Command or a Query; a Command modifies state and returns None, while a Query returns data without side effects.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: convention-cqs Download link: https://github.com/sunLeee/optimization/archive/main.zip#convention-cqs Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.