К основному содержанию
скилл CX Codex

deepagents-code-review — скилл для Claude Code: ревью кода Deep Agents

Скилл deepagents-code-review проверяет код на create_deep_agent: ловит забытый checkpointer, относительные пути и бэкенды без хранилища.

Apache-2.0 134 установок ★ 89 обновлён 2026-09-15

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add existential-birds/beagle --skill deepagents-code-review -a claude-code
Открыть на GitHub

Что делает deepagents-code-review

Скилл разбирает код, написанный на Deep Agents, и раскладывает найденное по категориям: критичные ошибки, бэкенды, субагенты. Внутри — набор гейтов. Сначала агент обязан процитировать file:line и сам код, прочитанный в этом же проходе. Потом перечислить места вызова (create_deep_agent, CompiledSubAgent, CompositeBackend, backend=, interrupt_on, checkpointer, store), привязать каждую претензию к строке и только затем выставить severity.

Проверки конкретные: interrupt_on без checkpointer, StoreBackend без store, вызов с чекпойнтером, но без thread_id в конфиге, относительные и Windows-пути в файловых инструментах, ожидание persist между тредами от StateBackend, FilesystemBackend с root_dir="/", маршруты CompositeBackend, где короткий префикс перекрывает длинный.

Первое, что стоит искать в чужом агенте: interrupt_on без checkpointer в той же конструкции — прерывания не сработают. Если рантайм-утверждение не подтверждается цитатой, скилл велит пометить его как uncertain, а не додумывать.

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

  • найти interrupt_on без checkpointer в конструкции агента
  • проверить, что каждый StoreBackend получает store
  • отловить относительные пути в вызовах read_file
  • разобрать маршруты CompositeBackend на перекрытие префиксов
  • свериться, что у субагента заполнены обязательные поля

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

  • Проверь agents/research.py по скиллу deepagents-code-review: есть ли проблемы с checkpointer и store.
  • Сделай ревью кода Deep Agents в src/agents/ и начни с цитат file:line.
  • Глянь backend.py: переживут ли файлы переход в другой тред?

Как установить deepagents-code-review

1Через Skills CLI (Vercel)

npx skills add existential-birds/beagle --skill deepagents-code-review -a claude-code

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

~/.claude/skills/deepagents-code-review/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/deepagents-code-review/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о deepagents-code-review

Как установить deepagents-code-review в Claude Code?

Выполните npx skills add existential-birds/beagle --skill deepagents-code-review -a claude-code. Файл скилла окажется в ~/.claude/skills/deepagents-code-review/SKILL.md.

Что делает deepagents-code-review?

Прогоняет код Deep Agents через набор гейтов и выдаёт находки с привязкой к строке: критичные ошибки вроде прерываний без чекпойнтера, проблемы бэкендов и субагентов.

Почему скилл требует сначала цитировать код?

Модель под давлением контекста уверенно помечает код, которого в файле нет. Поэтому находка без цитаты file:line из текущего прохода считается недействительной.

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

SKILL.md · Apache-2.0
---
name: deepagents-code-review
description: Reviews Deep Agents code for bugs, anti-patterns, and improvements. Use when reviewing code that uses create_deep_agent, backends, subagents, middleware, or human-in-the-loop patterns. Catches common configuration and usage mistakes.
---

# Deep Agents Code Review

When reviewing Deep Agents code, check for these categories of issues.

## Anti-confabulation (gate 0 — runs before every other gate)

Before issuing **any** finding — flag a bug, anti-pattern, or improvement — you MUST echo the exact artifact you are judging, quoted from a source you read in **this** turn:

- The code finding: its `file:line` plus the cited code, read freshly now.
- The agent code under review: the `create_deep_agent`, backend, subagent, or middleware snippet your finding depends on, quoted from the file you just read.

> The artifact is the only source of truth. **Never** infer what you are reviewing from the branch name, the working directory, surrounding files, or recollection. If your mental model differs from the freshly read source, **the source wins.** A finding issued without a same-turn echo of its target is invalid — emit the echo first, or do not emit the finding.

This gate exists because an LLM under contextual priming will confidently flag code that is not in the file. It runs **before** the gates below.

## Review gates (evidence-bound)

Run these steps in order before and while you write findings. Skipping a step is a failed review.

1. **Locate** — Enumerate call sites in scope (`create_deep_agent`, `CompiledSubAgent`, `CompositeBackend`, custom `backend=`, `interrupt_on`, `checkpointer`, `store`). **Pass:** You list each relevant **file path** and **line number** (or a grep/search result that proves where the code lives).
2. **Anchor** — For each suspected issue, tie it to **quoted or line-referenced code** from those files, not to imports or names alone. **Pass:** Every finding includes **evidence** (`path:line` plus a short quote or “absent parameter” note showing the gap).
3. **Classify** — Map each anchored issue to one category below (Critical → Performance) and a severity. **Pass:** The category label matches what the cited code actually does or omits.
4. **Runtime claims** — If you say something will error, fail at runtime, or leak data, **Pass:** The cited snippet shows the exact API combo (e.g. `interrupt_on` set with no `checkpointer` in the same construction path), or you state **uncertain** and what would confirm it.

If you cannot satisfy step 1, stop and say what file or search is missing instead of inferring issues from memory.

## Critical Issues

### 1. Missing Checkpointer with interrupt_on

```python
# BAD - interrupt_on without checkpointer
agent = create_deep_agent(
    tools=[send_email],
    interrupt_on={"send_email": True},
    # No checkpointer! Interrupts will fail
)

# GOOD - checkpointer required for interrupts
from langgraph.checkpoint.memory import InMemorySaver

agent = create_deep_agent(
    tools=[send_email],
    interrupt_on={"send_email": True},
    checkpointer=InMemorySaver(),
)
```

### 2. Missing Store with StoreBackend

```python
# BAD - StoreBackend without store
from deepagents.backends import StoreBackend

agent = create_deep_agent(
    backend=lambda rt: StoreBackend(rt),
    # No store! Will raise ValueError at runtime
)

# GOOD - provide store
from langgraph.store.memory import InMemoryStore

store = InMemoryStore()
agent = create_deep_agent(
    backend=lambda rt: StoreBackend(rt),
    store=store,
)
```

### 3. Missing thread_id with Checkpointer

```python
# BAD - no thread_id when using checkpointer
agent = create_deep_agent(checkpointer=InMemorySaver())
agent.invoke({"messages": [...]})  # Error!

# GOOD - always provide thread_id
config = {"configurable": {"thread_id": "user-123"}}
agent.invoke({"messages": [...]}, config)
```

### 4. Relative Paths in Filesystem Tools

```python
# BAD - relative paths not supported
read_file(path="src/main.py")
read_file(path="./config.json")

# GOOD - absolute paths required
read_file(path="/workspace/src/main.py")
read_file(path="/config.json")
```

### 5. Windows Paths in Virtual Filesystem

```python
# BAD - Windows paths rejected
read_file(path="C:\\Users\\file.txt")
write_file(path="D:/projects/code.py", content="...")

# GOOD - Unix-style virtual paths
read_file(path="/workspace/file.txt")
write_file(path="/projects/code.py", content="...")
```

## Backend Issues

### 6. StateBackend Expecting Persistence

```python
# BAD - expecting files to persist across threads
agent = create_deep_agent()  # Uses StateBackend by default

# Thread 1
agent.invoke({"messages": [...]}, {"configurable": {"thread_id": "a"}})
# Agent writes to /data/report.txt

# Thread 2 - file won't exist!
agent.invoke({"messages": [...]}, {"configurable": {"thread_id": "b"}})
# Agent tries to read /data/report.txt - NOT FOUND

# GOOD - use StoreBackend or CompositeBackend for cross-thread persistence
agent = create_deep_agent(
    backend=CompositeBackend(
        default=StateBackend(),
        routes={"/data/": StoreBackend(store=store)},
    ),
    store=store,
)
```

### 7. FilesystemBackend Without root_dir Restriction

```python
# BAD - unrestricted filesystem access
agent = create_deep_agent(
    backend=FilesystemBackend(root_dir="/"),  # Full system access!
)

# GOOD - scope to project directory
agent = create_deep_agent(
    backend=FilesystemBackend(root_dir="/home/user/project"),
)
```

### 8. CompositeBackend Route Order Confusion

```python
# BAD - shorter prefix shadows longer prefix
agent = create_deep_agent(
    backend=CompositeBackend(
        default=StateBackend(),
        routes={
            "/mem/": backend_a,        # This catches /mem/long-term/ too!
            "/mem/long-term/": backend_b,  # Never reached
        },
    ),
)

# GOOD - CompositeBackend sorts by length automatically
# But be explicit about your intent:
agent = create_deep_agent(
    backend=CompositeBackend(
        default=StateBackend(),
        routes={
            "/memories/": persistent_backend,
            "/workspace/": ephemeral_backend,
        },
    ),
)
```

### 9. Expecting execute Tool Without SandboxBackend

```python
# BAD - execute tool won't work with StateBackend
agent = create_deep_agent()  # Default StateBackend
# Agent calls execute("ls -la") → Error: not supported

# GOOD - use FilesystemBackend for shell execution
agent = create_deep_agent(
    backend=FilesystemBackend(root_dir="/project"),
)
# Agent calls execute("ls -la") → Works
```

## Subagent Issues

### 10. Subagent Missing Required Fields

```python
# BAD - missing required fields
agent = create_deep_agent(
    subagents=[{
        "name": "helper",
        # Missing: description, system_prompt, tools
    }]
)

# GOOD - all required fields present
agent = create_deep_agent(
    subagents=[{
        "name": "helper",
        "description": "General helper for misc tasks",
        "system_prompt": "You are a helpful assistant.",
        "tools": [],  # Can be empty but must be present
    }]
)
```

### 11. Subagent Name Collision

```python
# BAD - duplicate subagent names
agent = create_deep_agent(
    subagents=[
        {"name": "research", "description": "A", ...},
        {"name": "research", "description": "B", ...},  # Collision!
    ]
)

# GOOD - unique names
agent = create_deep_agent(
    subagents=[
        {"name": "web-research", "description": "Web-based research", ...},
        {"name": "doc-research", "description": "Document research", ...},
    ]
)
```

### 12. Overusing Subagents for Simple Tasks

```python
# BAD - subagent overhead for trivial task
# In system prompt or agent behavior:
"Use the task tool to check the current time"
"Delegate file reading to a subagent"

# GOOD - use subagents for complex, isolated work
"Use the task tool for multi-step research that requires many searches"
"Delegate the full analysis workflow to a subagent"
```

### 13. CompiledSubAgent Without Proper State

```python
# BAD - subgraph with incompatible state schema
from langgraph.graph import StateGraph

class CustomState(TypedDict):
    custom_field: str  # No messages field!

sub_builder = StateGraph(CustomState)
# ... build graph
subgraph = sub_builder.compile()

agent = create_deep_agent(
    subagents=[CompiledSubAgent(
        name="custom",
        description="Custom workflow",
        runnable=subgraph,  # State mismatch!
    )]
)

# GOOD - ensure compatible state or use message-based interface
class CompatibleState(TypedDict):
    messages: Annotated[list, add_messages]
    custom_field: str
```

## Middleware Issues

### 14. Middleware Order Misunderstanding

```python
# BAD - expecting custom middleware to run first
class PreProcessMiddleware(AgentMiddleware):
    def transform_request(self, request):
        # Expecting this runs before built-in middleware
        return request

agent = create_deep_agent(middleware=[PreProcessMiddleware()])
# Actually runs AFTER TodoList, Filesystem, SubAgent, etc.

# GOOD - understand middleware runs after built-in stack
# Built-in order:
# 1. TodoListMiddleware
# 2. FilesystemMiddleware
# 3. SubAgentMiddleware
# 4. SummarizationMiddleware
# 5. AnthropicPromptCachingMiddleware
# 6. PatchToolCallsMiddleware
# 7. YOUR MIDDLEWARE HERE
# 8. HumanInTheLoopMiddleware (if interrupt_on set)
```

### 15. Middleware Mutating Request/Response

```python
# BAD - mutating instead of returning new object
class BadMiddleware(AgentMiddleware):
    def transform_request(self, request):
        request.messages.append(extra_message)  # Mutation!
        return request

# GOOD - return modified copy
class GoodMiddleware(AgentMiddleware):
    def transform_request(self, request):
        return ModelRequest(
            messages=[*request.messages, extra_message],
            **other_fields
        )
```

### 16. Middleware Tools Without Descriptions

```python
# BAD - tool without docstring
@tool
def my_tool(arg: str) -> str:
    return process(arg)

class MyMiddleware(AgentMiddleware):
    tools = [my_tool]  # LLM won't know how to use it!

# GOOD - descriptive docstring
@tool
def my_tool(arg: str) -> str:
    """Process the input string and return formatted result.

    Args:
        arg: The string to process

    Returns:
        Formatted result string
    """
    return process(arg)
```

## System Prompt Issues

### 17. Duplicating Built-in Tool Instructions

```python
# BAD - re-explaining what middleware already covers
agent = create_deep_agent(
    system_prompt="""You have access to these tools:
    - write_todos: Create task lists
    - read_file: Read files from the filesystem
    - task: Delegate to subagents

    When using files, always use absolute paths..."""
)
# This duplicates what FilesystemMiddleware and TodoListMiddleware inject!

# GOOD - focus on domain-specific guidance
agent = create_deep_agent(
    system_prompt="""You are a code review assistant.

    Workflow:
    1. Read the files to review
    2. Create a todo list of issues found
    3. Delegate deep analysis to subagents if needed
    4. Compile findings into a report"""
)
```

### 18. Contradicting Built-in Instructions

```python
# BAD - contradicting default behavior
agent = create_deep_agent(
    system_prompt="""Never use the task tool.
    Always process everything in the main thread.
    Don't use todos, just remember everything."""
)
# Fighting against the framework!

# GOOD - work with the framework
agent = create_deep_agent(
    system_prompt="""For simple tasks, handle directly.
    For complex multi-step research, use subagents.
    Track progress with todos for tasks with 3+ steps."""
)
```

### 19. Missing Stopping Criteria

```python
# BAD - no guidance on when to stop
agent = create_deep_agent(
    system_prompt="Research everything about the topic thoroughly."
)
# Agent may run indefinitely!

# GOOD - define completion criteria
agent = create_deep_agent(
    system_prompt="""Research the topic with these constraints:
    - Maximum 5 web searches
    - Stop when you have 3 reliable sources
    - Limit subagent delegations to 2 parallel tasks
    - Summarize findings within 500 words"""
)
```

## Performance Issues

### 20. Not Parallelizing Independent Subagents

```python
# BAD - sequential subagent calls (in agent behavior)
# Agent calls: task(research topic A) → wait → task(research topic B) → wait

# GOOD - parallel subagent calls
# Agent calls in single turn:
#   task(research topic A)
#   task(research topic B)
#   task(research topic C)
# All run concurrently!

agent = create_deep_agent(
    system_prompt="""When researching multiple topics,
    launch all research subagents in parallel in a single response."""
)
```

### 21. Large Files in State

```python
# BAD - writing large files to StateBackend
# Agent writes 10MB log file to /output/full_log.txt
# This bloats every checkpoint!

# GOOD - use FilesystemBackend for large files or paginate
agent = create_deep_agent(
    backend=CompositeBackend(
        default=StateBackend(),  # Small files
        routes={
            "/large_files/": FilesystemBackend(root_dir="/tmp/agent"),
        },
    ),
)
```

### 22. InMemorySaver in Production

```python
# BAD - ephemeral checkpointer in production
agent = create_deep_agent(
    checkpointer=InMemorySaver(),  # Lost on restart!
)

# GOOD - persistent checkpointer
from langgraph.checkpoint.postgres import PostgresSaver

agent = create_deep_agent(
    checkpointer=PostgresSaver.from_conn_string(DATABASE_URL),
)
```

### 23. Missing Recursion Awareness

```python
# BAD - no guard against long-running loops
agent = create_deep_agent(
    system_prompt="Keep improving the solution until it's perfect."
)
# May hit recursion limit (default 1000)

# GOOD - explicit iteration limits
agent = create_deep_agent(
    system_prompt="""Improve the solution iteratively:
    - Maximum 3 revision cycles
    - Stop if quality score > 90%
    - Stop if no improvement after 2 iterations"""
)
```

## Code Review Checklist

See [`references/checklist.md`](references/checklist.md) for the full per-area checklist (Configuration, Backends, Subagents, Middleware, System Prompt, Performance). Run it after the **Review gates** and the numbered issue catalogue above.

© existential-birds · Apache-2.0 · existential-birds/beagle

Похожие скиллы

Все скиллы по теме «Код-ревью и рефакторинг» →
deepagents-setup-configuration soba-labs Скилл deepagents-setup-configuration для Claude Code создаёт и проверяет проекты Deep Agents на Python или JavaScript. Помогает настроить субагентов, память и подтверждение действий человеком. CX Codex +1 ★ 106звёзд репо langgraph sickn33 Строит явные графы LangGraph вместо неявных цепочек вызовов. Организует stateful-агентов с ветвлениями и паузами на решение человека. CX Codex +1 1 300установок langchain-development Mindrally Скилл langchain-development для Claude Code: задаёт правила разработки на LangChain и LangGraph — композиция цепочек, агенты, память, RAG. Держит Python-проект в едином стиле. CX Codex +1 726установок auto-review-loop-llm wanshuiyin Скилл auto-review-loop-llm гоняет вашу работу по кругу: внешний рецензент ставит оценку, вы правите слабые места, он смотрит снова. Полезно, когда нужно довести статью или эксперимент до готовности. CX Codex +1 550установок langchain-architecture Seth Hobson Скилл langchain-architecture для Claude Code помогает проектировать LLM-приложения на LangChain 1.x и LangGraph: агентов, память, состояние и вызов инструментов. Разбирает сложные AI-воркфлоу. CX Codex +1 13 150установок deepagents-python-quickstart langchain-ai Скилл deepagents-python-quickstart собирает минимального Deep Agent на Python по живому quickstart LangChain: спрашивает модель, поднимает отдельную папку проекта, меняет Tavily на встроенный поиск провайдера. CX Codex +1 5 900установок

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

Весь набор →
pydantic-ai-dependency-injection Скилл pydantic-ai-dependency-injection показывает, как передавать базы данных, API-клиенты и контекст пользователя в PydanticAI через RunContext и deps_type. CX Codex +1 141установок watchos-code-review Скилл watchos-code-review для Claude Code проверяет watchOS-код на ошибки жизненного цикла, осложнений, WatchConnectivity и ограничения производительности. CX Codex +1 137установок swiftdata-code-review Скилл swiftdata-code-review проверяет код SwiftData на ошибки в моделях, предикатах, миграциях и конкурентности. Запускается при ревью файлов со связками @Model и @Query. CX Codex +1 136установок howto-docs Скилл howto-docs помогает писать пошаговые how-to-гайды под конкретную задачу: с предусловиями, шагами, проверкой результата и разбором типичных проблем. CX Codex +1 135установок healthkit-code-review Скилл healthkit-code-review для Claude Code разбирает код с HealthKit по шагам: авторизацию, запросы, observer-запросы и фоновую доставку. Проверяет работу приложения с данными о здоровье. CX Codex +1 134установок cloudkit-code-review Скилл cloudkit-code-review проверяет Swift-код на ошибки работы с CloudKit: зоны, батчи, обработку CKErrorPartialFailure и лимиты CKAsset. CX Codex +1 127установок prometheus-go-code-review Скилл prometheus-go-code-review для Claude Code проверяет Prometheus-метрики в Go: типы, лейблы, имена и регистрацию. Ревьюирует код с prometheus/client_golang. CX Codex +1 126установок review-skill-improver Скилл review-skill-improver для Claude Code анализирует журнал отзывов о код-ревью и предлагает правки к скиллам. Выявляет повторяющиеся причины отказов по оценкам ACCEPT и REJECT. CX Codex +1 125установок

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

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