pluginslab/wp-agentic-admin / .claude/skills/new-ability
new-ability
VerifiedScaffold a new ability with PHP backend, JS chat interface, and test case
Scaffold New Ability: $ARGUMENTS
Before starting
Read these for the full patterns:
- An existing ability PHP file (e.g.,
includes/abilities/cache-flush.php) - An existing ability JS file (e.g.,
src/extensions/abilities/cache-flush.js) docs/ABILITIES-GUIDE.mdfor parseIntent, confirmation, and annotation details
Steps
-
PHP backend — create
includes/abilities/$ARGUMENTS.php:- Use
register_agentic_ability( 'agentic-admin/$ARGUMENTS', $php_config, $js_config ) - Include
permission_callbackwith appropriatecurrent_user_can()check - Include
input_schemawith top-leveldefaultfield - Include
output_schema - Set
annotations:readonly,destructive,idempotent - Implement
execute_callbackreturning{ success: bool, message: string, ... }
- Use
-
JS chat interface — create
src/extensions/abilities/$ARGUMENTS.js:- Use
registerAbility( 'agentic-admin/$ARGUMENTS', { ... } ) - Include:
label(string literal),description(string literal),keywords(array),initialMessage,summarize(),interpretResult(),execute() - Set
requiresConfirmationbased on whether the ability is destructive
- Use
-
Register — add import and call in
src/extensions/abilities/index.js -
Test case — add at least one test case in
tests/abilities/core-abilities.test.js -
Lint — run
npx wp-scripts lint-json the new JS file andcomposer linton the new PHP file -
Verify — run
npm run test:abilities -- --file tests/abilities/core-abilities.test.jsto confirm the model selects the new ability correctly
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |