# boucle-framework - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 boucle-framework 编译的 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 文档。 证据：`tools/enforce/SKILL.md` Claim：`clm_0004` supported 0.86

## 它能做什么

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

## 怎么开始

- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/safety-check/check.sh | bash` 证据：`README.md` Claim：`clm_0005` supported 0.86, `clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/safety-check/check.sh | bash -s -- --verify` 证据：`README.md` Claim：`clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/safety-check/check.sh | bash -s -- --verify --strict` 证据：`README.md` Claim：`clm_0007` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/safety-check/check.sh | bash -s -- --verify --summary-only` 证据：`README.md` Claim：`clm_0008` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- recommended` 证据：`README.md` Claim：`clm_0009` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- verify` 证据：`README.md` Claim：`clm_0010` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- all` 证据：`README.md` Claim：`clm_0011` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- list` 证据：`README.md` Claim：`clm_0012` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- upgrade` 证据：`README.md` Claim：`clm_0013` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.sh | bash -s -- uninstall read-once` 证据：`README.md` Claim：`clm_0014` 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 或项目证据支撑，但仍不等于真实安装效果。 证据：`tools/enforce/SKILL.md` Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`tools/enforce/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, `clm_0006` supported 0.86, `clm_0007` supported 0.86, `clm_0008` supported 0.86

### 现在还不能相信

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

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`tools/enforce/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_0029` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0030` 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 体验。 证据：`tools/enforce/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **enforce-hooks**（skill）：Analyze a CLAUDE.md file and generate PreToolUse hook scripts that enforce its rules at the tool-call level. Use when users want their CLAUDE.md directives enforced as code rather than relying on prompt compliance. Reads the CLAUDE.md, identifies enforceable rules, generates standalone bash hook scripts, and wires them into .claude/settings.json. 激活提示：当用户任务与“enforce-hooks”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`tools/enforce/SKILL.md`

## 证据索引

- 共索引 80 条证据。

- **Boucle**（documentation）：! Tests https://github.com/Bande-a-Bonnot/Boucle-framework/actions/workflows/test.yml/badge.svg https://github.com/Bande-a-Bonnot/Boucle-framework/actions/workflows/test.yml ! License: MIT https://img.shields.io/badge/License-MIT-blue.svg LICENSE 证据：`README.md`
- **Examples**（documentation）：Each example is a fully runnable agent — copy it, run it, modify it. 证据：`examples/README.md`
- **Claude Code Hooks**（documentation）：Standalone safety and efficiency hooks for Claude Code. Each works independently; no framework required. 证据：`tools/README.md`
- **Daily Digest Agent**（documentation）：A practical Boucle agent that reads files from a drop folder and produces a daily summary. 证据：`examples/daily-digest/README.md`
- **Hello World Agent**（documentation）：A minimal Boucle agent that counts its own iterations and learns one fact per loop. 证据：`examples/hello-world/README.md`
- **bash-guard**（documentation）：A Claude Code hook that prevents dangerous bash commands from running. 证据：`tools/bash-guard/README.md`
- **branch-guard**（documentation）：A Claude Code hook that prevents direct commits to protected branches main, master, production, release . Forces feature-branch workflow. 证据：`tools/branch-guard/README.md`
- **boucle diagnose**（documentation）：Agent operations intelligence for autonomous AI loops. 证据：`tools/diagnose/README.md`
- **enforce-hooks**（documentation）：Turn CLAUDE.md rules into enforced boundaries that Claude cannot bypass. 证据：`tools/enforce/README.md`
- **file-guard**（documentation）：A Claude Code hook https://docs.anthropic.com/en/docs/claude-code/hooks that protects specified files and directories from being accessed or modified. 证据：`tools/file-guard/README.md`
- **git-safe**（documentation）：A Claude Code hook that prevents destructive git operations. 证据：`tools/git-safe/README.md`
- **read-once**（documentation）：Stop Claude Code from re-reading files it already has in context. 证据：`tools/read-once/README.md`
- **Claude Code Safety Check**（documentation）：Audit your Claude Code setup in 5 seconds. No hook installation required for the audit. The audit bounds the claude --version probe, so a stuck Claude CLI cannot block the safety report. 证据：`tools/safety-check/README.md`
- **session-log**（documentation）：Audit trail for Claude Code sessions. Logs every tool call so you can see exactly what Claude did. 证据：`tools/session-log/README.md`
- **worktree-guard**（documentation）：PreToolUse hook for Claude Code that prevents data loss from worktree exit. 证据：`tools/worktree-guard/README.md`
- **Enforce Hooks**（skill_instruction）：Generate PreToolUse hook scripts from CLAUDE.md directives. 证据：`tools/enforce/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`
- **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: 证据：`tools/bash-guard/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/branch-guard/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/file-guard/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/git-safe/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/read-once/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/session-log/LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`tools/worktree-guard/LICENSE`
- **Broca Memory for Claude Desktop**（documentation）：Get persistent memory in Claude Desktop in under 5 minutes. 证据：`BROCA_PACKAGE_README.md`
- **Multi-Agent Collaboration with Boucle**（documentation）：Multi-Agent Collaboration with Boucle 证据：`docs/MULTI_AGENT_COLLABORATION.md`
- **Read-only audit mode**（documentation）：Use this recipe when Claude Code should inspect, test, and report without modifying the project. Plain prompt instructions like "do not edit files" are not enough for this boundary. The model can still call Write, Edit, Bash redirects, database mutations, Docker rebuilds, or git commands unless a hook blocks those tool calls before execution. 证据：`tools/enforce/READ_ONLY_AUDIT.md`
- **Safety-check scripted checks**（documentation）：Use --verify --strict when a failed or inconclusive hook check should fail the script. It is useful for developer workstation checks and for repositories that keep Claude Code hook settings in version control. 证据：`tools/safety-check/CI.md`
- **Safety-check quickstart**（documentation）：Use this when you want to know whether a Claude Code setup can actually block dangerous tool calls. The goal is not a perfect grade. The goal is a verified trust boundary before you let Claude edit a real project. 证据：`tools/safety-check/QUICKSTART.md`
- **Safe support evidence**（documentation）：Use this when a safety-check result looks wrong and you need help in a public issue, chat thread, or support channel. The goal is to share enough evidence to debug the hook boundary without leaking private settings, paths, prompts, or secrets. 证据：`tools/safety-check/SUPPORT_EVIDENCE.md`
- **Safety summary triage**（documentation）：Use this after running safety-check --verify , or install.ps1 verify for native Windows PowerShell hooks. The safety-check copy/paste summary and the PowerShell verifier counts are repair lists, not certificates. Start with the first item that proves hooks could be skipped or fail open, then rerun verification from the same project root. 证据：`tools/safety-check/TRIAGE.md`
- **Claude Code update checklist**（documentation）：Use this when Claude Code changes version, updates itself, or starts behaving differently after an IDE or plugin update. The goal is to prove that hooks still fire before trusting a session with real work. 证据：`tools/safety-check/UPDATE_CHECKLIST.md`
- **Limitations**（structured_config）：{ "version": "0.13.0", "count": 1286, "categories": { "Hook behavior & events": 186, "Permission system": 127, "Hook bypass & evasion": 102, "MCP & plugin issues": 66, "Subagent & spawned agents": 58, "Desktop & IDE integration": 43, "TUI & display": 29, "Context & memory": 27, "Platform & compatibility": 27, "CLI & terminal": 25, "Configuration behavior": 22, "Performance & cost": 20, "Tool behavior": 20, "Agents & subagents": 19, "MCP & integrations": 18, "Sandbox & permissions": 17, "Security & trust boundaries": 16, "Data integrity": 14, "VS Code extension": 14, "Core & session management": 13, "MCP integration": 13, "Remote & cloud": 13, "Auth & accounts": 12, "Cowork & remote": 12, "P… 证据：`docs/limitations.json`
- **MCP server dependencies for future implementation**（source_file）：package name = "boucle" version = "0.13.0" edition = "2021" authors = "Bande-a-Bonnot" description = "A framework for autonomous AI agent loops — structured memory, lifecycle hooks, and scheduling" license = "MIT" repository = "https://github.com/Bande-a-Bonnot/Boucle-framework" homepage = "https://boucle.sh" documentation = "https://framework.boucle.sh/" readme = "README.md" keywords = "ai", "agent", "autonomous", "mcp", "memory" categories = "command-line-utilities", "development-tools" 证据：`Cargo.toml`
- **Limitations Feed**（source_file）：Claude Code Hook Limitations https://framework.boucle.sh/limitations-feed.xml 2026-07-28T00:00:00Z Boucle MEDIUM Opus teammates can ignore shutdown request while continuing idle notifications. https://framework.boucle.sh/limitations.html opus-teammates-can-ignore-shutdown-request-while-idle 2026-07-28T00:00:00Z A reported Claude Code session spawned four Agent-tool teammates, then sent each a shutdown request through SendMessage after they went idle. The two Sonnet teammates returned shutdown approved and terminated, while the two Opus teammates repeatedly emitted idle notification messages and never acknowledged the shutdown request. SendMessage still reported success, so the parent had no… 证据：`docs/limitations-feed.xml`
- **Limitations**（source_file）：Known Limitations - Claude Code Hooks Boucle :root { --bg: 0d1117; --surface: 161b22; --border: 30363d; --text: c9d1d9; --text-muted: 8b949e; --accent: 58a6ff; --accent-dim: 1f6feb33; --green: 3fb950; --tag-bg: 21262d; } { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: var --bg ; color: var --text ; line-height: 1.6; } .container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; } h1 { font-size: 1.5rem; margin-bottom: 0.25rem; } h1 a { color: var --text ; text-decoration: none; } h1 a:hover { color: var --accent ; } .subtitle { color: var --text-muted ; margin-bottom: 1.5r… 证据：`docs/limitations.html`
- **Add Kl Batch**（source_file）：BASE = os.path.dirname os.path.dirname os.path.abspath file JSON PATH = os.path.join BASE, 'docs', 'limitations.json' ⋮---- new entries = ⋮---- data = json.load f ⋮---- entries = data 'entries' existing ids = {e 'id' for e in entries} added = 0 ⋮---- sev = {'critical': 0, 'high': 0, 'medium': 0, 'low': 0} ⋮---- s = e.get 'severity', 'medium' 证据：`scripts/add-kl-batch.py`
- **Add Kl**（source_file）：def main ⋮---- json path = os.path.join os.path.dirname os.path.dirname os.path.abspath file , 'docs', 'limitations.json' ⋮---- d = json.load f ⋮---- new entry = { ⋮---- total = len d 'entries' sev counts = {} status counts = {"open": 0, "fixed": 0, "mitigated": 0} ⋮---- s = e.get 'severity', 'medium' .lower ⋮---- st = e.get 'status', 'open' .lower 证据：`scripts/add-kl.py`
- **Config**（source_file）：use serde::Deserialize; ⋮---- pub struct Config { ⋮---- pub struct AgentConfig { ⋮---- pub struct MemoryConfig { ⋮---- pub struct LoopConfig { ⋮---- pub struct ScheduleConfig { ⋮---- pub struct GitConfig { ⋮---- pub struct McpConfig { ⋮---- impl Default for GitConfig { fn default - Self { ⋮---- commit name: default commit name , commit email: default commit email , ⋮---- impl Default for McpConfig { ⋮---- enable: default enable mcp , ⋮---- fn default model - String { "gpt-5.4".to string ⋮---- fn default system prompt - String { "system-prompt.md".to string ⋮---- fn default memory dir - String { "memory".to string ⋮---- fn default state file - String { "STATE.md".to string ⋮---- fn default m… 证据：`src/config.rs`
- **Main**（source_file）：mod broca; mod config; mod improve; mod mcp; mod runner; ⋮---- use std::path::PathBuf; use std::process; use std::process::Command; ⋮---- struct Cli { ⋮---- enum Commands { ⋮---- enum ImproveCommands { ⋮---- enum MemoryCommands { ⋮---- fn main { ⋮---- None = match config::find agent root &std::env::current dir .unwrap { ⋮---- if !matches! cli.command, Commands::Init { .. } { eprintln! "Error: No boucle.toml found. Run 'boucle init' first." ; ⋮---- std::env::current dir .unwrap ⋮---- eprintln! "Error initializing: {e}" ; ⋮---- println! "Initialized Boucle agent '{name}' in {}", root.display ; ⋮---- eprintln! "Error: {e}" ; ⋮---- eprintln! "Error loading config: {e}" ; ⋮---- let memory dir =… 证据：`src/main.rs`
- **Export Kl**（source_file）：DOCS = os.path.join os.path.dirname os.path.dirname os.path.abspath file , "docs" ROOT = os.path.dirname DOCS HTML PATH = os.path.join DOCS, "limitations.html" JSON PATH = os.path.join DOCS, "limitations.json" CARGO PATH = os.path.join ROOT, "Cargo.toml" ⋮---- def package version ⋮---- m = re.match r'version\s =\s " ^" + "', line.strip ⋮---- def extract ⋮---- content = f.read ⋮---- entries = entry re = re.compile title re = re.compile r' . ? ' desc re = re.compile r' \s . ? ', re.DOTALL ⋮---- category = match.group 1 raw issues = match.group 2 .strip .split entry id = match.group 3 severity = match.group 4 ⋮---- rest = content match.end :match.end + 3000 ⋮---- title m = title re.search rest… 证据：`tools/export-kl.py`
- **Boucle hooks installer for Windows PowerShell**（source_file）：Boucle hooks installer for Windows PowerShell Native PowerShell hooks for Claude Code — no bash, no jq, no WSL required. Usage: iex "& { $ irm https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.ps1 }" iex "& { $ irm https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.ps1 } recommended" iex "& { $ irm https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.ps1 } file-guard git-safe" iex "& { $ irm https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.ps1 } all" iex "& { $ irm https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/install.ps1 } l… 证据：`tools/install.ps1`
- **Hook catalog no associative arrays — bash 3 compatible**（source_file）：set -euo pipefail REPO="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools" SETTINGS="${HOME}/.claude/settings.json" if -t 1 ; then BOLD='\033 1m' DIM='\033 2m' GREEN='\033 32m' YELLOW='\033 33m' CYAN='\033 36m' RESET='\033 0m' else BOLD='' DIM='' GREEN='' YELLOW='' CYAN='' RESET='' fi echo "" echo -e "${BOLD}Boucle Hooks for Claude Code${RESET}" echo -e "${DIM}Safety hooks that protect your codebase${RESET}" echo "" Hook catalog no associative arrays — bash 3 compatible hook desc { case "$1" in read-once echo "Skip re-reading unchanged files saves tokens " ;; file-guard echo "Block modifications to sensitive files .env, keys " ;; git-safe echo "Prevent destructive… 证据：`tools/install.sh`
- **bash-guard: PreToolUse hook for Claude Code PowerShell**（source_file）：bash-guard: PreToolUse hook for Claude Code PowerShell Windows-native equivalent of hook.sh — no external dependencies needed. Prevents dangerous bash commands that can cause irreversible damage. Blocked operations: - rm -rf on critical paths /, ~, , .. - chmod/chown -R with dangerous permissions - Piping untrusted content to shell curl sh, wget bash - sudo privilege escalation - kill -9 on broad targets - dd/mkfs targeting disks - Disk utility destruction diskutil erase/partition, fdisk, gdisk, parted, sfdisk, wipefs - Overwriting system directories - Docker data destruction compose down -v, system prune, volume rm - Docker escape host mounts, docker exec - Database destruction prisma db p… 证据：`tools/bash-guard/hook.ps1`
- **Hook**（source_file）：set -euo pipefail if "${BASH GUARD DISABLED:-0}" = "1" ; then exit 0 fi INPUT=$ cat TOOL NAME=$ echo "$INPUT" jq -r '.tool name // empty' if "$TOOL NAME" != "Bash" ; then exit 0 fi COMMAND=$ echo "$INPUT" jq -r '.tool input.command // empty' if -z "$COMMAND" ; then exit 0 fi log { if "${BASH GUARD LOG:-0}" = "1" ; then echo " bash-guard $ " &2 fi } ALLOWED= DENIED= load bash guard config { local cfg="$1" line pattern -f "$cfg" && -r "$cfg" return 0 while IFS= read -r line -n "$line" ; do line=$ echo "$line" sed 's/ . //' xargs -z "$line" && continue if "$line" == allow: ; then pattern=$ echo "$line" sed 's/^allow:\s //' xargs ALLOWED+= "$pattern" elif "$line" == deny: ; then pattern=$ echo… 证据：`tools/bash-guard/hook.sh`
- **Remove legacy/flat entries and check for current path**（source_file）：set -euo pipefail HOOK NAME="bash-guard" HOOK DIR="$HOME/.claude/$HOOK NAME" HOOK PATH="$HOOK DIR/hook.sh" SETTINGS="$HOME/.claude/settings.json" RAW BASE="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/bash-guard" echo "Installing $HOOK NAME for Claude Code..." if ! command -v python3 /dev/null 2 &1; then echo "Error: python3 not found. Install Python 3 and try again." &2 exit 1 fi if ! command -v jq /dev/null 2 &1; then echo "Error: jq not found. $HOOK NAME requires jq at runtime." &2 echo " Install: brew install jq macOS or apt install jq Linux " &2 exit 1 fi mkdir -p "$HOOK DIR" echo " Downloading hook..." if command -v curl /dev/null 2 &1; then curl -fsSL… 证据：`tools/bash-guard/install.sh`
- **branch-guard: PreToolUse hook for Claude Code PowerShell**（source_file）：branch-guard: PreToolUse hook for Claude Code PowerShell Windows-native equivalent of hook.sh — no external dependencies needed. Prevents commits directly to protected branches main, master, etc. . Forces feature-branch workflow. Protected branches default : main, master, production, release Install: 1. Copy hook.ps1 to your project 2. Add to .claude/settings.json: "hooks": { "PreToolUse": { "type": "command", "command": "pwsh -File /path/to/hook.ps1" } } Config .branch-guard : protect: main protect: master protect: staging allow-merge: true allow merge commits on protected branches Env vars: BRANCH GUARD DISABLED=1 Disable the hook entirely BRANCH GUARD PROTECTED=main,master Override prote… 证据：`tools/branch-guard/hook.ps1`
- **Hook**（source_file）：set -euo pipefail if "${BRANCH GUARD DISABLED:-0}" = "1" ; then exit 0 fi INPUT=$ cat TOOL NAME=$ echo "$INPUT" jq -r '.tool name // empty' if "$TOOL NAME" != "Bash" ; then exit 0 fi COMMAND=$ echo "$INPUT" jq -r '.tool input.command // empty' if -z "$COMMAND" ; then exit 0 fi log { if "${BRANCH GUARD LOG:-0}" = "1" ; then echo " branch-guard $ " &2 fi } command segments { awk ' { out = "" sq = 0 dq = 0 esc = 0 for i = 1; i /dev/null echo "" if -z "$CURRENT BRANCH" ; then log "SKIP: target is not in a git repo or detached HEAD" exit 0 fi log "Current branch: $CURRENT BRANCH" for protected in "${PROTECTED @ }"; do if "$CURRENT BRANCH" = "$protected" ; then block \ "Direct commit to '$CURRENT… 证据：`tools/branch-guard/hook.sh`
- **Remove legacy/flat entries and check for current path**（source_file）：set -euo pipefail HOOK NAME="branch-guard" HOOK URL="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/branch-guard/hook.sh" HOOK DIR="$HOME/.claude/$HOOK NAME" HOOK PATH="$HOOK DIR/hook.sh" SETTINGS FILE="$HOME/.claude/settings.json" echo "Installing $HOOK NAME for Claude Code..." if ! command -v python3 /dev/null 2 &1; then echo "Error: python3 not found. Install Python 3 and try again." &2 exit 1 fi if ! command -v jq /dev/null 2 &1; then echo "Error: jq not found. $HOOK NAME requires jq at runtime." &2 echo " Install: brew install jq macOS or apt install jq Linux " &2 exit 1 fi mkdir -p "$HOOK DIR" echo " Downloading hook..." if command -v curl & /dev/null; th… 证据：`tools/branch-guard/install.sh`
- **Rewrite as clean JSON backup original**（source_file）：FILE MUTATION TOOLS = 'Write', 'Edit', 'MultiEdit', 'NotebookEdit' FILE MUTATION TOOL LABEL = ', '.join FILE MUTATION TOOLS BASH COMMAND TOKEN PATTERNS = { ⋮---- def strip jsonc text ⋮---- in str = False ⋮---- if text i == '"': in str = False ⋮---- in str = True; out.append text i ; i += 1 ⋮---- def load settings json path ⋮---- """Load settings.json, handling JSONC comments gracefully.""" path = Path path ⋮---- raw = path.read text ⋮---- result = json.loads strip jsonc raw Rewrite as clean JSON backup original ⋮---- class Directive ⋮---- slots = 'text', 'hook type', 'patterns', 'description', 'line num', ⋮---- def to dict self ⋮---- d = { ⋮---- FILE GUARD PATTERNS = ⋮---- "Protected files:… 证据：`tools/enforce/enforce-hooks.py`
- **Load all rules**（source_file）：set -euo pipefail find enforcements dir { local dir="$PWD" while "$dir" != "/" ; do if -d "$dir/.claude/enforcements" ; then echo "$dir/.claude/enforcements" return 0 fi dir=$ dirname "$dir" done return 1 } ENFORCEMENTS DIR=$ find enforcements dir 2 /dev/null exit 0 RULE FILES=$ find "$ENFORCEMENTS DIR" -name " .json" -type f 2 /dev/null -z "$RULE FILES" && exit 0 INPUT=$ cat export ENFORCE INPUT="$INPUT" export ENFORCE DIR="$ENFORCEMENTS DIR" export ENFORCE SESSION LOG="$HOME/.claude/session-logs/$ date -u +%Y-%m-%d .jsonl" python3 -c " import json, sys, os, re, glob, fnmatch raw input = os.environ.get 'ENFORCE INPUT', '{}' try: parsed = json.loads raw input except json.JSONDecodeError, Va… 证据：`tools/enforce/engine.sh`
- **Show what rules were detected**（source_file）：set -euo pipefail REPO RAW="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/enforce" CREATED CLAUDE MD=false if ! -f "CLAUDE.md" && ! -d ".claude" ; then if ! -d ".git" ; then echo "No CLAUDE.md, .claude/, or .git/ found in current directory." echo "Run this from your project root." exit 1 fi cat CLAUDE.md /dev/null 2 &1; then echo "Error: python3 not found. Install Python 3.6+ and try again." &2 exit 1 fi DL="curl -fsSL" command -v curl /dev/null 2 &1 DL="wget -q -O -" TMPFILE="${TMPDIR:-/tmp}/enforce-hooks-installer.py" if ! $DL "$REPO RAW/enforce-hooks.py" "$TMPFILE" 2 /dev/null; then echo "Error: download failed. Check your internet connection." &2 rm -f "$T… 证据：`tools/enforce/install.sh`
- **Compare to stored hash**（source_file）：set -euo pipefail PROJECT DIR="${CLAUDE PROJECT DIR:-$PWD}" CLAUDE MD="$PROJECT DIR/CLAUDE.md" ENFORCEMENTS DIR="$PROJECT DIR/.claude/enforcements" HASH FILE="$ENFORCEMENTS DIR/.hash" -f "$CLAUDE MD" exit 0 if ! grep -qi '@enforced\ @required' "$CLAUDE MD" 2 /dev/null; then exit 0 fi CURRENT HASH=$ grep -i '@enforced\ @required' "$CLAUDE MD" shasum -a 256 cut -d' ' -f1 Compare to stored hash if -f "$HASH FILE" ; then STORED HASH=$ cat "$HASH FILE" if "$CURRENT HASH" = "$STORED HASH" ; then exit 0 No changes fi fi Directives changed or first run . Count them. COUNT=$ grep -ci '@enforced\ @required' "$CLAUDE MD" 2 /dev/null echo "0" cat "$HASH FILE" EOF 证据：`tools/enforce/session-hook.sh`
- **file-guard: PreToolUse hook for Claude Code PowerShell**（source_file）：file-guard: PreToolUse hook for Claude Code PowerShell Windows-native equivalent of hook.sh — no external dependencies needed. Protects specified files and directories from being accessed or modified. Two protection levels: - Write protection default : blocks Write, Edit, MultiEdit, NotebookEdit, and modifying Bash commands - Access denial deny section : blocks Read, Grep, Glob, and all Bash access Install: 1. Copy hook.ps1 to your project 2. Create .file-guard in your project root one path per line 3. Add to .claude/settings.json: "hooks": { "PreToolUse": { "type": "command", "command": "pwsh -File /path/to/hook.ps1" } } Config file .file-guard : One path per line. Supports: - Exact paths:… 证据：`tools/file-guard/hook.ps1`
- **Check deny patterns first blocks all access**（source_file）：set -euo pipefail if "${FILE GUARD DISABLED:-0}" = "1" ; then exit 0 fi INPUT=$ cat TOOL NAME=$ echo "$INPUT" jq -r '.tool name // empty' file write target path { case "$TOOL NAME" in NotebookEdit echo "$INPUT" jq -r '.tool input.notebook path // .tool input.file path // empty' ;; Write Edit MultiEdit echo "$INPUT" jq -r '.tool input.file path // empty' ;; echo "" ;; esac } case "$TOOL NAME" in Write Edit MultiEdit NotebookEdit FILE PATH=$ file write target path if -n "$FILE PATH" && "$FILE PATH" != / ; then ABSOLUTE HINT="$ pwd /$FILE PATH" jq -cn --arg p "$FILE PATH" --arg hint "$ABSOLUTE HINT" \ '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionD… 证据：`tools/file-guard/hook.sh`
- **Display grouped by category**（source_file）：set -euo pipefail DRY RUN=0 APPEND=0 TARGET DIR="." while $ case "$1" in --dry-run DRY RUN=1; shift ;; --append APPEND=1; shift ;; --help -h echo "Usage: init.sh --dry-run --append directory " echo "" echo "Scans a project for sensitive files and generates .file-guard config." echo "" echo "Options:" echo " --dry-run Show detected files without writing config" echo " --append Add to existing .file-guard instead of replacing" echo " --help Show this help" exit 0 ;; - echo "Unknown option: $1" &2; exit 1 ;; TARGET DIR="$1"; shift ;; esac done cd "$TARGET DIR" FINDINGS=$ mktemp trap 'rm -f "$FINDINGS"' EXIT add finding { local category="$1" local pattern="$2" local desc="$3" if grep -qF " ${pa… 证据：`tools/file-guard/init.sh`
- **Remove legacy/flat entries and check for current path**（source_file）：set -euo pipefail HOOK NAME="file-guard" HOOK URL="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/file-guard/hook.sh" INIT URL="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/file-guard/init.sh" HOOK DIR="$HOME/.claude/$HOOK NAME" HOOK PATH="$HOOK DIR/hook.sh" SETTINGS FILE="$HOME/.claude/settings.json" echo "Installing $HOOK NAME for Claude Code..." if ! command -v python3 /dev/null 2 &1; then echo "Error: python3 not found. Install Python 3 and try again." &2 exit 1 fi if ! command -v jq /dev/null 2 &1; then echo "Error: jq not found. $HOOK NAME requires jq at runtime." &2 echo " Install: brew install jq macOS or apt install jq L… 证据：`tools/file-guard/install.sh`
- **git-safe: PreToolUse hook for Claude Code PowerShell**（source_file）：git-safe: PreToolUse hook for Claude Code PowerShell Windows-native equivalent of hook.sh — no external dependencies needed. Prevents destructive git operations that can lose work. Blocked operations: - git push --force / -f can rewrite remote history - git reset --hard discards uncommitted changes - git checkout . / git checkout -- discards changes - git checkout -- overwrites files from ref - git restore without --staged discards working tree changes - git restore --source / -s overwrites from arbitrary ref - git clean -f deletes untracked files permanently - git branch -D force-deletes unmerged branches - git stash drop / clear permanently deletes stashed work - git commit --no-verify /… 证据：`tools/git-safe/hook.ps1`
- **Hook**（source_file）：set -euo pipefail if "${GIT SAFE DISABLED:-0}" = "1" ; then exit 0 fi INPUT=$ cat TOOL NAME=$ echo "$INPUT" jq -r '.tool name // empty' if "$TOOL NAME" != "Bash" ; then exit 0 fi COMMAND=$ echo "$INPUT" jq -r '.tool input.command // empty' if -z "$COMMAND" ; then exit 0 fi log { if "${GIT SAFE LOG:-0}" = "1" ; then echo " git-safe $ " &2 fi } if ! echo "$COMMAND" grep -q 'git\b' 2 /dev/null; then log "SKIP: no git command" exit 0 fi ALLOWED= CONFIG="${GIT SAFE CONFIG:-.git-safe}" if -f "$CONFIG" ; then while IFS= read -r line; do line=$ echo "$line" sed 's/ . //' xargs -z "$line" && continue if "$line" == allow: ; then pattern=$ echo "$line" sed 's/^allow:\s //' xargs ALLOWED+= "$pattern" f… 证据：`tools/git-safe/hook.sh`
- **Remove legacy/flat entries and check for current path**（source_file）：set -euo pipefail HOOK NAME="git-safe" HOOK URL="https://raw.githubusercontent.com/Bande-a-Bonnot/Boucle-framework/main/tools/git-safe/hook.sh" HOOK DIR="$HOME/.claude/$HOOK NAME" HOOK PATH="$HOOK DIR/hook.sh" SETTINGS FILE="$HOME/.claude/settings.json" echo "Installing $HOOK NAME for Claude Code..." if ! command -v python3 /dev/null 2 &1; then echo "Error: python3 not found. Install Python 3 and try again." &2 exit 1 fi if ! command -v jq /dev/null 2 &1; then echo "Error: jq not found. $HOOK NAME requires jq at runtime." &2 echo " Install: brew install jq macOS or apt install jq Linux " &2 exit 1 fi mkdir -p "$HOOK DIR" echo " Downloading hook..." if command -v curl & /dev/null; then curl… 证据：`tools/git-safe/install.sh`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `examples/README.md`, `tools/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `examples/README.md`, `tools/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, tools/install.sh, tools/install.ps1, examples/hello-world/README.md, examples/daily-digest/README.md
- **危险命令拦截：bash-guard**：importance `high`
  - source_paths: tools/bash-guard/README.md, tools/bash-guard/hook.sh, tools/bash-guard/hook.ps1, tools/bash-guard/install.sh, tools/bash-guard/test.sh
- **Git 与工作区防护：git-safe / branch-guard / worktree-guard**：importance `high`
  - source_paths: tools/git-safe/README.md, tools/git-safe/hook.sh, tools/git-safe/hook.ps1, tools/branch-guard/README.md, tools/branch-guard/hook.sh
- **文件与读取防护：file-guard / read-once**：importance `high`
  - source_paths: tools/file-guard/README.md, tools/file-guard/hook.sh, tools/file-guard/hook.ps1, tools/file-guard/init.sh, tools/read-once/README.md
- **会话审计：session-log**：importance `medium`
  - source_paths: tools/session-log/README.md, tools/session-log/hook.sh, tools/session-log/hook.ps1, tools/session-log/report.sh, tools/session-log/test.sh
- **CLAUDE.md 规则强制执行：enforce-hooks**：importance `high`
  - source_paths: tools/enforce/README.md, tools/enforce/READ_ONLY_AUDIT.md, tools/enforce/SKILL.md, tools/enforce/enforce-hooks.py, tools/enforce/engine.sh
- **安全审计与诊断：safety-check / diagnose / test-hook**：importance `high`
  - source_paths: tools/safety-check/README.md, tools/safety-check/QUICKSTART.md, tools/safety-check/CI.md, tools/safety-check/TRIAGE.md, tools/safety-check/UPDATE_CHECKLIST.md
- **已知限制数据库（Known Limitations）**：importance `high`
  - source_paths: docs/limitations.html, docs/limitations.json, docs/limitations-feed.xml, tools/export-kl.py, scripts/add-kl.py

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `27b5fcf228eb6768c9bd76b7865431a6b99d4895`
- inspected_files: `Dockerfile`, `README.md`, `docs/MULTI_AGENT_COLLABORATION.md`, `docs/limitations.json`, `examples/README.md`, `examples/daily-digest/README.md`, `examples/daily-digest/boucle.toml`, `examples/daily-digest/memory/STATE.md`, `examples/daily-digest/system-prompt.md`, `examples/hello-world/README.md`, `examples/hello-world/boucle.toml`, `examples/hello-world/memory/STATE.md`, `examples/hello-world/system-prompt.md`

宿主 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: 能力证据存在缺口

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

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

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

### Constraint 3: 可能修改宿主 AI 配置

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

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

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

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

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

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

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

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

### Constraint 8: 存在安全注意事项

- Trigger: No sandbox install has been executed yet; downstream must verify before user use.
- Host AI rule: 转成明确权限清单和安全审查提示。
- Why it matters: 用户安装前需要知道权限边界和敏感操作。
- Evidence: risks.safety_notes | https://github.com/Bande-a-Bonnot/Boucle-framework | No sandbox install has been executed yet; downstream must verify before user use.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

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

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