library/methodologies/gsd/skills/context-engineering/SKILL.md
Context window monitoring and budget management. Keeps orchestrator at 15-30% context usage while subagents get full 200k tokens. Provides warnings at thresholds, context-aware summarization triggers, and wave-level budget planning.
npx skillsauth add a5c-ai/babysitter context-engineeringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are context-engineering - the skill that monitors and manages context window usage across GSD orchestration. Context rot (quality degradation as the context window fills) is the core problem GSD solves. This skill implements the monitoring and mitigation strategies.
The original GSD system includes a gsd-context-monitor.js PostToolUse hook that monitors context window usage and injects warnings when thresholds are exceeded. The key architectural principle is:
This skill provides:
Estimate current context window usage based on conversation history size:
Tokens used: ~45,000 / 200,000
Usage: 22.5%
Status: HEALTHY
Next threshold: 70% (warning) at ~140,000 tokens
Estimation methods:
Inject warnings at configurable thresholds:
[CONTEXT 70%] Warning: Context window at 70%. Consider summarizing completed work.
[CONTEXT 85%] Critical: Context window at 85%. Spawn new subagent for remaining work.
[CONTEXT 95%] Emergency: Context window at 95%. Wrap up immediately. Write state and exit.
Actions per threshold:
Monitor orchestrator-specific budget:
Target orchestrator usage: 15-30%
Current orchestrator usage: 18%
Remaining budget: 12% (~24,000 tokens)
Budget allocation:
- Phase context loading: 5% (PROJECT, ROADMAP, STATE)
- Agent spawn overhead: 3% per agent
- Result processing: 2% per agent result
- State updates: 1%
Recommend context allocation for subagent spawns:
Agent: gsd-executor
Available context: 200,000 tokens (fresh)
Recommended loading:
- Plan file: ~2,000 tokens
- Relevant source files: ~15,000 tokens
- Project context: ~3,000 tokens
- Remaining for execution: ~180,000 tokens
Trigger summarization when context is filling:
Summarization triggers:
- Tool output > 10,000 characters: summarize before continuing
- File read > 5,000 lines: extract relevant sections only
- Agent result > 20,000 characters: summarize key outcomes
Summarization strategies:
Identify context that is no longer relevant:
Stale context candidates:
- File contents read 10+ interactions ago
- Agent results from completed (not current) phases
- Tool outputs that were informational only
- Research documents already synthesized into plans
Plan context budget across execution waves:
Wave 1 (3 parallel agents):
Spawn cost: 3 * 3% = 9%
Result processing: 3 * 2% = 6%
Wave total: 15%
Wave 2 (2 parallel agents):
Spawn cost: 2 * 3% = 6%
Result processing: 2 * 2% = 4%
Wave total: 10%
Total orchestrator budget needed: 25%
Target: 30% -> Sufficient with 5% margin
Bash to estimate current session token count if availableRead to load plan files for the phaseexecute-phase.js - Monitor context during multi-wave execution, trigger summarization between wavesiterative-convergence.js - Track context across convergence iterations, spawn fresh agents when context fillsnew-project.js - Budget context for parallel research agents (4 spawns + synthesis){
"operation": "check|warn|plan|summarize",
"status": "healthy|warning|critical|emergency",
"usage": {
"estimatedTokens": 45000,
"maxTokens": 200000,
"percentage": 22.5,
"nextThreshold": 70
},
"recommendation": "Continue normally|Summarize completed work|Spawn new agent|Emergency wrap-up",
"waveBudget": {
"totalWaves": 2,
"estimatedOrchestratorUsage": 25,
"withinBudget": true
}
}
| Setting | Default | Description |
|---------|---------|-------------|
| contextWarningThreshold | 70 | Warning threshold percentage |
| contextCriticalThreshold | 85 | Critical threshold percentage |
| contextEmergencyThreshold | 95 | Emergency threshold percentage |
| orchestratorBudgetTarget | 30 | Target max orchestrator context % |
| agentSpawnCost | 3 | Estimated % per agent spawn overhead |
| agentResultCost | 2 | Estimated % per agent result processing |
| autoSummarize | true | Auto-trigger summarization at thresholds |
| Error | Cause | Resolution |
|-------|-------|------------|
| Token estimation inaccurate | Approximation drift | Use conservative estimates (overestimate usage) |
| Budget exceeded mid-wave | Underestimated agent costs | Defer remaining agents to next session with continue-here.md |
| Emergency threshold hit | Orchestrator doing too much work inline | Immediately write state, commit, create handoff document |
| Stale context false positive | Context still needed | Maintain a "pinned context" list that is never pruned |
development
Model documentation skill for generating model cards following Google's model card framework.
development
MLflow integration skill for experiment tracking, model registry, and artifact management. Enables LLMs to log experiments, compare runs, manage model lifecycle, and retrieve artifacts through the MLflow API.
data-ai
LIME-based local explanation skill for individual predictions across tabular, text, and image data.
devops
Kubeflow Pipelines skill for ML workflow orchestration, component management, and Kubernetes-native ML.