/wagoe:wagoe-gen-testsfrom wagoe
Generates Kaocha test namespaces for Wagoe source files using `bb ai gen-tests`, places them in conventional paths, stamps correct test-type metadata, and guides triage of expected assertion failures.
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 ai gen-tests <source-file> # print to stdout
bb ai gen-tests <source-file> --write # write to the conventional test path
bb ai gen-tests <source-file> -o <file> # write to a named file
It needs an AI provider. Check first — the command is otherwise a slow way to discover that:
bb doctor:env # names the provider it would use, or says none is set
Measured on this repository's own libs/ai/src/wagoe/ai/core/context.clj: the
generated namespace loaded, ran, and reported
Ran 10 tests containing 84 assertions.
{:test 10, :pass 74, :fail 10, :error 0}
Ten failing assertions out of eighty-four is the normal result for a subtle namespace, not a malfunction. The model infers what each function should return from its name and shape; some of those guesses are wrong. A short module of obvious pure functions fared much better in the same measurement — 10 of 10 — so expect the failure rate to track how much of the behaviour a reader could guess from the source.
Every failure is either a wrong assertion or a real bug, and only you can say which. Read the function, then fix whichever is wrong — never delete the test to get green.
Treat the run as a review queue. This is why the skill runs the tests rather than stopping at "file written".
Both are derived from the source path, in Clojure, not asked of the model:
| Source path contains | Kaocha metadata |
|---|---|
/core/ | ^:unit |
/adapters/ | ^:contract |
anything else (/shell/, …) | ^:integration |
libs/user/src/wagoe/user/core/validation.clj
-> libs/user/test/wagoe/user/core/validation_test.clj ^:unit
--write puts it there. A source file with no src/ path segment has no
convention to apply — --write refuses and asks for -o rather than guessing
a location Kaocha will not look in.
The metadata matters more than it looks: Kaocha selects suites on it. A
deftest without it is in the file and in no test run. bb ai gen-tests
stamps it now; before it merely asked the model, which supplied it on 0 of 15
measured deftests.
Three failures were reproducible enough to be fixed in bb ai gen-tests
itself, so you do not need to check for them:
Missing metadata — stamped from the path, as above.
A namespace used but not required. str/join in the body with no
[clojure.string :as str] fails at load with No such namespace: str;
clojure.set/subset? with no require fails with
ClassNotFoundException: clojure.set. Both are repaired for the standard
clojure.* aliases (str set walk edn io pprint). An alias outside that set
is left to fail, because the namespace behind it cannot be inferred.
An answer cut off mid-form. A long source file can exhaust the model's output budget; the reply then ends inside a form and the file cannot be read. That is now reported as an error instead of written to disk:
Error: The model's answer was cut off mid-form — 598 lines, delimiters
still open. Generate for a smaller source file, or raise :max-tokens.
If you hit it, generate for a smaller namespace. Splitting a 250-line source file into two calls is more reliable than raising the budget.
It does not check that the tests pass, that the assertions are right, or that coverage is meaningful. That is the step below.
bb doctor:env — confirm a provider. Without one, stop; there is no
offline fallback for this command.bb ai gen-tests <source-file> --write. If the destination already exists
it refuses rather than overwriting — with -o as well as --write. Write
elsewhere and merge by hand, or pass --force only when you mean to replace
an earlier draft.clojure -M:test --focus <the.test.namespace>
In this repository, add the library suite: clojure -M:test :ai --focus ….bb check:placeholder-tests. Generated drafts have not produced (is true)
placeholders in practice, but the gate is cheap and it is a hard CI failure.bb check before committing.The generated namespace tests the public functions it can see in one file. It
does not know about the database, the Integrant system, or the ports a shell
namespace depends on, so ^:integration output for a shell/ file is usually
the weakest of the three — expect to supply the stubs yourself. For a service
that needs a repository, reify the port; the existing tests under
libs/*/test/**/shell/ show the pattern.
Nor does it replace scaffolding: bb scaffold already generates a test
skeleton for a new module. Use this for code that exists and has none.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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-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./wagoe-migrateCreate, apply, verify and roll back database migrations in a Wagoe project. Use when adding or changing a database column or table, when a migration seems not to have run, when `bb migrate status` disagrees with the schema, or when adding a field to an entity — which needs a migration plus two other changes to stay consistent. Covers bb migrate create/up/status/rollback and the three-way schema sync.Other plugins' skills for the same job