Large Document / Codebase Mastery
Summaries lose information. "Analyze this 80k-token codebase" with no structure
produces a vague paragraph about architecture that misses the three critical bugs
and the two deprecated modules that half the new code still imports.
The skill is not consuming large context — Claude does that automatically. The skill
is structuring the task so the synthesis is precise: specific questions, specific
output formats, explicit cross-reference instructions, and verification passes that
confirm the model used the actual document rather than its priors.
SLASH COMMANDS
| Command |
Action |
/map |
Build a structural map of the document (sections, components, entities) |
/index <topic> |
Find every location in the document that touches a specific topic |
/extract <type> |
Extract all instances of a type: decisions, risks, assumptions, TODOs, etc. |
/cross-ref <a> <b> |
Find all connections between two topics, sections, or entities |
/contradictions |
Surface any internal contradictions or inconsistencies in the document |
/gaps |
Identify what's absent — what the document should address but doesn't |
/trace <entity> |
Follow an entity (function, concept, person, requirement) through the full document |
/timeline |
Extract a chronological sequence of events, changes, or decisions |
/compare <section-a> <section-b> |
Directly compare two sections or files |
/synthesize <question> |
Answer a specific question using the full document as context |
/verify <claim> |
Check whether a specific claim is supported by the document |
/hotspots |
Identify the highest-complexity or highest-risk areas |
/summary-lossy |
Produce a short summary with explicit list of what was dropped |
HIGH-LEVEL WORKFLOW
User provides large document / codebase
│
├─ Phase 1: Document Orientation
│ Build structural map; identify key entities and sections
│
├─ Phase 2: Scope Definition
│ Clarify the synthesis goal — don't analyze everything equally
│
├─ Phase 3: Targeted Extraction
│ Pull specific patterns, entities, or facts with location references
│
├─ Phase 4: Cross-Reference Pass
│ Connect extracted elements across sections or files
│
├─ Phase 5: Synthesis
│ Answer the synthesis question with evidence citations
│
└─ Phase 6: Verification
Confirm claims are in the document, not in prior knowledge
PHASE 1 — DOCUMENT ORIENTATION
Before any analysis, build an orientation map. This prevents anchor bias —
where the first section dominates the analysis and the rest is skimmed.
Orientation map format
DOCUMENT MAP: [title / description]
Total scope: [estimated sections / files / pages]
STRUCTURE
[Section/File 1]: [1-line description] — [key entities defined]
[Section/File 2]: [1-line description] — [key entities defined]
...
KEY ENTITIES
[Entity type]: [list] — (e.g., Functions, Classes, Requirements, Actors)
DENSITY DISTRIBUTION
Heavy: [sections with most content / complexity]
Light: [sections with least content]
Missing: [sections referenced but absent]
PHASE 2 — SCOPE DEFINITION
Large documents contain far more than any single analysis needs. Before extracting,
define the synthesis aperture — what lens is this analysis using?
Synthesis aperture types
| Aperture |
Question being answered |
Best for |
| Decision audit |
What decisions were made, by whom, and why? |
Meeting transcripts, PRDs, ADRs |
| Risk surface |
What can go wrong, and where? |
Architecture docs, contracts, plans |
| Dependency map |
What depends on what? |
Codebases, system designs |
| Consistency check |
Does the document contradict itself? |
Legal docs, specs, policies |
| Entity trace |
How does X evolve through the document? |
Code, narratives, regulations |
| Gap analysis |
What's missing that should be here? |
Requirements, audits |
| Change surface |
What changed between versions / sections? |
Diffs, revisions, amendments |
Scope question rules
- Ask ONE scope-defining question if the synthesis goal is ambiguous
- If the user says "analyze everything," default to: Risk surface + Dependency map
- Never attempt all apertures simultaneously — output becomes noise
PHASE 3 — TARGETED EXTRACTION
Extract with location anchors. Every extracted element must cite where it came from.
Extraction format
EXTRACTION: [type] — [aperture]
[ID]. [Extracted element]
Location: [section / file / line / page]
Context: [1 sentence: surrounding context that makes this significant]
Flags: [RISK | DECISION | ASSUMPTION | TODO | CONTRADICTION | DEPENDENCY]
Extraction rules
- Cite location for every item. Uncited extractions cannot be verified.
- Do not paraphrase. Quote directly, then interpret in the Context field.
- Flag before filtering. Extract everything matching the type, then rank.
- Note absences. If a required element (e.g., error handling, auth check) is absent, flag as MISSING.
- Distinguish document claims from your inferences. Use "The document states..." vs "This implies..."
High-value extraction targets by document type
| Document type |
High-value extraction targets |
| Codebase |
TODO/FIXME, dead code, circular deps, missing error handling, hardcoded values |
| Legal / contract |
Obligations, conditions, termination clauses, liability caps, ambiguous definitions |
| PRD / spec |
Unverified assumptions, missing acceptance criteria, conflicting requirements |
| Research / report |
Methodology limitations, sample sizes, confidence intervals, conflicting findings |
| Architecture doc |
Single points of failure, unstated assumptions, missing components |
PHASE 4 — CROSS-REFERENCE PASS
The insight that justifies large-context analysis only appears when you connect
elements that are far apart in the document.
Cross-reference format
CROSS-REFERENCE: [entity A] ↔ [entity B]
Connection 1:
[Entity A] location: [cite]
[Entity B] location: [cite]
Relationship: [DEPENDS_ON | CONTRADICTS | MODIFIES | REFERENCES | UNDEFINED]
Significance: [1 sentence: why this connection matters]
Connection 2:
...
SUMMARY
Total connections found: [N]
Critical connections (high-risk or decision-affecting): [list]
Unresolved: [connections implied but not made explicit in the document]
Cross-reference rules
- Always cite both locations — without both citations, the connection cannot be verified
CONTRADICTS always surfaces first — contradictions are the highest-value finding
UNDEFINED means the relationship exists but the document doesn't specify it — flag these
PHASE 5 — SYNTHESIS
Answer the synthesis question using the extracted and cross-referenced evidence.
Synthesis output format
SYNTHESIS: [question / aperture]
FINDING
[Direct answer in 1–3 sentences]
EVIDENCE
1. [claim] — Source: [location]
2. [claim] — Source: [location]
3. [claim] — Source: [location]
PATTERNS
[Cross-document pattern that only appears with full context]
ANOMALIES
[Elements that don't fit the pattern; outliers; exceptions]
CONFIDENCE
[HIGH / MEDIUM / LOW] — [1 sentence: what limits confidence]
WHAT'S NOT IN THE DOCUMENT
[What the synthesis question required but the document doesn't contain]
PHASE 6 — VERIFICATION
After synthesis, run a verification pass to confirm the output is document-grounded.
Verification checklist
For each major claim in the synthesis:
Verification format
VERIFICATION PASS
Claim: "[claim from synthesis]"
Status: DOCUMENT-GROUNDED | INFERENCE | TRAINING KNOWLEDGE
Citation: [location, or NONE]
Note: [if inference or training knowledge: flag for user review]
Common verification failures in large-context tasks
| Failure |
Signal |
Fix |
| Prior contamination |
Claim is true but not in the document |
Flag as TRAINING KNOWLEDGE |
| Location drift |
Cited location doesn't contain the claim |
Re-read and re-cite |
| Paraphrase inflation |
Summary adds meaning the original doesn't have |
Quote directly |
| Recency bias |
Last section dominates synthesis |
Re-run extraction on early sections |
| Gap hallucination |
Document "says" something it actually omits |
Add to WHAT'S NOT IN THE DOCUMENT |
1---2name: large-doc-mastery3description: >4 Large document and codebase synthesis skill. Activates when the user provides5 50k–200k+ tokens of context — codebases, PDFs, legal documents, transcripts,6 research corpora — and needs synthesis, cross-referencing, or insight extraction7 with perfect recall across the entire context. Not a summarizer. A precision8 instrument for finding patterns, contradictions, dependencies, and insights that9 only emerge when you hold the whole thing at once.10 Use when user says: analyze this codebase, read this whole document, find all11 references to X, synthesize across sections, what does this say about Y, find12 contradictions, extract all decisions, map the dependencies, read the whole thing,13 cross-reference, audit the entire document, what changed between sections,14 find every mention of, trace this through the code, what's missing.15 Do NOT activate for: small documents where a direct answer is more useful,16 tasks that don't require cross-document reasoning.17 First response: "Large Document Mode active. Paste or attach your document(s).18 Tell me the synthesis goal — what insight, decision, or structure you're after."19license: Apache 2.020metadata:21 source: https://skillmd.com/skills/sandeeprdy1729/large-doc-mastery22---2324# Large Document / Codebase Mastery2526Summaries lose information. "Analyze this 80k-token codebase" with no structure27produces a vague paragraph about architecture that misses the three critical bugs28and the two deprecated modules that half the new code still imports.2930The skill is not consuming large context — Claude does that automatically. The skill31is structuring the task so the synthesis is precise: specific questions, specific32output formats, explicit cross-reference instructions, and verification passes that33confirm the model used the actual document rather than its priors.3435---3637## SLASH COMMANDS3839| Command | Action |40| --- | --- |41| `/map` | Build a structural map of the document (sections, components, entities) |42| `/index <topic>` | Find every location in the document that touches a specific topic |43| `/extract <type>` | Extract all instances of a type: decisions, risks, assumptions, TODOs, etc. |44| `/cross-ref <a> <b>` | Find all connections between two topics, sections, or entities |45| `/contradictions` | Surface any internal contradictions or inconsistencies in the document |46| `/gaps` | Identify what's absent — what the document should address but doesn't |47| `/trace <entity>` | Follow an entity (function, concept, person, requirement) through the full document |48| `/timeline` | Extract a chronological sequence of events, changes, or decisions |49| `/compare <section-a> <section-b>` | Directly compare two sections or files |50| `/synthesize <question>` | Answer a specific question using the full document as context |51| `/verify <claim>` | Check whether a specific claim is supported by the document |52| `/hotspots` | Identify the highest-complexity or highest-risk areas |53| `/summary-lossy` | Produce a short summary with explicit list of what was dropped |5455---5657## HIGH-LEVEL WORKFLOW5859```text60User provides large document / codebase61 │62 ├─ Phase 1: Document Orientation63 │ Build structural map; identify key entities and sections64 │65 ├─ Phase 2: Scope Definition66 │ Clarify the synthesis goal — don't analyze everything equally67 │68 ├─ Phase 3: Targeted Extraction69 │ Pull specific patterns, entities, or facts with location references70 │71 ├─ Phase 4: Cross-Reference Pass72 │ Connect extracted elements across sections or files73 │74 ├─ Phase 5: Synthesis75 │ Answer the synthesis question with evidence citations76 │77 └─ Phase 6: Verification78 Confirm claims are in the document, not in prior knowledge79```8081---8283## PHASE 1 — DOCUMENT ORIENTATION8485Before any analysis, build an orientation map. This prevents anchor bias —86where the first section dominates the analysis and the rest is skimmed.8788### Orientation map format8990```text91DOCUMENT MAP: [title / description]92Total scope: [estimated sections / files / pages]9394STRUCTURE95 [Section/File 1]: [1-line description] — [key entities defined]96 [Section/File 2]: [1-line description] — [key entities defined]97 ...9899KEY ENTITIES100 [Entity type]: [list] — (e.g., Functions, Classes, Requirements, Actors)101102DENSITY DISTRIBUTION103 Heavy: [sections with most content / complexity]104 Light: [sections with least content]105 Missing: [sections referenced but absent]106```107108---109110## PHASE 2 — SCOPE DEFINITION111112Large documents contain far more than any single analysis needs. Before extracting,113define the synthesis aperture — what lens is this analysis using?114115### Synthesis aperture types116117| Aperture | Question being answered | Best for |118| --- | --- | --- |119| **Decision audit** | What decisions were made, by whom, and why? | Meeting transcripts, PRDs, ADRs |120| **Risk surface** | What can go wrong, and where? | Architecture docs, contracts, plans |121| **Dependency map** | What depends on what? | Codebases, system designs |122| **Consistency check** | Does the document contradict itself? | Legal docs, specs, policies |123| **Entity trace** | How does X evolve through the document? | Code, narratives, regulations |124| **Gap analysis** | What's missing that should be here? | Requirements, audits |125| **Change surface** | What changed between versions / sections? | Diffs, revisions, amendments |126127### Scope question rules128- Ask ONE scope-defining question if the synthesis goal is ambiguous129- If the user says "analyze everything," default to: Risk surface + Dependency map130- Never attempt all apertures simultaneously — output becomes noise131132---133134## PHASE 3 — TARGETED EXTRACTION135136Extract with location anchors. Every extracted element must cite where it came from.137138### Extraction format139140```text141EXTRACTION: [type] — [aperture]142143[ID]. [Extracted element]144 Location: [section / file / line / page]145 Context: [1 sentence: surrounding context that makes this significant]146 Flags: [RISK | DECISION | ASSUMPTION | TODO | CONTRADICTION | DEPENDENCY]147```148149### Extraction rules150- **Cite location for every item.** Uncited extractions cannot be verified.151- **Do not paraphrase.** Quote directly, then interpret in the Context field.152- **Flag before filtering.** Extract everything matching the type, then rank.153- **Note absences.** If a required element (e.g., error handling, auth check) is absent, flag as MISSING.154- **Distinguish document claims from your inferences.** Use "The document states..." vs "This implies..."155156### High-value extraction targets by document type157158| Document type | High-value extraction targets |159| --- | --- |160| Codebase | TODO/FIXME, dead code, circular deps, missing error handling, hardcoded values |161| Legal / contract | Obligations, conditions, termination clauses, liability caps, ambiguous definitions |162| PRD / spec | Unverified assumptions, missing acceptance criteria, conflicting requirements |163| Research / report | Methodology limitations, sample sizes, confidence intervals, conflicting findings |164| Architecture doc | Single points of failure, unstated assumptions, missing components |165166---167168## PHASE 4 — CROSS-REFERENCE PASS169170The insight that justifies large-context analysis only appears when you connect171elements that are far apart in the document.172173### Cross-reference format174175```text176CROSS-REFERENCE: [entity A] ↔ [entity B]177178Connection 1:179 [Entity A] location: [cite]180 [Entity B] location: [cite]181 Relationship: [DEPENDS_ON | CONTRADICTS | MODIFIES | REFERENCES | UNDEFINED]182 Significance: [1 sentence: why this connection matters]183184Connection 2:185 ...186187SUMMARY188 Total connections found: [N]189 Critical connections (high-risk or decision-affecting): [list]190 Unresolved: [connections implied but not made explicit in the document]191```192193### Cross-reference rules194- Always cite both locations — without both citations, the connection cannot be verified195- `CONTRADICTS` always surfaces first — contradictions are the highest-value finding196- `UNDEFINED` means the relationship exists but the document doesn't specify it — flag these197198---199200## PHASE 5 — SYNTHESIS201202Answer the synthesis question using the extracted and cross-referenced evidence.203204### Synthesis output format205206```text207SYNTHESIS: [question / aperture]208209FINDING210[Direct answer in 1–3 sentences]211212EVIDENCE2131. [claim] — Source: [location]2142. [claim] — Source: [location]2153. [claim] — Source: [location]216217PATTERNS218[Cross-document pattern that only appears with full context]219220ANOMALIES221[Elements that don't fit the pattern; outliers; exceptions]222223CONFIDENCE224[HIGH / MEDIUM / LOW] — [1 sentence: what limits confidence]225226WHAT'S NOT IN THE DOCUMENT227[What the synthesis question required but the document doesn't contain]228```229230---231232## PHASE 6 — VERIFICATION233234After synthesis, run a verification pass to confirm the output is document-grounded.235236### Verification checklist237238For each major claim in the synthesis:239- [ ] Can I cite the exact location in the document where this appears?240- [ ] Am I paraphrasing accurately, or am I inferring beyond what's stated?241- [ ] Is this in the document, or is it from my training data?242- [ ] If I'm connecting two things, are both connections cited?243244### Verification format245246```text247VERIFICATION PASS248249Claim: "[claim from synthesis]"250 Status: DOCUMENT-GROUNDED | INFERENCE | TRAINING KNOWLEDGE251 Citation: [location, or NONE]252 Note: [if inference or training knowledge: flag for user review]253```254255### Common verification failures in large-context tasks256257| Failure | Signal | Fix |258| --- | --- | --- |259| Prior contamination | Claim is true but not in the document | Flag as TRAINING KNOWLEDGE |260| Location drift | Cited location doesn't contain the claim | Re-read and re-cite |261| Paraphrase inflation | Summary adds meaning the original doesn't have | Quote directly |262| Recency bias | Last section dominates synthesis | Re-run extraction on early sections |263| Gap hallucination | Document "says" something it actually omits | Add to WHAT'S NOT IN THE DOCUMENT |