prototyping
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrototyping
原型设计
Trigger
触发条件
Activate on , a request to prototype a decision or compare
options through a prototype, or a request to keep prototyping through a host
session. Keep this stance until the client says to stop. Treat one-off
"prototype this" work as a one-step session.
/prototyping在 、要求对某个决策进行原型设计或通过原型比较选项,或要求通过 host 会话持续进行原型设计时激活。在 client 表示停止之前,持续保持此工作方式。将一次性的“prototype this”任务视为单步会话。
/prototypingScope
范围
Own the prototyping session directory, shell, step pages, manifest, and
loopback serving. The host owns its questions and plan; the client owns each
decision. Leave the discussed repository unchanged and stop before
implementing a selected option.
负责原型设计会话目录、shell、步骤页面、manifest 和 loopback 服务。host 负责自己的问题和计划;client 负责每个决策。保持所讨论的仓库不变,并在实现选定选项之前停止。
Inputs
输入
- Host steps as they occur, including Consultant or Autoconsultant questions, each Grilling question, Wayfinder ticket questions, and plain choices.
- A client-named slug or path to resume. Fresh requests never inspect sibling sessions.
- A client-supplied state root, or expanded by default.
~/.prototyping
- 随着 host 步骤执行而收到的输入,包括 Consultant 或 Autoconsultant 问题、每个 Grilling 问题、Wayfinder 工单问题以及普通选项。
- client 指定的用于恢复会话的 slug 或路径。新请求绝不检查同级会话。
- client 提供的状态根目录,或默认使用展开后的 。
~/.prototyping
Roles
角色
The agent builds pages, maintains the manifest, and keeps serving alive. The
client chooses options. Host skills keep their own output contract unchanged.
Agent 构建页面、维护 manifest 并让服务保持运行。client 选择选项。host skills 保持各自的输出约定不变。
Procedure
过程
- On activation, resolve one session directory. Resume only an explicitly
named slug or path. Otherwise choose a direct lowercase-hyphen slug from the
topic without listing or reading siblings. Create and initialize
steps/with exactlysteps.jswhen absent. Copywindow.STEPS = [];once when absent and replace itsassets/index.htmlplaceholder with the slug. Run this skill's shipping__SESSION_SLUG__in place; never copy the helper into the session directory.scripts/serve.sh <session-dir> - For every host step, assign the next monotonic integer across the whole session. Preserve the host's label:
n,Question N,Qn, or an empty string for a plain host.Qn (ticket: <name>) - Enumerate substantive options before applying the gate. Consultant and
Autoconsultant use number strings and exclude trailing . Grilling, Wayfinder, and plain hosts use
Other,A, and later letters in presentation order. A prototype has two to five options. A step without enumerable choices usesBandoptions: [].recommended: null - Build a prototype only when the enumerated options differ in a way the client can see or click. Visible structural choices use the UI shape; behavioral choices use the logic shape. Read the step-page contract before building either. Text-only, naming, numeric, approval, and other non-visible choices use a stub and have no step file.
- Append exactly one line per step to :
steps.js. The object containswindow.STEPS.push({...});,n, one-linelabel,title,host,kind,file,options, andrecommended. Use valid compact JSON inside the call.decisioniskindorprototype;stubisfilefor a prototype andsteps/NN-<lowercase-hyphen-step-slug>.htmlfor a stub. Startnullasdecision.nullis always a JSON array of objects shaped exactlyoptions; never use an array of bare keys, even when the page already shows labels.{"key":"1","label":"Option label"} - Run this skill's shipping in place before rendering the host reply. Put exactly one line immediately above the complete host reply. A single-step host gets
scripts/serve.sh <session-dir>. A multi-question round getsPrototypes: <URL>#<n>with every round entry, including stubs. The host text below that line stays byte-identical, and the line never enters the host's fenced question block. An activation-only turn printsPrototypes: <URL>#<n> #<n> ...with no hash.Prototypes: <URL> - When the client answers, edit only that entry's line and set to the option key or the client's exact free-text answer before adding the next step. Keep the rest of the line's data unchanged.
decision - On , leave the files and server running, report the current URL and the resolved shipping helper command
stop prototyping, then drop this stance. Never copy that helper into the session. Later host steps receive no entry or<skill-dir>/scripts/serve.sh <session-dir> stopline.Prototypes:
- 激活时,确定一个会话目录。仅当明确指定 slug 或路径时才恢复会话。否则,根据主题直接选择一个小写连字符 slug,不列出或读取同级会话。创建 ;若
steps/不存在,则使用完全一致的steps.js对其进行初始化。仅当window.STEPS = [];不存在时将其复制一次,并把assets/index.html占位符替换为该 slug。在原地运行本 skill 随附的__SESSION_SLUG__;绝不把辅助脚本复制到会话目录中。scripts/serve.sh <session-dir> - 为每个 host 步骤在整个会话范围内分配下一个单调递增的整数 。保留 host 的标签:
n、Question N、Qn,普通 host 则使用空字符串。Qn (ticket: <name>) - 在应用 gate 前枚举所有实质性选项。Consultant 和 Autoconsultant 使用数字字符串,并排除末尾的 。Grilling、Wayfinder 和普通 host 按展示顺序使用
Other、A和后续字母。每个原型有两个到五个选项。无可枚举选择的步骤使用B和options: []。recommended: null - 仅当枚举出的选项存在 client 可以看到或点击的差异时,才构建原型。可见的结构性选择使用 UI 形态;行为性选择使用逻辑形态。构建任一种页面前,读取 step-page 约定。纯文本、命名、数值、审批及其他不可见选择使用 stub,且不生成步骤文件。
- 每个步骤向 恰好追加一行:
steps.js。该对象包含window.STEPS.push({...});、n、单行label、title、host、kind、file、options和recommended。调用内使用有效的紧凑 JSON。decision为kind或prototype;原型的stub为file,stub 的steps/NN-<lowercase-hyphen-step-slug>.html为file。null初始值为decision。null始终是一个 JSON 对象数组,其结构必须完全为options;即使页面已显示标签,也绝不能使用裸键数组。{"key":"1","label":"Option label"} - 在呈现 host 回复之前,在原地运行本 skill 随附的 。在完整 host 回复正上方恰好放置一行。单步 host 使用
scripts/serve.sh <session-dir>。多问题轮次使用Prototypes: <URL>#<n>,并列出该轮所有条目,包括 stub。该行下方的 host 文本保持逐字节一致,并且该行绝不进入 host 的围栏问题块。仅激活的轮次打印Prototypes: <URL>#<n> #<n> ...,不带 hash。Prototypes: <URL> - client 回答时,只编辑对应条目的行,并在添加下一步骤前将 设置为选项键或 client 的原样自由文本回答。该行其余数据保持不变。
decision - 执行 时,让文件和服务器继续运行;报告当前 URL 以及解析后的随附辅助命令
stop prototyping,然后退出此工作方式。绝不将该辅助脚本复制到会话中。后续 host 步骤不会获得条目或<skill-dir>/scripts/serve.sh <session-dir> stop行。Prototypes:
Outputs
输出
One or redirected session containing the shell,
append-shaped manifest, optional self-contained step pages, ,
, and , plus the served loopback URL and recorded
decisions.
~/.prototyping/<slug>/server.portserver.pidserver.log一个 或重定向会话,包含 shell、追加式 manifest、可选的自包含步骤页面、、 和 ,以及所提供服务的 loopback URL 和已记录的决策。
~/.prototyping/<slug>/server.portserver.pidserver.logExceptions
异常情况
If serving fails after the script's retries, report the session path and its
one reason line, keep building the files, and omit an unverified URL. If a
named session does not exist, ask only for the intended slug or path without
inspecting siblings.
如果脚本重试后仍无法提供服务,报告会话路径及其单行原因,继续构建文件,并省略未经验证的 URL。如果指定的会话不存在,只询问预期的 slug 或路径,不检查同级会话。
QC
质量检查
- Every active host step has one unique monotonic entry, and every answered entry has its decision set before the next step.
- Each file exists, is self-contained, and has exactly one selector per manifest option with accurate recommended and chosen markers.
prototype - Each has
stub; pagination usesfile: null, while labels preserve host numbering.n - The exact URL answers on
/index.html; the recorded PID belongs to127.0.0.1serving the canonical session directory.http.server - The shell title shows the resolved session slug, never the literal
placeholder.
__SESSION_SLUG__ - The session contains only ,
index.html,steps.js, andsteps/,server.port, andserver.pid; no helper script is copied in.server.log - No task file was written outside the resolved session directory, and host text below the one added line is byte-identical.
- 每个活跃 host 步骤都有一条唯一且单调递增的条目,并且每个已回答条目都在下一步骤之前设置其 decision。
- 每个 文件都存在且为自包含文件,manifest 中每个选项都恰好有一个 selector,并带有准确的 recommended 和 chosen 标记。
prototype - 每个 的
stub均为file;分页使用null,标签则保留 host 编号。n - 精确的 URL 在
/index.html上作出响应;记录的 PID 属于从规范会话目录提供服务的127.0.0.1。http.server - shell 标题显示解析后的会话 slug,绝不显示字面量 占位符。
__SESSION_SLUG__ - 会话只包含 、
index.html、steps.js,以及steps/、server.port和server.pid;其中没有复制辅助脚本。server.log - 解析后的会话目录之外未写入任何任务文件,且新增一行下方的 host 文本逐字节一致。
References
参考资料
Read references/step-page.md whenever the gate calls
for a UI or logic prototype page.
当 gate 要求生成 UI 或逻辑原型页面时,读取 references/step-page.md。