Rebuild plugins before deploy
Skill LaWebcapsule/d9-skills/skills/rebuild-plugins-before-deploy
Always rebuild Directus plugins before deployment to avoid silent extension failures in production.From its SKILL.md
npx -y skills add LaWebcapsule/d9-skills --skill rebuild-plugins-before-deployAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.1 KB, 390 tokens by cl100k_base, as published. Nobody here has run it
Skill: Rebuild Plugins Before Deploy
Purpose
Directus plugins must be rebuilt from source (plugins/) before every deployment. If you deploy without rebuilding, the extensions directory will contain stale or missing builds, and the server will start normally but custom endpoints, hooks, and interfaces will silently not work. There is no error message — the server looks healthy but custom functionality is missing.
Triggers
- A deploy command is about to be executed (
npm run deploy,directus deploy, Docker build) - Files in
plugins/have been modified since last build - The
extensions/directory exists in the project
Actions
- Before any deployment, check if files in
plugins/have changed since the last build - If yes, run
npm run build(orpnpm build) in each plugin directory underplugins/ - Verify the build output exists in each plugin's
dist/folder - Copy build output to
extensions/(or verify the build outputs directly there) - Continue with the deployment
Errors Prevented
- "Extensions not found" — silent failure in production The server starts successfully, returns 200 on healthcheck, logs show normal startup. But custom API endpoints return 404, custom hooks don't fire, custom interfaces don't render. There is NO error in the logs. Diagnosed after 2h of debugging on 3 independent sessions. The root cause each time: plugins were modified but not rebuilt before deploy.
Restrictions
- Do not skip the rebuild even if "nothing changed" — dependency updates in the monorepo can affect plugin builds
- Do not assume
extensions/is auto-generated — it must be explicitly populated from plugin builds - Check build output exists before deploying — a failed build is better caught here than in production
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.