跳到正文
cccskills
免费在 GitHub 公开

context-engine

Context management engine for AI coding agents. Use when building agent memory systems, optimizing context windows, allocating token budgets, designing RAG pipelines for code, or managing persistent multi-session agent state.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(11)

  • SKILL.md8.6 KB
  • references/code-retrieval-patterns.md2.8 KB
  • references/context-window-strategies.md3.1 KB
  • references/long-context-strategies.md6.2 KB
  • references/memory-and-context-editing.md9.0 KB
  • references/memory-architecture-guide.md4.0 KB
  • references/workflows-and-quality.md6.7 KB
  • scripts/context_analyzer.py13.3 KB
  • scripts/context_budget_planner.py9.6 KB
  • scripts/context_pruner.py15.4 KB
  • scripts/memory_indexer.py16.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Context Engine - AI Agent Context Management

Context Engine provides production-grade patterns for managing what AI agents know, remember, and retrieve. It covers the full lifecycle: ingestion of project knowledge, optimal packing of context windows, persistent memory across sessions, and retrieval-augmented generation for large codebases. The difference between a useful agent and a hallucinating one is context management.

Core Capabilities

  • Context window architecture — token budget allocation plus greedy, tiered, and adaptive-compression packing strategies.
  • Memory architecture — three-layer model (working / session / knowledge base), promotion protocol, and staleness detection.
  • Code retrieval — file-level, chunk-level (RAG), and dependency-aware retrieval with code chunking and embedding guidance.
  • Knowledge graph construction — codebase graph schema (nodes + edges) and graph queries that resolve agent questions.
  • Window optimization patterns — sliding window with anchors, progressive summarization, selective tool-result caching.
  • Memory tool & context editing — file-backed persistent memory across sessions, plus context compaction (evict stale tool outputs, summarize-and-replace history) to keep a long loop from exhausting the window.
  • Long-context strategies — when to use a 1M-token window vs. RAG vs. a hybrid agent loop, budget allocation across a big window, and position/attention effects.
  • Multi-agent context sharing — shared context bus and a five-element handoff protocol.

When to Use

  • Bootstrapping agent context for a new codebase (index → graph → summary → tiers).
  • Optimizing context for a specific task (bug fix, feature, refactor, review).
  • Capturing, promoting, and pruning session memory across sessions.
  • Designing a RAG pipeline for code retrieval.
  • Coordinating context across multiple collaborating agents.

Clarify First

Before designing or analyzing, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Which task — bootstrap context for a codebase, optimize for a specific task, design persistent memory, or build a code RAG (selects the analyzer/pruner/indexer and the playbook)
  • Token budget — the context-window ceiling (sets --budget and which packing strategy applies)
  • Source content — the files/codebase or knowledge base to index (the input the scripts process)

Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.

Tools

ToolPurposeCommand
context_analyzer.pyAnalyze files/prompts for token usage, relevance, and optimization suggestionspython scripts/context_analyzer.py src/ --budget 128000 --json
context_pruner.pyPrune low-relevance content, redundancy, and verbose patterns from contextpython scripts/context_pruner.py src/main.py --aggressive --json
memory_indexer.pyIndex and search a memory/knowledge base with TF-IDF relevance scoringpython scripts/memory_indexer.py docs/ --query 'auth middleware' --top 5
context_budget_planner.pyAllocate a window across components, flag overflow, and suggest what to compact/evict firstpython scripts/context_budget_planner.py --window-size 200000 --system 4000 --history 60000 --tools 90000 --rag 40000 --reserve-output 8000

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • references/context-window-strategies.md — budget allocation, packing strategies, and window-optimization patterns. Read when planning budgets or optimizing a long conversation.
  • references/memory-architecture-guide.md — three-layer memory model, promotion protocol, staleness detection, shared context bus + handoff protocol. Read when designing persistent memory or coordinating agents.
  • references/code-retrieval-patterns.md — file/chunk/dependency-aware retrieval, chunking/embedding guidance, knowledge-graph schema and queries. Read when building RAG for code.
  • references/memory-and-context-editing.md — the memory-tool pattern (file-backed memory, what to store vs. recompute, retention, security) and context editing/compaction (eviction priority, summarize-and-replace, token-savings payoff) and how both weave into the agent loop. Read when persisting state across sessions or keeping a long loop from exhausting the window.
  • references/long-context-strategies.md — long-context vs. RAG vs. hybrid decision-making, budget allocation across a 1M-token window, position/attention effects, and when a bigger window hurts (cost, latency, distraction). Read when choosing a window-vs-retrieval strategy.
  • references/workflows-and-quality.md — the three workflows, anti-patterns, evaluation metrics, troubleshooting, and success criteria. Read before running a workflow and before shipping.

Scope & Limitations

This skill covers:

  • Context window token budget planning, allocation strategies, and packing algorithms for AI coding agents.
  • Multi-layer memory architecture design (working memory, session memory, knowledge base) with promotion and staleness protocols.
  • Code-specific retrieval strategies including file-level, chunk-level, and dependency-aware retrieval for RAG pipelines.
  • Knowledge graph construction from codebases and graph-based context queries for agent workflows.

This skill does NOT cover:

  • Vector store infrastructure setup, embedding model selection, or database deployment — see rag-architect for vector store design and embedding strategies.
  • Agent role definition, personality design, or multi-agent orchestration logic — see agent-designer for agent architecture and agent-workflow-designer for orchestration patterns.
  • Runtime observability, metrics dashboards, or alerting for agent systems — see observability-designer for monitoring and instrumentation.
  • Prompt engineering techniques, chain-of-thought design, or instruction tuning — see prompt-engineer-toolkit for prompt construction patterns.

Integration Points

SkillIntegrationData Flow
rag-architectContext Engine defines retrieval strategies; RAG Architect implements the vector store and embedding pipelineRetrieval queries flow from Context Engine to RAG Architect's indexed store; ranked results flow back as context chunks
agent-designerAgent Designer defines agent roles and capabilities; Context Engine manages per-agent context budgets and memory layersAgent specifications define context requirements; Context Engine returns tailored context windows per agent role
self-improving-agentSelf-Improving Agent identifies recurring patterns and corrections; Context Engine decides when to promote learnings to persistent memoryCandidate learnings flow from Self-Improving Agent; promotion decisions and memory updates flow back through Context Engine's staleness and promotion protocols
observability-designerObservability Designer instruments context utilization metrics (relevance, staleness, cache hits); Context Engine exposes metric endpointsRaw metric events flow from Context Engine; Observability Designer aggregates into dashboards and alerts
agent-workflow-designerAgent Workflow Designer defines multi-agent handoff sequences; Context Engine implements the shared context bus and handoff protocolWorkflow definitions specify which agents share context; Context Engine manages the context bus, serialization, and handoff payloads
codebase-onboardingCodebase Onboarding generates project summaries and architecture maps; Context Engine consumes these as Tier 0 bootstrap contextOnboarding artifacts (project summary, directory map, entry points) feed into Context Engine's initial knowledge graph and context tiers

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

This skill should be used when the user asks to "check accessibility", "audit WCAG compliance", "scan HTML for a11y issues", "check color contrast", or "find accessibility violations in web pages".

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

Design and run statistically rigorous A/B tests and experiments. Use when planning experiments, calculating sample sizes, designing test variants, selecting metrics, analyzing results, or when someone says "let's test that."

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

Design and analyze A/B tests: sample size, test duration, and statistical significance for conversion experiments. Use when setting up an A/B test, calculating sample size, designing an experiment, or analyzing results.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

Sales execution across pipeline, discovery, demos, negotiation, and closing. Use when qualifying opportunities, running MEDDIC discovery, building account plans, handling objections, structuring proposals, or forecasting pipeline.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

Design ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

aeo

免费

Answer Engine Optimization (AEO): optimize content to be cited by LLMs (ChatGPT, Claude, Perplexity, Gemini) in their answers. Use when designing content for LLM citation, auditing citability, or structuring Q&A schema.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9482026年10月7日 更新

查看 borghei 的全部技能

报告此技能的问题