Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

context-engineering情境工程

Agent Skill

context-engineering 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

1,992

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context-engineering(情境工程)
来源仓库:https://github.com/rohitg00/pro-workflow
仓库路径:skills/context-engineering
安装命令:
npx skills add https://github.com/rohitg00/pro-workflow --skill context-engineering
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/rohitg00/pro-workflow --skill context-engineering

简介

context-engineering 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中获取信息的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围和维护状态,注意可能触发的联网或文件操作。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

Context Engineering

Four operations control everything about how context flows through an AI coding session. Master them and you control the quality of every response.

The Four Operations

1. Write — Persist Info Outside Context

Move information out of the context window into durable storage so it survives compaction and session boundaries.

Where to write:

TargetWhenExample
CLAUDE.mdPermanent project rules"Always use pnpm, never npm"
NOTES.md / scratchpadWorking state for current taskArchitecture decisions, open questions
.claude/memory/Learnings and patterns[LEARN] rules from corrections
External filesData too large for contextTest plans, migration checklists

Pattern — Scratchpad workflow:

1. Start complex task → create NOTES.md with goals and constraints
2. After research → write findings to NOTES.md
3. After compaction → NOTES.md survives, context does not
4. Resume → read NOTES.md to recover full state

2. Select — Retrieve Relevant Info

Pull the right information into context at the right time. Precision matters more than volume.

Methods ranked by precision:

  1. @file references — exact file injection
  2. grep / Glob — targeted pattern search
  3. Subagent exploration — delegated deep search
  4. RAG / embeddings — semantic retrieval for large codebases

Key principle: Focused 300 tokens > unfocused 113K tokens.

A surgical grep result that returns the exact function signature beats dumping an entire module into context. Every irrelevant token dilutes attention.

Pattern — Progressive retrieval:

1. Start with file names (Glob)
2. Narrow to specific functions (Grep)
3. Read only the relevant lines (Read with offset+limit)
4. Never read entire large files when you need one function

3. Compress — Reduce Tokens, Preserve Signal

Shrink context without losing the information that matters.

Compaction strategies:

StrategyHowWhen
/compact with focus/compact focus: auth module changesTask boundaries
MicrocompactAsk Claude to summarize tool output inlineAfter large reads/searches
Head+tailRead first 20 + last 20 lines of large outputLog analysis, test results
Tool result clearingSubagent results auto-clear after reportingHeavy exploration
Semantic selectionSummarize findings, discard raw dataResearch phases

Compaction triggers:

  • After planning, before implementation
  • After completing a feature or milestone
  • When context exceeds 50% (set CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50)
  • Before switching task domains
  • After heavy search/read operations

PostCompact hook — Re-inject critical context:

{
  "type": "PostCompact",
  "command": "cat .claude/critical-context.md"
}

Use this to ensure project rules, current task state, or architecture constraints survive every compaction.

4. Isolate — Partition Across Execution Spaces

Don't load everything into one context. Split work across independent execution spaces.

MethodIsolation LevelUse When
SubagentsForked contextHeavy exploration, test runs, doc generation
Worktrees (claude -w)Full repo copyParallel features, competing approaches
/btw (built-in Claude Code)Temporary overlayQuick questions without entering conversation history
Agent teamsIndependent sessionsCross-layer changes, parallel reviews
Fresh session (/resume)Clean slateUnrelated work, degraded context

Pattern — Subagent delegation:

Main session: planning, coordination, commits
Subagent 1: explore auth module, report findings
Subagent 2: run test suite, report failures
Subagent 3: generate migration script

Main context stays clean. Subagents handle the volume.

Context Budget Planning

Example baseline (calibrate with /context): ~200K total window, ~20K overhead (CLAUDE.md, tool definitions, MCP schemas). Plan around ~180K usable — actual budgets vary by model and configuration.

AllocationBudgetWhat Goes Here
Static context20-30KCLAUDE.md, tool schemas, MCP definitions
Dynamic context150-180KCode, conversation, tool results

Put static context first. CLAUDE.md and tool definitions load before conversation. Keeping them stable maximizes prompt cache hits — saves cost and latency.

PhaseTarget UsageAction If Over
Planning< 20%Keep plans concise, write to scratchpad
Implementation< 50%Compact between files, delegate reads
Testing< 70%Delegate test runs to subagents
Review< 85%Start fresh session if degraded

When to /clear vs /compact vs Subagent

SituationAction
Task boundary, want to keep learnings/compact with focus
Context degraded, Claude repeating itself/compact, then /resume if still bad
Starting unrelated work/clear or new session
Heavy read/search operationDelegate to subagent
Quick side question/btw (doesn't pollute main context)
Exploring multiple approachesWorktrees or agent teams

Anti-Patterns

  • Loading entire files when you need one function
  • Keeping MCP tool results in context after extracting what you need
  • Running 15+ MCPs (each adds tool schema overhead to every request)
  • Vague prompts that force Claude to search broadly ("fix the code")
  • Never compacting until auto-compact triggers at 95%

Add to CLAUDE.md

## Context Engineering

Write to NOTES.md for working state that must survive compaction.
Select with precision — grep first, read specific lines, never dump whole files.
Compact at 50% or task boundaries. Set CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50.
Isolate heavy work to subagents. Main session stays for coordination and commits.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.56%
按下载量换算22

Claude

29.32%
按下载量换算18

Cursor

17.75%
按下载量换算11

Gemini CLI

9.13%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills