com um clique
clj-init
// Scaffold a new Clojure project with composable modules. Creates hello-world examples only - no assumptions, no custom code.
// Scaffold a new Clojure project with composable modules. Creates hello-world examples only - no assumptions, no custom code.
REPL-driven autonomous development loops for Clojure. Spawns fresh Claude instances per iteration with REPL validation for 10x faster feedback.
Start or connect to a Clojure/ClojureScript/Babashka nREPL. Detects project type and starts appropriate REPL in background. Use when user wants to evaluate code, start REPL, or needs nREPL connection.
Experimental: Run Lisa Loop checkpoints via Claude Code Agent Teams. You become team lead, coordinating parallel teammates with REPL-validated gates.
Check and update forj template dependency versions. Use when maintaining forj or when user asks about template versions.
| name | clj-init |
| description | Scaffold a new Clojure project with composable modules. Creates hello-world examples only - no assumptions, no custom code. |
Create minimal project structure to get started. This is scaffolding, NOT code generation.
CRITICAL: This tool creates the bare minimum to start coding:
(comment ...) blocksDO NOT:
The user will build their app with forj and REPLs after scaffolding.
Skip questions with flags:
/clj-init my-app --api --db postgres --web
/clj-init my-app --mobile
/clj-init my-app --api --mobile
/clj-init my-app --script
/clj-init my-app --flutter
/clj-init my-app --htmx simpleui --db postgres
/clj-init my-app --htmx biff
Flags:
| Flag | Module | Description |
|---|---|---|
--api | api | Clojure server with Ring/Reitit |
--db postgres | db-postgres | PostgreSQL with next.jdbc |
--db sqlite | db-sqlite | SQLite with next.jdbc |
--htmx simpleui | htmx-simpleui | HTMX with SimpleUI (lightweight) |
--htmx biff | (external) | HTMX with Biff (uses Biff generator) |
--web | web | ClojureScript web (Reagent/Re-frame) |
--mobile | mobile | Expo + ClojureScript |
--script | script | Babashka script only |
--flutter | flutter | ClojureDart Flutter (mobile/desktop/web) |
Examples:
/clj-init api-server --api --db postgres → REST API + PostgreSQL/clj-init my-site --web → Web frontend only/clj-init my-tool --script → Babashka script/clj-init my-app --flutter → ClojureDart Flutter app/clj-init my-app --htmx simpleui → HTMX web app with SimpleUI/clj-init my-app --htmx biff → Triggers Biff flow (external generator)/clj-init
/clj-init my-app
If no flags provided, ask questions to determine modules.
If not provided, ask in plain text:
"What would you like to name the project?"
CRITICAL: Do NOT use AskUserQuestion tool for the project name. Just output the question as text. The name is free-form text, not multiple choice.
Question: "Do you need a backend/API?" Options:
If Yes, ask:
Question: "What kind of interface?" Options:
If HTMX selected, ask:
Question: "Which HTMX framework?" Options:
If Biff selected: See Biff Flow below - uses external generator.
If API only, SimpleUI, or Separate frontend, ask:
Question: "Database?" Options:
Only ask if "Separate frontend" was selected OR if user said No to backend.
Question: "Do you need a frontend?" Options:
If ClojureScript selected, ask:
Question: "Which platforms?" Options:
Note: Flutter uses ClojureDart (a different Clojure dialect). It cannot be combined with ClojureScript frontends, but works fine with a Clojure backend.
If user selected No backend AND No frontend → Script project (Babashka only)
Biff is an opinionated full-stack framework with its own project generator. We don't scaffold it directly.
When user selects Biff:
Output this message:
"Biff has its own project generator. Please run this command in another terminal:
clj -M -e '(load-string (slurp "https://biffweb.com/new.clj"))'Follow the prompts to create your project. Let me know when you're done and what you named the project."
Wait for user to confirm completion and provide project name.
Once they confirm (e.g., "done, called it myapp"):
validate_project with path ./myapp and fix=truecd myapp && claude /clj-replIMPORTANT: Do NOT try to run Biff's generator programmatically. Let the user interact with it directly.
Based on answers, determine modules for scaffold_project:
| Configuration | Modules |
|---|---|
| Script only | ["script"] |
| API only | ["api"] |
| API + PostgreSQL | ["api", "db-postgres"] |
| API + SQLite | ["api", "db-sqlite"] |
| HTMX (Biff) | Use Biff flow (not scaffold_project) |
| HTMX (SimpleUI) | ["api", "htmx-simpleui"] |
| HTMX (SimpleUI) + PostgreSQL | ["api", "htmx-simpleui", "db-postgres"] |
| HTMX (SimpleUI) + SQLite | ["api", "htmx-simpleui", "db-sqlite"] |
| Web only | ["web"] |
| Mobile (Expo) only | ["mobile"] |
| Web + Mobile (Expo) | ["web", "mobile"] |
| Flutter only | ["flutter"] |
| API + Web | ["api", "web"] |
| API + Mobile (Expo) | ["api", "mobile"] |
| API + Web + Mobile (Expo) | ["api", "web", "mobile"] |
| API + Flutter | ["api", "flutter"] |
| API + PostgreSQL + Web | ["api", "db-postgres", "web"] |
| API + PostgreSQL + Flutter | ["api", "db-postgres", "flutter"] |
CRITICAL: Use the scaffold_project MCP tool. Do NOT manually write files.
Once you have the project name and modules list:
scaffold_project with:
project_name: "my-app"
modules: ["api", "web"]
output_path: "." (optional, defaults to current directory)
The tool handles everything:
After scaffold_project succeeds, run validation:
validate_project with path="./my-app" fix=true
This tool handles:
:override-builtin true if missingDO NOT tell the user the project is ready until validate_project returns success: true.
Question: "Would you like to enable forj tool permissions for this project?" Options:
If Yes, create .claude/settings.local.json in the project:
mkdir -p ./my-app/.claude
Then write this file:
{
"permissions": {
"allow": [
"Bash(bb:*)",
"Bash(mkdir:*)",
"Bash(pgrep:*)",
"Bash(pkill:*)",
"Bash(lsof:*)",
"mcp__forj__repl_eval",
"mcp__forj__discover_repls",
"mcp__forj__reload_namespace",
"mcp__forj__doc_symbol",
"mcp__forj__eval_at",
"mcp__forj__eval_comment_block",
"mcp__forj__run_tests",
"mcp__forj__analyze_project",
"mcp__forj__validate_changed_files",
"mcp__forj__track_process",
"mcp__forj__stop_project",
"mcp__forj__list_tracked_processes",
"mcp__forj__view_repl_logs"
]
}
}
Tell the user:
./my-appFor Clojure/ClojureScript projects:
cd my-app && claude /clj-repl
For Flutter projects:
cd my-app
bb flutter # Run app with hot reload + REPL
ClojureDart is initialized automatically during scaffolding. REPL starts automatically - watch for 🤫 ClojureDart REPL listening on port XXXXX in output, then connect with nc localhost XXXXX.
If project has BOTH backend AND Flutter:
cd my-app && claude /clj-repl # For the Clojure backend
# In another terminal:
bb flutter # For Flutter frontend
IMPORTANT: Do NOT offer to start the REPL from the current session. The user should exit and restart Claude Code in the new project directory so that:
STOP HERE. Do not start building or generating code. The scaffolding is complete.
| Module | Description | Provides |
|---|---|---|
| base | Common files | .gitignore, README.md |
| script | Babashka script | bb.edn, hello-world src |
| api | Ring/Reitit server | deps.edn, bb.edn, core.clj, routes.clj |
| htmx-simpleui | HTMX with SimpleUI | simpleui dep, htmx, hiccup views |
| db-postgres | PostgreSQL support | next.jdbc, honeysql, pg driver |
| db-sqlite | SQLite support | next.jdbc, honeysql, sqlite driver |
| web | ClojureScript web | shadow-cljs.edn, package.json, reagent, re-frame |
| mobile | Expo mobile | shadow-cljs.edn, package.json, app.json, expo config |
| flutter | ClojureDart Flutter | deps.edn (git dep), bb.edn, main.cljd |
Modules automatically include their dependencies (e.g., api includes base, htmx-simpleui includes api).
Notes:
flutter module uses ClojureDart (a different Clojure dialect). It can be combined with backend modules (api, db-*) but NOT with ClojureScript frontend modules (web, mobile).htmx-simpleui module is for server-rendered HTML apps. It cannot be combined with web or mobile modules (no ClojureScript needed).Only if user asks, add basic deployment configs:
Do NOT add complex infrastructure. Keep it simple.