Claude-skill-registry clojure-review
Review Clojure and ClojureScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing Clojure/ClojureScript code.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/clojure-review-gregbaron-metabase-mysandbox" ~/.claude/skills/majiayu000-claude-skill-registry-clojure-review && rm -rf "$T"
skills/data/clojure-review-gregbaron-metabase-mysandbox/SKILL.mdClojure 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
exists in the working directory, also check compliance with the community Clojure style guideCLOJURE_STYLE_GUIDE.adoc - 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
-
for all variables and functionskebab-case - Side-effect functions end with
! - No namespace-alias repetition in function names
Documentation
- Public vars in
orsrc
have useful docstringsenterprise/backend/src - Docstrings use Markdown conventions
- References use
not backticks[[other-var]] -
comments include author and date:TODO;; TODO (Name 1/1/25) -- description
Code Organization
- Everything
unless used elsewhere^:private - No
when avoidable (public functions near end)declare - 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
forms for distinct test casesdeftest - Pure tests marked
^:parallel - Test names end in
or-test-test-<number>
Modules
- Correct module patterns (OSS:
, EE:metabase.<module>.*
)metabase-enterprise.<module>.* - API endpoints in
namespaces<module>.api - Public API in
with Potemkin<module>.core - 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 -
has no side effects (except analytics)GET - Malli schemas detailed and complete
- All new endpoints have tests
MBQL
- No raw MBQL manipulation outside
,lib
, orlib-be
modulesquery-processor - Uses Lib and MBQL 5, not legacy MBQL
Database
- Model and table names are singular nouns
- Uses
instead of selecting full rows for one columnt2/select-one-fn - Logic in Toucan methods, not helper functions
Drivers
- New multimethods documented in
docs/developers-guide/driver-changelog.md - Passes
argument to other driver methods (no hardcoded driver names)driver - Minimal logic in
read-column-thunk
Miscellaneous
- Example data is bird-themed when possible
- Kondo linter suppressions use proper format (not
keyword form)#_:clj-kondo/ignore
Pattern matching table
Quick scan for common issues:
| Pattern | Issue |
|---|---|
, | Pure functions should be nouns: , |
, | Missing for side effects: , |
| Should use kebab-case |
| Public var without docstring | Add docstring explaining purpose |
| Missing author/date: |
in namespace used elsewhere | Should be |
| Function > 20 lines | Consider breaking up into smaller functions |
| Use singular: |
Query params with | 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
instead ofuser.get-user
For missing documentation:
This public var needs a docstring explaining its purpose, inputs, and outputs.
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
touser_id.user-id