/wagoe:wagoe-migratefrom wagoe
Creates, applies, verifies, and rolls back database migrations in a Wagoe project. Covers bb migrate create/up/status/rollback and the three-way schema sync.
Ships in wagoe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
bb migrate status # what is applied, what is pending
bb migrate create <name> # new up/down pair
bb migrate up # apply everything pending
bb migrate rollback # undo the last one
status is the step that mattersCreating a migration file proves nothing. Migratus only applies files it
discovers, and the discovery rule is the filename: <id>-<name>.up.sql and
.down.sql. A file that does not match is invisible — it will not error, it
will simply never run. A whole release shipped a sample module whose table did
not exist for exactly this reason (BOU-256).
So after creating a migration, always:
bb migrate status # the new one must appear as Pending
Only once it is pending is it real. Verified sequence:
create → Pending 1
up → Applied 1, Pending 0
rollback → Applied 0, Pending 1
:migration-dir is a name, not a path, and it resolves to exactly one
place. Migratus tries, in order: the system classloader, the context
classloader, resources/migrations (its default-migration-parent is
"resources/"), then migrations/. Only the last is the project directory —
so a resources/migrations directory, or a jar carrying migrations/, takes
the name instead.
When that happens, everything in migrations/ is skipped: not applied, not
listed as pending, not counted. This used to be silent — bb migrate up
exited 0, status showed no pending migrations, and the table simply did not
exist (BOU-274).
It is not silent any more. Every migration command now refuses:
$ bb migrate up
❌ Migration failed: These migrations are never read:
migrations/20260101000000-add-widgets.down.sql
migrations/20260101000000-add-widgets.up.sql
':migration-dir' is a name, not a path, and it resolved to
'resources/migrations' (which is empty) — so everything above is skipped: not
applied, and not reported as pending.
Keep migrations in one place. 'migrations/' is the conventional home; if you
keep 'resources/migrations', it must hold all of them.
Exit status is 1, and status refuses the same way rather than reporting a
false clean.
What this means in practice:
bb migrate create reports where it actually wrote, which is not always
migrations/. Read the path it prints; both the summary line and the
"Edit the generated SQL files in …" line now name the same real directory.migrations/
is the conventional home. A resources/migrations-only layout also works —
this framework repository uses one — but it has to hold all of them.The guard covers an empty capturing directory, migrations nested in
subdirectories, jars on the classpath, and EDN migrations as well as SQL. It
decides none of that itself: it asks migratus where the name resolves
(find-migration-dir) and what counts as a migration (parse-name).
After anything writes a migration — you, the scaffolder, or bb migrate create — run bb migrate status and confirm it appears.
The most common migration bug is doing one third of the job. A new field needs:
src/<project>/<module>/schema.cljshell/persistence.clj, both directionsMiss the schema and validation rejects the field. Miss the persistence
transform and it reads back nil with no error anywhere.
bb scaffold field does not do all three. Measured — it writes the
migration pair and nothing else:
$ bb scaffold field --module-name order --entity Order --name status --type string
:create: migrations/…-add-status-to-orders.up.sql
:create: migrations/…-add-status-to-orders.down.sql
:update: src/wagoe/order/schema.clj ← reported, but not written
$ git status --porcelain
?? migrations/…-add-status-to-orders.down.sql
?? migrations/…-add-status-to-orders.up.sql
The schema file is untouched despite the :update: line, and persistence.clj
is never mentioned. So after running it you still have to edit both by hand,
and the command's own output will tell you otherwise.
Check with git status after running it, then add the field to schema.clj
and to both directions of the persistence transform yourself.
Remember the case boundary: kebab-case in Clojure, snake_case only in SQL.
:created-at in the entity, created_at in the column.
The id is generated from the clock, so two branches that each add a migration
produce ids that interleave rather than conflict — until they share a database.
If several worktrees or branches point at the same DB, a migration applied from
one is recorded as applied for all of them, and the other branch's file with a
lower id will never run. Check bb migrate status after switching branches.
bb migrate rollback runs the .down.sql you wrote. If that file is empty or
wrong, you find out during an incident. Roll back and re-apply once, locally,
while it is cheap:
bb migrate up && bb migrate rollback && bb migrate up
bb migrate status first — know the starting point.bb migrate create <name>, then write both .up.sql and .down.sql.bb migrate status — confirm it appears as Pending. If it does not,
there are two causes, and both are silent:
<id>-<name>.up.sql / .down.sqlmigrations/ and
resources/migrations/; if each holds .sql files, only
resources/migrations/ is read and everything in the other is invisible.bb migrate up, then status again to confirm it applied.schema.clj and
both directions of the persistence transform. bb scaffold field writes
only the migration, whatever its output says. Then run the module's tests.Nothing here edits production. bb migrate acts on the database in the active
config — check with bb doctor which one that is before running up anywhere
that matters.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wagoebv/wagoe --plugin wagoe10 skills in this plugin
/wagoeWagoe framework (Clojure FC/IS) toolkit. Use when the user wants to add a module, entity, or feature ("add a product module with name and price"), add a field/endpoint/adapter to a module, wire a module into the app, explain a Clojure/Wagoe error or stacktrace, generate tests, write SQL from a description, configure the project, or diagnose setup issues. ALWAYS scaffold new modules with `bb scaffold` instead of hand-writing them./wagoe-debugDiagnose a failure in a Wagoe app — a 500, an exception, a stack trace, a nil where a value was expected, a field that reads back empty, or a test that fails for no obvious reason. Use when something in a Wagoe project is broken and the cause is not yet known. Works from the innermost layer outward, checks the framework's known pitfalls first, and can call bb ai explain on a stack trace./wagoe-deployPackage and deploy a Wagoe app — uberjar, Docker image, Kubernetes, systemd or a cloud manifest. Use when asked to build a release, containerise the app, deploy to an environment, or check a project is ready to ship. Covers the pre-deploy checks that actually catch things, the server/worker split, and the health endpoints to probe./wagoe-doctorDiagnose and fix a Wagoe project's configuration and development environment. Use when a Wagoe app will not start, when config.edn changes are not taking effect, before running dev commands on an unfamiliar machine, when JWT_SECRET or database settings look wrong, or when the user asks whether their setup is correct. Runs bb doctor and bb doctor:env, explains each failure, and applies the fix it names./wagoe-gen-testsGenerate a Kaocha test namespace for a Wagoe source file with `bb ai gen-tests`, put it in the right place, and run it. Use when asked to write tests for an existing namespace, to cover a function that has none, or to bootstrap a test file for freshly scaffolded code. Covers the test-type metadata Kaocha selects on, where the file belongs, and how to triage the failures a generated draft always has./wagoe-i18nExternalise user-visible strings in a Wagoe project into the translation catalogue and keep locales in parity. Use when adding UI text, when a string appears untranslated, when `bb i18n:scan` fails, or when asked to add or audit a language. Covers the `[:t :key]` marker convention, where markers may and may not appear, the en/nl catalogues, and what the scan does not see.Other plugins' skills for the same job