clean-room-rebuild
Skill0 starsChanged 43 days agoMITView on GitHub
Use when rebuilding a feature from a shipped program you are authorized to analyze, writing a behavior spec from evidence, setting up an oracle that proves a rebuild is right, running a clean-room loop (read in one session, build in a fresh one), or keeping an evidence ledger, with or without REA.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Facta-Dev/beautifulqttheir own version, first seen Nov 29, 2026
- Facta-Dev/beautifulnodejstheir own version, first seen Nov 29, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Facta-Dev/beautifulnodejs★ 0same name
- Facta-Dev/beautifulqt★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 18 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Run this before any tool touches the artifact, including a file listing.
- Distinctive: line 35
If any box is unchecked or unclear, stop.
- Distinctive: line 41
Ask these before any analysis and write the answers into TASK.md.
- Distinctive: line 54
Every finding enters the evidence ledger the moment it is made.
- Distinctive: line 70
A GUESS cannot be a dependency of a CONFIRMED: If a row's pointer cites a GUESS row, that row is a GUESS too, however solid it looks.
- Distinctive: line 72
Every row states its limits: static or runtime, which version, what the search did not cover.
- Distinctive: line 87
Every obligation rests on CONFIRMED rows only.
- Distinctive: line 96
No code: no pseudocode, no decompiled fragments, no addresses, no internal names from the artifact.
- Distinctive: line 97
No copied strings, except identifiers needed for compatibility (a file extension, a column header a file must carry, a message name another …
- Distinctive: line 100
No assets: no icons, images, fonts or text taken from the artifact.
- Very specific: line 101
Every statement traces to a ledger row, cited inline as [E4].
- Distinctive: line 107
Start a new session in an empty folder, or a separate worktree (a second working copy of a repository).
- Distinctive: line 114
If an oracle needs the original program, the harness reports pass or fail and which case failed.
- Very specific: line 116
Leak check before the handoff: Before SPEC.md crosses to the builder, scan it for anything carried over from the original: raw addresses, …
- Distinctive: line 133
Keep them in their own folder.
- Very specific: line 154
When the verifier runs the build (differential mode), it sorts inputs into ordinary, edge and malformed groups, labels each divergence …
- Distinctive: line 161
Update it whenever the step changes and before every session ends.
- Very specific: line 196
Run REA under a separate configuration profile (set CLAUDE_CONFIG_DIR) and preview setup with a dry run, because the default setup makes …
- Distinctive: line 199
Keep the artifact in a read-only workspace so nothing can modify it and it stays available for later comparison (@zodchiii).
- Distinctive: line 218
No analysis before the gate.
- Distinctive: line 219
No code in SPEC.md.
- Distinctive: line 220
No GUESS as a dependency of a CONFIRMED row or of an obligation.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean-room rebuild
This skill is the discipline around an investigation, not the investigation itself. It analyzes
nothing for you. Whatever reads the shipped program (REA, a disassembler, browser developer tools,
or careful reading), this skill decides whether you may start, how findings are recorded, what the
rebuild must reproduce, how the reading and the building stay apart, and which check gets the last
word. Tool routing, which REA tool fits which target, is a separate concern this skill does not
duplicate; rea doctor lists the tool catalog for your install.
Words used throughout: the artifact is the shipped program file you study. An oracle is the check that says the rebuild is right. SPEC.md is a written description of behavior that contains no code. A clean room keeps the session that reads the artifact apart from the session that builds.
Step 0. Authorization gate (hard stop)
Run this before any tool touches the artifact, including a file listing. Ask the user every item and record the answers in TASK.md.
- The target is one of: software the user owns or wrote; open source under a license that permits this analysis and the planned reuse; or software the user holds written permission to analyze. Record which one, and where the license or permission can be found.
- None of the prohibited-use categories in references/legal-line.md apply to the goal.
- The analysis tool's own disclaimer and terms are respected (for REA, its DISCLAIMER.md), and any commercial analysis engine in use is properly licensed.
- Having a copy is not being treated as permission, and permission to read is not being stretched into permission to run the program, capture its traffic or change a device. Each needs its own yes.
- If the result will ship in a product, the user has been told to get a lawyer's view first.
If any box is unchecked or unclear, stop. Say which box failed and why, do nothing further on the target, and do not suggest ways around the gap. If the source is already public, say so: reading the source beats reconstructing it. Nothing in this skill is legal advice.
Step 1. Scope: four questions
Ask these before any analysis and write the answers into TASK.md. Do not continue while one is blank. (@0xDeniAi's prompt opens with four scoping questions; this is this skill's version.)
- Which feature? One feature, named the way a user would describe it ("what happens when I click Export notes"), never "the whole app."
- Which artifact, and how may you analyze it? Exact path and version. Static reading only, or is running it allowed? Is capturing its network traffic allowed? Any limit from the permission?
- What does done mean? Name the oracle now (Step 6). No oracle, no project.
- What is out of bounds? Files, behaviors, servers, accounts and assets that must not be touched or reproduced.
Step 2. Investigate with an evidence ledger
Every finding enters the evidence ledger the moment it is made. Each one gets a tag (@zodchiii calls the CONFIRMED vs GUESS tag the most important line in the whole setup):
- CONFIRMED: seen directly, with a pointer anyone can re-check.
- GUESS: a reasonable inference nobody has checked yet.
- UNKNOWN: looked for and not found. The pointer records where you looked. Unknown is a valid answer.
| ID | Finding | Tag | Evidence pointer | Limits | How to confirm |
| E1 | <what was seen> | CONFIRMED | <file>:<line> or tool evidence ID | <static only, version, what was not covered> | n/a |
| E2 | <what seems true> | GUESS | rests on E1 | <why it is not proven> | <the experiment that would prove it> |
A pointer is something another person can open: a file and offset, a file and line, a request line in a redacted capture, a screenshot path, a test name, or the analysis tool's own evidence ID.
Rules for the ledger:
- A GUESS cannot be a dependency of a CONFIRMED. If a row's pointer cites a GUESS row, that row is a GUESS too, however solid it looks.
- Every row states its limits: static or runtime, which version, what the search did not cover.
- A GUESS is promoted only by running its "How to confirm" step and adding the new pointer. Rewording is not evidence.
- Show the user the first few rows before going wide, so a wrong direction is caught early.
Step 3. Obligation ledger
List everything the rebuild must reproduce. This is the contract between the two rooms.
| ID | Obligation | Kind | Rests on | Oracle | Covered |
| O1 | <observable behavior, in plain words> | behavior | E1, E4 | <which check, which case> | no |
- Kinds: behavior, format (file layouts, message shapes), edge case, error path (empty input, bad input, missing file). Error paths are the obligations most often forgotten.
- Every obligation rests on CONFIRMED rows only. A GUESS becomes an open question in the spec, never an obligation.
- An obligation is covered only when an oracle exercises it and passes. Every row starts at "no."
Step 4. SPEC.md
The reading session writes it. Skeleton in references/templates.md.
- Behavior only: inputs, outputs, states, formats, edge cases, error paths, open questions.
- No code: no pseudocode, no decompiled fragments, no addresses, no internal names from the artifact.
- No copied strings, except identifiers needed for compatibility (a file extension, a column header a file must carry, a message name another program expects). Each one sits in a "Compatibility identifiers" table with the ledger row that justifies it.
- No assets: no icons, images, fonts or text taken from the artifact.
- Every statement traces to a ledger row, cited inline as
[E4]. A sentence with no row gets a row or gets cut. - GUESS and UNKNOWN rows appear only under "Open questions," never as requirements.
Step 5. Fresh room
- Start a new session in an empty folder, or a separate worktree (a second working copy of a repository). This is the building session.
- It receives exactly three things: SPEC.md, the obligation ledger and the oracle harness.
- It has no analysis tools connected and no access to the artifact, the evidence ledger or the reading session's notes.
- The reading session never pastes code, decompiled output or screenshots into it. A question from the builder goes back as a question; the answer comes back only as an edited SPEC.md.
- If an oracle needs the original program, the harness reports pass or fail and which case failed. Raw byte dumps of the original stay on the reading side.
- Leak check before the handoff. Before SPEC.md crosses to the builder, scan it for anything
carried over from the original: raw addresses, the auto-generated names a decompiler emits (
sub_...,FUN_...,loc_...,param_N,var_...), mangled symbols, register names, or pasted code. Those fragments are what turn a clean-room description into a copy.scripts/spec_leak_check.py SPEC.mdreports them and exits non-zero on a hit; the only allowed exceptions are the identifiers listed in the spec's Compatibility identifiers table. - Know the limit: a new session on the same computer account is a thin wall, because the builder could still read what the reader left on disk. REA's installation guide says true separation calls for a different OS account or a container; @benjistacked makes the same point. Use that level of separation for anything that will ship.
Step 6. Oracles with planted failures
Details for each oracle type, and what each one cannot see: references/oracles.md.
- Plant failures first. Make at least two deliberately broken copies of the build: one with a wrong constant, one with a swapped branch (@N01ennn adds a third: a boundary shifted by one). Keep them in their own folder. Run the oracle on each. Every one must be rejected. If any passes, the oracle is broken: fix it before trusting a single green result.
- Run the suite on the real build and record the result against each obligation.
- Run the literal audit. List every literal in the build (a value written straight into the
code, such as
128.0or a column name) and trace each one to a SPEC.md statement, and that statement to a CONFIRMED row. An untraced literal is a defect. - If any oracle is ever shown faulty, re-run everything it ever passed.
Why step 3 exists: in the TH08 rebuild described by @N01ennn and in the project's Touhou write-up, a function compared a value against 0.0 where the original compared against 128.0, and still passed an exact byte comparison, because the comparison adjusted addresses and never read the value stored there. An audit of 1,548 floating-point literals then turned up twelve further mistakes in five functions that had already been accepted. The blind-spot rule: a check only sees what it looks at. For every oracle, write down what it cannot see and cover that with a different check.
Step 7. Coverage report and resume
Coverage = obligations covered / total obligations. Report it as that fraction, never as "done," next to the planted-failure result, the literal-audit result, every uncovered obligation, every open GUESS or UNKNOWN row, and the next experiment. Format in references/templates.md.
When the verifier runs the build (differential mode), it sorts inputs into ordinary, edge and malformed
groups, labels each divergence compatible, wrong or crash, and ends with a one-line machine summary such
as RESULT wrong=0 crash=0 mutants_survived=0. Zero across the planted mutants and all three groups is
parity; a surviving mutant means the oracle is broken, not that the build is right.
Progress lives in TASK.md in the working folder, so any new session can pick up the work (@0xDeniAi saves progress to a task file; @N01ennn ends each session by updating a notes file). Update it whenever the step changes and before every session ends. A new session reads TASK.md first and resumes at "Next action." Never rely on chat memory for state.
Team mode: four agents
The steps above can be run by one agent across two sessions, or by four narrow agents, each given only the tools its own job needs. The four-agent split (from @Gyome1_) makes the wall structural instead of a matter of discipline.
- Analyst reads, searches and runs the analysis tool (for REA, its read-only tools). The only agent allowed near the artifact. Produces the evidence ledger (Step 2).
- Spec Writer reads and writes, nothing else. Turns confirmed rows into SPEC.md (Step 4).
- Rebuilder reads, writes, edits and runs, in a fresh room (Step 5), from SPEC.md alone. It has no analysis tool, no artifact and no evidence ledger. It writes down any question as a question, records any outside knowledge it is tempted to use, and stops rather than guess.
- Verifier reads, writes and runs. It runs the oracle (Step 6), never edits the build, and ends on the RESULT line.
Give each agent the smallest tool set that lets it finish: a tool it does not have is a mistake it cannot make. Run the loop at most a few rounds, and feed a divergence back only as a new test case for the Rebuilder, never as a hint about the original.
Working with REA
- REA, short for Reverse Engineer Anything, is open source: an MCP server (MCP is a standard way for a coding agent to call tools) plus a command line. Its README says results carry the evidence and the limitations behind each conclusion, which drops straight into the evidence ledger: its evidence ID goes in the pointer column, its limitations in Limits, and its observation, inference and unknown labels map to CONFIRMED, GUESS and UNKNOWN.
- Install and routing are REA's own concern, not this skill's:
rea doctorlists the tool catalog for your install, and REA's installation guide covers setup and isolation. This skill does not duplicate tool routing. - Practice target: the official Notes example app from REA's first-investigation guide (https://rea.tools/first-investigation/). Its expected answer is published, so it tests your ledger and spec habits before a real target.
- Run REA under a separate configuration profile (set
CLAUDE_CONFIG_DIR) and preview setup with a dry run, because the default setup makes REA reachable from every project (@benjistacked; REA's installation guide). - Keep the artifact in a read-only workspace so nothing can modify it and it stays available for later comparison (@zodchiii).
- Strip cookies, tokens and session IDs out of any traffic capture before an agent sees it (@zodchiii).
- REA 6.7 ships guided MCP prompts and tools that fit inside these steps, not around them. The guided
prompts
investigate_featureandcompare_application_versionsserve Step 2 and a version diff, andaudit_residual_unknownskeeps Step 2's UNKNOWN rows honest;verify_reconstructionis offered as both a prompt and a tool for Step 6. REA's tools fill in the rest:trace_featurefor Step 2,evaluate_reconstruction_coveragefor Step 6,build_reconstruction_obligation_ledgerfor Step 3,list_unknownsbeside the UNKNOWN rows, andexport_evidence_bundleto carry the evidence pointers. None of them replace the gate, the ledgers or the planted failures (@0xCodila, @benjistacked). - Without REA the steps are identical. Only the pointer changes: a file and offset, a request line, a screenshot, a test name.
Frozen rules
These are the rules an eager agent would weaken to finish faster. They do not bend for deadlines, user pressure or a passing test.
- No analysis before the gate. Not even a listing.
- No code in SPEC.md.
- No GUESS as a dependency of a CONFIRMED row or of an obligation.
- Planted failures are rejected before the oracle is trusted.
- The builder never sees the artifact.
- The leak check passes before SPEC.md crosses to the builder.
- The verifier never edits the build.
- A divergence goes back to the builder only as a new test case, never as a fragment of the original.
Sources
- darkzodchi (@zodchiii), X, Oct 12, 2026, https://x.com/zodchiii/status/2109623079429460478
- Deni (@0xDeniAi), X, Oct 12, 2026, https://x.com/0xDeniAi/status/2109760573273510267
- codila (@0xCodila), X, Oct 12, 2026, https://x.com/0xCodila/status/2109623431763292649
- NO1ennn (@N01ennn), X, Oct 14, 2026, https://x.com/N01ennn/status/2110319993128706208
- benji (@benjistacked), X, Oct 16, 2026, https://x.com/benjistacked/status/2111173769423364316
- Gyomei (@Gyome1_), X, Oct 2026, https://x.com/Gyome1_/status/2111774069783720195
- cabbitar (@cabbitar), X, Oct 2026, https://x.com/cabbitar/status/2112520869105078561
- REA-Prompts (JoasASantos), GitHub, retrieved Oct 2026 (ideas only), https://github.com/JoasASantos/REA-Prompts
- REA README, GitHub, retrieved Oct 17, 2026, https://github.com/morluto/rea
- REA DISCLAIMER.md, GitHub, retrieved Oct 16, 2026, https://github.com/morluto/rea/blob/main/DISCLAIMER.md
- REA installation and setup, GitHub, retrieved Oct 16, 2026, https://github.com/morluto/rea/blob/main/docs/installation.md
- First investigation, rea.tools, retrieved Oct 16, 2026, https://rea.tools/first-investigation/
- N0zoM1z0, The industrial revolution in reverse engineering, rea.tools blog, Oct 10, 2026, retrieved Oct 16, 2026, https://rea.tools/blog/touhou-reconstruction/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

