# karajan-code - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

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

## Claim 消费规则

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

## 它最适合谁

- **AI 研究者或研究型 Agent 构建者**：README 明确围绕研究、实验或论文工作流展开。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0003` supported 0.86

## 它能做什么

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

## 怎么开始

- `npm install -g karajan-code` 证据：`README.md` Claim：`clm_0004` supported 0.86
- `curl -L https://github.com/manufosela/karajan-code/releases/latest/download/kj-darwin-arm64 -o kj && chmod +x kj` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `curl -L https://github.com/manufosela/karajan-code/releases/latest/download/kj-linux-x64 -o kj && chmod +x kj` 证据：`README.md` Claim：`clm_0006` supported 0.86
- `curl -L https://github.com/manufosela/karajan-code/releases/latest/download/kj-win-x64.exe -o kj.exe` 证据：`README.md` Claim：`clm_0007` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install-binary.sh | sh` 证据：`README.md` Claim：`clm_0008` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install-kj.sh | sh` 证据：`README.md` Claim：`clm_0009` supported 0.86
- `pip install karajan-code` 证据：`README.md` Claim：`clm_0010` supported 0.86
- `git clone https://github.com/manufosela/karajan-code.git` 证据：`README.md` Claim：`clm_0011` supported 0.86
- `pip install .` 证据：`README.md` Claim：`clm_0010` supported 0.86, `clm_0012` supported 0.86

## 继续前判断卡

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

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：角色质量和任务匹配不能直接相信。
- **继续会触碰**：角色选择偏差、命令执行、宿主 AI 配置

### 现在可以相信

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

### 现在还不能相信

- **角色质量和任务匹配不能直接相信。**（unverified）：角色库证明有很多角色，不证明每个角色都适合你的具体任务，也不证明角色能产生高质量结果。
- **不能把角色文案当成真实执行能力。**（unverified）：安装前只能判断角色描述和任务画像是否匹配，不能证明它能在宿主 AI 里完成任务。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`AGENTS.md`, `CLAUDE.md`
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`AGENTS.md`, `CLAUDE.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`CHANGELOG.md`, `README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

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

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **保留原始角色选择记录**：如果输出偏题，可以回到任务画像阶段重新选择角色，而不是继续沿着错误角色推进。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

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

## 哪些必须安装后验证

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

## 边界与风险判断卡

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

### 任务路由

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

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **Karajan Code — Agent-Facing Index**（project_doc）：This directory is the AI-agent entry point for the Karajan Code repository. Humans look at the top-level README.md ../../README.md . Agents Cursor, Cline, Aider, generic Claude / Codex sessions come here. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/README.md`
- **Karajan Code — Demo recordings**（project_doc）：Scripts for recording reproducible asciinema demos of Karajan Code, plus the published .cast files when available. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/demos/README.md`
- **Task file templates**（project_doc）：Plantillas y guía para los .md que pasas a los comandos de Karajan via --task-file . Sin estas, escribir un task file requiere ensayo y error caro cada kj plan generate cuesta $0.30–0.80 en LLM y 2–5 minutos . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/README.md`
- **What is Karajan?**（project_doc）：Local multi-agent coding orchestrator. TDD-first, MCP-based, vanilla JavaScript. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Karajan Code Examples**（project_doc）：express-notes-api ./express-notes-api/ 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/README.md`
- **DNI Validator — Generated by Karajan Code**（project_doc）：DNI Validator — Generated by Karajan Code 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/dni-validator/README.md`
- **Express Notes API — Generated by Karajan Code**（project_doc）：Express Notes API — Generated by Karajan Code 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/express-notes-api/README.md`
- **@karajan/ai-trash**（project_doc）：AI-proof trash: intercept destructive operations from an AI-driven shell rm -rf , truncation via , mv overwriting, destructive git ops, … and snapshot the affected paths to a bin the AI cannot reach before the command runs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`packages/ai-trash/README.md`
- **karajan-core**（project_doc）：Shared modules for the Karajan Code CLI and @karajan/hu-board . Private workspace package — not published to npm. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`packages/core/README.md`
- **Karajan HU Board**（project_doc）：A web dashboard that visualizes all HU User Story stories managed by Karajan Code. Reads from ~/.karajan/hu-stories/ and ~/.karajan/sessions/ , groups by project, and provides a read-only kanban board with quality metrics and session timelines. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`packages/hu-board/README.md`
- **karajan-code Python wrapper**（project_doc）：Python wrapper for Karajan Code https://karajancode.com -- local multi-agent coding orchestrator. This package is not a reimplementation; it locates and delegates to the real Karajan Code binary. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`wrappers/python/README.md`
- **KJ Default Workflow Codex**（project_doc）：Objective Use Karajan Code KJ as the default orchestrator for implementing tasks and fixing bugs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AGENTS.md`
- **KJ Default Workflow Claude Code**（project_doc）：Objective Use Karajan Code KJ as the default orchestrator for implementing tasks and fixing bugs in this project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CLAUDE.md`
- **Karajan Code — Architecture**（project_doc）：Karajan is a local multi-agent coding orchestrator . It coordinates a pipeline of AI agents Claude, Codex, Gemini, Aider, OpenCode through specialized roles to plan, implement, test, and review code. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/ARCHITECTURE.md`
- **Getting Started with Karajan Code**（project_doc）：- Node.js ≥ 22.22 Karajan v3.0.0 dropped Node 20 — see CHANGELOG for migration notes - Git - At least one AI CLI installed: claude , codex , gemini , aider , or opencode - Optional Docker for local SonarQube - RTK + Squeezr token efficiency — kj init installs both automatically. Opt out with --no-rtk / --no-squeezr if you don't want them. - QMD per-project semantic wiki — kj init registers docs/ , .reviews/ and .kar… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/GETTING-STARTED.md`
- **ADR-001: Role-Based AI Architecture**（project_doc）：ADR-001: Role-Based AI Architecture 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/001-role-based-ai-architecture.md`
- **Karajan Code — Arquitectura**（project_doc）：Karajan es un orquestador local multi-agente de código . Coordina un pipeline de agentes IA Claude, Codex, Gemini, Aider, OpenCode a través de roles especializados para planificar, implementar, testear y revisar código. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/es/ARCHITECTURE.md`
- **Primeros pasos con Karajan Code**（project_doc）：- Node.js ≥ 22.22 Karajan v3.0.0 elimina soporte de Node 20 — ver CHANGELOG para notas de migración - Git - Al menos una CLI de IA instalada: claude , codex , gemini , aider u opencode - Opcional Docker para SonarQube local - RTK + Squeezr eficiencia de tokens — kj init los instala automáticamente. Para no usarlos, --no-rtk / --no-squeezr . - QMD wiki semántica por proyecto — kj init registra docs/ , .reviews/ y .ka… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/es/GETTING-STARTED.md`
- **Contributing**（project_doc）：Open an issue with the exact command you ran, the output you got, and the output you expected. Without those three things the bug cannot be reproduced and the issue will be closed. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **Karajan cleanup — kj clean**（project_doc）：kj clean is a read-only by default garbage collector that surfaces stale state accumulated by Karajan so the user can decide what to drop. It never executes destructive commands on its own — every layer prints a copy-paste command you can run if you want to actually delete. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/CLEANUP.md`
- **Karajan Code vs AI Frameworks**（project_doc）：While Genkit, Mastra, LangChain and Vercel AI SDK call /v1/messages , Karajan orchestrates the AI CLIs your developers already use in their terminals. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/COMPARISON.md`
- **Karajan Code - Docker**（project_doc）：Run Karajan Code without installing Node.js or npm on your host machine. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/DOCKER.md`
- **Hardening Your Dev Environment Against AI Tools**（project_doc）：Hardening Your Dev Environment Against AI Tools 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/HARDENING-AGAINST-AI.md`
- **RAG — Retrieval-Augmented Generation**（project_doc）：RAG — Retrieval-Augmented Generation 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/RAG.md`
- **Que es Karajan?**（project_doc）：Orquestador local multi-agente. TDD-first, basado en MCP, JavaScript vanilla. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/README.es.md`
- **ai-trash — Fase 1 KJC-TSK-0386**（project_doc）：Stack Node 22 ESM compilado a Single Executable App node --experimental-sea-config . Reutiliza release-binaries.yml . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/ai-trash-fase1-report.md`
- **ai-trash — Fase 2 plan KJC-TSK-0387**（project_doc）：ai-trash — Fase 2 plan KJC-TSK-0387 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/ai-trash-fase2-plan.md`
- **Audit false positives — verified non-removable dependencies**（project_doc）：Audit false positives — verified non-removable dependencies 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/audit-false-positives.md`
- **Brain decisor**（project_doc）：Karajan's Brain is now the pipeline's decisor: it reads the triage output plus the task text, classifies intent, and decides which roles should run for the current task. The existing flag-based stage execution continues to drive runFlow — Brain just tells it which flags should be on. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/brain-decisor.md`
- **Custom Roles & Agents**（project_doc）：How to customize and extend Karajan Code with your own roles and agents. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/custom-roles.md`
- **Design decisions — things Karajan deliberately does NOT do**（project_doc）：Design decisions — things Karajan deliberately does NOT do 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design-decisions.md`
- **Karajan Code — Plan de testing por niveles dogfooding**（project_doc）：Karajan Code — Plan de testing por niveles dogfooding 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/dogfooding-levels.md`
- **Golden tasks regression suite**（project_doc）：Status : Active introduced in v2.12.0 — KJC-TSK-0374 Implementation : src/golden/{schema,loader,asserter,runner}.js · fixtures in tests/golden/tasks/ · baseline in tests/golden/baseline.json 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/golden-tasks.md`
- **Instalar Karajan con 2 Instancias personal y profesional**（project_doc）：Instalar Karajan con 2 Instancias personal y profesional 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/install-two-instances.md`
- **Loop engineering**（project_doc）："Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead." 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/loop-engineering.md`
- **Karajan Multi-Instancia Guia Paso a Paso**（project_doc）：Karajan Multi-Instancia Guia Paso a Paso 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/multi-instance.md`
- **Parallel HU execution worktree lanes**（project_doc）：Parallel HU execution worktree lanes 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/parallel-hus.md`
- **Phase 1 — Cache propio: análisis técnico**（project_doc）：Phase 1 — Cache propio: análisis técnico 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/phase-1-cache-propio.md`
- **Plan adherence metric**（project_doc）：Status : Active introduced in v2.12.0 — KJC-TSK-0376 Implementation : src/audit/plan-adherence.js · integration in src/orchestrator/drivers/post-loop.js · rendering in src/session/journal/summary-writer.js 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/plan-adherence.md`
- **Extra providers via OpenCode Kimi, DeepSeek, local models…**（project_doc）：Extra providers via OpenCode Kimi, DeepSeek, local models… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/providers-via-opencode.md`
- **Simulating provider quota exhaustion KJ SIMULATE QUOTA**（project_doc）：Simulating provider quota exhaustion KJ SIMULATE QUOTA 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/quota-simulation.md`
- **OpenSkills integration**（project_doc）：Karajan auto-injects domain-specific skills into role prompts so each AI agent has the right context for the task at hand. This page documents how detection works, how skills are routed to roles, how the cache behaves, and how to customize the behavior. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/skills.md`
- **Spec Reviewer**（project_doc）：The spec-reviewer runs BEFORE every other role in the Karajan pipeline. It audits whatever the user passed to kj run or kj plan — a prompt string, the contents of --task-file foo.md , a piped spec — and surfaces deficiencies that would otherwise cause the pipeline to spend tokens on the wrong work. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/spec-reviewer.md`
- **Troubleshooting Guide**（project_doc）：Common issues and solutions when using Karajan Code. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/troubleshooting.md`
- **Version Update Checklist**（project_doc）：Checklist of files and locations to review and update when releasing a new version of Karajan Code. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/version-update-checklist.md`
- **Por qué JavaScript vanilla: la versión larga**（project_doc）：Por qué JavaScript vanilla: la versión larga 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/why-vanilla-js.md`
- **ADR: MCP Progress Notifications**（project_doc）：Karajan Code runs long-running tool calls kj run, kj code, kj review, kj plan that can take several minutes. During this time, the MCP host Claude Code, Codex CLI shows no feedback to the user unless the server actively sends progress updates. This ADR documents the available mechanisms, what the codebase already implements, and what hosts actually display. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/mcp-progress-notifications.md`
- **SKILL: kj audit**（project_doc）：Read-only analysis of a codebase. Surfaces god-functions, missing imports the bug class that took down a real demo on 2026-04-27 , oversized modules, structure smells, and planned, see issue 542 agent-readiness. Does NOT modify any file in the audited repo. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-audit.md`
- **SKILL: kj board**（project_doc）：Manages the HU Board — a local web dashboard Express + SQLite that visualises plans, HU statuses, sessions and the run timeline. It auto-starts when kj plan produces a batch and can be used standalone. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-board.md`
- **SKILL: kj clean**（project_doc）：Garbage-collects stale plans, sessions, HU batches and audit/review outputs under ~/.karajan/ . Honors per-category retention windows configured in ~/.karajan/kj.config.yml . Defaults are conservative 7 days for sessions, 30 days for plans . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-clean.md`
- **SKILL: kj doctor**（project_doc）：Runs a battery of environment checks Node version, AI CLIs detected, ports free, SonarQube reachable, RTK installed, MCP servers healthy, config file shape, secrets/tokens and auto-remediates what it safely can: starting Docker SonarQube containers, creating missing ~/.karajan/ directories, installing optional skill catalogs, etc. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-doctor.md`
- **SKILL: kj init**（project_doc）：One-time bootstrap for a project that wants to use Karajan: writes ~/.karajan/kj.config.yml global config , seeds /.karajan/ with role rule templates coder-rules, review-rules , brings up SonarQube via Docker and auto-generates the analysis token via the Sonar REST API , and walks the user through a wizard that covers all the meaningful runtime knobs: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-init.md`
- **SKILL: kj plan**（project_doc）：Manages plans — versioned JSON files that decompose a task into HUs atomic user stories with dependencies and acceptance tests. Plans live under ~/.kj/plans/ /plan- .json . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-plan.md`
- **SKILL: kj resume**（project_doc）：Resumes a paused, stopped or failed Karajan session by id. Sessions are persisted under ~/.karajan/sessions/ / ; each one carries a config snapshot so resumption preserves the original flags --no-sonar , --coder , etc. — no need to remember what the original kj run command looked like. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-resume.md`
- **SKILL: kj review**（project_doc）：Runs the reviewer role only against the current diff uncommitted changes by default; against a base ref if requested . Useful for \"second-opinion\" passes when you wrote code by hand and want Karajan's reviewer to weigh in without going through the full coder/iterate cycle. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-review.md`
- **SKILL: kj run**（project_doc）：Executes the full Karajan pipeline against a task: triage → researcher → architect → coder → reviewer → tester → SonarQube quality gate. Either against a one-shot task description or against a pre-generated plan multiple HUs . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agents/SKILL.kj-run.md`
- **Karajan v2: Native API Proxy — Implementation Plan**（project_doc）：Karajan v2: Native API Proxy — Implementation Plan 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/archive/v2-proxy-plan.md`
- **Karajan Code v2 — Proxy Layer Release Notes**（project_doc）：Karajan Code v2 — Proxy Layer Release Notes 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/archive/v2-release-notes.md`
- **Karajan Code - Docker**（project_doc）：Ejecuta Karajan Code sin instalar Node.js ni npm en tu maquina. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/es/DOCKER.md`
- **RAG — Retrieval-Augmented Generation**（project_doc）：RAG — Retrieval-Augmented Generation 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/es/RAG.md`
- **Karajan Code — Skills**（project_doc）：Los skills son cápsulas de conocimiento que los agentes cargan para mejorar sus capacidades. Se instalan globalmente vía OpenSkills https://github.com/openskills-project . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/es/SKILLS.md`
- **Autonomous Delivery — de spec a software funcionando, sin intervención humana**（project_doc）：Autonomous Delivery — de spec a software funcionando, sin intervención humana 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/specs/autonomous-delivery.md`
- **kj start — entrada del squad autónomo análisis técnico**（project_doc）：kj start — entrada del squad autónomo análisis técnico 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/specs/kj-start.md`
- **Quality Harness — kj harden + kj check análisis técnico**（project_doc）：Quality Harness — kj harden + kj check análisis técnico 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/specs/quality-harness.md`
- **Spike: Rediseño de kj doctor — separar sistema vs proyecto**（project_doc）：Spike: Rediseño de kj doctor — separar sistema vs proyecto 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/spikes/kj-doctor-redesign.md`
- **Template — kj architect**（project_doc）：Tienes una feature que requiere decisiones arquitectónicas antes de codear: estructura de capas, contratos entre módulos, patterns, schema de DB, integración con sistemas existentes. El architect devuelve un diseño con ADRs ligeros. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/architect.md`
- **Template — kj discover**（project_doc）：Tienes una tarea/feature en la cabeza pero no estás seguro de si está bien definida . El discover detecta: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/discover.md`
- **Template — kj plan generate**（project_doc）：📘 Antes de leer esta plantilla , lee spec-conventions.md spec-conventions.md . Cubre las 6 convenciones clave que el planner v2.14.1+ entiende EPICA prefix, scope exclusions, deps transversales, reuse, async observers, deps explícitas y los antipatrones detectados en dogfooding. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/plan-generate.md`
- **Template — kj refactorer**（project_doc）：Tienes código que funciona pero está mal estructurado y quieres mejorarlo sin cambiar el comportamiento externo. El refactorer: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/refactorer.md`
- **Template — kj researcher**（project_doc）：Necesitas que Karajan explore el codebase local antes de codear o de planificar. El researcher devuelve un JSON con: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/researcher.md`
- **Template — kj run**（project_doc）：Tienes una tarea concreta un bug fix, una mejora pequeña, una HU suelta que el coder puede atacar directamente. No uses esto para features grandes que necesitan descomposición — para eso usa kj plan generate y luego kj run --plan . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/run.md`
- **SPEC conventions for Karajan task files**（project_doc）：SPEC conventions for Karajan task files 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/task-templates/spec-conventions.md`
- **Karajan Code — Test Suite Overview**（project_doc）：Snapshot as of v2.10.0 : 4 358 tests across 373 files +53 in the agent-readiness cycle . All green on Node 20.x and 22.x. CI matrix dropped Node 18 in v2.8.0 engines.node bumped to =20.10.0; Node 18 LTS hit EOL on 2025-04-30 — see .github/workflows/ci.yml . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/TESTS.md`

## 证据索引

- 共索引 80 条证据。

- **Karajan Code — Agent-Facing Index**（documentation）：This directory is the AI-agent entry point for the Karajan Code repository. Humans look at the top-level README.md ../../README.md . Agents Cursor, Cline, Aider, generic Claude / Codex sessions come here. 证据：`docs/agents/README.md`
- **Karajan Code — Demo recordings**（documentation）：Scripts for recording reproducible asciinema demos of Karajan Code, plus the published .cast files when available. 证据：`docs/demos/README.md`
- **Task file templates**（documentation）：Plantillas y guía para los .md que pasas a los comandos de Karajan via --task-file . Sin estas, escribir un task file requiere ensayo y error caro cada kj plan generate cuesta $0.30–0.80 en LLM y 2–5 minutos . 证据：`docs/task-templates/README.md`
- **What is Karajan?**（documentation）：Local multi-agent coding orchestrator. TDD-first, MCP-based, vanilla JavaScript. 证据：`README.md`
- **Karajan Code Examples**（documentation）：express-notes-api ./express-notes-api/ 证据：`examples/README.md`
- **DNI Validator — Generated by Karajan Code**（documentation）：DNI Validator — Generated by Karajan Code 证据：`examples/dni-validator/README.md`
- **Express Notes API — Generated by Karajan Code**（documentation）：Express Notes API — Generated by Karajan Code 证据：`examples/express-notes-api/README.md`
- **@karajan/ai-trash**（documentation）：AI-proof trash: intercept destructive operations from an AI-driven shell rm -rf , truncation via , mv overwriting, destructive git ops, … and snapshot the affected paths to a bin the AI cannot reach before the command runs. 证据：`packages/ai-trash/README.md`
- **karajan-core**（documentation）：Shared modules for the Karajan Code CLI and @karajan/hu-board . Private workspace package — not published to npm. 证据：`packages/core/README.md`
- **Karajan HU Board**（documentation）：A web dashboard that visualizes all HU User Story stories managed by Karajan Code. Reads from ~/.karajan/hu-stories/ and ~/.karajan/sessions/ , groups by project, and provides a read-only kanban board with quality metrics and session timelines. 证据：`packages/hu-board/README.md`
- **karajan-code Python wrapper**（documentation）：Python wrapper for Karajan Code https://karajancode.com -- local multi-agent coding orchestrator. This package is not a reimplementation; it locates and delegates to the real Karajan Code binary. 证据：`wrappers/python/README.md`
- **Package**（package_manifest）：{ "name": "karajan-code", "version": "3.15.2", "description": "Local multi-agent coding orchestrator with TDD, SonarQube, and code review pipeline", "type": "module", "license": "AGPL-3.0", "author": "manufosela https://github.com/manufosela ", "homepage": "https://github.com/manufosela/karajan-code readme", "repository": { "type": "git", "url": "git+https://github.com/manufosela/karajan-code.git" }, "bugs": { "url": "https://github.com/manufosela/karajan-code/issues" }, "keywords": "ai", "orchestrator", "code-review", "tdd", "sonarqube", "multi-agent", "mcp", "cli" , "engines": { "node": " =22.12.0" }, "kj": { "harden": { "exclude": "wrappers", "packages" } }, "workspaces": "packages/ai-tr… 证据：`package.json`
- **Package**（package_manifest）：{ "name": "kj-demo", "version": "1.0.0", "type": "module", "scripts": { "test": "vitest run" }, "devDependencies": { "vitest": "^4.0.0" } } 证据：`examples/dni-validator/package.json`
- **Package**（package_manifest）：{ "name": "kj-demo-notes-api", "version": "1.0.0", "type": "module", "description": "Karajan Code demo — Express REST API built with AI pipeline", "scripts": { "test": "vitest run", "start": "node src/index.js" }, "dependencies": { "express": "^5.1.0" }, "devDependencies": { "vitest": "^4.0.0", "supertest": "^7.1.0" } } 证据：`examples/express-notes-api/package.json`
- **Package**（package_manifest）：{ "name": "@karajan/ai-trash", "version": "0.0.0", "description": "AI-proof trash: intercept destructive ops from an AI shell and snapshot them to an unreachable bin before execution", "type": "module", "license": "AGPL-3.0", "author": "Manu Fosela", "homepage": "https://github.com/manufosela/karajan-code/tree/main/packages/ai-trash readme", "repository": { "type": "git", "url": "git+https://github.com/manufosela/karajan-code.git", "directory": "packages/ai-trash" }, "bugs": { "url": "https://github.com/manufosela/karajan-code/issues" }, "keywords": "ai", "trash", "undo", "snapshot", "safety", "claude-code", "cursor", "aider" , "engines": { "node": " =22.12.0" }, "bin": { "kj-trash": "bin/k… 证据：`packages/ai-trash/package.json`
- **Package**（package_manifest）：{ "name": "karajan-core", "version": "1.3.1", "description": "Shared modules for Karajan Code CLI and @karajan/hu-board atomic-write, paths, RAG store, plan ops, process runner .", "type": "module", "license": "AGPL-3.0", "author": "manufosela", "repository": { "type": "git", "url": "git+https://github.com/manufosela/karajan-code.git", "directory": "packages/core" }, "files": "src/" , "engines": { "node": " =22.12.0" }, "exports": { "./atomic-write": "./src/atomic-write.js", "./db": "./src/db.js", "./worktree": "./src/worktree.js", "./slot-registry": "./src/slot-registry.js", "./rag/ ": "./src/rag/ .js", "./shared-paths": "./src/shared-paths.js", "./port-check": "./src/port-check.js", "./pa… 证据：`packages/core/package.json`
- **Package**（package_manifest）：{ "name": "@karajan/hu-board", "version": "1.0.0", "description": "HU Story Board dashboard for Karajan Code", "type": "module", "private": true, "engines": { "node": " =22.12.0" }, "scripts": { "start": "node src/server.js", "dev": "node --watch src/server.js", "test": "vitest run" }, "dependencies": { "karajan-core": " ", "better-sqlite3": "^12.10.0", "chokidar": "^5.0.0", "express": "^5.1.0", "express-rate-limit": "^8.5.0", "helmet": "^8.1.0", "js-yaml": "^4.2.0" }, "devDependencies": { "supertest": "^7.1.0", "vitest": "^4.0.0" } } 证据：`packages/hu-board/package.json`
- **KJ Default Workflow Codex**（documentation）：Objective Use Karajan Code KJ as the default orchestrator for implementing tasks and fixing bugs. 证据：`AGENTS.md`
- **KJ Default Workflow Claude Code**（documentation）：Objective Use Karajan Code KJ as the default orchestrator for implementing tasks and fixing bugs in this project. 证据：`CLAUDE.md`
- **Karajan Code — Architecture**（documentation）：Karajan is a local multi-agent coding orchestrator . It coordinates a pipeline of AI agents Claude, Codex, Gemini, Aider, OpenCode through specialized roles to plan, implement, test, and review code. 证据：`docs/ARCHITECTURE.md`
- **Getting Started with Karajan Code**（documentation）：- Node.js ≥ 22.22 Karajan v3.0.0 dropped Node 20 — see CHANGELOG for migration notes - Git - At least one AI CLI installed: claude , codex , gemini , aider , or opencode - Optional Docker for local SonarQube - RTK + Squeezr token efficiency — kj init installs both automatically. Opt out with --no-rtk / --no-squeezr if you don't want them. - QMD per-project semantic wiki — kj init registers docs/ , .reviews/ and .karajan/plans/ as searchable collections, and kj qmd query "..." runs against the active project. The RAG index serves the agent ; QMD serves you . Opt out with --no-qmd . 证据：`docs/GETTING-STARTED.md`
- **ADR-001: Role-Based AI Architecture**（documentation）：ADR-001: Role-Based AI Architecture 证据：`docs/adr/001-role-based-ai-architecture.md`
- **Karajan Code — Arquitectura**（documentation）：Karajan es un orquestador local multi-agente de código . Coordina un pipeline de agentes IA Claude, Codex, Gemini, Aider, OpenCode a través de roles especializados para planificar, implementar, testear y revisar código. 证据：`docs/es/ARCHITECTURE.md`
- **Primeros pasos con Karajan Code**（documentation）：- Node.js ≥ 22.22 Karajan v3.0.0 elimina soporte de Node 20 — ver CHANGELOG para notas de migración - Git - Al menos una CLI de IA instalada: claude , codex , gemini , aider u opencode - Opcional Docker para SonarQube local - RTK + Squeezr eficiencia de tokens — kj init los instala automáticamente. Para no usarlos, --no-rtk / --no-squeezr . - QMD wiki semántica por proyecto — kj init registra docs/ , .reviews/ y .karajan/plans/ como colecciones indexadas, y kj qmd query "..." consulta contra el proyecto activo. El índice RAG sirve al agente ; QMD te sirve a ti . Para no usarlo, --no-qmd . 证据：`docs/es/GETTING-STARTED.md`
- **Contributing**（documentation）：Open an issue with the exact command you ran, the output you got, and the output you expected. Without those three things the bug cannot be reproduced and the issue will be closed. 证据：`CONTRIBUTING.md`
- **License**（source_file）：GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 证据：`LICENSE`
- **Karajan cleanup — kj clean**（documentation）：kj clean is a read-only by default garbage collector that surfaces stale state accumulated by Karajan so the user can decide what to drop. It never executes destructive commands on its own — every layer prints a copy-paste command you can run if you want to actually delete. 证据：`docs/CLEANUP.md`
- **Karajan Code vs AI Frameworks**（documentation）：While Genkit, Mastra, LangChain and Vercel AI SDK call /v1/messages , Karajan orchestrates the AI CLIs your developers already use in their terminals. 证据：`docs/COMPARISON.md`
- **Karajan Code - Docker**（documentation）：Run Karajan Code without installing Node.js or npm on your host machine. 证据：`docs/DOCKER.md`
- **Hardening Your Dev Environment Against AI Tools**（documentation）：Hardening Your Dev Environment Against AI Tools 证据：`docs/HARDENING-AGAINST-AI.md`
- **RAG — Retrieval-Augmented Generation**（documentation）：RAG — Retrieval-Augmented Generation 证据：`docs/RAG.md`
- **Que es Karajan?**（documentation）：Orquestador local multi-agente. TDD-first, basado en MCP, JavaScript vanilla. 证据：`docs/README.es.md`
- **ai-trash — Fase 1 KJC-TSK-0386**（documentation）：Stack Node 22 ESM compilado a Single Executable App node --experimental-sea-config . Reutiliza release-binaries.yml . 证据：`docs/ai-trash-fase1-report.md`
- **ai-trash — Fase 2 plan KJC-TSK-0387**（documentation）：ai-trash — Fase 2 plan KJC-TSK-0387 证据：`docs/ai-trash-fase2-plan.md`
- **Audit false positives — verified non-removable dependencies**（documentation）：Audit false positives — verified non-removable dependencies 证据：`docs/audit-false-positives.md`
- **Brain decisor**（documentation）：Karajan's Brain is now the pipeline's decisor: it reads the triage output plus the task text, classifies intent, and decides which roles should run for the current task. The existing flag-based stage execution continues to drive runFlow — Brain just tells it which flags should be on. 证据：`docs/brain-decisor.md`
- **Custom Roles & Agents**（documentation）：How to customize and extend Karajan Code with your own roles and agents. 证据：`docs/custom-roles.md`
- **Design decisions — things Karajan deliberately does NOT do**（documentation）：Design decisions — things Karajan deliberately does NOT do 证据：`docs/design-decisions.md`
- **Karajan Code — Plan de testing por niveles dogfooding**（documentation）：Karajan Code — Plan de testing por niveles dogfooding 证据：`docs/dogfooding-levels.md`
- **Golden tasks regression suite**（documentation）：Status : Active introduced in v2.12.0 — KJC-TSK-0374 Implementation : src/golden/{schema,loader,asserter,runner}.js · fixtures in tests/golden/tasks/ · baseline in tests/golden/baseline.json 证据：`docs/golden-tasks.md`
- **Instalar Karajan con 2 Instancias personal y profesional**（documentation）：Instalar Karajan con 2 Instancias personal y profesional 证据：`docs/install-two-instances.md`
- **Loop engineering**（documentation）："Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead." 证据：`docs/loop-engineering.md`
- **Karajan Multi-Instancia Guia Paso a Paso**（documentation）：Karajan Multi-Instancia Guia Paso a Paso 证据：`docs/multi-instance.md`
- **Parallel HU execution worktree lanes**（documentation）：Parallel HU execution worktree lanes 证据：`docs/parallel-hus.md`
- **Phase 1 — Cache propio: análisis técnico**（documentation）：Phase 1 — Cache propio: análisis técnico 证据：`docs/phase-1-cache-propio.md`
- **Plan adherence metric**（documentation）：Status : Active introduced in v2.12.0 — KJC-TSK-0376 Implementation : src/audit/plan-adherence.js · integration in src/orchestrator/drivers/post-loop.js · rendering in src/session/journal/summary-writer.js 证据：`docs/plan-adherence.md`
- **Extra providers via OpenCode Kimi, DeepSeek, local models…**（documentation）：Extra providers via OpenCode Kimi, DeepSeek, local models… 证据：`docs/providers-via-opencode.md`
- **Simulating provider quota exhaustion KJ SIMULATE QUOTA**（documentation）：Simulating provider quota exhaustion KJ SIMULATE QUOTA 证据：`docs/quota-simulation.md`
- **OpenSkills integration**（documentation）：Karajan auto-injects domain-specific skills into role prompts so each AI agent has the right context for the task at hand. This page documents how detection works, how skills are routed to roles, how the cache behaves, and how to customize the behavior. 证据：`docs/skills.md`
- **Spec Reviewer**（documentation）：The spec-reviewer runs BEFORE every other role in the Karajan pipeline. It audits whatever the user passed to kj run or kj plan — a prompt string, the contents of --task-file foo.md , a piped spec — and surfaces deficiencies that would otherwise cause the pipeline to spend tokens on the wrong work. 证据：`docs/spec-reviewer.md`
- **Troubleshooting Guide**（documentation）：Common issues and solutions when using Karajan Code. 证据：`docs/troubleshooting.md`
- **Version Update Checklist**（documentation）：Checklist of files and locations to review and update when releasing a new version of Karajan Code. 证据：`docs/version-update-checklist.md`
- **Por qué JavaScript vanilla: la versión larga**（documentation）：Por qué JavaScript vanilla: la versión larga 证据：`docs/why-vanilla-js.md`
- **ADR: MCP Progress Notifications**（documentation）：Karajan Code runs long-running tool calls kj run, kj code, kj review, kj plan that can take several minutes. During this time, the MCP host Claude Code, Codex CLI shows no feedback to the user unless the server actively sends progress updates. This ADR documents the available mechanisms, what the codebase already implements, and what hosts actually display. 证据：`docs/adr/mcp-progress-notifications.md`
- **SKILL: kj audit**（documentation）：Read-only analysis of a codebase. Surfaces god-functions, missing imports the bug class that took down a real demo on 2026-04-27 , oversized modules, structure smells, and planned, see issue 542 agent-readiness. Does NOT modify any file in the audited repo. 证据：`docs/agents/SKILL.kj-audit.md`
- **SKILL: kj board**（documentation）：Manages the HU Board — a local web dashboard Express + SQLite that visualises plans, HU statuses, sessions and the run timeline. It auto-starts when kj plan produces a batch and can be used standalone. 证据：`docs/agents/SKILL.kj-board.md`
- **SKILL: kj clean**（documentation）：Garbage-collects stale plans, sessions, HU batches and audit/review outputs under ~/.karajan/ . Honors per-category retention windows configured in ~/.karajan/kj.config.yml . Defaults are conservative 7 days for sessions, 30 days for plans . 证据：`docs/agents/SKILL.kj-clean.md`
- **SKILL: kj doctor**（documentation）：Runs a battery of environment checks Node version, AI CLIs detected, ports free, SonarQube reachable, RTK installed, MCP servers healthy, config file shape, secrets/tokens and auto-remediates what it safely can: starting Docker SonarQube containers, creating missing ~/.karajan/ directories, installing optional skill catalogs, etc. 证据：`docs/agents/SKILL.kj-doctor.md`
- **SKILL: kj init**（documentation）：One-time bootstrap for a project that wants to use Karajan: writes ~/.karajan/kj.config.yml global config , seeds /.karajan/ with role rule templates coder-rules, review-rules , brings up SonarQube via Docker and auto-generates the analysis token via the Sonar REST API , and walks the user through a wizard that covers all the meaningful runtime knobs: 证据：`docs/agents/SKILL.kj-init.md`
- **SKILL: kj plan**（documentation）：Manages plans — versioned JSON files that decompose a task into HUs atomic user stories with dependencies and acceptance tests. Plans live under ~/.kj/plans/ /plan- .json . 证据：`docs/agents/SKILL.kj-plan.md`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/agents/README.md`, `docs/demos/README.md`, `docs/task-templates/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/agents/README.md`, `docs/demos/README.md`, `docs/task-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, docs/GETTING-STARTED.md, package.json, bin/kj.js, bin/karajan-mcp.js
- **系统架构、流水线与角色**：importance `high`
  - source_paths: docs/ARCHITECTURE.md, src/orchestrator.js, src/mcp/server.js, src/mcp/tools.js, src/roles/index.js
- **核心功能：规划、HUs、RAG 与质量保障**：importance `high`
  - source_paths: src/plan, src/commands/plan, src/hu, src/orchestrator/hu-scheduler.js, src/orchestrator/iteration-gate.js
- **部署、安装配置文件与故障排除**：importance `high`
  - source_paths: scripts/install-kj.sh, scripts/install-binary.sh, scripts/install-binary.ps1, scripts/build-sea.mjs, Dockerfile

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `2edaee8e546d1877c3cdbb7d30cdf5f31f5e80c8`
- inspected_files: `Dockerfile`, `README.md`, `docker-compose.yml`, `package.json`, `docs/ARCHITECTURE.md`, `docs/CLEANUP.md`, `docs/COMPARISON.md`, `docs/DOCKER.md`, `docs/GETTING-STARTED.md`, `docs/HARDENING-AGAINST-AI.md`, `docs/RAG.md`, `docs/README.es.md`, `docs/TESTS.md`, `docs/adr/001-role-based-ai-architecture.md`, `docs/adr/mcp-progress-notifications.md`, `docs/agents/README.md`, `docs/agents/SKILL.kj-audit.md`, `docs/agents/SKILL.kj-board.md`, `docs/agents/SKILL.kj-clean.md`, `docs/agents/SKILL.kj-doctor.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: 失败模式：installation: [nightly-drift] Drift detected by nightly CI

- Trigger: Developers should check this installation risk before relying on the project: [nightly-drift] Drift detected by nightly CI
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: [nightly-drift] Drift detected by nightly CI. Context: Observed when using node, windows
- Why it matters: Developers may fail before the first successful local run: [nightly-drift] Drift detected by nightly CI
- Evidence: failure_mode_cluster:github_issue | https://github.com/manufosela/karajan-code/issues/994 | [nightly-drift] Drift detected by nightly CI
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 失败模式：installation: v3.12.2

- Trigger: Developers should check this installation risk before relying on the project: v3.12.2
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.12.2. Context: Observed when using node
- Why it matters: Upgrade or migration may change expected behavior: v3.12.2
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.12.2 | v3.12.2
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 失败模式：installation: v3.12.3

- Trigger: Developers should check this installation risk before relying on the project: v3.12.3
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.12.3. Context: Observed when using node, python
- Why it matters: Upgrade or migration may change expected behavior: v3.12.3
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.12.3 | v3.12.3
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 失败模式：installation: v3.13.0

- Trigger: Developers should check this installation risk before relying on the project: v3.13.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.13.0. Context: Observed when using node
- Why it matters: Upgrade or migration may change expected behavior: v3.13.0
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.13.0 | v3.13.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 失败模式：installation: v3.14.0

- Trigger: Developers should check this installation risk before relying on the project: v3.14.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.14.0. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v3.14.0
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.14.0 | v3.14.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 失败模式：installation: v3.15.0

- Trigger: Developers should check this installation risk before relying on the project: v3.15.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.15.0. Context: Observed when using node, docker
- Why it matters: Upgrade or migration may change expected behavior: v3.15.0
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.15.0 | v3.15.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 失败模式：installation: v3.15.1

- Trigger: Developers should check this installation risk before relying on the project: v3.15.1
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.15.1. Context: Observed when using node
- Why it matters: Upgrade or migration may change expected behavior: v3.15.1
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.15.1 | v3.15.1
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 失败模式：installation: v3.15.2

- Trigger: Developers should check this installation risk before relying on the project: v3.15.2
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.15.2. Context: Observed when using node
- Why it matters: Upgrade or migration may change expected behavior: v3.15.2
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.15.2 | v3.15.2
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

### Constraint 10: 失败模式：configuration: v3.14.1

- Trigger: Developers should check this configuration risk before relying on the project: v3.14.1
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v3.14.1. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v3.14.1
- Evidence: failure_mode_cluster:github_release | https://github.com/manufosela/karajan-code/releases/tag/v3.14.1 | v3.14.1
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
