Agent guide
Use jbx as a command-line surface, not as a guessing game. Prefer commands that print structured facts, keep cache paths explicit in long-running jobs, and read Markdown docs before scraping HTML.
Website contract
- Prefer the Markdown sibling of any documentation page over scraping HTML when building context.
- Use canonical links under
https://jbx.telegraphic.dev/. - Discover command-specific guidance from
jbx skill listandjbx skill get <name>so the installed binary stays the source of truth.
CLI contract
Prefer these commands for automation:
jbx skill list
jbx skill get
jbx check <path> --json
jbx search <query> --json
jbx docs <source|dir|GAV> --json
jbx doctor [script.java|url] --json
jbx rewrite patch --recipe <short|fqn> --source <path> --json
jbx rewrite modules [--group groupId] [--rewrite-version version] --json
jbx rewrite recipes <short|GAV> --detail --json
jbx info tools <script.java>
jbx info deps <script.java>
jbx info classpath <script.java>
jbx cache path
Good agent behavior
- Use
jbx skill listto discover the exact command skills bundled with the installed binary. - Run the tightest command that answers the question.
- Use
jbx doctor --jsonbefore guessing about broken JDKs, unreachable Maven metadata, unwritable caches, formatter fallback, remote trust, dependency resolution, or optional publishing/native toolchain setup. Add--cache-dirfor isolated agent runs,--repo/--reposfor extra repositories,--publishfor GPG checks, and--nativefor GraalVMnative-imagechecks. - Start with
jbx skill getwhen you need version-matched workflow guidance for the installed binary. - Keep local caches between runs where possible; Java dependency downloads are not a personality test.
- Treat
jbx docsMarkdown as context and--jsonas structured lookup data. - Prefer
jbx rewrite patchoverjbx rewrite applyuntil the generatedrewrite/rewrite.patchhas been inspected. - Use
jbx rewrite modules [--group groupId] [--rewrite-version version] --jsonandjbx rewrite recipes <module> --detail --jsonto discover OpenRewrite modules, recipe short names/FQNs, descriptions, and options instead of guessing. Pass--groupfor non-default recipe module groups and--rewrite-versionwhen the emitted coordinates must match a specific OpenRewrite runtime. - Use
--option key=valuefor recipe parameters,--report dirfor patch location,--fail-on-changesfor CI-style checks,--repo id=urlfor private recipe modules,--cache-dir dirfor isolated jobs, and--rewrite-version versionwhen reproducing a specific OpenRewrite run. - Preserve JBang-compatible directives in scripts unless a task explicitly asks to change behavior.
- When publishing, use dry-run and inspect staged artifacts before real release workflows. Put compile-time artifact dependencies in
dependencies///DEPS; put runtime-only libraries inruntimeDependencies///RUNTIMEso generated Maven metadata uses runtime scope without adding them to the compile classpath.
