
Clojure Code Review
FreeAutomate compliance checks for Clojure code changes.
Free · Opens the source repo
What Clojure Code Review does
The Clojure Code Review skill is designed to assist developers in ensuring that their Clojure and ClojureScript code changes adhere to the Metabase coding standards. This skill is particularly useful for reviewing pull requests or diffs, as it automates the detection of style violations and potential code quality issues. By following the guidelines established in the Metabase Clojure style guide, the skill helps maintain a consistent codebase and promotes best practices among developers.
When using this skill, users can expect a thorough review process that flags any deviations from the coding standards outlined in the provided style guide. The skill checks for naming conventions, documentation quality, code organization, testing practices, and adherence to specific patterns that are considered best practices within the Metabase development environment. It also references the community Clojure style guide if available, providing a broader context for compliance.
The skill emphasizes the importance of constructive feedback by avoiding trivial comments such as congratulating developers for minor adjustments or confirming that changes look good. Instead, it focuses on highlighting areas that require attention, ensuring that the review process is efficient and targeted towards improving code quality. This approach not only streamlines the code review process but also fosters a culture of continuous improvement within development teams.
Overall, the Clojure Code Review skill is an essential tool for any developer working with Clojure or ClojureScript in the Metabase ecosystem. It simplifies the review process, enhances code quality, and helps maintain coding standards across the board.
When to use it
Use this skill when reviewing pull requests or diffs that contain Clojure or ClojureScript code to ensure adherence to coding standards.
When not to use it
This skill is not suitable for reviewing non-Clojure code or for situations where a more subjective review process is required.
What you can build with it
Pull Request Review
Use the skill to automate the review of Clojure code changes in pull requests, ensuring compliance with coding standards.
Code Quality Assurance
Integrate the skill into your CI/CD pipeline to maintain high code quality by automatically flagging style violations.
Onboarding New Developers
Leverage the skill to help new team members understand coding standards by providing immediate feedback on their code submissions.
How to install Clojure Code Review
View source1. Install with the skills CLI
npx skills add metabase/metabase/clojure-review --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by metabaseClojure Code Review Skill
@./../_shared/clojure-style-guide.md @./../_shared/clojure-commands.md
Review guidelines
What to flag:
- Check compliance with the Metabase Clojure style guide (included above)
- If
CLOJURE_STYLE_GUIDE.adocexists in the working directory, also check compliance with the community Clojure style guide - Flag all style guide violations
What NOT to post:
- Do not post comments congratulating someone for trivial changes or for following style guidelines
- Do not post comments confirming things "look good" or telling them they did something correctly
- Only post comments about style violations or potential issues
Example bad code review comments to avoid:
This TODO comment is properly formatted with author and date - nice work!
Good addition of limit 1 to the query - this makes the test more efficient without changing its behavior.
The kondo ignore comment is appropriately placed here
Test name properly ends with -test as required by the style guide.
Special cases:
- Do not post comments about missing parentheses (these will be caught by the linter)
Quick review checklist
Use this to scan through changes efficiently:
Naming
- Descriptive names (no
tbl,zs') - Pure functions named as nouns describing their return value
-
kebab-casefor all variables and functions - Side-effect functions end with
! - No namespace-alias repetition in function names
Documentation
- Public vars in
srcorenterprise/backend/srchave useful docstrings - Docstrings use Markdown conventions
- References use
[[other-var]]not backticks -
TODOcomments include author and date:;; TODO (Name 2025-01-01) -- description
Docstring content — check every new or rewritten docstring against the anti-pattern table in the style guide above. Read the diff's docstrings on their own, separately from the code: prose is where review attention slides off, and a long docstring reads as diligence rather than as the liability it usually is.
Code Organization
- Everything
^:privateunless used elsewhere - No
declarewhen avoidable (public functions near end) - Functions under 20 lines when possible
- No blank, non-comment lines within definition forms (except pairwise constructs in
let/cond) - Lines ≤ 120 characters
Tests
- Separate
deftestforms for distinct test cases - Pure tests marked
^:parallel - Test names end in
-testor-test-<number>
Modules
- Correct module patterns (OSS:
metabase.<module>.*, EE:metabase-enterprise.<module>.*) - API endpoints in
<module>.apinamespaces - Public API in
<module>.corewith Potemkin - No cheating module linters with
:clj-kondo/ignore [:metabase/modules]
REST API
- Response schemas present (
:- <schema>) - Query params use kebab-case, bodies use
snake_case - Routes use singular nouns (e.g.,
/api/dashboard/:id) -
GEThas no side effects (except analytics) - Malli schemas detailed and complete
- All new endpoints have tests
MBQL
- No raw MBQL manipulation outside
lib,lib-be, orquery-processormodules - Uses Lib and MBQL 5, not legacy MBQL
Database
- Model and table names are singular nouns
- Uses
t2/select-one-fninstead of selecting full rows for one column - Logic in Toucan methods, not helper functions
Drivers
- New multimethods documented in
docs/developers-guide/driver-changelog.md - Passes
driverargument to other driver methods (no hardcoded driver names) - Minimal logic in
read-column-thunk
Miscellaneous
- Example data is bird-themed when possible
- Kondo linter suppressions use proper format (not
#_:clj-kondo/ignorekeyword form)
Pattern matching table
Quick scan for common issues:
| Pattern | Issue |
|---|---|
calculate-age, get-user | Pure functions should be nouns: age, user |
update-db, save-model | Missing ! for side effects: update-db!, save-model! |
snake_case_var | Should use kebab-case |
| Public var without docstring | Add docstring explaining purpose |
;; TODO fix this | Missing author/date: ;; TODO (Name 2025-01-01) -- description |
(defn foo ...) in namespace used elsewhere | Should be (defn ^:private foo ...) |
| Function > 20 lines | Consider breaking up into smaller functions |
/api/dashboards/:id | Use singular: /api/dashboard/:id |
Query params with snake_case | Use kebab-case for query params |
| New API endpoint without tests | Add tests for the endpoint |
Feedback format examples
For style violations:
This pure function should be named as a noun describing its return value. Consider
userinstead ofget-user.
For missing documentation:
This public var needs a docstring explaining its purpose, inputs, and outputs.
For docstrings documenting code they don't own:
This describes how
libdecides binning strategies internally. Nothing here fails when that changes, so it will go stale silently — drop it and letavailable-binning-strategiesanswer for its own behavior.
For docstring content that belongs in the body:
This paragraph explains why the branches are ordered this way, which is what someone editing the
condneeds — but a caller can't act on it. Move it to an inline comment above thecond.
For organization issues:
This function is only used in this namespace, so it should be marked
^:private.
For API conventions:
Query parameters should use kebab-case. Change
user_idtouser-id.
Frequently asked questions about Clojure Code Review
Similar skills
Quality Playbook Generator
Run comprehensive quality audits on any codebase.
PR Draft Summary
Automate PR summary generation for openai-agents-python.
Final Release Review
Streamline your release candidate audits with ease.
Unit Test Vue Pinia
Efficiently write and review unit tests for Vue 3 applications.
Slang Shader Expert
Optimize and integrate Slang shaders with ease.
Telemetry Standards
Ensure consistent event tracking in Supabase Studio.
