# opendeepwiki - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

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

## Claim 消费规则

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

## 它最适合谁

- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md` Claim：`clm_0003` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 怎么开始

- `git clone https://github.com/AIDotNet/OpenDeepWiki.git` 证据：`README.md` Claim：`clm_0004` supported 0.86

## 继续前判断卡

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

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：真实输出质量不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md` Claim：`clm_0003` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md` Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0004` supported 0.86

### 现在还不能相信

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

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`AGENTS.md`, `CLAUDE.md`, `src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`CLAUDE.md`, `README.md`, `README.zh-CN.md`, `start.sh`
- **宿主 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_0005` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.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。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`, `src/OpenDeepWiki/skills/think/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **graphify**（skill）：any input code, docs, papers, images, videos to knowledge graph. Use when user asks any question about a codebase, documents, or project content - especially if graphify-out/ exists, treat the question as a /graphify query. 激活提示：当用户任务与“graphify”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`
- **think**（skill）：Deliberate reasoning skill: enforce multi-step analysis, hypothesis testing, and option evaluation before answering complex questions 激活提示：当用户任务与“think”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`src/OpenDeepWiki/skills/think/SKILL.md`

## 证据索引

- 共索引 79 条证据。

- **OpenDeepWiki**（documentation）：中文 README.zh-CN.md English README.md 证据：`README.md`
- **Getting Started**（documentation）：This is a Next.js https://nextjs.org project bootstrapped with create-next-app https://nextjs.org/docs/app/api-reference/cli/create-next-app . 证据：`web/README.md`
- **User Templates**（documentation）：This directory allows you to create custom templates that override the default Spec Workflow templates. 证据：`.spec-workflow/user-templates/README.md`
- **Package**（package_manifest）：{ "name": "docs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "eslint" }, "dependencies": { "@types/mdx": "^2.0.13", "fumadocs-core": "^16.5.1", "fumadocs-mdx": "^14.2.6", "fumadocs-ui": "^16.5.1", "lucide-react": "^0.563.0", "next": "16.1.6", "react": "19.2.3", "react-dom": "19.2.3" }, "devDependencies": { "@tailwindcss/postcss": "^4", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.1.6", "tailwindcss": "^4", "typescript": "^5" } } 证据：`docs/package.json`
- **Package**（package_manifest）：{ "name": "web", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "eslint", "test": "vitest --run", "test:watch": "vitest" }, "dependencies": { "@floating-ui/react": "^0.27.16", "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-alert-dialog": "^1.1.15", "@radix-ui/react-avatar": "^1.1.11", "@radix-ui/react-checkbox": "^1.3.3", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-menubar": "^1.1.16", "@radix-ui/react-navigation-menu": "^1.2.14", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-progress": "^1.1.8", "@radix-ui/react-scroll-area": "^1.2.10", "@radix-… 证据：`web/package.json`
- **Repository Guidelines**（documentation）：Project Structure & Module Organization - src/OpenDeepWiki/ ASP.NET Core API entry; src/OpenDeepWiki.Entities/ domain models; src/OpenDeepWiki.EFCore/ shared EF Core context; src/EFCore/ provider implementations. - web/ Next.js app App Router with app/ , components/ , hooks/ , i18n/ , and public/ . - tests/OpenDeepWiki.Tests/ xUnit + FsCheck tests. - docs/ , scripts/ , and img/ for documentation, automation, and assets. 证据：`AGENTS.md`
- **CLAUDE.md**（documentation）：This file provides guidance to Claude Code claude.ai/code when working with code in this repository. 证据：`CLAUDE.md`
- **/graphify**（skill_instruction）：Turn any folder of files into a navigable knowledge graph with community detection, an honest audit trail, and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language GRAPH REPORT.md. 证据：`src/OpenDeepWiki/skills/graphify/SKILL.md`
- **Think — Deliberate Reasoning Skill**（skill_instruction）：Use this skill whenever a task requires careful judgment, non-trivial trade-offs, or multi-hop reasoning. Follow the deliberate workflow before responding. 证据：`src/OpenDeepWiki/skills/think/SKILL.md`
- **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`
- **OpenDeepWiki**（documentation）：中文 README.zh-CN.md English README.md 证据：`README.zh-CN.md`
- **使用模板将 OpenDeepWiki 一键部署到 Sealos**（documentation）：通过 Sealos 应用模板，你可以快速将 OpenDeepWiki 部署到云端并暴露到公网。 证据：`scripts/sealos/README.zh-CN.md`
- **Appsettings**（structured_config）：{ "Serilog": { "MinimumLevel": { "Default": "Information", "Override": { "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information", "Microsoft.AspNetCore": "Warning", "Microsoft.EntityFrameworkCore": "Warning", "System": "Warning", "OpenDeepWiki": "Debug" } } }, "Logging": { "LogDirectory": "logs", "RetainedFileCountLimit": 31, "MinimumLevel": "Information" }, "Database": { "Type": "sqlite" }, "ConnectionStrings": { "Default": "Data Source=/data/opendeepwiki.db" }, "Jwt": { "SecretKey": "OpenDeepWiki-Default-Secret-Key-Please-Change-In-Production-Environment-2024", "Issuer": "OpenDeepWiki", "Audience": "OpenDeepWiki", "ExpirationMinutes": 1440 }, "AI": { "Endpoint": "https://api.r… 证据：`src/OpenDeepWiki/appsettings.json`
- **.Env**（source_file）：DB TYPE=sqlite CONNECTION STRING=Data Source=/data/opendeepwiki.db JWT SECRET KEY=change-this-to-a-long-random-secret LOCAL IMPORT ROOT=/host/home/zhangruibo 证据：`.env.example`
- **Program**（source_file）：namespace DatabaseQuery ⋮---- public class DatabaseQueryTool ⋮---- public DataTable ExecuteQuery string sql ⋮---- using var connection = new SqliteConnection connectionString ; connection.Open ; ⋮---- using var command = new SqliteCommand sql, connection ; using var reader = command.ExecuteReader ; ⋮---- var dataTable = new DataTable ; dataTable.Load reader ; ⋮---- public DataTable GetTables ⋮---- public DataTable GetTableSchema string tableName ⋮---- public DataTable GetTableData string tableName, int limit = 10 ⋮---- public int GetTableRowCount string tableName ⋮---- return Convert.ToInt32 result.Rows 0 "Count" ; ⋮---- public static void PrintDataTable DataTable dataTable, string title =… 证据：`DatabaseQuery/Program.cs`
- **Visual Studio Version 17**（source_file）：Microsoft Visual Studio Solution File, Format Version 12.00 Visual Studio Version 17 VisualStudioVersion = 17.14.36915.13 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project "{2150E333-8FDC-42A3-9474-1A3956D46DE8}" = "src", "src", "{7F5745CD-DAE4-4C81-A675-B427B634EB17}" EndProject Project "{2150E333-8FDC-42A3-9474-1A3956D46DE8}" = "Solution Items", "Solution Items", "{25263893-E043-4F54-A41B-D97FACE64062}" ProjectSection SolutionItems = preProject .editorconfig = .editorconfig .gitignore = .gitignore Directory.Packages.props = Directory.Packages.props README.md = README.md README.zh-CN.md = README.zh-CN.md compose.yaml = compose.yaml EndProjectSection EndProject Project "{FAE04EC0-301… 证据：`OpenDeepWiki.sln`
- **Check if docker compose is available**（source_file）：param Parameter Position=0 string $Command = "help" 证据：`build.ps1`
- **Compose.Pgsql**（source_file）：services: opendeepwiki: image: crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki build: context: . dockerfile: src/OpenDeepWiki/Dockerfile ports: - "8080:8080" restart: unless-stopped depends on: postgres: condition: service healthy healthcheck: test: "CMD-SHELL", "curl -f http://localhost:8080/health exit 1" interval: 30s timeout: 10s retries: 3 start period: 15s environment: - ASPNETCORE ENVIRONMENT=Production - URLS=http://+:8080 - Database Type=postgresql - ConnectionStrings Default=Host=postgres;Port=5432;Database=opendeepwiki;Username=postgres;Password=opendeepwiki123 - JWT SECRET KEY=OpenDeepWiki-Default-Secret-Key-Please-Change-In-Production-Envir… 证据：`compose.pgsql.yaml`
- **Compose**（source_file）：services: opendeepwiki: image: crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki build: context: . dockerfile: src/OpenDeepWiki/Dockerfile ports: - "18081:8080" restart: unless-stopped user: "0:0" environment: - ASPNETCORE ENVIRONMENT=Production - URLS=http://+:8080 - Database Type=${DB TYPE:-sqlite} - ConnectionStrings Default=${CONNECTION STRING:-Data Source=/data/opendeepwiki.db} - JWT SECRET KEY=${JWT SECRET KEY:-OpenDeepWiki-Default-Secret-Key-Please-Change-In-Production-Environment-2024} - REPOSITORIES DIRECTORY=/data - RepositoryAnalyzer AllowedLocalPathRoots 0=${LOCAL IMPORT ROOT:-/host/home/zhangruibo} - CHAT API KEY=${CHAT API KEY:-your-chat-api… 证据：`compose.yaml`
- **Start**（source_file）：export URLS=http://localhost:5085 export TASK MAX SIZE PER USER=5 export CHAT MODEL=DeepSeek-V3 export ANALYSIS MODEL= export CHAT API KEY= export LANGUAGE= export ENDPOINT=https://api.openai.com/v1 export DB TYPE=sqlite export MODEL PROVIDER=OpenAI export DB CONNECTION STRING="Data Source=./KoalaWiki.db" export EnableSmartFilter=true export UPDATE INTERVAL=5 export MAX FILE LIMIT=100 export DEEP RESEARCH MODEL= export ENABLE INCREMENTAL UPDATE=true echo "Building frontend..." cd web-site if ! -d "node modules" ; then echo "Installing frontend dependencies..." npm install fi echo "Building frontend project..." npm run build cd .. ./KoalaWiki 证据：`start.sh`
- **Layout**（source_file）：import { HomeLayout } from 'fumadocs-ui/layouts/home'; import { baseOptions } from '@/lib/layout.shared'; ⋮---- export default function Layout 证据：`docs/app/(home)/layout.tsx`
- **Layout**（source_file）：import { source } from '@/lib/source'; import { DocsLayout } from 'fumadocs-ui/layouts/docs'; import { baseOptions } from '@/lib/layout.shared'; ⋮---- export default function Layout ⋮---- <DocsLayout tree= 证据：`docs/app/docs/layout.tsx`
- **Layout**（source_file）：import { RootProvider } from 'fumadocs-ui/provider/next'; ⋮---- import { Inter } from 'next/font/google'; import type { Metadata } from 'next'; ⋮---- export default function Layout 证据：`docs/app/layout.tsx`
- **Opendeepwiki.Entities**（source_file）：net10.0 enable enable true 证据：`src/OpenDeepWiki.Entities/OpenDeepWiki.Entities.csproj`
- **Admingithubimportendpoints**（source_file）：public static class AdminGitHubImportEndpoints ⋮---- public static RouteGroupBuilder MapAdminGitHubImportEndpoints this RouteGroupBuilder group ⋮---- var github = group.MapGroup "/github" .WithTags "Admin - GitHub Import" ; ⋮---- github.MapGet "/status", async ⋮---- var result = await service.GetStatusAsync cancellationToken ; return Results.Ok new { success = true, data = result } ; ⋮---- github.MapGet "/config", async ⋮---- var result = await service.GetGitHubConfigAsync cancellationToken ; ⋮---- github.MapPost "/config", async ⋮---- var result = await service.SaveGitHubConfigAsync request, cancellationToken ; ⋮---- return Results.BadRequest new { success = false, message = ex.Message } ;… 证据：`src/OpenDeepWiki/Endpoints/Admin/AdminGitHubImportEndpoints.cs`
- **Adminrepositoryendpoints**（source_file）：public static class AdminRepositoryEndpoints ⋮---- public static RouteGroupBuilder MapAdminRepositoryEndpoints this RouteGroupBuilder group ⋮---- var repoGroup = group.MapGroup "/repositories" .WithTags "管理端-仓库管理" ; ⋮---- repoGroup.MapGet "/", async ⋮---- var result = await repositoryService.GetRepositoriesAsync page, pageSize, search, status ; return Results.Ok new { success = true, data = result } ; ⋮---- .WithName "AdminGetRepositories" .WithSummary "获取仓库列表" ; ⋮---- repoGroup.MapGet "/{id}", async ⋮---- var result = await repositoryService.GetRepositoryByIdAsync id ; ⋮---- return Results.NotFound new { success = false, message = "仓库不存在" } ; ⋮---- .WithName "AdminGetRepository" .WithSumma… 证据：`src/OpenDeepWiki/Endpoints/Admin/AdminRepositoryEndpoints.cs`
- **Branchgenerationendpoints**（source_file）：public static class BranchGenerationEndpoints ⋮---- public static IEndpointRouteBuilder MapBranchGenerationEndpoints this IEndpointRouteBuilder app ⋮---- var repoGroup = app.MapGroup "/api/v1/repositories" .WithTags "Branch Generation" ; ⋮---- repoGroup.MapPost "/{repositoryId}/branches/{branchId}/generation-tasks/full", EnqueueFullGenerationAsync .WithName "EnqueueBranchFullGeneration" ; ⋮---- var taskGroup = app.MapGroup "/api/v1/branch-generation-tasks" .WithTags "Branch Generation Tasks" ; ⋮---- taskGroup.MapGet "/{taskId}", GetTaskAsync .WithName "GetBranchGenerationTask" ; taskGroup.MapPost "/{taskId}/retry", RetryAsync .WithName "RetryBranchGenerationTask" ; taskGroup.MapPost "/{task… 证据：`src/OpenDeepWiki/Endpoints/BranchGenerationEndpoints.cs`
- **Githubimportendpoints**（source_file）：public static class GitHubImportEndpoints ⋮---- public static IEndpointRouteBuilder MapGitHubImportEndpoints this IEndpointRouteBuilder app ⋮---- var group = app.MapGroup "/api/github" .RequireAuthorization .WithTags "GitHub Import" ; ⋮---- group.MapGet "/status", async ⋮---- var result = await service.GetStatusAsync ct ; return Results.Ok new { success = true, data = result } ; ⋮---- group.MapGet "/installations/{installationId:long}/repos", async ⋮---- var result = await service.ListInstallationReposAsync installationId, page, perPage, ct ; ⋮---- return Results.BadRequest new { success = false, message = ex.Message } ; ⋮---- group.MapPost "/import", async ⋮---- if string.IsNullOrEmpty use… 证据：`src/OpenDeepWiki/Endpoints/GitHubImportEndpoints.cs`
- **Incrementalupdateendpoints**（source_file）：public class IncrementalUpdateEndpointsLogger { } ⋮---- public static class IncrementalUpdateEndpoints ⋮---- public static IEndpointRouteBuilder MapIncrementalUpdateEndpoints this IEndpointRouteBuilder app ⋮---- var repoGroup = app.MapGroup "/api/v1/repositories" .WithTags "增量更新" ; ⋮---- repoGroup.MapPost "/{repositoryId}/branches/{branchId}/incremental-update", TriggerIncrementalUpdateAsync .WithName "TriggerIncrementalUpdate" .WithSummary "手动触发增量更新" .WithDescription "为指定仓库和分支创建一个高优先级的增量更新任务" ; ⋮---- var taskGroup = app.MapGroup "/api/v1/incremental-updates" .WithTags "增量更新任务" ; ⋮---- taskGroup.MapGet "/{taskId}", GetTaskStatusAsync .WithName "GetIncrementalUpdateTaskStatus" .WithSummary "… 证据：`src/OpenDeepWiki/Endpoints/IncrementalUpdateEndpoints.cs`
- **Repositoryuploadendpoints**（source_file）：public static class RepositoryUploadEndpoints ⋮---- public static IEndpointRouteBuilder MapRepositoryUploadEndpoints this IEndpointRouteBuilder app ⋮---- app.MapPost "/api/v1/repositories/submit-archive", SubmitArchiveAsync .WithTags "仓库" .WithName "SubmitArchiveRepository" .WithSummary "通过 ZIP 压缩包创建仓库" .DisableAntiforgery ; ⋮---- private static async Task SubmitArchiveAsync ⋮---- return Results.BadRequest new { message = "请使用 multipart/form-data 格式上传" } ; ⋮---- var form = await httpRequest.ReadFormAsync ; ⋮---- var branchName = form "branchName" .ToString ; var request = new ArchiveRepositorySubmitRequest ⋮---- OrgName = form "orgName" .ToString , RepoName = form "repoName" .ToString , Bra… 证据：`src/OpenDeepWiki/Endpoints/RepositoryUploadEndpoints.cs`
- **Program**（source_file）：Log.Logger = new LoggerConfiguration .MinimumLevel.Information .WriteTo.Console .CreateBootstrapLogger ; ⋮---- Console.WriteLine banner ; ⋮---- Log.Information "Starting OpenDeepWiki application" ; ⋮---- var builder = WebApplication.CreateBuilder args ; ⋮---- builder.AddSerilogLogging ; ⋮---- builder.Services.AddOpenApi ; builder.Services.AddMiniApis ; ⋮---- builder.Services.AddDatabase builder.Configuration ; ⋮---- .Bind builder.Configuration.GetSection "Jwt" .PostConfigure options = ⋮---- if string.IsNullOrWhiteSpace options.SecretKey ⋮---- ?? throw new InvalidOperationException "JWT密钥未配置" ; ⋮---- var jwtOptions = builder.Configuration.GetSection "Jwt" .Get ?? new JwtOptions ; ⋮---- if st… 证据：`src/OpenDeepWiki/Program.cs`
- **Repositoryprocessingworker**（source_file）：public class RepositoryProcessingWorker ⋮---- IOptions wikiOptions : BackgroundService ⋮---- private static readonly TimeSpan PollingInterval = TimeSpan.FromSeconds 30 ; private readonly WikiGeneratorOptions wikiOptions = wikiOptions.Value; ⋮---- protected override async Task ExecuteAsync CancellationToken stoppingToken ⋮---- logger.LogInformation "Repository processing worker started. Polling interval: {PollingInterval}s", ⋮---- logger.LogInformation "Repository processing worker is shutting down" ; ⋮---- logger.LogError ex, "Repository processing loop failed unexpectedly" ; ⋮---- await Task.Delay PollingInterval, stoppingToken ; ⋮---- logger.LogInformation "Repository processing worker st… 证据：`src/OpenDeepWiki/Services/Repositories/RepositoryProcessingWorker.cs`
- **Catalogstorage**（source_file）：public class CatalogStorage ⋮---- private readonly IContext context; ⋮---- private static readonly JsonSerializerOptions JsonOptions = new ⋮---- context = context ?? throw new ArgumentNullException nameof context ; branchLanguageId = branchLanguageId ?? throw new ArgumentNullException nameof branchLanguageId ; ⋮---- public async Task GetCatalogJsonAsync CancellationToken cancellationToken = default ⋮---- .Where c = c.BranchLanguageId == branchLanguageId && !c.IsDeleted .OrderBy c = c.Order .ToListAsync cancellationToken ; ⋮---- return JsonSerializer.Serialize root, JsonOptions ; ⋮---- public async Task SetCatalogAsync string catalogJson, CancellationToken cancellationToken = default ⋮---- i… 证据：`src/OpenDeepWiki/Services/Wiki/CatalogStorage.cs`
- **Iwikigenerator**（source_file）：public interface IWikiGenerator ⋮---- Task GenerateMindMapAsync ⋮---- Task GenerateCatalogAsync ⋮---- Task GenerateDocumentsAsync ⋮---- Task RegenerateDocumentAsync ⋮---- Task IncrementalUpdateAsync ⋮---- Task TranslateWikiAsync 证据：`src/OpenDeepWiki/Services/Wiki/IWikiGenerator.cs`
- **Wikigenerator**（source_file）：public class TokenUsageStats ⋮---- public void Add int inputTokens, int outputTokens, int toolCalls = 0 ⋮---- public void Reset ⋮---- public override string ToString ⋮---- public class WikiGenerator : IWikiGenerator ⋮---- private static readonly Regex ThinkTagRegex = new ⋮---- TimeSpan.FromSeconds 1 ; ⋮---- private readonly AgentFactory agentFactory; private readonly IPromptPlugin promptPlugin; ⋮---- private readonly IContext context; private readonly IContextFactory contextFactory; ⋮---- private readonly IProcessingLogService processingLogService; private readonly ISkillToolConverter skillToolConverter; private readonly IAiProviderResolver aiProviderResolver; private readonly IRepositorySc… 证据：`src/OpenDeepWiki/Services/Wiki/WikiGenerator.cs`
- **Wikigeneratoroptions**（source_file）：public class WikiGeneratorOptions ⋮---- public List GetTranslationLanguages string primaryLanguage ⋮---- if string.IsNullOrWhiteSpace Languages ⋮---- .Split ',', StringSplitOptions.RemoveEmptyEntries StringSplitOptions.TrimEntries .Select l = l.ToLowerInvariant .Where l = !string.Equals l, primaryLanguage, StringComparison.OrdinalIgnoreCase .Distinct .ToList ; ⋮---- public string GetTranslationModel ⋮---- return string.IsNullOrWhiteSpace TranslationModel ? ContentModel : TranslationModel; 证据：`src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs`
- **Wikipromptcachekeybuilder**（source_file）：public static class WikiPromptCacheKeyBuilder ⋮---- public static string Build ⋮---- ArgumentNullException.ThrowIfNull ai ; ArgumentNullException.ThrowIfNull executionContext ; ⋮---- return string.Join ⋮---- public static string BuildToolsetHash IEnumerable ? tools ⋮---- .OrderBy tool = tool.Name, StringComparer.Ordinal .ThenBy tool = tool.Description, StringComparer.Ordinal .Select tool = tool is AIFunctionDeclaration function ? $"{function.Name}\u001f{function.Description}\u001f{function.JsonSchema.GetRawText }" ⋮---- var payload = string.Join '\n', entries ; ⋮---- private static string NormalizeSegment string? value ⋮---- if string.IsNullOrWhiteSpace value ⋮---- var normalized = new Stri… 证据：`src/OpenDeepWiki/Services/Wiki/WikiPromptCacheKeyBuilder.cs`
- **Layout**（source_file）：import type { ReactNode } from "react"; ⋮---- export default function MainLayout 证据：`web/app/(main)/layout.tsx`
- **Layout**（source_file）：import React from "react"; import type { Metadata } from "next"; import { fetchRepoTree, fetchRepoBranches, checkGitHubRepo, fetchProcessingLogs } from "@/lib/repository-api"; import { RepoShell } from "@/components/repo/repo-shell"; import { RepositoryProcessingStatus } from "@/components/repo/repository-processing-status"; import { RepositoryNotFound } from "@/components/repo/repository-not-found"; import { decodeRouteSegment } from "@/lib/repo-route"; import { indexableMetadata, noIndexMetadata, repoCanonicalPath, repoTitle, SITE DESCRIPTION } from "@/lib/repo-seo"; import RouteProviders from "@/app/route-providers"; ⋮---- interface RepoLayoutProps { children: React.ReactNode; params: Pr… 证据：`web/app/[owner]/[repo]/layout.tsx`
- **Layout**（source_file）：import type { ReactNode } from "react"; ⋮---- export default function OwnerLayout 证据：`web/app/[owner]/layout.tsx`
- **Layout**（source_file）：import type { ReactNode } from "react"; import AdminLayoutClient from "./admin-layout-client"; ⋮---- export default function AdminLayout { children, }: { children: ReactNode; } 证据：`web/app/admin/layout.tsx`
- **Layout**（source_file）：import type { ReactNode } from "react"; ⋮---- export default function AuthLayout 证据：`web/app/auth/layout.tsx`
- **Layout**（source_file）：import type { Metadata } from "next"; import { getLocale } from "next-intl/server"; import RouteProviders from "@/app/route-providers"; import { getSiteUrl, SITE DESCRIPTION, SITE NAME } from "@/lib/repo-seo"; ⋮---- export default async function RootLayout { children, }: Readonly 证据：`web/app/layout.tsx`
- **Layout**（source_file）：import type { Metadata } from "next" ⋮---- export default function ShareLayout 证据：`web/app/share/[shareId]/layout.tsx`
- **App Layout**（source_file）：import React from "react"; import { AppSidebar } from "@/app/sidebar"; import { SidebarInset, SidebarProvider } from "@/components/animate-ui/components/radix/sidebar"; import { Header } from "@/components/header"; import { useTranslations } from "@/hooks/use-translations"; ⋮---- interface HeaderSearchBoxProps { value: string; onChange: value: string = void; visible: boolean; } ⋮---- interface AppLayoutProps { children: React.ReactNode; activeItem?: string; onItemClick?: item: string = void; searchBox?: HeaderSearchBoxProps; } ⋮---- export function AppLayout 证据：`web/components/app-layout.tsx`
- **Changelog**（documentation）：Added - Added AI billing and token usage accounting across chat, document tools, and admin statistics. - Added AI provider preset loading and expanded admin controls for AI providers and model configs. 证据：`CHANGELOG.md`
- **Design Document**（documentation）：High-level description of the feature and its place in the overall system 证据：`.spec-workflow/templates/design-template.md`
- **Product Overview**（documentation）：Product Purpose Describe the core purpose of this product/project. What problem does it solve? 证据：`.spec-workflow/templates/product-template.md`
- **Requirements Document**（documentation）：Provide a brief overview of the feature, its purpose, and its value to users 证据：`.spec-workflow/templates/requirements-template.md`
- **Project Structure**（documentation）：Define your project's directory structure. Examples below - adapt to your project type 证据：`.spec-workflow/templates/structure-template.md`
- **Tasks Document**（documentation）：- 1. Create core interfaces in src/types/feature.ts - File: src/types/feature.ts - Define TypeScript interfaces for feature data structures - Extend existing base interfaces from base.ts - Purpose: Establish type safety for feature implementation - Leverage: src/types/base.ts - Requirements: 1.1 - Prompt: Role: TypeScript Developer specializing in type systems and interfaces Task: Create comprehensive TypeScript interfaces for the feature data structures following requirements 1.1, extending existing base interfaces from src/types/base.ts Restrictions: Do not modify existing base interfaces, maintain backward compatibility, follow project naming conventions Success: All interfaces compile w… 证据：`.spec-workflow/templates/tasks-template.md`
- **Technology Stack**（documentation）：Project Type Describe what kind of project this is: web application, CLI tool, desktop application, mobile app, library, API service, embedded system, game, etc. 证据：`.spec-workflow/templates/tech-template.md`
- **Wiki Catalog Generator**（documentation）：You are a senior code repository analyst and information architect. Your task is to generate a DeepWiki-style documentation catalog that helps readers understand the repository as a source-backed knowledge base. 证据：`src/OpenDeepWiki/prompts/catalog-generator.md`
- **System Constraints CRITICAL - READ FIRST**（documentation）：System Constraints CRITICAL - READ FIRST 证据：`src/OpenDeepWiki/prompts/content-generator.md`
- **Wiki Incremental Updater**（documentation）：⚠️ System Constraints CRITICAL - READ FIRST 证据：`src/OpenDeepWiki/prompts/incremental-updater.md`
- **Project Architecture Mind Map Generator**（documentation）：Project Architecture Mind Map Generator 证据：`src/OpenDeepWiki/prompts/mindmap-generator.md`
- **Settings.Local**（structured_config）：{ "permissions": { "allow": "Bash find: ", "Read //d/code/ ", "Bash cat: ", "Bash done ", "Bash findstr: ", "Bash dir /s /b: ", "Bash where /r \"C:\\\\Users\\\\Administrator\\\\RiderProjects\\\\MarkAgents\\\\OpenDeepWiki\\\\web-site\\\\src\" Dialog .tsx: ", "Bash dir: ", "Bash powershell -Command: ", "Bash tree /F \"web-site\\\\src\\\\i18n\": ", "Bash python3: ", "Bash python: ", "Bash node check-i18n.js: ", "Bash git add: ", "Bash git commit: ", "Bash docker-compose build: ", "Bash git push: ", "Bash bash: ", "mcp MCP DOCKER code-mode", "Bash List files in repo root ", "Bash rg: ", "Bash cd: ", "Bash dotnet build: ", "Bash npx next: ", "Bash docker compose: " , "deny": , "ask": } } 证据：`.claude/settings.local.json`
- **Tsconfig**（structured_config）：{ "compilerOptions": { "target": "ES2017", "lib": "dom", "dom.iterable", "esnext" , "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", "incremental": true, "plugins": { "name": "next" } , "paths": { "@/ ": "./ " , "fumadocs-mdx:collections/ ": "./.source/ " } }, "include": "next-env.d.ts", " / .ts", " / .tsx", ".next/types/ / .ts", ".next/dev/types/ / .ts", " / .mts" , "exclude": "node modules" } 证据：`docs/tsconfig.json`
- **Components**（structured_config）：{ "$schema": "https://ui.shadcn.com/schema.json", "style": "new-york", "rsc": true, "tsx": true, "tailwind": { "config": "", "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "iconLibrary": "lucide", "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "registries": { "@animate-ui": "https://animate-ui.com/r/{name}.json" } } 证据：`web/components.json`
- **Tsconfig**（structured_config）：{ "compilerOptions": { "target": "ES2017", "lib": "dom", "dom.iterable", "esnext" , "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", "incremental": true, "plugins": { "name": "next" } , "paths": { "@/ ": "./ " } }, "include": "next-env.d.ts", " / .ts", " / .tsx", ".next/types/ / .ts", ".next/dev/types/ / .ts", " / .mts" , "exclude": "node modules" } 证据：`web/tsconfig.json`
- 其余 19 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `web/README.md`, `.spec-workflow/user-templates/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `web/README.md`, `.spec-workflow/user-templates/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, README.zh-CN.md, OpenDeepWiki.sln, src/OpenDeepWiki/Program.cs, src/OpenDeepWiki/GlobalUsing.cs
- **Wiki 生成流水线与 AI 集成**：importance `high`
  - source_paths: src/OpenDeepWiki/Services/Wiki/WikiGenerator.cs, src/OpenDeepWiki/Services/Wiki/IWikiGenerator.cs, src/OpenDeepWiki/Services/Wiki/CatalogStorage.cs, src/OpenDeepWiki/Services/Wiki/WikiGeneratorOptions.cs, src/OpenDeepWiki/Services/Wiki/WikiPromptCacheKeyBuilder.cs
- **仓库导入、分支与多语言管理**：importance `high`
  - source_paths: src/OpenDeepWiki/Endpoints/RepositoryUploadEndpoints.cs, src/OpenDeepWiki/Endpoints/BranchGenerationEndpoints.cs, src/OpenDeepWiki/Endpoints/IncrementalUpdateEndpoints.cs, src/OpenDeepWiki/Endpoints/Admin/AdminRepositoryEndpoints.cs, src/OpenDeepWiki/Endpoints/Admin/AdminGitHubImportEndpoints.cs
- **部署、运维与常见故障排查**：importance `high`
  - source_paths: compose.yaml, compose.pgsql.yaml, .env.example, Makefile, build.ps1

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `bb4cc0f3bc051827686e69647160c1d5721d8496`
- inspected_files: `README.md`, `docs/.source/browser.ts`, `docs/.source/dynamic.ts`, `docs/.source/server.ts`, `docs/content/docs/api-reference/admin.mdx`, `docs/content/docs/api-reference/auth.mdx`, `docs/content/docs/api-reference/chat.mdx`, `docs/content/docs/api-reference/incremental-updates.mdx`, `docs/content/docs/api-reference/meta.json`, `docs/content/docs/api-reference/repositories.mdx`, `docs/content/docs/architecture/backend.mdx`, `docs/content/docs/architecture/data-models.mdx`, `docs/content/docs/architecture/frontend.mdx`, `docs/content/docs/architecture/index.mdx`, `docs/content/docs/configuration/environment-variables.mdx`, `docs/content/docs/configuration/meta.json`, `docs/content/docs/deployment/ai-providers.mdx`, `docs/content/docs/deployment/database.mdx`, `docs/content/docs/deployment/docker-compose.mdx`, `docs/content/docs/deployment/meta.json`

宿主 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: 来源证据：Please add support for the Vietnamese language.

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Please add support for the Vietnamese language.
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/AIDotNet/OpenDeepWiki/issues/370 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 能力证据存在缺口

- Trigger: Sandbox install result is missing.
- Host AI rule: 优先补证或在页面明确标记为未验证。
- Why it matters: 缺口未补前，Doramagic 不能把该能力当作可靠推荐卖点。
- Evidence: evidence.evidence_gaps | https://github.com/AIDotNet/OpenDeepWiki | Sandbox install result is missing.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 沙箱验证已有失败原因

- Trigger: llm_blocked_sandbox_execution
- Why it matters: 失败原因未处理前，不应向用户暗示项目可顺利运行。
- Evidence: sandbox_validation_results | planner_decision=llm_blocked; planner_reason=docker compose up -d is not in the deterministic allowlist and is not a single-package pip/npm/npx/uvx install, so it cannot be selected under the isolated_install policy.; failure=llm_blocked_sandbox_execution
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：[Proposal] Upstream generic features from a self-hosted fork (Forgejo, MCP auth, i18n, OAuth…) / 回馈通用功能提案

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Proposal] Upstream generic features from a self-hosted fork (Forgejo, MCP auth, i18n, OAuth…) / 回馈通用功能提案
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/AIDotNet/OpenDeepWiki/issues/371 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 依赖 Docker 环境

- Trigger: 安装/运行入口包含 Docker 命令：docker compose up -d
- Host AI rule: 标注 Docker 前置条件，并提供非 Docker 路径或失败提示。
- Why it matters: 非工程用户可能没有 Docker，启动成本明显增加。
- Evidence: identity.distribution | https://github.com/AIDotNet/OpenDeepWiki | docker compose up -d
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 安装命令尚未沙箱验证

- Trigger: 当前 install_status=documented，还只是文档/元数据线索。
- Host AI rule: 在隔离环境执行最小安装路径，记录失败原因和修复步骤。
- Why it matters: 命令可能缺步骤、过期或依赖本地环境，不能直接作为用户承诺。
- Evidence: downstream_validation.install_status | https://github.com/AIDotNet/OpenDeepWiki | install_status=documented; command=docker compose up -d
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 来源证据：【bug】如果导入了一个分支，则无法再次导入其他分支代码

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：【bug】如果导入了一个分支，则无法再次导入其他分支代码
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/AIDotNet/OpenDeepWiki/issues/353 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 来源证据：bad_response_status_code 最新代码调用本地llm模型api报错 Can only get item pairs from a mapping

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：bad_response_status_code 最新代码调用本地llm模型api报错 Can only get item pairs from a mapping
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/AIDotNet/OpenDeepWiki/issues/307 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

### Constraint 10: Quick Start 尚未实际跑通

- Trigger: quickstart_status=not_attempted。
- Host AI rule: 执行最小 repro plan，记录命令、输入样例、输出样例和失败原因。
- Why it matters: 用户只能看到安装线索，不能确信 10 分钟内能形成最小可试路径。
- Evidence: downstream_validation.quickstart_status | https://github.com/AIDotNet/OpenDeepWiki | quickstart_status=not_attempted; sandbox_quickstart_status=blocked
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
