# agentloom - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 agentloom 编译的 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_0003` supported 0.86
- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`agentloom-framework-skill/SKILL.md`, `applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`, `applications/repo_map/skills/repo_map_guide/SKILL.md`, `skills/agent-recall-with-files/SKILL.md` 等 Claim：`clm_0004` supported 0.86

## 它能做什么

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

## 怎么开始

- `git clone <repo-url> AgentLoom` 证据：`README.md` Claim：`clm_0005` supported 0.86

## 继续前判断卡

- **当前建议**：先做权限沙盒试用
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：先做权限沙盒试用
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`agentloom-framework-skill/SKILL.md`, `applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`, `applications/repo_map/skills/repo_map_guide/SKILL.md`, `skills/agent-recall-with-files/SKILL.md` 等 Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`agentloom-framework-skill/SKILL.md`, `applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`, `applications/repo_map/skills/repo_map_guide/SKILL.md`, `applications/test_demo/skills/test1_skill/skill.md` 等 Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0005` supported 0.86

### 现在还不能相信

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

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`agentloom-framework-skill/SKILL.md`, `applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`, `applications/repo_map/skills/repo_map_guide/SKILL.md`, `applications/test_demo/skills/test1_skill/skill.md` 等
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

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

## 哪些必须安装后验证

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

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0006` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0007` 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 体验。 证据：`agentloom-framework-skill/SKILL.md`, `applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`, `applications/repo_map/skills/repo_map_guide/SKILL.md`, `applications/test_demo/skills/test1_skill/skill.md` 等 Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **agentloom-framework-skill**（skill）：当用户需要理解、开发、扩展或验证 AgentLoom 框架能力时使用。覆盖创建/扩展 Application、设计单 Agent 或多 Agent、编写 Agent/Worker YAML、实现 Tool、创建私有 Skill 或 Hook、更新 README、验证 YAML/结构/运行结果。也适用于用户问“这个功能用 AgentLoom 怎么实现”。 激活提示：当用户任务与“agentloom-framework-skill”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`agentloom-framework-skill/SKILL.md`
- **browser-harness-agentloom**（skill）：Use when working on AgentLoom browser-harness integration or debugging applications/browser harness probe: creating or updating the probe Application, installing the external browser-harness CLI, validating isolated or real Chrome browser control, and diagnosing browser-harness doctor, daemon, Chrome remote debugging, config/llm.yaml, or AgentLoom tool-registration issues. 激活提示：当用户任务与“browser-harness-agentloom”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`
- **repo_map_guide**（skill）：Guide for generating and using AI-readable code maps 激活提示：当用户任务与“repo_map_guide”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`applications/repo_map/skills/repo_map_guide/SKILL.md`
- **hooks-skill**（skill）：hooks test relative path 激活提示：当用户任务与“hooks-skill”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`applications/test_demo/skills/test1_skill/skill.md`
- **hooks-skill-2**（skill）：hooks test relative path 激活提示：当用户任务与“hooks-skill-2”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`applications/test_demo/skills/test2_skill/skill.md`
- **agent-recall-with-files**（skill）：Cross-session experience recall via file-based memory. Agents accumulate insights pitfalls, decisions, facts that persist across runs, plus ephemeral context and trace files for the current task. 激活提示：当用户任务与“agent-recall-with-files”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/agent-recall-with-files/SKILL.md`
- **agent-visualization**（skill）：Passive observer. Auto-collects agent lifecycle events into visualization.json. Invisible to AI. 激活提示：当用户任务与“agent-visualization”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/agent-visualization/SKILL.md`

## 证据索引

- 共索引 80 条证据。

- **3 分钟快速开始**（documentation）：通过 YAML 构建 multi-agent 应用，为不同子 Agent 选择合适模型，加载 Skills / MCP / 工具，并发处理重复任务，并从保存的状态恢复长任务。 证据：`docs/cn/README.md`
- **3-Minute Quick Start**（documentation）：Application-level framework for building multi-agent systems from YAML. 证据：`README.md`
- **Browser Harness Probe**（documentation）：验证 AgentLoom 能否通过普通 Python Tool 调用外部 browser-harness CLI 控制浏览器。 证据：`applications/browser_harness_probe/README.md`
- **Codex Exec Demo**（documentation）：This application demonstrates that AgentLoom can call local codex exec directly as normal function tools. The framework LLM does not need a custom Python entrypoint or special system config; it only sees registered tools. 证据：`applications/codex_exec_demo/README.md`
- **ContextEngine JSON Retrieve Validation**（documentation）：ContextEngine JSON Retrieve Validation 证据：`applications/context_engine_json_retrieve_validation/README.md`
- **ContextEngine Multi-Worker Validation**（documentation）：ContextEngine Multi-Worker Validation 证据：`applications/context_engine_multi_worker_validation/README.md`
- **ContextEngine Text Retrieve Validation**（documentation）：ContextEngine Text Retrieve Validation 证据：`applications/context_engine_text_retrieve_validation/README.md`
- **Repo Map — AI 驱动的代码仓库架构地图**（documentation）：Repo Map 是 AgentLoom 中的代码仓库架构分析应用，面向陌生仓库、大型仓库和长期演进项目的快速理解场景。它解决的核心问题是：开发者或 AI 编程助手在修改代码前，如何快速知道“这个仓库有哪些模块、关键入口在哪里、依赖关系怎么流动、架构意图是什么”。 证据：`applications/repo_map/README.md`
- **Readme**（documentation）：These scm files are all adapted from the github repositories listed here: 证据：`applications/repo_map/agent_tools/queries/tree-sitter-language-pack/README.md`
- **Credits**（documentation）：Aider uses modified versions of the tags.scm files from these open source tree-sitter language implementations: 证据：`applications/repo_map/agent_tools/queries/tree-sitter-languages/README.md`
- **Tool Registry Core Validation**（documentation）：Small real-LLM validation app for the AgentLoom core toolsets. 证据：`applications/tool_registry_core_validation/README.md`
- **Tool Registry Markdown Validation**（documentation）：Small real-LLM validation app for the non-default markdown report toolset. 证据：`applications/tool_registry_markdown_validation/README.md`
- **Readme**（documentation）：These scm files are all adapted from the github repositories listed here: 证据：`src/tools/queries/queries/tree-sitter-language-pack/README.md`
- **Credits**（documentation）：Aider uses modified versions of the tags.scm files from these open source tree-sitter language implementations: 证据：`src/tools/queries/queries/tree-sitter-languages/README.md`
- **Readme**（documentation）：These scm files are all adapted from the github repositories listed here: 证据：`src/tools/queries/tree-sitter-language-pack/README.md`
- **Credits**（documentation）：Aider uses modified versions of the tags.scm files from these open source tree-sitter language implementations: 证据：`src/tools/queries/tree-sitter-languages/README.md`
- **AST-Grep Language Rules Configuration**（documentation）：AST-Grep Language Rules Configuration 证据：`src/tools/search/ast_grep_tool/grep_config/README.md`
- **AgentLoom Framework Skill**（skill_instruction）：本 Skill 是 AgentLoom 仓库的框架级入口，封装开发 AgentLoom 应用和扩展框架能力所需的上下文。一个入口 Skill 负责路由，细节放到按需 reference；不要把规则拆回多个互相竞争的 Skill。 证据：`agentloom-framework-skill/SKILL.md`
- **Browser Harness AgentLoom**（skill_instruction）：Keep browser-harness as an external editable CLI. Do not add it to AgentLoom pyproject.toml or uv.lock . 证据：`applications/browser_harness_probe/skills/browser-harness-agentloom/SKILL.md`
- **Repo Map 生成指南**（skill_instruction）：Repo Map 是一个代码地图生成系统，参考 Aider 的 RepoMap 实现， 将任意代码项目扫描后生成 AI 可读的 Markdown 文件目录结构。 证据：`applications/repo_map/skills/repo_map_guide/SKILL.md`
- **Agent Recall With Files**（skill_instruction）：File-based memory that lets agents recall experience from previous sessions. 证据：`skills/agent-recall-with-files/SKILL.md`
- **Skill**（skill_instruction）：--- name: agent-visualization description: "Passive observer. Auto-collects agent lifecycle events into visualization.json. Invisible to AI." version: "1.0.0" hooks: TaskCreated: - hooks: - type: command command: python ./scripts/on task start.py TaskCompleted: - hooks: - type: command command: python ./scripts/on task complete.py StopFailure: - hooks: - type: command command: python ./scripts/on task fail.py SubagentStart: - matcher: " " hooks: - type: command command: python ./scripts/on subtask start.py SubagentStop: - matcher: " " hooks: - type: command command: python ./scripts/on subtask finish.py PreToolUse: - matcher: " " hooks: - type: command command: python ./scripts/on pre tool… 证据：`skills/agent-visualization/SKILL.md`
- **Body**（skill_instruction）：--- name: hooks-skill description: hooks test relative path hooks: PreToolUse: - matcher: "Write" hooks: - type: command command: python ./scripts/pre tool hook.py PostToolUse: - matcher: " " hooks: - type: command command: python ./scripts/post tool hook.py Stop: - matcher: " " hooks: - type: command command: python ./scripts/stop hook.py --- Body 证据：`applications/test_demo/skills/test1_skill/skill.md`
- **Body**（skill_instruction）：--- name: hooks-skill-2 description: hooks test relative path hooks: PreToolUse: - matcher: "Write" hooks: - type: command command: python ./scripts/pre tool hook.py PostToolUse: - matcher: " " hooks: - type: command command: python ./scripts/post tool hook.py Stop: - matcher: " " hooks: - type: command command: python ./scripts/stop hook.py --- Body 证据：`applications/test_demo/skills/test2_skill/skill.md`
- **AgentLoom Agent YAML 配置完整参考**（documentation）：文档定位 ：本文档详细说明 Agent YAML 的 每一个 配置参数。 关于配置文件之间的覆盖关系，请参阅 配置体系总览 config-overview.md 。 关于 config/system.yaml ，请参阅 系统配置文档 system config.md 。 关于 config/llm.yaml ，请参阅 LLM 配置文档 llm config.md 。 证据：`docs/cn/agent_config.md`
- **断点续跑与会话恢复**（documentation）：AgentLoom 支持多 Agent 任务的 断点续跑 （Checkpoint & Resume）能力。当长时间运行的任务被中断（用户 Ctrl-C、进程崩溃、机器重启等）时，可以从上次中断处继续执行，而无需从头开始。 证据：`docs/cn/checkpoint.md`
- **AgentLoom 配置体系总览**（documentation）：本文档介绍 AgentLoom 框架的配置体系架构，包括配置文件的分类、加载层级、覆盖机制以及 LLM 配置的独立性。 证据：`docs/cn/config-overview.md`
- **Hooks 系统**（documentation）：Hooks 是 AgentLoom 的生命周期拦截系统，允许在 Agent 执行的关键节点（工具调用、任务启停、会话管理等）注入自定义逻辑。 证据：`docs/cn/hooks.md`
- **AgentLoom LLM 模型配置 llm.yaml 完整参考**（documentation）：文档定位 ：本文档详细说明 config/llm.yaml 的 每一个 配置参数。 关于配置文件之间的覆盖关系，请参阅 配置体系总览 config-overview.md 。 关于全局系统配置，请参阅 系统配置文档 system config.md 。 关于 Agent YAML 参数，请参阅 Agent 配置文档 agent config.md 。 证据：`docs/cn/llm_config.md`
- **MCP Model Context Protocol 客户端配置**（documentation）：AgentLoom 支持作为 MCP Client 连接外部 MCP Server，动态发现并加载工具。配置格式采用标准 .mcp.json 格式。 证据：`docs/cn/mcp_config.md`
- **Skills 配置**（documentation）：AgentLoom Skill 使用 Claude Code 风格包结构： 证据：`docs/cn/skills_config.md`
- **AgentLoom 系统全局配置 system.yaml 完整参考**（documentation）：文档定位 ：本文档详细说明 config/system.yaml 的 每一个 配置参数。 关于配置文件之间的覆盖关系，请参阅 配置体系总览 config-overview.md 。 关于 LLM 模型参数，请参阅 LLM 配置文档 llm config.md 。 关于 Agent YAML 参数，请参阅 Agent 配置文档 agent config.md 。 证据：`docs/cn/system_config.md`
- **AgentLoom Agent YAML Configuration Complete Reference**（documentation）：AgentLoom Agent YAML Configuration Complete Reference 证据：`docs/en/agent_config.md`
- **Checkpoint & Resume**（documentation）：AgentLoom supports Checkpoint & Resume for multi-Agent tasks. When a long-running task is interrupted user Ctrl-C, process crash, machine restart, etc. , it can continue from where it left off without starting over. 证据：`docs/en/checkpoint.md`
- **AgentLoom Configuration System Overview**（documentation）：AgentLoom Configuration System Overview 证据：`docs/en/config-overview.md`
- **Hooks System**（documentation）：Hooks is AgentLoom's lifecycle interception system, allowing custom logic to be injected at key points during Agent execution tool calls, task start/stop, session management, etc. . 证据：`docs/en/hooks.md`
- **AgentLoom LLM Model Configuration llm.yaml Complete Reference**（documentation）：AgentLoom LLM Model Configuration llm.yaml Complete Reference 证据：`docs/en/llm_config.md`
- **Skills Configuration**（documentation）：AgentLoom skills use Claude Code style packages: 证据：`docs/en/skills_config.md`
- **AgentLoom System Global Configuration system.yaml Complete Reference**（documentation）：AgentLoom System Global Configuration system.yaml Complete Reference 证据：`docs/en/system_config.md`
- **.Mcp.Json**（source_file）：{ "mcpServers": { "filesystem": { "type": "stdio", "command": "npx", "args": "-y", "@modelcontextprotocol/server-filesystem", "/workspace" , "env": { "NODE ENV": "production" } }, "database": { "type": "stdio", "command": "python", "args": "-m", "mcp server sqlite", "--db", "data.db" }, "web-search": { "type": "sse", "url": "http://localhost:8080/mcp", "headers": { "Authorization": "Bearer YOUR TOKEN HERE" } }, "remote-api": { "type": "http", "url": "https://api.example.com/mcp" } } } 证据：`config/.mcp.json.example`
- **Llm.Example**（source_file）：model: default model type: powerful powerful: base url: "xxxxxxx" api key: "xxxxxxx" model: "openai/gpt-5 5" temperature: 0.2 max tokens: 128000 timeout: 300 requests per minute: 10 context cache: true extra body: thinking: type: "enabled" fast: base url: "xxxxxxx" api key: "xxxxxxx" model: "gemini/gemini-3 1-pro-preview" temperature: 1.0 max tokens: 50000 timeout: 300 context cache: true summary: base url: "xxxxxxx" api key: "xxxxxxx" model: "openai/gpt-5 5" temperature: 0.2 max tokens: 128000 timeout: 300 requests per minute: 10 context cache: true 证据：`config/llm.example.yaml`
- **System**（source_file）：system: name: "AgentLoom" version: "1.0.1" user agent: "AgentLoom/1.0.1" smart summary: false context engine: min chars: 2000 preview max chars: 3000 skills: - path: "skills/agent-visualization" invocation-control: allow-model: false allow-hook: true lsp servers: enabled: true max restarts: 3 servers: - python - go - typescript execution env: type: "local" code agent: additional authorized imports: " " additional functions: " " logging: enabled: true level: "INFO" file path: null dir: ".logs" tool access control: path validation: - tools: - "shell tool" - "read file" - "edit file" - "write file" - "list directory" - "grep search" - "glob search" - "write markdown file" - "write markdown fil… 证据：`config/system.yaml`
- **System**（source_file）：tool access control: path validation: - tools: - "read file" - "edit file" - "write file" - "list directory" - "write markdown file" - "write markdown file raw" - "append markdown sections" - "get file outline" - "glob search" - "grep search" exclude paths: "Tools", "Test", ".git" 证据：`applications/ai_quality_analysis/config/system.yaml`
- **System**（source_file）：skills: 证据：`applications/browser_harness_probe/config/system.yaml`
- **System**（source_file）：skills: default toolsets: - context context engine: enabled: true min chars: 1000 preview max chars: 600 store: max entries: 1000 ttl seconds: null tool metadata: make context engine json payload: max result chars: null 证据：`applications/context_engine_json_retrieve_validation/config/system.yaml`
- **System**（source_file）：skills: default toolsets: - context context engine: enabled: true min chars: 1000 preview max chars: 550 store: max entries: 1000 ttl seconds: null tool metadata: make context engine log payload: max result chars: null make context engine search payload: max result chars: null 证据：`applications/context_engine_multi_worker_validation/config/system.yaml`
- **System**（source_file）：skills: default toolsets: - context context engine: enabled: true min chars: 1000 preview max chars: 500 store: max entries: 1000 ttl seconds: null tool metadata: make context engine text payload: max result chars: null 证据：`applications/context_engine_text_retrieve_validation/config/system.yaml`
- **2. output dir**（source_file）：project root = os.path.dirname os.path.dirname os.path.dirname os.path.abspath file ⋮---- proj = Path project path .resolve ⋮---- 2. output dir out = Path output dir .resolve if output dir else proj / ".repo map" ⋮---- 3. skill output dir Deprecated: the generated Skill now lives under / -repo-map so repo map docs and incremental state are not duplicated into an external skills directory. Keep the argument accepted for old command lines. skill out = Path skill output dir .resolve if skill output dir else None 4. exclude dirs cleaned: list str = ⋮---- d = raw.strip ⋮---- p = Path d ⋮---- full = proj / d ⋮---- --------------------------------------------------------------------------- Entry p… 证据：`applications/repo_map/repo_map_app.py`
- **Repo Map Agent**（source_file）：name: "repo map agent" description: Repo Map 架构分析 Supervisor。 扫描和 Markdown 生成已由 repo map app.py 直接完成（纯 Python，零 LLM）。 本 Agent 负责： 1 运行目录级 LLM 架构分析 2 组装 repo map Skill 元数据（确定性文件准备） 3 确定性写入 SKILL.md 与示例 4 校验 skill 完整性并输出总结 model type: "powerful" tool call type: "tool call" workflow: 你是 Repo Map 架构分析监督智能体。你需要按顺序调用工具来完成架构分析和 Skill 文档生成。 工具 调用方式 作用 ------ --------- ------ run analysis loop run analysis loop output dir=... 逐目录调用 dir architecture analysis 子 Agent 进行 LLM 架构分析 prepare repo map skill workspace prepare repo map skill workspace output dir=... 在 / -repo-map 内生成 references/scripts/assets/agents write repo map skill files write repo map skill files output dir=... 根据 context 确定性写入 SKILL.md… 证据：`applications/repo_map/workflows/repo_map_agent.yaml`
- **Config**（source_file）：SYSTEM CONFIG NAME = "system.yaml" LLM CONFIG NAME = "llm.yaml" APP CONFIG RELATIVE PATH = Path "config" / SYSTEM CONFIG NAME PROJECT NAME = "AgentLoom" WORKFLOW OVERLAY KEYS = { LLM ONLY TOP LEVEL KEYS = {"model", "llm", "langfuse"} logger = get logger name def load yaml path: Path - dict str, Any ⋮---- loaded = yaml.safe load f or {} ⋮---- filtered: dict str, Any = {} ⋮---- def is agentloom project pyproject path: Path - bool ⋮---- """Return True if pyproject path declares project.name == PROJECT NAME .""" ⋮---- import tomllib Python 3.11+ except ModuleNotFoundError: pragma: no cover import tomli as tomllib type: ignore no-redef ⋮---- data = tomllib.load f ⋮---- def discover agent root co… 证据：`src/lib/config/config.py`
- **Config Validation**（source_file）：class BoolParser ⋮---- TRUTHY STRINGS = frozenset {"true", "yes", "1", "on", "y"} FALSY STRINGS = frozenset {"false", "no", "0", "off", "n", ""} ⋮---- normalised = value.strip .lower ⋮---- log = get logger logger, name ⋮---- class IntParser ⋮---- val str = value.strip ⋮---- class FloatParser class EnumParser ⋮---- normalized = value.strip ⋮---- normalized = normalized.upper ⋮---- class LogLevelParser ⋮---- OFF LEVEL = logging.CRITICAL + 10 ⋮---- normalized = value.strip .upper ⋮---- class SystemSettings BaseModel ⋮---- model config = ConfigDict extra="allow" name: str = "AgentLoom" version: str = "1.0.1" user agent: str = "AgentLoom/1.0.1" class PathValidationRule BaseModel ⋮---- tools: lis… 证据：`src/lib/config/config_validation.py`
- **Layered Builder**（source_file）：@dataclass frozen=True class OverlaySpec ⋮---- name: str data: Mapping str, Any class LayeredConfigBuilder ⋮---- @staticmethod def deep merge base: dict str, Any , overlay: Mapping str, Any - None def apply overlay self, overlay: OverlaySpec - "LayeredConfigBuilder" ⋮---- overlay data = dict overlay.data ⋮---- def apply mapping self, name: str, data: Mapping str, Any None - "LayeredConfigBuilder" def build self - dict str, Any ⋮---- @property def applied layers self - tuple OverlaySpec, ... 证据：`src/lib/config/layered_builder.py`
- **Extra parameters passed through to litellm.completion e.g. reasoning effort,**（source_file）：RESERVED MODEL KEYS = {"default model type", "common"} def available types text models: Dict str, Any - str ⋮---- available = list models.keys ⋮---- def missing default model type error models: Dict str, Any - str def unknown model type error model type: Any, models: Dict str, Any - str def missing default target error default type: str, models: Dict str, Any - str class LangfuseSettings BaseModel ⋮---- model config = ConfigDict extra="allow", frozen=True enabled: bool = True host: str = "https://cloud.langfuse.com" public key: str = "" private key: str = "" secret key: str = "" ⋮---- @model validator mode="before" @classmethod def resolve private key cls, values: dict - dict ⋮---- pk = val… 证据：`src/lib/config/llm_config.py`
- **Config**（source_file）：def default skip tools - tuple str, ... ⋮---- destructive file tools = tuple ⋮---- @dataclass frozen=True class ContextStoreConfig ⋮---- max entries: int = 1000 ttl seconds: int None = None ⋮---- @dataclass frozen=True class ContextSafetyConfig ⋮---- skip roles: tuple str, ... = "user", "system" skip tools: tuple str, ... = field default factory= default skip tools preserve recent errors: int = 1 ⋮---- @dataclass frozen=True class ContextEngineConfig ⋮---- min chars: int = 2000 preview max chars: int = 3000 store: ContextStoreConfig = field default factory=ContextStoreConfig safety: ContextSafetyConfig = field default factory=ContextSafetyConfig ⋮---- @classmethod def from mapping cls, raw:… 证据：`src/lib/context_engine/config.py`
- **Has a file extension — resolve in worker agents folder.**（source_file）：@dataclass class NormalizedAgentConfig ⋮---- agent function schema: Optional dict = None ALLOWED EXECUTION ENV TYPES = {"local", "e2b", "docker", "wasm"} WORKFLOW VALIDATION ERROR = ⋮---- @dataclass frozen=True class NormalizedExecutionConfig ⋮---- executor type: str executor kwargs: dict str, Any prompt template path: Optional str planning interval: Optional int = None def resolve agent root agent root: Path str - Path def normalize execution env config: dict, source: str - dict str, Any ⋮---- raw execution env = config.get "execution env" ⋮---- normalized: dict str, Any = { raw type = raw execution env.get "type", "local" ⋮---- normalized type = raw type.strip .lower ⋮---- raw executor kw… 证据：`src/lib/smolagents/agent/agent_validation.py`
- **Extract tool info from error message failures and raw LLM output**（source_file）：class LoomAgentMixin TodoSyncMixin ⋮---- def run self, task: str, args, kwargs ⋮---- skip task step on reset false = kwargs.pop " skip task step on reset false", True ⋮---- task = callback self, task, args, kwargs ⋮---- reset = kwargs.get "reset", True ⋮---- reset = args 1 ⋮---- original steps = self.memory.steps class InterceptTaskStepList list ⋮---- def init self, original list def append self, item ⋮---- def write memory to messages self, summary mode: bool = False ⋮---- messages = super .write memory to messages summary mode=summary mode ⋮---- todo override = getattr self, " todo sys prompt override", None ⋮---- hook manager = getattr self, " hook manager", None or get current hook mana… 证据：`src/lib/smolagents/agent/loom_mixin.py`
- **Escape Jinja2 syntax to prevent rendering errors**（source_file）：class TodoSyncMixin ⋮---- MAX TODO RETRIES = 4 DEFAULT TODO INITIAL = DEFAULT TODO UPDATE = DEFAULT TODO FINAL = def validate todo prompts self ⋮---- planning = self.prompt templates.get "planning" ⋮---- def reset todo file self - None ⋮---- agent path = root = Path C.agent root .resolve runtime dir = root / ".runtime" / agent path ⋮---- todos file = runtime dir / "todos.md" ⋮---- log = get logger name ⋮---- def has incomplete todos self - bool ⋮---- agent path = get current runtime agent path or get current agent name or getattr self, "name", None or "default" ⋮---- todos file = root / ".runtime" / agent path / "todos.md" ⋮---- content = todos file.read text encoding="utf-8" ⋮---- stripped… 证据：`src/lib/smolagents/agent/todo_sync.py`
- **Third-party package: mermaid-syntax-parser**（source_file）：AGENT ROOT = C.agent root PROMPT PROTOCOL PATH = Path file .resolve .parent.parent / "prompts" / "agent tool behavior spec.yaml" .resolve PROMPT PROTOCOL REQUIRED STRING KEYS = PROMPT PROTOCOL REQUIRED KEYS = PROMPT PROTOCOL REQUIRED STRING KEYS + "output rule lines", PROMPT PROTOCOL VAR PATTERN = re.compile r"\$\{ A-Za-z A-Za-z0-9 \}" FIXED ARGS CONFIG KEY = "fixed args" def get fixed tool args tool config: dict str, Any - dict str, Any ⋮---- raw fixed args = tool config.get FIXED ARGS CONFIG KEY ⋮---- def bind fixed tool args tool func: Callable, tool name: str, fixed args: dict str, Any - Callable ⋮---- signature = inspect.signature tool func parameters = signature.parameters accepts var… 证据：`src/lib/smolagents/agent/yaml_agent_factory.py`
- **Hooks Config**（source_file）：logger = get logger name def load hooks from dict raw: Dict str, Any - HooksSettings ⋮---- settings: HooksSettings = {} ⋮---- event values = {e.value: e.value for e in HookEvent} ⋮---- canonical = event values.get event key ⋮---- parsed matchers: List HookMatcher = ⋮---- matcher str = matcher raw.get "matcher" hooks raw = matcher raw.get "hooks", ⋮---- parsed hooks: List HookCommand = ⋮---- cmd = parse hook command hook raw ⋮---- class HooksConfigSnapshot ⋮---- def init self, settings: HooksSettings - None def get matchers self, event: str - List HookMatcher def get all events self - List str ⋮---- @property def settings self - HooksSettings class HooksConfigManager ⋮---- def init self - No… 证据：`src/lib/smolagents/hooks/hooks_config.py`
- **Get base configuration.**（source_file）：logger = get logger name ⋮---- @dataclass frozen=True class ModelConfigOverlay ⋮---- model id: Optional str = None base url: Optional str = None api key: Optional str = None temperature: Optional float = None max tokens: Optional int = None timeout: Optional int = None description: Optional str = None num retries: Optional int = None retry delay: Optional float = None max retry delay: Optional float = None extra headers: Optional dict = None context cache: Optional bool = None system prompt boundary: Optional str = None requests per minute: Optional int = None extra completion params: Optional dict = None def to mapping self - dict class ModelConfigBuilder ⋮---- def init self - None ⋮---- d… 证据：`src/lib/smolagents/models/model_manager.py`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

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

- **Overview & Runtime Architecture**：importance `high`
  - source_paths: README.md, src/runner.py, src/scaffold.py, src/__main__.py, src/registry.py
- **Configuration System (YAML, LLM, Skills, MCP, Hooks)**：importance `high`
  - source_paths: config/system.yaml, config/llm.example.yaml, config/.mcp.json.example, src/lib/config/config.py, src/lib/config/layered_builder.py
- **Runtime, Tools & Observability**：importance `high`
  - source_paths: src/tools/__init__.py, src/tools/tool_meta.py, src/tools/codex/codex_tool.py, src/tools/file_ops/read_file/read_file.py, src/tools/file_ops/write_file/write_file.py
- **Application Ecosystem & Extensions (Examples, Codex Tool, Self-Learning)**：importance `high`
  - source_paths: applications/ai_quality_analysis/workflows/code_review_agent.yaml, applications/ai_quality_analysis/ai_quality_analysis_demo.py, applications/ai_quality_analysis/config/system.yaml, applications/unit_test_studio/workflows/unit_test_studio_agent.yaml, applications/unit_test_studio/studio_runner.py

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `afb069674a28829b549018180a8a938e7f3e20c1`
- inspected_files: `README.md`, `pyproject.toml`, `uv.lock`, `docs/cn/README.md`, `docs/cn/agent_config.md`, `docs/cn/checkpoint.md`, `docs/cn/config-overview.md`, `docs/cn/hooks.md`, `docs/cn/llm_config.md`, `docs/cn/mcp_config.md`, `docs/cn/skills_config.md`, `docs/cn/system_config.md`, `docs/en/agent_config.md`, `docs/en/checkpoint.md`, `docs/en/config-overview.md`, `docs/en/hooks.md`, `docs/en/llm_config.md`, `docs/en/skills_config.md`, `docs/en/system_config.md`, `src/__init__.py`

宿主 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: 可能修改宿主 AI 配置

- Trigger: 项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。
- Host AI rule: 列出会写入的配置文件、目录和卸载/回滚步骤。
- Why it matters: 安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。
- Evidence: capability.host_targets | https://github.com/linora-u/AgentLoom | host_targets=mcp_host, claude_code, claude
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

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

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

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/linora-u/AgentLoom | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/linora-u/AgentLoom | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | https://github.com/linora-u/AgentLoom | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

- Trigger: release_recency=unknown。
- Host AI rule: 确认最近 release/tag 和 README 安装命令是否一致。
- Why it matters: 安装命令和文档可能落后于代码，用户踩坑概率升高。
- Evidence: evidence.maintainer_signals | https://github.com/linora-u/AgentLoom | release_recency=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
