Use when reimplementing, cloning for compatibility, or behavior-migrating an existing product with AI agents under clean-room rules — drives the spec/inventory/oracle/ratchet loop, enforces the legal boundary, and gates completion on measured evidence. Triggers include "clean room", "重实现", "复刻", "clone this app's behavior", "behavior parity", "spec-driven reimplementation".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Cleanroom Reimplementation?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/climashscape-cleanroom-reimplementation)
---
name: cleanroom-reimplementation
description: Use when reimplementing, cloning for compatibility, or behavior-migrating an existing product with AI agents under clean-room rules — drives the spec/inventory/oracle/ratchet loop, enforces the legal boundary, and gates completion on measured evidence. Triggers include "clean room", "重实现", "复刻", "clone this app's behavior", "behavior parity", "spec-driven reimplementation".
---
# Clean-room reimplementation loop
Run the methodology of this repository as a procedure with gates. This
skill assumes the repository layout (spec/inventory, corpus, tools/,
AGENTS.md); adapt paths if the host project differs.
## Override rules (outrank the current plan until evidence overrides them)
- **R1 Never open the reference implementation.** Not its code, not its
decompilation, not its embedded assets. Observed behavior and public
specs only. If a task seems to require reading it, stop and re-scope.
- **R2 The oracles decide.** A feature is done when its golden
comparison, corpus floor and acceptance test pass — not when the code
looks right.
- **R3 Floors never fall.** If your change lowers coverage, corpus pass
counts, or any budget, the change is wrong.
- **R4 On the second failure of the same shape, stop and re-read the
spec.** Two failures mean the model is wrong, not the parameters
(two-strike rule, distilled from apk-reverse).
## Procedure
1. **Classify** — read the project's AGENTS.md and
`docs/roadmap.md` (honest assessment) first. State in one line which
feature id you are working on.
2. **Gate G1 — spec exists.** The feature has a spec entry and
acceptance criteria; ambiguity is marked `[NEEDS CLARIFICATION]`
and escalated, never guessed.
3. **Gate G2 — oracle exists.** A golden master, corpus file, or pixel
reference for this behavior is present (or you record one via
`tools/golden_master.py record` from an approved recording — never
from the reference's installed files).
4. **Implement** from the spec alone. Run the relevant tests +
`tools/inventory_parity.py check` + affected corpus tests.
5. **Gate G3 — measured pass.** All comparisons green; the diff image
(if pixel) inspected; no new `settings that do nothing`.
6. **Gate G4 — bookkeeping.** Update state file, raise the floor you
earned (`tools/inventory_parity.py floor`), append a devlog entry
(landed / numbers / still open / next), add `Assisted-by:` trailer
if your harness supports trailers.
7. **Report.** State what landed with measured numbers and what remains.
"Done" means G1-G4 all pass; anything less is a checkpoint.
## References
- Legal boundary and AI-contamination rules: `docs/02-law-and-cleanroom.md`
- Spec idioms: `docs/03-specifications.md`
- Verification families: `docs/05-verification.md`
- Failure catalogue: `docs/10-failure-modes.md` — a matching row is a
stop signal; read it before the next attempt, not after.
- Tool usage: `tools/README.md`