Communitygithub.com

计划画板

在本地浏览器画板中打开计划和 HTML 工件,供人类标注元素、聊天、批准或请求更改,无需离开页面。在呈现计划以供审查,或需要类似反馈时使用。

计划画板 是什么?

Plan Canvas 是一个用于计划和可视化工件审查循环的技能。它允许 AI 代理在本地浏览器中打开工件(Markdown 计划或 HTML 文件),人类可以标注具体元素、进行聊天,并给出“批准计划”或“请求更改”的裁决,所有交互都在一个独立的画板中进行。代理通过单个 CLI 调用 `ecc-plan-canvas await` 阻塞等待,并接收结构化的 JSON 反馈,包含聊天、标注和裁决。该技能受 `lavish-axi` 启发,但完全围绕 `/plan` 确认门控进行了原生重构,零依赖,并且独立于模型和工具链(支持 Claude Code、Codex、Cursor、Gemini 等)。它通过共享的环回服务器(127.0.0.1:4517)按工件路径管理多个会话,支持 Mermaid 图表渲染,并提供后台监听、回复和活动状态指示功能。这对于需要人类确认或精确反馈的复杂计划、设计和报告审查特别有用,避免了代理在终端中无方向地等待。

兼容平台✓Claude Code✓Codex CLI✓Cursor✓Gemini CLI✓OpenCode
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/plan-canvas

在你喜欢的 AI 中提问

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

文档

Plan Canvas(计划画板)

计划和可视化工件的审查循环:你编写工件,人类在浏览器中审查 —— 标注他们所指的确切元素、聊天、并给出 批准计划 / 请求更改 的裁决 —— 而你则阻塞在一个 CLI 调用上,该调用将他们的反馈作为 JSON 返回。

灵感来自 lavish-axi;围绕 /plan 确认门控进行了 ECC 原生重构,零依赖。

何时使用

  • 你刚刚编写了一个计划工件(来自 /plan 的 .claude/plans/*.plan.md),需要 CONFIRM/批准决策 —— 画板的裁决取代了键盘输入的“是/继续”。
  • 用户应该 指向 要更改的内容:审查设计、对比、报告或任何本地 .md / .html 工件。
  • 用户请求 /plan-canvas、可视化审查,或“在浏览器中打开它”。

请勿用于:差异审查(/code-review)、运行 Web 应用或远程 URL。画板仅服务于本地工件文件。

工作方式

调用 CLI 命令 ecc-plan-canvas —— 由 ecc-universal 包提供的二进制文件(在全局/插件安装后位于 PATH 中;对于插件安装,node "$CLAUDE_PLUGIN_ROOT/scripts/plan-canvas.js" 也同样有效)。在你正在审查的项目目录中运行它;它可以从任何工作目录运行。它管理一个由所有会话共享的分离式环回服务器(127.0.0.1:4517),以工件路径为键 —— 无需跟踪会话 ID。

这个工作流是一个纯 CLI 加 JSON 的循环,因此与模型和工具链无关:任何能够运行 shell 命令并读取标准输出的代理都可以以相同的方式驱动它(Claude Code、Codex、Cursor、Gemini、OpenCode、Copilot)。通过你的工具链支持技能的任何方式触发它 —— 例如 Claude Code 中的 /plan-canvas,Codex 中的 $plan-canvas —— 或者直接运行 ecc-plan-canvas 命令。

# 1. 在用户浏览器中打开工件(立即返回)
ecc-plan-canvas open .claude/plans/feature.plan.md

# 2. 阻塞直到人类响应。保持运行;如果中断则重新运行:
#    队列中的反馈永远不会丢失。
ecc-plan-canvas await .claude/plans/feature.plan.md

保持监听,否则人类会对空椅子说话

只有当 await 实际在会话上驻留时,反馈才能到达你。如果你的回合结束时没有人在监听,消息会留在队列中,从人类的角度看,发送似乎没有任何作用。

因此,当你的工具链支持时,将 await 作为后台任务运行(在 Claude Code 中,使用 run_in_background: true 的 Bash 调用)。它会在反馈到达时立即退出,工具链将 JSON 交给你,这样循环就能在回合之间保持活跃,而不是随着前台调用而终止。前台的 await 也可以工作,但只能持续到工具链超时为止。

存在两个后盾,但都不能成为忽略上述规则的借口:

  • ecc-plan-canvas pending 列出没有监听器而排队的反馈。每当你不确定是否遗漏了某些内容时检查它。
  • stop:plan-canvas-pending 钩子会在画板反馈未送达时阻止你的回合结束,并将消息交给你。如果你从该钩子读取反馈,说明你过早停止了监听。

await 在人类操作时打印 JSON:

{
  "status": "feedback",
  "items": [
    { "kind": "annotation", "text": "把这分成两个阶段",
      "anchor": { "selector": "h2:nth-of-type(3)", "tag": "h2", "snippet": "阶段2: 迁移" } },
    { "kind": "verdict", "verdict": "request-changes" }
  ]
}
  • kind: "chat" —— 自由格式消息;在画板中回答,而不是终端。
  • kind: "annotation" —— 锚定到元素的反馈(anchor.selector、anchor.snippet 显示他们指向的内容;anchor.textRange.text 在他们高亮了一段文字时提供)。
  • kind: "verdict" —— approve 表示计划已确认:停止轮询,结束会话,开始实施。request-changes 表示修订工件(画板将实时重新加载它)并保持循环进行。

3. 始终在画板中响应,然后继续监听。一个命令同时完成两件事:

ecc-plan-canvas await <file> --reply "已经按照要求拆分阶段2,请查看。"

人类的每条消息都要在画板中得到回复,即使只是一句“正在处理,现在重写风险表。”画板聊天面板中的沉默与破损的画板无法区分,而这正是此循环要防止的故障。在那里回答,而不仅仅是终端中。

在你工作时,用活动指示器保持聊天的真实性:

# 动画“代理正在思考...”气泡;在长时间工作时刷新它
ecc-plan-canvas typing <file> --state thinking
# 在回复即将到来之前切换到“代理正在输入...”
ecc-plan-canvas typing <file> --state typing

await 在将一批结果交给你时会自动设置为 thinking,而 --reply 会清除它。两种状态都会自动过期,因此崩溃的代理会诚实地显示为“已排队”,而不会让人类永远看着那些点。如果修订需要超过一分钟,请刷新 thinking。

4. 结束 当审查结束时:ecc-plan-canvas end <file>。

图表(Mermaid)

当计划的某部分涉及流程图、架构图、时序图、状态机、ER 模型或依赖关系图时,将其编写为围栏 ```mermaid 块,而不是 ASCII 艺术或一大段文字 —— 画板会将其渲染为带主题的图表,人类可以指向它。当图片比段落更容易阅读时使用它;对于简单的列表或表格则跳过。

```mermaid
flowchart LR
  A[市场解决] --> B{有观察者?}
  B -->|是| C[入队任务] --> D[扇出工作进程]
```

图表以 ECC 深色主题和强调色板渲染。Mermaid 从固定的 CDN 加载到浏览器中;如果 CDN 不可用(离线),该块会降级为显示其源代码,因此审查永远不会被阻塞。在离线环境中,将本地镜像指向 ECC_PLAN_CANVAS_MERMAID_URL。

规则

  • Markdown 工件以 ECC 的计划模板渲染(包括 Mermaid 块);.html 工件按原样渲染,并注入标注层。有关 HTML 编写的指导,请使用 frontend-design-direction 和 artifact-design 技能。
  • 编辑工件文件以进行修订 —— 画板在保存时实时重新加载。永远不要重新运行 open 来刷新。
  • {"status": "ended", "endedBy": "user"}(或反馈批次中的 sessionEnded: true)表示用户关闭了审查:停止轮询,在聊天中传递剩余的更新,不要重新打开。该会话上的普通 open 会被拒绝;仅当用户要求恢复时传递 --reopen。
  • 同级资产(图片、CSS)必须位于工件旁边,并通过相对路径引用。
  • 服务器仅限环回,并在空闲 30 分钟后退出(ECC_PLAN_CANVAS_IDLE_MS);stop 显式关闭它。状态存储在 ~/.claude/plan-canvas/(ECC_PLAN_CANVAS_STATE_DIR)中。

示例

计划批准流程 —— /plan 写入 .claude/plans/notifications.plan.md 并且必须 WAIT 等待确认:

ecc-plan-canvas open .claude/plans/notifications.plan.md
ecc-plan-canvas await .claude/plans/notifications.plan.md
# → {"status":"feedback","items":[{"kind":"verdict","verdict":"approve"}]}
ecc-plan-canvas end .claude/plans/notifications.plan.md
# 计划已确认 — 开始实施

修订循环 —— 反馈到达,你编辑文件,回复,继续监听:

# await 返回了标注 → 编辑 .plan.md(画板实时重新加载)
ecc-plan-canvas await <file> --reply "已重做风险表。"
# → 再次阻塞,直到下一次响应

反模式

  • 使用 --timeout-ms 在循环中进行轮询。它仅用于测试。保留普通的 await 运行。
  • 在审查仍然打开时,没有 await 监听就结束你的回合。这是人类体验为“我发送了一条消息,但什么也没发生”的唯一故障。
  • 读取反馈但仅在终端中回答。人类正在看着画板。
  • 在用户发起的结束之后重新打开,“只是为了展示”某些东西。
  • 将整个计划粘贴到聊天中 并且 打开画板 —— 选择画板,终端摘要保持在一行。
  • 从状态文件中解析画板聊天 —— 你需要的一切都通过 await 到达。

设计说明和起源: docs/design/plan-canvas.md。

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能