prompts/skills/clojure-polylith/SKILL.md
Polylith component architecture for Clojure. Load when working in a Polylith workspace (workspace.edn present), creating or modifying components, bases, or interfaces, or when asked about Polylith structure and conventions.
npx skillsauth add ramblurr/nix-devenv clojure-polylithInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Polylith is a monorepo architecture for Clojure. Components, bases, and projects live in one repository. Components communicate only through declared interface namespaces.
workspace/
├── workspace.edn ← top-namespace and brick registry
├── deps.edn ← root deps, aliases for each project
├── components/
│ └── <name>/
│ ├── deps.edn
│ ├── src/
│ │ └── <top-ns>/<name>/
│ │ ├── interface.cljc ← public surface (required)
│ │ └── core.cljc ← implementation (private)
│ └── test/
│ └── <top-ns>/<name>/
│ └── interface_test.cljc
├── bases/
│ └── <name>/
│ ├── deps.edn
│ └── src/
│ └── <top-ns>/<name>/
│ └── core.cljc
└── projects/
└── <name>/
└── deps.edn ← lists which components + bases to include
A typical workspace.edn:
{:top-namespace "com.example"
:interface-ns "interface"
:default-profile-name "default"
:compact-views #{}
:vcs {:name "git"
:auto-add false}
:tag-patterns {:stable "stable-*"
:release "v[0-9]*"}}
The top namespace drives all brick namespace paths.
Component — an isolated unit of business logic with a single responsibility.
interface namespace (the public surface)Base — a thin entry point that wires components together for deployment.
interface namespace (nothing consumes it)Project — a deployable artifact configuration.
deps.ednEvery component must have exactly one interface namespace:
<top-namespace>.<component-name>.interface
Example: if workspace.edn sets :top-namespace com.example, then the auth component
exposes com.example.auth.interface.
The interface namespace re-exports only what consumers should see:
(ns com.example.auth.interface
(:require [com.example.auth.core :as core]))
(defn authenticate [credentials]
(core/authenticate credentials))
deps.edn files list only external libraries, not other workspace bricksdeps.edn files list which components and bases are included together:dev alias acts like a project and may list brick local/root deps for REPL workclojure -M:poly check enforces all these rulesbb test ... for targeted verificationbb qa for full verification when the repo provides itclojure -M:dev:test invocation in Polylith workspacesMultiple components can implement the same interface path. Projects pick which implementation to include — consumer code never changes:
postgres-db and sqlite-db both implement the db interface<top-ns>.db.interface — they never changeconventions.md when naming functions, namespaces, or reviewing naming choicescommands.md when running poly CLI commands or creating/validating brickspatterns.md when creating new components, writing interfaces, or setting up teststesting
Use this OCP when executing or preparing to execute commands that change a live or important system, service reloads/restarts, package changes, deployments, migrations, firewall/network/access changes, credential rotation, NixOS switch/test/boot/deploy, or incident mitigation. It guides safe operations with a persisted ledger for scope, preflight, baseline, rollback, validation, and evidence.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
documentation
Naming conventions for workflow documents in prompts/. Use when creating plans, PRDs, research reports, idea capture or other workflow documents. Triggers on (1) creating new planning documents, (2) naming PRDs or research reports, (3) questions about document organization in prompts/.
testing
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.