Skip to content

Compose AGENTS.md with the resolved WordPress CLI transport #519

Description

@chubes4

Problem

On WordPress Studio installs, wp-coding-agents correctly detects the WordPress command transport as studio wp, but a successfully composed AGENTS.md prescribes bare commands such as:

wp --path=/Users/example/Studio/site intelligence search <query>
wp --path=/Users/example/Studio/site datamachine-code workspace list

Bare wp is not available in the non-interactive agent shell. studio wp intelligence search ... works.

This caused an OpenCode session to fail every prescribed Intelligence and Data Machine Code command before the operator corrected the transport.

Root cause

runtimes/opencode.sh::runtime_generate_instructions() has two paths:

  1. The static-template fallback computes wp_cli_display and substitutes studio wp for Studio.
  2. The normal path runs wp_cmd datamachine memory compose AGENTS.md and returns immediately on success.

The comment says composition handles WP-CLI prefix resolution automatically, but the resulting composed file contains environment-specific absolute --path values prefixed by bare wp. The transport detected by wp-coding-agents is not provided to or reflected by composed SectionRegistry content.

The same risk applies to other non-bare transports and to Codex/Claude Code composition paths.

Desired contract

Generated agent guidance must use the same resolved WordPress control transport that setup and runtime commands actually use.

The solution should preserve section ownership: Intelligence, Data Machine, and Data Machine Code own their command guidance, while wp-coding-agents owns runtime transport detection and composition orchestration. Transport values must remain structured runtime context rather than ad hoc global text replacement.

Acceptance criteria

  • A Studio fixture composes AGENTS.md whose executable WordPress commands use studio wp, with no bare wp --path=... instructions.
  • A colocated WP-CLI fixture continues to use its resolved wp command and path flags.
  • An external/portable runtime fixture uses its declared control wrapper without exposing credentials in guidance.
  • OpenCode, Codex, and Claude Code use the same transport-aware composition contract.
  • SectionRegistry contributors can express WordPress commands without hardcoding one host transport.
  • A test executes at least one generated Intelligence or Data Machine command through the composed transport, rather than asserting only static text shape.
  • Existing AGENTS.md files are regenerated or diagnosed when their rendered transport no longer matches the detected runtime transport.

Reproduction

  1. Install/upgrade wp-coding-agents on a WordPress Studio site.
  2. Compose the normal SectionRegistry-backed AGENTS.md.
  3. Start a non-interactive OpenCode shell.
  4. Run the prescribed wp --path=<studio-site> intelligence search test; observe command not found: wp.
  5. Run studio wp intelligence search test; observe that WP-CLI executes.

AI assistance

  • Model: OpenAI gpt-5.6-sol
  • Tool: OpenCode
  • Used for: Reproduced the command failure, verified the working Studio transport, inspected runtime generation and transport detection paths, searched existing trackers, and drafted this issue under Chris Huber's direction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions