feat: register a wp-codebox AGENTS.md section on the Agents API context registry - #2508
Merged
Conversation
…xt registry WP Codebox exposes 17 `wp codebox` commands and the `wp-codebox/*` abilities but registered no composable agent-context section, so agents only learned about Codebox through a host integration's Homeboy guidance. Add WP_Codebox_Agents_Md_Section, hooked on `agents_api_context_sections`, which registers an `agents-md` section (slug `wp-codebox`, priority 40) directly on WP_Agent_Context_Section_Registry — the plugin's existing substrate dependency. The body carries default routing, safety, and discovery guidance with `--help` as the authoritative contract. The WP-CLI prefix is filterable via `wp_codebox_agents_md_wp_cli_cmd`. No-op when the substrate class is absent. Closes #2501
…ent-context section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2501
What
Adds
packages/wordpress-plugin/src/class-wp-codebox-agents-md-section.php, hooked onagents_api_context_sections. It registers anagents-mdcontext section (slugwp-codebox, priority 40, label "WP Codebox") directly onWP_Agent_Context_Section_Registry— agents-api, the plugin's existing and only substrate dependency. No reference to any host composer.Rendered body, in the shape peer plugin sections use:
run-agent-task/-batch/-fanout,run-runtime-task,run-wordpress-workload,resolve-runtime-requirements,artifacts list|inspect, thepreflight-apply → stage-apply → applychain,browser-session createapplymutates the host; preflight +--approved-files; never printsecret_envvalues; CLI is trusted operator contextwp codebox --helpis authoritativeWP-CLI prefix defaults to
wp --path=<ABSPATH>, filterable viawp_codebox_agents_md_wp_cli_cmd. Registration is a no-op when the substrate class isn't loaded.Verification
tests/php-agents-md-section.test.ts(auto-discovered by smoke discovery) drives PHP with stub WP hooks and a minimalWP_Agent_Context_Section_Registrystand-in, asserting: no-op without the substrate; exactly one registration with the expected context/slug/priority/label/meta; rendered body has all three headings and every routing verb; the filtered prefix is used; no host-composer names leak into the guidance.Verified end-to-end on extrachill.com against Data Machine 0.176.9 (Extra-Chill/data-machine#3491 made DM's inspection read back from this registry), where this section will appear in
wp datamachine memory sectionsonce deployed.AI disclosure
Authored by Extra Chill Bot (Claude) from the live extrachill.com session; diff and test output reviewed before opening.