aibdd.auto.php.it.handlers.command

Automate Given/When command handlers by invoking service methods and capturing errors.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/zenbuapps/zenbu-powers --skill aibdd-auto-php-it-handlers-command
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aibdd.auto.php.it.handlers.command
Source: https://github.com/zenbuapps/zenbu-powers/tree/main/skills/aibdd.auto.php.it.handlers.command
Command: npx skills add https://github.com/zenbuapps/zenbu-powers --skill aibdd-auto-php-it-handlers-command

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Command handlers in aibdd workflows often struggle with consistent service invocation, error handling, and dependency resolution. This Skill provides a structured reference for implementing reliable Command handlers that execute operations via service methods, capture failures, and enforce proper layer boundaries.

Core Features & Use Cases

  • Deterministic service invocation: invoke the correct service method based on the api.yml operationId to execute business logic.
  • Error containment: When steps are executed, failures are caught and stored for later validation, avoiding leakage into the test flow.
  • Dependency-driven IDs: all necessary identifiers are sourced from a shared ids map, preventing hard-coded lookups.
  • No direct DB access: reinforces service-layer boundaries, disallowing direct DB calls from the command handler.

Quick Start

Provide a concrete example that uses a When step to call a service method and handle errors with try/catch.

Frequently Asked Questions about aibdd.auto.php.it.handlers.command

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

FAQPage Schema
How do I handle errors in PHP command handlers without breaking the test flow?

Error handling in PHP command handlers captures failures via a lastError mechanism, storing errors for later validation. Wrapping service method calls in try/catch blocks contains exceptions so they do not leak into the test flow.

What's the best way to resolve dependencies in WordPress service layer command handlers?

Dependency resolution in WordPress command handlers uses a shared ids map. Sourcing all necessary identifiers from this map prevents hard-coded lookups and ensures deterministic service invocation when executing business logic.

How do I invoke service methods deterministically from PHP command handlers?

Deterministic service invocation in PHP command handlers uses the operationId defined in api.yml. This ensures the correct service method is called to execute business logic while enforcing service-layer boundaries.

Why should PHP command handlers avoid direct database access in integration tests?

Direct database access in PHP command handlers breaks service-layer boundaries. Preventing direct DB calls ensures all state-changing operations route through service methods, maintaining consistent error handling and architectural integrity.

Can I use Given and When steps to test state-changing operations in WordPress?

Given and When steps in WordPress execute state-changing operations by invoking service methods. The When step calls the appropriate service method while the command handler captures any failures through the lastError mechanism for validation.