| name | code-check |
| description | Reviews staged or recent code changes against LocoMotion coding conventions and Windsurf rules before committing. Use when the user says "check my code", "review my changes", "lint my code", "does this follow conventions", or "code check". |
| metadata | {"author":"profoundry-us","version":"1.0.0"} |
Code Check
Reviews code changes for adherence to LocoMotion conventions before committing
or opening a PR.
Instructions
Step 1: See what changed
git diff
git diff --staged
Read every modified file. Do not skip files.
Step 2: Check against each rule category
Work through the checklist below. Flag every violation with the file path and
line number.
Branch safety
Component Ruby class
YARD documentation
HAML template
Spec file
Example view
helpers.rb (if modified)
Step 3: Run the test suite
just loco-test
All tests must pass.
Step 4: Report findings
List every violation with:
- File path and line number
- Which rule is violated
- A specific fix suggestion
If no violations are found, report "All checks passed" and note the test
result.
Examples
Example 1 — clean code check
Output: "All checks passed. 142 examples, 0 failures."
Example 2 — violation found
Output:
Violations found:
1. app/components/daisy/actions/button_component.rb:12
Rule: @loco_example required (not @example)
Fix: Replace `@example Basic button` with `@loco_example Basic button`
2. app/components/daisy/actions/button_component.rb:8
Rule: DaisyUI size/color variants must not be added as parameters
Fix: Remove the `size:` parameter. Users should pass `css: "btn-lg"`.
Tests: 142 examples, 0 failures.
Troubleshooting
Unsure about a rule — Check .windsurf/rules/ for the authoritative source.
Files: coding.md, component_implementation.md, documenting_code.md.
Test suite cannot run — Verify Docker containers are running:
docker compose ps. Start with docker compose up -d if needed.
Large diff with many files — Work file by file. Check component files first,
then specs, then views.