lw-site-manager-extend-abilities

Installation
SKILL.md

LW Site Manager: extending with custom abilities

For developers shipping a companion plugin that adds abilities to the LW Site Manager hub — without forking, without registering a parallel namespace. The plugin exposes a small but precise extension contract: two action hooks plus a reusable abstract registrar. Done right, your custom abilities appear seamlessly in the hub's catalog with consistent meta annotations and capability checks; done wrong, they look like an unrelated plugin that happens to share a prefix.

Misconception this skill corrects

"I'll just call wp_register_ability('site-manager/my-thing', [...]) directly on wp_abilities_api_init — same outcome."

It registers the ability, yes. But it bypasses the plugin's central infrastructure:

  1. No shared PermissionManager — your permission_callback is some inline current_user_can('edit_posts') rather than the typed $permissions->callback('can_edit_posts'). When WP shifts a capability mapping (rare but happens — comment editing migrated cap), every ability that called current_user_can directly needs its own update; abilities routed through PermissionManager get the fix in one place.
  2. No AbstractAbilitiesRegistrar helpers — meta annotations (readonly / destructive / idempotent) and output envelope shapes (success / list / entity / bulk-result / update-result) become whatever you remembered to build by hand. Surface looks heterogeneous to AI agents; some abilities tag readonly: true for read endpoints, yours doesn't, agent doesn't realize a "list" is safe to retry.
  3. Wrong category — if you forget category or set one the plugin's category map doesn't recognize, the ability registers but doesn't appear in the plugin's grouped admin UI / catalog views.

The contract is two action hooks + one abstract class to extend. Verified at:

  • lw_site_manager_register_categories action — lw-site-manager.php:232. Fires inside the plugin's category-init hook AFTER its own categories register, so external categories don't collide with built-in ones.
  • lw_site_manager_register_abilities action — src/Abilities/Registrar.php:48. Fires AFTER the plugin's own four registrars run, with the PermissionManager instance as the only argument: do_action( 'lw_site_manager_register_abilities', $this->permissions );.
Installs
1
GitHub Stars
22
First Seen
1 day ago
lw-site-manager-extend-abilities — lonsdale201/wp-agent-skills