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

agents — команда для Claude Code: что делает и как установить

Команда создаёт AGENTS.md в подходящих папках репозитория, если таких файлов ещё нет. Она помогает записать для кодовых агентов команды сборки и тестов, структуру проекта и правила работы с кодом.

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

Что делает agents

Сначала команда проверяет репозиторий и выбирает папки для инструкций: корень, тесты, исходный код и каталоги с собственной конфигурацией сборки. Сгенерированный AGENTS.md описывает назначение папки, команды, тестирование, структуру, стиль кода и границы действий агента. В существующие файлы команда не вносит изменения.

Для каждой папки она собирает сведения из конфигураций сборки, CI, кода и README. Вложенные инструкции должны охватывать только свою папку, не повторяя корневой файл. Это важно для репозиториев с уже подготовленными инструкциями: существующий AGENTS.md будет пропущен, а не обновлён.

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

  • создать инструкции для кодовых агентов в корне репозитория
  • описать команды сборки и тестирования проекта
  • зафиксировать структуру папок и точки входа
  • задать границы действий агента для отдельных частей проекта

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

  • Создай AGENTS.md для подходящих папок этого репозитория, пропуская уже существующие файлы.
  • Изучи команды сборки и тестов и добавь их в инструкции для кодового агента.
  • Подготовь отдельные инструкции для tests/ и src/, если этих файлов там ещё нет.

Как установить agents

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

.claude/commands/deep-wiki-agents.md

Встроенная /agents перекрывает файл с тем же именем, поэтому файл назван иначе. Вызов — /deep-wiki-agents. Для всех проектов — ~/.claude/commands/

Вопросы о agents

Как установить agents в Claude Code?

Сохраните команду в .claude/commands/deep-wiki-agents.md.

Что делает команда agents?

Она анализирует папки репозитория и создаёт в подходящих местах AGENTS.md с командами, тестами, структурой проекта и правилами для агента. Уже существующие файлы пропускает.

Перезаписывает ли agents существующий AGENTS.md?

Нет. Команда проверяет наличие файла в каждой папке и пропускает папки, где AGENTS.md уже есть.

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

agents.md · MIT
---
description: Generate AGENTS.md files for pertinent repository folders — only where missing. Provides coding agents with build commands, testing instructions, code style, project structure, and boundaries.
---

# Deep Wiki: Generate AGENTS.md Files

You are a Technical Documentation Architect specializing in coding agent instructions. Generate tailored `AGENTS.md` files for pertinent folders in this repository.

## What is AGENTS.md

AGENTS.md complements README.md. While README is for human contributors, AGENTS.md provides the extra context coding agents need: build commands, test instructions, code conventions, and boundaries. It's a standard, predictable file that any coding agent can find and use.

**AGENTS.md ≠ Agent Personas.** This is NOT an agent persona file (like `.github/agents/*.agent.md`). AGENTS.md is project context — the instructions you'd give a new teammate.

## ⚠️ CRITICAL: Only Generate If Missing

**NEVER overwrite an existing AGENTS.md file.** For every folder:
1. Check if `AGENTS.md` exists (case-sensitive)
2. If YES → skip, report: "✅ AGENTS.md already exists in [folder] — skipping"
3. If NO → generate a new one

This is NON-NEGOTIABLE. Existing AGENTS.md files may have been carefully hand-crafted.

## Process

### Step 1: Identify Pertinent Folders

Scan the repository and identify folders that should have an AGENTS.md:

**Always include:**
- Repository root (`./`)

**Include if they exist:**
- `tests/` or `test/` — test suites
- `src/` — source code root
- `lib/` — library code
- `app/` or `apps/*/` — application code
- `api/` — API layer
- `packages/*/` — monorepo packages
- `services/*/` — microservices

**Include if they have their own build system:**
- Any folder with `package.json`, `pyproject.toml`, `Cargo.toml`, `*.csproj`, `go.mod`, `Makefile`

**Skip:**
- `node_modules/`, `dist/`, `build/`, `.git/`, `vendor/`, `__pycache__/`
- Generated output directories
- Folders with fewer than 3 source files (unless they have their own package config)

### Step 2: Analyze Each Folder

For each pertinent folder, gather:

1. **Language & Framework** — What language(s), what frameworks, what versions
2. **Build Commands** — Read `package.json` scripts, `Makefile` targets, `pyproject.toml` scripts, `Cargo.toml`, CI configs
3. **Test Commands** — How to run tests, test framework, how to run a single test
4. **Entry Points** — Main files, index files, app entry points
5. **Conventions** — Look at existing code for naming patterns, import styles, file organization
6. **CI/CD** — Check `.github/workflows/`, `Jenkinsfile`, `.gitlab-ci.yml` for commands
7. **Existing Documentation** — Read `README.md` in the folder (don't duplicate it — complement it)

### Step 3: Generate AGENTS.md for Each Folder

For each folder where AGENTS.md is missing, generate a file covering the **six core areas**:

#### Structure Template

```markdown
# [Project/Folder Name] — Agent Instructions

## Overview
[1-2 sentences about what this folder/project does and its role in the larger system]

## Build & Run Commands
[Put commands FIRST — agents reference these constantly]
- Build: `exact command with flags`
- Run: `exact command`
- Dev: `exact dev server command`
- Clean: `exact clean command`

## Testing
[Test framework, commands, single-test execution]
- Run all: `exact test command`
- Run one: `exact single test command`
- Coverage: `exact coverage command`
[Test conventions — where tests live, naming patterns]

## Project Structure
[Key directories and what they own — annotated tree]
[Entry points and where to add new features]

## Code Style
[Naming conventions — be specific]
[One real code example showing the project's actual style]

## Git Workflow
[Branch naming, PR format, pre-commit checks]

## Boundaries
- ✅ **Always do:** [safe operations the agent can freely perform]
- ⚠️ **Ask first:** [operations needing confirmation — schema changes, dependency additions]
- 🚫 **Never do:** [hard rules — commit secrets, modify vendor, touch production configs]

## Documentation
[If wiki/ directory or llms.txt exists, list them here]
- Wiki: `wiki/` — Generated documentation with architecture, onboarding, and API reference
- LLM Context: `llms.txt` — Quick project summary for LLMs (see also `wiki/llms-full.txt` for full content)
- Onboarding: `wiki/onboarding/` — Audience-tailored guides (contributor, staff engineer, executive, PM)
```

### Step 4: Root AGENTS.md vs Nested

**Root AGENTS.md** should cover:
- Overall project description and purpose
- Tech stack with versions
- Global dev environment setup
- Global conventions that apply everywhere
- Security considerations
- Links to key documentation

**Nested AGENTS.md** (e.g., `tests/`, `packages/foo/`) should cover:
- That specific folder's purpose and scope
- Folder-specific commands (test commands, build commands)
- Folder-specific conventions
- Should NOT repeat root-level content
- Should be concise — the root AGENTS.md handles the big picture

**Wiki AGENTS.md** (`wiki/AGENTS.md`) — Generate for the wiki folder if it doesn't already exist (same only-if-missing guard). Use this template:

```markdown
# Wiki — Agent Instructions

## Overview
Generated VitePress documentation site for this project. Contains architecture docs, onboarding guides, and API references with source-linked citations and dark-mode Mermaid diagrams.

## Build & Run Commands
- Install: `npm install`
- Dev server: `npm run dev`
- Build: `npm run build`
- Preview: `npm run preview`

## Wiki Structure
- `index.md` — Landing page with project overview and navigation
- `onboarding/` — Audience-tailored guides (contributor, staff engineer, executive, product manager)
- `{NN}-{section}/` — Numbered documentation sections
- `llms.txt` — LLM-friendly project summary (links + descriptions)
- `llms-full.txt` — LLM-friendly full content (inlined pages)
- `.vitepress/config.mts` — VitePress config with sidebar and Mermaid setup
- `.vitepress/theme/` — Dark theme (custom.css) and zoom handlers (index.ts)

## Content Conventions
- All Mermaid diagrams use dark-mode colors (fills `#2d333b`, borders `#6d5dfc`, text `#e6edf3`)
- Every page has VitePress frontmatter (`title`, `description`)
- Citations link to source repository with line numbers
- Tables include a "Source" column with linked citations
- Mermaid diagrams followed by `<!-- Sources: ... -->` comment blocks

## Boundaries
- ✅ **Always do:** Add new pages following existing section numbering, use dark-mode Mermaid colors
- ⚠️ **Ask first:** Change theme CSS, modify VitePress config, restructure sections
- 🚫 **Never do:** Delete generated pages without understanding dependencies, use light-mode colors, remove citation links

## Documentation
- Wiki: `./` — This folder is the wiki
- LLM Context: `llms.txt` — Quick summary; `llms-full.txt` — Full content
- Onboarding: `onboarding/` — Four audience-tailored guides
```

Adapt this template to the actual project — fill in the real section names, technologies, and any project-specific conventions.

### Step 5: Generate CLAUDE.md Companion Files

For every folder where you generated an `AGENTS.md`, also create a `CLAUDE.md` in the same folder — **only if `CLAUDE.md` does not already exist**.

The `CLAUDE.md` content is always exactly:

```markdown
# CLAUDE.md

<!-- Generated for repository development workflows. Do not edit directly. -->

Before beginning work in this repository, read `AGENTS.md` and follow all scoped AGENTS guidance.
```

This redirects Claude Code (and similar tools) to the authoritative `AGENTS.md`. Same only-if-missing guard applies.

### Step 6: Report

After processing all folders, output a summary:

```
## AGENTS.md Generation Report

### Created
- `./AGENTS.md` — Root project instructions
- `./CLAUDE.md` — Companion pointer to AGENTS.md
- `tests/AGENTS.md` — Test harness instructions
- `tests/CLAUDE.md` — Companion pointer to AGENTS.md

### Skipped (already exist)
- `src/AGENTS.md` — already exists
- `src/CLAUDE.md` — already exists

### Not applicable
- `dist/` — generated output (skipped)
```

## Quality Rules

1. **Specific > Generic** — "React 18 with TypeScript and Vite" not "React project"
2. **Commands first** — Put executable commands near the top of every AGENTS.md
3. **Code examples over prose** — One real code snippet beats three paragraphs
4. **Real paths only** — Reference actual files/directories in this repo
5. **No padding** — If the folder doesn't have tests, don't invent a testing section
6. **Grounded in evidence** — Every section comes from reading actual project files
7. **Concise** — AGENTS.md should be scannable, not a novel. Target 50-200 lines per file.

$ARGUMENTS

© microsoft · MIT · microsoft/skills

Похожие слэш-команды

Все слэш-команды по теме «Настройка агента: память, контекст, субагенты» →
feature-dev официальный Anthropic Сопровождает разработку новой функции: изучает кодовую базу, задаёт вопросы, предлагает архитектуру и ждёт подтверждения перед реализацией. 179установок security-hardening Seth Hobson Команда проводит аудит безопасности по этапам: сканирует уязвимости, строит threat model и проверяет архитектуру. Подходит для поэтапного hardening проекта. CX Codex 437установок status Seth Hobson Показывает состояние проекта Conductor, активные треки и следующие действия. Нужна, когда важно увидеть прогресс по задачам и блокеры. CX Codex 348установок ultra-think davila7 Запускает многошаговый разбор задачи: вскрывает скрытые допущения, предлагает конкурирующие варианты и проверяет каждый на прочность. Пригодится, когда решение дорогое и не хочется ошибиться. 8 383установок create-architecture-documentation davila7 Слэш-команда для Claude, которая собирает документацию по архитектуре проекта: диаграммы, ADR и описание компонентов. 6 136установок refactor-code davila7 Слэш-команда ведёт агента по 17 шагам рефакторинга: от анализа и тестов до проверки производительности и подготовки к ревью. 4 890установок

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

Весь набор →
deploy Команда создаёт GitHub Actions workflow для сборки и публикации сайта VitePress на GitHub Pages. Она также проверяет настройки base и наличие lock-файла. ★ 3 149звёзд репо crisp Генерирует компактную wiki по репозиторию и сразу собирает сайт на VitePress. Пригодится, когда нужна документация, а ждать долгую сборку не хочется. ★ 3 149звёзд репо catalogue Строит иерархическую структуру документации репозитория в JSON. Пригодится, когда нужен план wiki без генерации самих страниц. ★ 3 149звёзд репо build Команда build из набора Deep Wiki упаковывает готовые markdown-страницы вики в проект VitePress. Тёмная тема, диаграммы Mermaid в тёмном режиме, зум по клику на картинки и схемы. ★ 3 149звёзд репо wiki-architect Разбирает кодовую базу и собирает иерархический каталог документации со ссылками на файлы и строками. Плюс четыре гайда по онбордингу под разную аудиторию. ★ 3 149звёзд репо python-appservice-deploy Автоматизирует публикацию приложений на Python в Azure App Service Linux. Создаёт недостающую инфраструктуру и настраивает параметры запуска. ★ 3 149звёзд репо preset Скилл проверяет доступность Azure OpenAI в текущем регионе и предлагает другие регионы, если там нет ёмкости. Помогает выбрать модель и развернуть её. ★ 3 149звёзд репо customize Ведёт по шагам через развёртывание модели Azure OpenAI: версия, SKU, ёмкость, политика RAI и дополнительные параметры. Пригодится, когда нужен точный контроль над конфигурацией. ★ 3 149звёзд репо

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

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