一键导入
context-engineering
主动管理 context 质量与信噪比,确保决策基于可信、新鲜、相关的信息
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
主动管理 context 质量与信噪比,确保决策基于可信、新鲜、相关的信息
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full-stack Hermes Agent health audit: observability config, compression tuning, prompt/skill consistency, skill invocation diagnosis, system overload detection, session pattern analysis, tool-use/delegation tuning, plus a full annotated config (model/queue/IO/security), per-channel Feishu output discipline, a prompt-engineering method, and a reverse-QA regression loop. Use when skills stop triggering, model ignores loaded skill steps, context grows unexpectedly, sessions hit compression too often, long tasks get interrupted, the task queue misbehaves, or after editing any prompt/skill/config file.
Securely serve private S3 content through CloudFront using Origin Access Control (OAC). Use when you need to make S3 files publicly accessible over a CDN without making the bucket itself public — e.g. hosting static sites, media, downloads, or build artifacts. Covers the modern OAC approach (AWS-recommended), migrating legacy OAI distributions to OAC, locking down the bucket Public Access Block, enforcing HTTPS, and verifying the result. Never make an S3 bucket public directly.
用 AWS Bedrock AgentCore 云端浏览器做联网深度调研、搜索、抓网页正文。Use when 要做带引用的多源调研 / 搜资料 / 抓动态页 / 反爬站 / SPA / 需 JS 渲染的页面。本机已部署同名 MCP server,优先用它而非裸 WebFetch。NOT for 抓本机已登录态的页面(用 chrome-cdp 9222),NOT for 纯本地文件搜索(用 grep/search_files)。
用本机已登录的 Perplexity / Gemini 做 AI 深度搜索,直接拿带引用的综合报告。当需要快速拿一个话题的多源综述、对比、"现在最好的 X 是什么"、带引用的事实核查,且想省去自己拼 web_search+抓取时使用。走 CDP 驱动本机 Chrome(9222,已登录 Pro)。NOT for 抓指定单个 URL 的正文(用 fetch_page),NOT for 需要自己控制每个来源的严谨调研(用 deep-search-protocol + agentcore-deepsearch)。
Desktop notifications for Claude Code via Notification/Stop hooks. Pops a native macOS notification showing which project, who's waiting, and what for — with click-to-focus back to your terminal. Use when setting up sound alerts, desktop notifications, or 'tell me when Claude needs me / is done'.
对抗自审 — 在非平凡决策前触发魔鬼代言人式自我审查,防止幻觉和未验证断言流入输出。
| name | context-engineering |
| description | 主动管理 context 质量与信噪比,确保决策基于可信、新鲜、相关的信息 |
主动管理上下文质量的实践框架。核心原则:不是所有 context 都平等——验证胜过记忆,新鲜胜过陈旧,精准胜过冗余。
从最可信到最不可信:
| Layer | 来源 | 信任度 | 处理方式 |
|---|---|---|---|
| L1 | Tool-verified facts | ★★★★★ | 直接使用,grep/API/file 输出即事实 |
| L2 | User-stated requirements | ★★★★☆ | 遵循执行,有歧义时确认 |
| L3 | Loaded skills/docs | ★★★☆☆ | 参考但验证,可能已过时 |
| L4 | Memory entries | ★★☆☆☆ | 作为线索,需 re-verify 关键细节 |
| L5 | Training data | ★☆☆☆☆ | 仅作推理辅助,绝不引用为来源 |
当 L1 与 L4 冲突 → 信任 L1(工具输出 > 记忆)
当 L2 与 L3 冲突 → 信任 L2(用户指令 > 文档)
当 L5 是唯一来源 → 明确标注"基于一般知识,未经验证"
加载 skill 前问自己:
□ 这个 skill 对当前步骤是否必需?
□ 能否用 1-2 句话替代整个 skill 的加载?
□ 是否已有足够信息完成任务?
如果任一为否 → 不加载
需要 re-verify 的信号:
□ 引用的文件内容是 10+ messages 前读取的
□ 基于 memory entry 做具体操作(路径、配置值)
□ 用户暗示情况可能已变("我改了..."、"现在...")
验证方法:read_file / search_files / API call
信息放置原则:
- 最高影响信息 → 紧贴决策点(最近的 message)
- 背景/历史 → 可以在早期 context 中(允许被压缩)
- 一次性参考 → 用完即弃,不写入 memory
隔离规则:
- 用户数据 vs 系统 prompt → 不混合处理
- 不同任务的 context → 切换任务时主动声明边界
- 敏感值 → 仅在使用时引用,不 echo back
触发条件:context 使用 > 50% window
执行步骤:
1. 识别当前活跃目标(用户最近在做什么)
2. 列出仍然相关的关键事实
3. 标记可以丢弃的历史细节
4. 主动向用户确认:"我理解当前目标是 X,需要保留 Y 信息,对吗?"
当以下情况出现时,激活 context engineering 思维:
| 触发信号 | 风险 | 动作 |
|---|---|---|
| Context 接近 compression threshold (0.75) | 信息丢失 | 主动 summarize,保护关键事实 |
| 单次加载 3+ skills | Flooding | 评估是否每个都必要 |
| 引用 20+ messages 前的信息做决策 | Stale context | 用工具 re-verify |
| 用户说"我们之前讨论过" | Stale/missing | 检查 memory 或请用户重述 |
| 输出包含未验证的具体值 | Trust confusion | 标注或验证 |
| 任务切换(新话题) | Leakage | 声明边界,释放旧 context |
收到用户请求时:
1. 我需要什么信息来完成这个?
├─ 已在 context 中 → 检查 freshness(多久前加载?)
│ ├─ < 5 messages → 直接使用
│ └─ > 20 messages → re-verify with tool
└─ 不在 context 中 → 需要加载
├─ 能用工具获取 (L1) → 优先工具
├─ 需要加载 skill (L3) → 评估必要性
└─ 只有 training data (L5) → 标注不确定性
2. 我的 context 健康吗?
├─ 使用率 < 50% → 正常
├─ 使用率 50-75% → 开始规划 prune
└─ 使用率 > 75% → 立即执行 refresh
└─ protect_last_n: 40 messages 不动
└─ 压缩早期内容,保留关键事实摘要
3. 我即将输出的内容基于什么?
├─ L1/L2 → 高置信度输出
├─ L3/L4 → 加验证caveat 或先 verify
└─ L5 → 明确标注 "based on general knowledge"
每次复杂任务开始前:
每次输出前: