Seven lessons, one recurring idea: an ability is plain PHP until the moment it calls an LLM, and that one moment needs a different kind of test than everything around it. This lesson doesn’t introduce anything new, it’s the checklist you actually run through before merging a change to an ability, in the order that catches the most expensive mistakes first.
All seven previous lessons in this course. This one is a reference you’ll come back to, not new material to work through once.
Step 1: The checklist itself
Step 2: The one decision that determines how much of this checklist applies
Not every item here applies to every ability. The fork in the road is Step 1’s fourth
row: does execute_callback call wp_ai_client_prompt() or anything like it. If it
doesn’t, an ability like the ticket-listing example from Lesson 3, you’re done after
the first three items, ordinary PHPUnit, no different from testing any other plugin
function. If it does, the last four items all apply, and skipping any one of them
leaves a real gap: no injection point means no way to test the ability’s own logic
without a live API call, no evals means nobody notices the model’s output quality
degrading over weeks, no contract test means a custom handler you built could be
silently unwired and nothing would tell you.
The shortcut worth naming explicitly: shipping an AI-calling ability with only a manual, one-time “I tried it and it looked right” check, no injected dependency, no automated test at all. It works, right up until a prompt tweak, a provider switch, or a schema change breaks something nobody re-checked by hand. Every pattern in this course exists specifically to make that manual check unnecessary, replaced by something that runs on every change instead of once.
Step 3: Where this course sits in the wider track
This course is the preventive counterpart to Debug & Troubleshoot the MCP Adapter. That course’s whole premise is reactive: something already broke, reproduce it, check the log, isolate registration, permission, or execution. Everything built across these eight lessons exists to reduce how often you ever need that workflow at all, catching the same three failure categories, registration, permission, execution, before a change reaches production rather than after an agent hits it there. If you haven’t taken that course yet, it’s worth doing regardless, since the debugging workflow it builds is still the right tool for the failures no test suite catches, an environment-specific issue, a client-side quirk, something genuinely new.
This course also goes considerably further than the single CI/CD lesson inside
Advanced WordPress MCP Architecture & Enterprise AI,
which introduces wp scaffold plugin-tests and a basic GitHub Actions workflow in one
lesson as part of a much broader capstone course. Everything from Lesson 2’s
Composer-based test library onward, the AI-client injection pattern, evals, contract
testing against the adapter’s own real fixtures, is what that single lesson didn’t have
room for.
Step 4: What to build next
If you’re starting a new plugin with abilities from scratch, Build a WordPress MCP Server From Scratch is the natural place to register your first real ability, this course’s checklist is exactly what to apply the first time you change it. If you already have abilities in production with no tests at all, start with Lesson 2’s PHPUnit setup and Lesson 3’s non-AI tests first, that’s the highest ratio of protection to effort, before moving on to Lesson 4’s injection pattern for anything that calls an LLM.
Recap
The checklist in Step 1 is the entire course compressed into eight lines: registration
and schema, permission across real roles, deterministic execution, an injectable AI
dependency, error propagation from that dependency, evals for the actual output,
contract-tested custom handlers, and a CI pipeline that actually blocks a bad merge
rather than just reporting one. Not every ability needs every line, the fork is
whether execute_callback calls an LLM at all, but every ability that does needs all
eight, and skipping any one of them is exactly the gap a future regression will find
first.
Resources & further reading
- MCP Adapter repository, testing guide, GitHub
- Abilities API reference, developer.wordpress.org
- PHP AI Client SDK repository, GitHub