Repository navigation
✨ feat(bones): deploy leaves the agent instruction files out - #140
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The default skip list names
README.mdand theDockerfilebut no coding-agent instructions, and a web server hands out a plugin's files as they are. A plugin'sCLAUDE.md, with whatever it says about the code (architecture, known weaknesses, release steps), can be read underwp-content/plugins/<plugin>/CLAUDE.mdon every site that installs it. Adeploy.phpfilter does not help when the package is built without WordPress, in a Docker build or a CI job:deploy.phponly runs when WordPress is loaded.What
AGENTS.md,AGENTS.override.md,AGENT.md,CLAUDE.md,CLAUDE.local.mdandGEMINI.mdwherever they are,vendor/included, and aCLAUDE.mdlink toAGENTS.mdtoo. They go through the default skip list, sowpbones_console_deploy_default_skip_files_folderscan still put one back..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 3ReflectionProperty::setAccessible()deprecationsmasteralready has on 8.5.DeployTestSuitesTestis unchanged and green on the shared walker.AGENTS.mdandCLAUDE.mdat its root, deployed outside WordPress (--no-build),bones3.2.0 vs this branch: 223 vs 221 entries, onlyAGENTS.mdandCLAUDE.mdgone, every other file byte-identical (diff -rq).