Context Firewall
This skill should be used when the user asks to "analyze a large log", "summarize a big file", "read the whole repository", "process long tool output", "avoid context window overflow", "use sub-agents for preprocessing", "add evidence with line numbers", "verify claims with locators", or mentions "TaskSpec", "SubResult", "Evidence Contract", "Context Firewall", "Map-Reduce", "FileWorker", "Aggregator", "Critic".
What this skill does
Implement a **Context Firewall** workflow to prevent the master context from being flooded by large inputs.
## Purpose
Route large inputs (big files, logs, PDFs/images, long MCP/tool outputs) through sub-agents that produce **compressed, auditable results**. Only pass back:
- Structured claims
- Evidence locators (line/symbol/tool-call)
- Coverage statements
## When to use
Prefer this workflow when any of the following is true:
- The user wants the "full" content of a large file/log/document.
- Tool output is long/noisy (search results, crawls, API responses).
- The task needs multi-file scanning or cross-file synthesis.
- The output must be **verifiable** without re-reading everything.
## Core contract (Evidence Contract)
For every meaningful claim:
- Attach at least one `evidence` item.
- Use a locator that enables low-cost verification.
Locator preference order:
1) `line_range` (default)
2) `symbol_range` (functions/classes)
3) `tool_call` (tool-derived facts; include args hash and rerun hint when safe)
4) `byte_range/json_path/stack_signature` (define, but treat as harder to verify in v1)
Keep quotes short:
- Respect the `quote_max_chars` constraint.
- Never paste large raw blobs.
## Recommended workflow
### 1) Generate TaskSpec
Create a `TaskSpec.v1` that is explicit about:
- Objective
- Inputs (files/tool calls)
- Questions
- must_cover checklist
- Constraints (budget + evidence requirements)
- Risk level
Prefer using the command:
- `/cf-spec` to generate a schema-valid template.
### 2) Run Map-Reduce preprocessing
Use `/cf-run` to:
- Split inputs into shards
- Run `cf-fileworker` on each shard in parallel
- Merge with `cf-aggregator` into a final `SubResult.v1`
Hard requirements for sub-agents:
- Output **strict JSON only** (no markdown fences, no extra commentary).
- Ensure every claim includes evidence.
### 3) Verify cheaply
Use `/cf-verify` to sample-check claims:
- Choose sampling rate by `risk_level`.
- Re-read only the referenced snippets.
- Produce `VerifyReport.v1`.
If verification fails:
- Request stronger evidence (more/clearer locators).
- Narrow `must_cover`.
- Run a second-pass `cf-critic` to independently review.
## Coverage & anti-leak rules
Always include a `coverage` section that declares:
- Which inputs were scanned
- Which method was used (grep+window, full scan, time-window scan)
- Known gaps (missing archives, not provided inputs)
Never:
- Dump raw input into the master context.
- Hide uncertainty: mark gaps explicitly.
## Operational defaults
Default thresholds are configurable in:
- `.claude/context-firewall.local.md`
Defaults:
- `read_warn_bytes: 524288`
- `tool_output_warn_chars: 20000`
- `sample_rate: {low:0.05, medium:0.15, high:0.30}`
## Related resources
- Commands:
- `plugins/context-firewall/commands/cf-spec.md`
- `plugins/context-firewall/commands/cf-run.md`
- `plugins/context-firewall/commands/cf-verify.md`
- Agents:
- `plugins/context-firewall/agents/cf-fileworker.md`
- `plugins/context-firewall/agents/cf-aggregator.md`
- `plugins/context-firewall/agents/cf-critic.md`
- Schemas:
- `plugins/context-firewall/schemas/task-spec.v1.schema.json`
- `plugins/context-firewall/schemas/sub-result.v1.schema.json`
- `plugins/context-firewall/schemas/verify-report.v1.schema.json`
- `plugins/context-firewall/schemas/settings.v1.schema.json`
- Settings template:
- `plugins/context-firewall/scripts/settings-frontmatter.md`
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.