基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tangle-network/agent-runtime --skill loop-writer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Batch mechanical tool work as one program so loops and intermediates stay out of context.
Author runGraph programs from AgentProfiles and versioned prompt directives.
Choose and compose current runtime, eval, knowledge, and interface APIs before adding wrappers.
| name | loop-writer |
| description | Write a custom control policy only when current runtime composition APIs cannot express it. |
Use this only for a control policy that the shipped high-level APIs cannot express.
Read docs/canonical-api.md, current exports, the implementation, and the nearest test before writing code.
Do not copy signatures from this skill.
| Need | Existing path |
|---|---|
| One product chat turn | handleChatTurn(...) |
| One task or bounded multi-turn task | runAgentTask(...) or runAgentTaskStream(...) |
| Two or more actors taking turns | defineConversation(...) and runConversation(...) |
| A driver coordinating workers | supervise(...) or superviseSurface(...) |
| Parallel or fixed composition | fanout(...), pipeline(...), panel(...), verify(...), or loopUntil(...) |
| Parallel repository workers with isolated branches | worktreeFanout(...) |
| Repeated work in a graded tool environment | runAgentic(...) |
| Equal-budget comparison over that environment | runBenchmark(...) |
| Low-level round policy with custom planning and stopping | runAgentRounds(...) |
If an existing row fits, use it and stop. Do not create another wrapper solely to rename inputs or results.
A custom loop has five explicit parts:
task -> plan work -> execute attempts -> check outcomes -> continue or stop
Keep ownership separate:
The driver must not mutate product state while planning. An LLM score must not override failed builds, tests, missing evidence, denied permissions, or service errors.
Model every terminal and resumable state explicitly:
Use stable run, attempt, task, and parent IDs. Persist the accepted artifact, every attempted artifact identity, spend, and final reason. Resume from durable facts, not an in-memory counter or summary alone.
Steering is a typed input to a running or replacement attempt. Record who sent it, why, which evidence motivated it, whether delivery succeeded, and which attempt consumed it.
Questions are explicit events. Route them to the responsible parent or user, preserve unanswered blockers, and fail closed when a required answer is unavailable. Do not bury a permission request in free-form worker output.
Give parallel workers isolated state unless shared mutation is the point of the task. For repository changes, use one worktree per worker and explicit merge outcomes. For external writes, use idempotency keys and product-owned transactions.
Recursive supervisors use the same budget, cancellation, trace, question, and completion contracts at every depth. Do not grant a child more authority than its parent.
Cover:
The change is complete when the public entrypoint is smaller than the policy it replaces, all states above are observable, a real task exercises the custom behavior, and package typecheck, tests, build, docs, and package verification pass.
critical-audit when the loop changes a public contract or authority boundary.eval-engineering when the loop's stopping condition needs a new evaluation case.verify before publishing the package.