| name | cross-doc-consistency-checker |
| description | Uses knowledge graphs and adversarial multi-model reviews to enforce absolute numerical and logical consistency across interdependent Markdown and Excel files. Use when revising multi-file project proposals, financial models, or architecture docs. |
| disable-model-invocation | true |
Cross-Document Consistency Checker (Knowledge Graph approach)
Context & Purpose
When dealing with complex project proposals that span multiple files (e.g., Markdown narratives, requirement specs, financial Excel models), a small change in scope (e.g., cutting a budget item) can create cascading contradictions.
This skill defines a "Knowledge Graph (KG) & Script-Driven Adversarial Review" methodology to guarantee 100% numerical and logical consistency across documents.
Methodology: The 4-Step DBTL (Design-Build-Test-Learn) for Docs
1. Design: Establish the "Knowledge Network" (The Single Source of Truth)
Before making ad-hoc edits, define the immutable anchor points:
- CapEx/Budget Constraints: What is the hard total? (e.g., 5,100万)
- Scope Constraints: What modules are in-house? What is outsourced?
- Timeline/Phase: Single-phase vs Multi-phase? (e.g., 18-month one-time build vs Phase 1/2/3).
- Revenue/Utilization: What is the Y1 capacity? When does it ramp?
Document this KG (Knowledge Graph) explicitly in your scratchpad. Every edit must trace back to these roots.
2. Build: Script-Driven Cascading Updates
Never rely on manual LLM find-and-replace for numbers scattered across 100-page documents.
- Write robust Python scripts using
re (regex) for Markdown and openpyxl for Excel.
- For Excel, read formulas, recalculate dynamically, and overwrite specific cells without destroying the structure.
- For Markdown, target headers and bullet points accurately.
3. Test: Adversarial Multi-Model Review
Use independent subagents (via /multi-model-review or parallel Task calls) to scrutinize the work.
- Prompt them specifically to look for "ghosts" (e.g., an outsourced item still described as if we bought the equipment, or leftover "Phase II" budgets).
- Ask them to sum the numbers manually and verify they hit the KG constraint (e.g., summing M0 to M11 = 3700).
4. Learn: Root-Cause Cleanup
If the adversarial reviewers find a contradiction:
- Do not just patch the line. Trace the root cause in the Knowledge Network.
- (e.g., If M5 is 1000W but the breakdown sums to 1500W, rewrite the breakdown line explicitly).
- Re-run the python validation script until it returns exit code 0 with NO warnings.
Example Tools to Use
- Python:
re.sub(r'old_pattern', 'new_pattern', text)
- OpenPyXL:
ws.cell(row=x, col=y, value=new_val)
- Subagents: Launch
Task with model: "composer-2.5-fast" and prompt: "Act as an adversarial reviewer... Check for these specific forbidden words..."
Implementation Script
See scripts/verify_kg.py for a template of how to encode the knowledge graph validation into a Python assertion suite.