A PHP-focused AI agent skill for disciplined, test-driven code changes.
Русский · Skill instructions · Original ub-mode
ub-mode-php adapts the three-stage workflow from Uncle Bob's ub-mode for PHP projects and coding agents. The skill works without any external analyzer or runtime dependencies. Its installed name is ub-mode.
| Stage | Focus |
|---|---|
| First Make It Work | Small changes, test-driven development, behavior and boundaries |
| Then Make It Right | Root causes, code review, complexity, duplication, mutation testing and refactoring |
| Practice | Work log, context management, cleanup and commit discipline |
Copy the single SKILL.md file into your coding agent's skill directory. For Codex:
mkdir -p ~/.codex/skills/ub-mode
cp SKILL.md ~/.codex/skills/ub-mode/SKILL.mdFor other agents supporting SKILL.md, use their corresponding skills directory. Invoke the installed skill using the agent's supported syntax (for example, $ub-mode).
The independent ub-cdmu-php Composer package adds reproducible CRAP, duplicate-detection, mutation-testing and UML measurements. It is optional and never installed automatically. The CLI currently requires PHP 8.4.27+ (<8.5) or PHP 8.5.12+ (<9.0); the agent skill itself does not.
To install CDMU directly from GitHub in a compatible target project:
composer config repositories.ub-cdmu-php vcs https://github.com/Yatseck-k/ub-cdmu-php
composer require --dev yatseck-k/ub-cdmu-php:dev-mainAfter running the project's own tests, an agent can inspect changes with:
vendor/bin/ub-php doctor --format json
vendor/bin/ub-php check --changed --format json
vendor/bin/ub-php dry --changed --threshold 0.8 --format json--changed requires Git; an empty changed-file scan does not assess the entire project. The agent must evaluate both exit codes and structured report fields. Missing coverage is unknown, not a verified pass. Duplication results are candidates for review.
Mutation testing runs project tests and is an explicit, optional operation. UML generation is static and offline. See the CDMU quick guide and reference for prerequisites, commands, statuses and exit codes.
SKILL.md Agent instructions (the only required installation file)
README.md English overview
README.ru.md Russian overview
- ub-cdmu-php — optional PHP analysis CLI.
- commit-rules — standalone skill for Conventional Commits and PR descriptions.
Independently maintained adaptation inspired by unclebob/ub-mode. Original companion tools: Crapper, Dryer, Mutator, and UML Viewer.