agentleFS
ControllableModelControllableModel/SWE-Skills-Bench/skills/clojure-write/SKILL.md

clojure-write

Skill8 starsChanged 26 days agoMITView on GitHub

Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When clojure-mcp tools are available (e.g., clojure_eval, clojure_edit), always use them instead of shell commands like ./bin/mage -repl.

    line 10
  2. Very specific:

    Only fall back to ./bin/mage commands when clojure-mcp is not available.

    line 16
  3. Distinctive:

    Start with small, fundamental functions:

    line 24
  4. Distinctive:

    Write and test in the REPL:

    line 27
  5. Distinctive:

    Write the code for each small function directly in the REPL (Read-Eval-Print Loop).

    line 28
  6. Distinctive:

    Test it thoroughly with a variety of inputs, including typical use cases and relevant edge cases, to ensure it behaves as expected.

    line 29
  7. Distinctive:

    Make sure every function is fully tested in the REPL before it is depended upon by other functions.

    line 38
  8. Distinctive:

    Use the REPL fully:

    line 40
  9. Distinctive:

    Use the REPL as your primary tool to experiment with different approaches, iterate quickly, and get immediate feedback on your code.

    line 41
  10. Distinctive:

    Follow functional programming principles:

    line 43
  11. Distinctive:

    Keep functions small, focused, and composable.

    line 44
  12. Distinctive:

    Use Clojure's functional programming features—like immutability, higher-order functions, and the standard library—to write concise, …

    line 45
  13. Distinctive:

    Write code into a file.

    line 52
  14. Very specific:

    Call functions in the namespace with test inputs, and observe that the outputs are correct Feel free to copy these REPL session trials into …

    line 59
  15. Very specific:

    After EVERY change to Clojure code, verify readability with -check-readable

    line 66
  16. Distinctive:

    When editing tabular code, where the columns line up, try to keep them aligned

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clojure Development Skill

Tool Preference

When clojure-mcp tools are available (e.g., clojure_eval, clojure_edit), always use them instead of shell commands like ./bin/mage -repl. The MCP tools provide:

  • Direct REPL integration without shell escaping issues
  • Better error messages and feedback
  • Structural Clojure editing that prevents syntax errors

Only fall back to ./bin/mage commands when clojure-mcp is not available.

@./../_shared/development-workflow.md @./../_shared/clojure-style-guide.md @./../_shared/clojure-commands.md

REPL-Driven Development Workflow

  • Start with small, fundamental functions:
  • Identify the core features or functionalities required for your task.
  • Break each feature down into the smallest, most basic functions that can be developed and tested independently.
  • Write and test in the REPL:
    • Write the code for each small function directly in the REPL (Read-Eval-Print Loop).
    • Test it thoroughly with a variety of inputs, including typical use cases and relevant edge cases, to ensure it behaves as expected.
  • Integrate into source code:
    • Once a function works correctly in the REPL, move it from the REPL environment into your source code files (e.g., within appropriate namespaces).
  • Gradually increase complexity:
    • Build upon tested, basic functions to create more complex functions or components.
    • Compose smaller functions together, testing each new composition in the REPL to verify correctness step by step.
  • Ensure dependency testing:
    • Make sure every function is fully tested in the REPL before it is depended upon by other functions.
    • This ensures that each layer of your application is reliable before you build on it.
  • Use the REPL fully:
    • Use the REPL as your primary tool to experiment with different approaches, iterate quickly, and get immediate feedback on your code.
  • Follow functional programming principles:
    • Keep functions small, focused, and composable.
    • Use Clojure's functional programming features—like immutability, higher-order functions, and the standard library—to write concise, effective code.

How to Evaluate Code

Bottom-up Dev Loop

  1. Write code into a file.
  2. Evaluate the file's namespace and make sure it loads correctly with:
./bin/mage -repl --namespace metabase.app-db.connection
  1. Call functions in the namespace with test inputs, and observe that the outputs are correct Feel free to copy these REPL session trials into actual test cases using deftest and is.
  2. Once you know these functions are good, return to 1, and compose them into the task that you need to build.

Critical Rules for Editing

  • Be careful with parentheses counts when editing Clojure code
  • After EVERY change to Clojure code, verify readability with -check-readable
  • End all files with a newline
  • When editing tabular code, where the columns line up, try to keep them aligned
  • Spaces on a line with nothing after it is not allowed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.