编程代理插件
Archyl 开发者插件让您可以直接从编程代理(Claude Code、Codex 或任何兼容工具)管理整个 C4 架构模型。无需在编辑器和 Archyl 仪表板之间来回切换,您可以在终端中直接创建系统、容器、组件、ADR、合规规则等。
该插件是开源的,可在 github.com/archyl-com/agent-skills 获取。
功能概览
该插件为您的代理提供了对 Archyl 200 多个 MCP 工具的深度了解,涵盖以下领域:
| 领域 | 功能 |
|---|---|
| C4 建模 | 创建和管理系统、容器、组件、代码元素和关系 |
| 文档 | 架构决策记录、项目文档、用户/系统流程、AI 洞察 |
| 治理 | 合规规则、漂移检测、DORA 指标、所有权映射 |
| 运维 | 发布、环境、API 契约、事件通道、技术雷达 |
| 协作 | 评论、变更请求、白板、团队管理 |
| 历史 | 快照、时间回溯、架构差异对比、审计日志 |
| 集成 | Webhooks、市场小部件、全局架构视图 |
前置条件
- 拥有 API 访问权限的 Archyl 账户
- API 密钥(可在 Archyl 仪表板的设置 → API 密钥中获取)
- Claude Code、Codex 或兼容的编程代理
安装
第 1 步:添加市场
在 Claude Code 中运行以下命令:
/plugin marketplace add archyl-com/agent-skills
然后打开插件管理器配置自动更新:
- 运行
/plugin - 选择 Marketplaces
- 从列表中选择
archyl-marketplace - 选择 Enable auto-update 或 Disable auto-update
第 2 步:安装插件
/plugin install archyl-developer@archyl-com-agent-skills
安装后重启 Claude Code。
第 3 步:配置 MCP 服务器
将 Archyl MCP 服务器添加到项目的 .mcp.json 文件中:
{
"mcpServers": {
"archyl": {
"type": "http",
"url": "https://api.archyl.com/mcp",
"headers": {
"X-API-Key": "arch_your_api_key_here"
}
}
}
}
将 arch_your_api_key_here 替换为您在 Archyl 仪表板中获取的实际 API 密钥。
其他编程代理
该插件内容兼容任何支持插件格式的代理。您也可以直接使用仓库中 archyl-developer 插件目录 下的技能文件。
常见工作流
安装完成后,您可以用自然语言让编程代理执行架构任务。以下是一些常见工作流:
为新项目生成文档
让代理为您搭建架构模型:
Create a new Archyl project for our e-commerce platform.
Add the main systems: WebApp, PaymentService, and PostgreSQL Database.
Then create containers for the API server and React frontend inside WebApp.
代理将调用相应的 MCP 工具(create_project、create_system、create_container)并将所有内容连接起来。
分析现有架构
Get the full C4 model for my project and summarize the architecture.
Check the drift score — is the documentation still accurate?
Show me any open architecture insights.
执行架构规则
Create a conformance rule that prevents any container from having
more than 10 direct dependencies. Then run a conformance check.
记录架构决策
Create an ADR titled "Migrate from REST to gRPC for internal services".
Set it as proposed, explain the context around latency requirements,
and link it to the ApiGateway and PaymentService containers.
查看部署性能
Show me the DORA metrics for the last month.
What's our deployment frequency and lead time trend?
管理技术雷达
Show me the current technology radar.
Add "Temporal" as an adopted workflow orchestration technology
and tag it on the OrderProcessing container.
工作原理
该插件为编程代理提供了关于每个 Archyl MCP 工具的结构化知识,包括参数、预期值和最佳实践。当您要求代理执行架构任务时,它会:
- 识别需要调用的 MCP 工具
- 构造正确的参数(项目 ID、元素类型、关系类型)
- 将多个调用串联以完成复杂工作流
- 返回已创建或修改内容的摘要
代理始终会先调用 list_projects 来发现可用项目并获取后续操作所需的 projectId。
C4 模型参考
该插件理解 C4 模型的全部 4 个层级:
| 层级 | 元素 | 示例 |
|---|---|---|
| 1 | System | "Payment Platform"、"Email Service" |
| 2 | Container | "API Server"、"PostgreSQL Database"、"React Frontend" |
| 3 | Component | "AuthService"、"PaymentProcessor"、"UserRepository" |
| 4 | Code | "PaymentGateway interface"、"processPayment()" |
命名约定
代理在创建元素时遵循以下命名规则:
- Systems:PascalCase,描述性命名(
PaymentPlatform、NotificationService) - Containers:PascalCase 加类型提示(
ApiServer、PostgresDatabase、RedisCache) - Components:PascalCase,面向模块(
AuthService、PaymentProcessor) - Code Elements:使用源代码中的精确符号名称
关系类型
连接元素时,代理会使用适当的关系类型:
| 类型 | 使用场景 |
|---|---|
uses |
系统之间的一般依赖 |
calls |
同步 HTTP/gRPC 调用 |
sends_to / consumes_from |
异步消息传递(队列、事件) |
reads_from / writes_to |
数据库访问 |
implements / extends |
代码级别的继承 |
贡献
该插件是开源的。您可以通过以下方式贡献:
- 修复工具名称、参数或描述
- 为新的 Archyl 功能增加覆盖
- 改进工作流示例
- 为缺失的领域添加参考文件
详情请参阅贡献指南。