Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions inc/Runtime/AgentsMdSections.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public static function register(): void {
self::register_auto_generated_marker($wp);
self::register_datamachine_section($wp);
self::register_workspace_inventory_section($wp);
self::register_abilities_section();
self::register_wordpress_source_section();
self::register_multisite_section($wp);
}

Expand Down Expand Up @@ -175,48 +173,6 @@ private static function register_workspace_inventory_section( string $wp ): void
);
}

private static function register_abilities_section(): void {
self::register_section(
'AGENTS.md', 'abilities', 20, function () {
return <<<'MD'
## Abilities

WordPress Abilities are the universal tool surface. Plugins register abilities that are automatically available via REST API, MCP, and chat.

Data Machine Code does not currently register a WP-CLI abilities discovery command. Use the active runtime tool listings exposed to MCP/chat/REST, and plugin-specific `--help` output, before assuming what's available.
MD;
}, array(
'label' => 'Abilities',
'description' => 'WordPress Abilities API discovery.',
'owner' => 'data-machine-code',
'freshness' => 'static',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}

private static function register_wordpress_source_section(): void {
self::register_section(
'AGENTS.md', 'wordpress-source', 30, function () {
return <<<'MD'
## WordPress Source (Read-Only Reference)

These directories are **read-only reference material** — grep and read them to understand code, but never edit them directly. All code changes go through the workspace (see Code above).

- `wp-content/plugins/` — plugin source (read-only)
- `wp-content/themes/` — theme source (read-only)
- `wp-includes/` — WordPress core (read-only)
MD;
}, array(
'label' => 'WordPress Source',
'description' => 'Pointers to WordPress source directories.',
'owner' => 'data-machine-code',
'freshness' => 'static',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}

private static function register_multisite_section( string $wp ): void {
if ( ! is_multisite() ) {
return;
Expand Down
6 changes: 6 additions & 0 deletions tests/smoke-agents-md-sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ function assert_not_contains( string $needle, string $haystack, string $message
if ( ! isset($sections['datamachine-code']) ) {
throw new RuntimeException('datamachine-code section was not registered');
}
if ( ! isset($sections['workspace-inventory']) ) {
throw new RuntimeException('workspace-inventory section was not registered');
}
if ( isset($sections['abilities']) || isset($sections['wordpress-source']) ) {
throw new RuntimeException('generic WordPress guidance must be registered by wp-coding-agents');
}

$render = $sections['datamachine-code']['callback'];
$default = $render();
Expand Down