AGENT SKILL

principle-guard-the-context-window

Apply when context is filling up: large outputs, long files, repeated reads, fan-out planning. Route bulk to subagents; keep summaries in the main thread, not raw payloads.

License 许可
MIT
最近更新
2026-10-01
Stars
★ 0
Forks
0

01 前言 Front Matter

name
principle-guard-the-context-window
description
Apply when context is filling up: large outputs, long files, repeated reads, fan-out planning. Route bulk to subagents; keep summaries in the main thread, not raw payloads.

03 SKILL.md 正文

Guard the Context Window

The context window is finite and non-renewable within a session. Every token should be worth its cost.

Why: Context overflow degrades reasoning quality, creates compression artifacts, and halts progress.

Pattern:

  • Isolate large payloads. Route verbose outputs, screenshots, and large documents to subagents. The main context gets summaries, not raw data.
  • Don't read what you won't use. Read selectively based on relevance. If a file isn't needed for the current task, skip it.
  • Keep frequently used content inline. Templates and references used on every invocation belong in the skill file, not in separate files that cost a read each time.
  • Size phases and cap scope. Limit files per phase, set turn budgets, account for mechanism costs.

04 同仓库更多 Skills

stepankuzmin
stepankuzmin/skills

vendor-skill

Adapt an external skill into this marketplace, or review upstream changes to one already adapted. Use when asked to vendor, import, adapt, mirror, or update a skill from skills.sh, `npx skills add`, or any external GitHub skills repo, especially to work around Claude Code Web only allowing one marketplace per GitHub repo name.

★ 0
stepankuzmin
stepankuzmin/skills

why

Use when the user asks to investigate why code is built the way it is: 'why does X work this way', 'why we picked Y', design rationale, regressions, or postmortems. Not for explaining a single error or a quick question. Queries each available evidence source (git and PRs, issues, docs, team chat) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.

★ 0
stepankuzmin
stepankuzmin/skills

unslop

Cut AI tells from any writing. Must always apply.

★ 0
stepankuzmin
stepankuzmin/skills

uncomplect

Pressure-test a stateful system or replacement design through Rich Hickey's simplicity and complection, Greg Young's deletability, Ousterhout's deep modules, DDD boundaries, typed effects, and explicit lifecycle modeling. Use when the user asks "what would Rich Hickey do", "optimize for deletion", "make this simpler", "define this error out of existence", "review this state machine", "design it twice", or wants to replace a working prototype without preserving its accidental architecture.

★ 0
stepankuzmin
stepankuzmin/skills

typescript-best-practices

TypeScript best practices. Use when reading or editing any .ts or .tsx file.

★ 0
stepankuzmin
stepankuzmin/skills

technical-writing

Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.

★ 0