# @upstash/context7 - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 @upstash/context7 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0012` supported 0.86
- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`packages/pi/skills/context7-docs/SKILL.md`, `plugins/claude/context7/skills/context7-mcp/SKILL.md`, `plugins/cursor/context7/skills/context7-mcp/SKILL.md`, `skills/context7-cli/SKILL.md` 等 Claim：`clm_0013` supported 0.86

## 它能做什么

- **MCP Server**（可做安装前预览）：Model Context Protocol server that exposes documentation lookup tools (resolve-library-id, query-docs) to AI coding agents via the MCP protocol. 证据：`packages/mcp/package.json`, `packages/mcp/README.md`, `packages/mcp/package.json` Claim：`clm_0001` supported 0.86
- **CLI Tool (ctx7)**（可做安装前预览）：Command-line interface for fetching library documentation, managing AI coding skills, and configuring MCP for coding agents. 证据：`packages/cli/package.json`, `packages/cli/README.md`, `packages/cli/README.md` Claim：`clm_0002` supported 0.86, `clm_0008` supported 0.86
- **TypeScript SDK**（可做安装前预览）：HTTP/REST-based client library for TypeScript developers to programmatically access Context7 documentation API. 证据：`packages/sdk/package.json`, `packages/sdk/README.md`, `packages/sdk/README.md` Claim：`clm_0003` supported 0.86
- **Vercel AI SDK Integration**（可做安装前预览）：Tools and agents that integrate Context7 documentation lookup with the Vercel AI SDK for generating accurate, current code examples. 证据：`packages/tools-ai-sdk/package.json`, `packages/tools-ai-sdk/README.md`, `packages/tools-ai-sdk/README.md` Claim：`clm_0004` supported 0.86
- **pi Coding Agent Extension**（可做安装前预览）：Official Context7 extension for the pi coding agent that adds documentation lookup tools and a slash command. 证据：`packages/pi/package.json`, `packages/pi/README.md`, `packages/pi/README.md` Claim：`clm_0005` supported 0.86
- **Claude Code Plugin**（可做安装前预览）：Context7 plugin for Claude Code that provides MCP server connection, skills, agents, and commands for documentation lookup. 证据：`plugins/claude/context7/README.md`, `plugins/claude/context7/README.md`, `.claude-plugin/marketplace.json` Claim：`clm_0006` supported 0.86, `clm_0009` supported 0.86
- **Cursor IDE Plugin**（可做安装前预览）：Context7 plugin for Cursor that provides MCP server connection, rules, skills, and agents for automatic documentation lookup. 证据：`plugins/cursor/context7/README.md`, `plugins/cursor/context7/.cursor/plugin.json` Claim：`clm_0007` supported 0.86, `clm_0009` supported 0.86
- **Skills Management System**（可做安装前预览）：Framework for managing reusable prompt instructions (skills) that enhance AI coding assistants with specialized capabilities. 证据：`packages/cli/README.md`, `packages/cli/README.md`, `skills/context7-cli/SKILL.md`, `skills/find-docs/SKILL.md` Claim：`clm_0002` supported 0.86, `clm_0008` supported 0.86, `clm_0009` supported 0.86
- **Version-Specific Documentation**（可做安装前预览）：Ability to retrieve documentation for specific library versions by including version in library ID format. 证据：`plugins/claude/context7/README.md`, `plugins/cursor/context7/README.md`, `skills/find-docs/SKILL.md` Claim：`clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86, `clm_0009` supported 0.86
- **Enterprise Azure Entra SSO**（需要安装后验证）：Enterprise authentication via Microsoft Entra ID (Azure AD) SSO with role-based access control. 证据：`docs/images/enterprise/entra-sso/README.md`, `docs/images/enterprise/entra-sso/README.md`, `docs/images/enterprise/entra-sso/README.md` Claim：`clm_0010` supported 0.86
- **Multi-Language Documentation**（可做安装前预览）：Project documentation available in 16+ languages including Chinese, Japanese, Korean, Spanish, French, German, and others. 证据：`README.md`, `i18n/README.ko.md` Claim：`clm_0011` supported 0.86

## 怎么开始

- `npx ctx7 setup` 证据：`README.md` Claim：`clm_0014` supported 0.86
- `npx ctx7` 证据：`packages/cli/README.md` Claim：`clm_0014` supported 0.86, `clm_0015` supported 0.86
- `npm install -g ctx7` 证据：`packages/cli/README.md` Claim：`clm_0016` supported 0.86
- `npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>` 证据：`packages/mcp/README.md` Claim：`clm_0017` supported 0.86
- `claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY` 证据：`packages/mcp/README.md` Claim：`clm_0018` supported 0.86
- `claude mcp add --scope user --header "CONTEXT7_API_KEY: YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp` 证据：`packages/mcp/README.md` Claim：`clm_0019` supported 0.86
- `npx -y @upstash/context7-mcp@latest` 证据：`packages/mcp/README.md` Claim：`clm_0020` supported 0.86
- `npx -y @modelcontextprotocol/inspector npx @upstash/context7-mcp` 证据：`packages/mcp/README.md` Claim：`clm_0021` supported 0.86
- `npm install @upstash/context7-sdk` 证据：`packages/sdk/README.md` Claim：`clm_0022` supported 0.86
- `npm install @upstash/context7-tools-ai-sdk @upstash/context7-sdk ai zod` 证据：`packages/tools-ai-sdk/README.md` Claim：`clm_0023` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：研究结论、引用和实验结果不能在安装前相信。
- **继续会触碰**：研究判断、命令执行、宿主 AI 配置

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0012` supported 0.86
- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`packages/pi/skills/context7-docs/SKILL.md`, `plugins/claude/context7/skills/context7-mcp/SKILL.md`, `plugins/cursor/context7/skills/context7-mcp/SKILL.md`, `skills/context7-cli/SKILL.md` 等 Claim：`clm_0013` supported 0.86
- **能力存在：MCP Server**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`packages/mcp/package.json`, `packages/mcp/README.md`, `packages/mcp/package.json` Claim：`clm_0001` supported 0.86
- **能力存在：CLI Tool (ctx7)**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`packages/cli/package.json`, `packages/cli/README.md`, `packages/cli/README.md` Claim：`clm_0002` supported 0.86, `clm_0008` supported 0.86
- **能力存在：TypeScript SDK**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`packages/sdk/package.json`, `packages/sdk/README.md`, `packages/sdk/README.md` Claim：`clm_0003` supported 0.86
- **能力存在：Vercel AI SDK Integration**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`packages/tools-ai-sdk/package.json`, `packages/tools-ai-sdk/README.md`, `packages/tools-ai-sdk/README.md` Claim：`clm_0004` supported 0.86

### 现在还不能相信

- **研究结论、引用和实验结果不能在安装前相信。**（unverified）：研究 Skill 可以组织问题和路径，但不能替代真实资料检索、论文核验和实验复现。
- **是否适合你的具体研究领域不能直接相信。**（unverified）：Skill 覆盖很多研究主题，不代表对你的领域、资料要求和可信度标准足够。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.claude-plugin/marketplace.json`, `packages/pi/skills/context7-docs/SKILL.md`, `plugins/claude/context7/.claude-plugin/plugin.json`, `plugins/claude/context7/README.md` 等
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。 证据：`.claude-plugin/marketplace.json`, `plugins/claude/context7/.claude-plugin/plugin.json`, `plugins/cursor/context7/.cursor/plugin.json`
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **研究判断**：问题拆解、资料路径、实验路径、结论结构和可信度判断。 原因：研究型 Skill 可能让输出看起来更专业，但不能替代真实证据核验。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`, `packages/cli/README.md`, `packages/mcp/README.md`, `packages/sdk/README.md` 等
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.claude-plugin/marketplace.json`, `packages/pi/skills/context7-docs/SKILL.md`, `plugins/claude/context7/.claude-plugin/plugin.json`, `plugins/claude/context7/README.md` 等
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`docs/images/enterprise/entra-sso/README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`README.md`, `gemini-extension.json`, `i18n/README.de.md`, `i18n/README.es.md` 等
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：先验证它能否正确界定研究问题和证据边界，不要先相信研究输出。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **保留资料和结论核验清单**：如果后续发现引用或实验路径不可靠，可以回到证据边界阶段重新校验。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0024` inferred 0.45
- **宿主 AI 插件或 Skill 规则冲突**：新规则可能改变用户现有宿主 AI 的工作方式。 处理方式：安装前先检查插件 manifest 和 Skill 文件，必要时隔离测试。 证据：`.claude-plugin/marketplace.json`, `plugins/claude/context7/.claude-plugin/plugin.json`, `plugins/cursor/context7/.cursor/plugin.json` Claim：`clm_0025` supported 0.86
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md`, `packages/cli/README.md`, `packages/mcp/README.md`, `packages/sdk/README.md` 等 Claim：`clm_0026` supported 0.86
- **风险**： 处理方式：
- **风险**： 处理方式：
- **风险**： 处理方式：
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **MCP Server**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/mcp/package.json`, `packages/mcp/README.md`, `packages/mcp/package.json` Claim：`clm_0001` supported 0.86, `clm_0006` supported 0.86, `clm_0007` supported 0.86
- **CLI Tool (ctx7)**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/cli/package.json`, `packages/cli/README.md`, `packages/cli/README.md` Claim：`clm_0002` supported 0.86, `clm_0008` supported 0.86
- **TypeScript SDK**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/sdk/package.json`, `packages/sdk/README.md`, `packages/sdk/README.md` Claim：`clm_0003` supported 0.86
- **Vercel AI SDK Integration**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/tools-ai-sdk/package.json`, `packages/tools-ai-sdk/README.md`, `packages/tools-ai-sdk/README.md` Claim：`clm_0004` supported 0.86
- **pi Coding Agent Extension**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/pi/package.json`, `packages/pi/README.md`, `packages/pi/README.md` Claim：`clm_0005` supported 0.86
- **Claude Code Plugin**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`plugins/claude/context7/README.md`, `plugins/claude/context7/README.md`, `.claude-plugin/marketplace.json` Claim：`clm_0006` supported 0.86, `clm_0009` supported 0.86
- **Cursor IDE Plugin**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`plugins/cursor/context7/README.md`, `plugins/cursor/context7/.cursor/plugin.json` Claim：`clm_0007` supported 0.86, `clm_0009` supported 0.86
- **Skills Management System**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`packages/cli/README.md`, `packages/cli/README.md`, `skills/context7-cli/SKILL.md`, `skills/find-docs/SKILL.md` Claim：`clm_0002` supported 0.86, `clm_0008` supported 0.86, `clm_0009` supported 0.86
- **Version-Specific Documentation**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`plugins/claude/context7/README.md`, `plugins/cursor/context7/README.md`, `skills/find-docs/SKILL.md` Claim：`clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86, `clm_0009` supported 0.86
- **Enterprise Azure Entra SSO**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`docs/images/enterprise/entra-sso/README.md`, `docs/images/enterprise/entra-sso/README.md`, `docs/images/enterprise/entra-sso/README.md` Claim：`clm_0010` supported 0.86
- **Multi-Language Documentation**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`README.md`, `i18n/README.ko.md` Claim：`clm_0011` supported 0.86

### 上下文规模

- 文件总数：237
- 重要文件覆盖：40/237
- 证据索引条目：80
- 角色 / Skill 条目：6

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 @upstash/context7 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 @upstash/context7 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 @upstash/context7 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```


## 角色 / Skill 索引

- 共索引 6 个角色 / Skill / 项目文档条目。

- **context7-docs**（skill）：- 激活提示：当用户任务与“context7-docs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`packages/pi/skills/context7-docs/SKILL.md`
- **context7-mcp**（skill）：This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc. 激活提示：当用户任务与“context7-mcp”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`plugins/claude/context7/skills/context7-mcp/SKILL.md`
- **context7-mcp**（skill）：This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc. 激活提示：当用户任务与“context7-mcp”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`plugins/cursor/context7/skills/context7-mcp/SKILL.md`
- **context7-cli**（skill）：Use the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7", needs current docs for any library, wants to install/search/generate skills, or needs to set up Context7 for their AI coding agent. 激活提示：当用户任务与“context7-cli”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/context7-cli/SKILL.md`
- **context7-mcp**（skill）：This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc. 激活提示：当用户任务与“context7-mcp”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/context7-mcp/SKILL.md`
- **find-docs**（skill）：- 激活提示：当用户任务与“find-docs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/find-docs/SKILL.md`

## 证据索引

- 共索引 80 条证据。

- **Entra SSO screenshots**（documentation）：Checklist and capture instructions for the 11 screenshots referenced in docs/enterprise/security/entra-sso.mdx . Drop the finished PNGs into this folder using the exact filenames below. Each screenshot should capture only the relevant Azure blade or Context7 card crop out the surrounding Azure sidebar when it isn't load-bearing for the step . 证据：`docs/images/enterprise/entra-sso/README.md`
- **Changesets**（documentation）：Hello and welcome! This folder has been automatically generated by @changesets/cli , a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it in our repository https://github.com/changesets/changesets 证据：`.changeset/README.md`
- **Context7 Platform - Up-to-date Code Docs For Any Prompt**（documentation）：! Cover https://github.com/upstash/context7/blob/master/public/cover.png?raw=true 证据：`README.md`
- **ctx7**（documentation）：CLI for Context7 https://context7.com - query up-to-date library documentation and manage AI coding skills. 证据：`packages/cli/README.md`
- **Context7 MCP - Up-to-date Code Docs For Any Prompt**（documentation）：! Cover https://github.com/upstash/context7/blob/master/public/cover.png?raw=true 证据：`packages/mcp/README.md`
- **@upstash/context7-pi**（documentation）：Official Context7 https://context7.com extension for the pi coding agent https://pi.dev . 证据：`packages/pi/README.md`
- **Upstash Context7 SDK**（documentation）：⚠️ Work in Progress : This SDK is currently under active development. The API is subject to change and may introduce breaking changes in future releases. 证据：`packages/sdk/README.md`
- **Upstash Context7 AI SDK**（documentation）：@upstash/context7-tools-ai-sdk provides Vercel AI SDK https://ai-sdk.dev/ compatible tools and agents that give your AI applications access to up to date library documentation through Context7. 证据：`packages/tools-ai-sdk/README.md`
- **Context7 Plugin for Claude Code**（documentation）：Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories. 证据：`plugins/claude/context7/README.md`
- **Context7 Plugin for Cursor**（documentation）：Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories. 证据：`plugins/cursor/context7/README.md`
- **Package**（package_manifest）：{ "name": "@upstash/context7", "private": true, "version": "1.0.0", "description": "Context7 monorepo - Documentation tools and SDKs", "workspaces": "packages/ " , "scripts": { "build": "pnpm -r run build", "build:sdk": "pnpm --filter @upstash/context7-sdk build", "build:mcp": "pnpm --filter @upstash/context7-mcp build", "build:ai-sdk": "pnpm --filter @upstash/context7-tools-ai-sdk build", "typecheck": "pnpm -r run typecheck", "test": "pnpm -r run test", "test:sdk": "pnpm --filter @upstash/context7-sdk test", "test:tools-ai-sdk": "pnpm --filter @upstash/context7-tools-ai-sdk test", "clean": "pnpm -r run clean && rm -rf node modules", "lint": "pnpm -r run lint", "lint:check": "pnpm -r run li… 证据：`package.json`
- **Package**（package_manifest）：{ "name": "ctx7", "version": "0.4.4", "description": "Context7 CLI - Manage AI coding skills and documentation context", "type": "module", "bin": { "ctx7": "./dist/index.js" }, "files": "dist" , "scripts": { "build": "tsup", "dev": "tsup --watch", "typecheck": "tsc --noEmit", "lint": "eslint src --fix", "lint:check": "eslint src", "format": "prettier --write src", "format:check": "prettier --check src", "clean": "rm -rf dist node modules", "test": "vitest run", "test:watch": "vitest" }, "dependencies": { "@inquirer/core": "^11.1.1", "@inquirer/prompts": "^8.2.0", "commander": "^13.1.0", "figlet": "^1.9.4", "open": "^10.1.0", "ora": "^9.0.0", "picocolors": "^1.1.1" }, "devDependencies": { "@… 证据：`packages/cli/package.json`
- **Package**（package_manifest）：{ "name": "@upstash/context7-mcp", "version": "3.0.0", "mcpName": "io.github.upstash/context7", "description": "MCP server for Context7", "scripts": { "build": "tsc && chmod 755 dist/index.js", "test": "pnpm exec vitest run", "typecheck": "tsc --noEmit", "lint": "eslint .", "lint:check": "eslint .", "format": "prettier --write .", "format:check": "prettier --check .", "dev": "tsc --watch", "start": "node dist/index.js --transport http", "pack-mcpb": "pnpm install && pnpm run build && rm -rf node modules && pnpm install --prod && cp mcpb/manifest.json manifest.json && cp mcpb/.mcpbignore .mcpbignore && cp ../../public/icon.png icon.png && mcpb validate manifest.json && mcpb pack . mcpb/conte… 证据：`packages/mcp/package.json`
- **Package**（package_manifest）：{ "name": "@upstash/context7-pi", "version": "0.1.0", "description": "Official Context7 extension for pi.dev — adds resolve-library-id and query-docs tools to the pi coding agent", "type": "module", "pi": { "extensions": "./extensions" , "skills": "./skills" , "prompts": "./prompts" , "image": "https://github.com/upstash/context7/blob/master/public/cover.png?raw=true" }, "files": "extensions", "lib", "skills", "prompts", "LICENSE", "README.md" , "scripts": { "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc --noEmit", "lint": "eslint .", "lint:check": "eslint .", "format": "prettier --write .", "format:check": "prettier --check ." }, "peerDependencies": { "@earendil-works/pi-c… 证据：`packages/pi/package.json`
- **Package**（package_manifest）：{ "name": "@upstash/context7-sdk", "version": "0.3.0", "description": "JavaScript/TypeScript SDK for Context7", "scripts": { "build": "tsup", "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc --noEmit", "dev": "tsup --watch", "clean": "rm -rf dist", "lint": "eslint .", "lint:check": "eslint ." }, "repository": { "type": "git", "url": "git+https://github.com/upstash/context7.git", "directory": "packages/sdk" }, "keywords": "context7", "sdk", "documentation", "ai", "upstash" , "author": "Upstash", "license": "MIT", "type": "module", "exports": { ".": { "import": "./dist/client.js", "require": "./dist/client.cjs" } }, "main": "./dist/client.cjs", "module": "./dist/client.js", "ty… 证据：`packages/sdk/package.json`
- **Package**（package_manifest）：{ "name": "@upstash/context7-tools-ai-sdk", "version": "0.2.3", "description": "Context7 tools for Vercel AI SDK", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" }, "./agent": { "types": "./dist/agent.d.ts", "import": "./dist/agent.js", "require": "./dist/agent.cjs" } }, "files": "dist" , "scripts": { "build": "tsup", "dev": "tsup --watch", "test": "vitest run", "typecheck": "tsc --noEmit", "clean": "rm -rf dist" }, "peerDependencies": { "@upstash/context7-sdk": " =0.3.0", "ai": " =6.0.0", "zod": " =4.0.0" }, "devDependencies"… 证据：`packages/tools-ai-sdk/package.json`
- **Context7 Documentation Lookup**（skill_instruction）：Retrieve current documentation and code examples from Context7 https://context7.com using the resolve-library-id and query-docs tools that ship with this extension. 证据：`packages/pi/skills/context7-docs/SKILL.md`
- **When to Use This Skill**（skill_instruction）：When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data. 证据：`plugins/claude/context7/skills/context7-mcp/SKILL.md`
- **When to Use This Skill**（skill_instruction）：When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data. 证据：`plugins/cursor/context7/skills/context7-mcp/SKILL.md`
- **ctx7 CLI**（skill_instruction）：The Context7 CLI does three things: fetches up-to-date library documentation, manages AI coding skills, and sets up Context7 MCP for your editor. 证据：`skills/context7-cli/SKILL.md`
- **When to Use This Skill**（skill_instruction）：When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data. 证据：`skills/context7-mcp/SKILL.md`
- **Documentation Lookup**（skill_instruction）：Retrieve current documentation and code examples for any library using the Context7 CLI. 证据：`skills/find-docs/SKILL.md`
- **Marketplace**（structured_config）：{ "name": "context7-marketplace", "owner": { "name": "Upstash" }, "plugins": { "name": "context7-plugin", "source": "./plugins/claude/context7", "description": "Up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.", "version": "1.0.0" } } 证据：`.claude-plugin/marketplace.json`
- **Plugin**（structured_config）：{ "name": "context7-plugin", "description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.", "author": { "name": "Upstash" } } 证据：`plugins/claude/context7/.claude-plugin/plugin.json`
- **Plugin**（structured_config）：{ "name": "context7", "version": "1.0.0", "description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.", "author": { "name": "Context7", "email": "context7@upstash.com", "url": "https://context7.com" }, "keywords": "documentation", "mcp", "context7", "libraries", "frameworks" , "logo": "https://context7.com/brand/context7-icon-green.svg", "primaryColor": " 059669" } 证据：`plugins/cursor/context7/.cursor/plugin.json`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`packages/mcp/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`packages/pi/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`packages/sdk/LICENSE`
- **Context7 MCP - 모든 프롬프트를 위한 최신 코드 문서**（documentation）：! Cover https://github.com/upstash/context7/blob/master/public/cover.png?raw=true 证据：`i18n/README.ko.md`
- **Changelog**（documentation）：- 7cacc94: Add --json flag to ctx7 skills list for machine-parseable output. Emits { skills: { name, path, source } } where path is absolute and source is the agent type universal , claude , cursor , antigravity . Matches the existing --json pattern on ctx7 library and ctx7 docs . 证据：`packages/cli/CHANGELOG.md`
- **@upstash/context7-mcp**（documentation）：- af6a7b5: Convert the stateless MCP implementation to a stateful one using Redis for session management. 证据：`packages/mcp/CHANGELOG.md`
- **@upstash/context7-pi**（documentation）：- f91b40c: Initial release. Adds an official Context7 extension for the pi coding agent https://pi.dev — registers resolve-library-id and query-docs tools, ships the context7-docs skill, and exposes a /c7-docs slash command. Wire format, error messages, and tool descriptions are copied verbatim from @upstash/context7-mcp so pi and MCP clients give the LLM identical instructions and output. Self-contained — no Context7 runtime dependencies. Works out of the box at IP-based rate limits; set CONTEXT7 API KEY for the higher tier. Install with pi install npm:@upstash/context7-pi . 证据：`packages/pi/CHANGELOG.md`
- **C7 Docs**（documentation）：Look up documentation for $1 using Context7. 证据：`packages/pi/prompts/c7-docs.md`
- **@upstash/context7-sdk**（documentation）：- 9412e62: feat: Change SDK default response type from "txt" to "json" for both searchLibrary and getContext methods. AI SDK tools now explicitly use type: "txt" for LLM-friendly text responses. 证据：`packages/sdk/CHANGELOG.md`
- **@upstash/context7-tools-ai-sdk**（documentation）：- 8322879: Improve resolve libryar id tool prompt to provide the libraryName query with proper format 证据：`packages/tools-ai-sdk/CHANGELOG.md`
- **Your Task**（documentation）：You are a documentation researcher specializing in fetching up-to-date library and framework documentation from Context7. 证据：`plugins/claude/context7/agents/docs-researcher.md`
- **Context7**（documentation）：Context7 is a documentation power for libraries, frameworks, SDKs, APIs, and developer tools. It retrieves up-to-date documentation to ground code generation. 证据：`plugins/context7-power/POWER.md`
- **Your Task**（documentation）：You are a documentation researcher specializing in fetching up-to-date library and framework documentation from Context7. 证据：`plugins/cursor/context7/agents/docs-researcher.md`
- **Manifest**（structured_config）：{ "manifest version": "0.3", "name": "context7", "display name": "Context7", "version": "2.1.0", "description": "Up-to-date Code Docs For Any Prompt", "long description": "Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.", "author": { "name": "Upstash", "email": "context7@upstash.com", "url": "https://upstash.com" }, "homepage": "https://context7.com", "documentation": "https://github.com/upstash/context7", "support": "https://github.com/upstash/context7/issues", "privacy policies": "https://upstash.com/privacy" , "icon": "icon.png", "server": { "type": "node", "entry point": "dist/index.js"… 证据：`packages/mcp/mcpb/manifest.json`
- **Context7**（structured_config）：{ "$schema": "http://json-schema.org/draft-07/schema ", "$id": "https://context7.com/schema/context7.json", "title": "Context7 Configuration Schema", "description": "Configuration file for Context7 project parsing and documentation generation", "type": "object", "properties": { "projectTitle": { "type": "string", "description": "The display name for your project in Context7. This overrides the default repository name.", "minLength": 1, "maxLength": 100, "examples": "Upstash Ratelimit", "Next.js", "React Query" }, "description": { "type": "string", "description": "A brief description of what your library does. This helps coding agents understand the purpose of your project.", "minLength": 10… 证据：`packages/mcp/schema/context7.json`
- **Mcp**（structured_config）：{ "mcpServers": { "context7": { "url": "https://mcp.context7.com/mcp" } } } 证据：`plugins/context7-power/mcp.json`
- **Mcp**（structured_config）：{ "context7": { "url": "https://mcp.context7.com/mcp/oauth" } } 证据：`plugins/cursor/context7/mcp.json`
- **Claiming Your Library**（source_file）：Context7 allows you to add your favorite libraries and frameworks so developers always receive current, trustworthy documentation inside their coding environment. 证据：`docs/adding-libraries.mdx`
- **Authentication**（source_file）：All API requests require authentication using an API key. Include your API key in the Authorization header: 证据：`docs/api-guide.mdx`
- **Automatic Refresh**（source_file）：Context7 automatically refreshes library documentation so that developers always receive accurate, up-to-date context in their coding environment. Here's how it works. 证据：`docs/library-updates.mdx`
- **❌ Without Context7**（source_file）：Context7 brings up-to-date, version-specific documentation and code examples directly into your AI coding assistant. That means no more outdated code or hallucinated APIs. 证据：`docs/overview.mdx`
- **Agentic Tools**（source_file）：Context7 provides tools and integrations that give your AI agents access to accurate, up-to-date library documentation. Instead of relying on potentially outdated training data, your agents can fetch real-time documentation to answer questions and generate code. 证据：`docs/agentic-tools/overview.mdx`
- **Managing API Keys**（source_file）：API keys authenticate your requests to Context7's documentation services. 证据：`docs/howto/api-keys.mdx`
- **Why Claim Your Library?**（source_file）：As a library owner, you can claim your library on Context7 to unlock advanced configuration options through a web-based admin panel. This gives you full control over how your documentation is parsed and presented to developers. 证据：`docs/howto/claiming-libraries.mdx`
- **Why Get Verified?**（source_file）：Verified libraries receive a special badge that signals quality and trustworthiness to developers. Verification helps your library rank higher in search results and gives users confidence that your documentation is reliable. 证据：`docs/howto/verification.mdx`
- **OAuth Authentication**（source_file）：Context7 supports all MCP clients. Below are configuration examples for popular clients. If your client isn't listed, check its documentation for MCP server installation. To configure manually, use the Context7 server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the CONTEXT7 API KEY header. 证据：`docs/resources/all-clients.mdx`
- **API Key Security**（source_file）：This guide covers the authentication mechanisms and access controls available in Context7, including API key handling and enterprise identity features. 证据：`docs/security/auth-and-access-control.mdx`
- **Secure Your API Keys**（source_file）：These recommendations cover how to use Context7 securely across credentials, repository access, and network usage. 证据：`docs/security/best-practices.mdx`
- **Reporting Security Issues**（source_file）：How Context7 handles security reporting, transparency, and compliance. 证据：`docs/security/compliance-and-reporting.mdx`
- **Query Privacy**（source_file）：How Context7 handles privacy, retrieval scope, and data. 证据：`docs/security/data-privacy.mdx`
- **Prompt Injection and Malware Pattern Detection**（source_file）：Prompt Injection and Malware Pattern Detection 证据：`docs/security/data-safety.mdx`
- **Platform Infrastructure**（source_file）：The operational and platform-level protections behind Context7, including hosted infrastructure, abuse prevention, and secure development practices. 证据：`docs/security/infrastructure.mdx`
- **Highlights**（source_file）：Context7 takes security and privacy seriously. This page outlines our security practices, data handling, and compliance measures. 证据：`docs/security/overview.mdx`
- **Auth**（source_file）：import { Command } from "commander"; import pc from "picocolors"; import ora from "ora"; import open from "open"; import { generatePKCE, generateState, createCallbackServer, exchangeCodeForTokens, saveTokens, clearTokens, buildAuthorizationUrl, getValidAccessToken, } from "../utils/auth.js"; ⋮---- import { trackEvent } from "../utils/tracking.js"; import { CLI CLIENT ID } from "../constants.js"; import { getBaseUrl } from "../utils/api.js"; ⋮---- export function setAuthBaseUrl url: string : void ⋮---- export function registerAuthCommands program: Command : void ⋮---- export async function performLogin openBrowser = true : Promise ⋮---- async function loginCommand options: ⋮---- function log… 证据：`packages/cli/src/commands/auth.ts`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/images/enterprise/entra-sso/README.md`, `.changeset/README.md`, `README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/images/enterprise/entra-sso/README.md`, `.changeset/README.md`, `README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **概述与快速入门**：importance `high`
  - source_paths: README.md, package.json, packages/cli/README.md, packages/mcp/README.md
- **CLI 参考指南**：importance `high`
  - source_paths: packages/cli/src/commands/auth.ts, packages/cli/src/commands/docs.ts, packages/cli/src/commands/remove.ts, packages/cli/src/commands/setup.ts, packages/cli/src/utils/api.ts
- **MCP 服务器架构**：importance `high`
  - source_paths: packages/mcp/src/index.ts, packages/mcp/src/lib/api.ts, packages/mcp/src/lib/auth/auth-prompt.ts, packages/mcp/src/lib/sessionStore.ts, packages/mcp/src/lib/redis.ts
- **TypeScript SDK 与 AI SDK 工具**：importance `high`
  - source_paths: packages/sdk/src/client.ts, packages/sdk/src/commands/get-context/index.ts, packages/sdk/src/commands/search-library/index.ts, packages/tools-ai-sdk/src/index.ts, packages/tools-ai-sdk/src/tools/query-docs.ts
- **AI 编码助手集成**：importance `high`
  - source_paths: packages/cli/src/setup/agents.ts, packages/cli/src/setup/templates.ts, docs/clients/cli.mdx, docs/clients/cursor.mdx, docs/clients/claude-code.mdx
- **pi.dev 扩展集成**：importance `medium`
  - source_paths: packages/pi/extensions/context7.ts, packages/pi/lib/tools/query-docs.ts, packages/pi/lib/tools/resolve-library-id.ts, packages/pi/prompts/c7-docs.md, packages/pi/skills/context7-docs/SKILL.md
- **多客户端配置参考**：importance `medium`
  - source_paths: docs/resources/all-clients.mdx, packages/mcp/mcpb/context7.mcpb, packages/mcp/smithery.yaml, plugins/context7-power/mcp.json, plugins/claude/context7/.mcp.json
- **库管理与维护**：importance `high`
  - source_paths: docs/adding-libraries.mdx, docs/library-updates.mdx, docs/howto/claiming-libraries.mdx, docs/howto/verification.mdx, docs/api-guide.mdx

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `7e956e594584db4b1b66a3a4a07781e92b4d7e45`
- inspected_files: `pnpm-lock.yaml`, `package.json`, `README.md`, `docs/api-guide.mdx`, `docs/enterprise.mdx`, `docs/openapi.json`, `docs/installation.mdx`, `docs/adding-libraries.mdx`, `docs/docs.json`, `docs/contact.mdx`, `docs/library-updates.mdx`, `docs/tips.mdx`, `docs/plans-pricing.mdx`, `docs/overview.mdx`, `docs/skills.mdx`, `docs/howto/teamspace.mdx`, `docs/howto/oauth.mdx`, `docs/howto/api-keys.mdx`, `docs/howto/claiming-libraries.mdx`, `docs/howto/chat-widget.mdx`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 失败模式：security_permissions: Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation l...

- Trigger: Developers should check this security_permissions risk before relying on the project: Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library)
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library). Context: Observed during installation or first-run setup.
- Why it matters: Developers may expose sensitive permissions or credentials: Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library)
- Evidence: failure_mode_cluster:github_issue | fmev_f91ad7c65b248ade2db4a9cc8ca70e1f | https://github.com/upstash/context7/issues/2673 | Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library)
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 失败模式：security_permissions: query-docs response embeds non-doc "system notice" with auto-approve install command — prompt...

- Trigger: Developers should check this security_permissions risk before relying on the project: query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector. Context: Observed during installation or first-run setup.
- Why it matters: Developers may expose sensitive permissions or credentials: query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector
- Evidence: failure_mode_cluster:github_issue | fmev_d54367d6cbfefa30a08d27c872533e44 | https://github.com/upstash/context7/issues/2663 | query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library)

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Prompt-injection content appended to `query-docs` response (HubSpot Developer Documentation library)
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_40a4551a10c541ff9aeb4cfa33ad689e | https://github.com/upstash/context7/issues/2673 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：Use XDG-compliant directories for storing Context7 files

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Use XDG-compliant directories for storing Context7 files
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_4cf92b43e1694ab6bbd96e6eb63188dd | https://github.com/upstash/context7/issues/2638 | 来源讨论提到 linux 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 来源证据：[Feature]: Add --dry-run flag to CLI for config validation

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Feature]: Add --dry-run flag to CLI for config validation
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_621e348546d94e81b343d02ef9f86cf5 | https://github.com/upstash/context7/issues/2677 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 来源证据：query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：query-docs response embeds non-doc "system notice" with auto-approve install command — prompt injection vector
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_31d3961fd88444a68e1ea5035a28dcac | https://github.com/upstash/context7/issues/2663 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 仓库名和安装名不一致

- Trigger: 仓库名 `context7` 与安装入口 `ctx7` 不完全一致。
- Host AI rule: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。
- Why it matters: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。
- Evidence: identity.distribution | github_repo:955620917 | https://github.com/upstash/context7 | repo=context7; install=ctx7
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 来源证据：Verification Request: Glyph

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Verification Request: Glyph
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_cedef8266f434c77aebb4e590501196a | https://github.com/upstash/context7/issues/2682 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 失败模式：configuration: Update Request: Library Migration racletteJs

- Trigger: Developers should check this configuration risk before relying on the project: Update Request: Library Migration racletteJs
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Update Request: Library Migration racletteJs. Context: Observed during version upgrade or migration.
- Why it matters: Developers may misconfigure credentials, environment, or host setup: Update Request: Library Migration racletteJs
- Evidence: failure_mode_cluster:github_issue | fmev_2c347e165f54805473e465e7e0398a8c | https://github.com/upstash/context7/issues/2665 | Update Request: Library Migration racletteJs
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 失败模式：configuration: Use XDG-compliant directories for storing Context7 files

- Trigger: Developers should check this configuration risk before relying on the project: Use XDG-compliant directories for storing Context7 files
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Use XDG-compliant directories for storing Context7 files. Context: Observed when using linux
- Why it matters: Developers may misconfigure credentials, environment, or host setup: Use XDG-compliant directories for storing Context7 files
- Evidence: failure_mode_cluster:github_issue | fmev_6c1bf0512a4906da8a1af4d73f35184f | https://github.com/upstash/context7/issues/2638 | Use XDG-compliant directories for storing Context7 files
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
