coordinating-multi-space-devops-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQuerying multiple AgentSpaces
多AgentSpace查询
Pre-flight
前期准备
If is not in your available tools, the remote MCP server is not connected. Tell the user to ask "help me set up the AWS DevOps Agent" so the skill auto-loads.
aws_devops_agent__list_agent_spacessetup-devops-agent如果你的可用工具中没有,说明远程MCP服务器未连接。请告知用户发送“help me set up the AWS DevOps Agent”,这样技能会自动加载。
aws_devops_agent__list_agent_spacessetup-devops-agentPrerequisite: SigV4 auth required
前提条件:需要SigV4认证
Multi-space routing requires SigV4 authentication — Bearer tokens are scoped to a single AgentSpace and cannot route to other spaces.
Many real teams run more than one AgentSpace — typically a production space, a staging space, and a dedicated "knowledge" space that holds runbooks shared across accounts. Each space has its own set of associated AWS accounts, runbooks, and history.
This skill is the routing brain. Use it when the user has multiple spaces configured, or when a question genuinely spans accounts.
多空间路由需要SigV4认证——Bearer令牌仅作用于单个AgentSpace,无法路由到其他空间。
许多实际团队会运行多个AgentSpace——通常包括一个生产环境空间、一个预发布环境空间,以及一个专门存储跨账户共享运行手册的“知识库”空间。每个空间都有自己关联的AWS账户、运行手册和历史记录。
本技能是路由核心。当用户配置了多个空间,或者问题确实涉及多个账户时,请使用本技能。
Discovering spaces
发现空间
aws_devops_agent__list_agent_spaces()
→ {"agentSpaces": [{"agentSpaceId": "as-abc123", "name": "prod"}, ...]}If only one space is returned, this skill doesn't apply — use or directly (no needed).
chatting-with-aws-devops-agentinvestigating-incidents-with-aws-devops-agentagent_space_idIf more than one is returned, decide whether the user's question is:
| Question shape | Strategy |
|---|---|
| Scoped to one environment ("prod is broken") | Single space — pick the matching one |
| Spans environments ("compare prod vs staging") | Parallel — query each, synthesize |
| Generic knowledge ("what runbooks do we have for ECS?") | Route to the knowledge space if one is named that way |
| Ambiguous ("our service is slow") | Ask the user which environment, don't guess |
aws_devops_agent__list_agent_spaces()
→ {"agentSpaces": [{"agentSpaceId": "as-abc123", "name": "prod"}, ...]}如果仅返回一个空间,则本技能不适用——直接使用或即可(无需指定)。
chatting-with-aws-devops-agentinvestigating-incidents-with-aws-devops-agentagent_space_id如果返回多个空间,请根据用户的问题类型决定策略:
| 问题类型 | 策略 |
|---|---|
| 针对单个环境(“生产环境出现故障”) | 单空间——选择匹配的空间 |
| 涉及多个环境(“对比生产和预发布环境”) | 并行查询——查询每个空间,综合结果 |
| 通用知识类问题(“我们有哪些ECS相关的运行手册?”) | 如果存在名为“知识库”的空间,则路由到该空间 |
| 模糊问题(“我们的服务运行缓慢”) | 询问用户具体是哪个环境,不要猜测 |
Per-session routing memory
会话内路由记忆
If the user has a routing guide stored locally (e.g. , , or per-project notes), read it once at the start of the session and use it as the routing table for the rest of the conversation. Format expected:
.claude/aws-agents-for-devsecops.mdAGENTS.mdmarkdown
| Space | AWS Profile | Agent Space ID | Purpose |
|-------|-------------|----------------|---------|
| prod | acme-prod | as-abc123 | Production incidents, customer-facing services |
| stage | acme-stage | as-def456 | Pre-prod validation, integration testing |
| kb | acme-shared | as-ghi789 | Shared runbooks, cross-account knowledge |If no guide exists, run discovery:
- → get all spaces.
aws_devops_agent__list_agent_spaces() - For each space: → get a one-paragraph summary.
aws_devops_agent__chat(message="Summarize the AWS accounts, services, and runbooks you have access to.", agent_space_id="<SPACE_ID>") - Offer to write the routing guide to the project (e.g. ,
.claude/aws-agents-for-devsecops.md, or per-project notes) so future sessions skip discovery.AGENTS.md
如果用户本地存储了路由指南(例如、或项目专属笔记),请在会话开始时读取一次,并将其作为整个对话的路由表。预期格式如下:
.claude/aws-agents-for-devsecops.mdAGENTS.mdmarkdown
| Space | AWS Profile | Agent Space ID | Purpose |
|-------|-------------|----------------|---------|
| prod | acme-prod | as-abc123 | Production incidents, customer-facing services |
| stage | acme-stage | as-def456 | Pre-prod validation, integration testing |
| kb | acme-shared | as-ghi789 | Shared runbooks, cross-account knowledge |如果没有路由指南,请执行以下发现步骤:
- → 获取所有空间。
aws_devops_agent__list_agent_spaces() - 对每个空间执行:→ 获取一段摘要。
aws_devops_agent__chat(message="Summarize the AWS accounts, services, and runbooks you have access to.", agent_space_id="<SPACE_ID>") - 提议将路由指南写入项目(例如、
.claude/aws-agents-for-devsecops.md或项目专属笔记),以便后续会话跳过发现步骤。AGENTS.md
Pattern A — Parallel queries, one synthesized answer
模式A——并行查询,生成综合答案
Use when the user wants a comparison: "compare prod and staging error rates", "is this issue happening in both accounts?", "audit costs across all our environments".
undefined当用户需要对比结果时使用:“对比生产和预发布环境的错误率”“这个问题是否在两个账户中都出现?”“审计所有环境的成本”。
undefined1. Query each space in parallel with environment-specific context
1. 并行查询每个空间,并提供环境特定上下文
aws_devops_agent__chat(message="<question> | env=prod | <prod IaC context>", agent_space_id="PROD_ID")
→ {"executionId": "...", "answer": "..."}
aws_devops_agent__chat(message="<question> | env=stage | <stage IaC context>", agent_space_id="STAGE_ID")
→ {"executionId": "...", "answer": "..."}
aws_devops_agent__chat(message="<question> | env=prod | <prod IaC context>", agent_space_id="PROD_ID")
→ {"executionId": "...", "answer": "..."}
aws_devops_agent__chat(message="<question> | env=stage | <stage IaC context>", agent_space_id="STAGE_ID")
→ {"executionId": "...", "answer": "..."}
2. Synthesize locally — present a side-by-side summary, not two separate dumps
2. 本地综合——提供并列摘要,而非两个独立的响应内容
**Don't just paste both responses.** Read both, identify what's the same vs. different, and tell the user the *delta* — that's the value.
**不要直接粘贴两个响应。**请阅读两者内容,找出相同点和不同点,并告知用户差异所在——这才是核心价值。Pattern B — Knowledge lookup, then per-space action
模式B——先查询知识库,再执行空间操作
Use when one space holds runbooks/knowledge that informs work in another space.
undefined当某个空间存储的运行手册/知识可指导其他空间的工作时使用。
undefined1. Ask the knowledge space first
1. 先询问知识库空间
aws_devops_agent__chat(
message="What's our standard runbook for ECS 503 errors?",
agent_space_id="KB_ID"
)
→ {"answer": "<runbook text>"}
aws_devops_agent__chat(
message="What's our standard runbook for ECS 503 errors?",
agent_space_id="KB_ID"
)
→ {"answer": "<runbook text>"}
2. Apply that runbook in the target environment
2. 在目标环境中应用该运行手册
aws_devops_agent__investigate(
title="ECS 503 errors on checkout-service. [Runbook from knowledge space] <runbook text> [Local context] ...",
agent_space_id="PROD_ID",
priority="HIGH"
)
The DevOps Agent doesn't share state between spaces — you bridge it by quoting the knowledge space's response into the investigation's `title`.aws_devops_agent__investigate(
title="ECS 503 errors on checkout-service. [Runbook from knowledge space] <runbook text> [Local context] ...",
agent_space_id="PROD_ID",
priority="HIGH"
)
DevOps Agent不会在不同空间之间共享状态——你需要将知识库空间的响应内容引用到调查的`title`字段中来实现桥接。Pattern C — Targeted single-space query
模式C——定向单空间查询
Use when the user explicitly names a space or environment.
undefined当用户明确指定某个空间或环境时使用。
undefinedPick the matching agentSpaceId from your routing memory, pass it on the call
从路由记忆中选择匹配的agentSpaceId,在调用时传入
aws_devops_agent__chat(message="<question>", agent_space_id="<matched_space_id>")
If the routing is ambiguous and the user doesn't say, **ask once** — better than firing into the wrong account.aws_devops_agent__chat(message="<question>", agent_space_id="<matched_space_id>")
如果路由存在歧义且用户未明确说明,请**询问一次**——总比选错账户要好。Pattern D — Investigations don't share state
模式D——调查任务不共享状态
Investigations are per-space. If an issue spans accounts, you may need two investigations:
aws_devops_agent__investigate(title="Latency spike — prod side", agent_space_id="PROD_ID", priority="HIGH")
aws_devops_agent__investigate(title="Latency spike — stage side", agent_space_id="STAGE_ID", priority="HIGH")Track both s. Poll both. Surface findings together.
taskIdThis is rare — usually one space owns the problem. Don't fan out by default.
调查任务是空间专属的。如果问题涉及多个账户,可能需要创建两个调查任务:
aws_devops_agent__investigate(title="Latency spike — prod side", agent_space_id="PROD_ID", priority="HIGH")
aws_devops_agent__investigate(title="Latency spike — stage side", agent_space_id="STAGE_ID", priority="HIGH")跟踪两个,轮询两者状态,并一起呈现调查结果。
taskId这种情况很少见——通常只有一个空间是问题的责任方。不要默认进行多空间扩散。
What NOT to do
禁止操作
- Don't blast every space with every question. It's slow, expensive, and the user has to read 3× as much output.
- Don't fan out without verifying scope. If a space's or recorded coverage doesn't mention the relevant service, skip it — sending a question into a scope-mismatched space typically hangs rather than returning "I don't know."
description - Don't fire investigations in parallel by default. They take 5–8 minutes each. Pick the one space that owns the incident.
- Don't silently switch spaces mid-conversation. If a follow-up needs a different space, tell the user: "Switching to the knowledge space to look up the runbook."
- **不要用每个问题轰炸所有空间。**这会很慢、成本高,而且用户需要阅读三倍的输出内容。
- **不要在未验证范围的情况下进行扩散。**如果某个空间的或记录的覆盖范围未提及相关服务,请跳过该空间——将问题发送到范围不匹配的空间通常会导致挂起,而不是返回“我不知道”。
description - **不要默认并行发起调查任务。**每个调查任务需要5-8分钟。请选择负责该事件的那个空间。
- **不要在对话中途悄悄切换空间。**如果后续问题需要切换到不同空间,请告知用户:“正在切换到知识库空间查找运行手册。”
Timeout guidance
超时指南
The tool buffers the full response server-side before returning. Complex cross-account queries can take 30-90s per space. If a space doesn't respond within 90s, it's likely a scope mismatch — surface a message like "Space X did not respond within 90s — skipping (likely scope mismatch)" and move on rather than hanging.
chatchatSee also
另请参阅
- for a fully worked scenario (prod incident with staging comparison and knowledge-space runbook lookup).
examples/multi-space-walkthrough.md - The skill for first-time configuration of multiple AgentSpaces, AWS profiles, and shell wrappers.
setup-devops-agent
- :完整的场景演示(生产环境事件,包含预发布环境对比和知识库空间运行手册查询)。
examples/multi-space-walkthrough.md - 技能:用于首次配置多个AgentSpace、AWS配置文件和Shell包装器。
setup-devops-agent