Communitygithub.com

grahama1970/align

基于轮次的上下文对齐,在执行前确保所有参与者对任务理解一致。适用于人类、项目代理、WebGPT、scillm、ask、dogpile、memory 或 project-knowledge 对任务事实持不同看法的情况;尤其是在模糊设计、信息图、产品工作流、高风险实现、计划-迭代、项目信息图或多轮审查工作之前。

align 是什么?

`grahama1970/align` 技能是一个预执行的门控机制,旨在解决涉及多个信息源(如人类、项目代理、WebGPT、scillm、ask、dogpile、memory 和 project-knowledge)的任务中常见的上下文不一致问题。当这些参与者可能各自持有不同的事实或假设时,Align 通过结构化的多轮对话来强制对齐,最终生成一个 `alignment_lock.json` 文件,明确记录已达成一致的目标、非目标、输出形状、验收标准以及明确的就绪/不就绪决策。此技能特别适用于模糊设计、信息图创建、产品工作流制定、高风险实现、计划-迭代循环或多轮审查等复杂任务。 Align 的核心机制是轮次循环:每一轮都会向选定的参与者广播当前的对齐摘要,每个参与者陈述他们对该任务的理解、他们知道而其他人可能不知道的事实、以及他们的假设、矛盾和问题。然后将所有问题合并为阻塞性和非阻塞性两类,并路由到能够回答该问题的参与者。只有在所有阻塞性问题都得到解决后,锁定才会设置为 `ready_for_execution: true`,从而允许后续技能(如实施、审查或信息图渲染)开始。如果达到最大轮次后仍有阻塞性问题未解决,则停止并指示 `ready_for_execution: false`,并呈现人类需要做的最小决策。该技能支持通过 `prepare-review` 命令生成可复现的审查请求,用于 WebGPT(通过 `$ask` 路由)、scillm(直接模型调用)和 dogpile(外部研究),但不直接调用这些审查者,而是生成供其他技能执行的工件。 该技能主要面向需要复杂上下文协调的开发者和 AI 代理用户。它适用于包含多个智能体或人类参与者的工作流,这些参与者可能对同一任务持有不同事实或假设。技能支持的主要平台包括 GitHub 仓库和本地开发环境,通过 CLI 工具 `skills/align/run.sh` 进行交互。它还提供了 `sanity.sh` 和 `sanity-live.sh` 脚本,用于本地和真实的端到端测试,确保对齐机制在投入实际使用前能够正确工作。关键优势在于它防止了基于不完整或有冲突的上下文进行实现或审查,从而避免了代价高昂的返工和错误。 总的来说,`grahama1970/align` 是一个精心设计的预执行协调层,通过强制多源信息对齐来提升复杂 AI 代理任务的可靠性和一致性。它不直接执行工作,而是确保所有后续步骤都建立在经过验证和共识的基础上。

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

在你喜欢的 AI 中提问

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

文档

align 是做什么的?

在执行之前,使用 $align 来均衡上下文。该技能适用于以下情况: 人类、项目代理、WebGPT、$scillm、$ask、$dogpile、$memory 或 $project-knowledge 可能各自掌握不同的事实。它会生成一个 alignment_lock.json,后续技能可以据此执行。

不要使用 $align 来实现、渲染、重构或审查最终工作。它是一个 预执行的门控机制。在 alignment lock 显示 ready_for_execution: true 之前,不应开始任何代码、信息图、仪表盘、计划-迭代阶段或 项目信息图渲染。

核心规则

仅当所有阻塞性问题都得到解答,并且锁定记录以下内容时,对齐才完成:

  • 已同意的目标
  • 已同意的非目标
  • 来源上下文
  • 参与者事实
  • 剩余假设和风险
  • 输出形状
  • 验收标准
  • 明确的就绪/不就绪决策

如果仍然存在分歧,则保持锁定的 ready_for_execution: false。

参与者

仅使用与任务相关的参与者:

参与者角色
human意图、偏好、领域细微差别、验收标准
project_agent本地仓库状态、约束、可执行的下一个步骤
project_knowledge持久化的项目历史和接管笔记
memory先前的经验教训和已解决的类似问题
scillm通过 localhost LLM 代理进行直接的模型批评
ask包含工件的 Ask/oracle/deep-review 运行时;拥有 WebGPT 路由
dogpile当本地上下文不足时进行新鲜的外部研究
webgpt浏览器/会话可见的上下文和面向人类的判断

WebGPT 调用必须通过 $ask webgpt 路由;$ask 已经拥有 WebGPT oracle 后端,并使用 surf webgpt.submit --no-activate 针对用户已认证的 ChatGPT 标签页。$align 不直接调用 surf。不要通过 $scillm 发送 WebGPT 请求;$scillm 用于直接模型调用,例如 gpt-5.5、Gemini、Claude 或 OpenCode Go。当人类提供标签页 ID 时,请保留它。 仅当对齐因缺少外部/当前知识而受阻时,才使用 $dogpile。不要将其用于 $project-knowledge 或 $memory 已经能回答的事实。

运行时路由

                         +-----------------------+
                         |    $align init        |
                         | goal, output, sources |
                         +-----------+-----------+
                                     |
                                     v
                   +-----------------+-----------------+
                   |     Round N: alignment_brief      |
                   | participants state facts, gaps,   |
                   | contradictions, and questions     |
                   +-----------------+-----------------+
                                     |
                   +-----------------+-----------------+
                   | compile-round extracts questions  |
                   | Question[blocking/nonblocking]:   |
                   +-----------------+-----------------+
                                     |
                  open blocking questions?
                         | yes                         | no
                         v                             v
        +----------------+----------------+    +-------+--------+
        | route each question to owner    |    | lock --ready   |
        | human/project/memory/reviewer   |    | writes lock    |
        +----------------+----------------+    +----------------+
                         |
                         v
        +----------------+----------------+
        | add-response / answer-question  |
        | update brief, increment round   |
        +----------------+----------------+
                         |
                         v
                    Round N+1

审查者路由是轮次的可选输入:

                                +----------------+
                                | Round N brief  |
                                +-------+--------+
                                        |
          +-----------------------------+-----------------------------+
          |                             |                             |
          v                             v                             v
+--------------------+       +--------------------+       +--------------------+
| WebGPT via $ask    |       | $scillm direct     |       | $ask review/oracle |
| prepare-review     |       | prepare-review     |       | prepare-review     |
| --reviewer webgpt  |       | --reviewer scillm  |       | --reviewer ask     |
+---------+----------+       +---------+----------+       +---------+----------+
          |                            |                            |
          v                            v                            v
skills/ask/run.sh ask webgpt    round-N-scillm-request.json   round-N-ask-request.md
--webgpt-tab-id <id>            model: gpt-5.5               skills/ask/run.sh ask
          |                     reasoning_effort: high       --deep-review
          v                     optional persona prompt
 $ask -> surf webgpt.submit            |
 --no-activate                         v
          |                  POST localhost:4001/v1/chat/completions
          v
 authenticated ChatGPT tab

外部/当前研究:
  prepare-review --reviewer dogpile -> round-N-dogpile-request.md
  仅当缺失的外部事实阻碍了对齐时才使用。

轮次循环

每一轮都遵循相同的顺序:

  1. 将当前的对齐摘要广播给选定的参与者。
  2. 每个参与者陈述他们认为的任务是什么。
  3. 每个参与者列出他们知道而其他人可能不知道的事实。
  4. 每个参与者列出假设、矛盾和问题。
  5. 将问题合并为阻塞性和非阻塞性集合。
  6. 将问题路由到能够回答该问题的一方。
  7. 更新摘要。
  8. 仅当阻塞性问题已解决或达到最大轮次时停止。

如果在达到最大轮次时仍有阻塞性问题未解决,则以 ready_for_execution: false 停止,并呈现人类需要做的最小决策。

CLI

WebGPT 标签页绑定(CLI 一致性)

优先从已注册的工作目录中使用 零标志 的 $ask webgpt。/ask 会自动组合 $browser-oracle。init 和 prepare-review 将绑定提示持久化到 .align/state.json 中,并在生成的 round-*-webgpt-ask-command.sh 上发出相同的标志。

标志使用时机
(无)cwd 有向上查找注册表 + 绑定 — 首选
--browser-oracle-from <dir>覆盖向上查找根目录(monorepo 子目录)
--webgpt-project <name>显式项目;跳过 yaml 向上查找
--webgpt-tab-id <id>一次性覆盖;跳过向上查找
--webgpt-url <url>通过对话 URL 解析;跳过向上查找

解析顺序(与 $ask / $surf 相同):--webgpt-tab-id → --webgpt-url → $browser-oracle 向上查找 → --webgpt-project → 一个 chatgpt.com 标签页(失败关闭)。

设置:$browser-oracle register + bind + doctor --from <dir>。请参阅 $browser-oracle 和 $ask SKILL.md 的 WebGPT 标签页绑定 部分。

从拥有任务的仓库或项目根目录运行:

skills/align/run.sh init \
  --goal "创建一个清晰的计划-迭代信息图请求" \
  --output-shape "来源衍生的故事板和 Web 信息图请求" \
  --participant human \
  --participant project_agent \
  --participant project_knowledge \
  --participant scillm \
  --participant ask \
  --participant dogpile \
  --participant webgpt
# 优先从已注册的目录使用零标志,或持久化向上查找根目录:
#   --browser-oracle-from skills/oc-subagent/personas/mathematics
# 传统的显式覆盖:
#   --webgpt-tab-id 837343529

记录参与者响应:

skills/align/run.sh add-response \
  --participant project_agent \
  --round 1 \
  --text "任务:在渲染前协调工作流。事实:先前的视觉效果失败,因为没有批准的故事板。问题[阻塞性]:应该用哪个确切样本项目来锚定视觉?"

编译轮次:

skills/align/run.sh compile-round --round 1

仅在所有阻塞性问题都解决后才锁定:

skills/align/run.sh lock --ready --approved-by human

审查者请求生成

prepare-review 为审查者创建可重放的请求工件。它本身不调用审查者。

skills/align/run.sh prepare-review --round 1 --reviewer scillm
skills/align/run.sh prepare-review --round 1 --reviewer ask
skills/align/run.sh prepare-review --round 1 --reviewer dogpile
skills/align/run.sh prepare-review --round 1 --reviewer webgpt --browser-oracle-from skills/oc-subagent/personas/mathematics
# 或者:--webgpt-tab-id 837343529

当审查需要人类已认证的 ChatGPT 浏览器会话或浏览器可见上下文时,使用 WebGPT。当审查应该是一个直接的、可重放的模型调用时,使用 $scillm,例如含有角色/系统提示的 GPT-5.5 高推理:

skills/align/run.sh prepare-review \
  --round 1 \
  --reviewer scillm \
  --scillm-model gpt-5.5 \
  --reasoning-effort high \
  --persona-prompt "你是一位持怀疑态度的产品对齐审查员。专注于不匹配的假设和缺失的验收标准。"

prepare-review 后的推荐调用:

# scillm 直接审查
.align/reviews/round-001-scillm-command.sh

# ask 深度审查或 WebGPT oracle
skills/ask/run.sh ask "审查位于 .align/reviews/round-001-ask-request.md 的对齐请求" \
  --deep-review --deep-review-target .align/reviews/round-001-ask-request.md

skills/ask/run.sh ask webgpt "审查位于 .align/reviews/round-001-webgpt-request.md 的对齐请求" \
  --browser-oracle-from skills/oc-subagent/personas/mathematics --oracle-iterations 1

# 仅当对齐因缺少外部事实而受阻时,才进行 dogpile 研究
skills/dogpile/run.sh search "需要解除此对齐障碍的事实" \
  --context-file ".align/reviews/round-001-dogpile-request.md"

使用 add-response 存储得到的审查者文本。审查者收据是对齐的输入;它们本身不是执行批准。

实时组合完整性检查

sanity.sh 是快速的本地检查。它验证轮次循环、阻塞性问题门控、审查者请求生成和锁定模式,而无需消耗外部配额。

sanity-live.sh 是必要的真实世界端到端门控,用于在声明 $align 作为组合技能准备就绪之前。它是可选的,因为它调用实时下游系统:

  • 通过真实 memory 技能的 $memory recall --brief
  • 通过 $align add-response 的项目代理响应摄取
  • 使用生成的对齐请求作为上下文的 $dogpile search
  • 针对已认证浏览器支持的 WebGPT 路径的 $ask webgpt
  • 仅在这些收据验证后创建最终的 alignment_lock.json

仅当本地工作站具有 memory、dogpile 凭据/搜索、Chrome 和已认证的 ChatGPT 会话时运行:

ALIGN_LIVE_E2E=1 skills/align/sanity-live.sh

可选控制:

ALIGN_LIVE_E2E=1 \
ALIGN_WEBGPT_TAB_ID=837343529 \
ALIGN_LIVE_OUTPUT_ROOT=/mnt/storage12tb/skills/align/live-e2e \
skills/align/sanity-live.sh

如果没有提供 ALIGN_WEBGPT_TAB_ID 或 ALIGN_WEBGPT_PROJECT,则实时检查会将 --webgpt-create-tab 传递给 $ask;这仍然需要有效的本地 Chrome/WebGPT 设置。默认情况下,证明工件是 /mnt/storage12tb/skills/align/live-e2e/<timestamp>/report.json。跳过的实时检查不能确立就绪状态。

工件布局

.align/
  alignment_state.json
  alignment_brief.md
  alignment_lock.json
  rounds/
    round-001/
      participant-human.md
      participant-project_agent.md
      participant-scillm.md
      round_summary.md
      questions.json
  reviews/
    round-001-scillm-request.json
    round-001-scillm-command.sh
    round-001-ask-request.md
    round-001-dogpile-request.md
    round-001-webgpt-request.md
    round-001-webgpt-ask-command.sh

/mnt/storage12tb/skills/align/live-e2e/<timestamp>/
  report.json
  memory.stdout
  dogpile.stdout
  webgpt.stdout
  ask-runs/<ask_id>/

停止条件

仅在满足以下所有条件时,才将 ready_for_execution 设置为 true:

  • 没有阻塞性问题仍然未解决
  • 已同意的目标和非目标是明确的
  • 输出形状是具体的
  • 验收标准是可测试或可审查的
  • 来源上下文已被命名
  • 人类或委派的负责人批准了锁定

在以下情况下,将 ready_for_execution 设置为 false:

  • 阻塞性问题仍然存在
  • WebGPT、$scillm、$ask 或项目知识与摘要相矛盾
  • 输出形状仍然是抽象的
  • 参与者暴露了缺失的来源证据
  • 请求的下一个步骤会产生收据,而不是解决实际任务

常见错误

  • 不要使用 $align 作为 $interview 的替代;当缺失的信息纯粹是人类偏好或验收标准时,使用 interview。
  • 不要使用 $align 作为 $review-code、$review-plan 或 $plan-iterate 的替代;对齐发生在这些技能之前。
  • 不要手动总结 WebGPT 或 $ask。使用它们的实际运行时并存储工件路径或审查者文本。
  • 不要因为审查者通过了而对齐锁定就认为完成。项目代理必须合并结果并清除阻塞性问题。

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/agent-ecosystem

Canonical map and shared contracts for the agent-governance ecosystem: the pi.receipt_envelope.v1 boundary envelope, the component graph, and the rules for which component owns which schema. Use when wiring a skill or extension into the shared receipt world, when asking how shame, triage-error, tau, ask, project-watchdog, ops-herdr, ponytail, and Memory fit together, or when validating an envelope.

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/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.

相关技能