Community编程与开发github.com

grahama1970/agent-ecosystem

为代理治理生态系统提供规范映射和共享契约:pi.receipt_envelope.v1 边界信封、组件图以及每个组件拥有哪些模式的规则。在将技能或扩展接入共享收据世界时、询问 shame、triage-error、tau、ask、project-watchdog、ops-herdr、ponytail 和 Memory 如何协同工作时,或验证信封时使用。

agent-ecosystem 是什么?

Agent Ecosystem 是一个为 AI 代理治理而设计的严格分层生态系统,它通过类型化的 JSON 契约而非直接的状态机导入来耦合各个组件。其核心是不可变的 $shame 目标:确保项目代理无法忽略明确指令——通过将指令服从和完成报告转换为类型化的 pydantic 验证契约、确定性扩展门和保留的代理评估。生态系统包含多个明确分工的组件(如 shame、triage-error、tau、ask 等),每个组件只拥有一个关注点,通过 pi.receipt_envelope.v1 边界信封在权威变更边界(调度、交接、验收、升级、关闭、持久失败)处进行通信。该系统适用于 Claude Code、Cursor 和 Codex 等平台,要求所有决策必须基于类型化数据而非自由文本或 LLM 判断,并通过确定性分类(失败代码目录)和严格的 pydantic 模式保持不变性。

兼容平台✓Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/agent-ecosystem

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

预览

来自技能 README

Agent 治理生态系统

文档

Agent 生态系统

一个分层的治理循环。每个组件只拥有一个关注点;它们只通过类型化的 JSON 契约耦合,从不导入彼此的状态机。

不可变的 $shame 目标是 shame-deterministic-instruction-obedience-v1 (skills/shame/immutable_goal.json):通过将指令服从和完成报告转换为类型化的 pydantic 验证契约、确定性扩展门以及保留的代理评估,使项目代理无法忽略明确指令。散文仅用于展示,不能决定成功与否。下面列出的每个生态系统成员都必须在其边界处维护该目标。

图

Agent 治理生态系统

使用 $create-svg 渲染(scene.yml 是源文件;使用 skills/create-svg/run.sh render skills/agent-ecosystem/scene.yml skills/agent-ecosystem/ecosystem.svg 重新生成)。 机器可读的成员清单是 members.json(由 scripts/membership.py validate 验证;保留的评估使其保持最新)。 生成的 SVG 和下面的 mermaid 块是非规范性说明;所有权表和成员的 ## Ecosystem 部分是规范的拓扑结构。

flowchart TB
    subgraph SHAPE[生成塑造]
        PONY[ponytail\nYAGNI 阶梯,无收据]
    end
    subgraph TURN[Turn 层 - Pi 会话]
        SHAME[shame 扩展\npi.agent_status.v1\n验证、编译、吞入]
        TRIAGE[triage-error\n失败词汇表\ncode, cause, next_command]
    end
    subgraph WORK[工作流层]
        ASK[ask\n将意图编译为 DAG 契约]
        TAU[tau\n执行 DAG,拥有验收\n类型化节点收据,goal_hash]
    end
    subgraph OPS[运维层]
        WD[project-watchdog\ncron 调度、租约、\n证明门、tick 收据]
        HERDR[ops-herdr 桥\n收件箱、静默、\nTTL 死信]
    end
    MEM[(Memory\n训练示例、\n分类决议、\n项目知识)]

    PONY -.-> SHAME
    SHAME -->|failed.triage.code| TRIAGE
    SHAME -->|needs_* 编译命令| ASK
    ASK -->|tau.dag_contract.v1| TAU
    TAU -->|节点收据 / handoff v2 携带状态| SHAME
    WD -->|ticket_repair through ask| ASK
    WD -->|读取判决| TAU
    HERDR -->|死信分类代码| TRIAGE
    SHAME -->|带标签的示例| MEM
    TRIAGE -->|铸币代码| MEM
    TAU -->|后运行导出不良节点收据| MEM

所有权表

组件拥有发出消费对于 $shame 不可变目标的必须行为
项目代理在 turn 边界的指令服从pi.agent_status.v1 报告操作员指令、工具结果、收据必须将受保护的工作报告为类型化状态数据,对代理可执行的未完成工作使用 continuing.not_done[].next_command,并且绝不能将散文/提交/评审意见视为完成证明。
triage-error失败词汇表 (failure_codes.json){code, cause, next_command}来自任何层的原始错误文本必须使一个原始信号映射到一个目录或铸币代码;模糊的终端标签不能成为有效的决策。
shameturn 状态 (pi.agent_status.v1) 和 shame.immutable_goal.v1状态对象、不可变目标、训练示例分类代码、人工标签必须保持状态真实性为 pydantic 验证的、仅用于散文展示的、并经过评估门控的。
lazy-report-shame-shame-shame 扩展Pi message_end 执行拒绝包、渲染状态、后续命令最终状态 JSON、延续分类账必须拒绝缺失/无效的状态 JSON,剥离模型撰写的状态散文,从验证数据渲染,并排队编译的延续/升级命令。
status-json-check.mjs最终状态提取和验证器调用带有验证状态对象的检查结果助手文本绝不能使用正则表达式、散文标题、markdown、HTML 或 LLM 判断来决定状态有效性。
agent_status_schema.pypydantic 状态合法性解析通过/失败最终状态 JSON必须使无效状态状态不可表示,使用 extra=forbid、类型化状态有效载荷、规范的分类代码,并且 not_done 仅出现在 continuing 上。
compile-status-command.mjs类型化状态到命令的编译精确的后续命令或无命令pydantic 验证的状态对象必须机械地编译 continuing/needs_* 有效载荷,并将终端/人类状态编译为无自动命令。
agentic-evals保留的回归证明就绪报告固定装置和命令如果正则表达式/散文状态策略返回或 pydantic 状态不变性被削弱,必须失败。
ask意图到 DAG 编译tau.dag_contract.v1、恢复包状态升级有效载荷必须消费类型化的 needs_* 有效载荷,而不是非正式的升级散文。
tauDAG 执行和验收节点收据、tau.agent_handoff.v1/v2、目标哈希DAG 契约、嵌入状态对象必须拥有不可变的目标哈希和类型化的验收收据;评审者散文不能取代验收。
project-watchdog计划调度tick 收据、证明门、锁、延续分类账GitHub 工单、tau 判决必须暴露机器可读的未完成工作,以便在工单/门/下一步未解决时 done 可以失败。
ops-herdr跨会话传输收件箱记录、死信分类代码必须将跨会话的失败/状态作为带有分类代码的类型化收件箱或死信记录携带。
ponytail生成极简主义ponytail: 债务注释(非收据)收据世界中的任何内容绝不能覆盖状态、收据、证明或评估要求。
Memory回忆存储/回忆回读响应(非信封收据;回忆是观察结果,永远不包装)所有持久化内容必须存储 shame 示例、分类决议和项目知识并支持回读;回忆是观察结果,而不是完成收据。
agent-ecosystem组件所有权和收据边界pi.receipt_envelope.v1 验证边界有效载荷必须发布所有权映射,并要求在权威变更边界进行信封包装。
goal-helper以证明为中心的目标形状不可变目标提示/检查清单人类目标文本必须保持成功与主要证明、完成标准、允许范围、禁止漂移、重试预算和停止条件相关联。

pi.receipt_envelope.v1 - 边界信封

仅在权威变更边界将有效载荷包装在信封中: 调度、交接、验收、升级、关闭、持久失败。 内部对象保持未包装(经评审的 YAGNI 裁决:无通用事件总线, 不在每个工件上放信封)。

{
  "schema": "pi.receipt_envelope.v1",
  "receipt_id": "stable-id",
  "payload_schema": "pi.agent_status.v1",
  "producer": "shame",
  "emitted_at": "RFC3339",
  "goal_hash": "sha256:<64hex> (可选)",
  "parent_refs": [
    {"receipt_id": "id", "expected_schema": "s", "expected_producer": "p", "digest": "sha256:<64hex> (可选)"}
  ],
  "triage_code": "目录或铸币代码 (可选)",
  "payload": {}
}

使用以下命令验证:

skills/agent-ecosystem/run.sh validate <envelope.json>
echo '{...}' | skills/agent-ecosystem/run.sh validate -

由 scripts/receipt_envelope.py(pydantic,extra=forbid)强制执行的规则:

  • triage_code,如果存在,必须是 triage-error 目录代码或铸币的 *_unclassified_<8hex> 代码 - 与 pi.agent_status.v1.failure 相同的规则。
  • goal_hash 和 parent_refs[].digest 必须是 sha256: + 64 个小写十六进制字符。
  • parent_refs 需要 goal_hash:没有共享目标的证据边是不可信的,并会验证失败。
  • Pydantic 仅证明结构。引用解析是 单独的消费者端步骤,包含四个强制性检查:引用的收据存在; 其 schema 等于 expected_schema;其 producer 等于 expected_producer; 并且 resolved_parent.goal_hash == envelope.goal_hash(存在的哈希在比较之前不是共享目标)。当设置 digest 时,摘要验证适用。结构上有效的信封还不是可信的信封。
  • payload.schema 在每个包装的有效载荷中都是必需的,并且必须等于信封的 payload_schema;匿名有效载荷验证失败。
  • 对任何 extra=forbid 模式的字段集更改本质上是破坏性的; 它们需要一个新的模式版本,绝不能就地编辑。

共享 JSON 字段约定

以下字段是实际的共享表面。当一个组件发出或验证与所有者相同的名称、形状和语义时,该组件“共享”一个字段。

字段形状所有者共享者
schema版本化 id,例如 pi.agent_status.v1每个模式所有者每个契约对象;版本升级是追加式或新名称
code(分类)目录条目或 <prefix>_unclassified_<8hex>triage-errorshame failure.triage.code、信封 triage_code、herdr 死信、ask 恢复包
cause / next_command纯字符串 / 精确可运行命令triage-error每个分类的消费者;next_command 也是 shame 的 continuing 继续字段
goal_hashsha256: + 64 个小写十六进制字符tau(不可变目标数据包)shame 状态(可选)、信封(可选)、每个 tau 节点收据
verified[]{command, result} 对shame嵌入状态对象的任何地方的完成状态证明
proof[]具体路径/URL/ID;pi.agent_status.v1 中的本地路径必须在 done 通过前存在shame状态对象;看门狗证明门命名相同的工件
parent_refs[]{receipt_id, expected_schema, expected_producer, digest?}agent-ecosystem 信封升级证据(替换 needs_webgpt 中的临时路径)
producer / receipt_id / emitted_at字符串 / 稳定 id / RFC3339agent-ecosystem 信封任何边界包装的收据
payload_schema版本化 id;当有效载荷声明一个时必须等于 payload.schemaagent-ecosystem 信封任何边界包装的收据
终端判决PASS FAIL BLOCKED NEEDS_ATTENTIONtauask 加入、看门狗证明门、流监控器
recoverable / not_thisbool / 排除列表triage-error 目录决定重试与升级的消费者

triage-error 约定(此处为规范性,实现在彼处)

  1. 一个原始信号映射到一个 {code, cause, next_command};层边界处的通用代码是错误,而不是分类。
  2. 目录条目位于 skills/triage-error/failure_codes.json 中,包含 {code, layer, match[], cause, next_command, recoverable, not_this[]}。 匹配是确定性的:归一化完全是 " ".join(text.lower().split())(小写,所有空白序列折叠为单个空格,两端修剪);当任意的 match[] 标记(也小写化)是归一化信号的子串时,条目匹配;当给出 --layer 时,具有不同 layer 的条目被跳过;文件顺序中第一个匹配的条目获胜。绝不使用正则表达式或 LLM 判断。 禁止作为终端分类(它们是症状而非原因,必须从底层信号重新分类):NEEDS_ATTENTION、 BLOCKED、browser_handler_timeout、unknown_error、generic_failure、 以及任何裸终端判决词。
  3. 不匹配的信号铸币 <layer-or-unknown>_unclassified_<8hex>,其中 8 个十六进制字符是标准化信号文本的 sha256 的前 8 个字符,因此相同的信号总是铸出相同的代码。铸币会打开工单 + agentic-eval + memory 循环。复发阈值:同一个铸币代码的第二次观察会触发提升或别名化。别名表示: 目录文件中的顶层 aliases 映射将铸币代码映射到规范代码;由于铸币在标准化信号上是确定性的,重复的信号会重新铸出相同的代码,分类器通过映射将其解析为规范条目(记录为 aliased_from);铸币代码永远不会成为第二个规范标识。工单/eval/memory 副作用按铸币代码是幂等的(以代码字符串为键)。
  4. 每个命名失败的生态系统组件都使用目录或铸币代码。pydantic 验证器(状态模式、信封)在解析时强制执行此操作,因此模棱两可的标签不可能存在于有效对象中。

设计裁决(来自外部评审)

  1. 严格性适用于决策,而非观察。保留原始证据的宽松性;保留已接受结果的严格性。类型化的 unknown 观察是合法的;模棱两可的决策则不是。
  2. 铸币的 *_unclassified_* 代码获得临时生命周期:在它们复发时提升到目录或别名化到现有代码;绝不让它们蔓延。
  3. 模式变更是追加式的;破坏性形状变更获得新版本(tau.agent_handoff.v2 模式),绝不就地编辑。
  4. 不要构建:通用治理事件总线;用于 ponytail 注释、Memory 召回或内部重试的收据。

成员资格

技能或扩展通过在其 SKILL.md 中添加 ## Ecosystem 部分来加入生态系统,命名:它产生哪些模式、消费哪些模式、以及将哪些边界事件包装在信封中。当前成员:shame、triage-error、tau、ask、project-watchdog、ops-herdr。Ponytail 按设计是相邻的。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

grahama1970/acceptance-contract

Turn a client brief, zip bundle, directory, or single requirements file into a typed acceptance-contract bundle with extracted requirements, acceptance checks, open questions, an immutable-goal draft, and a create-report-backed decision report. Use when users say acceptance contract, brief to requirements, freeze the goal, create immutable goal, amend immutable goal, build a Battle requirements bundle, or extract requirements from this bundle.

grahama1970/agentic-evals

Agentic evaluation of skills using multi-trial fixtures, deterministic command assertions, trajectory checks, safety constraints, and evidence-backed readiness scoring. Use when users ask for agentic evals, multi-trial skill evaluation, skill trajectory validation, or readiness scoring for a skill workflow.

grahama1970/agent-inbox

File-based inter-agent messaging with headless dispatch. Check inbox, send bugs/requests to other projects, automatically spawn headless agents to fix bugs, and track progress via task-monitor.

grahama1970/agents-registry

Generate and query the centralized agent identity registry. Scans .pi/agents/*/AGENTS.md, parses frontmatter, outputs agents-registry.json and optionally syncs to /memory for semantic search.

grahama1970/agent-status

Artifact-driven status surfaces for long-running project-agent work. Maintains status.json, events.jsonl, proof manifests, and a stale-aware STATUS.html so humans can tell where the agent is, what passed, what is still unproven, and what decision or action is next — without dashboard theater.

grahama1970/align

Round-based context alignment before execution. Use when the human, project agent, WebGPT, scillm, ask, dogpile, memory, or project-knowledge may each hold different facts about a task; especially before ambiguous design, infographic, product workflow, high-stakes implementation, plan-iterate, project-infographic, or multi-review work.

grahama1970/analytics

Flexible data science analytics for any dataset. Auto-discovers schema, recommends charts, exports to create-figure. Works with JSONL, JSON, CSV from any source.

grahama1970/analyze-chatterbox-emotions

Evaluate generated Chatterbox voice files as voice-quality artifacts: affect match, arousal/valence proxies, pause placement, intelligibility inputs, clipping, loudness, and discontinuity flags. Use when reviewing Chatterbox emotional tags, pauses, Turbo/base affect delivery, Persona Dream utterance renders, or whether generated speech matches an intended product-facing affect.

grahama1970/analyze-elf

Reverse-engineer features from ELF binaries. Extracts CLI commands, state machines, protocols, Zod schemas, and data models. Automatically generates a /create-walkthrough prosecution brief with Mermaid diagrams. Uses /treesitter for AST analysis of bundled JS/TS source.

grahama1970/animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

grahama1970/anonymize-data

Anonymize supported CSV, JSON, UTF-8 text, and SQLite files using an explicit policy through the oai-trial project. Use for anonymize data, pseudonymize exports, redact policy literals, or discover and explicitly approve fuzzy name aliases. The skill is a thin CLI/Docker interface, not another engine.

grahama1970/anvil

Heavy-duty "No-Vibes" debugging and hardening orchestrator. Use this for complex, stubborn bugs where `review-code` has failed, or for "Red Teaming" (hardening) a codebase. Runs multiple agents in parallel (Thunderdome) using git worktree isolation.

grahama1970/apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

grahama1970/argue

Multi-persona structured debate orchestrator. Personas research via /dogpile, consult colleagues via /ask, and argue toward nuanced synthesis on complex questions.

grahama1970/arxiv

Search arXiv for papers and extract knowledge into memory. Use `search` to find papers, `learn` to extract knowledge.

grahama1970/ask

Use when the user asks to query project memory, ask an oracle, use supported browser-backed reviewers, run Tau roundtable/single-handler workflows, ask Pi-native subagents from within Pi, run persona/deep-review workflows, generate image prompts, check OS/project health through composed skills, or run an ask DAG. This skill is the executable /ask runtime; do not replace it with an informal subagent, plain web search, or hand-written review; inside Pi, explicit Pi-native subagent targets are routed through the pi-subagents tool as an Ask target type.

grahama1970/assess

Step back and critically reassess project state. Use when asked to "assess", "step back", "fresh eyes", "check alignment", "sanity check", "health check", "prune documentation", or "evaluate what's working". Offers documentation pruning and doc-code alignment analysis. Offer to run after major changes (don't auto-run).

grahama1970/assistant

Shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

grahama1970/assistant-lab

Self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

grahama1970/batch-quality

Pre-flight validation and quality gates for batch LLM operations. ACTUALLY tests samples through LLM before burning tokens. Uses SPARTA contracts for DuckDB validation queries. Integrates with task-monitor for enforced quality gates.

相关技能