prototype
Isolated hookless worktree sandbox for zero-friction proof-of-concept builds, then a clean-room re-verification that promotes a successful POC into a real deploy. Triggers: prototype, /prototype, proof of concept, POC, spike, throwaway build, build without hooks, sandbox this idea, hookless worktree, prototype then ship, promote the prototype.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- prototype
- description
- Isolated hookless worktree sandbox for zero-friction proof-of-concept builds, then a clean-room re-verification that promotes a successful POC into a real deploy. Triggers: prototype, /prototype, proof of concept, POC, spike, throwaway build, build without hooks, sandbox this idea, hookless worktree, prototype then ship, promote the prototype.
02 资源文件 17
- 参考文档reference/honest-limitations.md1.4 KB
- 参考文档reference/promotion-tasks.md3.0 KB
- 脚本scripts/build_sandbox_settings.py9.2 KB
- 脚本scripts/conftest.py505 B
- 脚本scripts/launch_sandbox.py6.7 KB
- 脚本scripts/probe_sandbox_safety.py10.6 KB
- 脚本scripts/prototype_scripts_constants/__init__.py55 B
- 脚本scripts/prototype_scripts_constants/config/__init__.py—
- 脚本scripts/prototype_scripts_constants/config/build_sandbox_settings_constants.py1.3 KB
- 脚本scripts/prototype_scripts_constants/config/launch_sandbox_constants.py641 B
- 脚本scripts/prototype_scripts_constants/config/probe_sandbox_safety_constants.py1.4 KB
- 脚本scripts/prototype_scripts_constants/config/prototype_common_constants.py311 B
- 脚本scripts/test_build_sandbox_settings.py10.1 KB
- 脚本scripts/test_launch_sandbox.py10.4 KB
- 脚本scripts/test_probe_sandbox_safety.py11.5 KB
- 参考文档workflows/promotion.md2.2 KB
- 参考文档workflows/sandbox.md2.8 KB
03 SKILL.md 正文
Prototype
Principle
Give a build the freedom to move fast, then make it earn the right to ship. Two phases, one hard wall between them:
- Sandbox — an isolated worktree where an agent runs under
claude --bare, so the normal TDD, code-rules, plain-language, and stage hooks do not run. The agent builds a proof-of-concept with zero friction. - Promotion — back in the normal, fully-hooked session, the successful POC receives clean-room review and verification under the review guide before it becomes a commit and a pull request.
Two safety gates stay live even in the sandbox: personal-data blocking and destructive-command blocking. A worktree shares the real repo's .git store and rm reaches the whole disk, so these are containment, not the "delays" the sandbox is meant to shed.
Gotchas
Highest-signal content. Append a bullet each time a run fails in a new way.
- A
--settingsfile's hooks still load under--bare(the file is passed explicitly). That is the mechanism for keeping the two safety gates, not a bug. - The two safety hooks must point at the real installed scripts and import their
*_constantspackages at runtime.scripts/build_sandbox_settings.pyresolves each hook's command from the live~/.claude/settings.jsonand registers it on the matchers the sandbox needs — personal-data on Write, Edit, MultiEdit, and Bash; destructive-command on Bash — so the paths stay correct on any machine and both gates cover the write surface. Do not hand-write the hook paths or matchers, and do not inherit whatever matcher the live config happens to use (a personal-data gate wired only to a narrow tool leaves disk writes ungated). - Under
--dangerously-skip-permissionsanaskdecision is auto-resolved, so only a harddenyblocks a destructive command. The settings file carries anenvblock that setsCLAUDE_DESTRUCTIVE_DENY_MODE, which turns the destructive gate's terminalaskinto adeny. The probe runs the gate under that env block and passes only on the hard deny.
Refusal cases — first match wins:
- Not in a git repository. Respond:
Prototype needs a git repo to branch a worktree from. Run this from inside one. - The
fresh-branchskill is not installed. Respond:Prototype composes fresh-branch to make the sandbox worktree, and it is not installed. Install claude-dev-env first. - The
claudeCLI is not on PATH. Respond:The sandbox launches a headless claude session, and the claude CLI is not on PATH.
Process
Two phases. Run the sandbox phase first; run the promotion phase only when the POC succeeds and the user wants it shipped.
Phase 1 — Sandbox
Follow workflows/sandbox.md. In short:
- Invoke the
fresh-branchskill to create an isolated worktree offorigin/main. Keep its returnedworktree_pathandbase_commit. - Run
scripts/build_sandbox_settings.pyto emit the minimal safety settings (personal-data and destructive-command gates only). - Run
scripts/probe_sandbox_safety.py --settings <path>and confirm both gates block. Do not continue on a non-zero exit. - Run
scripts/launch_sandbox.pyto start the hooklessclaude -p --baresession in the worktree with those settings and the POC task. - Read what the sandbox built. Decide whether the POC proves the idea.
Phase 2 — Promotion
Run only in the normal, fully-hooked session — never inside the sandbox. Follow workflows/promotion.md, which drives the clean-room task seeds in reference/promotion-tasks.md: fresh branch off live origin/main, POC content as an uncommitted diff, cleanup and privacy sweep, review and verification under the review guide, then commit by hand per git-workflow and a draft PR handed to a PR-loop skill. State the two honest limitations from reference/honest-limitations.md.
Task seeding
At the start of Phase 2, register every item in reference/promotion-tasks.md as a session task (TaskCreate, or TodoWrite if that is the host tool). Work only from the task list. Mark each complete with evidence. Do not track promotion as a markdown checklist.
Sub-skills
| Skill / agent | When | Produces | If missing |
|---|---|---|---|
fresh-branch |
Sandbox step 1; Promotion step 2 | isolated worktree JSON (worktree_path, base_commit, repo_root) |
Refuse — see refusal cases |
privacy-hygiene |
Promotion step 5 | personal-data and secret sweep of the diff | Warn; do a manual review before continuing |
| Review guide | Promotion step 6 | review and verification of the real diff | Stop and report the incomplete promotion |
autoconverge (default; pr-converge or bugteam as alternatives) |
Promotion step 9 | the PR converged to ready | Stop after the draft PR; tell the user to converge manually |
Degree of freedom
Low on the skill's own mechanics — the launch flags and the promotion order are fragile with cliffs, so they live in scripts and a fixed task list, not in prose the agent reconstructs. High inside the sandbox — the sandboxed agent's build freedom is the whole point.
File index
| File | Purpose |
|---|---|
SKILL.md |
This hub — principle, gotchas, when-applies, process, sub-skills, file index |
workflows/sandbox.md |
Phase 1 steps: worktree, safety settings, probe, hookless launch |
workflows/promotion.md |
Phase 2 steps: the clean-room re-verification that drives the promotion task seeds |
reference/promotion-tasks.md |
Task-seed catalog for the clean-room protocol (register via the task tool) |
reference/honest-limitations.md |
The two fixed statements to make on every promotion |
scripts/build_sandbox_settings.py |
Emit the minimal safety --settings: resolve each hook's command from live settings, register it on the required matchers |
scripts/launch_sandbox.py |
Launch the hookless claude -p --bare sandbox session in the worktree |
scripts/probe_sandbox_safety.py |
Prove both safety gates block before trusting the sandbox |
Folder map
SKILL.md— hub.workflows/— the two phase workflows.reference/— promotion task seeds and the honest-limitation statements.scripts/— the settings builder, the launcher, the safety probe, theirprototype_scripts_constantspackage, and paired tests.
04 同仓库更多 Skills
update
Fast-forwards a local repository's main branch to a remote's main after confirming the repo path and source remote through AskUserQuestion. Use when the user says '/update', 'update main', 'fast-forward main', 'sync main from origin', 'pull latest main into <path>', or 'bring main up to date'.
source-command-sr-loop
Converging cleanup loop: repeat /simplify until clean, then repeat /code-review --fix until clean
skill-builder
Skill lifecycle: classify, scaffold, write via the skill-writer-agent, self-audit, compose sub-skills, polish description triggers, enforce deterministic scripts. Triggers: build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, skill composition, description trigger catalog, deterministic skill scripts.
session-tidy
Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.
session-log
Logs a session report as an HTML page, tracks vault context, extracts decisions, and outputs a /rename command. Use for /session-log, 'journal this session', 'log this work', 'session report', 'summarize/log/record this session', 'save session', 'capture session', or 'document what we did'.
run-claude-dev-env
Build, install, run, and test the claude-dev-env installer. Use when asked to run claude-dev-env, install the Claude Code config into ~/.claude, drive the installer, smoke-test it against a sandbox, or run its test suite.