Loading...
Loading...
Compare original and translation side by side
tmp/tmp/<skill-folder>/agents/<skill-folder>/agents/INDEX.md<skill-folder>/agents/<skill-folder>/agents/INDEX.md| Category | Count | Examples |
|---|---|---|
| Language Implementation | 22 | python-pro, golang-pro, rust-pro, typescript-pro |
| Web Frameworks | 10 | react-pro, nextjs-pro, django-pro, fastapi-pro |
| Architecture & Design | 9 | backend-architect, api-designer, microservices-architect |
| DevOps & Infrastructure | 11 | devops-engineer, kubernetes-architect, cloud-architect |
| Security | 6 | security-reviewer, penetration-tester, threat-modeling-pro |
| Database | 5 | postgres-pro, sql-pro, database-architect |
| Testing & Quality | 5 | code-reviewer, tdd-guide, test-automator |
| AI & ML | 5 | ai-engineer, ml-engineer, prompt-engineer |
| Frontend & Mobile | 5 | frontend-developer, ios-pro, ui-designer |
| Documentation | 7 | documentation-pro, technical-writer, docs-architect |
| Incident & Troubleshooting | 4 | incident-responder, debugger, devops-troubleshooter |
| Specialized | 22 | build-engineer, cli-developer, product-manager, web-searcher, etc. |
| 分类 | 数量 | 示例 |
|---|---|---|
| 语言实现 | 22 | python-pro, golang-pro, rust-pro, typescript-pro |
| Web框架 | 10 | react-pro, nextjs-pro, django-pro, fastapi-pro |
| 架构与设计 | 9 | backend-architect, api-designer, microservices-architect |
| DevOps与基础设施 | 11 | devops-engineer, kubernetes-architect, cloud-architect |
| 安全 | 6 | security-reviewer, penetration-tester, threat-modeling-pro |
| 数据库 | 5 | postgres-pro, sql-pro, database-architect |
| 测试与质量 | 5 | code-reviewer, tdd-guide, test-automator |
| AI与机器学习 | 5 | ai-engineer, ml-engineer, prompt-engineer |
| 前端与移动 | 5 | frontend-developer, ios-pro, ui-designer |
| 文档 | 7 | documentation-pro, technical-writer, docs-architect |
| 事件与故障排查 | 4 | incident-responder, debugger, devops-troubleshooter |
| 专业领域 | 22 | build-engineer, cli-developer, product-manager, web-searcher, etc. |
knowledge.mdsession.mdmemory.shknowledge.mdsession.md| Question | Use |
|---|---|
| Will this help in future sessions? | Knowledge |
| Current task only? | Session |
| Discovered a gotcha/pattern/config? | Knowledge |
| Tracking todos/progress/blockers? | Session |
memory.shknowledge.mdsession.mdknowledge.mdsession.md| 问题 | 使用场景 |
|---|---|
| 这对未来会话有帮助吗? | Knowledge |
| 仅用于当前任务? | Session |
| 发现了陷阱/模式/配置? | Knowledge |
| 跟踪待办事项/进度/阻塞点? | Session |
./<skill-folder>/tools/memory.sh add <category> "<content>" [--tags a,b,c]| Category | Save When |
|---|---|
| System design, service connections, ports |
| Bugs, pitfalls, non-obvious behavior |
| Code conventions, recurring structures |
| Environment settings, credentials |
| Important classes, functions, APIs |
| Why choices were made |
| New findings about codebase |
| Long-term tasks to remember |
| Useful links, documentation |
| Background info, project context |
--tags redis,production,authsearch "<query>"list [--category CAT]delete <id>stats./<skill-folder>/tools/memory.sh add <category> "<content>" [--tags a,b,c]| 分类 | 保存时机 |
|---|---|
| 系统设计、服务连接、端口 |
| 漏洞、陷阱、非明显行为 |
| 代码规范、重复结构 |
| 环境设置、凭证 |
| 重要类、函数、API |
| 选择背后的原因 |
| 关于代码库的新发现 |
| 需要记住的长期任务 |
| 有用的链接、文档 |
| 背景信息、项目上下文 |
--tags redis,production,authsearch "<query>"list [--category CAT]delete <id>statsplantodoprogressnotecontextdecisionblockerpendingin_progresscompletedblocked./<skill-folder>/tools/memory.sh session add todo "Task" --status pending
./<skill-folder>/tools/memory.sh session show # View current
./<skill-folder>/tools/memory.sh session update <id> --status completed
./<skill-folder>/tools/memory.sh session delete <id>
./<skill-folder>/tools/memory.sh session clear # Current only
./<skill-folder>/tools/memory.sh session clear --all # ALL sessionsplantodoprogressnotecontextdecisionblockerpendingin_progresscompletedblocked./<skill-folder>/tools/memory.sh session add todo "Task" --status pending
./<skill-folder>/tools/memory.sh session show # 查看当前会话
./<skill-folder>/tools/memory.sh session update <id> --status completed
./<skill-folder>/tools/memory.sh session delete <id>
./<skill-folder>/tools/memory.sh session clear # 仅清除当前会话
./<skill-folder>/tools/memory.sh session clear --all # 清除所有会话-SMEMORY_SESSION<skill-folder>/current_session"default"./<skill-folder>/tools/memory.sh session use feature-auth # Switch session
./<skill-folder>/tools/memory.sh -S other session add todo "..." # One-off
./<skill-folder>/tools/memory.sh session sessions # List all-SMEMORY_SESSION<skill-folder>/current_session"default"./<skill-folder>/tools/memory.sh session use feature-auth # 切换会话
./<skill-folder>/tools/memory.sh -S other session add todo "..." # 单次切换
./<skill-folder>/tools/memory.sh session sessions # 列出所有会话web_search.shcurlwget./<skill-folder>/tools/web_search.sh "query"<skill-folder>/tools/web_search.batweb_search.sh-s--max-results--sci--med--tech/web_search.shcurlwget./<skill-folder>/tools/web_search.sh "query"<skill-folder>/tools/web_search.batweb_search.sh-s--max-results--sci--med--tech/assemble-prompt.shspawn-glm.shwait-glm.shTasksubagent_typeassemble-prompt.shspawn-glm.shwait-glm.shTasksubagent_type<skill-folder>/agents/.mdspawn-glm.sh<skill-folder>/agents/*.mdassemble-prompt.sh.md.md.md.mdassemble-prompt.shspawn-glm.sh<skill-folder>/agents/.mdspawn-glm.sh<skill-folder>/agents/*.mdassemble-prompt.sh.md.md.md.mdassemble-prompt.shspawn-glm.sh./<skill-folder>/tools/memory.sh search "GLM-CONTINUATION"tmp/glm-continuation.md<skill-folder>/templates/planner-task-template.txtassemble-prompt.sh -a agentic-planner -t research -n s0-planner-mtmp/glm-plan.mdtmp/glm-plan.mdWRITABLE FILES: tmp/glm-plan.mdassemble-prompt.sh -a agent-organizer -t review -n s0-organize-mtmp/glm-plan.mdtmp/glm-plan.mdtmp/glm-plan.md./<skill-folder>/tools/memory.sh search "GLM-CONTINUATION"tmp/glm-continuation.md<skill-folder>/templates/planner-task-template.txtassemble-prompt.sh -a agentic-planner -t research -n s0-planner-mtmp/glm-plan.mdtmp/glm-plan.mdWRITABLE FILES: tmp/glm-plan.mdassemble-prompt.sh -a agent-organizer -t review -n s0-organize-mtmp/glm-plan.mdtmp/glm-plan.mdtmp/glm-plan.md.mdassemble-prompt.shspawn-glm.shdebuggerresearch-analystspawn-glm.sh.mdassemble-prompt.shspawn-glm.shdebuggerresearch-analystspawn-glm.sh<skill-folder>/agents/INDEX.mdspawn-glm.shadversarial-reviewer.mdadversarial-reviewer.md| CONFIRMED | REJECTED | WEAKENED |
|---|---|---|
| → fix list | → dropped | severity downgraded → fix list at lower priority |
FIX SKIPPED: Zero MEDIUM+ verified findings — nothing to fix.<skill-folder>/agents/INDEX.mdspawn-glm.shadversarial-reviewer.mdadversarial-reviewer.md| CONFIRMED | REJECTED | WEAKENED |
|---|---|---|
| → 修复列表 | → 丢弃 | 严重程度降级 → 低优先级修复列表 |
FIX SKIPPED: Zero MEDIUM+ verified findings — nothing to fix.<skill-folder>/tools/spawn-glm.sh -n NAME -f PROMPT_FILE [-m MODEL] [--pi]-m-m MODEL--piSPAWNED|name|pid|log_filetmp/{NAME}-report.mdtmp/{NAME}-log.txttmp/{NAME}-status.txt.cmd-m-m| Stage Type | Description |
|---|---|
| Plan (always runs) | Planner researches and produces the plan. Organizer (agent-organizer) reviews the plan, applies fixes, produces final plan. All use default model. |
| Discovery (review, research, audit, analysis) | Specialist agent with dedicated context focused on one domain. When a stage has independent subtasks (different files, modules, concerns), spawn one agent per subtask — as many as the task naturally decomposes into, maximum 10 in parallel. At MEDIUM+ severity: second opinion agent runs in parallel with complementary specialist |
| Implementation (write code) | Single agent writes code directly to original files. For multi-domain changes, one agent per domain writes to respective files in parallel. |
| Review (after implementation or fix) | Reviews implementation or fix for bugs, quality, correctness. Every implementation and every fix MUST be followed by a review agent. At MEDIUM+ severity: second opinion agent runs in parallel with language specialist |
| Fixing (fix verified findings) | Applies known fixes mechanically. Fix ALL confirmed findings from the synthesis grid. Every fix MUST be followed by a post-fix review agent. |
| Adversarial verification (falsification) | For CRITICAL/HIGH findings — 1 agent per finding (1:1). For MEDIUM findings — 1 agent per batch of 5 findings. Both use exhaustive falsification: read cited code, search for counter-evidence at every level (same function, caller, framework, type system, tests). Label CONFIRMED / REJECTED / WEAKENED with evidence. Extraction and synthesis agents also default model. |
| Test (build + test suite) | Runs build and test commands, fixes compilation/test failures, reports results. |
| Quick-fix (minor finishing, reverts) | Short, informal fix for workflow-internal issues — fixing broken agent output or reverting incorrect edits. Not a substitute for the planning pipeline. No verification. If wrong, escalate to full IMPLEMENT → REVIEW → VERIFY. |
<skill-folder>/tools/wait-glm.sh name1:$PID1 name2:$PID2 name3:$PID3waitsleepname:pid<skill-folder>/tools/spawn-glm.sh -n NAME -f PROMPT_FILE [-m MODEL] [--pi]-m-m MODEL--piSPAWNED|name|pid|log_filetmp/{NAME}-report.mdtmp/{NAME}-log.txttmp/{NAME}-status.txt.cmd-m-m| 阶段类型 | 描述 |
|---|---|
| Plan(始终运行) | 规划者研究并生成计划。Organizer(agent-organizer)审查计划、应用修复、生成最终计划。均使用默认模型。 |
| Discovery(审查、研究、审计、分析) | 专注于单一领域的专业Agent。当阶段有独立子任务(不同文件、模块、关注点)时,每个子任务生成一个Agent——与任务自然分解数量相同,并行最多10个。MEDIUM及以上严重程度:第二意见Agent与互补专家 |
| Implementation(编写代码) | 单个Agent直接将代码写入原始文件。对于跨领域更改,每个领域一个Agent并行写入各自的文件。 |
| Review(实现或修复后) | 审查实现或修复的漏洞、质量、正确性。每个实现和每个修复都必须跟随一个审查Agent。MEDIUM及以上严重程度:第二意见Agent与语言专家 |
| Fixing(修复已验证发现结果) | 机械应用已知修复。修复合成网格中的所有已确认发现结果。每个修复都必须跟随一个修复后审查Agent。 |
| Adversarial verification(证伪) | 对于CRITICAL/HIGH发现结果——每个发现结果一个Agent(1:1)。对于MEDIUM发现结果——每5个发现结果一个Agent。均使用全面证伪:读取引用代码、在各个层面搜索反证(相同函数、调用者、框架、类型系统、测试)。用证据标记CONFIRMED / REJECTED / WEAKENED。提取和合成Agent也使用默认模型。 |
| Test(构建+测试套件) | 运行构建和测试命令、修复编译/测试失败、报告结果。 |
| Quick-fix(小幅度完善、回滚) | 针对工作流内部问题的简短、非正式修复——修复损坏的Agent输出或回滚不正确的编辑。不能替代规划管道。无需验证。如果错误,升级为完整IMPLEMENT → REVIEW → VERIFY。 |
<skill-folder>/tools/wait-glm.sh name1:$PID1 name2:$PID2 name3:$PID3waitsleepname:pidtmp/glm-plan.mdundefinedtmp/glm-plan.mdundefined
The planner selects from the following bricks. Skipped bricks are noted as `SKIPPED: [reason]`. **Do NOT wait for user approval — output the plan and proceed immediately.**
规划者从以下组件中选择。跳过的组件标记为`SKIPPED: [理由]`。**不要等待用户批准——输出计划并立即继续。**PLAN Always FULL (2 agents: planner + organizer, both default model).
No variants. Never skipped. Bad plan poisons everything downstream.
Planner (agentic-planner) researches and produces the plan. Organizer (agent-organizer) reviews and fixes in-place — the organizer's output IS the final plan.
DISCOVER Pre-change analysis — review/audit existing code before making changes.
├── NONE Required for size=tiny — nothing to discover on changes this small.
│ Required for size=small when the planner traced the complete code
│ path and identified the exact fix location with file:line citations
│ — no open questions remain. Justify with specific research findings.
│ If the planner cannot state "Root cause at [file:line], fix is
│ [approach]" with concrete evidence, the NONE bar is not met.
├── SINGLE 1 agent per domain. Use for medium+ tasks, or small tasks
│ where open questions remain after planning research.
│ At MEDIUM+ severity: +1 second opinion agent per domain (parallel).
│ Default pair: domain specialist (primary) + code-reviewer (second opinion) — planner may override based on task context.
└── MULTI N agents, one per domain. Split by specialist → volume.
At MEDIUM+: each domain gets a second opinion agent.
When the task spans 2+ domains with non-trivial coupling (see
Boundary Selection Criteria below), the planner adds intersection
discovery agents to the DISCOVER batch. An intersection agent
audits the integration boundary between two adjacent domains —
tracing the full data/error/call flow across the divide,
verifying contracts hold at the boundary, and identifying
mismatches in data format, error semantics, or transactional
consistency. This is distinct from second opinions: second
opinions apply a different analytical lens to the SAME domain;
intersection agents trace the boundary BETWEEN different domains
where coupling creates defect-prone blind spots invisible to
either domain specialist alone. Intersection findings are tagged
"boundary-found" in extraction — signaling issues no within-domain
specialist could have detected. CRITICAL/HIGH findings from
intersection discovery are routed through cross-domain adversarial
verification (1:1 per finding, verifying from both sides of the
boundary). Intersection agents MUST be placed in the first DISCOVER
stage — never deferred to CONVERGE iterations. CONVERGE inherits
the intersection requirement but adds ADDITIONAL agents with
different specialists, not replacements for the first-stage ones.
Intersection agents run in parallel with domain primaries and
second opinions within the same stage. At MEDIUM+ severity: each
intersection agent gets its own second opinion (a different
specialist from the INDEX, not the same type as the intersection
agent). Intersection agents audit gaps between domains — second
opinions audit the intersection audit itself for missed concerns.
The planner selects the best agent for each boundary based on
domain context. Suggested defaults (planner's selection is
authoritative — these are starting points, not mandates):
`backend-architect` for data flow and contract tracing;
`security-reviewer` for crypto/auth boundaries. The planner
may choose any agent from the INDEX that fits the boundary.
IMPLEMENT Write or modify code.
├── NONE No code change (analysis-only, cosmetic-only).
├── SINGLE 1 agent per domain. Writes code directly to original files.
│ Standard for all code changes.
└── MULTI N agents, one per domain. Split by specialist → volume.
SINGLE for narrow single-domain changes; MULTI for changes
spanning multiple specialists. Line count is not the measure —
split by domain diversity, not file count.
REVIEW Review code changes.
├── NONE Skip: change type=cosmetic AND severity=none.
│ Or: IMPLEMENT=NONE.
├── SINGLE 1 agent per domain. Standard.
│ At MEDIUM+ severity: +1 second opinion agent per domain (parallel).
│ Default pair: code-reviewer (primary) + language specialist (second opinion) — planner may override based on task context.
│ When the task spans 2+ domains using DIFFERENT specialists,
│ the planner adds cross-domain integration reviewers to the
│ REVIEW batch (see Boundary Selection Criteria for triage —
│ same ALWAYS/DEFAULT/SKIP tiers apply). These agents focus
│ ONLY on integration points: API contracts, shared types,
│ data flow between domains, and regressions at boundaries from
│ implementation changes. Do NOT re-review domain-internal logic.
│ Post-implementation intersection review is critical: domain
│ reviewers see new methods as correct within their context;
│ only tracing the full boundary reveals regressions where error
│ contracts, data formats, or transactional ordering differ from
│ what the caller expects. Findings from cross-domain integration
│ review are routed through adversarial cross-verification (1:1
│ per CRITICAL/HIGH finding, verifying from both sides).
└── MULTI N agents, one per domain.
VERIFY Verify findings from DISCOVER, REVIEW, or post-fix review.
Always includes extraction (1 agent, default model). Tags findings
"both-found"/"single-found" when originating stage had second opinion,
and "boundary-found"/"domain-only" when intersection agents were present.
Routes findings by severity:
CRITICAL/HIGH → ADVERSARIAL AGENT (1 agent per finding — 1:1)
Adversarial agent tries to FALSIFY every finding: reads cited code
with full surrounding context (minimum 30 lines), exhaustively
searches for counter-evidence at every level (same function guards,
caller-level validation, framework-level protections — middleware,
decorators, interceptors, global error handlers — type system
invariants, test coverage). Labels each CONFIRMED / REJECTED /
WEAKENED with evidence. For CONFIRMED: describe what patterns
were searched, which grep commands were run, why nothing was found.
For REJECTED: paste exact counter-evidence code with file:line.
For WEAKENED: paste partial counter-evidence AND explain what
portion of the original claim still stands.
Default position: assume the claimed issue is a misunderstanding and search exhaustively before confirming. For "missing X" findings, searching for X and finding it in no reachable code path IS valid evidence — document all searched locations. Findings that survive
exhaustive falsification become ADVERSARIALLY VERIFIED.
CRITICAL/HIGH from intersection or cross-domain integration review
(any finding spanning domain boundaries, regardless of whether
it originated in DISCOVER or REVIEW) → ADVERSARIAL CROSS AGENT
(1 agent per finding — 1:1). Same exhaustive falsification but verifies
from BOTH sides of the integration boundary (Domain A producer +
Domain B consumer + bridge between them). Finding only survives
if no counter-evidence on either side or in the bridge.
MEDIUM → ADVERSARIAL AGENT (1 agent per batch of 5 findings)
Same exhaustive falsification methodology as CRITICAL/HIGH —
reads cited code with full surrounding context (minimum 30
lines), exhaustively searches for counter-evidence at every
level (same function guards, caller-level validation,
framework-level protections, type system invariants, test
coverage). Labels each CONFIRMED / REJECTED / WEAKENED with
evidence. Default position: assume the claimed issue is a
misunderstanding and search exhaustively before confirming.
Every CONFIRMED label must be hard-won with grep evidence.
LOW → NOTED. Recorded in report. No further agent spend.
After routing: SYNTHESIS (1 agent, default model) compiles all
verdicts into unified grid. Surfaces "both-found" confidence signals.
Unified vocabulary: CONFIRMED / REJECTED / WEAKENED.
Also sanity-checks severity assignments against the severity
classification criteria — if a finding's severity appears mismatched
(e.g., "SQL injection" labeled MEDIUM), flag it as CHALLENGED.
Challenged findings are re-routed through adversarial verification.
Exception: documentation-domain challenged findings skip
adversarial — documentation severity is inherently subjective
(is "10 missing API docs" HIGH or MEDIUM?) and adversarial
review of severity ratings adds no meaningful verification.
Documentation-domain challenged findings stay at their
challenged severity; the lead accepts the downgrade directly.
Early-exit: 0 findings after extraction → skip synthesis.
Always runs when DISCOVER, REVIEW, or post-fix review produced findings with code-level references.
When CONFIRMED findings exist at MEDIUM+, FIX=DOMAINS must follow.
CONVERGE Repeat DISCOVER or REVIEW for additional passes. Planner decides variant.
Factors: ambiguity, codebase complexity, finding volume, production impact,
change type, time sensitivity.
NONE: One pass. For well-understood, narrow work. Also appropriate
for codebases with comprehensive test coverage (>80%) and
clean module boundaries — first pass is unlikely to miss
meaningful issues.
ONCE: One extra iteration if first pass found anything ("found
anything" means any iter 1 agent reported at least one
finding — regardless of whether it survived adversarial
verification; the point is different iter 2 specialists
re-examine what iter 1 noticed). Use when
the planner's Phase 1 research reveals interconnected modules,
dense coupling, non-uniform code patterns, or >15K LOC per
domain — characteristics suggesting a first pass may miss
issues. Also used when severity is HIGH/CRITICAL regardless
of codebase quality (missed findings are expensive). ONCE is
NOT the universal default — well-tested, cleanly-structured
codebases should use NONE.
LOOP: Up to 3 iterations, stop on empty report. For highly ambiguous
or production-critical work where missed findings would be
unacceptable.
Iterations inherit ALL mandatory rules from the parent stage type
(second opinions at MEDIUM+, intersection agents at triaged boundaries,
DISCOVER/REVIEW → VERIFY pipeline, etc.). Intersection agents inherited
by CONVERGE are ADDITIONAL agents, not replacements — the first DISCOVER
stage must have its own intersection agents for ALWAYS/DEFAULT boundaries;
CONVERGE iter 2 adds fresh intersection agents with different specialists.
Each iteration gets its own VERIFY stage. Iter 1's VERIFY runs BEFORE
iter 2 spawns — the synthesis grid from iter 1's VERIFY determines
whether iter 2 spawns (any finding = spawn) AND provides PRIOR CONTEXT
for iter 2 agents. Do NOT merge both iterations' verification into a
single stage after both iterations complete. The plan structure must be:
Stage N: DISCOVER iter 1
Stage N+1: VERIFY iter 1
Stage N+2: DISCOVER iter 2 (conditional, PRIOR CONTEXT from N+1)
Stage N+3: VERIFY iter 2
The planner must list all agents per iteration with different
specialists from the previous iteration — the lead spawns
whatever the plan lists. Before writing iter 2, the planner MUST
list every agent `.md` file used in iter 1 and exclude them all
from iter 2 — no agent may appear in any role in both iterations.
Swapping primary and second opinion roles between iterations does
NOT count as different specialists. Using the same pair of agent
`.md` files in opposite roles is still the same analytical
framework. The exclusion list must be explicit in the plan.
FIX Apply verified findings. Always 2-3 sequential stages — includes post-fix review.
When DOMAINS: 1 fix agent per domain → post-fix REVIEW
(same variant/domain split as the REVIEW stage), then VERIFY
if any post-fix review report contains at least one finding at
MEDIUM severity or above. A finding is any numbered item with a
severity label and code reference (file:line, function, or block)
in a reviewer's report. The lead does NOT re-classify, downgrade,
or exclude findings — the reviewer's filed severity is authoritative.
VERIFY is skipped ONLY when ALL post-fix review reports contain
zero MEDIUM+ findings. Mechanical trigger, no judgment.
CONVERGENCE: If post-fix VERIFY produces CONFIRMED MEDIUM+
findings in the synthesis grid, the fix is incomplete. Spawn a new
fix pass (fix agents → post-fix review → conditional verify) for
the confirmed findings. This repeats until post-fix review
produces zero MEDIUM+ findings and VERIFY is skipped. The FIX
brick is a convergence loop — one pass is never final when
MEDIUM+ findings survive verification. Documented findings marked
"for follow-up action" are still unfixed MEDIUM+ findings — fix
them now, not later.
├── NONE No verified findings.
└── DOMAINS 1 fix agent per domain → post-fix REVIEW → conditional VERIFY.
TEST Run build + test suite. Always single agent, default model (mechanical).
├── NONE IMPLEMENT=NONE. Or planner skips with justification (no test infra).
└── FULL 1 agent. Runs build + tests, fixes failures.PLAN 始终完整运行(2个Agent:规划者 + 组织者,均使用默认模型)。
无变体。永远不能跳过。糟糕的计划会影响下游所有环节。
规划者(agentic-planner)研究并生成计划。组织者(agent-organizer)审查并就地修复——组织者的输出即为最终计划。
DISCOVER 变更前分析——在进行变更前审查/审计现有代码。
├── NONE 当size=tiny时必需——如此小的变更无需发现。
│ 当size=small且规划者追踪了完整代码路径并确定了确切的修复位置(带file:line引用)时必需——无未解决问题。用具体研究结果证明。
│ 如果规划者不能用具体证据说明“根本原因在[file:line],修复方法是[方案]”,则不满足NONE条件。
├── SINGLE 每个领域1个Agent。用于中等及以上任务,或规划研究后仍有未解决问题的小型任务。
│ MEDIUM及以上严重程度:每个领域+1个第二意见Agent(并行)。
│ 默认组合:领域专家(主) + code-reviewer(第二意见)——规划者可根据任务上下文覆盖。
└── MULTI N个Agent,每个领域一个。按专家 → 容量拆分。
MEDIUM及以上:每个领域有一个第二意见Agent。
当任务跨越2个及以上具有非琐碎耦合的领域(请参阅下文的Boundary Selection Criteria)时,规划者在DISCOVER批次中添加交叉发现Agent。交叉Agent审计两个相邻领域之间的集成边界——追踪跨边界的完整数据/错误/调用流,验证边界处的契约是否成立,并识别数据格式、错误语义或事务一致性的不匹配。这与第二意见不同:第二意见对**同一**领域应用不同的分析视角;交叉Agent追踪**不同**领域之间的边界,耦合在此处创建了领域专家单独无法发现的易缺陷盲点。交叉发现结果在提取中标记为“boundary-found”——表示领域专家无法检测到的问题。交叉发现的CRITICAL/HIGH结果通过跨领域对抗性验证路由(每个发现结果1:1,从边界两侧验证)。交叉Agent必须放在第一个DISCOVER阶段——永远不要推迟到CONVERGE迭代。CONVERGE继承交叉要求,但添加**额外**的不同专家Agent,而非替换第一阶段的Agent。
交叉Agent与领域主Agent和第二意见在同一阶段并行运行。MEDIUM及以上严重程度:每个交叉Agent有自己的第二意见(来自INDEX的不同专家,而非与交叉Agent相同类型)。交叉Agent审计领域之间的差距——第二意见审计交叉审计本身是否遗漏了关注点。
规划者根据领域上下文为每个边界选择最佳Agent。建议默认值(规划者的选择具有权威性——这些是起点,而非强制要求):
`backend-architect`用于数据流和契约追踪;
`security-reviewer`用于加密/认证边界。规划者可以选择INDEX中适合边界的任何Agent。
IMPLEMENT 编写或修改代码。
├── NONE 无代码变更(仅分析、仅 cosmetic)。
├── SINGLE 每个领域1个Agent。直接将代码写入原始文件。
│ 所有代码变更的标准方式。
└── MULTI N个Agent,每个领域一个。按专家 → 容量拆分。
SINGLE用于狭窄的单领域变更;MULTI用于跨越多个专家的变更。行数不是衡量标准——按领域多样性拆分,而非文件数量。
REVIEW 审查代码变更。
├── NONE 跳过:变更类型=cosmetic且severity=none。
│ 或:IMPLEMENT=NONE。
├── SINGLE 每个领域1个Agent。标准方式。
│ MEDIUM及以上严重程度:每个领域+1个第二意见Agent(并行)。
│ 默认组合:code-reviewer(主) + 语言专家(第二意见)——规划者可根据任务上下文覆盖。
│ 当任务跨越2个及以上使用**不同**专家的领域时,规划者在REVIEW批次中添加跨领域集成审查者(请参阅Boundary Selection Criteria进行分类——相同的ALWAYS/DEFAULT/SKIP层级适用)。这些Agent仅关注集成点:API契约、共享类型、领域间数据流以及实现变更在边界处的回归。不要重新审查领域内部逻辑。
│ 实现后交叉审查至关重要:领域审查者认为新方法在其上下文中是正确的;只有追踪完整边界才能发现错误契约、数据格式或事务顺序与调用者预期不同的回归。跨领域集成审查的发现结果通过对抗性跨验证路由(每个CRITICAL/HIGH发现结果1:1,从两侧验证)。
└── MULTI N个Agent,每个领域一个。
VERIFY 验证DISCOVER、REVIEW或修复后审查的发现结果。
始终包括提取(1个Agent,默认模型)。当源阶段有第二意见Agent时,标记发现结果为"both-found"/"single-found";当存在交叉Agent时,标记为"boundary-found"/"domain-only"。
按严重程度路由发现结果:
CRITICAL/HIGH → 对抗性Agent(每个发现结果1个Agent —— 1:1)
对抗性Agent尝试证伪每个发现结果:读取引用代码及其完整上下文(至少30行),在各个层面全面搜索反证(相同函数保护、调用者级验证、框架级保护——中间件、装饰器、拦截器、全局错误处理、类型系统不变量、测试覆盖率)。用证据标记每个CONFIRMED / REJECTED /
WEAKENED。对于CONFIRMED:描述搜索的模式、运行的grep命令、未找到的原因。
对于REJECTED:粘贴带有file:line的确切反证代码。
对于WEAKENED:粘贴部分反证并解释原始主张的哪些部分仍然成立。
默认立场:假设主张的问题是误解,在确认前进行全面搜索。对于“缺少X”的发现结果,搜索X并在所有可达代码路径中未找到X是有效证据——记录所有搜索位置。通过全面证伪幸存的发现结果成为ADVERSARIAL VERIFIED。
来自交叉或跨领域集成审查的CRITICAL/HIGH结果
(任何跨领域边界的发现结果,无论来自DISCOVER还是REVIEW) → 对抗性跨领域Agent
(每个发现结果1个Agent —— 1:1)。相同的全面证伪,但从集成边界的**双方**验证(领域A生产者 +
领域B消费者 + 两者之间的桥梁)。只有当双方或桥梁中都没有反证时,发现结果才会幸存。
MEDIUM → 对抗性Agent(每5个发现结果1个Agent)
与CRITICAL/HIGH相同的全面证伪方法——读取引用代码及其完整上下文(至少30
行),在各个层面全面搜索反证(相同函数保护、调用者级验证、框架级保护、类型系统不变量、测试覆盖率)。用证据标记每个CONFIRMED / REJECTED / WEAKENED。默认立场:假设主张的问题是误解,在确认前进行全面搜索。
每个CONFIRMED标签都必须通过grep证据努力获得。
LOW → NOTED。记录在报告中。不消耗更多Agent资源。
路由后:合成(1个Agent,默认模型)将所有裁决编译为统一网格。显示"both-found"置信度信号。
统一词汇:CONFIRMED / REJECTED / WEAKENED。
还根据严重程度分类标准检查严重程度分配是否合理——如果发现结果的严重程度不匹配(例如“SQL注入”标记为MEDIUM),则标记为CHALLENGED。
CHALLENGED发现结果重新通过对抗性验证路由。例外:文档领域的CHALLENGED发现结果跳过对抗性验证——文档严重程度本质上是主观的(“10个缺失的API文档”是HIGH还是MEDIUM?),对严重程度评级的对抗性审查不会增加有意义的验证。
文档领域的CHALLENGED发现结果保持其挑战后的严重程度;主导者直接接受降级。
提前退出:提取后0个结果 → 跳过合成。
当DISCOVER、REVIEW或修复后审查产生带代码引用的发现结果时,始终运行。
当存在MEDIUM及以上的CONFIRMED发现结果时,必须跟随FIX=DOMAINS。
CONVERGE 重复DISCOVER或REVIEW以进行额外的检查。规划者决定变体。
因素:模糊性、代码库复杂性、发现结果数量、生产影响、变更类型、时间敏感性。
NONE:一次检查。用于理解充分、范围狭窄的工作。也适用于测试覆盖率全面(>80%)且模块边界清晰的代码库——首次检查不太可能遗漏有意义的问题。
ONCE:如果首次检查发现任何问题,则进行一次额外迭代(“发现任何问题”指任何迭代1的Agent报告了至少一个发现结果——无论是否通过对抗性验证;重点是不同的迭代2专家重新检查迭代1注意到的内容)。当规划者第一阶段研究发现互连模块、紧密耦合、非统一代码模式或每个领域>15K LOC时使用——这些特征表明首次检查可能遗漏问题。也用于严重程度为HIGH/CRITICAL的情况,无论代码库质量如何(遗漏发现结果代价高昂)。ONCE不是通用默认值——测试充分、结构清晰的代码库应使用NONE。
LOOP:最多3次迭代,当报告为空时停止。用于高度模糊或生产关键工作,遗漏发现结果不可接受。
迭代继承父阶段类型的所有强制规则(MEDIUM及以上的第二意见要求、分类边界的交叉Agent、DISCOVER/REVIEW → VERIFY管道等)。CONVERGE继承的交叉Agent是**额外**的Agent,而非替换——第一个DISCOVER阶段必须为ALWAYS/DEFAULT边界有自己的交叉Agent;
CONVERGE迭代2添加具有不同专家的新交叉Agent。
每次迭代有自己的VERIFY阶段。迭代1的VERIFY在迭代2生成**之前**运行——迭代1 VERIFY的合成网格决定是否生成迭代2(任何发现结果=生成)并为迭代2 Agent提供PRIOR CONTEXT。不要将两次迭代的验证合并到两次迭代完成后的单个阶段。计划结构必须是:
阶段N: DISCOVER迭代1
阶段N+1: VERIFY迭代1
阶段N+2: DISCOVER迭代2(条件,来自N+1的PRIOR CONTEXT)
阶段N+3: VERIFY迭代2
规划者必须列出每次迭代的所有Agent,且与前一次迭代的专家不同——主导者生成计划列出的所有Agent。在编写迭代2之前,规划者必须列出迭代1中使用的每个Agent `.md`文件,并将它们全部排除在迭代2之外——没有Agent可以在两次迭代中担任任何角色。
在迭代之间交换主Agent和第二意见角色不算不同专家。使用相同的Agent `.md`文件对担任相反角色仍然是相同的分析框架。排除列表必须在计划中明确。
FIX 应用已验证的发现结果。始终为2-3个顺序阶段——包括修复后审查。
当DOMAINS:每个领域1个修复Agent → 修复后REVIEW
(与REVIEW阶段相同的变体/领域拆分),然后如果任何修复后审查报告包含至少一个MEDIUM及以上严重程度的发现结果,则进行VERIFY。发现结果是审查者报告中带有严重程度标签和代码引用(file:line、函数或块)的任何编号项。主导者不得重新分类、降级或排除发现结果——审查者记录的严重程度具有权威性。
仅当所有修复后审查报告都包含零个MEDIUM+发现结果时,才跳过VERIFY。机械触发,无需判断。
收敛:如果修复后VERIFY在合成网格中产生CONFIRMED MEDIUM+
发现结果,则修复不完整。为已确认的发现结果生成新的修复过程(修复Agent → 修复后审查 → 条件验证)。重复此过程,直到修复后审查产生零个MEDIUM+发现结果并跳过VERIFY。FIX组件是收敛循环——当MEDIUM+发现结果通过验证时,一次修复永远不是最终的。标记为“待后续行动”的已记录发现结果仍然是未修复的MEDIUM+发现结果——现在修复,而非以后。
├── NONE 无已验证发现结果。
└── DOMAINS 每个领域1个修复Agent → 修复后REVIEW → 条件VERIFY。
TEST 运行构建+测试套件。始终为单个Agent,默认模型(机械操作)。
├── NONE IMPLEMENT=NONE。或规划者有理由跳过(无测试基础设施)。
└── FULL 1个Agent。运行构建+测试,修复失败。| Level | Criteria |
|---|---|
| None | No functional impact. Comment, formatting, variable rename. |
| Low | Minor, immediately reversible. Dev tooling, internal logging, tests. |
| Medium | User-facing, visible but contained. UI component, new endpoint, feature. |
| High | Core product function, data mutation, could break key flows. Payment, auth, database writes, primary user flows, data model changes. |
| Critical | Product outage, data loss, severe production bugs, irreversible damage. Secret exposure, SQL injection, data deletion, auth bypass, production crash, corrupt state. |
validatePassword| 级别 | 标准 |
|---|---|
| None | 无功能影响。注释、格式、变量重命名。 |
| Low | 轻微,可立即逆转。开发工具、内部日志、测试。 |
| Medium | 用户可见,影响有限。UI组件、新端点、功能。 |
| High | 核心产品功能、数据变更,可能破坏关键流程。支付、认证、数据库写入、主要用户流程、数据模型变更。 |
| Critical | 产品 outage、数据丢失、严重生产漏洞、不可逆损坏。密钥泄露、SQL注入、数据删除、认证绕过、生产崩溃、状态损坏。 |
validatePasswordswift-pro<skill-folder>/agents/INDEX.mdswift-pro<skill-folder>/agents/INDEX.md| Tier | Criteria | Action |
|---|---|---|
| ALWAYS | Two persistence mechanisms at boundary; OR data format/encoding transformation at boundary; OR error contract differs from caller expectation; OR 5+ cross-boundary call sites across 3+ modules | Add intersection agent to DISCOVER and REVIEW |
| DEFAULT | Multiple cross-boundary call sites; moderate coupling; multi-module boundary | Add intersection agent to DISCOVER and REVIEW |
| SKIP | Boundary bridged by a single well-understood mediator class; OR <3 cross-boundary call sites; OR well-documented established pattern (e.g., standard library protocol layer) | Skip — domain primaries + second opinions sufficient |
| 层级 | 标准 | 行动 |
|---|---|---|
| ALWAYS | 边界处有两种持久化机制;或边界处有数据格式/编码转换;或错误契约与调用者预期不同;或3个及以上模块中有5个及以上跨边界调用点 | 在DISCOVER和REVIEW中添加交叉Agent |
| DEFAULT | 多个跨边界调用点;中等耦合;多模块边界 | 在DISCOVER和REVIEW中添加交叉Agent |
| SKIP | 边界由单个易于理解的中介类桥接;或<3个跨边界调用点;或有完善文档的既定模式(例如标准库协议层) | 跳过——领域主Agent + 第二意见足够 |
| Size | Criteria |
|---|---|
| tiny | Single file, single change, under 10 lines. Trivial fix, no structural impact. |
| small | Single module, few files. Well-scoped change with clear boundaries. Under ~20 files and ~5K LOC. |
| medium | Multiple modules, cross-file changes. Moderate scope, may touch different concerns. Under ~20 files and ~5K LOC. |
| large | Exceeds ~20 files OR ~5K LOC in any domain, OR spans multiple specialist domains (different languages/frameworks). Requires volume splitting. |
size=tinysize=smallmediumlarge| 规模 | 标准 |
|---|---|
| tiny | 单个文件,单个变更,少于10行。琐碎修复,无结构影响。 |
| small | 单个模块,少数文件。范围明确的变更,边界清晰。少于 |
| medium | 多个模块,跨文件变更。中等范围,可能涉及不同关注点。少于 |
| large | 任何领域超过 |
size=tinysize=smallmediumlarge Stage N: Implementation — 1 agent per domain
Agent writes code directly to original files.
Stage N+1: Review — 1 agent per domain
Reviews the implementation for bugs, quality, correctness.
Stage N+2: Verification — severity-routed (extraction → adversarial [CRITICAL/HIGH 1:1, MEDIUM 1 per 5] → synthesis) Stage N: Fixes — N agents split by domain
Stage N+1: Post-fix review — N agents (1 per domain)
Stage N+2: Verification — severity-routed (only if fix review found MEDIUM+ findings)<skill-folder>/agents/INDEX.mdPRIOR CONTEXT:tmp/glm-plan.md-mspawn-glm.shtmp/glm-plan.md Stage N agents:
Batch 1 (parallel): agent-a (writes X.swift), agent-b (writes Y.swift)
Batch 2 (after batch 1): agent-c (tests X.swift, depends on agent-a)findrm -f tmp/glm-plan.mdfind tmp/ -maxdepth 1 \( -name 'stage-*-synthesis.md' -o -name 'stage-*-iter-*-synthesis.md' -o -name 's[0-9]*-task.txt' -o -name 's[0-9]*-prompt.txt' -o -name 's[0-9]*-status.txt' -o -name 's[0-9]*-report.md' -o -name 'plan-review-*' \) -deletels tmp/echo "# Session Memory" > session.mdtmp/*-report.mdtmp/*-log.txtlog-analysis-report.mdtmp/loop-runs/s{digit}...s1-researchers2i1-reviewer-r2tmp/s[0-9]* 阶段N: 实现 —— 每个领域1个Agent
Agent直接将代码写入原始文件。
阶段N+1: 审查 —— 每个领域1个Agent
审查实现的漏洞、质量、正确性。
阶段N+2: 验证 —— 按严重程度路由(提取 → 对抗性验证 [CRITICAL/HIGH 1:1,MEDIUM每5个1个] → 合成) 阶段N: 修复 —— 按领域拆分的N个Agent
阶段N+1: 修复后审查 —— N个Agent(每个领域1个)
阶段N+2: 验证 —— 按严重程度路由(仅当修复审查发现MEDIUM+发现结果时)<skill-folder>/agents/INDEX.mdPRIOR CONTEXT:tmp/glm-plan.mdspawn-glm.sh-mtmp/glm-plan.md 阶段N的Agent:
批次1(并行): agent-a(写入X.swift), agent-b(写入Y.swift)
批次2(批次1之后): agent-c(测试X.swift,依赖于agent-a)findrm -f tmp/glm-plan.mdfind tmp/ -maxdepth 1 \( -name 'stage-*-synthesis.md' -o -name 'stage-*-iter-*-synthesis.md' -o -name 's[0-9]*-task.txt' -o -name 's[0-9]*-prompt.txt' -o -name 's[0-9]*-status.txt' -o -name 's[0-9]*-report.md' -o -name 'plan-review-*' \) -deletels tmp/echo "# Session Memory" > session.mdtmp/*-report.mdtmp/*-log.txtlog-analysis-report.mdtmp/loop-runs/s{digit}...s1-researchers2i1-reviewer-r2tmp/s[0-9]*<skill-folder>/agents/INDEX.mdWRITABLE FILESMUST ANSWER:tmp/{name}-task.txttmp/{NAME}-report.md<skill-folder>/tools/assemble-prompt.sh -a AGENT -t TYPE -n NAME --task tmp/{name}-task.txtreviewcoderesearch{NAME}tmp/{name}-prompt.txtASSEMBLED|name|path|bytesdebuggerresearch-analysts1-researchers2-impl-auth<skill-folder>/agents/INDEX.mdWRITABLE FILESMUST ANSWER:tmp/{name}-task.txttmp/{NAME}-report.md<skill-folder>/tools/assemble-prompt.sh -a AGENT -t TYPE -n NAME --task tmp/{name}-task.txtreviewcoderesearch{NAME}tmp/{name}-prompt.txtASSEMBLED|name|path|bytesdebuggerresearch-analysts1-researchers2-impl-auth-m.mdsN-names1-reviewers2i1-researcherundefined-msN-names1-reviewers2i1-researcherundefined
**Prompt assembly:** Assemble ONE prompt per agent via `assemble-prompt.sh`:
```bash
<skill-folder>/tools/assemble-prompt.sh -a AGENT -t TYPE -n NAME --task tmp/task.txtreviewcoderesearchundefined
**提示组装:** 通过`assemble-prompt.sh`为每个Agent组装一个提示:
```bash
<skill-folder>/tools/assemble-prompt.sh -a AGENT -t TYPE -n NAME --task tmp/task.txtreviewcoderesearchundefined
**Naming convention overview:**
- Plan: `s0-planner`, `s0-organize`
- Discovery: `sN-discover-{domain}`, `sN-discover-2-{domain}` (second opinion),
`sN-discover-{domainA}-{domainB}` (intersection, e.g., `s1-discover-crypto-services`)
- Implementation: `sN-impl-{domain}`, `sN-review-{domain}`, `sN-review-2-{domain}` (second opinion),
`sN-review-{domainA}-{domainB}` (intersection, e.g., `s6-review-crypto-services`)
- Verification: `sN-extract`, `sN-adv-{domain}` (adversarial — 1:1 for CRITICAL/HIGH, 1 per 5 for MEDIUM), `sN-adv-cross` (cross-domain adversarial), `sN-synth`
- Fix: `sN-fix-{domain}`
- Test: `sN-test`
- Iterations: `s{N}i{K}-name` (e.g., `s2i1-researcher`, `s2i2-researcher`)
- Respawns: add `-r2`, `-r3` suffix when re-spawning a failed agent with corrected configuration (e.g., `s2i1-reviewer-r2` = stage 2 iteration 1 reviewer, respawn attempt 2). Maximum 3 respawn attempts per agent.
**命名约定概述:**
- 计划:`s0-planner`, `s0-organize`
- 发现:`sN-discover-{domain}`, `sN-discover-2-{domain}`(第二意见),
`sN-discover-{domainA}-{domainB}`(交叉,例如`s1-discover-crypto-services`)
- 实现:`sN-impl-{domain}`, `sN-review-{domain}`, `sN-review-2-{domain}`(第二意见),
`sN-review-{domainA}-{domainB}`(交叉,例如`s6-review-crypto-services`)
- 验证:`sN-extract`, `sN-adv-{domain}`(对抗性——CRITICAL/HIGH为1:1,MEDIUM为每5个1个), `sN-adv-cross`(跨领域对抗性), `sN-synth`
- 修复:`sN-fix-{domain}`
- 测试:`sN-test`
- 迭代:`s{N}i{K}-name`(例如`s2i1-researcher`, `s2i2-researcher`)
- 重新生成:添加`-r2`, `-r3`后缀,当使用更正的配置重新生成失败的Agent时(例如`s2i1-reviewer-r2` = 阶段2迭代1审查者,重新生成尝试2)。每个Agent最多3次重新生成尝试。.md| Context | Primary | Second Opinion |
|---|---|---|
| General code | domain specialist ( | |
| Auth/crypto | | |
| Infrastructure/config | | |
| Trivial / single-domain-small | skip | — (only when overall task severity < MEDIUM; the MEDIUM+ severity rule — "second opinion mandatory in all DISCOVER stages" — overrides this row) |
| 上下文 | 主Agent | 第二意见 |
|---|---|---|
| 通用代码 | 领域专家( | |
| 认证/加密 | | |
| 基础设施/配置 | | |
| 琐碎/单领域小型 | 跳过 | —(仅当整体任务严重程度<MEDIUM时;MEDIUM+严重程度规则——“所有DISCOVER阶段必须有第二意见”——覆盖此行) |
| Context | Primary | Second Opinion |
|---|---|---|
| General code | | language specialist ( |
| Auth/crypto | | |
| Infrastructure/config | | |
| System design / architecture | | |
| Multi-language | | |
| Trivial / single-domain-small | skip | — (only when overall task severity < MEDIUM; the MEDIUM+ severity rule — "second opinion mandatory in all REVIEW stages" — overrides this row) |
.md.mdpython-pro| 上下文 | 主Agent | 第二意见 |
|---|---|---|
| 通用代码 | | 语言专家( |
| 认证/加密 | | |
| 基础设施/配置 | | |
| 系统设计/架构 | | |
| 多语言 | | |
| 琐碎/单领域小型 | 跳过 | —(仅当整体任务严重程度<MEDIUM时;MEDIUM+严重程度规则——“所有REVIEW阶段必须有第二意见”——覆盖此行) |
python-prospawn-glm.sh.cmdtmp/{NAME}-status.txtwait-glm.sh name1:$PID1 name2:$PID2 ...tmp/glm-plan.mdSTAGE GAP ACCEPTED: [domain] [reason] [coverage from other agents]spawn-glm.sh.cmdtmp/{NAME}-status.txtwait-glm.sh name1:$PID1 name2:$PID2 ...tmp/glm-plan.mdSTAGE GAP ACCEPTED: [domain] [reason] [coverage from other agents]research-analyst.mdresearch-analyst.md| CONFIRMED | REJECTED | WEAKENED |
|---|---|---|
| → fix list | → dropped | severity downgraded → fix list at lower priority |
FIX SKIPPED: Zero MEDIUM+ verified findings — nothing to fix.sN-extractsN-adv-{domain}sN-adv-crosssN-synthresearch-analystresearch-analyst| CONFIRMED | REJECTED | WEAKENED |
|---|---|---|
| → 修复列表 | → 丢弃 | 严重程度降级 → 低优先级修复列表 |
FIX SKIPPED: Zero MEDIUM+ verified findings — nothing to fix.sN-extractsN-adv-{domain}sN-adv-crosssN-synthtmp/stage-N-synthesis.mdtmp/glm-plan.mdrm -f tmp/sN-*-prompt.txt tmp/sN-*-task.txtPRIOR CONTEXT:tmp/glm-plan.mdSKIPPEDtmp/glm-plan.mdtmp/stage-N-synthesis.mdtmp/glm-plan.mdrm -f tmp/sN-*-prompt.txt tmp/sN-*-task.txtPRIOR CONTEXT:tmp/glm-plan.mdSKIPPEDtmp/glm-plan.mdtmp/stage-N-iter-K-synthesis.mds{N}i{K}-names2i1-reviewers2i2-researchers2i1-reviewer-r2tmp/stage-N-iter-K-synthesis.mds{N}i{K}-names2i1-reviewers2i2-researchers2i1-reviewer-r2tmp/glm-plan.mdtmp/tmp/session-summary.mdrm -f tmp/s[0-9]*-prompt.txt tmp/s[0-9]*-task.txttmp/glm-plan.mdtmp/tmp/session-summary.mdrm -f tmp/s[0-9]*-prompt.txt tmp/s[0-9]*-task.txtYou are a single agent working solo. Do all the work yourself — do not spawn sub-agents, do not delegate to other agents, do not run agentic workflows. Agentic workflows are not allowed in this session.
Before claiming something is missing or broken — grep for existing guards, handlers, or implementations first.
{cat <skill-folder>/templates/coordination-review.txt OR coordination-code.txt — replace {NAME}}
{cat <skill-folder>/templates/severity-guide.txt — REVIEW/audit tasks only}
{cat <skill-folder>/templates/quality-rules-review.txt OR quality-rules-code.txt}
{Full <skill-folder>/agents/{agent}.md — see Rules → Prompts}
You are an AI agent named {NAME}.
--- TASK ASSIGNMENT ---
PROJECT: {working directory and project description}
ENVIRONMENT (code tasks only):
{Runtime, test command, lint command}
PRIOR CONTEXT (stage 2+ or iteration 2+):
{Contents of tmp/stage-N-synthesis.md OR cumulative tmp/stage-N-iter-*-synthesis.md for iterations}
YOUR TASK: {KEY FILES, CONTEXT, SCOPE, MUST ANSWER questions}
WRITABLE FILES: {code agents only — list source files agent may edit. Review/research/audit agents: omit this section}| Task Type | Coordination | Severity Guide | Quality Rules |
|---|---|---|---|
| Review/audit | coordination-review.txt | severity-guide.txt | quality-rules-review.txt |
| Code/refactor | coordination-code.txt | — | quality-rules-code.txt |
| Research | coordination-review.txt | — | quality-rules-review.txt |
<skill-folder>/templates/cat你是一个独立工作的单个Agent。自己完成所有工作——不要生成子Agent,不要委托给其他Agent,不要运行Agentic工作流。本次会话中不允许Agentic工作流。
在声称某物缺失或损坏之前——先grep查找现有的保护、处理程序或实现。
{cat <skill-folder>/templates/coordination-review.txt 或 coordination-code.txt —— 替换 {NAME}}
{cat <skill-folder>/templates/severity-guide.txt —— 仅REVIEW/审计任务}
{cat <skill-folder>/templates/quality-rules-review.txt 或 quality-rules-code.txt}
{完整的 <skill-folder>/agents/{agent}.md —— 请参阅Rules → Prompts}
你是名为{NAME}的AI Agent。
--- 任务分配 ---
项目: {工作目录和项目描述}
环境(仅代码任务):
{运行时、测试命令、lint命令}
先前上下文(阶段2+或迭代2+):
{tmp/stage-N-synthesis.md 的内容 或 迭代的累积 tmp/stage-N-iter-*-synthesis.md 内容}
你的任务: {KEY FILES、上下文、范围、MUST ANSWER问题}
可写文件: {仅代码Agent——列出Agent可编辑的源文件。审查/研究/审计Agent:省略此部分}| 任务类型 | 协调 | 严重程度指南 | 质量规则 |
|---|---|---|---|
| 审查/审计 | coordination-review.txt | severity-guide.txt | quality-rules-review.txt |
| 代码/重构 | coordination-code.txt | — | quality-rules-code.txt |
| 研究 | coordination-review.txt | — | quality-rules-review.txt |
<skill-folder>/templates/cat./<skill-folder>/tools/memory.sh session add context "CHECKPOINT: [task] | DONE: [steps] | NEXT: [remaining] | SKIP: [do not redo — completed agents, failed approaches, skipped stages, pending approvals] | FILES: [key files] | BUILD/TEST: [commands]"SKIP:s2-reviewer doneverify skipped — 0 findingsawaiting user approval for push<skill-folder>/tools/glm-recover.shglm-recover.shglm-recover.sh./<skill-folder>/tools/memory.sh session showtmp/glm-plan.mdtmp/sN-synth-report.mdtmp/stage-N-iter-K-synthesis.mdtmp/stage-N-synthesis.md| Checkpoint | Recovery |
|---|---|
| Plan done | Read |
| Agents prepared | List prompts → spawn |
| Agents spawned | Check PIDs/reports → verify or re-wait |
| Verifying stage N | Read |
| Iterating stage N, iter K | Read |
| Stage N done | Read synthesis + plan → next stage |
undefined./<skill-folder>/tools/memory.sh session add context "CHECKPOINT: [任务] | 已完成: [步骤] | 下一步: [剩余步骤] | 跳过: [不要重做——已完成的Agent、失败的方法、跳过的阶段、待批准事项] | 文件: [关键文件] | 构建/测试: [命令]"SKIP:s2-reviewer doneverify skipped — 0 findingsawaiting user approval for push<skill-folder>/tools/glm-recover.shglm-recover.shglm-recover.sh./<skill-folder>/tools/memory.sh session showtmp/glm-plan.mdtmp/sN-synth-report.mdtmp/stage-N-iter-K-synthesis.mdtmp/stage-N-synthesis.md| 检查点 | 恢复 |
|---|---|
| 计划完成 | 读取 |
| Agent准备完成 | 列出提示 → 生成Agent |
| Agent已生成 | 检查PID/报告 → 验证或重新等待 |
| 验证阶段N | 读取 |
| 迭代阶段N,迭代K | 读取 |
| 阶段N完成 | 读取合成结果 + 计划 → 下一阶段 |
undefinedundefinedundefinedtmp/glm-continuation.md./<skill-folder>/tools/memory.sh add context "GLM-CONTINUATION: [summary]" --tags glm-opencode,continuation./<skill-folder>/tools/memory.sh search "GLM-CONTINUATION"tmp/glm-continuation.md./<skill-folder>/tools/memory.sh add context "GLM-CONTINUATION: [摘要]" --tags glm-opencode,continuation./<skill-folder>/tools/memory.sh search "GLM-CONTINUATION"| Scenario | Action |
|---|---|
| No report after exit | Read log to diagnose failure. Fix root cause (bad prompt? missing dependency? environment?). Re-spawn the agent. Do NOT fill gaps yourself — filling gaps is agent work. |
| STALLED (flagged by wait-glm.sh) | Kill process, read log to diagnose. Fix root cause. Re-spawn. Do NOT note gap and proceed. |
| Agent claims success but output wrong | Diagnose why output is wrong (bad prompt? misunderstood task?). Fix the prompt/task. Re-spawn the agent. Do NOT verify or fix the output yourself. |
| Incorrect edits | Diagnose why the agent produced wrong output (bad prompt? misunderstood task?). Fix the prompt/task. Spawn a quick-fix agent to revert and rewrite. Do NOT revert changes yourself. If the quick-fix agent is still wrong, escalate to full IMPLEMENT → REVIEW → VERIFY. |
| 2+ agents fail same env error | STOP respawning. Diagnose environment first (do NOT fix environment issues directly — spawn an agent if changes needed) |
| Agent aborted (same error 3×) | Read log to diagnose root cause, fix environment/config (spawn an agent if code/config changes needed), then respawn |
| Stage partially failed (1+ agents produced no useful output or wrong output) | Diagnose root causes across all failed agents. Fix issues (environment, prompts, tasks). Re-spawn ALL failed agents. The stage is incomplete until all agents succeed. Do NOT proceed to the next stage with gaps. |
| Iteration cap hit without convergence | Synthesize all iterations, note "convergence not reached" in delivery, proceed |
| Adversarial verification produces suspicious results (CONFIRMED on obviously-wrong findings or REJECTED with weak evidence) | Diagnose prompt/task quality — adversarial agent may have misunderstood its role. Adjust MUST ANSWER questions or adversarial instructions and respawn. |
| 场景 | 行动 |
|---|---|
| 退出后无报告 | 读取日志诊断失败原因。修复根本原因(提示错误?依赖项缺失?环境问题?)。重新生成Agent。不要自己填补空白——填补空白是Agent的工作。 |
| STALLED(由wait-glm.sh标记) | 终止进程,读取日志诊断。修复根本原因。重新生成Agent。不要记录间隙并继续。 |
| Agent声称成功但输出错误 | 诊断输出错误的原因(提示错误?误解任务?)。修复提示/任务。重新生成Agent。不要自己验证或修复输出。 |
| 不正确的编辑 | 诊断Agent产生错误输出的原因(提示错误?误解任务?)。修复提示/任务。生成快速修复Agent回滚并重写。不要自己回滚更改。如果快速修复Agent仍然错误,升级为完整IMPLEMENT → REVIEW → VERIFY。 |
| 2+个Agent因相同环境错误失败 | 停止重新生成。先诊断环境(不要直接修复环境问题——如果需要更改,生成Agent) |
| Agent中止(相同错误3次) | 读取日志诊断根本原因,修复环境/配置(如果需要代码/配置更改,生成Agent),然后重新生成 |
| 阶段部分失败(1+个Agent未产生有用输出或输出错误) | 诊断所有失败Agent的根本原因。修复问题(环境、提示、任务)。重新生成所有失败Agent。所有Agent成功前阶段不完整。不要在有间隙的情况下进入下一阶段。 |
| 达到迭代上限仍未收敛 | 合成所有迭代,在交付中注明“未达到收敛”,继续 |
| 对抗性验证产生可疑结果(明显错误的发现结果被CONFIRMED或弱证据被REJECTED) | 诊断提示/任务质量——对抗性Agent可能误解了其角色。调整MUST ANSWER问题或对抗性指令并重新生成。 |
-r2-r3spawn-glm.shTasksubagent_typesubagent_type.md<skill-folder>/agents/code-reviewerios-proswift-prospawn-glm.sh.md-a AGENT_NAMEassemble-prompt.shspawn-glm.shTask(subagent_type=...)spawn-glm.sh.md<skill-folder>/templates/opencodepi--pi-r2-r3spawn-glm.shsubagent_typeTasksubagent_type<skill-folder>/agents/code-reviewerios-proswift-prospawn-glm.shassemble-prompt.sh-a AGENT_NAMEspawn-glm.shTask(subagent_type=...)spawn-glm.sh<skill-folder>/templates/opencodepi--pi<skill-folder>/skills//skill-name<skill-folder>/skills//skill-name