Skip to content

✨ feat(bones): deploy leaves the agent instruction files out - #140

Merged
gfazioli merged 3 commits into
masterfrom
feat/deploy-skip-agent-files
Nov 16, 2026
Merged

gfazioli merged 3 commits into
masterfrom
feat/deploy-skip-agent-files

Conversation

@gfazioli

Copy link
Copy Markdown
Collaborator

Why

The default skip list names README.md and the Dockerfile but no coding-agent instructions, and a web server hands out a plugin's files as they are. A plugin's CLAUDE.md, with whatever it says about the code (architecture, known weaknesses, release steps), can be read under wp-content/plugins/<plugin>/CLAUDE.md on every site that installs it. A deploy.php filter does not help when the package is built without WordPress, in a Docker build or a CI job: deploy.php only runs when WordPress is loaded.

What

  • The deploy leaves out AGENTS.md, AGENTS.override.md, AGENT.md, CLAUDE.md, CLAUDE.local.md and GEMINI.md wherever they are, vendor/ included, and a CLAUDE.md link to AGENTS.md too. They go through the default skip list, so wpbones_console_deploy_default_skip_files_folders can still put one back.
  • Their folders (.claude/, .codex/, .cursor/, .github/) never shipped: the deploy copies no dot entry. The test pins that too.
  • javascriptTestsToSkip() and the new scan share one walker, pathsToSkip(), so the dot-entry rule and the link and readability guards live once.

Verification

  • composer test: 368 tests green on PHP 8.5 locally, apart from the 3 ReflectionProperty::setAccessible() deprecations master already has on 8.5. DeployTestSuitesTest is unchanged and green on the shared walker.
  • Mutation: without the new skip-list entry both agent tests fail; with the walker's recursion removed, the agent tests and the JS-test suite fail too.
  • A real plugin with AGENTS.md and CLAUDE.md at its root, deployed outside WordPress (--no-build), bones 3.2.0 vs this branch: 223 vs 221 entries, only AGENTS.md and CLAUDE.md gone, every other file byte-identical (diff -rq).

The default skip list named README.md and the Dockerfile but no coding-agent
instructions, and a web server hands out a plugin's files as they are: a
plugin's CLAUDE.md, with whatever it says about the code (architecture, known
weaknesses, release steps), could be read under wp-content/plugins/ on every
site that installed it. A deploy.php does not help when the package is built
without WordPress, in a Docker build or a CI job, because it only runs when
WordPress is loaded.

The deploy now leaves out AGENTS.md, AGENTS.override.md, AGENT.md, CLAUDE.md,
CLAUDE.local.md and GEMINI.md wherever they are, vendor/ included, a CLAUDE.md
link to AGENTS.md too. Their folders (.claude/, .codex/, .cursor/, .github/)
never shipped: the deploy copies no dot entry.
javascriptTestsToSkip() and agentInstructionsToSkip() were the same scandir
walk with a different match: pathsToSkip() now holds the walk, the dot-entry
rule and the link and readability guards once, and each caller passes its
match and the folders it does not walk.

The agent-instructions test checks the exact package, in a plain and a --wp
deploy, instead of one assertion per file: a leaked file, the CLAUDE.md link
or a dot folder shows up in the listing.
The scan skipped every folder named node_modules, but the deploy leaves out
only the root one: with --wp, a node_modules under resources/assets ships, and
a CLAUDE.md in one of its packages shipped with it (independent review of #140).
pathsToSkip() now takes a path from the plugin root in $prune as well as a
name, and the agent scan prunes /node_modules only.
@gfazioli
gfazioli merged commit c2aa561 into master Nov 16, 2026
4 checks passed
@gfazioli
gfazioli deleted the feat/deploy-skip-agent-files branch November 16, 2026 13:23
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.

1 participant