agentleFS
nuttarujnuttaruj/rolepod-wplab/skills/wp-connect/SKILL.md

wp-connect

Skill1 starsChanged 6 months agoMITView on GitHub

Open a WordPress Target on any kind (local / REST + App Password / SSH / Docker) using credentials already in the vault. Phase = Define.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    NEVER pick a connection kind without knowing what the user will DO — REST covers almost everything, but Local/SSH/Docker are needed for …

    line 16
  2. Very specific:

    NEVER store the chosen kind silently — surface "I'm opening this as a <kind> target because <reason>" so the user can correct mid-flow.

    line 17
  3. Very specific:

    ALWAYS close the previous target with rolepod_wp_disconnect before opening the same site under a different kind — registry collisions cause …

    line 18
  4. Very specific:

    No creds in vault AND user pasted a pair prompt → wp-pair-setup.

    line 29
  5. Very specific:

    Read references/connect-kinds.md if unsure.

    line 76
  6. Distinctive:

    Default to REST unless the user explicitly says otherwise — it works on every host.

    line 85
  7. Distinctive:

    Call the matching tool:

    line 89
  8. Distinctive:

    If user already said what to do → hand off immediately.

    line 101
  9. Distinctive:

    Read what the user has.

    line 111
  10. Very specific:

    Call the right connect_*.

    line 113
  11. Very specific:

    No durable artifact. The opened target lives in the in-memory TargetRegistry for this session.

    line 119
  12. Distinctive:

    No examples file. Kind selection is single-decision and the workflow is one tool call.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WP Connect

Re-open a previously paired site, or open a new connection over local/SSH/Docker. Picks the right connect_* tool by what the user has and what they need to do.

Iron Rule

<EXTREMELY-IMPORTANT> 1. NEVER pick a connection kind without knowing what the user will DO — REST covers almost everything, but Local/SSH/Docker are needed for direct filesystem work outside ABSPATH, and for wp-cli when the companion is not installed (a RestTarget without it raises COMPANION_REQUIRED_V0_2). 2. NEVER store the chosen kind silently — surface "I'm opening this as a `<kind>` target because <reason>" so the user can correct mid-flow. 3. ALWAYS close the previous target with `rolepod_wp_disconnect` before opening the same site under a different kind — registry collisions cause confusing tool failures later. </EXTREMELY-IMPORTANT>

When to use

  • "เชื่อม walnutztudio.com" + creds are already in vault (skip pair).
  • User wants to work against a local WordPress at /path/to/wp/.
  • User has SSH access to the server and wants direct shell.
  • User runs WP-in-Docker locally.

Skip when:

  • No creds in vault AND user pasted a pair prompt → wp-pair-setup.
  • User already has an active target_id → no need to reconnect.

Session bootstrap (run once, right after connecting)

The connect tools return prod_guard. Read it before any write: armed: false does not mean the target is safe, it means nobody told the server otherwise.

Then, in order:

  1. rolepod_wp_memory_recall(target_id) — notes from earlier sessions on this site. Skip nothing here; this is where "the client hates the blue" lives.
  2. rolepod_wp_conventions_get(target_id) — the project's own rules (naming, builder, deploy). Follow them over your defaults.
  3. rolepod_wp_skill_catalog(target_id) — which workflow guides exist, including any the user wrote. rolepod_wp_skill_get reads one.

Record what you learn with rolepod_wp_memory_note(target_id, ...) before the session ends, or the next session starts blind.

Boundary

Owns:

  • Picking the kind (local / rest / ssh / docker).
  • Calling the right rolepod_wp_connect_<kind> tool.
  • Surfacing the resulting target_id + companion status.

Does not own:

  • Pairing (first-time companion redeem) → wp-pair-setup.
  • Post-connect health probe — that is wp-health-check.
  • Any actual WP operation — pick the right next skill.

Return / hand off:

  • REST + no creds → wp-pair-setup (plugin-first walkthrough). Manual App Password entry is the last resort inside that flow, never the opening offer.
  • Connection opens but companion missing → wp-health-check for full report.

Inputs to gather

  • siteurl (REST) OR filesystem path (Local) OR host:user (SSH) OR container_name (Docker).
  • For SSH: SSH key path / port if non-default.
  • For Docker: container name / wp-cli command path inside container.
  • (optional) require_companion: true if the user explicitly needs power tools.

Workflow

1. Pick the kind

Read references/connect-kinds.md if unsure. Quick rule:

User hasPick
siteurl + App Password (any host, including shared)rest
filesystem path to wp-config.phplocal
SSH access to serverssh
WP in Docker on this machinedocker

Default to REST unless the user explicitly says otherwise — it works on every host.

2. Open

Call the matching tool:

  • rolepod_wp_connect_rest { url, [credential_ref], [require_companion] }
  • rolepod_wp_connect_local { path }
  • rolepod_wp_connect_ssh { host, user, [keyPath], [port] }
  • rolepod_wp_connect_docker { containerName, [wpCliPath] }

3. Surface state

Tell user: kind + target_id + wp_version + companion presence + any warnings.

4. Hand off

If user already said what to do → hand off immediately. Otherwise ask.

If a matching Rolepod agent is available

  • rolepod:rolepod-builder for SSH key / Docker config issues.
  • rolepod:rolepod-builder for follow-up REST work.

If no matching agent is available

Execute as Lead:

  1. Read what the user has.
  2. Pick a kind (REST is default).
  3. Call the right connect_*.
  4. Surface target_id + warnings.
  5. Hand off.

Output

No durable artifact. The opened target lives in the in-memory TargetRegistry for this session.

Examples

No examples file. Kind selection is single-decision and the workflow is one tool call.

References

Load when the user's situation does not match the quick rule:

  • references/connect-kinds.md — which kind for which scenario; trade-offs around companion availability, security guarantees, and performance.

Hard stops

  • CREDENTIALS_MISSING on REST → STOP. Hand off to wp-pair-setup — it walks the user through installing the plugin and pairing. Suggest manual rolepod-wplab credentials add <site> only as the last resort (plugin uninstallable, or the user declined it).
  • REST_AUTH_FAILED on a previously-working site → STOP. The App Password was revoked from profile.php. Hand off to wp-pair-setup.
  • require_companion=true but companion: null → STOP. Tell user to install the WP plugin via wp plugin install https://github.com/nuttaruj/rolepod-wp/releases/latest/download/rolepod-wp.zip --activate.
  • HTTP, not HTTPS → STOP. RestTarget refuses non-https URLs unconditionally.

Full Rolepod enhancement

Full Rolepod adds an auto-reconnect path that detects an expired session token mid-flow and silently re-handshakes; standalone, the user sees a single retryable error.

Next phase

  • wp-health-check for a fuller report after open.
  • The skill matching the user's original ask (wp-content, wp-edit-*, wp-scaffold, wp-diagnose, wp-execute-php).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.