[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GKD2Q59SMM50P5R9FZ5GQS":3,"skill-same:01M6GKD2Q59SMM50P5R9FZ5GQS":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6GKD2Q59SMM50P5R9FZ5GQS","cleanroom-rewrite",null,"Use when reimplementing a codebase from scratch from a behavioral spec without copying the original's code — a legal-safe reimplementation, a messy legacy rewrite, or a two-agent spec-then-build process. Triggers on: \"cleanroom rewrite\", \"clean room reimplementation\", \"spec-driven rewrite\", \"behavior-preserving rewrite\", \"rewrite from scratch without copying\", \"legal reimplement\".","dekoza\u002Foh-my-slop","dekoza","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F210980?v=4","01M6GK5KFK2SJQ364J2SR2P57S","Dominik Kozaczko","01M6GK5KP5PAA51JVTXYXHN66N",4,"Unlicense","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcleanroom-rewrite\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"cleanroom rewrite","rewrite","legal","spec-driven","From Scratch","driven","triggers","build","clean","spec","Legacy","behavioral","use","process","behavior","code","safe","2026-11-10 10:12:30",false,"---\nname: cleanroom-rewrite\ndescription: >\n  Use when reimplementing a codebase from scratch from a behavioral spec without copying\n  the original's code — a legal-safe reimplementation, a messy legacy rewrite, or a\n  two-agent spec-then-build process. Triggers on: \"cleanroom rewrite\", \"clean room\n  reimplementation\", \"spec-driven rewrite\", \"behavior-preserving rewrite\", \"rewrite from\n  scratch without copying\", \"legal reimplement\".\n---\n\n# Cleanroom Rewrite\n\nA disciplined two-agent process for rewriting a codebase from scratch by separating specification from implementation — the spec agent produces a behavioral specification without code, and the implementation agent builds a working system using only that specification.\n\n## Core Principle\n\nThe rewrite produces a functional equivalent of the original codebase without copying its implementation. The wall between specification and implementation is a process control (no code snippets, no algorithmic descriptions, no structural copying), not an information barrier that claims perfect isolation.\n\n## When to Use This Skill\n\nThree scenarios, in order of priority:\n\n1. **Greenfield spec-driven rewrite**: A messy, legacy, or poorly-structured codebase needs to be rewritten cleanly. The spec agent documents what the system does; the impl agent builds from scratch.\n2. **AI-assisted cleanroom**: Same as above but explicitly orchestrated with AI agents replacing human teams.\n3. **Legal-safe reimplementation**: Third-party or proprietary code must be rewritten without copyright infringement (e.g., reimplementing leaked\u002Freverse-engineered code). The cleanroom process provides legal defensibility through documented independent creation.\n\n## Architecture\n\nThe process runs two agents in sequence with a strictly defined handoff:\n\n```\nPhase 1: SPECIFICATION (Spec Agent)\n  ↓ spec document (frozen at handoff)\nPhase 2: IMPLEMENTATION (Impl Agent)\n  ↓ working code + assumption log\nPhase 3: VERIFICATION\n  ↓ divergence report + pass\u002Ffail\nDecision: Ship or iterate\n```\n\n**Critical constraint**: The spec agent must never see the impl agent's code. The impl agent must never see the original codebase or the spec agent's analysis process. The spec document is the only contract between them.\n\n## Phase 1: Specification\n\nThe spec agent analyzes the original codebase and produces a specification document. This agent has full read access to the original code but must follow strict output constraints.\n\n### Spec Agent Rules\n\n1. **No code snippets** — never include code from the original in the specification. Describe behavior, not implementation.\n2. **No algorithmic descriptions** — do not describe how the original achieves its results. State what it does and what the observable behavior is.\n3. **No architectural carryover** — do not propose module structures, file organizations, class hierarchies, or design patterns from the original.\n4. **Tag every behavioral claim** with a confidence level:\n   - `[VERIFIED]` — observed concrete behavior with evidence (specific inputs produce specific outputs, observed through execution or tests)\n   - `[INFERRED]` — logically deduced from interface contracts, type signatures, or documentation (not directly executed)\n   - `[UNKNOWN]` — genuine gap where the spec agent cannot determine the behavior\n5. **Mark `[CRITICAL_UNKNOWN]`** for gaps involving data loss risk, security-sensitive behavior, or externally observable side effects. These must be resolved before handoff.\n6. **Write a Philosophy of Implementation** section listing principles the impl agent should follow when the spec is silent (e.g., \"explicit over implicit\", \"correctness over performance\", \"preserve VERIFIED behavior exactly; diverge from INFERRED freely\").\n\n### Spec Document Structure\n\nThe specification document MUST contain these sections, in this order:\n\n```markdown\n# Specification: [Project Name]\n\n## 1. Overview\nBrief description: what the system is, what problem it solves, its primary users and use cases.\n\n## 2. External Interfaces\nEvery public entry point — APIs, CLI commands, UI elements, file formats, environment variables.\nFor each interface:\n  - Name and purpose\n  - Inputs (types, constraints, defaults)\n  - Outputs (types, structure)\n  - Error modes (what can go wrong, how errors are signaled)\n  - Dependencies (external services, databases, files)\n\n## 3. Functional Behavior\nCore logic, organized by feature area. For each feature:\n  - Description of what happens\n  - Inputs and preconditions\n  - Outputs and postconditions\n  - State changes and side effects\n  - [VERIFIED\u002FINFERRED\u002FUNKNOWN] confidence tag\n  - Evidence for VERIFIED items (example inputs\u002Foutputs)\n\n## 4. Data Structures\nAll data types, their fields, constraints, relationships.\nDo NOT describe internal storage or indexing — only the logical data model.\n\n## 5. Business Rules\nValidation rules, calculation formulas, state machine transitions, conditional logic.\nEach rule stated as a declarative constraint.\n\n## 6. Edge Cases\nExplicitly called-out boundary conditions:\n  - Empty\u002Fnull\u002Fmalformed inputs\n  - Concurrency boundaries\n  - Resource limits (time, memory, disk, connections)\n  - Error propagation chains\n\n## 7. Non-Functional Requirements\nObserved performance characteristics, security properties, error handling patterns, retry semantics.\nOnly include what was directly observed or documented — do not speculate.\n\n## 8. Philosophy of Implementation\nOrdered list of principles for resolving ambiguities:\n  1. [Most important principle]\n  2. [Second principle]\n  3. ...\n\n## 9. Gap Inventory\nList of all [UNKNOWN] items with:\n  - What is unknown\n  - Why it could not be determined\n  - Impact assessment (how bad is it if wrong?)\n  - Suggested resolution approach\n```\n\n### Spec Quality Gates\n\nBefore handoff, verify:\n- [ ] No code snippets from the original anywhere in the spec\n- [ ] No algorithmic descriptions (\"the code does X by iterating Y and accumulating Z\")\n- [ ] Every functional claim has a confidence tag\n- [ ] All `[CRITICAL_UNKNOWN]` items are resolved or explicitly deferred with user approval\n- [ ] The Philosophy of Implementation section has at least 3 principles\n- [ ] Every `[VERIFIED]` item includes concrete example evidence\n\n## Phase 2: Implementation\n\nThe impl agent builds a working system using ONLY the specification document. This agent has NO access to the original codebase, the spec agent's conversation, or any analysis artifacts other than the spec.\n\n### Impl Agent Rules\n\n1. **The spec is authoritative** — when the spec is clear, follow it exactly.\n2. **`[VERIFIED]` items are hard requirements** — behavior must match. Any deviation is a bug.\n3. **`[INFERRED]` items are guidance** — match the described behavior but MAY diverge if a cleaner approach exists. Document divergences in ASSUMPTIONS.md.\n4. **`[UNKNOWN]` items are free implementation** — decide based on the Philosophy of Implementation. Document every decision in ASSUMPTIONS.md.\n5. **Record all assumptions** in ASSUMPTIONS.md: what was assumed, why, what the risk is, and what would prove the assumption wrong.\n6. **Do not optimize for fidelity to the original** — optimize for correctness, clarity, and maintainability. The point is a fresh implementation, not a behavioral clone.\n\n### ASSUMPTIONS.md Format\n\n```markdown\n# Assumptions Log\n\n## A-1: [Short title]\n- **Spec gap**: [reference to spec item]\n- **Assumption**: [what we decided]\n- **Rationale**: [why this is the best choice]\n- **Risk**: [what happens if wrong]\n- **Verification**: [how to check if this is correct]\n```\n\n### Impl Quality Gates\n\nBefore declaring done:\n- [ ] All `[VERIFIED]` items from the spec are implemented\n- [ ] Every `[UNKNOWN]` item has an assumption log entry\n- [ ] ASSUMPTIONS.md exists and covers all decisions\n- [ ] No reference to the original codebase's structure or implementation\n- [ ] The system compiles, runs, and serves its core purpose\n\n## Phase 3: Verification\n\nThe verification process has three mandatory phases plus one recommended phase.\n\n### Phase 3a: Spec Conformance (Mandatory)\n\nTests derived directly from the spec. If the spec says \"endpoint X returns 200 with body Y for input Z,\" there is a test that checks this. These tests prove the system satisfies the specification.\n\n### Phase 3b: Characterization Testing (Mandatory)\n\nRun the original and the rewrite side-by-side with the same inputs. Compare outputs.\n\n1. **Define test fixtures upfront** — before running any tests, enumerate at least 5 characterization fixtures. Each fixture must have a name, description, inputs, and expected outputs from the original. This is not optional — the verification plan is incomplete without explicit fixtures.\n2. **Run the same fixtures through the rewrite.**\n3. **Classify every divergence:**\n   - `PASS` — output matches\n   - `SPEC_ERROR` — output differs, but the spec was wrong (the spec agent misobserved)\n   - `IMPL_DEVIATION` — output differs, spec is correct, impl made a wrong choice\n   - `UNKNOWN_ZONE` — output differs in an area the spec marked `[UNKNOWN]` (expected)\n\nThe characterization divergence report is the primary deliverable:\n\n```markdown\n## Characterization Report\n\n### Fixtures\n\n| # | Fixture Name | Description | Expected Original Output |\n|---|-------------|-------------|--------------------------|\n| 1 | [name] | [what it tests] | [expected output] |\n| ... | ... | ... | ... |\n\n### Results\n\n| # | Fixture | Original Output | Rewrite Output | Classification |\n|---|---------|-----------------|----------------|----------------|\n| 1 | ... | ... | ... | PASS |\n| 2 | ... | ... | ... | SPEC_ERROR |\n| 3 | ... | ... | ... | UNKNOWN_ZONE |\n\n### Summary\n- Pass rate: X\u002FY (Z%)\n- SPEC_ERROR items: [list]\n- IMPL_DEVIATION items: [list + fix status]\n- UNKNOWN_ZONE items: [list + risk assessment]\n```\n\n### Phase 3c: Property-Based Testing (Recommended)\n\nDefine core invariants the system must satisfy — properties that are true regardless of specific input values. Express these as property tests and run them against both original and rewrite.\n\nExample invariants:\n- \"Output is always parseable as valid JSON when status is 200\"\n- \"No database writes occur on GET requests\"\n- \"Error responses never leak internal paths or stack traces\"\n- \"All timestamps are in UTC\"\n\n### Phase 3d: Non-Functional Assessment (Recommended)\n\nCheck properties not captured in functional specs:\n- Performance profile comparison (is the rewrite within the same order of magnitude?)\n- Security behavior parity (auth, input validation, error handling)\n- Failure mode comparison (does the system fail gracefully in the same situations?)\n\n### Acceptance Criteria\n\nThe rewrite is verified when ALL of the following are true:\n1. All spec-conformance tests pass\n2. All `[VERIFIED]` characterization tests pass (zero `SPEC_ERROR` and zero `IMPL_DEVIATION`)\n3. All property-based tests pass\n4. No unresolved `[CRITICAL_UNKNOWN]` items remain\n5. All `[IMPL_DEVIATION]` items from Phase 3b are fixed or explicitly accepted with rationale\n\nThe verification plan MUST state these acceptance criteria explicitly. A plan without acceptance criteria is incomplete.\n\n## Handoff Artifacts\n\nThe process produces a canonical set of artifacts:\n\n```\ncleanroom-rewrite-project\u002F\n├── SPEC.md                  # Phase 1 output (frozen at handoff)\n├── source\u002F                  # Phase 2 output (the rewrite)\n├── ASSUMPTIONS.md           # Phase 2 output (gap resolutions)\n├── characterization\u002F        # Phase 3 test cases\n│   ├── original_outputs\u002F    # Recorded original behavior\n│   ├── rewrite_outputs\u002F     # Recorded rewrite behavior\n│   └── report.md            # Phase 3b divergence report\n└── properties\u002F              # Phase 3c property tests\n```\n\n## Common Mistakes\n\n| Mistake | Why It Breaks the Cleanroom |\n|---------|------------------------------|\n| Spec agent includes code fragments in the spec | Impl agent copies the structure; contamination |\n| Spec agent describes algorithmic steps (\"iterate over X, accumulate Y\") | Impl agent reimplements the same algorithm; no fresh approach |\n| Impl agent reads the \"forbidden\" original codebase | Direct copying; cleanroom wall is breached |\n| Spec has unmarked confidence levels | Impl agent cannot distinguish hard requirements from guesses |\n| Divergence classified as SPEC_ERROR when it is IMPL_DEVIATION | You ship a bug thinking the spec was wrong |\n| Characterization tests generated AFTER seeing the spec | Spec unconsciously aligns tests with spec claims; confirmation bias |\n| `[CRITICAL_UNKNOWN]` left unresolved | Silent data loss or security vulnerability in production |\n| Verification only runs spec-conformance, not characterization | You never check if the spec matched the original |\n\n## Rationalization Table\n\nThese excuses have been observed during pressure testing. Do not use them.\n\n| Excuse | Reality |\n|--------|---------|\n| \"Just paste the regex\u002Ffunction — it'll save hours\" | The impl agent will copy the regex\u002Ffunction. Each snippet is a contamination precedent. Describe behavior in English. |\n| \"I'll mark the snippets as 'for context only'\" | A disclaimer doesn't reduce contamination. The impl agent still sees the original's structure, variable names, and control flow. |\n| \"Just read 20 lines to understand the logic\" | Reading the original is reading the original. Once you've seen the algorithm, your implementation will be influenced. Use ASSUMPTIONS.md instead. |\n| \"I'll read it then rewrite so it's not a copy\" | Post-hoc justification on top of a breach. The wall exists to force independent design decisions. |\n| \"It's a tiny script — confidence tags are bureaucracy\" | Tags are a contract with the impl agent, not a diary for the spec agent. Without them, the impl agent guesses what's negotiable. |\n| \"Everything is obvious — skip tags for clear items\" | \"Obvious\" is subjective and context-dependent. The impl agent has no memory of the original code. If confidence isn't explicit in the spec, it doesn't exist. |\n| \"Nobody will know if I peek at the original\" | The value of the wall isn't purity — it's that the impl agent makes independent decisions. Reading the original eliminates that independence. |\n\n## Process Philosophy\n\nThe cleanroom wall is a process control, not an information-theoretic barrier. The spec agent has seen the original code and its structural knowledge inevitably influences the specification. This is acceptable. The goal is legal and practical defensibility — documented independent creation through a clean process — not perfect information isolation.\n\nThe value of the wall is not purity; it is that the impl agent is forced to make independent design decisions rather than transliterating the original. Those independent decisions are what make the rewrite a rewrite, not a copy.\n","# Cleanroom Rewrite\n\nA disciplined two-agent process for rewriting a codebase from scratch by separating specification from implementation — the spec agent produces a behavioral specification without code, and the implementation agent builds a working system using only that specification.\n\n## Core Principle\n\nThe rewrite produces a functional equivalent of the original codebase without copying its implementation. The wall between specification and implementation is a process control (no code snippets, no algorithmic descriptions, no structural copying), not an information barrier that claims perfect isolation.\n\n## When to Use This Skill\n\nThree scenarios, in order of priority:\n\n1. **Greenfield spec-driven rewrite**: A messy, legacy, or poorly-structured codebase needs to be rewritten cleanly. The spec agent documents what the system does; the impl agent builds from scratch.\n2. **AI-assisted cleanroom**: Same as above but explicitly orchestrated with AI agents replacing human teams.\n3. **Legal-safe reimplementation**: Third-party or proprietary code must be rewritten without copyright infringement (e.g., reimplementing leaked\u002Freverse-engineered code). The cleanroom process provides legal defensibility through documented independent creation.\n\n## Architecture\n\nThe process runs two agents in sequence with a strictly defined handoff:\n\n```\nPhase 1: SPECIFICATION (Spec Agent)\n  ↓ spec document (frozen at handoff)\nPhase 2: IMPLEMENTATION (Impl Agent)\n  ↓ working code + assumption log\nPhase 3: VERIFICATION\n  ↓ divergence report + pass\u002Ffail\nDecision: Ship or iterate\n```\n\n**Critical constraint**: The spec agent must never see the impl agent's code. The impl agent must never see the original codebase or the spec agent's analysis process. The spec document is the only contract between them.\n\n## Phase 1: Specification\n\nThe spec agent analyzes the original codebase and produces a specification document. This agent has full read access to the original code but must follow strict output constraints.\n\n### Spec Agent Rules\n\n1. **No code snippets** — never include code from the original in the specification. Describe behavior, not implementation.\n2. **No algorithmic descriptions** — do not describe how the original achieves its results. State what it does and what the observable behavior is.\n3. **No architectural carryover** — do not propose module structures, file organizations, class hierarchies, or design patterns from the original.\n4. **Tag every behavioral claim** with a confidence level:\n   - `[VERIFIED]` — observed concrete behavior with evidence (specific inputs produce specific outputs, observed through execution or tests)\n   - `[INFERRED]` — logically deduced from interface contracts, type signatures, or documentation (not directly executed)\n   - `[UNKNOWN]` — genuine gap where the spec agent cannot determine the behavior\n5. **Mark `[CRITICAL_UNKNOWN]`** for gaps involving data loss risk, security-sensitive behavior, or externally observable side effects. These must be resolved before handoff.\n6. **Write a Philosophy of Implementation** section listing principles the impl agent should follow when the spec is silent (e.g., \"explicit over implicit\", \"correctness over performance\", \"preserve VERIFIED behavior exactly; diverge from INFERRED freely\").\n\n### Spec Document Structure\n\nThe specification document MUST contain these sections, in this order:\n\n```markdown\n# Specification: [Project Name]\n\n## 1. Overview\nBrief description: what the system is, what problem it solves, its primary users and use cases.\n\n## 2. External Interfaces\nEvery public entry point — APIs, CLI commands, UI elements, file formats, environment variables.\nFor each interface:\n  - Name and purpose\n  - Inputs (types, constraints, defaults)\n  - Outputs (types, structure)\n  - Error modes (what can go wrong, how errors are signaled)\n  - Dependencies (external services, databases, files)\n\n## 3. Functional Behavior\nCore logic, organized by feature area. For each feature:\n  - Description of what happens\n  - Inputs and preconditions\n  - Outputs and postconditions\n  - State changes and side effects\n  - [VERIFIED\u002FINFERRED\u002FUNKNOWN] confidence tag\n  - Evidence for VERIFIED items (example inputs\u002Foutputs)\n\n## 4. Data Structures\nAll data types, their fields, constraints, relationships.\nDo NOT describe internal storage or indexing — only the logical data model.\n\n## 5. Business Rules\nValidation rules, calculation formulas, state machine transitions, conditional logic.\nEach rule stated as a declarative constraint.\n\n## 6. Edge Cases\nExplicitly called-out boundary conditions:\n  - Empty\u002Fnull\u002Fmalformed inputs\n  - Concurrency boundaries\n  - Resource limits (time, memory, disk, connections)\n  - Error propagation chains\n\n## 7. Non-Functional Requirements\nObserved performance characteristics, security properties, error handling patterns, retry semantics.\nOnly include what was directly observed or documented — do not speculate.\n\n## 8. Philosophy of Implementation\nOrdered list of principles for resolving ambiguities:\n  1. [Most important principle]\n  2. [Second principle]\n  3. ...\n\n## 9. Gap Inventory\nList of all [UNKNOWN] items with:\n  - What is unknown\n  - Why it could not be determined\n  - Impact assessment (how bad is it if wrong?)\n  - Suggested resolution approach\n```\n\n### Spec Quality Gates\n\nBefore handoff, verify:\n- [ ] No code snippets from the original anywhere in the spec\n- [ ] No algorithmic descriptions (\"the code does X by iterating Y and accumulating Z\")\n- [ ] Every functional claim has a confidence tag\n- [ ] All `[CRITICAL_UNKNOWN]` items are resolved or explicitly deferred with user approval\n- [ ] The Philosophy of Implementation section has at least 3 principles\n- [ ] Every `[VERIFIED]` item includes concrete example evidence\n\n## Phase 2: Implementation\n\nThe impl agent builds a working system using ONLY the specification document. This agent has NO access to the original codebase, the spec agent's conversation, or any analysis artifacts other than the spec.\n\n### Impl Agent Rules\n\n1. **The spec is authoritative** — when the spec is clear, follow it exactly.\n2. **`[VERIFIED]` items are hard requirements** — behavior must match. Any deviation is a bug.\n3. **`[INFERRED]` items are guidance** — match the described behavior but MAY diverge if a cleaner approach exists. Document divergences in ASSUMPTIONS.md.\n4. **`[UNKNOWN]` items are free implementation** — decide based on the Philosophy of Implementation. Document every decision in ASSUMPTIONS.md.\n5. **Record all assumptions** in ASSUMPTIONS.md: what was assumed, why, what the risk is, and what would prove the assumption wrong.\n6. **Do not optimize for fidelity to the original** — optimize for correctness, clarity, and maintainability. The point is a fresh implementation, not a behavioral clone.\n\n### ASSUMPTIONS.md Format\n\n```markdown\n# Assumptions Log\n\n## A-1: [Short title]\n- **Spec gap**: [reference to spec item]\n- **Assumption**: [what we decided]\n- **Rationale**: [why this is the best choice]\n- **Risk**: [what happens if wrong]\n- **Verification**: [how to check if this is correct]\n```\n\n### Impl Quality Gates\n\nBefore declaring done:\n- [ ] All `[VERIFIED]` items from the spec are implemented\n- [ ] Every `[UNKNOWN]` item has an assumption log entry\n- [ ] ASSUMPTIONS.md exists and covers all decisions\n- [ ] No reference to the original codebase's structure or implementation\n- [ ] The system compiles, runs, and serves its core purpose\n\n## Phase 3: Verification\n\nThe verification process has three mandatory phases plus one recommended phase.\n\n### Phase 3a: Spec Conformance (Mandatory)\n\nTests derived directly from the spec. If the spec says \"endpoint X returns 200 with body Y for input Z,\" there is a test that checks this. These tests prove the system satisfies the specification.\n\n### Phase 3b: Characterization Testing (Mandatory)\n\nRun the original and the rewrite side-by-side with the same inputs. Compare outputs.\n\n1. **Define test fixtures upfront** — before running any tests, enumerate at least 5 characterization fixtures. Each fixture must have a name, description, inputs, and expected outputs from the original. This is not optional — the verification plan is incomplete without explicit fixtures.\n2. **Run the same fixtures through the rewrite.**\n3. **Classify every divergence:**\n   - `PASS` — output matches\n   - `SPEC_ERROR` — output differs, but the spec was wrong (the spec agent misobserved)\n   - `IMPL_DEVIATION` — output differs, spec is correct, impl made a wrong choice\n   - `UNKNOWN_ZONE` — output differs in an area the spec marked `[UNKNOWN]` (expected)\n\nThe characterization divergence report is the primary deliverable:\n\n```markdown\n## Characterization Report\n\n### Fixtures\n\n| # | Fixture Name | Description | Expected Original Output |\n|---|-------------|-------------|--------------------------|\n| 1 | [name] | [what it tests] | [expected output] |\n| ... | ... | ... | ... |\n\n### Results\n\n| # | Fixture | Original Output | Rewrite Output | Classification |\n|---|---------|-----------------|----------------|----------------|\n| 1 | ... | ... | ... | PASS |\n| 2 | ... | ... | ... | SPEC_ERROR |\n| 3 | ... | ... | ... | UNKNOWN_ZONE |\n\n### Summary\n- Pass rate: X\u002FY (Z%)\n- SPEC_ERROR items: [list]\n- IMPL_DEVIATION items: [list + fix status]\n- UNKNOWN_ZONE items: [list + risk assessment]\n```\n\n### Phase 3c: Property-Based Testing (Recommended)\n\nDefine core invariants the system must satisfy — properties that are true regardless of specific input values. Express these as property tests and run them against both original and rewrite.\n\nExample invariants:\n- \"Output is always parseable as valid JSON when status is 200\"\n- \"No database writes occur on GET requests\"\n- \"Error responses never leak internal paths or stack traces\"\n- \"All timestamps are in UTC\"\n\n### Phase 3d: Non-Functional Assessment (Recommended)\n\nCheck properties not captured in functional specs:\n- Performance profile comparison (is the rewrite within the same order of magnitude?)\n- Security behavior parity (auth, input validation, error handling)\n- Failure mode comparison (does the system fail gracefully in the same situations?)\n\n### Acceptance Criteria\n\nThe rewrite is verified when ALL of the following are true:\n1. All spec-conformance tests pass\n2. All `[VERIFIED]` characterization tests pass (zero `SPEC_ERROR` and zero `IMPL_DEVIATION`)\n3. All property-based tests pass\n4. No unresolved `[CRITICAL_UNKNOWN]` items remain\n5. All `[IMPL_DEVIATION]` items from Phase 3b are fixed or explicitly accepted with rationale\n\nThe verification plan MUST state these acceptance criteria explicitly. A plan without acceptance criteria is incomplete.\n\n## Handoff Artifacts\n\nThe process produces a canonical set of artifacts:\n\n```\ncleanroom-rewrite-project\u002F\n├── SPEC.md                  # Phase 1 output (frozen at handoff)\n├── source\u002F                  # Phase 2 output (the rewrite)\n├── ASSUMPTIONS.md           # Phase 2 output (gap resolutions)\n├── characterization\u002F        # Phase 3 test cases\n│   ├── original_outputs\u002F    # Recorded original behavior\n│   ├── rewrite_outputs\u002F     # Recorded rewrite behavior\n│   └── report.md            # Phase 3b divergence report\n└── properties\u002F              # Phase 3c property tests\n```\n\n## Common Mistakes\n\n| Mistake | Why It Breaks the Cleanroom |\n|---------|------------------------------|\n| Spec agent includes code fragments in the spec | Impl agent copies the structure; contamination |\n| Spec agent describes algorithmic steps (\"iterate over X, accumulate Y\") | Impl agent reimplements the same algorithm; no fresh approach |\n| Impl agent reads the \"forbidden\" original codebase | Direct copying; cleanroom wall is breached |\n| Spec has unmarked confidence levels | Impl agent cannot distinguish hard requirements from guesses |\n| Divergence classified as SPEC_ERROR when it is IMPL_DEVIATION | You ship a bug thinking the spec was wrong |\n| Characterization tests generated AFTER seeing the spec | Spec unconsciously aligns tests with spec claims; confirmation bias |\n| `[CRITICAL_UNKNOWN]` left unresolved | Silent data loss or security vulnerability in production |\n| Verification only runs spec-conformance, not characterization | You never check if the spec matched the original |\n\n## Rationalization Table\n\nThese excuses have been observed during pressure testing. Do not use them.\n\n| Excuse | Reality |\n|--------|---------|\n| \"Just paste the regex\u002Ffunction — it'll save hours\" | The impl agent will copy the regex\u002Ffunction. Each snippet is a contamination precedent. Describe behavior in English. |\n| \"I'll mark the snippets as 'for context only'\" | A disclaimer doesn't reduce contamination. The impl agent still sees the original's structure, variable names, and control flow. |\n| \"Just read 20 lines to understand the logic\" | Reading the original is reading the original. Once you've seen the algorithm, your implementation will be influenced. Use ASSUMPTIONS.md instead. |\n| \"I'll read it then rewrite so it's not a copy\" | Post-hoc justification on top of a breach. The wall exists to force independent design decisions. |\n| \"It's a tiny script — confidence tags are bureaucracy\" | Tags are a contract with the impl agent, not a diary for the spec agent. Without them, the impl agent guesses what's negotiable. |\n| \"Everything is obvious — skip tags for clear items\" | \"Obvious\" is subjective and context-dependent. The impl agent has no memory of the original code. If confidence isn't explicit in the spec, it doesn't exist. |\n| \"Nobody will know if I peek at the original\" | The value of the wall isn't purity — it's that the impl agent makes independent decisions. Reading the original eliminates that independence. |\n\n## Process Philosophy\n\nThe cleanroom wall is a process control, not an information-theoretic barrier. The spec agent has seen the original code and its structural knowledge inevitably influences the specification. This is acceptable. The goal is legal and practical defensibility — documented independent creation through a clean process — not perfect information isolation.\n\nThe value of the wall is not purity; it is that the impl agent is forced to make independent design decisions rather than transliterating the original. Those independent decisions are what make the rewrite a rewrite, not a copy.\n",{"name":5,"description":7},"main","8c687fa2c077e1cd3ff8e5b2912c28fd443bc675","skills\u002Fworkflow\u002Fcleanroom-rewrite",0,"https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop","https:\u002F\u002Fgithub.com\u002Fdekoza","https:\u002F\u002Fqoto.org\u002F@minder","Plz send BTC: 32UQpSVbcYXdfZnbyPuPvYi7rXvHcueqi1","2026-10-28 00:52:41",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add dekoza\u002Foh-my-slop --skill cleanroom-rewrite",{"tool":56,"command":57},"bunx","bunx skills add dekoza\u002Foh-my-slop --skill cleanroom-rewrite",{"tool":59,"command":60},"pnpm","pnpm dlx skills add dekoza\u002Foh-my-slop --skill cleanroom-rewrite","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcleanroom-rewrite\u002FSKILL.md",true,[64,70,74],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"evals\u002Fevals.json","REFERENCE","参考文档",1813,"https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcleanroom-rewrite\u002Fevals\u002Fevals.json",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"evals\u002Ftrigger-evals.json",3097,"https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcleanroom-rewrite\u002Fevals\u002Ftrigger-evals.json",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fspec-template.md",3491,"https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcleanroom-rewrite\u002Freferences\u002Fspec-template.md",[79,105,124,141,155,180],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":36},"01M6GKGSV5GC23S7CZ8XMXQF7C","wizard","Generate an interactive bash wizard that walks a human through a manual procedure — third-party setup, credential provisioning, a one-off migration — opening URLs, capturing values, confirming each step, and writing .env files and CI secrets (GitHub and Gitea\u002FForgejo Actions).","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fwizard\u002FSKILL.md",[],[81,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],"true","interactive","manual","gitea","env","third-party","human","credential","files","migration","Bash","secrets","provisioning","ci","actions","generate","setup","github","writing",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":36},"01M6GKFC9YYQ4CC6N7YAW7BWW1","restore-test-pyramid","Analyze the project's E2E suite and push every assertion that doesn't need a real browser down to a faster integration or unit test, proving each migration honest before thinning E2E.","MIT","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Frestore-test-pyramid\u002FSKILL.md",[],[113,114,115,116,117,95,118,119,120,121,122,123,86],"restore test pyramid","test","restore","real browser","analyze","push","project","unit","e2e","integration","browser",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":36},"01M6GKEW0YH8ZSSN1PT543TDNZ","ponytail-debt","Harvest SHORTCUT markers from the codebase and report them grouped by file, flagging any missing upgrade paths.","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fponytail-debt\u002FSKILL.md",[],[131,132,133,86,134,135,136,137,138,139,140],"ponytail","ponytail debt","missing","shortcut","paths","markers","upgrade","file","report","harvest",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":36},"01M6GKE8R93K0Z9XCM0MVCMS82","humanify","Repair an inherited or human-blocked ticket for agent implementation, or finish its explicit human-only outcome.","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fhumanify\u002FSKILL.md",[],[143,148,86,149,150,151,92,152,153,154],"finish","ticket","agent implementation","repair","implementation","only","outcome",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":36},"01M6GKDQYP2QQZCVE34AAJW7KC","fix-pr","Repair an existing pull request's review findings and target-branch conflicts, verify the result, and update the same open PR.","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ffix-pr\u002FSKILL.md",[],[162,163,164,165,166,167,168,169,170,171,172,173,174,175,86,176,177,151,178,179],"pr","fix","fix pr","testing","open","verify","pull","update","pull request","merge","workflow","tdd","review","branch","merge-conflicts","review findings","conflicts","discipline",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":36},"01M6GKDMR2V617S1V8APDT4R2B","feature-milestones","Reconstruct a fragmented backlog as finishable feature milestones with explicit delivery boundaries and an approval-gated tracker update.","https:\u002F\u002Fgithub.com\u002Fdekoza\u002Foh-my-slop\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ffeature-milestones\u002FSKILL.md",[],[187,188,169,86,189,190,191,192,193,194,195],"feature","feature milestones","with","as","delivery","backlog","gated","tracker","approval"]