> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 可扩展性概览

> 使用规则、技能、插件、子 Agent、MCP 服务器和钩子自定义并扩展 Devin CLI，或从其他工具导入配置。

Devin CLI 设计为高度可定制。你可以通过项目或主目录中的配置文件，定义 Agent 的行为方式、它可访问的工具，以及它如何响应事件。

> [card] [规则与 AGENTS.md](https://docs.devin.ai/zh/cli/extensibility/rules.md)
>
> 提供始终生效的上下文和指示，在每次会话中引导 Agent 的行为。

> [card] [技能](https://docs.devin.ai/zh/cli/extensibility/skills/overview.md)
>
> 创建可复用的提示和工作流程，Agent 可以将其作为斜杠命令调用，或自主使用。

> [card] [插件](https://docs.devin.ai/zh/cli/extensibility/plugins/overview.md)
>
> 在各个项目间安装和共享技能包。

> [card] [自定义子 Agent](https://docs.devin.ai/zh/cli/subagents.md#custom-subagents)
>
> 定义专门的子 Agent Profile，并为其配置各自的系统提示、工具和模型。

> [card] [MCP 服务器](https://docs.devin.ai/zh/cli/extensibility/mcp/overview.md)
>
> 连接外部工具服务器，让 Agent 能够访问 API、数据库等资源。

> [card] [钩子](https://docs.devin.ai/zh/cli/extensibility/hooks/overview.md)
>
> 在 Agent 生命周期的关键节点运行 shell 命令或 LLM 提示，以强制执行策略并自动化工作流程。

***

## 它们如何协同配合

这些功能在不同层面发挥作用：

* **规则** 决定 Agent 的行为风格和约束条件——始终保持生效。
* **技能** 为 Agent 提供可按需调用的新能力。
* **自定义子 Agent** 定义专门的工作者配置，Agent 可以将任务交给它们处理。
* **MCP 服务器** 为 Agent 提供可调用的全新工具。
* **钩子** 会在生命周期事件中运行 shell 命令或 LLM 提示 (例如在工具运行前) ，以强制执行策略或触发工作流程。

你可以在同一个项目中组合使用这些功能。例如，你可以有一个包含编码规范的 `AGENTS.md` 文件、一个用于代码审查的 `review` 技能、一个用于 issue 跟踪器的 MCP 服务器，以及用于阻止破坏性命令的 钩子。

***

## 配置存放位置

所有项目级扩展配置都存放在你项目根目录下的 `.devin/` 目录中：

```
my-project/
├── .devin/
│   ├── config.json             # Project config (permissions, imports)
│   ├── config.local.json       # Personal overrides (gitignored)
│   ├── mcp_config.json         # Project MCP servers
│   ├── mcp_config.local.json   # Personal MCP servers and secrets (gitignored)
│   ├── hooks.v1.json           # Lifecycle 钩子 (Claude Code compatible)
│   ├── skills/
│   │   └── review/
│   │       └── SKILL.md        # A custom skill
│   └── agents/
│       └── reviewer.md         # 自定义子 Agent 的 Profile（reviewer/AGENT.md 同样有效）
├── AGENTS.md                   # Project rules
└── src/
```

用户级配置存放在 `~/.config/devin/` 中，适用于所有项目。在 Windows 上，此路径则为 `%APPDATA%\devin\`。

> [!TIP]
>
> 文件名中包含 `.local.` 的文件会自动被 Git 排除，因此你可以使用个人覆盖设置，而不会影响你的团队。

***

## 从其他工具导入

Devin CLI 可以读取你可能已在使用的其他 AI 编程工具中的配置：

| Source | 导入内容 |
| - | - |
| `AGENTS.md` / `AGENT.md` / `CLAUDE.md` | 规则 (始终生效的上下文) |
| `.cursor/rules/*.md` / `.cursor/rules/*.mdc` | 规则 |
| `.windsurf/rules/*.md` | 规则 |
| `.claude/` directory | 命令、[自定义子 Agent](https://docs.devin.ai/zh/cli/subagents.md#custom-subagents)、[钩子](https://docs.devin.ai/zh/cli/extensibility/hooks/overview.md) |
| `.github/skills/` (GitHub Copilot) | 技能 |
| `opencode.json` (OpenCode) | MCP 服务器 |
| `.zed/settings.json` (Zed) | MCP 服务器 |

这意味着你无需重写现有配置即可开始使用 Devin CLI。导入默认启用，并且可在配置文件中控制：

```json theme={null}
{
  "read_config_from": {
    "cursor": true,
    "windsurf": true,
    "claude": true,
    "copilot": true,
    "opencode": true,
    "zed": true
  }
}
```

将任意提供程序设为 `false`，即可禁用从该提供程序导入。有关每个提供商密钥以及源文件的完整列表，请参阅 [Configuration Import](https://docs.devin.ai/zh/cli/reference/configuration/read-config-from.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.