From scope-check
Evaluates specification complexity against context window limits before authoring plans or designs, estimates token expansion, and recommends chunking strategies to prevent context collapse.
How this skill is triggered — by the user, by Claude, or both
Slash command
/scope-check:scope-checkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Evaluate specification documents against Claude Code's context window constraints. Provides grounded estimations of whether a spec will fit within safe context bounds and recommends chunking strategies when it won't.
Evaluate specification documents against Claude Code's context window constraints. Provides grounded estimations of whether a spec will fit within safe context bounds and recommends chunking strategies when it won't.
Two modes:
/scope-check path/to/spec.md before implementationWhen to activate (automatic detection):
You MUST activate this skill when you detect ANY of these workflow signals:
Planning workflow indicators:
docs/plans/ or docs/design/Pre-write detection:
plans/, design/, spec/, architecture/Other planning skill activity:
Interception workflow:
When ANY trigger detected:
Why this matters:
This is a GATE skill - you actively assert yourself into planning workflows to prevent context budget issues.
# Basic check
/scope-check docs/feature-spec.md
# With explicit overrides
/scope-check docs/feature-spec.md --stack typescript --tdd comprehensive
Stack detection (in order):
stack: declaration (if present)package.json → TypeScript/JavaScriptpyproject.toml / requirements.txt → Python*.csproj / *.sln → C#Cargo.toml → Rustgo.mod → GoTDD detection:
tdd: declaration (if present)pytest.ini, jest.config, *.test.ts, tests/ → "standard" assumedToken estimation:
Prose sections: character_count / 4
Code blocks: line_count × 10
Tables/structured: character_count / 3
Total + 15% buffer for formatting variance
Complexity metrics (no model calls required):
base_output = spec_tokens × language_multiplier × 15
with_tdd = base_output × tdd_multiplier
conservative = with_tdd × (1 + spec_type_variance)
See MULTIPLIERS.md for language, TDD, and spec type values.
Two constraints to check:
Claude Code's Read tool has a hard 25,000 token limit (~100K characters). Specs exceeding this cannot be read in a single pass.
| Spec Size | Status | Action |
|---|---|---|
| <20K tokens (~80K chars) | OK | Spec readable in single pass |
| 20-25K tokens (80-100K chars) | WARNING | Near limit, consider splitting |
| >25K tokens (~100K+ chars) | MUST SPLIT | Cannot write as single file |
If spec exceeds 25K tokens: Block writing single file. Split into multiple spec files with descriptive slug names based on semantic boundaries:
spec-auth-flow.md # Authentication and session management
spec-data-models.md # Core entities and relationships
spec-api-endpoints.md # REST/GraphQL interface definitions
spec-ui-components.md # Frontend component specifications
Use coupling analysis to determine boundaries - high-coupling sections stay together, low-coupling sections split naturally.
See CONTEXT-BUDGET.md for configurable assumptions and customization instructions.
Default baseline (Sonnet 4.5):
Status thresholds (% of 128K working budget):
| Status | Threshold | % Used | Meaning |
|---|---|---|---|
| GREEN | <50K | <39% | Safe single-pass, proceed freely |
| YELLOW | 50-75K | 39-58% | Fits but tight, include context management recommendations |
| ORANGE | 75-100K | 58-78% | Chunking recommended, offer interactive refinement |
| RED | >100K | >78% | Must decompose, block without override |
Note: Users can customize thresholds in CONTEXT-BUDGET.md based on their actual /context overhead and risk tolerance.
┌─────────────────────────────────────────────────────┐
│ SCOPE CHECK: [STATUS EMOJI] [STATUS] - [One-liner] │
├─────────────────────────────────────────────────────┤
│ Spec: [path] ([X] tokens) │
│ Stack: [Language] + [TDD level] TDD │
│ Estimated output: [range] tokens │
│ Working budget: 128K (200K - 27K overhead - 45K buffer) │
│ Usage: [Y]K ([Z]% of working budget) │
│ │
│ → [Primary recommendation] │
│ → [Secondary recommendation if applicable] │
└─────────────────────────────────────────────────────┘
DETAILED ANALYSIS
─────────────────
Token breakdown:
Prose: [X] tokens ([Y] chars)
Code samples: [X] tokens ([Y] lines)
Tables: [X] tokens ([Y] chars)
Complexity metrics:
NL-CC: [X] ([low/moderate/high])
Coupling ratio: [X] ([chunkable/resists chunking])
Function points: [X] UFP
Expansion calculation:
Base: [formula] = [X] tokens
With TDD ([multiplier]×): [Y] tokens
Conservative (+[Z]%): [W] tokens
When chunking is recommended, enter interactive mode:
CHUNKING ANALYSIS
─────────────────
Your spec has coupling ratio [X] ([chunkable/resistant]).
Detected [N] natural boundaries:
Chunk 1: Lines [X-Y] "[Section Name]"
~[X] tokens → ~[Y]K output
Dependencies: [none/list]
Chunk 2: Lines [X-Y] "[Section Name]"
~[X] tokens → ~[Y]K output
Dependencies: [Chunk N]
Recommended order: [sequence with parallelization notes]
Does this split align with your architecture?
[A] Looks good, generate execution plan
[B] Adjust boundaries (tell me what to move)
[C] Different split strategy (describe your preference)
If B or C selected, ask targeted follow-ups:
Recalculate estimates after each adjustment.
EXECUTION PLAN
──────────────
Shared context header (include in each chunk):
- Core types: [list]
- Constants: [list]
- ~[X] tokens overhead per chunk
Chunk 1 → implement → verify → commit
Chunk 2 → implement → verify → commit
[Parallel chunks marked with ┬┘ notation]
Total estimated API calls: [range]
For multi-agent execution, calculate coordinator burden:
SUBAGENT ANALYSIS
─────────────────
Chunks: [N]
Estimated summaries: [X]K tokens ([N] × 2K)
Handoff overhead: [Y]K tokens
Coordinator total: ~[Z]K tokens
[✓/⚠️] [Assessment of coordinator budget safety]
If coordinator load >25% of budget, recommend:
When invoked by brainstorming or writing-plans before writing artifacts:
Before writing ANY spec, estimate output size. If spec would exceed 25K tokens (~100K chars):
BLOCKED - Must split first:
"Spec would be ~[X]K tokens, exceeding 25K read limit.
Must split into semantic chunks:
Proposed split:
spec-[slug-1].md (~[X]K tokens) - [description]
spec-[slug-2].md (~[X]K tokens) - [description]
spec-[slug-3].md (~[X]K tokens) - [description]
Proceed with this split? [A] Yes [B] Suggest different boundaries"
No override allowed - this is a hard tooling constraint.
GREEN/YELLOW: Proceed to write, include status in document header
<!-- scope-check: GREEN - 45K estimated, safe for single-pass -->
ORANGE: Show chunking recommendations, ask: "Spec is ORANGE status. Options: [A] Split now using recommended boundaries [B] Write as-is with warning header [C] Show detailed analysis first"
RED: Block write, require resolution: "Spec is RED status ([X]K estimated, exceeds 100K safe limit). Must either: [A] Enter interactive chunking to split spec [B] Override with explicit acknowledgment"
Override syntax: User says "Write anyway, I understand the risk"
<!-- scope-check: RED (override) - 245K estimated, chunking recommended -->
Include with YELLOW+ status. See SAFETY.md for full details.
Key mitigations:
npx claudepluginhub dvdarkin/claude-skills --plugin scope-checkGenerates structured feature specifications with demoable units, functional requirements, and proof artifacts. Use when defining what to build before writing code.
Authors structured specifications (NLSpec) via multi-AI research and consensus gathering. Useful for complex requirement definition.