commands

A design pattern for application services that handle write actions such as creating, updating, or deleting business data. It also describes how those services manage transactions, publish business events, and dispatch commands.

In plain words
What is it for?
Use it when implementing application-service commands that modify domain aggregates, need transaction handling, publish events, or call external services.
Why use it?
It gives write operations a consistent structure for coordinating data changes and related work across business objects or outside systems.

Command

Part of the application-spec plugin — 5 skills, 1 command, 26 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/voro6yov/spec-driven-development/index
Clone the repo
git clone --depth 1 https://github.com/voro6yov/spec-driven-development

Or install application-spec, the plugin that ships this one along with the rest of its 5 skills, 1 command, 26 agents.

Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,771 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.01771
Opus 5 $0.00018 $0.00886
Sonnet 5 $0.00007 $0.00354
Haiku 4.5 $0.00004 $0.00177

Measured 2d ago against content hash d58a5a02d58a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commands scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/application-spec/skills/patterns/commands/index.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Commands

Purpose: Handle write operations (create, update, delete) for domain aggregates with transaction management and event publishing

Purpose

  • Handle write operations (create, update, delete) for domain aggregates.
  • Coordinate transactions, domain event publishing, and command dispatching.
  • Encapsulate business workflows that span multiple aggregates or external systems.

Structure

  • Accept AbstractUnitOfWork, DomainEventPublisher, CommandProducer as core dependencies.
  • Accept Protocol-based interfaces (e.g., ICanUpdateLineItems) for external system interactions.
  • Use @retry_on_transaction_error() decorator on all methods that modify state.
  • Maintain a logger instance for operation tracking.

Note on External Dependencies: The template includes imports for pubsub infrastructure (CommandProducer, DomainEventPublisher). You can customize the module path via the pubsub_module template variable, or it defaults to deps_pubsub. If your project uses different event/command infrastructure, provide the appropriate module path.

Behavior checklist

  • Wrap aggregate operations in with self._uow: context manager.
  • Load aggregates from repository or create new instances using domain factories.
  • Invoke domain methods on aggregates to perform state changes.
  • Save aggregates via self._uow.{aggregate_plural}.save(aggregate).
  • Commit transaction with self._uow.commit().
  • Publish domain events via _publish_events() helper after commit.
  • Send commands via _send_commands() helper if aggregate emits commands.
  • Log successful operations with appropriate detail level.
  • Raise domain exceptions (e.g., AggregateNotFound) when aggregates are missing.

Testing guidance

  • Write integration tests that verify transaction boundaries, event publishing, and command dispatching.
  • Use fakes for Protocol interfaces to isolate external system interactions.
  • Verify aggregate state changes and emitted events match expected outcomes.

Read the full file on GitHub · 171 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 171 lines · 36 tokens per session scan A d58a5a02d58a

Subscribe to this mod's changes

commands is a command published in the GitHub repository voro6yov/spec-driven-development (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 36 tokens to every session and 1,771 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.