Communitygithub.com

计划画布

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

计划画布 是什么?

Plan Canvas 是一个用于计划和可视化制品审查循环的工具:AI 代理编写制品,人工在浏览器中审查——注释他们确切指出的元素、聊天、并给出「批准计划 / 请求更改」的裁决——而代理则阻塞在一个 CLI 调用上,该调用将反馈作为 JSON 返回。它受 lavish-axi 启发,围绕 /plan 确认门重新构建为 ECC 原生方案,零依赖。该工具支持 Claude Code、Codex、Cursor、Gemini、OpenCode、Copilot 等所有能运行 shell 命令的代理。工作流基于 CLI + JSON 循环:使用 `ecc-plan-canvas open` 在浏览器中打开制品,`ecc-plan-canvas await` 阻塞等待人工响应,反馈包含注释、聊天消息和裁决(批准/请求更改)。关键模式是将 `await` 作为后台任务运行,以跨轮次保持监听,避免人工消息丢失。画布渲染 Markdown 制品(含 Mermaid 图表)和 HTML 制品,支持实时重载,具备活动状态指示器(“思考中…”/“正在输入…”),并通过转移编码的注释层让用户能精确指向元素。

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

在你喜欢的 AI 中提问

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

文档

计划画布 是做什么的?

计划和可视化制品的审查循环:你编写制品,人工在浏览器中审查——注释他们确切指出的元素、聊天、并给出批准计划 / 请求更改的裁决——而你则阻塞在一个 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 并且必须等待确认:

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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能