hugoduncan/psi/clojure-coding-standards
- community
Checking that the SKILL.md file is still in the repository.
Comprehensive Clojure coding standards including function formatting, testing patterns, REPL workflows, dependency management, and code organization. Use whenever writing Clojure or babashka code, or tests, reviewing Clojure or babashka projects, or setting up Clojure or babashka development workflows.
Install
npx vskill@latest install hugoduncan/psi/clojure-coding-standardsSKILL.md
Clojure Coding Standards
Comprehensive Clojure coding standards for maintainable, readable code.
Core Formatting Rules
Function Structure
- Doc strings always come before the argument vector
- File size limit: 800 lines maximum per file
- No lazy sequences unless explicitly required
Architecture
- Use explicit arguments instead, not dynamic vars.
- Prefer not to use multimethods. Use something that does use global mutable state.
- Only use
declerefor mutual recursion - Do not use
in-nsin production code. - Do not use
trycatchexception handling for flow control - Do not shadow locals, vars or functions
- Break dependency cycles architecturally, not use requiring-resolve
- Vars (e.g. functions) do not need to be public to be tested; tests can use the #' idiom.
- Prefer clojure idioms to java interop
λx.prefer(compose(transducers))∧when(working_with(sequences),thread(sequence_functions))
Dependencies
Find available versions:
For git-based dependencies:
Testing Standards
Test Organization
- Fast tests by default - slow tests in separate profile
- No docstrings in
deftestforms - Start each test with intention comment
- BDD-style testing forms that read like specifications
Test Structure Template
Testing Best Practices
- Filesystem fixtures: Use test-resources in test-specific sub-directories
- Informative assertions: Write assertions that provide debugging info when they fail
- No use-fixtures: Prefer
(with-xxx [args] ...)macros for setup/teardown - Zero tolerance: Fix failing/flaky tests immediately
- Isolation: Each test should be independent
- Deterministic: tests should be deterministic and repeatable. no sleeps.
- No test only code paths in production.
- Test boundary contracts. Testing implementation details makes tests brittle, and production code harder to change.
Prefer testing-without-mocks.
REPL Workflow
Discovery & Connection
REPL Management
Linting
Code Formatting
Parenthesis Repair
NEVER manually fix parenthesis errors.
Use the tool:
The tool automatically:
- Fixes delimiters
- Formats code with cljfmt
- Reports any issues
Comments & Documentation
Comment Hierarchy
- Section separators: Use
;;;prefix (no decorative lines) - Function docs: Public functions get docstrings
- Inline comments: Focus on WHY, not WHAT
Required Comments
- Business logic: Domain rules and requirements
- Non-obvious algorithms: Complex implementations
- Edge cases: Assumptions and limitations
- TODOs/FIXMEs: Known issues
Never Comment
- Self-explanatory code
- Function names restated
- Stale information
Docstring Format
Error Reporting
For command-line error reports on stderr:
Project Organization
File Structure
- Keep related functions together
- Separate pure functions from side effects
- Group by domain, not by technical layer
Namespace Guidelines
- Clear, descriptive namespace names
- Avoid deeply nested namespaces
- Use consistent prefixes for project namespaces
Quick Reference Commands
Integration with Editors
Preferred Tools
- Leverage
clojure_lspfor diagnostics and refactoring
REPL Integration
- Keep REPL connection active during development
- Evaluate forms as you write them
- Use REPL for exploratory programming
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.psi/skills/clojure-coding-standards/SKILL.md
Popularity
- Repository stars
- 55
- Repository forks
- 7
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hugoduncan/psi/clojure-coding-standards)