Agent-friendly guardrails and skills for Phoenix/Elixir projects.
This repo packages:
plugin/- theelixir-phoenix-guardrailsOpenCode plugin (deny+warnrules)skills/- reusable project skills (elixir,ecto,phoenix-live-view,phoenix-uploads,testing)lib/agent_friendly/guardrails/- installable neutral guardrails packagemix_tasks/agentfriendly/- installable neutral Mix tasksmanifest/install_map.txt- source-of-truth mapping for installed pathsbin/agent-friendly-installer- bootstrap wrapper that ensuresmix agentfriendly.pullexists and then delegates to itmigration/migrate_agentfriendly_install.sh- copy-run-delete migration tool for existing installs
Clone this repo, then run the installer script targeting your Phoenix app:
./bin/agent-friendly-installer install --target /path/to/your_phoenix_appThis installs or updates the managed paths from manifest/install_map.txt, including:
.opencode/plugins/elixir-phoenix-guardrails/.opencode/plugins/elixir-phoenix-guardrails.js.agents/skills/<skill>/for all bundled skillslib/agent_friendly/guardrails/lib/mix/tasks/agentfriendly/.agentfriendly/phoenix-agentfriendly.lock.json
From this repo:
./bin/agent-friendly-installer update --target /path/to/your_phoenix_app
./bin/agent-friendly-installer check --target /path/to/your_phoenix_appIf managed files were edited locally in the target repo, update will fail unless forced:
./bin/agent-friendly-installer update --target /path/to/your_phoenix_app --forceYou can also set AGENT_FRIENDLY_TARGET instead of passing --target.
The installed tasks give projects a neutral update and verification surface:
mix agentfriendly.pull
mix agentfriendly.pull --check
mix agentfriendly.pull --force
mix agentfriendly.guardrails.checkProjects can wire the check task into precommit, for example:
precommit: [
"compile --warnings-as-errors",
"deps.unlock --unused",
"format",
"agentfriendly.guardrails.check",
"test"
]Fresh installs and updates will add "agentfriendly.guardrails.check" to an existing precommit alias in mix.exs if it is not already present. The edit is idempotent. If a project has no precommit alias, the installer leaves mix.exs alone and prints a manual follow-up message.
Source repos that maintain these managed paths can publish with:
mix agentfriendly.publish --dry-run
mix agentfriendly.publishIf mix agentfriendly.pull is missing, bin/agent-friendly-installer bootstraps it via a temporary task and removes the temp file after bootstrap.
Optional env vars:
AGENT_FRIENDLY_REPO(defaulthttps://github.com/mackross/phoenix-agentfriendly.git)AGENT_FRIENDLY_REF(defaultmain)AGENT_FRIENDLY_DST(default/tmp/phoenix-agentfriendly)AGENT_FRIENDLY_REMOTE(used bymix agentfriendly.publish)
Already-installed repos should migrate in place once:
cp /path/to/phoenix-agentfriendly/migration/migrate_agentfriendly_install.sh .
bash migrate_agentfriendly_install.sh
rm migrate_agentfriendly_install.shThe migration script:
- moves the installed files from the old
opencodepaths to the neutralagentfriendlypaths - rewrites task names, module names, installer names, env vars, and lock paths
- updates
mix.exs,README.md, andAGENTS.mdif those files exist
Use one publishing path:
- Author changes in your source repo.
- Publish to this repo with
mix agentfriendly.publish. - Review and push from
phoenix-agentfriendly.
Example:
# In your source repo
mix agentfriendly.publish
# In phoenix-agentfriendly
npm --prefix plugin test
bash test/smoke.sh
bash test/opencode_integration.sh
git add -A
git commit -m "describe change"
git push origin mainnpm --prefix plugin test
bash test/smoke.sh
bash test/opencode_integration.shThis project is inspired by and adapted from: