ai
Framework-aware AI tooling for Boundary applications. Unlike a generic assistant, it knows Boundary’s conventions: FC/IS, ports, kebab↔snake naming, Malli schemas, and HoneySQL syntax.
Features
-
NL Scaffolding - parse a natural language description into a scaffolding spec
-
Error Explainer - explain a stack trace with Boundary-specific context
-
Test Generator - generate a complete test namespace for a source file
-
SQL Copilot - translate a description into HoneySQL format
-
Documentation Wizard - generate AGENTS.md, OpenAPI YAML, or README
CLI commands
# NL scaffolding (interactive confirm)
bb scaffold ai "product module with name, price, stock"
# NL scaffolding (non-interactive)
bb scaffold ai "product module with name, price, stock" --yes
# Explain a stack trace
bb ai explain --file stacktrace.txt
# Generate test namespace
bb ai gen-tests libs/user/src/boundary/user/core/validation.clj
# Generate HoneySQL from description
bb ai sql "find active users with orders in the last 7 days"
# Generate documentation
bb ai docs --module libs/user --type agents
bb ai docs --module libs/user --type openapi
bb ai docs --module libs/user --type readme
Provider strategy
Offline-first by default: uses Ollama (no data leaves the machine). Falls back to cloud providers if configured:
;; Offline-first (Ollama, no API key)
:boundary/ai-service
{:provider :ollama
:model "qwen2.5-coder:7b"
:base-url "http://localhost:11434"}
;; Anthropic
:boundary/ai-service
{:provider :anthropic
:model "claude-haiku-4-5-20251001"
:api-key #env ANTHROPIC_API_KEY}
;; Ollama primary + Anthropic fallback
:boundary/ai-service
{:provider :ollama
:model "qwen2.5-coder:7b"
:base-url "http://localhost:11434"
:fallback {:provider :anthropic
:api-key #env ANTHROPIC_API_KEY}}
CLI provider resolution order: ANTHROPIC_API_KEY → OPENAI_API_KEY → OLLAMA_URL.
Key namespaces
| Namespace | Layer | Responsibility |
|---|---|---|
|
shared |
|
|
core |
Pure prompt builders for all 5 features |
|
core |
Pure context extractors (module names, stack traces, function signatures) |
|
core |
Pure response parsers (JSON, module spec, SQL, test code) |
|
shell |
Ollama HTTP adapter |
|
shell |
Anthropic API adapter |
|
shell |
OpenAI API adapter |
|
shell |
Test stub |
|
shell |
Public API: |
|
shell |
REPL helpers: |
REPL usage
(require '[boundary.ai.shell.repl :as ai])
;; Bind a service
(ai/set-service! (create-service-from-config))
;; Use helpers
(ai/explain "ClassNotFoundException: boundary.user.core.user")
(ai/sql "find all users who logged in today")
(ai/gen-tests "libs/user/src/boundary/user/core/validation.clj")
Testing
clojure -M:test:db/h2 :ai