Skip to content

feat: register a wp-codebox AGENTS.md section on the Agents API context registry - #2508

Merged
chubes4 merged 2 commits into
mainfrom
feat/agents-md-section
Sep 12, 2026
Merged

feat: register a wp-codebox AGENTS.md section on the Agents API context registry#2508
chubes4 merged 2 commits into
mainfrom
feat/agents-md-section

Conversation

@chubes4

@chubes4 chubes4 commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #2501

What

Adds packages/wordpress-plugin/src/class-wp-codebox-agents-md-section.php, hooked on agents_api_context_sections. It registers an agents-md context section (slug wp-codebox, priority 40, label "WP Codebox") directly on WP_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:

  • one-paragraph identity (disposable, isolated, artifacts come back for review)
  • Default routingrun-agent-task / -batch / -fanout, run-runtime-task, run-wordpress-workload, resolve-runtime-requirements, artifacts list|inspect, the preflight-apply → stage-apply → apply chain, browser-session create
  • Safetyapply mutates the host; preflight + --approved-files; never print secret_env values; CLI is trusted operator context
  • Discoverywp codebox --help is authoritative

WP-CLI prefix defaults to wp --path=<ABSPATH>, filterable via wp_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 minimal WP_Agent_Context_Section_Registry stand-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.

npx tsx tests/php-agents-md-section.test.ts   # OK
npx tsx tests/php-json-codec.test.ts          # OK (sibling, unchanged)
php -l on both touched PHP files               # clean

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 sections once deployed.

AI disclosure

Authored by Extra Chill Bot (Claude) from the live extrachill.com session; diff and test output reviewed before opening.

…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
@chubes4
chubes4 merged commit 033e24c into main Sep 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register a wp-codebox AGENTS.md section against the agents-api context registry

1 participant