This document provides instructions for maintaining consistency between the system prompt (SYSTEM.md) and the Anthropic/pi skill (clojure-repl-dev/SKILL.md).
| File | Purpose | Format |
|---|---|---|
SYSTEM.md |
System prompt for pi agent | XML-style tags with priorities |
clojure-repl-dev/SKILL.md |
Anthropic/pi skill - core workflow | Markdown with frontmatter |
clojure-repl-dev/references/*.md |
Detailed reference material | Markdown (loaded on demand) |
SKILL.md contains essential workflow (~170 lines) while references/ contains detailed documentation (~400 lines) following the progressive disclosure principle.
Both SYSTEM.md and the skill files share the same Clojure development guidance, but formatted for their respective systems.
All Clojure code examples in SYSTEM.md and SKILL.md must be syntactically valid and runnable. Use clj-nrepl-eval to verify code before committing changes.
# 1. Start an nREPL server if not running
# bb nrepl, lein repl :headless, or clj -M:mcp/nrepl
# 2. Test simple expressions
clj-nrepl-eval -p 7889 "(+ 1 2 3)"
# => 6
# 3. Test function definitions from your edits
clj-nrepl-eval -p 7889 "(defn greet [name] (str \"Hello, \" name))"
# => #'user/greet
clj-nrepl-eval -p 7889 "(greet \"World\")"
# => "Hello, World"
# 4. Test threading macro examples from the skills
clj-nrepl-eval -p 7889 "(-> {:count 0} (update :count inc) (assoc :active true))"
# => {:count 1, :active true}
clj-nrepl-eval -p 7889 "(->> [1 2 3 4] (filter even?) (map #(* % 2)))"
# => (4 8)
# 5. Test destructuring examples
clj-nrepl-eval -p 7889 "(let [{:keys [a b]} {:a 1 :b 2}] (+ a b))"
# => 3Before committing changes to Clojure code examples:
- Start nREPL:
bb nreplor equivalent - Test each new function definition with
clj-nrepl-eval - Test each threading macro example (
->,->>,some->,cond->) - Verify destructuring syntax works
- Check that namespace examples use correct require/import syntax
- Ensure regex literals work:
#"pattern"
# Test edge cases shown in examples
clj-nrepl-eval -p 7889 "(sum-evens [])" # empty collection handling
clj-nrepl-eval -p 7889 "(sum-evens nil)" # nil handling
# Verify metadata/accessor syntax
clj-nrepl-eval -p 7889 "(:arglists (meta #'map))"
# Test cond/case examples
clj-nrepl-eval -p 7889 "(cond (< -1 0) :negative (= 0 0) :zero :else :positive)"If you edit Clojure files and encounter delimiter errors:
# Fix unbalanced parentheses/brackets/braces
clj-paren-repair src/example.clj
# Or via stdin for quick testing
echo '(defn broken [x] (+ x 1)' | clj-paren-repairNever commit code that hasn't been validated in the REPL.
When modifying Clojure development guidance, ALWAYS update both files unless the change is format-specific.
Examples of shared content (update both):
- REPL-first development workflow
- Threading macro patterns
- Naming conventions (kebab-case,
?suffix, no!suffix) - Tool usage instructions (
clj-nrepl-eval,clj-paren-repair) - Code quality standards (docstrings, line length, indentation)
- Validation checklists
- Research references (compiler feedback paper)
Examples of format-specific content (update only one):
- SYSTEM.md: XML tag structure,
priority="critical"attributes - SKILL.md: YAML frontmatter, relative path references
Before considering any edit complete, verify:
- Core mandates match (REPL-first, no ! suffix, threading macros)
- Tool documentation is identical in substance
- Naming conventions are consistent
- Code quality standards align
- Research references match (arXiv paper)
- Version numbers are synchronized
Both files must carry the same version number:
SYSTEM.md:<prompt-version>v1.X.X</prompt-version>SKILL.md:**Version:** v1.X.Xat end of fileREADME.md:Current version: v1.X.XCHANGELOG.md: Version history for both files
When bumping version:
- Update
CHANGELOG.mdwith changes to both files - Update version in
SYSTEM.md - Update version in
SKILL.md - Update version in
README.md
| SYSTEM.md Section | SKILL.md | references/ |
|---|---|---|
<core-mandate> |
## Core Workflow | — |
<clj-nrepl-eval-tool> |
## Tools (brief) | tool-guide.md (detailed) |
<clj-paren-repair-tool> |
## Tools (brief) | tool-guide.md (detailed) |
<idiomatic-clojure> |
## Essential Patterns (examples) | idioms.md (complete reference) |
<code-quality> |
## Naming Rules, Docstrings | idioms.md |
<testing> |
## Validation Checklist | idioms.md |
<code-review-workflow> |
## Code Review Workflow | — |
<error-handling> |
— | idioms.md |
<tool-usage> |
## Tools | tool-guide.md |
<summary> |
## Core Workflow intro | — |
Progressive Disclosure:
- SKILL.md (~170 lines) contains only essential workflow and examples
- references/idioms.md (~260 lines) contains complete patterns, anti-patterns, and research
- references/tool-guide.md (~150 lines) contains complete tool documentation
When adding detailed content (>50 lines), prefer adding to references/ and linking from SKILL.md.
When asked to modify Clojure guidance:
-
Read both files to understand current state
read SYSTEM.md read clojure-repl-dev/SKILL.md
-
Identify which sections need updates in both files
-
Make edits to SYSTEM.md first (it's the source of truth)
-
Mirror changes to SKILL.md adapting format as needed:
- Convert XML tags to Markdown headers
- Preserve code examples exactly
- Adapt priority markers to prose emphasis
-
Verify synchronization using the checklist in Rule 2
-
Update CHANGELOG.md with the changes
-
Bump version if this is a release (all three files)
Keep SKILL.md lean with only essential workflow:
- Core workflow: REPL-first validation steps
- Key examples: Threading macros, naming rules, control flow
- Tool basics: Common clj-nrepl-eval commands
- Validation checklist: Quick reference before saving
- Code review steps: Before-any-changes workflow
- Reference links: Pointers to
references/files
Detailed reference material loaded only when needed:
- Complete idioms: All threading patterns, data structures, destructuring
- Advanced patterns: Multi-arity, variadic, memoization, composition
- Anti-patterns: Common mistakes to avoid with examples
- Research citation: Compiler feedback paper (arXiv:2601.12146v1)
- Error handling: Complete try-catch patterns
- Testing: Full test structure examples
Complete tool documentation:
- All clj-nrepl-eval options: Port, host, full command reference
- Discovery commands: doc, dir, apropos, find-doc, source
- Debugging patterns: Inspecting data, testing pipelines
- Troubleshooting: Connection issues, namespace errors
- Project loading: require, reload, namespace operations
SYSTEM.md only:
- XML tag structure (
<system-prompt>,<identity>, etc.) - Priority attributes (
priority="critical") - Tool-specific XML documentation blocks
- Summary tag at end
SKILL.md only:
- YAML frontmatter (name, description)
- Relative path references to
references/
- Update one file without checking if the other needs updates
- Change naming conventions in one file but not the other
- Add tool examples to SKILL.md that aren't in SYSTEM.md
- Remove the research reference from only one file
- Change version in one file but not others
- Keep code examples identical between files (copy-paste)
- Maintain the same sequence of concepts (REPL → Idioms → Quality → Testing)
- Preserve the no-
!-suffix rule with same emphasis - Include the arXiv paper reference with identical phrasing
For patterns used frequently (add to both):
-
Add brief example to SYSTEM.md under
<clj-nrepl-eval-tool>:```<new-pattern> ```shell clj-nrepl-eval -p 7889 "(new-example)" -
Add brief example to SKILL.md under
## Tools:```shell clj-nrepl-eval -p 7889 "(new-example)"
-
Add complete documentation to
references/tool-guide.md
For patterns rarely needed (references only):
- Add complete documentation to
references/idioms.md
For patterns used constantly (all three):
- Add to SYSTEM.md under
<idiomatic-clojure> - Add brief example to SKILL.md under
## Essential Patterns - Add complete docs to
references/idioms.md
- Edit both files simultaneously (all naming rules are core)
- Use identical examples
- Preserve the "NEVER use ! suffix" prohibition
- Update
references/idioms.mdif table format differs
- Edit
CHANGELOG.mdfirst - Update
SYSTEM.md:<prompt-version>vX.Y.Z</prompt-version> - Update
README.md:Current version: vX.Y.Z - Note: SKILL.md intentionally has no version (per skill spec)
To verify both files are synchronized:
# Check version alignment
grep -E "v1\.[0-9]+\.[0-9]+" SYSTEM.md README.md
grep "Version:" clojure-repl-dev/SKILL.md
# Check for compiler paper reference
grep "2601.12146v1" SYSTEM.md clojure-repl-dev/SKILL.md README.md
# Check no-!-suffix rule presence
grep -A2 "FORBIDDEN.*!" SYSTEM.md
grep -B1 -A1 "NEVER use !" clojure-repl-dev/SKILL.md- SYSTEM.md is the source of truth for content
- SKILL.md is the redistributed format for Anthropic/pi skills
- Always edit both when changing Clojure guidance
- Keep code examples identical between files
- Synchronize versions across all files
- Reference this document when unsure about synchronization