building

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Building Cap

构建 Cap

Use
/building <request>
in Cursor or Claude Code, or
$building <request>
in Codex. Each invocation authorizes implementing the feature in a new worktree, provisioning its disposable development resources, running verification, recording and uploading a demonstration into the user's
PR's
Cap folder, and opening a pull request. Honor narrower user instructions. Merging and production deployment remain separate actions.
Use the repository containing the requested Cap project. Keep the original checkout, its index, branches, running services, and recordings untouched. This workflow replaces the shared-checkout mechanics of
$build
; do not invoke that skill inside this workflow.
The helper is
scripts/building.mjs
relative to this skill. Use its absolute path when working in a newly created worktree, which might predate the repository copy of this skill. Run
npm ci --prefix <skill-directory> --ignore-scripts --no-audit --no-fund
once if the provider dependencies are missing.
node <helper> help
lists commands. Read editors.md when installing or checking discovery in another editor; all editors use the same scripts and session registry.
在 Cursor 或 Claude Code 中使用
/building <request>
,或在 Codex 中使用
$building <request>
。每次调用都授权在新 worktree 中实现该功能、预配其一次性开发资源、运行验证、将演示录制并上传到用户的
PR's
Cap 文件夹,以及创建 pull request。遵循范围更具体的用户指令。合并与生产部署仍是独立操作。
使用包含所请求 Cap 项目的仓库。保持原始 checkout、其 index、分支、正在运行的服务和录制内容不变。此工作流取代
$build
的共享 checkout 机制;不要在此工作流中调用该 skill。
相对于此 skill,helper 位于
scripts/building.mjs
。在新建的 worktree 中工作时,应使用其绝对路径,因为该 worktree 可能早于仓库中此 skill 的副本。如果缺少 provider 依赖,则运行一次
npm ci --prefix <skill-directory> --ignore-scripts --no-audit --no-fund
。
node <helper> help
列出可用命令。在其他编辑器中安装或检查 skill 发现功能时,读取 editors.md;所有编辑器使用相同的 scripts 和 session registry。

Publication privacy

发布隐私

Use neutral GitHub metadata. Branch names, commit messages, PR titles/descriptions, comments, release notes, and demo titles must not mention Codex, Cursor, Claude, model names, or automated authorship. Use
building/<feature>-<id>
branches and conventional commit titles describing the actual change. Never add tool signatures, generated-by text, co-author trailers, or other attribution. This naming rule applies whichever editor runs the workflow.
Never put secrets, sensitive information, or real people's personal data in committed content, filenames, commit messages, GitHub PR titles/descriptions, comments, attachments, or linked demonstrations. This includes credentials, tokens, cookies, signed URLs, connection strings, customer names, email addresses, phone numbers, account identifiers, recordings, and private support or billing details. Choose public-safe feature names before creating branches, recipes, or video titles. Use synthetic fixtures and reserved example domains. Keep raw logs, local absolute paths, database/provider receipts, and session state out of Git and GitHub text; a private repository is not an exception.
Before every commit, inspect the exact staged diff and proposed message. Before every push, review all outgoing commits, including intermediate versions that a later commit removes. Before each GitHub write or Cap upload, inspect the final text or media actually being published. Summarize test outcomes in safe language instead of pasting commands or raw output; inspect screenshots, video frames, and audio too. Use an available secret scanner as an additional check, never as proof that personal data is absent. Use the user's established public Git identity and GitHub no-reply email rather than publishing a private author or committer email; do not alter shared Git configuration.
If anything sensitive appears or cannot be confidently classified, sanitize or replace it before proceeding. Do not publish first and clean it up later. If exposure has already occurred, stop further publication, report the affected artifact without repeating the value, and coordinate credential revocation and history cleanup rather than silently force-pushing. Do not silently redact application behavior or required source values; use configuration or synthetic fixtures and preserve the intended feature.
使用中性的 GitHub metadata。分支名称、commit messages、PR 标题/描述、comments、release notes 和 demo titles 均不得提及 Codex、Cursor、Claude 或模型名称,也不得表明是自动化创作。使用
building/<feature>-<id>
分支,并使用描述实际变更的 conventional commit 标题。不得添加工具签名、generated-by 文本、co-author trailers 或任何其他署名信息。无论由哪个编辑器运行此工作流,此命名规则都适用。
绝不要在提交到仓库的内容、文件名、commit messages、GitHub PR 标题/描述、comments、附件或关联演示中放入 secrets、敏感信息或真实人员的个人数据。这包括 credentials、tokens、cookies、signed URLs、connection strings、客户名称、email addresses、phone numbers、account identifiers、录制内容,以及私密的支持或 billing details。创建 branches、recipes 或 video titles 前,选择可安全公开的功能名称。使用 synthetic fixtures 和保留的示例域名。将 raw logs、本地绝对路径、数据库/provider receipts 和 session state 排除在 Git 和 GitHub 文本之外;即使是私有仓库也不例外。
每次 commit 前,检查确切的 staged diff 和拟用的 message。每次 push 前,审查所有即将推送的 commits,包括被后续 commit 删除的中间版本。每次 GitHub 写入或 Cap 上传前,检查实际将要发布的最终文本或媒体。以安全的措辞总结测试结果,而不是粘贴 commands 或 raw output;同时检查 screenshots、video frames 和 audio。将可用的 secret scanner 作为额外检查,但绝不能将其视为不存在个人数据的证明。使用用户既有的公开 Git identity 和 GitHub no-reply email,而不是公开私有 author 或 committer email;不要修改共享 Git 配置。
如果出现任何敏感内容,或无法有把握地判定其性质,应先清理或替换后再继续。不要先发布再清理。如果已经发生暴露,停止后续发布,报告受影响的 artifact,但不要重复具体值,并协调 credential 吊销与 history 清理,而不是擅自 force-push。不要静默删改 application behavior 或必需的源代码值;应使用 configuration 或 synthetic fixtures,并保留预期功能。

Prepare and resume

准备与恢复

Read the selected repository's instructions. Fetch the remote default branch without moving the original checkout. Run
new --repo <repo> --name <short-feature-name> --target web|desktop|gpui|fullstack --base <remote-default-ref>
and use the returned worktree for every source edit, generator, command, commit, and push. Resume with the existing session ID; do not create replacement resources after an uncertain response.
Read environment.md before provisioning. Prefer the PlanetScale MCP to create the exact development branch named in the session, then run
database-attach
. The authenticated
database-create
helper is the fallback when that MCP is unavailable. Never attach production, staging, another session's branch, or production credentials. Create expiring credentials and seed the owned development branch. Generate migrations through Cap's existing generator; never edit generated SQL or metadata by hand.
Run short commands through the helper's
run
wrapper and long-lived servers through
serve
so inherited production integration credentials and unmanaged dotenv files cannot accidentally configure the feature. Explicitly configure only required test services. There is no automatic production fallback for storage, payments, email, OAuth, or media processing.
Read desktop.md when native crates or desktop applications are involved. Use Bun's shared package cache and private installations. Warm private native/build directories using copy-on-write only from a matching, idle checkout. Never symlink a writable
target
, whole
node_modules
, app profile, or user recording directory between worktrees.
读取所选仓库的说明。获取 remote 默认分支,但不移动原始 checkout。运行
new --repo <repo> --name <short-feature-name> --target web|desktop|gpui|fullstack --base <remote-default-ref>
,并将返回的 worktree 用于每一次源代码编辑、生成器调用、command、commit 和 push。使用现有 session ID 恢复;收到不确定的响应后,不要创建替代资源。
在预配资源前,读取 environment.md。优先使用 PlanetScale MCP 创建 session 中准确命名的 development branch,然后运行
database-attach
。MCP 不可用时,使用需要身份验证的
database-create
helper 作为 fallback。绝不让该功能连接 production、staging、其他 session 的 branch,也绝不接入 production credentials。创建有过期时间的 credentials,并为所属 development branch 填充种子数据。通过 Cap 现有的 generator 生成 migrations;绝不手动编辑生成的 SQL 或 metadata。
通过 helper 的
run
wrapper 运行短命令,通过
serve
运行长期服务器,避免继承的 production integration credentials 和未受管理的 dotenv 文件意外配置该功能。仅显式配置必需的 test services。对于 storage、payments、email、OAuth 或 media processing,不存在自动的 production fallback。
涉及 native crates 或 desktop applications 时,读取 desktop.md。使用 Bun 的共享 package cache 和私有 installations。仅从匹配且空闲的 checkout 使用 copy-on-write 预热私有 native/build 目录。绝不要在 worktrees 之间 symlink 可写的 target、整个 node_modules、app profile 或用户 recording 目录。

Implement and verify

实现与验证

Make the smallest complete change, trace its callers and platform behavior, and apply repository checks to the affected scope. Preserve an acceptance checklist including error states, permissions, and old data. Establish the demo's expected behavior before implementation; assertions must test that behavior, not just successful page loading.
Commit coherent changes in the owned worktree. Run final checks through
check
so successful results are bound to the committed SHA. Recheck against current remote main, including generated migration conflicts and deployment ordering. A successful Git merge simulation does not prove runtime compatibility.
Read recording.md for the Daytona/Cap path. Use a tracked, reviewed feature recipe and an assertion-driven walkthrough of the actual change. Before credentialed capture, independently inspect source provenance, changed code and dependencies, recipe commands, and credential scope, then record the actual SHA-bound review with
capture-review
. Untrusted or fork-controlled code receives no credentials until that review is complete. Verify the resulting video's content and reviewer access in a browser before calling it a successful demonstration. Use
preview
for local feature browsing: each session gets a separate Chrome profile, preventing cookies and local storage from colliding across ports. Preserve failed evidence; never replace a failed Cap CLI capture with a different recorder without reporting the change.
For macOS/Windows-specific behavior, obtain evidence on that OS. Linux browser or native demonstrations do not establish other-platform behavior. Infrastructure-only changes can give a concrete nonvisual explanation and relevant test evidence instead of a staged visual demo.
进行最小且完整的变更,追踪其 callers 和 platform behavior,并对受影响范围应用 repository checks。保留一份 acceptance checklist,其中包括 error states、permissions 和 old data。实现前确定 demo 的预期行为;assertions 必须测试该行为,而不只是验证页面成功加载。
在所属 worktree 中以逻辑一致的方式提交变更。通过
check
运行最终 checks,使成功结果与 committed SHA 绑定。针对当前 remote main 重新检查,包括 generated migration 冲突和 deployment ordering。Git merge simulation 成功并不能证明 runtime compatibility。
对于 Daytona/Cap 路径,读取 recording.md。使用受版本控制且经过审查的 feature recipe,以及由 assertions 驱动的实际变更 walkthrough。在需要凭据的 capture 前,独立检查 source provenance、变更代码和 dependencies、recipe commands 和 credential scope,然后使用
capture-review
记录绑定到实际 SHA 的 review。在 review 完成前,不向不受信任或 fork 控制的代码提供 credentials。在浏览器中验证生成视频的内容和 reviewer access 后,才能称为成功的 demonstration。使用
preview
浏览本地功能:每个 session 使用独立的 Chrome profile,防止 cookies 和 local storage 在不同端口之间发生冲突。保留失败证据;绝不在未报告变更的情况下,用其他 recorder 替换失败的 Cap CLI capture。
对于 macOS/Windows 特定行为,在相应 OS 上获取证据。Linux 上的 browser 或 native demonstrations 不能证明其他平台的行为。仅涉及基础设施的变更可以提供具体的非视觉说明和相关测试证据,以代替 staged visual demo。

Publish

发布

Create or reuse a draft PR for the owned branch, then record its URL using
pr
. Push only the feature branch without force. Keep the PR draft while required verification, video playback, native checks, or review remain incomplete. Do not let fork PR code run with provider or publishing credentials in privileged CI.
Upload the verified capture using
share
; the helper finds or creates
PR's
and moves the video there. An uncertain upload must be reconciled by its recorded title/ID, never blindly repeated. Write a short ELI5 file explaining the previous problem, the new behavior, and its benefit.
pr-body --eli5 <file>
produces a starting body with the recording and current-SHA checks. Add factual migration notes, platform coverage, and remaining limitations; remove limitations only after verification. Use
gh pr edit --body-file
, preserving unrelated reviewer-authored content.
Use the installed
greptile-pr-loop
skill when available, fixing actionable findings through its stop condition. Any changed commit invalidates old evidence: rerun affected checks, update the recording, and review the final PR head. In Codex, attach the created PR to the current task using
attach_artifact
when available; Cursor and Claude Code can report the GitHub URL directly. These editor integrations are optional; resource management uses the shared CLI. Mark it ready only after the required gates pass; otherwise report the concrete blocker and keep the draft.
为所属 branch 创建或复用 draft PR,然后使用
pr
记录其 URL。仅 push feature branch,不要 force push。在必需的 verification、video playback、native checks 或 review 尚未完成时,保持 PR 为 draft。不要让 fork PR 代码在 privileged CI 中使用 provider 或 publishing credentials 运行。
使用
share
上传通过验证的 capture;helper 会找到或创建
PR's
,并将 video 移至其中。上传结果不确定时,必须通过记录的 title/ID 进行核对,绝不盲目重复。编写一份简短的 ELI5 文件,说明此前的问题、新行为及其益处。
pr-body --eli5 <file>
生成包含 recording 和 current-SHA checks 的正文初稿。补充事实性的 migration notes、platform coverage 和 remaining limitations;只有在验证完成后才能移除 limitations。使用
gh pr edit --body-file
,并保留与本次修改无关的 reviewer-authored 内容。
可用时,使用已安装的
greptile-pr-loop
skill,并按照其 stop condition 修复可操作的问题。任何 changed commit 都会使旧证据失效:重新运行受影响的 checks、更新 recording,并 review 最终 PR head。在 Codex 中,如果
attach_artifact
可用,则将创建的 PR 附加到当前 task;在 Cursor 和 Claude Code 中,可直接报告 GitHub URL。这些 editor integrations 是可选的;resource management 使用共享 CLI。仅在所有 required gates 通过后,才将 PR 标为 ready;否则报告具体的 blocker,并保持 draft。

Finish

完成

Delete owned Daytona sandboxes after evidence is downloaded; the helper also sets expiry limits. After the PR is published, required checks pass, and the Cap upload is verified playable and accessible, run
finish
automatically. It stops owned server processes and removes the disposable development database and clean, published worktree while the PR remains open. Do not keep paid previews running unless the user asks for one. Keep recordings, Git branches, receipts, and shared caches.
resume
recreates the worktree from its retained feature branch; reprovision and reseed its development database for follow-up work.
close
also supports cleanup after a PR is merged or closed. Never delete resources based on age alone or break a lock without checking its host, process, and pending operation.
Report the PR, Cap link, actual checks, unverified platforms, and retained resources. Do not call a scaffold, a passing compile, or an accepted upload end-to-end success.
证据下载完成后,删除所属 Daytona sandboxes;helper 还会设置过期时间。PR 已发布、required checks 已通过,且 Cap upload 已验证为可播放且可访问后,自动运行
finish
。它会停止所属 server processes,并在 PR 保持打开的情况下,移除一次性 development database,以及处于 clean 状态且已完成发布的 worktree。除非用户要求,否则不要让付费 previews 持续运行。保留 recordings、Git branches、receipts 和 shared caches。
resume
根据保留的 feature branch 重新创建 worktree;为后续工作重新预配并初始化 development database。
close
还支持在 PR 已 merged 或 closed 后进行清理。绝不只根据资源存在时间删除资源,也绝不在未检查 host、process 和 pending operation 的情况下破坏 lock。
报告 PR、Cap link、实际执行的 checks、未验证的平台和保留的资源。不要将 scaffold、编译通过或仅被接受的上传称为端到端成功。