원클릭으로
context-engineering
Context window optimization, token budget management, and information compression for AI-assisted workflows
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Context window optimization, token budget management, and information compression for AI-assisted workflows
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Unified design foundations — design system architecture, tokens, component specs, visual principles, creative vision, figma integration, plus brand design system loader (66 real brands via DESIGN.md). Absorbs design, design-system, design-systems, design-principles, design-router, creative-vision, figma, design-md.
Render, summarize, and present markdown documents and structured content in multiple output modes
Ultra UI skill - combines Google's DESIGN.md spec (machine-readable design tokens) with the ui-ux-pro-max knowledge base (91 styles, 161 palettes, 73 font pairings, 161 products, 104 UX guidelines, 25 chart types). Generates lint-clean DESIGN.md files, validates token references and WCAG contrast, exports Tailwind/DTCG tokens, and diffs design systems version-over-version.
Initialize UltraThink capabilities in the current project directory
Org-Bench Google-bipartite winning mechanism — the 4-section design-doc gate that every non-trivial change passes through. Use when the Director defines new work, when an Integrator reviews a lane (code/quality/devops), when the Director approves, or when a Worker is about to start coding and needs the spec. Tools live in the `design-doc` MCP server. Triggers on phrases like "design doc", "design review", "approve revision", "lane verdict", "what does this issue require", "is this approved yet".
Web scraping with anti-bot bypass (Cloudflare Turnstile etc.), stealth headless browsing, adaptive selectors, and concurrent crawls. Use when the user asks to scrape, crawl, or extract data from websites; the built-in WebFetch fails; the target has anti-bot protections; or the work needs JavaScript rendering. Prefers the registered MCP tools (mcp__scrapling__*) over raw Python so token cost stays low.
| name | context-engineering |
| description | Context window optimization, token budget management, and information compression for AI-assisted workflows |
| layer | utility |
| category | meta |
| triggers | ["context window","token limit","too much context","compress this","summarize for context","optimize prompt","context budget"] |
| inputs | [{"content":"The raw content to be managed within context constraints"},{"budget":"Target token count or percentage of context window"},{"priority":"Which information is most critical to retain"}] |
| outputs | [{"optimized_context":"Compressed/prioritized content fitting the budget"},{"context_map":"What was included, excluded, and why"},{"retrieval_plan":"How to recover excluded information when needed"}] |
| linksTo | ["sequential-thinking","docs-seeker","repomix"] |
| linkedFrom | ["orchestrator","planner"] |
| preferredNextSkills | ["docs-seeker","repomix"] |
| fallbackSkills | ["sequential-thinking"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | selective |
| sideEffects | [] |
Context engineering is the discipline of maximizing the signal-to-noise ratio within a finite context window. Every token spent on irrelevant information is a token unavailable for reasoning. This skill provides strategies for curating, compressing, and structuring information so that AI agents operate with maximum relevant context and minimum waste.
Think of the context window as a budget:
| Budget Zone | Allocation | Content Type |
|---|---|---|
| System (10-15%) | Fixed | System prompt, persona, rules |
| Task (20-30%) | Per-task | Current task instructions, requirements |
| Reference (30-40%) | Selective | Code, docs, examples relevant to task |
| Working Memory (15-25%) | Dynamic | Conversation history, intermediate results |
| Output Reserve (10-15%) | Reserved | Space for the model to generate response |
LOW DENSITY ←————————————————→ HIGH DENSITY
Raw source code → Annotated snippets → Interface signatures → Natural language summary
Full documentation → Relevant sections → Key API signatures → Capability checklist
Complete git log → Recent commits → Change summary → Diff of key files
Not all context is equal. Prioritize:
Load context in layers, from most to least critical:
LAYER 0 — ALWAYS PRESENT:
- Task description and acceptance criteria
- Key constraints and requirements
- Output format specification
LAYER 1 — LOAD FIRST:
- Files being directly modified
- Type definitions and interfaces used
- Test files for the target code
LAYER 2 — LOAD IF BUDGET ALLOWS:
- Adjacent files (importers/importees)
- Configuration files (tsconfig, package.json)
- Similar implementations for pattern reference
LAYER 3 — LOAD ON DEMAND:
- Documentation and READMEs
- Git history for changed files
- CI/CD configuration
LAYER 4 — EXTERNAL RETRIEVAL:
- Library documentation (use Context7)
- Stack Overflow / community solutions (use web search)
- Full repository structure (use repomix)
Transform verbose content into increasingly dense representations:
LEVEL 0 — RAW (100% tokens):
Full source file with all comments and implementations
LEVEL 1 — TRIMMED (60% tokens):
Remove imports, empty lines, obvious implementations
Keep signatures, complex logic, comments
LEVEL 2 — SKELETON (30% tokens):
Type signatures, function signatures, class structure
Remove all implementation bodies
LEVEL 3 — MANIFEST (10% tokens):
File purpose, exported API surface, dependencies list
LEVEL 4 — TAG (2% tokens):
"auth-service: JWT auth with role-based access control"
Place the most critical information at natural attention points:
STRUCTURE:
[TASK DEFINITION — highest attention]
[KEY CONSTRAINTS — high attention]
[REFERENCE CODE — medium attention, scannable]
[SUPPORTING CONTEXT — lower attention]
[OUTPUT INSTRUCTIONS — refreshed attention at end]
The model attends more strongly to the beginning and end of context. Place critical constraints in both locations.
Aggressively remove redundant information:
When full content is too expensive, use pointers:
INSTEAD OF: [500-line utility file pasted in full]
USE: "See utils/validation.ts — exports: validateEmail(), validatePhone(),
validateAddress(). All return Result<T, ValidationError>. Uses zod schemas."
INSTEAD OF: [Full API documentation]
USE: "POST /api/orders — accepts OrderCreateDTO, returns Order.
See OpenAPI spec at docs/api.yaml for full schema."
The model can request the full content if needed, but often the pointer suffices.
BEFORE (high token cost):
import { useState, useEffect, useCallback } from 'react';
import { fetchUser } from '../api/users';
import { User } from '../types/user';
export function useUser(userId: string) {
const [user, setUser] = useState<User | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<Error | null>(null);
const loadUser = useCallback(async () => {
try {
setLoading(true);
const data = await fetchUser(userId);
setUser(data);
} catch (err) {
setError(err instanceof Error ? err : new Error('Unknown error'));
} finally {
setLoading(false);
}
}, [userId]);
useEffect(() => {
loadUser();
}, [loadUser]);
return { user, loading, error, refetch: loadUser };
}
AFTER (compressed — retains all semantic information):
// hooks/useUser.ts — fetches user by ID, returns {user, loading, error, refetch}
// Pattern: standard async data hook with error handling
// Dependencies: fetchUser() from api/users, User type
export function useUser(userId: string): { user: User|null, loading: boolean, error: Error|null, refetch: () => Promise<void> }
BEFORE: [2000-word API documentation]
AFTER:
API: User Service (REST, JSON)
ENDPOINTS:
GET /users/:id → User (200, 404)
POST /users → User (201, 400, 409)
PATCH /users/:id → User (200, 400, 404)
DELETE /users/:id → void (204, 404)
AUTH: Bearer token, roles: admin, user
RATE LIMIT: 100/min per token
PAGINATION: cursor-based, max 100 per page
SPECIAL: Soft delete only. email must be unique. name max 100 chars.
BUDGET: ~4K tokens reference
INCLUDE:
- Error message and stack trace (verbatim)
- The failing function/component (full source)
- Relevant type definitions (signatures only)
- Test that reproduces the bug (if exists)
EXCLUDE:
- Unrelated files in the same module
- Full dependency source code
- Historical context (load on demand)
BUDGET: ~12K tokens reference
INCLUDE:
- Feature requirements / acceptance criteria
- Files to be modified (full source)
- Adjacent files (signatures/skeleton)
- Relevant test files (full source)
- Type definitions used across the feature
- Similar existing features (one example, compressed)
EXCLUDE:
- Framework documentation (use Context7)
- Unrelated modules
- CI/CD configuration
BUDGET: ~25K tokens reference
INCLUDE:
- Directory tree (depth 3)
- All configuration files (full)
- Key module entry points (signatures)
- Database schema (full)
- API route definitions (full)
- Dependency manifest (package.json)
- Architecture Decision Records (compressed)
EXCLUDE:
- Individual component implementations
- Test files (reference their existence only)
- Static assets, generated files