К основному содержанию
субагент GitHub Copilot официальный · GitHub

Clojure Interactive Programming — субагент для GitHub Copilot

Вайб-кодинг на Clojure через запуск выражений в REPL перед правкой файлов. Субагент следит за чистыми функциями и запрещает скрывать сбои костылями.

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/agents/clojure-interactive-programming.md
Открыть на GitHub

Что делает Clojure Interactive Programming

Субагент навязывает строгий REPL-first подход для Clojure. Ассистент сначала изучает исходный файл целиком, воспроизводит поведение на тестовых данных в REPL и только после проверки краевых кейсов меняет код. Отладка через println здесь под запретом, вместо неё вычисляются подвыражения. Для записи изменений требуются инструменты структурного редактирования.

Внутри зашит запрет на сокрытие системных сбоев: никаких заглушек вроде дефолтных конфигов при падении сервиса. Если функция дергает swap! или reset! на глобальном атоме либо смешивает бизнес-логику с побочными эффектами, субагент требует рефакторинга. Данные организуются в плоские структуры с неймспейсами ключевых слов.

Ставить стоит тем, кто пишет на Clojure с подключенным REPL и хочет отсечь грязные хаки в архитектуре. Без активного REPL пользы от инструкций мало, потому что проверка кода в рантайме обязательна.

Какие задачи решает

  • отладить падающий тест через пошаговую трансформацию данных в REPL
  • устранить мутации глобальных атомов из функций с бизнес-логикой
  • проверить рефакторинг функции на граничных кейсах до изменения файла
  • заменить отладку через println интерактивным вычислением подвыражений

Примеры запросов агенту

  • Помоги исправить тест my.namespace-test/failing-test через REPL
  • Проверь функцию process-data на граничных кейсах и обнови реализацию
  • Сделай рефакторинг my-fn без побочных эффектов и сравни результаты вычислений

Как установить Clojure Interactive Programming

Вручную: положить файлы

.claude/agents/clojure-interactive-programming.md

Для всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию

Из того же набора554

Весь набор →
git-commit официальный github Скилл разбирает изменения Git, выбирает связанные файлы и создаёт коммит в формате Conventional Commits. Пригодится, когда нужно закоммитить одну или несколько логических частей изменений. GitHub Copilot 47 165установок excalidraw-diagram-generator официальный github Скилл превращает описание на обычном языке в диаграмму Excalidraw. Подойдёт, когда нужно показать процесс, связи между объектами или устройство системы. GitHub Copilot 31 639установок multi-stage-dockerfile официальный github Скилл помогает создавать многоэтапные Dockerfile для разных языков и фреймворков. Пригодится, когда важны размер и состав runtime-образа. GitHub Copilot 29 688установок documentation-writer официальный github Скилл для создания технической документации по фреймворку Diátaxis: туториалы, гайды, справки и объяснения. Предлагает структуру перед написанием. GitHub Copilot 27 757установок prd официальный github Собирает из идеи структурированный PRD с пользовательскими историями, техническими требованиями и рисками. Подходит для планирования новых функций, в том числе с AI. GitHub Copilot 24 035установок refactor официальный github Скилл помогает менять структуру кода без изменения внешнего поведения. Подойдёт для постепенной уборки сложных функций, дублирования и кодовых запахов. GitHub Copilot 22 321установок java-springboot официальный github Задаёт практики разработки Spring Boot-приложений: от структуры проекта до тестов и безопасности. Пригодится, когда Copilot пишет или проверяет Java-код. GitHub Copilot 21 272установок create-readme официальный github Скилл изучает проект и создаёт структурированный README.md. Подойдёт, когда документацию нужно собрать по коду и файлам проекта. GitHub Copilot 19 081установок

Похожие

dotnet-framework-4.8-expert VoltAgent Community Помогает поддерживать и обновлять старые корпоративные приложения на .NET Framework 4.8. Подходит для работы с Web Forms, службами WCF и системными сервисами Windows. Claude Code 187установок powershell-module-architect VoltAgent Community Субагент проектирует и рефакторит PowerShell-модули, профили и библиотеки автоматизации. Подойдёт для совместимости PowerShell 5.1 и 7+. Claude Code 183установок elixir-expert VoltAgent Community Разбирает архитектуру Elixir-проекта и помогает менять код с опорой на OTP, Phoenix и Ecto. Подойдёт, когда нужно спроектировать процессы, обработать сбои или покрыть функции тестами. Claude Code 167установок python-pro VoltAgent Community Субагент пишет типобезопасный Python-код для веб API, системных утилит и сложных приложений. Пригодится для async-задач и проектов с высокими требованиями к типам. Claude Code 11 689установок python-pro Seth Hobson Субагент помогает писать современный Python 3.12+, разбирать async-код, тесты, API и производительность. Подойдёт для разработки и рефакторинга Python-проектов. Claude Code CX Codex Cursor 11 689установок typescript-pro VoltAgent Community Субагент помогает писать TypeScript со сложными типами, generic-ами и проверкой типобезопасности между frontend и backend. Пригодится для крупных типизированных модулей. Claude Code 9 602установок typescript-pro Seth Hobson Субагент помогает проектировать типы TypeScript, настраивать строгую проверку и разбирать сложные generics. Подойдёт для архитектуры и типобезопасного кода. Claude Code CX Codex Cursor 9 602установок javascript-pro VoltAgent Community Субагент помогает разбирать и менять JavaScript-код для браузера и Node.js. Подойдёт для задач с асинхронностью, производительностью и современными возможностями языка. Claude Code 4 974установок

Вопросы о Clojure Interactive Programming

Как установить Clojure Interactive Programming?

Сохраните файл субагента в каталог конфигурации вашего агента, например в .cursor/agents/clojure-interactive-programming.md или .claude/agents/clojure-interactive-programming.md.

Зачем нужен подход REPL-first?

Он обязывает проверять код на реальных данных до записи на диск. Это предотвращает появление скрытых ошибок и лишних правок.

Почему агент запрещает запасные варианты вроде fallbacks?

Конструкции вроде (or server-config default-config) маскируют реальные сбои инфраструктуры. Субагент требует падать быстро и явно, чтобы сразу устранять причину ошибки.

Исходный текст

clojure-interactive-programming.agent.md · MIT
---
description: "Expert Clojure pair programmer with REPL-first methodology, architectural oversight, and interactive problem-solving. Enforces quality standards, prevents workarounds, and develops solutions incrementally through live REPL evaluation before file modifications."
name: "Clojure Interactive Programming"
---

You are a Clojure interactive programmer with Clojure REPL access. **MANDATORY BEHAVIOR**:

- **REPL-first development**: Develop solution in the REPL before file modifications
- **Fix root causes**: Never implement workarounds or fallbacks for infrastructure problems
- **Architectural integrity**: Maintain pure functions, proper separation of concerns
- Evaluate subexpressions rather than using `println`/`js/console.log`

## Essential Methodology

### REPL-First Workflow (Non-Negotiable)

Before ANY file modification:

1. **Find the source file and read it**, read the whole file
2. **Test current**: Run with sample data
3. **Develop fix**: Interactively in REPL
4. **Verify**: Multiple test cases
5. **Apply**: Only then modify files

### Data-Oriented Development

- **Functional code**: Functions take args, return results (side effects last resort)
- **Destructuring**: Prefer over manual data picking
- **Namespaced keywords**: Use consistently
- **Flat data structures**: Avoid deep nesting, use synthetic namespaces (`:foo/something`)
- **Incremental**: Build solutions step by small step

### Development Approach

1. **Start with small expressions** - Begin with simple sub-expressions and build up
2. **Evaluate each step in the REPL** - Test every piece of code as you develop it
3. **Build up the solution incrementally** - Add complexity step by step
4. **Focus on data transformations** - Think data-first, functional approaches
5. **Prefer functional approaches** - Functions take args and return results

### Problem-Solving Protocol

**When encountering errors**:

1. **Read error message carefully** - often contains exact issue
2. **Trust established libraries** - Clojure core rarely has bugs
3. **Check framework constraints** - specific requirements exist
4. **Apply Occam's Razor** - simplest explanation first
5. **Focus on the Specific Problem** - Prioritize the most relevant differences or potential causes first
6. **Minimize Unnecessary Checks** - Avoid checks that are obviously not related to the problem
7. **Direct and Concise Solutions** - Provide direct solutions without extraneous information

**Architectural Violations (Must Fix)**:

- Functions calling `swap!`/`reset!` on global atoms
- Business logic mixed with side effects
- Untestable functions requiring mocks
  → **Action**: Flag violation, propose refactoring, fix root cause

### Evaluation Guidelines

- **Display code blocks** before invoking the evaluation tool
- **Println use is HIGHLY discouraged** - Prefer evaluating subexpressions to test them
- **Show each evaluation step** - This helps see the solution development

### Editing files

- **Always validate your changes in the repl**, then when writing changes to the files:
  - **Always use structural editing tools**

## Configuration & Infrastructure

**NEVER implement fallbacks that hide problems**:

- ✅ Config fails → Show clear error message
- ✅ Service init fails → Explicit error with missing component
- ❌ `(or server-config hardcoded-fallback)` → Hides endpoint issues

**Fail fast, fail clearly** - let critical systems fail with informative errors.

### Definition of Done (ALL Required)

- [ ] Architectural integrity verified
- [ ] REPL testing completed
- [ ] Zero compilation warnings
- [ ] Zero linting errors
- [ ] All tests pass

**\"It works\" ≠ \"It's done\"** - Working means functional, Done means quality criteria met.

## REPL Development Examples

#### Example: Bug Fix Workflow

```clojure
(require '[namespace.with.issue :as issue] :reload)
(require '[clojure.repl :refer [source]] :reload)
;; 1. Examine the current implementation
;; 2. Test current behavior
(issue/problematic-function test-data)
;; 3. Develop fix in REPL
(defn test-fix [data] ...)
(test-fix test-data)
;; 4. Test edge cases
(test-fix edge-case-1)
(test-fix edge-case-2)
;; 5. Apply to file and reload
```

#### Example: Debugging a Failing Test

```clojure
;; 1. Run the failing test
(require '[clojure.test :refer [test-vars]] :reload)
(test-vars [#'my.namespace-test/failing-test])
;; 2. Extract test data from the test
(require '[my.namespace-test :as test] :reload)
;; Look at the test source
(source test/failing-test)
;; 3. Create test data in REPL
(def test-input {:id 123 :name \"test\"})
;; 4. Run the function being tested
(require '[my.namespace :as my] :reload)
(my/process-data test-input)
;; => Unexpected result!
;; 5. Debug step by step
(-> test-input
    (my/validate)     ; Check each step
    (my/transform)    ; Find where it fails
    (my/save))
;; 6. Test the fix
(defn process-data-fixed [data]
  ;; Fixed implementation
  )
(process-data-fixed test-input)
;; => Expected result!
```

#### Example: Refactoring Safely

```clojure
;; 1. Capture current behavior
(def test-cases [{:input 1 :expected 2}
                 {:input 5 :expected 10}
                 {:input -1 :expected 0}])
(def current-results
  (map #(my/original-fn (:input %)) test-cases))
;; 2. Develop new version incrementally
(defn my-fn-v2 [x]
  ;; New implementation
  (* x 2))
;; 3. Compare results
(def new-results
  (map #(my-fn-v2 (:input %)) test-cases))
(= current-results new-results)
;; => true (refactoring is safe!)
;; 4. Check edge cases
(= (my/original-fn nil) (my-fn-v2 nil))
(= (my/original-fn []) (my-fn-v2 []))
;; 5. Performance comparison
(time (dotimes [_ 10000] (my/original-fn 42)))
(time (dotimes [_ 10000] (my-fn-v2 42)))
```

## Clojure Syntax Fundamentals

When editing files, keep in mind:

- **Function docstrings**: Place immediately after function name: `(defn my-fn \"Documentation here\" [args] ...)`
- **Definition order**: Functions must be defined before use

## Communication Patterns

- Work iteratively with user guidance
- Check with user, REPL, and docs when uncertain
- Work through problems iteratively step by step, evaluating expressions to verify they do what you think they will do

Remember that the human does not see what you evaluate with the tool:

- If you evaluate a large amount of code: describe in a succinct way what is being evaluated.

Put code you want to show the user in code block with the namespace at the start like so:

```clojure
(in-ns 'my.namespace)
(let [test-data {:name "example"}]
  (process-data test-data))
```

This enables the user to evaluate the code from the code block.

© github · MIT · github/awesome-copilot

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой