clojure-review
Review Clojure and ClojureScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when rev…
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Clojure 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 1/1/25) -- description
Code Organization
- [ ] Everything
^:privateunless used elsewhere - [ ] No
declarewhen avoidable (public functions near end) - [ ] Functions under 20 lines when possible
- [ ] No blank 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 1/1/25) -- 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 user instead of 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 user_id to user-id.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
skills_categorized/cli-tools/clojure-review/SKILL.md同一个仓库里的其他技能
同名技能的其他版本
有 7 个不同仓库或目录里都有叫 clojure-review 的技能。它们内容并不相同,别混用:
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard
- Microck/ordinary-claude-skills — Review Clojure and ClojureScript code changes for compliance with Metabase coding standard