context-engineering-advisor by deanpeters/product-manager-skills
npx skills add https://github.com/deanpeters/product-manager-skills --skill context-engineering-advisor指导产品经理诊断他们是在进行上下文堆砌(无目的地堆砌信息量)还是上下文工程(为注意力塑造结构)。使用本指南来识别上下文边界,修复“上下文囤积症”,并实施诸如有界领域、按需检索以及研究→规划→重置→实施循环等战术实践。
关键区别: 上下文堆砌假设数量等于质量(“粘贴整个PRD”)。上下文工程则将AI注意力视为稀缺资源,并有意地进行分配。
这不是关于提示词写作——而是关于设计信息架构,让AI立足于现实,同时不被噪声淹没。
根本问题:
产品经理的角色转变: 从功能构建者 → 信息生态系统的架构师,使AI立足于现实
| 维度 | 上下文堆砌 | 上下文工程 |
|---|---|---|
| 思维方式 | 数量 = 质量 | 结构 = 质量 |
| 方法 | “以防万一,把所有东西都加上” | “我正在做什么决策?” |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 持久性 | 持久化所有上下文 | 有意图地检索 |
| 智能体链 | 在智能体之间共享所有内容 | 每个智能体有界上下文 |
| 失败应对 | 重试直到成功 | 修复结构 |
| 经济模型 | 上下文作为存储 | 上下文作为注意力(稀缺资源) |
关键比喻: 上下文堆砌就像把整个文件柜带到会议上。上下文工程则是只带来与今天决策相关的3份文件。
上下文堆砌的五个标志:
为何失败:
隐藏成本:
五个基本原则:
定量框架:
效率 = (准确性 × 连贯性) / (令牌数 × 延迟)
关键发现: 使用RAG并仅占用可用令牌的25%,可以保持95%的准确性,同时显著降低延迟和成本。
通过这些问题来识别上下文堆砌:
短期(对话)记忆:
长期(持久)记忆:
LLM驱动的ETL: 模型通过识别信号、与现有数据整合、自动更新数据库来生成自己的记忆。
上下文腐化解决方案:
为何有效: 上下文腐化被消除;智能体以压缩的、高信号上下文干净地开始。
✅ 在以下情况使用:
❌ 不要在以下情况使用:
使用 workshop-facilitation 作为此技能的默认交互协议。
它定义了:
其他(请说明))此文件定义了领域特定的评估内容。如果存在冲突,请遵循此文件的领域逻辑。
此交互式技能使用自适应提问来诊断上下文堆砌、识别边界并提供战术实施指导。
智能体提问:
在我们诊断你的上下文实践之前,让我们先收集信息:
当前AI使用情况:
症状:
系统架构(如适用):
你可以简要描述或粘贴示例。
智能体提问:
让我们评估你是否正在经历上下文堆砌。你认识到以下哪些症状?
选择所有适用的选项:
用户响应: [选择症状]
智能体分析:
根据你的选择:
智能体继续进行诊断性问题。
智能体提问:
让我们从最关键的问题开始:对于你包含的每个上下文片段,它支持什么具体决策?
上下文分析示例:
假设你要求AI“帮助进行探索规划”。你提供了:
问题: 你现在正在做什么决策?
提供3个场景:
“我正在决定首先访谈哪个用户群体”
“我正在决定在访谈中询问哪些探索性问题”
“我不确定我在做什么决策——我只是想让AI‘理解我的产品’”
智能体推荐:
最佳实践: 在添加上下文之前,完成这个句子:
“我需要这个上下文,因为我正在决定[具体决策],如果没有[具体信息],我就无法做出那个决定。”
如果你无法完成这个句子,就不需要这个上下文。
用户响应: [描述他们的决策 + 上下文]
智能体验证: 上下文是否直接支持所述的决策?如果不是,建议修剪。
智能体提问:
第二个问题:这是你始终需要的信息,还是可以即时检索的东西?
区别:
始终需要(持久化):
临时性(按需检索):
关键洞察: 即时检索胜过始终可用。不要持久化可以检索的内容。
提供3个选项:
“我的大部分上下文是始终需要的(核心约束、用户偏好)”
“我的大部分上下文是临时性的(项目细节、历史数据)”
“我不确定哪些是哪些——我持久化所有内容以求安全”
智能体推荐:
经验法则:
用户响应: [对他们的上下文进行分类]
智能体提供: 关于持久化与检索的具体建议。
智能体提问:
第三个问题:谁负责定义什么属于你的AI上下文,什么不属于?
所有权问题:
如果没有人拥有上下文边界,它将无限增长。每个产品经理都会添加“再多一个东西”,六个月后,你每次查询都会堆砌10万个令牌。
提供3个选项:
“我拥有边界(单独的产品经理或小团队)”
“我的团队共享所有权(协作定义边界)”
“没有人拥有它——它是临时的/隐式的”
智能体推荐:
最佳实践:创建上下文清单
# 上下文清单:[产品/功能名称]
## 始终持久化(核心上下文)
- 产品约束(技术、法规)
- 用户偏好(角色、权限、偏好)
- 操作术语表(20个关键术语)
## 按需检索(临时上下文)
- 历史PRD(通过语义搜索检索)
- 用户访谈记录(检索相关引用)
- 竞品分析(在明确需要时检索)
## 排除(超出范围)
- 超过30天的会议记录(不再相关)
- 完整代码库(改用代码搜索)
- 营销材料(与决策无关)
## 边界负责人:[姓名]
## 上次审查:[日期]
## 下次审查:[日期 + 90天]
用户响应: [描述当前所有权模型]
智能体提供: 关于正式化所有权的建议 + 上下文清单模板。
智能体提问:
第四个问题:对于每个上下文片段,如果排除它,会发生什么具体的失败模式?
这是证伪测试。如果你无法识别具体的失败,就不需要这个上下文。
提供3个场景:
“如果我排除产品约束,AI将推荐不可行的解决方案”
“如果我排除历史PRD,AI将不理解我们的产品演进”
“如果我排除这个,我不确定会发生什么——我只是为了全面而包含它”
智能体推荐:
证伪协议:
对于每个上下文元素,完成这个陈述:
“如果我排除[上下文元素],那么[具体失败]将在[具体场景]中发生。”
示例:
用户响应: [对他们的上下文应用证伪测试]
智能体提供: 要删除的上下文元素列表(未识别具体失败)。
智能体提问:
第五个问题:添加更多上下文是在解决问题,还是在掩盖更深层次的结构性问题?
根本原因问题:
上下文堆砌常常掩盖糟糕的信息架构。团队不是修复混乱、模糊的文档,而是添加更多文档,希望AI能“弄明白”。
提供3个选项:
“我添加上下文是因为我们的文档结构混乱/模糊”
“我添加上下文是因为我们没有共享的操作术语表”
“我添加上下文是因为我们的约束没有文档化”
智能体推荐:
结构健康测试:
如果你添加上下文是为了弥补:
用户响应: [识别结构性问题]
智能体提供: 在添加上下文之前需要修复的结构性问题优先级列表。
智能体提问:
根据你的上下文需求,让我们设计一个双层记忆架构。
你的上下文概况(来自之前的步骤):
推荐的架构:
短期(对话)记忆:
长期(持久)记忆:
检索策略(临时上下文):
智能体提供:
你希望我:
用户响应: [选择]
智能体提问:
现在让我们实施研究 → 规划 → 重置 → 实施循环,以防止上下文腐化。
问题: 随着智能体进行研究,上下文窗口变得混乱——充满了死胡同、错误和噪声。这稀释了注意力并导致目标漂移。
解决方案: 将研究压缩成高密度计划,然后在实施前清除上下文窗口。
四阶段循环:
阶段 1:研究(允许混乱上下文)
阶段 2:规划(综合)
阶段 3:重置(清除上下文窗口)
阶段 4:实施(仅使用计划的干净会话)
智能体提供3个选项:
“我想要 PLAN.md 格式的模板”
“我想看这个循环的实际示例”
“我准备在我的工作流中实施这个”
用户响应: [选择]
智能体提供: 根据选择提供定制指导。
智能体综合:
根据你的上下文工程评估,这是你的行动计划:
立即修复(本周):
基础构建(未来2周):
长期优化(下个月):
成功指标:
智能体提供:
你希望我:
上下文:
评估:
诊断: 活跃的上下文囤积症
干预:
结果: 令牌使用量下降70%,输出质量显著提高,回应清晰且可操作。
上下文:
评估:
诊断: 无边界智能体编排
干预:
结果: 令牌使用量下降60%,智能体链可靠性提高,成本降低50%。
上下文:
评估:
诊断: 无意图的检索(RAG作为上下文堆砌)
干预:
结果: 准确性提高35%(基于Anthropic基准),延迟降低60%,令牌使用量下降80%。
失败模式: 相信“100万令牌上下文窗口”意味着你应该全部使用它们。
后果: 推理噪声降低性能;超过约32k令牌后,准确性降至20%以下。
修复: 上下文窗口不是免费的。将令牌视为稀缺资源;优化密度,而非数量。
失败模式: “运行3次就能工作” → 将重试常态化,而非修复结构。
后果: 浪费时间和金钱;掩盖更深层次的上下文腐化问题。
修复: 如果重试很常见,你的上下文结构就坏了。应用问题5(修复结构,不要增加数量)。
失败模式: 临时、隐式的上下文决策 → 无限制增长。
后果: 六个月后,每次交互都会堆砌10万个令牌。
修复: 分配明确的所有权;创建上下文清单;安排季度审计。
失败模式: 持久化应该按需检索的历史数据。
后果: 上下文窗口被无关信息挤满;注意力被稀释。
修复: 应用问题2测试:仅持久化在80%以上交互中需要的内容;检索其余部分。
失败模式: 在研究→规划→实施循环中从不清除上下文窗口。
后果: 上下文腐化累积;目标漂移;死胡同污染实施。
修复: 规划后强制重置阶段;仅使用高密度计划作为上下文开始实施。
每周安装次数
242
仓库
GitHub 星标
1.5K
首次出现
2026年2月12日
安全审计
安装于
codex216
opencode213
gemini-cli210
github-copilot209
cursor208
kimi-cli206
Guide product managers through diagnosing whether they're doing context stuffing (jamming volume without intent) or context engineering (shaping structure for attention). Use this to identify context boundaries, fix "Context Hoarding Disorder," and implement tactical practices like bounded domains, episodic retrieval, and the Research→Plan→Reset→Implement cycle.
Key Distinction: Context stuffing assumes volume = quality ("paste the entire PRD"). Context engineering treats AI attention as a scarce resource and allocates it deliberately.
This is not about prompt writing—it's about designing the information architecture that grounds AI in reality without overwhelming it with noise.
The Fundamental Problem:
PM's Role Shift: From feature builder → architect of informational ecosystems that ground AI in reality
| Dimension | Context Stuffing | Context Engineering |
|---|---|---|
| Mindset | Volume = quality | Structure = quality |
| Approach | "Add everything just in case" | "What decision am I making?" |
| Persistence | Persist all context | Retrieve with intent |
| Agent Chains | Share everything between agents | Bounded context per agent |
| Failure Response | Retry until it works | Fix the structure |
| Economic Model | Context as storage | Context as attention (scarce resource) |
Critical Metaphor: Context stuffing is like bringing your entire file cabinet to a meeting. Context engineering is bringing only the 3 documents relevant to today's decision.
Five Markers of Context Stuffing:
Why It Fails:
The Hidden Costs:
Five Foundational Principles:
Quantitative Framework:
Efficiency = (Accuracy × Coherence) / (Tokens × Latency)
Key Finding: Using RAG with 25% of available tokens preserves 95% accuracy while significantly reducing latency and cost.
Ask these to identify context stuffing:
Short-Term (Conversational) Memory:
Long-Term (Persistent) Memory:
LLM-Powered ETL: Models generate their own memories by identifying signals, consolidating with existing data, updating database automatically.
The Context Rot Solution:
Why This Works: Context rot is eliminated; agent starts clean with compressed, high-signal context.
✅ Use this when:
❌ Don't use this when:
Use workshop-facilitation as the default interaction protocol for this skill.
It defines:
Other (specify) when useful)This file defines the domain-specific assessment content. If there is a conflict, follow this file's domain logic.
This interactive skill uses adaptive questioning to diagnose context stuffing, identify boundaries, and provide tactical implementation guidance.
Agent asks:
Before we diagnose your context practices, let's gather information:
Current AI Usage:
Symptoms:
System Architecture (if applicable):
You can describe briefly or paste examples.
Agent asks:
Let's assess whether you're experiencing context stuffing. Which of these symptoms do you recognize?
Select all that apply:
User response: [Select symptoms]
Agent analyzes:
Based on your selections:
Agent proceeds to diagnostic questions.
Agent asks:
Let's start with the most critical question: For each piece of context you're including, what specific decision does it support?
Example Context Analysis:
Imagine you're asking AI to "help with discovery planning." You're providing:
Question: What decision are you making right now?
Offer 3 scenarios:
"I'm deciding which user segment to interview first"
"I'm deciding which discovery questions to ask in interviews"
"I'm not sure what decision I'm making—I just want AI to 'understand my product'"
Agent recommends:
Best Practice: Before adding context, complete this sentence:
"I need this context because I'm deciding [specific decision], and without [specific information], I can't make that decision."
If you can't complete that sentence, you don't need the context.
User response: [Describe their decision + context]
Agent validates: Does the context directly support the stated decision? If not, recommend trimming.
Agent asks:
Second question: Is this information you always need, or something you can retrieve just-in-time?
The Distinction:
Always-Needed (Persist):
Episodic (Retrieve on-demand):
Key Insight: Just-in-time retrieval beats always-available. Don't persist what you can retrieve.
Offer 3 options:
"Most of my context is always-needed (core constraints, user prefs)"
"Most of my context is episodic (project details, historical data)"
"I'm not sure which is which—I persist everything to be safe"
Agent recommends:
Rule of Thumb:
User response: [Categorize their context]
Agent provides: Specific recommendations on what to persist vs. retrieve.
Agent asks:
Third question: Who is responsible for defining what belongs in vs. out of your AI's context?
The Ownership Problem:
If no one owns the context boundary, it will grow indefinitely. Every PM will add "just one more thing," and six months later, you're stuffing 100k tokens per query.
Offer 3 options:
"I own the boundary (solo PM or small team)"
"My team shares ownership (collaborative boundary definition)"
"No one owns it—it's ad-hoc / implicit"
Agent recommends:
Best Practice: Create a Context Manifest
# Context Manifest: [Product/Feature Name]
## Always Persisted (Core Context)
- Product constraints (technical, regulatory)
- User preferences (role, permissions, preferences)
- Operational glossary (20 key terms)
## Retrieved On-Demand (Episodic Context)
- Historical PRDs (retrieve via semantic search)
- User interview transcripts (retrieve relevant quotes)
- Competitive analysis (retrieve when explicitly needed)
## Excluded (Out of Scope)
- Meeting notes older than 30 days (no longer relevant)
- Full codebase (use code search instead)
- Marketing materials (not decision-relevant)
## Boundary Owner: [Name]
## Last Reviewed: [Date]
## Next Review: [Date + 90 days]
User response: [Describe current ownership model]
Agent provides: Recommendation on formalizing ownership + template for Context Manifest.
Agent asks:
Fourth question: For each piece of context, what specific failure mode occurs if you exclude it?
This is the falsification test. If you can't identify a concrete failure, you don't need the context.
Offer 3 scenarios:
"If I exclude product constraints, AI will recommend infeasible solutions"
"If I exclude historical PRDs, AI won't understand our product evolution"
"If I exclude this, I'm not sure anything would break—I just include it to be thorough"
Agent recommends:
The Falsification Protocol:
For each context element, complete this statement:
"If I exclude [context element], then [specific failure] will occur in [specific scenario]."
Examples:
User response: [Apply falsification test to their context]
Agent provides: List of context elements to delete (no concrete failure identified).
Agent asks:
Fifth question: Is adding more context solving a problem, or masking a deeper structural issue?
The Root Cause Question:
Context stuffing often hides bad information architecture. Instead of fixing messy, ambiguous documents, teams add more documents hoping AI will "figure it out."
Offer 3 options:
"I'm adding context because our docs are poorly structured/ambiguous"
"I'm adding context because we don't have a shared operational glossary"
"I'm adding context because our constraints aren't documented"
Agent recommends:
The Structural Health Test:
If you're adding context to compensate for:
User response: [Identify structural issues]
Agent provides: Prioritized list of structural fixes before adding more context.
Agent asks:
Based on your context needs, let's design a two-layer memory architecture.
Your Context Profile (from previous steps):
Recommended Architecture:
Short-Term (Conversational) Memory:
Long-Term (Persistent) Memory:
Retrieval Strategy (Episodic Context):
Agent offers:
Would you like me to:
User response: [Selection]
Agent asks:
Now let's implement the Research → Plan → Reset → Implement cycle to prevent context rot.
The Problem: As agents research, context windows grow chaotic—filled with dead ends, errors, and noise. This dilutes attention and causes goal drift.
The Solution: Compress research into a high-density plan, then clear the context window before implementing.
The Four-Phase Cycle:
Phase 1: Research (Chaotic Context Allowed)
Phase 2: Plan (Synthesis)
Phase 3: Reset (Clear Context Window)
Phase 4: Implement (Fresh Session with Plan Only)
Agent offers 3 options:
"I want a template for the PLAN.md format"
"I want to see an example of this cycle in action"
"I'm ready to implement this in my workflow"
User response: [Selection]
Agent provides: Tailored guidance based on selection.
Agent synthesizes:
Based on your context engineering assessment, here's your action plan:
Immediate Fixes (This Week):
Foundation Building (Next 2 Weeks):
Long-Term Optimization (Next Month):
Success Metrics:
Agent offers:
Would you like me to:
Context:
Assessment:
Diagnosis: Active Context Hoarding Disorder
Intervention:
Outcome: Token usage down 70%, output quality up significantly, responses crisp and actionable.
Context:
Assessment:
Diagnosis: Agent orchestration without boundaries
Intervention:
Outcome: Token usage down 60%, agent chain reliability up, costs reduced by 50%.
Context:
Assessment:
Diagnosis: Retrieval without intent (RAG as context stuffing)
Intervention:
Outcome: Accuracy up 35% (from Anthropic benchmark), latency down 60%, token usage down 80%.
Failure Mode: Believing "1 million token context windows" means you should use all of them.
Consequence: Reasoning Noise degrades performance; accuracy drops below 20% past ~32k tokens.
Fix: Context windows are not free. Treat tokens as scarce; optimize for density, not volume.
Failure Mode: "It works if I run it 3 times" → normalizing retries instead of fixing structure.
Consequence: Wastes time and money; masks deeper context rot issues.
Fix: If retries are common, your context structure is broken. Apply Q5 (fix structure, don't add volume).
Failure Mode: Ad-hoc, implicit context decisions → unbounded growth.
Consequence: Six months later, every query stuffs 100k tokens per interaction.
Fix: Assign explicit ownership; create Context Manifest; schedule quarterly audits.
Failure Mode: Persisting historical data that should be retrieved on-demand.
Consequence: Context window crowded with irrelevant information; attention diluted.
Fix: Apply Q2 test: persist only what's needed in 80%+ of interactions; retrieve the rest.
Failure Mode: Never clearing context window during Research→Plan→Implement cycle.
Consequence: Context rot accumulates; goal drift; dead ends poison implementation.
Fix: Mandatory Reset phase after Plan; start implementation with only high-density plan as context.
Weekly Installs
242
Repository
GitHub Stars
1.5K
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
codex216
opencode213
gemini-cli210
github-copilot209
cursor208
kimi-cli206
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
41,800 周安装