[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C00DQ9JCXKTKJCH3VGPRC6":3,"skill-same:01M7C00DQ9JCXKTKJCH3VGPRC6":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7C00DQ9JCXKTKJCH3VGPRC6","second-pass-review",null,"Independent audit of sanitized specs in workspace\u002Foutput\u002F. Three parallel LLM-based reviewer roles check structural leakage, content contamination, and behavioral completeness. Run AFTER Layer 5 sanitization, BEFORE implementation handoff.","zak-keown\u002Fmoe","zak-keown","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F320717241?v=4","01M7BZFXME0NW6TQX0H7AZM2KS","01M7BZFXN32VR0JN5AATRD53H4",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe-backstory\u002F.codex-plugin\u002Fskills\u002Fsecond-pass-review\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: second-pass-review\ndescription: Independent audit of sanitized specs in workspace\u002Foutput\u002F. Three parallel LLM-based reviewer roles check structural leakage, content contamination, and behavioral completeness. Run AFTER Layer 5 sanitization, BEFORE implementation handoff.\n---\n\n# Second-Pass Review (Layer 6)\n\nSanitization is necessary but insufficient. The author of a sanitized spec can't reliably catch their own leaks — the same assumptions that let implementation details slip in during the rewrite also let them slip past a self-review. A fresh read, with no access to the raw analysis, catches drift the author missed.\n\n## Why This Exists\n\nSanitization alone misses contamination in predictable categories:\n- **Structural leakage:** Module names in Part headers, cross-module dependency tables, module counts carried into the output\n- **Content contamination:** Minified identifiers, line number references, IPC channel names, state-store selectors, internal filenames\n- **Behavioral completeness:** Usually passes, because completeness is the easiest dimension to check\n\nRoot causes:\n1. Sanitization agents copy-paste instead of rewriting\n2. Gate 2 flags \"zero leakage\" but never defines what to look for\n3. Grep patterns can't catch descriptive English identifiers\n4. Without a second-pass review, authors can't catch their own blind spots\n\n## Audit Pipeline\n\n```dot\ndigraph audit_pipeline {\n    rankdir=TB;\n    compound=true;\n\n    \"Layer 5 sanitization complete\" [shape=doublecircle];\n    \"Audit PASS — proceed to implementation\" [shape=doublecircle];\n    \"STOP: Audit failed after 3 remediation attempts\" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];\n\n    subgraph cluster_specialist {\n        label=\"Parallel Specialist Reviewers (read every file, apply semantic checklists)\";\n        style=dashed;\n\n        \"structural-leakage-reviewer\" [shape=box];\n        \"content-contamination-reviewer\" [shape=box];\n        \"behavioral-completeness-reviewer\" [shape=box];\n    }\n\n    subgraph cluster_generalist {\n        label=\"Parallel Deep-Read Generalists (4-5 files each, full contextual judgment)\";\n        style=dashed;\n\n        \"deep-read-auditor-1\" [shape=box];\n        \"deep-read-auditor-2\" [shape=box];\n        \"deep-read-auditor-N\" [shape=box];\n    }\n\n    \"Merge all audit reports\" [shape=box];\n    \"Any FAIL?\" [shape=diamond];\n    \"Dispatch targeted fix agents\" [shape=box];\n    \"Re-audit failing files\" [shape=box];\n    \"Attempts \u003C 3?\" [shape=diamond];\n\n    \"Layer 5 sanitization complete\" -> \"structural-leakage-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"content-contamination-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"behavioral-completeness-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-1\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-2\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-N\";\n\n    \"structural-leakage-reviewer\" -> \"Merge all audit reports\";\n    \"content-contamination-reviewer\" -> \"Merge all audit reports\";\n    \"behavioral-completeness-reviewer\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-1\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-2\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-N\" -> \"Merge all audit reports\";\n\n    \"Merge all audit reports\" -> \"Any FAIL?\";\n    \"Any FAIL?\" -> \"Audit PASS — proceed to implementation\" [label=\"all PASS\"];\n    \"Any FAIL?\" -> \"Dispatch targeted fix agents\" [label=\"any FAIL\"];\n    \"Dispatch targeted fix agents\" -> \"Re-audit failing files\";\n    \"Re-audit failing files\" -> \"Attempts \u003C 3?\";\n    \"Attempts \u003C 3?\" -> \"structural-leakage-reviewer\" [label=\"yes\"];\n    \"Attempts \u003C 3?\" -> \"STOP: Audit failed after 3 remediation attempts\" [label=\"no\"];\n}\n```\n\n## Scope Rules\n\n- **READ ONLY from `workspace\u002Foutput\u002F`** — auditors check what reached the output without cross-referencing the raw analysis\n- Detailed reports with per-finding evidence are written to `workspace\u002Fraw\u002Faudit\u002F` alongside other analysis artifacts\n- Top-level summaries with PASS\u002FFAIL verdicts are written to `workspace\u002Foutput\u002Faudit\u002F` so downstream consumers see review outcomes\n- Summaries describe *outcomes*, not *source-derived examples*: a category PASS or FAIL with counts, plus overall PASS\u002FFAIL. Per-finding details live in the raw-side reports for remediation; they don't belong in the implementer-facing output.\n\n---\n\n## Why This Is LLM-Based, Not Grep-Based\n\nPattern matching is fundamentally the wrong tool for contamination detection. It produces both false positives and false negatives at rates that make it unreliable as a primary mechanism.\n\n**False positives are pervasive.** Patterns that detect minified identifiers also match regex character classes, priority levels (P0, P1), and standard technology names. Patterns for code structure language match natural English (\"cannot function without\"). Patterns for module counts match legitimate behavioral quantities (\"supports 3 output formats\"). An auditor drowning in false positives either wastes time on noise or starts ignoring real findings.\n\n**Contextual contamination is invisible to patterns.** No regex can detect:\n- A legitimate-looking constant name that is actually an internal implementation detail\n- Behavioral prose that describes code structure rather than observable behavior\n- Tables that mix clean behavioral content with contaminated source references\n- Feature flags and telemetry events that look like ordinary string constants\n\n**Semantic judgment catches everything patterns miss.** The core test is simple: \"Would an implementor encounter this exact string without seeing the source code?\" An LLM can apply this test to every identifier, name, and reference in a spec, using contextual understanding that patterns lack. This catches minified symbols, internal function names, vendor-specific flags, and structural leakage — all with a single semantic criterion rather than a brittle pattern library.\n\n## LLM-Based Audit Protocol\n\nAll auditors — specialist reviewers and deep-read generalists — are LLM agents that read files end-to-end and apply semantic judgment. There is no grep triage phase.\n\n### Specialist Reviewers\n\nThree parallel agents (structural-leakage-reviewer, content-contamination-reviewer, behavioral-completeness-reviewer) each read **every file** in `workspace\u002Foutput\u002Fspecs\u002F` and apply their category-specific checklists. See the role sections below for their checklists.\n\nEach specialist reviewer:\n1. Reads every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end\n2. For each finding, applies the semantic test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n3. Classifies findings by their category checklist (SL-1 through SL-8, CC-1 through CC-12, or BC-1 through BC-9)\n4. Produces a structured verdict per file (PASS\u002FFAIL with evidence)\n\n### Deep-Read Generalists\n\nIn parallel with the specialists, dispatch deep-read auditor agents (one per 4-5 domain files) with this prompt template:\n\n```\nRole: deep-read auditor\nSkill: second-pass-review\n\nRead each of these files END TO END:\n- workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile1>.md\n- workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile2>.md\n- ...\n\n## The Test\n\nFor every identifier, name, or reference in the spec, ask:\n**\"Would an implementor encounter this exact string without seeing the source code?\"**\n\nIf YES (it's in official docs, CLI help, config schemas, API specs, protocol standards) → CLEAN.\nIf NO (it came from reading the source code, observing internal state, or reverse engineering) → CONTAMINATION.\n\nThis test catches everything: minified gibberish, internal function names, internal feature flags, internal telemetry events, source file paths, and line numbers. No pattern list needed — just judgment.\n\n## Common traps\n\n- **Descriptive camelCase**: `shouldRetryOnTimeout` looks like English but it's an internal variable name. A different developer would call it something else. CONTAMINATION.\n- **Feature flags with vendor prefixes**: vendor-prefixed flags (e.g., `\u003Cvendor>_experiment_*`, `ff_\u003Cscope>_*`) — these are internal, not user-facing. CONTAMINATION.\n- **Telemetry event names**: `request_rate_limited`, `worker_shutdown_initiated` — internal analytics. CONTAMINATION.\n- **Config property names that look behavioral**: `strictSchemaValidation` — is this the actual config key users write, or an internal state property? Check the config schema spec to verify.\n\n## What is NOT contamination\n\n- Environment variables users set: `DATABASE_URL`, `CACHE_DISABLE_TTL`\n- CLI flags: `--format`, `--workers`, `--follow`\n- Config file keys users type: `upstreams`, `log_level`, `read_timeout`\n- API\u002Fprotocol field names: `Retry-After`, `Content-Type`, `Authorization`\n- Public library\u002Ftool names: `jq`, `ffmpeg`, `pandoc`\n- Standard tech names: `OAuth`, `PKCE`, `TLS`, `JWT`\n- IDE names: `PyCharm`, `GoLand`, `VSCode`\n\nFor each file, report:\n1. PASS or FAIL\n2. If FAIL: exact line numbers and the contaminating text\n3. Brief explanation of why it's contamination (applying the test above)\n\nWrite findings to workspace\u002Fraw\u002Faudit\u002Fdeep-read-\u003Cbatch>.md\n```\n\n### Targeted Fix\n\nFor each file that failed any audit (specialist or generalist), dispatch a fix agent:\n\n```\nRole: contamination fixer\nSkill: spec-sanitization (contamination taxonomy + rewrite patterns)\n\nRead workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile>.md\n\nThe audit found these specific issues:\n[paste exact findings with line numbers]\n\nFix ONLY the identified issues. Do NOT rewrite clean content.\nFor each fix, apply the appropriate rewrite pattern:\n- Minified IDs → remove or describe the behavior\n- Line numbers → remove the \"line NNN\" reference, keep the behavioral content\n- Module names → replace with behavioral domain description\n- Feature flags → \"a feature gate controlling [behavior]\"\n- Part N: headers → behavioral domain name\n\nWrite the corrected file back to the same path.\n```\n\n### Re-verify\n\nAfter all fixes, re-run audit (specialists + deep-read) on previously-failing files. Repeat up to 3 times.\n\n### Agent Sizing\n\n- **Specialist reviewers**: 3 agents, each reads all files for their category\n- **Deep-read generalists**: 4-5 domain files each (keeps context manageable)\n- **Fix agents**: 1 file each (focused, targeted fixes)\n- **Parallelism**: All specialist and deep-read agents run in parallel; all fix agents run in parallel\n\n---\n\n## Role: structural-leakage-reviewer\n\nChecks whether the organizational structure of `workspace\u002Foutput\u002F` leaks the original's internal module decomposition.\n\n**Why this matters:** output specs describe behavior, not the original's architecture. An implementer anchored to the original's module structure will reproduce its design — even when a different decomposition would be better for the new implementation. Module counts, inter-module tables, and domain-to-module mappings all encode architectural decisions that should be the implementer's to make fresh.\n\n### Semantic Checklist (8 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, check all 8 categories. Apply the core test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n\n#### SL-1: Module Names in Headers\n\nScan all `#`, `##`, `###` headers. Flag any header that contains a source module name, internal component name, or internal package name rather than a behavioral domain description.\n\nA header like \"Session Management\" is behavioral (PASS). A header like \"Fx3 Module\" or \"Part 3: CacheManager\" is structural leakage (FAIL).\n\n#### SL-2: Part N: Headers\n\nThe `Part N:` numbering pattern reveals the original module decomposition count and ordering. Any `Part N:` header is FAIL. Clean specs use behavioral domain names, not numbered parts.\n\n#### SL-3: Module Counts\n\nAny reference to a specific count of modules, components, or source files reveals the internal decomposition. FAIL unless the count refers to a user-facing concept (e.g., \"supports 3 output formats\").\n\n#### SL-4: Cross-Module \u002F Inter-Module \u002F Module Boundary Sections\n\nSection headings or content that reference module-to-module relationships (e.g., \"cross-module\", \"inter-module\", \"module boundary\", \"module interface\", \"module dependency\"). All are FAIL. Clean specs describe behavioral integration, not module interfaces.\n\n#### SL-5: Module IDs (MOD-NNN)\n\nInternal module identifiers from the analysis module map. Any `MOD-NNN` reference is FAIL.\n\n#### SL-6: Interface Consumption Tables\n\nTables showing which module consumes which module's interface. Look for language like \"consumes\", \"consumed by\", \"provides to\", \"depends on module\", \"module provides\".\n\n\"Depends on the API key being set\" is behavioral (PASS). \"Depends on AuthModule\" is structural (FAIL).\n\n#### SL-7: Domain-to-Module Mappings\n\nAny text that maps a behavioral domain back to its source module(s). Look for language like \"from module\", \"source module\", \"originally in\", \"derived from module\", \"mapped from\". All are FAIL.\n\n#### SL-8: Raw Paths\n\nAny reference to `workspace\u002Fraw\u002F` or files within it. All are FAIL.\n\n### Structural Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fstructural-leakage.md`:\n- Per-category: PASS\u002FFAIL, match count, file:line evidence for each match\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fstructural-summary.md`:\n- Per-category: PASS\u002FFAIL only\n- Overall: PASS\u002FFAIL\n- Report counts only (e.g., \"N findings in M files\"); the per-finding examples live in the detailed raw-side report.\n\n---\n\n## Role: content-contamination-reviewer\n\nChecks whether implementation-specific content from the original source survives in `workspace\u002Foutput\u002F`.\n\n### Semantic Checklist (12 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, check all 12 categories. Apply the core test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n\n#### CC-1: Minified Identifiers\n\nShort alphanumeric tokens that are artifacts of minification or bundling (e.g., `Ab2`, `sp`, `r0`, `Fx3`, `Qz`). Look for 2-3 character tokens that have no English meaning and appear in code-like or identifier-like contexts.\n\nTwo-letter abbreviations like \"UI\", \"IO\", \"ID\" are OK. Behavioral acronyms like \"API\", \"CLI\", \"SDK\" are OK. If the token has no English meaning, it's contamination.\n\n#### CC-2: Line Number References\n\nReferences to specific source code line numbers (e.g., \"line 42\", \"L157\", \":234:\"). FAIL unless referencing a user-facing output (e.g., \"error reported at line 5 of the config file\").\n\n#### CC-3: Source File Paths\n\nInternal source file paths, import paths, or bundle chunk references. Look for paths containing `src\u002F`, `lib\u002F`, `dist\u002F`, package manager directories, source file extensions in path context, or bundle chunk references (e.g., `chunk-042`).\n\nFAIL for all internal paths. Clean specs reference user-facing paths only (e.g., `~\u002F.config\u002Fapp\u002Fsettings.json`).\n\n#### CC-4: Internal Function\u002FClass Names\n\nNamed functions, classes, or methods from the source code. Look for camelCase identifiers that look like function\u002Fmethod names (e.g., `parseArgs()`, `serializeResponse()`), and PascalCase identifiers that look like class names (e.g., `JobRunner`, `QueueHandler`).\n\nWell-known compound words like \"JavaScript\", \"TypeScript\", \"WebSocket\" are legitimate (PASS). Internal names that a different developer would name differently are contamination (FAIL).\n\n#### CC-5: Code Structure Language\n\nPhrases that describe internal code organization rather than observable behavior. Look for text that names specific functions, classes, or methods and describes calling relationships between them.\n\n\"Calls the API endpoint\" is behavioral (PASS). \"Calls `parseArgs()` which returns...\" is code structure (FAIL).\n\n#### CC-6: IPC Channel Names\n\nInternal inter-process communication channel identifiers. Look for IPC-prefixed names, channel string literals, or message-passing identifiers that are internal to the implementation.\n\n**Rewrite guidance:** Replace with \"internal messaging mechanism\" or describe the behavioral outcome instead.\n\n#### CC-7: Store Property Names \u002F State Selectors\n\nInternal state management property names — selectors, store accessors, or state library-specific patterns. Look for references to specific state management libraries or their API patterns.\n\n**Rewrite guidance:** Replace with behavioral descriptions of the managed state (e.g., \"session state data\", \"user preferences store\").\n\n#### CC-8: Feature Flag Names and Telemetry Event Names\n\nInternal feature flag identifiers and telemetry\u002Fanalytics event names. These are NOT user-facing — they are internal implementation identifiers that happen to be strings rather than minified symbols. Look for:\n- Feature flag patterns (e.g., `FF_*`, `FEATURE_*`, vendor-prefixed flags)\n- Vendor-specific identifiers (e.g., vendor-prefixed flags (e.g., `\u003Cvendor>_experiment_*`, `ff_\u003Cscope>_*`), `experiment_*`)\n- Telemetry event names (internal analytics strings, not user-visible)\n\nThe test is: **does a user type this?** If the user never sees or configures this string, it is an internal identifier and MUST be generalized.\n\n**Rewrite guidance:** Replace flag names with \"a feature gate controlling [behavioral description]\". Replace telemetry event names with \"a telemetry event recording [what is measured]\".\n\n#### CC-9: CSS\u002FStyling Class Names\n\nInternal styling class names or module identifiers (CSS classes, BEM naming, styled-component references, styling module paths). FAIL for all. Clean specs describe visual behavior, not styling implementation.\n\n#### CC-10: Database Schema Details\n\nInternal database table names, column names, migration identifiers, or storage API references. Look for SQL statements, database file extensions, migration identifiers, or client-side storage API calls.\n\n**Rewrite guidance:** Replace with behavioral data persistence descriptions (e.g., \"persists session data locally\").\n\n**External system exception:** Matches in `workspace\u002Foutput\u002Fspecs\u002Fcontracts\u002F` files (database contracts, API contracts, CLI contracts, format contracts) are NOT contamination. External system contracts document interfaces the reimplementation must conform to — the schema\u002FAPI\u002FCLI details are behavioral constraints, not implementation choices.\n\n#### CC-11: Internal Filenames\n\nInternal application filenames that are not user-facing. Look for filenames with source code extensions that name internal implementation files rather than user-facing configuration or output files.\n\nUser-facing filenames (e.g., `config.json`, `settings.yaml`) are PASS. Internal source files (e.g., `auth-handler.py`, `session-manager.go`) are FAIL.\n\n#### CC-12: State Management Selectors\n\nSpecific selector or accessor patterns from state management libraries (e.g., `selectUserState`, `useSessionStore`, `getAuthState`). FAIL unless describing a user-facing API.\n\n### Content Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fcontent-contamination.md`:\n- Per-category: PASS\u002FFAIL, match count, file:line evidence for each match\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fcontent-summary.md`:\n- Per-category: PASS\u002FFAIL only\n- Overall: PASS\u002FFAIL\n- Report counts only (e.g., \"N findings in M files\"); the per-finding examples live in the detailed raw-side report.\n\n---\n\n## Role: behavioral-completeness-reviewer\n\nChecks that sanitization preserved all behavioral information. This is the \"did we throw the baby out with the bathwater?\" check.\n\n### Semantic Checklist (9 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, assess behavioral completeness across all 9 categories. The question here is not \"is this contaminated?\" but \"is critical behavioral information missing?\"\n\n#### BC-1: SPEC ID Coverage\n\nCount unique SPEC IDs across all output specs. Compare against the SPEC ID index (if one exists in `output\u002F`). Flag any SPEC IDs that appear in the raw sanitization report but not in output. FAIL if count is significantly lower than expected.\n\n#### BC-2: State Machines\n\nEvery stateful behavioral domain should have state machine documentation (states, transitions, triggers). Look for state machine descriptions, state diagrams, transition tables. FAIL if zero across all specs (unless all domains are genuinely stateless).\n\n#### BC-3: Error Conditions\n\nSpecs must document error conditions with equal depth to normal operations. Look for error condition descriptions, failure modes, error responses. FAIL if no error handling documentation exists.\n\n#### BC-4: Edge Cases\n\nEvery spec should document boundary conditions. Look for edge case descriptions, boundary conditions, corner cases, special cases. FAIL if none are documented.\n\n#### BC-5: Decision Trees\n\nBehavioral branching logic must be documented. Look for decision trees, conditional logic descriptions, branching behavior. FAIL if no branching logic is documented.\n\n#### BC-6: AC-to-SPEC Linkage\n\nAcceptance criteria should reference SPEC IDs they verify. Check `workspace\u002Foutput\u002Fvalidation\u002F` for acceptance criteria with SPEC ID references. FAIL if zero acceptance criteria exist.\n\n#### BC-7: Test Vector Coverage\n\nTest vectors should exist in `workspace\u002Foutput\u002Ftest-vectors\u002F` and contain concrete input\u002Foutput pairs. FAIL if zero test vector files or zero concrete pairs.\n\n#### BC-8: Constant Preservation\n\nNamed constants, magic numbers, timeout values, and limits should survive sanitization. Look for numeric values with units (ms, seconds, bytes, KB, MB), and named constants (MAX, MIN, DEFAULT, LIMIT, TIMEOUT, THRESHOLD). Low count may indicate constants were stripped during sanitization.\n\n#### BC-9: Requirement Level Coverage\n\nEvery behavioral claim should have MUST\u002FSHOULD\u002FMAY annotation (RFC 2119 language). FAIL if zero requirement-level keywords exist.\n\n### Completeness Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fbehavioral-completeness.md`:\n- Per-category: PASS\u002FFAIL, count, assessment\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fcompleteness-summary.md`:\n- Per-category: PASS\u002FFAIL with counts only\n- Overall: PASS\u002FFAIL\n\n---\n\n## Remediation Protocol\n\nWhen any audit role or deep-read agent reports FAIL:\n\n1. **Batch by file**: Group findings by affected file\n2. **Dispatch fix agents**: One agent per file (or batch of small files), using the fix agent prompt template from the LLM-Based Audit Protocol\n3. **Re-verify**: Re-run specialist and deep-read audits on previously-failing files\n4. **Maximum 3 remediation rounds** — if audit still fails after 3 rounds, STOP the pipeline\n\n### Fix Agent Prompt Template\n\nFor each affected file, dispatch `moe-backstory:analyzer`:\n\n```\nRole: contamination fixer\nSkill: spec-sanitization\n\nRead workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile>.md\n\nThe audit found these specific issues:\n- Line [N]: [exact finding and category]\n- Line [M]: [exact finding and category]\n\nFix ONLY the identified issues. For each:\n1. Read the surrounding context (5 lines before\u002Fafter)\n2. Determine if this is real contamination or false positive\n3. If real: apply the matching rewrite pattern from the skill\n4. If false positive: leave unchanged\n\nWrite the corrected file back to the same path.\n```\n\n## Output Directory Structure\n\n```\nworkspace\u002F\n├── raw\u002F\n│   └── audit\u002F                    # Detailed reports WITH evidence (stays in raw)\n│       ├── structural-leakage.md\n│       ├── content-contamination.md\n│       └── behavioral-completeness.md\n└── output\u002F\n    └── audit\u002F                    # Summaries (outcomes only)\n        ├── structural-summary.md\n        ├── content-summary.md\n        └── completeness-summary.md\n```\n\n## Definition of Done\n\n- [ ] All 8 structural checks executed against `workspace\u002Foutput\u002F`\n- [ ] All 12 content checks executed against `workspace\u002Foutput\u002F`\n- [ ] All 9 behavioral-completeness checks executed against `workspace\u002Foutput\u002F`\n- [ ] Deep contextual audit agents dispatched (one per 4-5 domain files)\n- [ ] All deep-read findings triaged (real vs false positive)\n- [ ] Detailed reports written to `workspace\u002Fraw\u002Faudit\u002F`\n- [ ] Clean summaries written to `workspace\u002Foutput\u002Faudit\u002F` (outcomes only)\n- [ ] Overall PASS\u002FFAIL determination made\n- [ ] If FAIL: remediation attempted (up to 3 rounds, using fix agent prompt template)\n- [ ] If PASS: `review-complete` git tag applied\n","# Second-Pass Review (Layer 6)\n\nSanitization is necessary but insufficient. The author of a sanitized spec can't reliably catch their own leaks — the same assumptions that let implementation details slip in during the rewrite also let them slip past a self-review. A fresh read, with no access to the raw analysis, catches drift the author missed.\n\n## Why This Exists\n\nSanitization alone misses contamination in predictable categories:\n- **Structural leakage:** Module names in Part headers, cross-module dependency tables, module counts carried into the output\n- **Content contamination:** Minified identifiers, line number references, IPC channel names, state-store selectors, internal filenames\n- **Behavioral completeness:** Usually passes, because completeness is the easiest dimension to check\n\nRoot causes:\n1. Sanitization agents copy-paste instead of rewriting\n2. Gate 2 flags \"zero leakage\" but never defines what to look for\n3. Grep patterns can't catch descriptive English identifiers\n4. Without a second-pass review, authors can't catch their own blind spots\n\n## Audit Pipeline\n\n```dot\ndigraph audit_pipeline {\n    rankdir=TB;\n    compound=true;\n\n    \"Layer 5 sanitization complete\" [shape=doublecircle];\n    \"Audit PASS — proceed to implementation\" [shape=doublecircle];\n    \"STOP: Audit failed after 3 remediation attempts\" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];\n\n    subgraph cluster_specialist {\n        label=\"Parallel Specialist Reviewers (read every file, apply semantic checklists)\";\n        style=dashed;\n\n        \"structural-leakage-reviewer\" [shape=box];\n        \"content-contamination-reviewer\" [shape=box];\n        \"behavioral-completeness-reviewer\" [shape=box];\n    }\n\n    subgraph cluster_generalist {\n        label=\"Parallel Deep-Read Generalists (4-5 files each, full contextual judgment)\";\n        style=dashed;\n\n        \"deep-read-auditor-1\" [shape=box];\n        \"deep-read-auditor-2\" [shape=box];\n        \"deep-read-auditor-N\" [shape=box];\n    }\n\n    \"Merge all audit reports\" [shape=box];\n    \"Any FAIL?\" [shape=diamond];\n    \"Dispatch targeted fix agents\" [shape=box];\n    \"Re-audit failing files\" [shape=box];\n    \"Attempts \u003C 3?\" [shape=diamond];\n\n    \"Layer 5 sanitization complete\" -> \"structural-leakage-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"content-contamination-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"behavioral-completeness-reviewer\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-1\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-2\";\n    \"Layer 5 sanitization complete\" -> \"deep-read-auditor-N\";\n\n    \"structural-leakage-reviewer\" -> \"Merge all audit reports\";\n    \"content-contamination-reviewer\" -> \"Merge all audit reports\";\n    \"behavioral-completeness-reviewer\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-1\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-2\" -> \"Merge all audit reports\";\n    \"deep-read-auditor-N\" -> \"Merge all audit reports\";\n\n    \"Merge all audit reports\" -> \"Any FAIL?\";\n    \"Any FAIL?\" -> \"Audit PASS — proceed to implementation\" [label=\"all PASS\"];\n    \"Any FAIL?\" -> \"Dispatch targeted fix agents\" [label=\"any FAIL\"];\n    \"Dispatch targeted fix agents\" -> \"Re-audit failing files\";\n    \"Re-audit failing files\" -> \"Attempts \u003C 3?\";\n    \"Attempts \u003C 3?\" -> \"structural-leakage-reviewer\" [label=\"yes\"];\n    \"Attempts \u003C 3?\" -> \"STOP: Audit failed after 3 remediation attempts\" [label=\"no\"];\n}\n```\n\n## Scope Rules\n\n- **READ ONLY from `workspace\u002Foutput\u002F`** — auditors check what reached the output without cross-referencing the raw analysis\n- Detailed reports with per-finding evidence are written to `workspace\u002Fraw\u002Faudit\u002F` alongside other analysis artifacts\n- Top-level summaries with PASS\u002FFAIL verdicts are written to `workspace\u002Foutput\u002Faudit\u002F` so downstream consumers see review outcomes\n- Summaries describe *outcomes*, not *source-derived examples*: a category PASS or FAIL with counts, plus overall PASS\u002FFAIL. Per-finding details live in the raw-side reports for remediation; they don't belong in the implementer-facing output.\n\n---\n\n## Why This Is LLM-Based, Not Grep-Based\n\nPattern matching is fundamentally the wrong tool for contamination detection. It produces both false positives and false negatives at rates that make it unreliable as a primary mechanism.\n\n**False positives are pervasive.** Patterns that detect minified identifiers also match regex character classes, priority levels (P0, P1), and standard technology names. Patterns for code structure language match natural English (\"cannot function without\"). Patterns for module counts match legitimate behavioral quantities (\"supports 3 output formats\"). An auditor drowning in false positives either wastes time on noise or starts ignoring real findings.\n\n**Contextual contamination is invisible to patterns.** No regex can detect:\n- A legitimate-looking constant name that is actually an internal implementation detail\n- Behavioral prose that describes code structure rather than observable behavior\n- Tables that mix clean behavioral content with contaminated source references\n- Feature flags and telemetry events that look like ordinary string constants\n\n**Semantic judgment catches everything patterns miss.** The core test is simple: \"Would an implementor encounter this exact string without seeing the source code?\" An LLM can apply this test to every identifier, name, and reference in a spec, using contextual understanding that patterns lack. This catches minified symbols, internal function names, vendor-specific flags, and structural leakage — all with a single semantic criterion rather than a brittle pattern library.\n\n## LLM-Based Audit Protocol\n\nAll auditors — specialist reviewers and deep-read generalists — are LLM agents that read files end-to-end and apply semantic judgment. There is no grep triage phase.\n\n### Specialist Reviewers\n\nThree parallel agents (structural-leakage-reviewer, content-contamination-reviewer, behavioral-completeness-reviewer) each read **every file** in `workspace\u002Foutput\u002Fspecs\u002F` and apply their category-specific checklists. See the role sections below for their checklists.\n\nEach specialist reviewer:\n1. Reads every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end\n2. For each finding, applies the semantic test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n3. Classifies findings by their category checklist (SL-1 through SL-8, CC-1 through CC-12, or BC-1 through BC-9)\n4. Produces a structured verdict per file (PASS\u002FFAIL with evidence)\n\n### Deep-Read Generalists\n\nIn parallel with the specialists, dispatch deep-read auditor agents (one per 4-5 domain files) with this prompt template:\n\n```\nRole: deep-read auditor\nSkill: second-pass-review\n\nRead each of these files END TO END:\n- workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile1>.md\n- workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile2>.md\n- ...\n\n## The Test\n\nFor every identifier, name, or reference in the spec, ask:\n**\"Would an implementor encounter this exact string without seeing the source code?\"**\n\nIf YES (it's in official docs, CLI help, config schemas, API specs, protocol standards) → CLEAN.\nIf NO (it came from reading the source code, observing internal state, or reverse engineering) → CONTAMINATION.\n\nThis test catches everything: minified gibberish, internal function names, internal feature flags, internal telemetry events, source file paths, and line numbers. No pattern list needed — just judgment.\n\n## Common traps\n\n- **Descriptive camelCase**: `shouldRetryOnTimeout` looks like English but it's an internal variable name. A different developer would call it something else. CONTAMINATION.\n- **Feature flags with vendor prefixes**: vendor-prefixed flags (e.g., `\u003Cvendor>_experiment_*`, `ff_\u003Cscope>_*`) — these are internal, not user-facing. CONTAMINATION.\n- **Telemetry event names**: `request_rate_limited`, `worker_shutdown_initiated` — internal analytics. CONTAMINATION.\n- **Config property names that look behavioral**: `strictSchemaValidation` — is this the actual config key users write, or an internal state property? Check the config schema spec to verify.\n\n## What is NOT contamination\n\n- Environment variables users set: `DATABASE_URL`, `CACHE_DISABLE_TTL`\n- CLI flags: `--format`, `--workers`, `--follow`\n- Config file keys users type: `upstreams`, `log_level`, `read_timeout`\n- API\u002Fprotocol field names: `Retry-After`, `Content-Type`, `Authorization`\n- Public library\u002Ftool names: `jq`, `ffmpeg`, `pandoc`\n- Standard tech names: `OAuth`, `PKCE`, `TLS`, `JWT`\n- IDE names: `PyCharm`, `GoLand`, `VSCode`\n\nFor each file, report:\n1. PASS or FAIL\n2. If FAIL: exact line numbers and the contaminating text\n3. Brief explanation of why it's contamination (applying the test above)\n\nWrite findings to workspace\u002Fraw\u002Faudit\u002Fdeep-read-\u003Cbatch>.md\n```\n\n### Targeted Fix\n\nFor each file that failed any audit (specialist or generalist), dispatch a fix agent:\n\n```\nRole: contamination fixer\nSkill: spec-sanitization (contamination taxonomy + rewrite patterns)\n\nRead workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile>.md\n\nThe audit found these specific issues:\n[paste exact findings with line numbers]\n\nFix ONLY the identified issues. Do NOT rewrite clean content.\nFor each fix, apply the appropriate rewrite pattern:\n- Minified IDs → remove or describe the behavior\n- Line numbers → remove the \"line NNN\" reference, keep the behavioral content\n- Module names → replace with behavioral domain description\n- Feature flags → \"a feature gate controlling [behavior]\"\n- Part N: headers → behavioral domain name\n\nWrite the corrected file back to the same path.\n```\n\n### Re-verify\n\nAfter all fixes, re-run audit (specialists + deep-read) on previously-failing files. Repeat up to 3 times.\n\n### Agent Sizing\n\n- **Specialist reviewers**: 3 agents, each reads all files for their category\n- **Deep-read generalists**: 4-5 domain files each (keeps context manageable)\n- **Fix agents**: 1 file each (focused, targeted fixes)\n- **Parallelism**: All specialist and deep-read agents run in parallel; all fix agents run in parallel\n\n---\n\n## Role: structural-leakage-reviewer\n\nChecks whether the organizational structure of `workspace\u002Foutput\u002F` leaks the original's internal module decomposition.\n\n**Why this matters:** output specs describe behavior, not the original's architecture. An implementer anchored to the original's module structure will reproduce its design — even when a different decomposition would be better for the new implementation. Module counts, inter-module tables, and domain-to-module mappings all encode architectural decisions that should be the implementer's to make fresh.\n\n### Semantic Checklist (8 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, check all 8 categories. Apply the core test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n\n#### SL-1: Module Names in Headers\n\nScan all `#`, `##`, `###` headers. Flag any header that contains a source module name, internal component name, or internal package name rather than a behavioral domain description.\n\nA header like \"Session Management\" is behavioral (PASS). A header like \"Fx3 Module\" or \"Part 3: CacheManager\" is structural leakage (FAIL).\n\n#### SL-2: Part N: Headers\n\nThe `Part N:` numbering pattern reveals the original module decomposition count and ordering. Any `Part N:` header is FAIL. Clean specs use behavioral domain names, not numbered parts.\n\n#### SL-3: Module Counts\n\nAny reference to a specific count of modules, components, or source files reveals the internal decomposition. FAIL unless the count refers to a user-facing concept (e.g., \"supports 3 output formats\").\n\n#### SL-4: Cross-Module \u002F Inter-Module \u002F Module Boundary Sections\n\nSection headings or content that reference module-to-module relationships (e.g., \"cross-module\", \"inter-module\", \"module boundary\", \"module interface\", \"module dependency\"). All are FAIL. Clean specs describe behavioral integration, not module interfaces.\n\n#### SL-5: Module IDs (MOD-NNN)\n\nInternal module identifiers from the analysis module map. Any `MOD-NNN` reference is FAIL.\n\n#### SL-6: Interface Consumption Tables\n\nTables showing which module consumes which module's interface. Look for language like \"consumes\", \"consumed by\", \"provides to\", \"depends on module\", \"module provides\".\n\n\"Depends on the API key being set\" is behavioral (PASS). \"Depends on AuthModule\" is structural (FAIL).\n\n#### SL-7: Domain-to-Module Mappings\n\nAny text that maps a behavioral domain back to its source module(s). Look for language like \"from module\", \"source module\", \"originally in\", \"derived from module\", \"mapped from\". All are FAIL.\n\n#### SL-8: Raw Paths\n\nAny reference to `workspace\u002Fraw\u002F` or files within it. All are FAIL.\n\n### Structural Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fstructural-leakage.md`:\n- Per-category: PASS\u002FFAIL, match count, file:line evidence for each match\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fstructural-summary.md`:\n- Per-category: PASS\u002FFAIL only\n- Overall: PASS\u002FFAIL\n- Report counts only (e.g., \"N findings in M files\"); the per-finding examples live in the detailed raw-side report.\n\n---\n\n## Role: content-contamination-reviewer\n\nChecks whether implementation-specific content from the original source survives in `workspace\u002Foutput\u002F`.\n\n### Semantic Checklist (12 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, check all 12 categories. Apply the core test: **\"Would an implementor encounter this exact string without seeing the source code?\"**\n\n#### CC-1: Minified Identifiers\n\nShort alphanumeric tokens that are artifacts of minification or bundling (e.g., `Ab2`, `sp`, `r0`, `Fx3`, `Qz`). Look for 2-3 character tokens that have no English meaning and appear in code-like or identifier-like contexts.\n\nTwo-letter abbreviations like \"UI\", \"IO\", \"ID\" are OK. Behavioral acronyms like \"API\", \"CLI\", \"SDK\" are OK. If the token has no English meaning, it's contamination.\n\n#### CC-2: Line Number References\n\nReferences to specific source code line numbers (e.g., \"line 42\", \"L157\", \":234:\"). FAIL unless referencing a user-facing output (e.g., \"error reported at line 5 of the config file\").\n\n#### CC-3: Source File Paths\n\nInternal source file paths, import paths, or bundle chunk references. Look for paths containing `src\u002F`, `lib\u002F`, `dist\u002F`, package manager directories, source file extensions in path context, or bundle chunk references (e.g., `chunk-042`).\n\nFAIL for all internal paths. Clean specs reference user-facing paths only (e.g., `~\u002F.config\u002Fapp\u002Fsettings.json`).\n\n#### CC-4: Internal Function\u002FClass Names\n\nNamed functions, classes, or methods from the source code. Look for camelCase identifiers that look like function\u002Fmethod names (e.g., `parseArgs()`, `serializeResponse()`), and PascalCase identifiers that look like class names (e.g., `JobRunner`, `QueueHandler`).\n\nWell-known compound words like \"JavaScript\", \"TypeScript\", \"WebSocket\" are legitimate (PASS). Internal names that a different developer would name differently are contamination (FAIL).\n\n#### CC-5: Code Structure Language\n\nPhrases that describe internal code organization rather than observable behavior. Look for text that names specific functions, classes, or methods and describes calling relationships between them.\n\n\"Calls the API endpoint\" is behavioral (PASS). \"Calls `parseArgs()` which returns...\" is code structure (FAIL).\n\n#### CC-6: IPC Channel Names\n\nInternal inter-process communication channel identifiers. Look for IPC-prefixed names, channel string literals, or message-passing identifiers that are internal to the implementation.\n\n**Rewrite guidance:** Replace with \"internal messaging mechanism\" or describe the behavioral outcome instead.\n\n#### CC-7: Store Property Names \u002F State Selectors\n\nInternal state management property names — selectors, store accessors, or state library-specific patterns. Look for references to specific state management libraries or their API patterns.\n\n**Rewrite guidance:** Replace with behavioral descriptions of the managed state (e.g., \"session state data\", \"user preferences store\").\n\n#### CC-8: Feature Flag Names and Telemetry Event Names\n\nInternal feature flag identifiers and telemetry\u002Fanalytics event names. These are NOT user-facing — they are internal implementation identifiers that happen to be strings rather than minified symbols. Look for:\n- Feature flag patterns (e.g., `FF_*`, `FEATURE_*`, vendor-prefixed flags)\n- Vendor-specific identifiers (e.g., vendor-prefixed flags (e.g., `\u003Cvendor>_experiment_*`, `ff_\u003Cscope>_*`), `experiment_*`)\n- Telemetry event names (internal analytics strings, not user-visible)\n\nThe test is: **does a user type this?** If the user never sees or configures this string, it is an internal identifier and MUST be generalized.\n\n**Rewrite guidance:** Replace flag names with \"a feature gate controlling [behavioral description]\". Replace telemetry event names with \"a telemetry event recording [what is measured]\".\n\n#### CC-9: CSS\u002FStyling Class Names\n\nInternal styling class names or module identifiers (CSS classes, BEM naming, styled-component references, styling module paths). FAIL for all. Clean specs describe visual behavior, not styling implementation.\n\n#### CC-10: Database Schema Details\n\nInternal database table names, column names, migration identifiers, or storage API references. Look for SQL statements, database file extensions, migration identifiers, or client-side storage API calls.\n\n**Rewrite guidance:** Replace with behavioral data persistence descriptions (e.g., \"persists session data locally\").\n\n**External system exception:** Matches in `workspace\u002Foutput\u002Fspecs\u002Fcontracts\u002F` files (database contracts, API contracts, CLI contracts, format contracts) are NOT contamination. External system contracts document interfaces the reimplementation must conform to — the schema\u002FAPI\u002FCLI details are behavioral constraints, not implementation choices.\n\n#### CC-11: Internal Filenames\n\nInternal application filenames that are not user-facing. Look for filenames with source code extensions that name internal implementation files rather than user-facing configuration or output files.\n\nUser-facing filenames (e.g., `config.json`, `settings.yaml`) are PASS. Internal source files (e.g., `auth-handler.py`, `session-manager.go`) are FAIL.\n\n#### CC-12: State Management Selectors\n\nSpecific selector or accessor patterns from state management libraries (e.g., `selectUserState`, `useSessionStore`, `getAuthState`). FAIL unless describing a user-facing API.\n\n### Content Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fcontent-contamination.md`:\n- Per-category: PASS\u002FFAIL, match count, file:line evidence for each match\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fcontent-summary.md`:\n- Per-category: PASS\u002FFAIL only\n- Overall: PASS\u002FFAIL\n- Report counts only (e.g., \"N findings in M files\"); the per-finding examples live in the detailed raw-side report.\n\n---\n\n## Role: behavioral-completeness-reviewer\n\nChecks that sanitization preserved all behavioral information. This is the \"did we throw the baby out with the bathwater?\" check.\n\n### Semantic Checklist (9 categories)\n\nRead every file in `workspace\u002Foutput\u002Fspecs\u002F` end-to-end. For each file, assess behavioral completeness across all 9 categories. The question here is not \"is this contaminated?\" but \"is critical behavioral information missing?\"\n\n#### BC-1: SPEC ID Coverage\n\nCount unique SPEC IDs across all output specs. Compare against the SPEC ID index (if one exists in `output\u002F`). Flag any SPEC IDs that appear in the raw sanitization report but not in output. FAIL if count is significantly lower than expected.\n\n#### BC-2: State Machines\n\nEvery stateful behavioral domain should have state machine documentation (states, transitions, triggers). Look for state machine descriptions, state diagrams, transition tables. FAIL if zero across all specs (unless all domains are genuinely stateless).\n\n#### BC-3: Error Conditions\n\nSpecs must document error conditions with equal depth to normal operations. Look for error condition descriptions, failure modes, error responses. FAIL if no error handling documentation exists.\n\n#### BC-4: Edge Cases\n\nEvery spec should document boundary conditions. Look for edge case descriptions, boundary conditions, corner cases, special cases. FAIL if none are documented.\n\n#### BC-5: Decision Trees\n\nBehavioral branching logic must be documented. Look for decision trees, conditional logic descriptions, branching behavior. FAIL if no branching logic is documented.\n\n#### BC-6: AC-to-SPEC Linkage\n\nAcceptance criteria should reference SPEC IDs they verify. Check `workspace\u002Foutput\u002Fvalidation\u002F` for acceptance criteria with SPEC ID references. FAIL if zero acceptance criteria exist.\n\n#### BC-7: Test Vector Coverage\n\nTest vectors should exist in `workspace\u002Foutput\u002Ftest-vectors\u002F` and contain concrete input\u002Foutput pairs. FAIL if zero test vector files or zero concrete pairs.\n\n#### BC-8: Constant Preservation\n\nNamed constants, magic numbers, timeout values, and limits should survive sanitization. Look for numeric values with units (ms, seconds, bytes, KB, MB), and named constants (MAX, MIN, DEFAULT, LIMIT, TIMEOUT, THRESHOLD). Low count may indicate constants were stripped during sanitization.\n\n#### BC-9: Requirement Level Coverage\n\nEvery behavioral claim should have MUST\u002FSHOULD\u002FMAY annotation (RFC 2119 language). FAIL if zero requirement-level keywords exist.\n\n### Completeness Audit Output\n\nWrite detailed report to `workspace\u002Fraw\u002Faudit\u002Fbehavioral-completeness.md`:\n- Per-category: PASS\u002FFAIL, count, assessment\n- Summary: total categories checked, total findings, overall PASS\u002FFAIL\n\nWrite summary to `workspace\u002Foutput\u002Faudit\u002Fcompleteness-summary.md`:\n- Per-category: PASS\u002FFAIL with counts only\n- Overall: PASS\u002FFAIL\n\n---\n\n## Remediation Protocol\n\nWhen any audit role or deep-read agent reports FAIL:\n\n1. **Batch by file**: Group findings by affected file\n2. **Dispatch fix agents**: One agent per file (or batch of small files), using the fix agent prompt template from the LLM-Based Audit Protocol\n3. **Re-verify**: Re-run specialist and deep-read audits on previously-failing files\n4. **Maximum 3 remediation rounds** — if audit still fails after 3 rounds, STOP the pipeline\n\n### Fix Agent Prompt Template\n\nFor each affected file, dispatch `moe-backstory:analyzer`:\n\n```\nRole: contamination fixer\nSkill: spec-sanitization\n\nRead workspace\u002Foutput\u002Fspecs\u002Fdomains\u002F\u003Cfile>.md\n\nThe audit found these specific issues:\n- Line [N]: [exact finding and category]\n- Line [M]: [exact finding and category]\n\nFix ONLY the identified issues. For each:\n1. Read the surrounding context (5 lines before\u002Fafter)\n2. Determine if this is real contamination or false positive\n3. If real: apply the matching rewrite pattern from the skill\n4. If false positive: leave unchanged\n\nWrite the corrected file back to the same path.\n```\n\n## Output Directory Structure\n\n```\nworkspace\u002F\n├── raw\u002F\n│   └── audit\u002F                    # Detailed reports WITH evidence (stays in raw)\n│       ├── structural-leakage.md\n│       ├── content-contamination.md\n│       └── behavioral-completeness.md\n└── output\u002F\n    └── audit\u002F                    # Summaries (outcomes only)\n        ├── structural-summary.md\n        ├── content-summary.md\n        └── completeness-summary.md\n```\n\n## Definition of Done\n\n- [ ] All 8 structural checks executed against `workspace\u002Foutput\u002F`\n- [ ] All 12 content checks executed against `workspace\u002Foutput\u002F`\n- [ ] All 9 behavioral-completeness checks executed against `workspace\u002Foutput\u002F`\n- [ ] Deep contextual audit agents dispatched (one per 4-5 domain files)\n- [ ] All deep-read findings triaged (real vs false positive)\n- [ ] Detailed reports written to `workspace\u002Fraw\u002Faudit\u002F`\n- [ ] Clean summaries written to `workspace\u002Foutput\u002Faudit\u002F` (outcomes only)\n- [ ] Overall PASS\u002FFAIL determination made\n- [ ] If FAIL: remediation attempted (up to 3 rounds, using fix agent prompt template)\n- [ ] If PASS: `review-complete` git tag applied\n",{"name":5,"description":7},"main","728894f3f85fbd4e788f015ddfd72bb6155d5dd5","plugins\u002Fmoe-backstory\u002F.codex-plugin\u002Fskills\u002Fsecond-pass-review",1,"https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe","https:\u002F\u002Fgithub.com\u002Fzak-keown","2026-09-05 06:29:06",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add zak-keown\u002Fmoe --skill second-pass-review",{"tool":36,"command":37},"bunx","bunx skills add zak-keown\u002Fmoe --skill second-pass-review",{"tool":39,"command":40},"pnpm","pnpm dlx skills add zak-keown\u002Fmoe --skill second-pass-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe-backstory\u002F.codex-plugin\u002Fskills\u002Fsecond-pass-review\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7C1Z5362Y8NVRZ69HWP0ZD0","write-skill","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fwrite-skill\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7C1YZ9966WK9R6ZRPCGWF3G","write-plan","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fwrite-plan\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7C1YMR4SJD7BPBBPXZCVGVH","write-clearly","Apply Strunk's timeless writing rules to ANY prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text. Makes your writing clearer, stronger, and more professional.","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fwrite-clearly\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7C1YH9805YSM0N20VQAVSXF","windows-vm","Create, manage, or connect to a headless Windows 11 VM running in Docker with SSH access. Use when the user wants to spin up, stop, restart, or SSH into a Windows VM.","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fwindows-vm\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7C1YD87SCNEJ2C9B8HFR2NQ","verify-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating MRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fverify-completion\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7C1YARDEHT0TJ9BRG30ZCF4","using-moe","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fzak-keown\u002Fmoe\u002Fblob\u002Fmain\u002Fplugins\u002Fmoe\u002Fskills\u002Fusing-moe\u002FSKILL.md",[],[]]