# @browserstack/mcp-server - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 @browserstack/mcp-server 编译的 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_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`CONTRIBUTING.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `git clone https://github.com/browserstack/mcp-server.git` 证据：`CONTRIBUTING.md` Claim：`clm_0003` supported 0.86
- `npx @modelcontextprotocol/inspector --config /PATH_TO_CONFIG/.cursor/mcp.json --server browserstack` 证据：`CONTRIBUTING.md` Claim：`clm_0004` supported 0.86

## 继续前判断卡

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

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、本地环境或项目文件、环境变量 / API Key

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`CONTRIBUTING.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`CONTRIBUTING.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`CONTRIBUTING.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`CONTRIBUTING.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`CONTRIBUTING.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`CONTRIBUTING.md`, `README.md`, `server.json`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

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

## 哪些必须安装后验证

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

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0005` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`CONTRIBUTING.md` Claim：`clm_0006` 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。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`CONTRIBUTING.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：152
- 重要文件覆盖：40/152
- 证据索引条目：76
- 角色 / Skill 条目：2

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

请严格输出四段：
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
请基于 @browserstack/mcp-server 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```


## 角色 / Skill 索引

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

- **BrowserStack MCP Server**（project_doc）：Manage test cases, execute manual or automated tests, debug issues, and even fix code—directly within tools like Cursor, Claude, or any MCP-enabled client, using plain English. Test from anywhere: Easily connect the BrowserStack Test Platform to your favourite AI tools, such as IDEs, LLMs, or agentic workflows. Test with natural language: Manage, execute, debug tests, and even fix code using plain English prompts. R… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **🚀 Contributing to the Browserstack MCP Server**（project_doc）：🚀 Contributing to the Browserstack MCP Server 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`

## 证据索引

- 共索引 76 条证据。

- **BrowserStack MCP Server**（documentation）：Manage test cases, execute manual or automated tests, debug issues, and even fix code—directly within tools like Cursor, Claude, or any MCP-enabled client, using plain English. Test from anywhere: Easily connect the BrowserStack Test Platform to your favourite AI tools, such as IDEs, LLMs, or agentic workflows. Test with natural language: Manage, execute, debug tests, and even fix code using plain English prompts. Reduced context switching: Stay in flow—keep all project context in one place and trigger actions directly from your IDE or LLM. 证据：`README.md`
- **Package**（package_manifest）：{ "name": "@browserstack/mcp-server", "version": "1.2.20", "description": "BrowserStack's Official MCP Server", "mcpName": "io.github.browserstack/mcp-server", "main": "dist/index.js", "repository": { "type": "git", "url": "git+https://github.com/browserstack/mcp-server.git" }, "type": "module", "scripts": { "build": "npm run lint && npm run format && npm test && tsc", "start": "node dist/index.js", "dev": "tsx watch --clear-screen=false src/index.ts", "test": "vitest run", "lint": "eslint . --ext .ts", "format": "prettier --write \"src/ / .ts\"" }, "bin": { "browserstack-mcp-server": "dist/index.js" }, "files": "dist" , "keywords": "mcp", "browserstack", "testing", "automation" , "engines"… 证据：`package.json`
- **🚀 Contributing to the Browserstack MCP Server**（documentation）：🚀 Contributing to the Browserstack MCP Server 证据：`CONTRIBUTING.md`
- **License**（source_file）：GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 证据：`LICENSE`
- **These are used while development**（source_file）：These are used while development At runtime, these should be configured as part of the mcpServers.json file BROWSERSTACK ACCESS KEY="bs access key" BROWSERSTACK USERNAME="bs username" NODE ENV="development" 证据：`.env.example`
- **Config**（source_file）：export class Config ⋮---- constructor 证据：`src/config.ts`
- **Index**（source_file）：import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { createRequire } from "module"; ⋮---- import logger from "./logger.js"; import { BrowserStackMcpServer } from "./server-factory.js"; ⋮---- async function main 证据：`src/index.ts`
- **Logger**（source_file）：import { pino } from "pino"; ⋮---- get target, prop ⋮---- export function setLogger customLogger: any : void 证据：`src/logger.ts`
- **Oninitialized**（source_file）：import { trackMCP } from "./lib/instrumentation.js"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { shouldSendStartedEvent } from "./lib/device-cache.js"; ⋮---- export function setupOnInitialized server: McpServer, config?: any 证据：`src/oninitialized.ts`
- **Server Factory**（source_file）：import { McpServer, RegisteredTool, } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createRequire } from "module"; ⋮---- import logger from "./logger.js"; import addSDKTools from "./tools/bstack-sdk.js"; import addPercyTools from "./tools/percy-sdk.js"; import addBrowserLiveTools from "./tools/live.js"; import addAccessibilityTools from "./tools/accessibility.js"; import addTestManagementTools from "./tools/testmanagement.js"; import addAppAutomationTools from "./tools/appautomate.js"; import addFailureLogsTools from "./tools/get-failure-logs.js"; import addAutomateTools from "./tools/automate.js"; import addSelfHealTools from "./tools/selfheal.js"; import addAppLiveTools from ".… 证据：`src/server-factory.ts`
- **Vite.Config**（source_file）：import { defineConfig } from 'vite' 证据：`vite.config.ts`
- **Api**（source_file）：import { getBrowserStackAuth } from "./get-auth.js"; import { BrowserStackConfig } from "../lib/types.js"; import { apiClient } from "./apiClient.js"; ⋮---- export async function getLatestO11YBuildInfo buildName: string, projectName: string, config: BrowserStackConfig, 证据：`src/lib/api.ts`
- **Apiclient**（source_file）：import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; import httpsProxyAgentPkg from "https-proxy-agent"; ⋮---- import config from "../config.js"; import { isDataUrlPayloadTooLarge } from "../lib/utils.js"; ⋮---- type RequestOptions = { url: string; headers?: Record ; params?: Record ; body?: any; timeout?: number; responseType?: AxiosRequestConfig "responseType" ; raise error?: boolean; }; ⋮---- class ApiResponse ⋮---- constructor response: AxiosResponse ⋮---- get data : T ⋮---- get status : number ⋮---- get statusText : string ⋮---- get headers : Record ⋮---- get config : AxiosRequestConfig ⋮---- get url : string undefined ⋮---- get ok : boolean ⋮---- function getAxiosAgent :… 证据：`src/lib/apiClient.ts`
- **Constants**（source_file）：export type SessionType = typeof SessionType keyof typeof SessionType ; export type AutomateLogType = typeof AutomateLogType keyof typeof AutomateLogType ; export type AppAutomateLogType = typeof AppAutomateLogType keyof typeof AppAutomateLogType ; 证据：`src/lib/constants.ts`
- **Error**（source_file）：import { AxiosError } from "axios"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; ⋮---- export function formatAxiosError err: unknown, defaultText: string, : CallToolResult 证据：`src/lib/error.ts`
- **Get Auth**（source_file）：import { BrowserStackConfig } from "../lib/types.js"; ⋮---- export function getBrowserStackAuth config: BrowserStackConfig : string 证据：`src/lib/get-auth.ts`
- **Types**（source_file）：export type BrowserStackConfig = { "browserstack-username": string; "browserstack-access-key": string; }; 证据：`src/lib/types.ts`
- **Utils**（source_file）：import sharp from "sharp"; import type { ApiResponse } from "./apiClient.js"; import { BrowserStackConfig } from "./types.js"; import { getBrowserStackAuth } from "./get-auth.js"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { trackMCP } from "../index.js"; ⋮---- export function sanitizeUrlParam param: string : string ⋮---- //Compresses a base64 image intelligently to keep it under 1 MB if needed. export async function maybeCompressBase64 base64: string : Promise ⋮---- export async function assertOkResponse response: Response ApiResponse, action: string, ⋮---- export async function fetchFromB… 证据：`src/lib/utils.ts`
- **Accessibility**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { AccessibilityScanner } from "./accessiblity-utils/scanner.js"; import { AccessibilityReportFetcher } from "./accessiblity-utils/report-fetcher.js"; import { AccessibilityAuthConfig } from "./accessiblity-utils/auth-config.js"; import { trackMCP } from "../lib/instrumentation.js"; import { parseAccessibilityReportFromCSV } from "./accessiblity-utils/report-parser.js"; import { queryAccessibilityRAG } from "./accessiblity-utils/accessibility-rag.js"; import { getBrowserStackAuth } from "../lib/get-auth.js"; import { Browser… 证据：`src/tools/accessibility.ts`
- **Accessibility Rag**（source_file）：import { apiClient } from "../../lib/apiClient.js"; ⋮---- export interface RAGChunk { url: string; content: string; } ⋮---- import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { BrowserStackConfig } from "../../lib/types.js"; ⋮---- export interface AccessibilityRAGResponse { content: Array ; } ⋮---- export async function queryAccessibilityRAG userQuery: string, config: BrowserStackConfig, : Promise 证据：`src/tools/accessiblity-utils/accessibility-rag.ts`
- **Auth Config**（source_file）：import { apiClient } from "../../lib/apiClient.js"; import logger from "../../logger.js"; ⋮---- export interface AuthConfigResponse { success: boolean; data?: { id: number; name: string; type: string; username?: string; password?: string; url?: string; usernameSelector?: string; passwordSelector?: string; submitSelector?: string; }; errors?: string ; } ⋮---- export interface FormAuthData { username: string; usernameSelector: string; password: string; passwordSelector: string; submitSelector: string; url: string; } ⋮---- export interface BasicAuthData { url: string; username: string; password: string; } ⋮---- export class AccessibilityAuthConfig ⋮---- public setAuth auth: ⋮---- private trans… 证据：`src/tools/accessiblity-utils/auth-config.ts`
- **Report Fetcher**（source_file）：import { apiClient } from "../../lib/apiClient.js"; ⋮---- interface ReportInitResponse { success: true; data: { task id: string; message: string }; error?: any; } ⋮---- interface ReportResponse { success: true; data: { reportLink: string }; error?: any; } ⋮---- export class AccessibilityReportFetcher ⋮---- public setAuth auth: ⋮---- async getReportLink scanId: string, scanRunId: string : Promise 证据：`src/tools/accessiblity-utils/report-fetcher.ts`
- **Report Parser**（source_file）：import { apiClient } from "../../lib/apiClient.js"; import { parse } from "csv-parse/sync"; ⋮---- type SimplifiedAccessibilityIssue = { issue type: string; component: string; issue description: string; HTML snippet: string; how to fix: string; severity: string; }; ⋮---- type PaginationOptions = { maxCharacterLength?: number; nextPage?: number; }; ⋮---- type PaginatedResult = { records: SimplifiedAccessibilityIssue ; page length: number; total issues: number; next page: number null; }; ⋮---- export async function parseAccessibilityReportFromCSV reportLink: string, { maxCharacterLength = 5000, nextPage = 0 }: PaginationOptions = {}, : Promise 证据：`src/tools/accessiblity-utils/report-parser.ts`
- **Scanner**（source_file）：import { apiClient } from "../../lib/apiClient.js"; import { randomUUID } from "node:crypto"; import logger from "../../logger.js"; import { isLocalURL, ensureLocalBinarySetup, killExistingBrowserStackLocalProcesses, } from "../../lib/local.js"; import config from "../../config.js"; ⋮---- export interface AccessibilityScanResponse { success: boolean; data?: { id: string; scanRunId: string }; errors?: string ; } ⋮---- export interface AccessibilityScanStatus { success: boolean; data?: { status: string }; errors?: string ; } ⋮---- export class AccessibilityScanner ⋮---- public setAuth auth: ⋮---- async startScan name: string, urlList: string , authConfigId?: number, advancedRules?: boolean, :… 证据：`src/tools/accessiblity-utils/scanner.ts`
- **Constants**（source_file）：import { z } from "zod"; import { AppSDKSupportedFrameworkEnum, AppSDKSupportedTestingFrameworkEnum, AppSDKSupportedLanguageEnum, } from "./index.js"; 证据：`src/tools/appautomate-utils/appium-sdk/constants.ts`
- **Handler**（source_file）：import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { BrowserStackConfig } from "../../../lib/types.js"; import { getBrowserStackAuth } from "../../../lib/get-auth.js"; import { validateAppAutomateDevices } from "../../sdk-utils/common/device-validator.js"; ⋮---- import { getAppUploadInstruction, validateSupportforAppAutomate, SupportedFramework, } from "./utils.js"; ⋮---- import { getAppSDKPrefixCommand, generateAppBrowserStackYMLInstructions, } from "./index.js"; ⋮---- import { AppSDKSupportedLanguage, AppSDKSupportedTestingFramework, AppSDKInstruction, formatAppInstructionsWithNumbers, getAppInstructionsForProjectConfiguration, SETUP APP A… 证据：`src/tools/appautomate-utils/appium-sdk/handler.ts`
- **Instructions**（source_file）：import { AppSDKSupportedLanguage, AppSDKSupportedTestingFramework, } from "./index.js"; ⋮---- import { getJavaAppInstructions } from "./languages/java.js"; import { getCSharpAppInstructions } from "./languages/csharp.js"; import { getNodejsAppInstructions } from "./languages/nodejs.js"; import { getPythonAppInstructions } from "./languages/python.js"; import { getRubyAppInstructions } from "./languages/ruby.js"; ⋮---- import { getCSharpSDKCommand } from "./languages/csharp.js"; import { getJavaSDKCommand } from "./languages/java.js"; import { getNodejsSDKCommand } from "./languages/nodejs.js"; import { getPythonSDKCommand } from "./languages/python.js"; import { getRubySDKCommand } from "./… 证据：`src/tools/appautomate-utils/appium-sdk/instructions.ts`
- **Java**（source_file）：import { createStep, combineInstructions, createEnvStep, PLATFORM UTILS, } from "../index.js"; ⋮---- export function getJavaAppInstructions : string ⋮---- export function getJavaAppFrameworkForMaven framework: string : string ⋮---- export function getJavaAppFrameworkVersion framework: string : string ⋮---- function getMavenCommandForWindows framework: string, mavenFramework: string, version: string, username: string, accessKey: string, appPath?: string, : string ⋮---- function getMavenCommandForUnix framework: string, mavenFramework: string, version: string, username: string, accessKey: string, appPath?: string, : string ⋮---- export function getJavaSDKCommand framework: string, username: s… 证据：`src/tools/appautomate-utils/appium-sdk/languages/java.ts`
- **Python**（source_file）：import { AppSDKSupportedTestingFramework, AppSDKSupportedTestingFrameworkEnum, createStep, createEnvStep, combineInstructions, PLATFORM UTILS, } from "../index.js"; ⋮---- export function getPythonAppInstructions testingFramework: AppSDKSupportedTestingFramework, : string ⋮---- export function getPythonSDKCommand framework: string, username: string, accessKey: string, : string ⋮---- function getPythonCommonSDKCommand username: string, accessKey: string, isWindows: boolean, platformLabel: string, : string ⋮---- function getLettuceCommand username: string, accessKey: string, isWindows: boolean, platformLabel: string, : string 证据：`src/tools/appautomate-utils/appium-sdk/languages/python.ts`
- **Ruby**（source_file）：import { createStep, combineInstructions, createEnvStep, PLATFORM UTILS, } from "../index.js"; ⋮---- export function getRubyAppInstructions : string ⋮---- export function getRubySDKCommand framework: string, username: string, accessKey: string, : string 证据：`src/tools/appautomate-utils/appium-sdk/languages/ruby.ts`
- **Types**（source_file）：export enum AppSDKSupportedLanguageEnum { java = "java", nodejs = "nodejs", python = "python", ruby = "ruby", csharp = "csharp", } export type AppSDKSupportedLanguage = keyof typeof AppSDKSupportedLanguageEnum; ⋮---- export enum AppSDKSupportedFrameworkEnum { appium = "appium", } ⋮---- export type AppSDKSupportedFramework = keyof typeof AppSDKSupportedFrameworkEnum; ⋮---- export enum AppSDKSupportedTestingFrameworkEnum { testng = "testng", junit5 = "junit5", junit4 = "junit4", selenide = "selenide", jbehave = "jbehave", serenity = "serenity", cucumberTestng = "cucumberTestng", cucumberJunit4 = "cucumberJunit4", cucumberJunit5 = "cucumberJunit5", webdriverio = "webdriverio", nightwatch = "ni… 证据：`src/tools/appautomate-utils/appium-sdk/types.ts`
- **Utils**（source_file）：import { uploadApp } from "../native-execution/appautomate.js"; import { AppSDKSupportedTestingFramework, AppSDKSupportedTestingFrameworkEnum, createStep, } from "./index.js"; import { SUPPORTED CONFIGURATIONS } from "./types.js"; ⋮---- export function isBrowserStackAppUrl appPath: string : boolean ⋮---- export function generateBuildName baseName: string = "app-automate" : string ⋮---- export function createError message: string, context?: Record , : Error ⋮---- // Platform utilities for cross-platform support ⋮---- export async function getAppUploadInstruction appPath: string, username: string, accessKey: string, detectedTestingFramework: AppSDKSupportedTestingFramework, : Promise ⋮---- ex… 证据：`src/tools/appautomate-utils/appium-sdk/utils.ts`
- **Appautomate**（source_file）：import fs from "fs"; import FormData from "form-data"; import { apiClient } from "../../../lib/apiClient.js"; import { customFuzzySearch } from "../../../lib/fuzzy.js"; import { getBrowserStackAuth } from "../../../lib/get-auth.js"; import { BrowserStackConfig } from "../../../lib/types.js"; import { validateUploadPath, UploadValidationOptions, APP BINARY EXTENSIONS, MAX APP UPLOAD BYTES, } from "../../../lib/upload-validator.js"; import appConfig from "../../../config.js"; ⋮---- interface Device { device: string; display name: string; os version: string; real mobile: boolean; } ⋮---- interface UploadResponse { app url: string; custom id?: string; shareable id?: string; } ⋮---- export funct… 证据：`src/tools/appautomate-utils/native-execution/appautomate.ts`
- **Constants**（source_file）：import { z } from "zod"; import { AppTestPlatform } from "./types.js"; 证据：`src/tools/appautomate-utils/native-execution/constants.ts`
- **Types**（source_file）：export enum AppTestPlatform { ESPRESSO = "espresso", XCUITEST = "xcuitest", } ⋮---- export interface Device { device: string; display name: string; os version: string; real mobile: boolean; } ⋮---- export interface PlatformDevices { os: string; os display name: string; devices: Device ; } ⋮---- export enum Platform { ANDROID = "android", IOS = "ios", } 证据：`src/tools/appautomate-utils/native-execution/types.ts`
- **Appautomate**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import logger from "../logger.js"; import { getBrowserStackAuth } from "../lib/get-auth.js"; import { BrowserStackConfig } from "../lib/types.js"; import { trackMCP } from "../lib/instrumentation.js"; import { maybeCompressBase64 } from "../lib/utils.js"; import { remote } from "webdriverio"; import { AppTestPlatform } from "./appautomate-utils/native-execution/types.js"; import { setupAppAutomateHandler } from "./appautomate-utils/appium-sdk/handler.js"; import { validateAppAutomateDevices } from "./sdk-utils/common/device-valida… 证据：`src/tools/appautomate.ts`
- **Device Search**（source_file）：import { customFuzzySearch } from "../../lib/fuzzy.js"; import { DeviceEntry } from "./types.js"; ⋮---- export function findDeviceByName devices: DeviceEntry , desiredPhone: string, : DeviceEntry 证据：`src/tools/applive-utils/device-search.ts`
- **Start Session**（source_file）：import logger from "../../logger.js"; import { getDevicesAndBrowsers, BrowserStackProducts, } from "../../lib/device-cache.js"; import { sanitizeUrlParam } from "../../lib/utils.js"; import { uploadApp } from "./upload-app.js"; import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { findDeviceByName } from "./device-search.js"; import { pickVersion } from "./version-utils.js"; import { DeviceEntry } from "./types.js"; import { BrowserStackConfig } from "../../lib/types.js"; import envConfig from "../../config.js"; ⋮---- interface StartSessionArgs { appPath?: string; desiredPlatform: "android" "ios"; desiredPhone: string; desiredPlatformVersion: string; browserstackAppUrl?: str… 证据：`src/tools/applive-utils/start-session.ts`
- **Types**（source_file）：export interface DeviceEntry { display name: string; device: string; os: string; os version: string; real mobile: boolean; } 证据：`src/tools/applive-utils/types.ts`
- **Version Utils**（source_file）：import { resolveVersion } from "../../lib/version-resolver.js"; ⋮---- export function pickVersion available: string , requested: string : string 证据：`src/tools/applive-utils/version-utils.ts`
- **Applive**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import fs from "fs"; import { startSession } from "./applive-utils/start-session.js"; import logger from "../logger.js"; import { trackMCP } from "../lib/instrumentation.js"; import { BrowserStackConfig } from "../lib/types.js"; ⋮---- export async function startAppLiveSession args: { desiredPlatform: string; desiredPlatformVersion: string; appPath?: string; desiredPhone: string; browserstackAppUrl?: string; }, config: BrowserStackConfig, : Promise ⋮---- export default function addAppLiveTools server: McpServer, config: BrowserStac… 证据：`src/tools/applive.ts`
- **Fetch Screenshots**（source_file）：import { assertOkResponse, maybeCompressBase64 } from "../../lib/utils.js"; import { SessionType } from "../../lib/constants.js"; import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { BrowserStackConfig } from "../../lib/types.js"; import { apiClient } from "../../lib/apiClient.js"; ⋮---- async function extractScreenshotUrls sessionId: string, sessionType: SessionType, config: BrowserStackConfig, : Promise ⋮---- // Split logs into lines and process them ⋮---- async function convertUrlsToBase64 urls: string , : Promise<Array< ⋮---- export async function fetchAutomationScreenshots sessionId: string, sessionType: SessionType = SessionType.Automate, config: BrowserStackConfig, 证据：`src/tools/automate-utils/fetch-screenshots.ts`
- **Automate**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { fetchAutomationScreenshots } from "./automate-utils/fetch-screenshots.js"; import { SessionType } from "../lib/constants.js"; import { trackMCP } from "../lib/instrumentation.js"; import logger from "../logger.js"; import { BrowserStackConfig } from "../lib/types.js"; ⋮---- export async function fetchAutomationScreenshotsTool args: { sessionId: string; sessionType: SessionType; }, config: BrowserStackConfig, : Promise ⋮---- export default function addAutomationTools server: McpServer, config: BrowserStackConfig, 证据：`src/tools/automate.ts`
- **Build Insights**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import logger from "../logger.js"; import { BrowserStackConfig } from "../lib/types.js"; import { fetchFromBrowserStackAPI, handleMCPError } from "../lib/utils.js"; import { trackMCP } from "../lib/instrumentation.js"; ⋮---- export async function fetchBuildInsightsTool args: { buildId: string }, config: BrowserStackConfig, : Promise ⋮---- export default function addBuildInsightsTools server: McpServer, config: BrowserStackConfig, 证据：`src/tools/build-insights.ts`
- **App Automate**（source_file）：import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { filterLinesByKeywords, validateLogResponse } from "./utils.js"; import { BrowserStackConfig } from "../../lib/types.js"; import { apiClient } from "../../lib/apiClient.js"; ⋮---- export async function retrieveDeviceLogs sessionId: string, buildId: string, config: BrowserStackConfig, : Promise ⋮---- export async function retrieveAppiumLogs sessionId: string, buildId: string, config: BrowserStackConfig, : Promise ⋮---- export async function retrieveCrashLogs sessionId: string, buildId: string, config: BrowserStackConfig, : Promise ⋮---- export function filterDeviceFailures logText: string : string ⋮---- export function filt… 证据：`src/tools/failurelogs-utils/app-automate.ts`
- **Automate**（source_file）：import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { HarEntry, HarFile, filterLinesByKeywords, validateLogResponse, } from "./utils.js"; import { BrowserStackConfig } from "../../lib/types.js"; import { apiClient } from "../../lib/apiClient.js"; ⋮---- export async function retrieveNetworkFailures sessionId: string, config: BrowserStackConfig, : Promise ⋮---- export async function retrieveSessionFailures sessionId: string, config: BrowserStackConfig, : Promise ⋮---- export async function retrieveConsoleFailures sessionId: string, config: BrowserStackConfig, : Promise ⋮---- export function filterSessionFailures logText: string : string ⋮---- export function filterConsoleFailu… 证据：`src/tools/failurelogs-utils/automate.ts`
- **Utils**（source_file）：import type { ApiResponse } from "../../lib/apiClient.js"; ⋮---- export interface LogResponse { logs?: any ; message?: string; } ⋮---- export interface HarFile { log: { entries: HarEntry ; }; } ⋮---- export interface HarEntry { startedDateTime: string; request: { method: string; url: string; queryString?: { name: string; value: string } ; }; response: { status: number; statusText?: string; error?: string; }; serverIPAddress?: string; time?: number; } ⋮---- export function validateLogResponse response: Response ApiResponse, logType: string, : LogResponse null ⋮---- export function filterLinesByKeywords logText: string, keywords: string , : string 证据：`src/tools/failurelogs-utils/utils.ts`
- **Get Failure Logs**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { trackMCP } from "../lib/instrumentation.js"; import { BrowserStackConfig } from "../lib/types.js"; ⋮---- import { retrieveNetworkFailures, retrieveSessionFailures, retrieveConsoleFailures, } from "./failurelogs-utils/automate.js"; ⋮---- import { retrieveDeviceLogs, retrieveAppiumLogs, retrieveCrashLogs, } from "./failurelogs-utils/app-automate.js"; ⋮---- import { AppAutomateLogType, AutomateLogType, SessionType, } from "../lib/constants.js"; ⋮---- type LogType = AutomateLogType AppAutomateLogType; type SessionTypeValues =… 证据：`src/tools/get-failure-logs.ts`
- **Start Session**（source_file）：import logger from "../../logger.js"; import { filterDesktop } from "./desktop-filter.js"; import { filterMobile } from "./mobile-filter.js"; import { DesktopSearchArgs, MobileSearchArgs, DesktopEntry, MobileEntry, PlatformType, } from "./types.js"; import { isLocalURL, ensureLocalBinarySetup, killExistingBrowserStackLocalProcesses, } from "../../lib/local.js"; ⋮---- import { getBrowserStackAuth } from "../../lib/get-auth.js"; import { BrowserStackConfig } from "../../lib/types.js"; import envConfig from "../../config.js"; ⋮---- async function prepareLocalTunnel url: string, username: string, password: string, : Promise ⋮---- export async function startBrowserSession args: DesktopSearchArgs… 证据：`src/tools/live-utils/start-session.ts`
- **Types**（source_file）：export interface DesktopSearchArgs { platformType: "desktop"; url: string; os: string; osVersion: string; browser: string; browserVersion: string; } ⋮---- export interface DesktopEntry { os: string; os version: string; browser: string; browser version: string; notes?: string; } ⋮---- export interface MobileSearchArgs { platformType: "mobile"; url: string; os: string; osVersion: string; device: string; browser: string; } ⋮---- export interface MobileEntry { os: string; os version: string; display name: string; notes?: string; } ⋮---- export enum PlatformType { DESKTOP = "desktop", MOBILE = "mobile", } 证据：`src/tools/live-utils/types.ts`
- **Live**（source_file）：import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import logger from "../logger.js"; import { startBrowserSession } from "./live-utils/start-session.js"; import { PlatformType } from "./live-utils/types.js"; import { trackMCP } from "../lib/instrumentation.js"; import { BrowserStackConfig } from "../lib/types.js"; import globalConfig from "../config.js"; ⋮---- async function launchDesktopSession args: z.infer , config: BrowserStackConfig, : Promise ⋮---- async function launchMobileSession args: z.infer , config: BrowserStackConfig, : Promise ⋮---- async function runBrowserSession rawArgs: any, config: BrowserStackConfig ⋮---- export default functi… 证据：`src/tools/live.ts`
- **Constants**（source_file）：import { z } from "zod"; import { SDKSupportedLanguage } from "../sdk-utils/common/types.js"; import { DetectionConfig } from "./types.js"; ⋮---- // UI interactions without explicit driver imports ⋮---- // Page Object patterns ⋮---- // UI test annotations and patterns ⋮---- // Common UI assertions ⋮---- // Browser/window operations ⋮---- // Cucumber UI steps ⋮---- // Browser automation - SPECIFIC CONTEXT ⋮---- // Page object patterns - UI specific ⋮---- // Cypress specific patterns ⋮---- // WebDriverIO specific patterns ⋮---- // Capybara without explicit require ⋮---- // Selenium patterns ⋮---- // Generic UI patterns 证据：`src/tools/percy-snapshot-utils/constants.ts`
- **Types**（source_file）：import { SDKSupportedTestingFrameworkEnum, SDKSupportedLanguageEnum, } from "../sdk-utils/common/types.js"; ⋮---- export type ListTestFilesParams = { dirs: string ; language: SDKSupportedLanguageEnum; framework?: SDKSupportedTestingFrameworkEnum; }; ⋮---- export interface DetectionConfig { extensions: string ; namePatterns: RegExp ; contentRegex: RegExp ; uiDriverRegex: RegExp ; uiIndicatorRegex: RegExp ; backendRegex: RegExp ; excludeRegex?: RegExp ; } 证据：`src/tools/percy-snapshot-utils/types.ts`
- **Utils**（source_file）：export async function updateFileAndStep file: string, idx: number, total: number, instruction: string, 证据：`src/tools/percy-snapshot-utils/utils.ts`
- **Constants**（source_file）：import { z } from "zod"; import { TestStatus } from "./types.js"; 证据：`src/tools/rca-agent-utils/constants.ts`
- **Format Rca**（source_file）：export function formatRCAData rcaData: any : string 证据：`src/tools/rca-agent-utils/format-rca.ts`
- **Get Build Id**（source_file）：export async function getBuildId projectName: string, buildName: string, username: string, accessKey: string, : Promise 证据：`src/tools/rca-agent-utils/get-build-id.ts`
- **Get Failed Test Id**（source_file）：import logger from "../../logger.js"; import { TestStatus, FailedTestInfo, TestRun, TestDetails } from "./types.js"; ⋮---- export async function getTestIds buildId: string, authString: string, status?: TestStatus, : Promise ⋮---- function extractFailedTestIds hierarchy: TestDetails , status?: TestStatus, : FailedTestInfo 证据：`src/tools/rca-agent-utils/get-failed-test-id.ts`
- **Rca Data**（source_file）：import { RCAState, RCATestCase, RCAResponse } from "./types.js"; ⋮---- interface ScanProgressContext { sendNotification: notification: any = Promise ; meta?: { progressToken?: string number; }; } ⋮---- const delay = ms: number ⋮---- function isInProgressState state: RCAState : boolean ⋮---- function isFailedState state: RCAState : boolean ⋮---- function calculateProgress resolvedCount: number, totalCount: number, baseProgress: number = 10, : number ⋮---- function mapApiState apiState?: string : RCAState ⋮---- async function notifyProgress context: ScanProgressContext undefined, message: string, progress: number, ⋮---- async function updateProgress context: ScanProgressContext undefined, tes… 证据：`src/tools/rca-agent-utils/rca-data.ts`
- **Types**（source_file）：export enum TestStatus { PASSED = "passed", FAILED = "failed", PENDING = "pending", SKIPPED = "skipped", } ⋮---- export interface TestDetails { status: TestStatus; details: any; children?: TestDetails ; display name?: string; } ⋮---- export interface TestRun { hierarchy: TestDetails ; pagination?: { has next: boolean; next page: string null; }; } ⋮---- export interface FailedTestInfo { test id: number; test name: string; } ⋮---- export enum RCAState { PENDING = "pending", FETCHING LOGS = "fetching logs", GENERATING RCA = "generating rca", GENERATED RCA = "generated rca", COMPLETED = "completed", FAILED = "failed", LLM SERVICE ERROR = "LLM SERVICE ERROR", LOG FETCH ERROR = "LOG FETCH ERROR",… 证据：`src/tools/rca-agent-utils/types.ts`
- 其余 16 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `package.json`, `CONTRIBUTING.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `package.json`, `CONTRIBUTING.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, src/index.ts, src/server-factory.ts
- **安装与配置**：importance `high`
  - source_paths: .env.example, src/config.ts, src/lib/get-auth.ts, src/lib/constants.ts
- **测试管理工具**：importance `high`
  - source_paths: src/tools/testmanagement.ts, src/tools/testmanagement-utils/create-project-folder.ts, src/tools/testmanagement-utils/create-testcase.ts, src/tools/testmanagement-utils/list-testcases.ts, src/tools/testmanagement-utils/create-testrun.ts
- **实时测试与自动化工具**：importance `high`
  - source_paths: src/tools/applive.ts, src/tools/live.ts, src/tools/automate.ts, src/tools/appautomate.ts, src/tools/applive-utils/start-session.ts
- **无障碍扫描工具**：importance `medium`
  - source_paths: src/tools/accessibility.ts, src/tools/accessiblity-utils/scanner.ts, src/tools/accessiblity-utils/report-parser.ts, src/tools/accessiblity-utils/accessibility-rag.ts, src/tools/accessiblity-utils/report-fetcher.ts
- **SDK 集成与框架支持**：importance `high`
  - source_paths: src/tools/sdk-utils/handler.ts, src/tools/sdk-utils/bstack/sdkHandler.ts, src/tools/sdk-utils/bstack/frameworks.ts, src/tools/sdk-utils/bstack/commands.ts, src/tools/sdk-utils/common/schema.ts
- **Percy 视觉测试集成**：importance `medium`
  - source_paths: src/tools/percy-sdk.ts, src/tools/add-percy-snapshots.ts, src/tools/run-percy-scan.ts, src/tools/percy-snapshot-utils/detect-test-files.ts, src/tools/percy-snapshot-utils/utils.ts
- **AI 智能体功能**：importance `high`
  - source_paths: src/tools/selfheal.ts, src/tools/selfheal-utils/selfheal.ts, src/tools/selfheal-utils/fetch-test-code.ts, src/tools/rca-agent.ts, src/tools/rca-agent-utils/format-rca.ts

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `b31f533630e20695501cbbe935cbf97d7cca0bb4`
- inspected_files: `package.json`, `README.md`, `src/index.ts`, `src/a2a-format.ts`, `src/platform-metadata.ts`

宿主 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: 社区讨论暴露的待验证问题：darkzodchi en X: "Top MCP Servers That Turn Claude Into a Productivity Machine" / X

- Trigger: darkzodchi en X: "Top MCP Servers That Turn Claude Into a Productivity Machine" / X Each session returns a live browser URL your agent controls. Free: 100 sessions/mo · https://github.com/browserbase/mcp-server-browserbase · 12 — GitHub — PRs, issues, code search, CI/CD workflows. The first MCP server every developer…
- Host AI rule: Pack Agent 需要打开来源链接，确认问题是否仍然存在，并把验证结论写入说明书和边界卡。
- Why it matters: 这类外部讨论可能代表真实用户在安装、配置、升级或生产使用时遇到阻力；发布前不能只依赖官方 README。
- Evidence: social_signal:x | ssig_9df635b2db4e49dc88b24ae5e8230ed4 | https://x.com/zodchiii/status/2041804097628582294 | darkzodchi en X: "Top MCP Servers That Turn Claude Into a Productivity Machine" / X
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 社区讨论暴露的待验证问题：Adding Github MCP to Claude Code Error : r/ClaudeAI - Reddit

- Trigger: Adding Github MCP to Claude Code Error : r/ClaudeAI - Reddit 22 Jun 2025 · Source of solution: https://github.com/github/github-mcp-server ... New in Claude Code: agent view. r/ClaudeAI - New in Claude Code ...
- Host AI rule: Pack Agent 需要打开来源链接，确认问题是否仍然存在，并把验证结论写入说明书和边界卡。
- Why it matters: 这类外部讨论可能代表真实用户在安装、配置、升级或生产使用时遇到阻力；发布前不能只依赖官方 README。
- Evidence: social_signal:reddit | ssig_928f35e76c1442709ae4143bf1ef6218 | https://www.reddit.com/r/ClaudeAI/comments/1li0v90/adding_github_mcp_to_claude_code_error/ | Adding Github MCP to Claude Code Error : r/ClaudeAI - Reddit
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 社区讨论暴露的待验证问题：you need somewhere between 1-10 Claude skills depending on what ...

- Trigger: you need somewhere between 1-10 Claude skills depending on what ... 20 Mar 2026 · https://github.com/haris-musa/excel-mcp-server ... Claude Inspector — See hidden Claude Code prompt mechanics https://github.com/kangraemin/claude ...
- Host AI rule: Pack Agent 需要打开来源链接，确认问题是否仍然存在，并把验证结论写入说明书和边界卡。
- Why it matters: 这类外部讨论可能代表真实用户在安装、配置、升级或生产使用时遇到阻力；发布前不能只依赖官方 README。
- Evidence: social_signal:x | ssig_504e57203f64433a83bf7ec96631f94c | https://x.com/Hesamation/status/2035136966719582695 | you need somewhere between 1-10 Claude skills depending on what ...
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 下游验证发现风险项

- Trigger: no_demo
- Host AI rule: 进入安全/权限治理复核队列。
- Why it matters: 下游已经要求复核，不能在页面中弱化。
- Evidence: downstream_validation.risk_items | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 存在评分风险

- Trigger: no_demo
- Host AI rule: 把风险写入边界卡，并确认是否需要人工复核。
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: issue/PR 响应质量未知

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 发布节奏不明确

- Trigger: release_recency=unknown。
- Host AI rule: 确认最近 release/tag 和 README 安装命令是否一致。
- Why it matters: 安装命令和文档可能落后于代码，用户踩坑概率升高。
- Evidence: evidence.maintainer_signals | mcp_registry:ai.agenttrust/mcp-server:1.1.1 | https://registry.modelcontextprotocol.io/v0.1/servers/ai.agenttrust%2Fmcp-server/versions/1.1.1 | release_recency=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
