context-engineering — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited context-engineering (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill to design, audit, or improve how an AI agent receives and manages context: system instructions, tool definitions, retrieved documents, message history, tool outputs, project instruction files, skills, commands, and sub-agent handoffs.
Apply these patterns across Codex, Claude, and other agent runtimes. Treat runtime-specific files, commands, tools, and context limits as variables to discover from the environment, not as assumptions.
| Component | Role | Budget Pressure |
|---|---|---|
| System prompt | Core identity, constraints, behavior | Low token count, high attention |
| Tool definitions | Available actions + descriptions | Front-loaded; poor descriptions force guessing |
| Retrieved documents | Domain knowledge loaded at runtime | High if unfiltered; use just-in-time loading |
| Message history | Conversation + scratchpad memory | Grows linearly; dominates in long sessions |
| Tool outputs | Results of agent actions | Can reach 80%+ of total tokens |
Organize with clear section boundaries. The exact format (XML tags, Markdown headers) matters less than structural clarity.
Right altitude: Specific enough to guide behavior, flexible enough to provide strong heuristics. Avoid both brittle hardcoded logic and vague high-level hand-waving.
Tool descriptions steer agent behavior. If a human cannot tell which tool to use in a given situation, an agent will not do better. Include usage context, examples, and defaults.
# Good
description: Analyze code architecture. Use for design reviews.
# Bad
description: This skill provides comprehensive analysis of code
architecture including but not limited to class hierarchies,
dependency graphs, coupling metrics, cohesion analysis...# Step 1: Load summary
docs/architecture_overview.md
# Step 2: Load detail only when needed
docs/api/endpoints.md # Only for API work
docs/database/schemas.md # Only for data layer workPre-load stable context for speed (project instruction files like CLAUDE.md, AGENTS.md). Enable autonomous exploration for dynamic or highly specific information. Decision boundary: stable content pre-loads; changing content loads just-in-time.
Know the effective limit for your model and task. Monitor usage during development. Implement compaction triggers at 70-80% utilization. Design assuming context will degrade.
Models show U-shaped attention: beginning and end get reliable attention; the middle suffers 10-40% lower recall. The first token acts as an "attention sink" that absorbs disproportionate budget.
Placement rules:
<CRITICAL_CONSTRAINTS> # Start (high attention)
- Never modify production files directly
- Always run tests before committing
</CRITICAL_CONSTRAINTS>
<DETAILED_GUIDELINES> # Middle (lower attention)
- Code style, templates, checklists
</DETAILED_GUIDELINES>
<KEY_REMINDERS> # End (high attention)
- Run tests: npm test
- Create PR with description
</KEY_REMINDERS>Context degrades predictably. Recognize these patterns to diagnose and fix failures.
Information in the center of context receives 10-40% lower recall than the same information at the beginning or end. This is a consequence of attention mechanics, not a bug.
Mitigation:
[REQUIRED], [CRITICAL], bold text.Hallucinations or errors enter context and compound through repeated reference. Enters via bad tool outputs, incorrect retrieved docs, or hallucinated intermediate results.
Symptoms: Degraded output on previously-successful tasks, persistent hallucinations despite correction, wrong tool calls.
Recovery:
Irrelevant information competes for attention budget. Even a single irrelevant document reduces performance on relevant tasks. Models cannot "skip" irrelevant context -- they attend to everything provided.
Mitigation:
The model cannot determine which context applies to the current situation. Responses address the wrong aspect, use inappropriate tools, or mix requirements from multiple sources.
Mitigation:
Multiple correct pieces of information contradict each other (version conflicts, multi-source retrieval, perspective conflicts).
Mitigation:
| Utilization | Symptoms |
|---|---|
| 50-70% | Occasional missed instructions, less focused responses |
| 70-85% | Inconsistent behavior, "forgotten" earlier instructions |
| 85%+ | Key constraints ignored, hallucinations increase, task failure |
| Strategy | When to Use | What It Does |
|---|---|---|
| Write | Preserve info without consuming context | Save to scratchpad, file system, external storage |
| Select | Context contains irrelevant material | Pull only relevant context via retrieval and filtering |
| Compress | Context too verbose but information needed | Summarize, abstract, mask observations |
| Isolate | Single context growing too large | Split across sub-agents or sessions |
Summarize context contents when approaching limits, then reinitialize with the summary. Priority for compression:
Trigger compaction at 70-80% utilization, before degradation becomes severe. Effective summaries preserve: key findings and metrics from tool outputs, decisions and commitments from conversations, key facts from documents.
Tool outputs can reach 80%+ of tokens. Replace verbose outputs with compact references once they have served their purpose.
Split work across sub-agents with isolated contexts. Each operates in a clean context focused on its subtask.
When to partition:
Example -- sub-agent isolation:
## Coordinator Agent (lean context)
- Task decomposition
- Delegates to specialized sub-agents
- Synthesizes results
## Code Review Sub-Agent (isolated context)
- Only code review guidelines loaded
- Returns structured findings
## Test Writer Sub-Agent (isolated context)
- Only testing patterns loaded
- Returns test filesResult aggregation: Validate all partitions completed, merge compatible results, summarize if combined results too large, resolve conflicts.
| Dominant Component | Apply |
|---|---|
| Tool outputs | Observation masking |
| Retrieved documents | Summarization or partitioning |
| Message history | Compaction with summarization |
| Multiple components | Combine strategies |
Commands: Keep individual commands focused on a single concern.
# Good: Focused
name: review-security
description: Review code for security vulnerabilities
# Bad: Overloaded
name: review-all
description: Review code for everythingSub-agent handoffs: Provide focused, minimal context.
# Good
"Review authentication module for security issues. Return findings in structured format."
# Bad
"I need you to look at the authentication module which is located in src/auth/ and contains
several files including login.ts, session.ts, tokens.ts... [500 more tokens]"Use these patterns when agent output feeds downstream agents, when validating long prompts, or during post-mortem analysis. Skip if the runtime does not support sub-agents -- use manual review instead.
(false_claims * 2 + unverifiable_claims) / total_claimsTest whether a prompt's critical instructions are reliably followed:
followed / applicable_runsRemediation for at-risk instructions:
[REQUIRED], [CRITICAL], bold text.For multi-agent chains where final output has errors:
For long-running sessions (20+ turns), check every ~10 turns:
Intervention: If degraded or critical, extract essential state to a file, start a new session with clean context, and load preserved state.
description clearly says what the skill does and when to use it.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.