agents
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgents
Agent 技能
Command-driven skill for building, diagnosing, and running agent systems (Cursor/Codex/Claude agents, Task/subagent trees, Trigger/durable workflows, custom orchestrators). Parse the first token as a command when it matches the table; otherwise map clear intent.
用于构建、诊断和运行Agent系统的命令驱动技能(Cursor/Codex/Claude agents、任务/子Agent树、触发器/持久化工作流、自定义编排器)。当第一个token匹配表格中的命令时,将其解析为命令;否则映射明确的意图。
Operating contract
操作契约
Shared by every DecisionNerd/dev-skills skill. Canonical copy: .
handbook/concepts/14-operating-contract.md- Define done first. Before using tools, write the finish line in one or two lines: the acceptance criteria (existing issue AC, BDD scenarios, tests, or contract when they exist; otherwise propose them and say where they should live) and the evidence that will prove them. Re-check it before reporting done. Never report done on work you did not verify.
- Requested scope sets the finish line. A question ("is it ready?", "why is it broken?", "what next?") ends with the answer and a line naming the exact next invoke. An outcome request ("fix", "finish", "land", "#42") continues through the chain (diagnose → fix → test → check-readiness → merge-it) until the outcome or a real blocker. Do not end a turn with "Do you want me to…?" for in-scope, in-repo work.
Next: - Stop only for real blockers. Stop and ask only when you cannot continue without the user, or before: deleting data or unmerged work, force-push or history rewrite, changing anything outside this repository (GitHub objects, deployments, live data, production or paid resources, external services), or leaving the requested scope, unless the user's request already named that exact action. Keep the harness's permission prompts for risky commands. Otherwise keep going and put status notes in the same message as the next action.
- Ask well, once. For a genuine question use the harness's structured question tool when it has one (Claude Code: ; Codex:
AskUserQuestionwhen the current mode supports it) with concrete options; otherwise plain text with numbered options. Treat the answer as settled; do not re-open earlier verdicts, plans, or answers unless asked.request_user_input - Fan out when work is parallel. Use subagents for independent reads (repo survey, evidence gathering, per-option research, per-area audits) and for independent verification (a reviewer that did not write the change). Writes stay single-owner per path set and sequential. Brief every child with goal, done-when, constraints, must-not, and return shape; verify each child's result before consolidating. Use Claude Code's tool only for orchestration across many subagents that truly needs it; it is expensive.
Workflow - Pick the model tier per child; defer to routing config. If the harness or user config already routes subagents (Claude Code or a CLAUDE.md rule; Codex
CLAUDE_CODE_SUBAGENT_MODELor a role'sagents.default_subagent_model; Cursor a custom subagent'sagents.<name>.config_filefrontmatter), follow it and do not pass a model. Otherwise: mechanical search or inventory → fast/cheap (Claude Codemodel:); implementation and evidence gathering → mid (haiku); planning, review, adversarial verification → top (sonnetoropus). In Claude Code set it with thefabletoolAgentparam or agent frontmattermodel; in Codex pass a spawn model or setmodel:in the role's config file; in Cursor setmodel(defaultmodel:) ininherit. Where the harness cannot choose, children inherit the parent model or the harness picks one (Cursor's built-in Explore/Bash/Browser subagents pick per subtask); say which in the status note..cursor/agents/*.md - Keep a checklist on long runs. For more than about five steps or work that crosses skills, keep at the repo root and tick items as they finish. Do not commit it unless the repo already tracks one.
TASKS.md - Close every run with three headings. (the one genuine question or blocker, else "none");
Blocked on me(files, commits, GitHub objects, deploys, else "nothing");Changed(evidence, verdict, andFound).Next: <exact invoke>
所有DecisionNerd/dev-skills技能通用。标准副本:。
handbook/concepts/14-operating-contract.md- 先定义完成标准。 使用工具前,用一两行写下终点线:验收标准(现有issue的AC、BDD场景、测试或契约(如果存在);否则提出验收标准并说明应存放的位置)以及证明完成的证据。在报告完成前重新检查。永远不要对未验证的工作报告完成。
- 请求范围决定终点线。 问题(“准备好了吗?”、“为什么坏了?”、“下一步是什么?”)以答案和明确下一次调用的行结束。结果请求(“修复”、“完成”、“落地”、“#42”)会沿着链条持续推进(诊断→修复→测试→就绪检查→合并)直到完成或遇到真正的阻塞。对于范围内的仓库内工作,不要以“你需要我…吗?”结束回合。
Next: - 仅因真正的阻塞才停止。 仅当没有用户就无法继续时,或在以下操作前才停止并询问:删除数据或未合并的工作、强制推送或历史重写、修改此仓库外的任何内容(GitHub对象、部署、实时数据、生产或付费资源、外部服务),或超出请求范围,除非用户的请求已经明确指定了该操作。对于风险命令,保留运行框架的权限提示。否则继续推进,并将状态说明与下一个操作放在同一条消息中。
- 一次问一次,问清楚。 对于真正的问题,如果运行框架有结构化提问工具(Claude Code:;Codex:当前模式支持时用
AskUserQuestion),则使用该工具并提供具体选项;否则使用带编号选项的纯文本。将答案视为最终结论;除非被要求,否则不要重新讨论之前的结论、计划或答案。request_user_input - 并行工作时采用扇出模式。 对于独立读取任务(仓库调研、证据收集、逐选项研究、分领域审计)和独立验证(未编写变更的评审者),使用子Agent。写入操作按路径集保持单所有者且顺序执行。为每个子Agent明确目标、完成条件、约束、禁止事项和返回格式;在合并前验证每个子Agent的结果。仅当确实需要跨多个子Agent编排时,才使用Claude Code的工具;它成本很高。
Workflow - 为每个子Agent选择模型等级;遵循路由配置。 如果运行框架或用户配置已经为子Agent配置了路由(Claude Code的或CLAUDE.md规则;Codex的
CLAUDE_CODE_SUBAGENT_MODEL或角色的agents.default_subagent_model;Cursor自定义子Agent的agents.<name>.config_file前置元数据),则遵循该配置,不要传递模型参数。否则:机械搜索或盘点→快速/低成本(Claude Codemodel:);实现和证据收集→中等(haiku);规划、评审、对抗性验证→顶级(sonnet或opus)。在Claude Code中,通过fable工具的Agent参数或Agent前置元数据的model设置;在Codex中,传递生成模型或在角色配置文件中设置model:;在Cursor中,在model中设置.cursor/agents/*.md(默认model:)。如果运行框架无法选择,子Agent继承父模型或由运行框架选择(Cursor内置的Explore/Bash/Browser子Agent会根据子任务选择);在状态说明中说明使用的模型。inherit - 长时间运行时保留检查清单。 对于超过约五个步骤或跨技能的工作,在仓库根目录保留,完成项目后打勾。除非仓库已经跟踪该文件,否则不要提交它。
TASKS.md - 每次运行结束时包含三个标题。 (一个真正的问题或阻塞,否则为“none”);
Blocked on me(文件、提交、GitHub对象、部署,否则为“nothing”);Changed(证据、结论和Found)。Next: <确切的调用命令>
Commands
命令
| Command | What it does |
|---|---|
| Emergency: stop stupid agent behavior and safely drain a dumb/runaway workflow |
| Read-only autopsy of agent config, prompts, tools, traces, failure modes |
| Improve latency, cost, reliability, tool use, and loop quality — with a measured plan |
| Design an agent (roles, tools, memory, handoffs, evals) before coding |
| Execute work via subagents (parallel/sequential Task agents) with a clear parent brief |
| List commands |
Aliases: → ; / / → prefer when the situation is emergency thrash.
subagentssubdrainstopkill-loopslapTarget: path to agent config / skill / workflow, run ID, PR/issue, or free-text symptom (“it keeps rewriting the same file”).
| 命令 | 功能 |
|---|---|
| 紧急处理:终止异常Agent行为,安全排空失控/空转工作流 |
| 对Agent配置、提示词、工具、链路追踪、故障模式进行只读深度剖析 |
| 通过可衡量的计划,改善延迟、成本、可靠性、工具使用和循环质量 |
| 在编码前设计Agent(角色、工具、内存、交接、评估) |
| 通过子Agent(并行/顺序任务Agent)执行工作,父Agent提供明确的任务说明 |
| 列出所有命令 |
别名: → ; / / → 当情况为紧急抖动时优先使用。
subagentssubdrainstopkill-loopslap目标:Agent配置/技能/工作流的路径、运行ID、PR/issue,或自由文本描述的症状(“它一直在重写同一个文件”)。
Routing
路由规则
- No argument: ask intent via the harness's structured question tool (Claude Code: ); options:
AskUserQuestion(something on fire),slap,analyze,optimize,design,sub.help - First word is a command: run it; remainder is target/context.
- Clear intent (“emergency stop this agent”, “design a code-review agent”, “use subagents to explore”): map and proceed.
- Active runaway loop / dumb workflow burning tokens: default to even if the user only said “fix the agents”.
slap
Mutating production workflows, killing remote runs, or deleting agent state requires explicit approval unless the user already ordered that exact action. Prefer pause/drain over hard kill when both are possible.
- 无参数:通过运行框架的结构化提问工具询问意图(Claude Code:);选项:
AskUserQuestion(紧急情况)、slap、analyze、optimize、design、sub。help - 第一个词是命令:执行该命令;其余部分为目标/上下文。
- 意图明确(“紧急停止这个Agent”、“设计一个代码评审Agent”、“使用子Agent进行探索”):映射到对应命令并继续。
- 存在失控循环/空转工作流消耗token:即使用户只说“修复Agent”,也默认使用****。
slap
修改生产工作流、终止远程运行或删除Agent状态需要明确批准,除非用户已经明确要求该操作。如果暂停/排空和强制终止都可行时,优先选择暂停/排空。
slap
— emergency fix + safe drain
slapslap
— 紧急修复 + 安全排空
slapUse when an agent is thrashing, looping, spamming tools, rewriting the same files, ignoring instructions, or a durable/workflow run is producing junk. Follow references/slap.md.
Goals, in order:
- Stabilize — stop further damage (pause run, cancel queued steps, freeze writes).
- Drain — let in-flight safe work finish or abort cleanly; no orphan locks/partial deploys.
- Contain — revert or quarantine bad agent edits if they landed.
- Slap — name the stupid behavior in one blunt sentence + the smallest durable fix (prompt/guardrail/tool allowlist/max-steps).
- Handoff — for root cause,
analyze/optimizefor lasting change,designif product code broke.fix-it
Do not start a new mega-agent to “fix” the runaway. Parent stays in charge; subagents only for narrow read-only recon if needed.
当Agent出现抖动、循环、频繁调用工具、重写相同文件、忽略指令,或者持久化/工作流运行产生垃圾输出时使用。遵循references/slap.md。
目标按顺序如下:
- 稳定 — 阻止进一步损害(暂停运行、取消排队步骤、冻结写入)。
- 排空 — 让进行中的安全工作完成或干净地中止;不留孤儿锁/部分部署。
- 遏制 — 如果不良Agent编辑已经落地,则回滚或隔离这些编辑。
- — 用一句直白的话点明异常行为 + 最小的持久化修复方案(提示词/护栏/工具白名单/最大步骤数)。
slap - 交接 — 用查找根本原因,用
analyze/optimize进行持久化改进,如果产品代码损坏则用design修复。fix-it
不要启动一个新的大型Agent来“修复”失控问题。父Agent保持掌控全局;仅在需要时使用子Agent进行有限的只读侦察。
analyze
analyzeanalyze
analyzeRead-only. Produce:
- Surface — what agent(s), which harness (Cursor Task, Codex, Trigger, custom), entry prompts/skills.
- Behavior — observed loops, tool misuse, missing context, contradictory instructions.
- Evidence — logs/traces/transcripts/run IDs; cite concrete steps.
- Failure modes — ranked: loop, context rot, tool hallucination, scope creep, unsafe writes.
- Verdict — keep / redesign / slap-then-optimize.
- Next — exact follow-up (,
agents optimize …,agents design …).agents slap …
Details: references/analyze.md.
只读操作。输出内容:
- 表层信息 — 涉及的Agent、运行框架(Cursor Task、Codex、Trigger、自定义)、入口提示词/技能。
- 行为表现 — 观察到的循环、工具误用、上下文缺失、矛盾指令。
- 证据 — 日志/链路追踪/对话记录/运行ID;引用具体步骤。
- 故障模式 — 按优先级排序:循环、上下文腐烂、工具幻觉、范围蔓延、不安全写入。
- 结论 — 保留 / 重新设计 / 先slap再优化。
- 下一步 — 确切的后续操作(、
agents optimize …、agents design …)。agents slap …
详情:references/analyze.md
optimize
optimizeoptimize
optimizeOnly after you know what is bad ( first unless the user already provided a sharp diagnosis). Propose a small numbered plan (prompt splits, tool narrowing, caching, evals, step limits, model routing). Implement in-repo prompt and config changes; ask only before production-workflow or paid changes. Prefer measurable wins (fewer steps, fewer retries, clearer success criteria).
analyzeDetails: references/optimize.md.
仅在你知道问题所在后执行(除非用户已经提供了明确的诊断,否则先执行)。提出一个小型的编号计划(提示词拆分、工具范围收窄、缓存、评估、步骤限制、模型路由)。实现仓库内的提示词和配置变更;仅在生产工作流或付费变更前询问。优先选择可衡量的改进(更少的步骤、更少的重试、更清晰的成功标准)。
analyze详情:references/optimize.md
design
designdesign
designArchitecture before code. Output a short design: goal, inputs/outputs, tools (allow/deny), memory, success criteria, failure/escalation, whether to use fan-out, eval plan. Scaffolding is a separate step — end with rather than asking. Prefer one sharp agent over a swarm.
subNext: scaffold <name>Details: references/design.md.
先架构后编码。输出一份简短的设计:目标、输入/输出、工具(允许/拒绝)、内存、成功标准、故障/升级机制、是否使用扇出、评估计划。脚手架搭建是单独的步骤 — 以结束,而不是询问。优先选择一个精准的Agent,而非一群Agent。
subNext: scaffold <name>详情:references/design.md
sub
/ sub-agents
subsub-agentssub
/ sub-agents
subsub-agentsParent agent orchestrates; children do bounded work. Follow references/sub.md.
Rules:
- Write a crisp parent brief: goal, constraints, done-when, tools allowed, what not to do.
- Prefer parallel explore/research children; keep write/mutate work sequential or single-owned.
- Never give two subagents overlapping write ownership of the same files.
- Verify each child’s result before consolidating; do not rubber-stamp contradictory child plans.
- Aggregate verified results; parent decides.
- If children thrash → , don’t spawn more.
slap
父Agent编排;子Agent执行有边界的工作。遵循references/sub.md。
规则:
- 编写清晰的父任务说明:目标、约束、完成条件、允许使用的工具、禁止事项。
- 优先使用并行的探索/研究子Agent;写入/修改工作保持顺序执行或单所有者。
- 永远不要给两个子Agent分配相同文件的重叠写入权限。
- 在合并前验证每个子Agent的结果;不要直接批准相互矛盾的子Agent计划。
- 汇总验证后的结果;由父Agent决定。
- 如果子Agent出现抖动 → 执行****,不要生成更多子Agent。
slap
Output
输出
Close every run with:
Blocked on me: (production/paid change awaiting approval, or "none")
Changed: (files, config changes, GitHub objects, else "nothing")
Found: (analysis verdict, plan, or design). Next: `<exact follow-up invoke>`.每次运行结束时输出:
Blocked on me: (production/paid change awaiting approval, or "none")
Changed: (files, config changes, GitHub objects, else "nothing")
Found: (analysis verdict, plan, or design). Next: `<exact follow-up invoke>`.Related skills
相关技能
- Product/backend bugs: /
diagnose-bug/troubleshoot-app(do not usefix-itas the primary cut for deterministic compute or UI data-plane bugs)agents - Tests / evals as success criteria: (regime C)
test-it - Traces/scores in prod: (Langfuse house default for LLM)
observe-it - Docs for agents/humans: (surgical)
document-it - Options before design:
research-it - Repo situational awareness:
recon
- 产品/后端bug:/
diagnose-bug/troubleshoot-app(对于确定性计算或UI数据平面bug,不要将fix-it作为主要手段)agents - 作为成功标准的测试/评估:(质量模式C)
test-it - 生产环境的链路追踪/评分:(LLM默认使用Langfuse)
observe-it - Agent/人类文档:(精准式)
document-it - 设计前的选项调研:
research-it - 仓库态势感知:
recon
Grounding
基础依据
This skill’s TTPs are grounded in current engineering baselines (DORA, GitHub Docs, Fowler/Beck, Google SRE & SWE book, OpenTelemetry, OWASP LLM / NIST AI RMF, Diátaxis — see handbook ).
sources.mdAnthropic: keep agents simple and evaluable. OWASP LLM: bound tools/agency; NIST AI RMF: measure before optimize. Use to drain runaway loops (excessive agency). Parallel explore / sequential mutate for sub-agents. This is quality regime C — design for traces + evals (Langfuse house default), not unit-test theater ().
slaphandbook/concepts/11-quality-regimes.mdHandbook card: .
handbook/practices/design-agents.md本技能的TTP基于当前工程基线(DORA、GitHub Docs、Fowler/Beck、Google SRE与SWE书籍、OpenTelemetry、OWASP LLM / NIST AI RMF、Diátaxis — 参见手册)。
sources.mdAnthropic原则:保持Agent简单且可评估。OWASP LLM原则:限制工具/代理权限;NIST AI RMF原则:先衡量再优化。使用排空失控循环(过度代理)。子Agent采用并行探索/顺序修改模式。这属于质量模式C — 为链路追踪+评估设计(默认使用Langfuse),而非单元测试形式主义()。
slaphandbook/concepts/11-quality-regimes.md手册卡片:。
handbook/practices/design-agents.md