cairn-ai 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.agents/workflows/cairn-doctor.md +2 -11
  2. package/.agents/workflows/cairn-install.md +1 -5
  3. package/.agents/workflows/cairn-memory.md +3 -1
  4. package/.agents/workflows/cairn-plan.md +6 -4
  5. package/.agents/workflows/cairn-review.md +3 -1
  6. package/.agents/workflows/cairn-toolcheck.md +2 -10
  7. package/.agents/workflows/cairn-uninstall.md +1 -11
  8. package/.agents/workflows/cairn-upgrade.md +1 -5
  9. package/.agents/workflows/cairn-work.md +4 -2
  10. package/.claude/agents/explorer.md +1 -1
  11. package/.claude/agents/worker.md +1 -1
  12. package/.claude/commands/cairn-doctor.md +1 -9
  13. package/.claude/commands/cairn-install.md +1 -5
  14. package/.claude/commands/cairn-memory.md +1 -1
  15. package/.claude/commands/cairn-plan.md +1 -1
  16. package/.claude/commands/cairn-review.md +1 -1
  17. package/.claude/commands/cairn-toolcheck.md +2 -5
  18. package/.claude/commands/cairn-uninstall.md +1 -9
  19. package/.claude/commands/cairn-upgrade.md +1 -5
  20. package/.claude/commands/cairn-work.md +1 -1
  21. package/.codex-plugin/plugin.json +6 -1
  22. package/README.de.md +5 -5
  23. package/README.es.md +5 -5
  24. package/README.fr.md +5 -5
  25. package/README.ja.md +5 -5
  26. package/README.ko.md +11 -8
  27. package/README.md +11 -8
  28. package/README.pt.md +5 -5
  29. package/README.zh.md +5 -5
  30. package/commands/cairn-doctor.md +2 -7
  31. package/commands/cairn-install.md +4 -7
  32. package/commands/cairn-memory.md +3 -3
  33. package/commands/cairn-plan.md +8 -7
  34. package/commands/cairn-review.md +3 -3
  35. package/commands/cairn-toolcheck.md +4 -6
  36. package/commands/cairn-uninstall.md +1 -7
  37. package/commands/cairn-upgrade.md +4 -7
  38. package/commands/cairn-work.md +10 -8
  39. package/docs/model-guidance/README.md +9 -6
  40. package/docs/model-guidance/claude.md +1 -1
  41. package/docs/model-guidance/codex.md +1 -1
  42. package/hooks/hooks.json +5 -5
  43. package/package.json +2 -2
  44. package/scripts/cairn-goal.mjs +539 -0
  45. package/scripts/cairn-lifecycle.mjs +140 -7
  46. package/scripts/cairn-paths.mjs +103 -0
  47. package/scripts/cairn-state.mjs +183 -131
  48. package/scripts/cairn-state.sh +68 -8
  49. package/scripts/cairn-toolcheck.mjs +312 -79
  50. package/scripts/cairn.mjs +54 -43
  51. package/skills/cairn-memory/SKILL.md +9 -3
  52. package/skills/cairn-plan/SKILL.md +26 -10
  53. package/skills/cairn-review/SKILL.md +5 -2
  54. package/skills/cairn-work/SKILL.md +34 -13
  55. package/templates/MEMORY.md +1 -1
  56. package/templates/PLAN.md +1 -0
  57. package/templates/work-plan.md +21 -4
package/README.pt.md CHANGED
@@ -33,8 +33,8 @@ O path escolhido e sua justificativa sao registrados em `docs/plan/<topic>.md` q
33
33
  `cairn toolcheck` inspeciona o repositorio atual para stacks JavaScript, TypeScript, Python, PHP, Java, Kotlin, Swift, Go e Rust, depois verifica os LSP e verification tools correspondentes.
34
34
 
35
35
  ```sh
36
- cairn toolcheck
37
- cairn toolcheck --install
36
+ cairn toolcheck --root .
37
+ cairn toolcheck --install --yes --root .
38
38
  ```
39
39
 
40
40
  - `toolcheck` informa detected stacks e missing tools.
@@ -57,7 +57,7 @@ Cairn aplica model-specific adjustment apenas a modelos Claude-family e Codex-fa
57
57
  - Claude-family: util para long context, policy interpretation e plan/evidence review.
58
58
  - Codex-family: util para small implementation tasks, explicit file edits, command-based verification e bounded `worker` tasks.
59
59
 
60
- A orientacao detalhada fica em `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` e `docs/model-guidance/codex.md`.
60
+ A orientação detalhada fica no plugin instalado em `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md` e `cairn://docs/model-guidance/codex.md`.
61
61
 
62
62
  ## Repository Artifacts
63
63
 
@@ -65,7 +65,7 @@ O harness cria e mantem estes arquivos na raiz do repositorio alvo.
65
65
 
66
66
  - `MEMORY.md`: indice curto de persistent domain knowledge.
67
67
  - `docs/memory/*.md`: conhecimento detalhado por dominio.
68
- - `docs/model-guidance/*.md`: Claude and Codex model adjustment guidance.
68
+ - `.cairn/state.json`: estado git-ignored de goal, task e receipt para retomada e stop gates com escopo.
69
69
  - `PLAN.md`: indice curto de active and completed work topics.
70
70
  - `docs/plan/*.md`: detailed execution plans.
71
71
 
@@ -119,7 +119,7 @@ Codex-only hooks nao sao portados para Antigravity. Em vez disso, os mesmos proc
119
119
 
120
120
  ## Locale Policy
121
121
 
122
- As instrucoes reutilizaveis do Cairn sao escritas em English para global use. User-visible output deve seguir o OS locale configurado, a menos que o usuario peca explicitamente outro idioma. A CLI localiza mensagens comuns para `en`, `ko`, `ja`, `zh`, `es`, `fr`, `de` e `pt`, e volta para English em unsupported locales. O texto `statusMessage` dos Codex hooks permanece static English, enquanto hook command output e English ou Korean.
122
+ As instrucoes reutilizaveis do Cairn sao escritas em English para global use. User-visible output e documentation, plans e memory artifacts gerados ou atualizados devem seguir o OS locale configurado, a menos que o usuario peca explicitamente outro idioma. Isso inclui conteudo em `MEMORY.md`, `PLAN.md`, `docs/memory` e `docs/plan`. A CLI localiza mensagens comuns para `en`, `ko`, `ja`, `zh`, `es`, `fr`, `de` e `pt`, e volta para English em unsupported locales. O texto `statusMessage` dos Codex hooks permanece static English, enquanto hook command output e English ou Korean.
123
123
 
124
124
  ## Delegation
125
125
 
package/README.zh.md CHANGED
@@ -33,8 +33,8 @@ Cairn 在 execution policy 上刻意不同于 LazyCodex。它不采用 LazyCodex
33
33
  `cairn toolcheck` 会检查当前 repository 中的 JavaScript、TypeScript、Python、PHP、Java、Kotlin、Swift、Go 和 Rust stacks,然后检查匹配的 LSP 和 verification tools。
34
34
 
35
35
  ```sh
36
- cairn toolcheck
37
- cairn toolcheck --install
36
+ cairn toolcheck --root .
37
+ cairn toolcheck --install --yes --root .
38
38
  ```
39
39
 
40
40
  - `toolcheck` 报告 detected stacks 和 missing tools。
@@ -57,7 +57,7 @@ Cairn 只对 Claude-family 和 Codex-family models 应用 model-specific adjustm
57
57
  - Claude-family: 适合 long context、policy interpretation 和 plan/evidence review。
58
58
  - Codex-family: 适合 small implementation tasks、explicit file edits、command-based verification 和 bounded `worker` tasks。
59
59
 
60
- 详细指南位于 `docs/model-guidance/README.md`、`docs/model-guidance/claude.md` 和 `docs/model-guidance/codex.md`。
60
+ 详细指南位于已安装插件的 `cairn://docs/model-guidance/README.md`、`cairn://docs/model-guidance/claude.md` 和 `cairn://docs/model-guidance/codex.md`。
61
61
 
62
62
  ## Repository Artifacts
63
63
 
@@ -65,7 +65,7 @@ harness 会在目标 repository root 创建并维护这些文件。
65
65
 
66
66
  - `MEMORY.md`: persistent domain knowledge 的短索引。
67
67
  - `docs/memory/*.md`: 按 domain 记录的详细 knowledge。
68
- - `docs/model-guidance/*.md`: Claude 和 Codex model adjustment guidance。
68
+ - `.cairn/state.json`: 用于中断恢复和 scoped stop gate 的 git-ignored goal/task/receipt 状态。
69
69
  - `PLAN.md`: active 和 completed work topics 的短索引。
70
70
  - `docs/plan/*.md`: detailed execution plans。
71
71
 
@@ -119,7 +119,7 @@ Codex-only hooks 不会移植到 Antigravity。相同的 planning、memory、com
119
119
 
120
120
  ## Locale Policy
121
121
 
122
- Cairn 的 reusable instructions 为了 global use 使用英文编写。除非用户明确要求其他语言,user-visible output 应遵循 configured OS locale。CLI 会本地化 `en`、`ko`、`ja`、`zh`、`es`、`fr`、`de` 和 `pt` 的 common messages,不支持的 locales fallback 到 English。Codex hook `statusMessage` text 保持 static English,而 hook command output 为 English 或 Korean。
122
+ Cairn 的 reusable instructions 为了 global use 使用英文编写。除非用户明确要求其他语言,user-visible output 以及生成或更新的 documentation、plans、memory artifacts 应遵循 configured OS locale。这包括 `MEMORY.md`、`PLAN.md`、`docs/memory` 和 `docs/plan` 内容。CLI 会本地化 `en`、`ko`、`ja`、`zh`、`es`、`fr`、`de` 和 `pt` 的 common messages,不支持的 locales fallback 到 English。Codex hook `statusMessage` text 保持 static English,而 hook command output 为 English 或 Korean。
123
123
 
124
124
  ## Delegation
125
125
 
@@ -2,13 +2,7 @@
2
2
 
3
3
  Goal: diagnose Cairn installation status.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- node scripts/cairn.mjs doctor
9
- ```
10
-
11
- With the published package:
5
+ Run from the published or global package:
12
6
 
13
7
  ```sh
14
8
  bunx cairn-ai@latest doctor
@@ -26,3 +20,4 @@ Checks:
26
20
  - hook trust state.
27
21
  - Claude Code commands and agents mirror files.
28
22
  - Antigravity IDE/CLI skills and workflows mirror files.
23
+ - Installed runtime locators and their referenced scripts, templates, and model guidance.
@@ -2,18 +2,14 @@
2
2
 
3
3
  Goal: install Cairn into Codex, Claude Code, and Antigravity.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- node scripts/cairn.mjs install
9
- ```
10
-
11
- With the published package:
5
+ Run from the published or global package, not from the installed cache copy:
12
6
 
13
7
  ```sh
14
8
  bunx cairn-ai@latest install
15
9
  ```
16
10
 
11
+ The current custom lifecycle remains in use. Do not invoke lifecycle install/upgrade from the cached plugin root because that copy is the replacement target.
12
+
17
13
  Actions:
18
14
 
19
15
  - Copy the Cairn installation into the Codex marketplace cache.
@@ -21,4 +17,5 @@ Actions:
21
17
  - Register marketplace, plugin, and hook trust state in `~/.codex/config.toml`.
22
18
  - Install `cairn-*` commands and agents mirror files for Claude Code.
23
19
  - Install `cairn-*` skills and workflows mirror files for Antigravity IDE/CLI.
20
+ - Write runtime locators so all mirrors resolve scripts, templates, and model guidance from the installed plugin root.
24
21
  - Create `*.cairn-backup-*` backups before changing settings.
@@ -2,16 +2,16 @@
2
2
 
3
3
  Use the `cairn-memory` skill.
4
4
 
5
- Prerequisite: if `node scripts/cairn.mjs doctor` fails, restore installation with `node scripts/cairn.mjs install` or `node scripts/cairn.mjs upgrade`.
5
+ Prerequisite: resolve the installed Cairn runtime from the plugin or skill locator. If `cairn doctor` fails, restore it with the published/global lifecycle command. Never look for Cairn scripts in the target repository.
6
6
 
7
7
  Goal: create or update repository memory without asking the user for discoverable facts.
8
8
 
9
9
  Procedure:
10
10
 
11
- 1. Run the plugin state initialization script.
11
+ 1. Run the installed plugin state initialization script with an explicit target `--root`.
12
12
  2. Every agent must read the project-root `MEMORY.md` for domain knowledge and repository policy before assigned discovery or update work.
13
13
  3. Explore repository facts with focused tools.
14
14
  4. Use `explorer` for read-only domain discovery and contradiction checks when available; use `worker` for exact references, command checks, and bounded evidence capture. When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Tell every delegated agent and child subagent to read the project-root `MEMORY.md` before work, keep scope, and preserve others' edits.
15
15
  5. Write details to `docs/memory/<domain>.md`.
16
16
  6. Keep `MEMORY.md` as a short index.
17
- 7. Use the OS locale for user-visible output unless the user asks for another language.
17
+ 7. Use the OS locale for user-visible responses and generated or updated documentation, plans, and memory artifacts unless the user asks for another language.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use the `cairn-plan` skill.
4
4
 
5
- Prerequisite: if `node scripts/cairn.mjs doctor` fails, restore installation with `node scripts/cairn.mjs install` or `node scripts/cairn.mjs upgrade`.
5
+ Prerequisite: resolve the installed Cairn runtime from the plugin or skill locator. If `cairn doctor` fails, restore it with the published/global lifecycle command. Never look for Cairn scripts, templates, or model guidance in the target repository.
6
6
 
7
7
  Goal: leave a decision-complete plan for the current task in files before non-trivial implementation.
8
8
 
@@ -10,9 +10,9 @@ Procedure:
10
10
 
11
11
  1. Every agent must read the project-root `MEMORY.md` for domain knowledge and repository policy before repository exploration, tool selection, work, or delegation.
12
12
  2. Read relevant `docs/memory/*.md`.
13
- 3. If the active or assigned model is Claude-family, read `docs/model-guidance/claude.md`; if Codex-family, read `docs/model-guidance/codex.md`.
14
- 4. Run `node scripts/cairn.mjs toolcheck` when available.
15
- 5. If required LSP/check tools are missing, run `node scripts/cairn.mjs toolcheck --install` or a repository-native install command before accepting a fallback.
13
+ 3. If the active or assigned model is Claude-family, read `cairn://docs/model-guidance/claude.md`; if Codex-family, read `cairn://docs/model-guidance/codex.md`, resolving it through the installed runtime.
14
+ 4. Run the installed runtime's `toolcheck --root <repoRoot>`.
15
+ 5. If required LSP/check tools are missing, report the proposed install and obtain explicit user approval. Only then use `toolcheck --install --yes --root <repoRoot>` for pinned/supported installers or the approved repository-native command.
16
16
  6. Explore before asking the user.
17
17
  7. Understand the whole work and affected surfaces first, then classify it into small executable tasks. If a task is still too broad to verify cleanly, split it into sub-tasks.
18
18
  8. Run complexity triage before applying agent, plugin, or delegated workflow guidance, and record it before mutating files.
@@ -21,6 +21,7 @@ Procedure:
21
21
  11. Treat the user-called/main agent as the orchestrator: it plans, assigns, verifies, relays received subagent status events or observable lifecycle events to the user, and records evidence. Use `worker` for actual implementation edits with clear file ownership whenever subagent tools are available, on both Light Path and Heavy Path. When the subagent tool provides a progress-reporting channel, require subagents to report status when starting work, when deciding or confirming direction, during periodic progress, and when finishing; immediately relay received status events to the user. If no mid-run reporting channel exists, relay observable events such as assignment, waiting, and final completion. Require delegated subagents to provide a final report before leaving; after capturing the final report and evidence, close or release the completed subagent, then review the final report and evidence before marking the work complete. When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Tell every delegated agent and child subagent to read the project-root `MEMORY.md` before work, keep scope, and preserve others' edits. If subagent tools are unavailable, the main agent takes over implementation directly and records that takeover in evidence.
22
22
  12. Write `docs/plan/<topic>.md`.
23
23
  13. Add the topic link and status to `PLAN.md`.
24
- 14. Put the selected Light/Heavy Path, checked Heavy Path signals, tool readiness, module acceptance verification, and surface integration verification on every module task.
25
- 15. For Heavy Path, include an explicit automated test command and `Tests:` evidence line; Heavy Path completion must not rely on generic verification wording alone.
26
- 16. Use the OS locale for user-visible output unless the user asks for another language.
24
+ 14. Give the plan and every task stable IDs plus fail-closed task and goal evidence requirements. If implementation was requested, start or attach the Cairn goal after planning; do not activate a goal for plan-only requests.
25
+ 15. Put the selected Light/Heavy Path, checked Heavy Path signals, tool readiness, module acceptance verification, and surface integration verification on every module task.
26
+ 16. For Heavy Path, include an explicit automated test command and `Tests:` evidence line; Heavy Path completion must not rely on generic verification wording alone.
27
+ 17. Use the OS locale for user-visible responses and generated or updated documentation, plans, and memory artifacts unless the user asks for another language.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use the `cairn-review` skill.
4
4
 
5
- Prerequisite: if `node scripts/cairn.mjs doctor` fails, restore installation with `node scripts/cairn.mjs install` or `node scripts/cairn.mjs upgrade`.
5
+ Prerequisite: resolve Cairn from its installed runtime locator. If `cairn doctor` fails, restore it with the published/global lifecycle command. Never look for Cairn runtime files in the target repository.
6
6
 
7
7
  Goal: review completed work against plan, memory, policy, and evidence.
8
8
 
@@ -12,5 +12,5 @@ Procedure:
12
12
  2. Check changed files, tool readiness evidence, and verification evidence.
13
13
  3. Delegate independent read-only review to `explorer` when it materially improves speed or quality; use `worker` only for scoped verification reruns or QA artifacts. When subagent tools are available, each agent may recursively delegate bounded sub-tasks to subagents. Tell every delegated agent and child subagent to read the project-root `MEMORY.md` before work, keep scope, and preserve others' edits.
14
14
  4. Report findings first, ordered by severity, with file and line references. If no issues are found, say so clearly and mention remaining test gaps or residual risk.
15
- 5. Record review evidence in `docs/plan/<topic>.md`.
16
- 6. Use the OS locale for user-visible output unless the user asks for another language.
15
+ 5. Record review evidence in `docs/plan/<topic>.md` and as the goal-level final review receipt before completing the goal.
16
+ 6. Use the OS locale for user-visible responses and generated or updated documentation, plans, and memory artifacts unless the user asks for another language.
@@ -5,15 +5,13 @@ Goal: detect repository stacks and check required LSP, typecheck, lint, dry-run,
5
5
  From a globally installed package:
6
6
 
7
7
  ```sh
8
- bunx cairn-ai@latest toolcheck
9
- bunx cairn-ai@latest toolcheck --install
8
+ bunx cairn-ai@latest toolcheck --root /path/to/repository
10
9
  ```
11
10
 
12
- From this repository:
11
+ From the installed plugin runtime (resolve `pluginRoot` from its locator, not the target repository):
13
12
 
14
13
  ```sh
15
- node scripts/cairn.mjs toolcheck
16
- node scripts/cairn.mjs toolcheck --install
14
+ node "<pluginRoot>/scripts/cairn.mjs" toolcheck --root "/path/to/repository"
17
15
  ```
18
16
 
19
- Use `--install` when a required tool is missing. Record detected stacks, missing tools, install attempts, and blockers in the related `docs/plan/<topic>.md`.
17
+ Default toolcheck is read-only. When a required tool is missing, report the proposed change and obtain explicit user approval. Only then use `--install --yes`; unpinned or unsupported installers remain unavailable. Record detected stacks, missing tools, approvals, install attempts, timeouts, and blockers in the related `docs/plan/<topic>.md`.
@@ -2,13 +2,7 @@
2
2
 
3
3
  Goal: remove the Codex, Claude Code, and Antigravity entries installed by Cairn.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- node scripts/cairn.mjs uninstall
9
- ```
10
-
11
- With the published package:
5
+ Run from the published or global package:
12
6
 
13
7
  ```sh
14
8
  bunx cairn-ai@latest uninstall
@@ -2,22 +2,19 @@
2
2
 
3
3
  Goal: update the Cairn installation from the current source.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- node scripts/cairn.mjs upgrade
9
- ```
10
-
11
- With the published package:
5
+ Run from the published or global package, not from the installed cache copy:
12
6
 
13
7
  ```sh
14
8
  bunx cairn-ai@latest upgrade
15
9
  ```
16
10
 
11
+ The current custom lifecycle remains in use. The cached plugin root is a replacement target and must not upgrade itself.
12
+
17
13
  Actions:
18
14
 
19
15
  - Replace the Cairn installation in the Codex cache.
20
16
  - Recompute hook trust state and update settings.
21
17
  - Overwrite Claude Code mirror files with the latest content.
22
18
  - Overwrite Antigravity IDE/CLI skills and workflows mirror files with the latest content.
19
+ - Refresh runtime locators for every installed surface.
23
20
  - Create `*.cairn-backup-*` backups before changing settings.
@@ -2,17 +2,17 @@
2
2
 
3
3
  Use the `cairn-work` skill.
4
4
 
5
- Prerequisite: if `node scripts/cairn.mjs doctor` fails, restore installation with `node scripts/cairn.mjs install` or `node scripts/cairn.mjs upgrade`.
5
+ Prerequisite: resolve the installed Cairn runtime from the plugin or skill locator. If `cairn doctor` fails, restore it with the published/global lifecycle command. Never look for Cairn scripts or model guidance in the target repository.
6
6
 
7
- Goal: execute the next incomplete module task in `PLAN.md` without bypassing the recorded complexity triage.
7
+ Goal: execute the active goal's current task without bypassing complexity triage, then keep advancing tasks until goal-level final review completes or the goal is explicitly paused, blocked, or cancelled.
8
8
 
9
9
  Procedure:
10
10
 
11
11
  1. Every agent must read the project-root `MEMORY.md` for domain knowledge and repository policy before selecting or executing a task.
12
12
  2. Read `PLAN.md`, the detailed plan, and relevant memory notes.
13
- 3. Read the Codex or Claude model guidance recorded in the plan.
14
- 4. Select one small module task.
15
- 5. Confirm required tool readiness. If a required LSP/check tool is missing, run `node scripts/cairn.mjs toolcheck --install` or a repository-native install command before accepting a fallback.
13
+ 3. Resolve and read the `cairn://` Codex or Claude model guidance recorded in the plan through the installed runtime.
14
+ 4. Read Cairn goal status and select only its current task. If implementation was requested but no goal exists, create it from the decision-complete plan.
15
+ 5. Confirm required tool readiness. If a required LSP/check tool is missing, report it and obtain explicit user approval before `toolcheck --install --yes` or a repository-native install command.
16
16
  6. Confirm the complexity triage and selected Light/Heavy Path recorded in the plan. If missing, update the plan before mutating files.
17
17
  7. For Light Path, keep the user-called/main agent in the orchestrator role and delegate implementation edits to one bounded `worker` whenever subagent tools are available, then run focused verification.
18
18
  8. For Heavy Path, follow the plan's staged implementation and review gates without role-mapping shortcuts.
@@ -20,6 +20,8 @@ Procedure:
20
20
  10. For Heavy Path, run the recorded automated test command and record explicit `Tests:` evidence before any completion claim.
21
21
  11. Re-run module acceptance verification.
22
22
  12. Re-run surface integration verification.
23
- 13. Record tool readiness and verification evidence in `docs/plan/<topic>.md` and update `PLAN.md`.
24
- 14. If the user asks a side question, status question, or narrow clarification while this task is still active, answer it briefly and then resume the previous active work unless the user explicitly asks to pause, stop, or switch tasks.
25
- 15. Use the OS locale for user-visible output unless the user asks for another language.
23
+ 13. Record successful verification as structured receipts bound to the goal/task/plan. Missing, failed, skipped, or placeholder receipts never complete a task.
24
+ 14. Complete the current task, let Cairn advance to the next one, and continue until every task and goal-level final review receipt passes. Workers return only their assigned task handoff and never select the next task.
25
+ 15. Record tool readiness and verification evidence in `docs/plan/<topic>.md`, update goal state, and update `PLAN.md` only after evidence exists.
26
+ 16. If the user asks a side question, status question, or narrow clarification while this task is still active, answer it briefly and then resume the previous active work unless the user explicitly asks to pause, stop, or switch tasks.
27
+ 17. Use the OS locale for user-visible responses and generated or updated documentation, plans, and memory artifacts unless the user asks for another language.
@@ -7,14 +7,15 @@ The goal is not to make prompts long by model. The goal is to stabilize the same
7
7
  ## Application Order
8
8
 
9
9
  1. Identify the active model name. If the model name is not directly exposed, infer it from the user's default model setting and agent role frontmatter.
10
- 2. For Claude-family models, apply `docs/model-guidance/claude.md`.
11
- 3. For Codex-family models, apply `docs/model-guidance/codex.md`.
12
- 4. If the model is not clearly classified, apply only the common rules and skip model-specific adjustment.
10
+ 2. Resolve this installed guidance root from the active skill's `references/cairn-runtime.json` or the source skill's location. Never look for Cairn model guidance in the target repository.
11
+ 3. For Claude-family models, apply `cairn://docs/model-guidance/claude.md`.
12
+ 4. For Codex-family models, apply `cairn://docs/model-guidance/codex.md`.
13
+ 5. If the model is not clearly classified, apply only the common rules and skip model-specific adjustment.
13
14
 
14
15
  ## Common Rules
15
16
 
16
17
  - Keep root `MEMORY.md` and `PLAN.md` as indexes only.
17
- - Keep detailed judgment in `docs/memory/`, `docs/plan/`, and `docs/model-guidance/`.
18
+ - Keep repository-specific judgment in `docs/memory/` and `docs/plan/`. Keep Cairn's model guidance in the installed plugin and reference it with `cairn://docs/model-guidance/...`.
18
19
  - Preserve proper nouns, file names, variable names, service names, alert names, MCP tool names, and agent names exactly as written.
19
20
  - Select Light Path or Heavy Path before implementation.
20
21
  - Treat the user-called/main agent as the orchestrator: it plans, assigns, verifies, and records evidence.
@@ -23,11 +24,13 @@ The goal is not to make prompts long by model. The goal is to stabilize the same
23
24
  - When a delegated subagent finishes, require a final report before it leaves; after capturing the final report and evidence, the orchestrator closes or releases the completed subagent, then reviews the final report and evidence before marking the work complete.
24
25
  - If subagent tools are unavailable, the main agent takes over implementation directly and records that takeover in evidence.
25
26
  - Detect required LSP, typecheck, lint, dry-run, and verification tools before implementation.
26
- - Missing required tools must trigger a project-local, repository-native, or ephemeral install attempt before they can be treated as unavailable.
27
+ - Missing required tools must be reported with a proposed install. Installation requires explicit user approval and a pinned/supported installer.
28
+ - Bind active work to a persisted Cairn goal and stable task IDs. Continue through tasks until goal-level final review completes, or record an explicit pause, blocker, or cancellation.
29
+ - Treat missing, failed, skipped, stale, or placeholder evidence as failure. Task receipts must be bound to the current goal, task, and plan.
27
30
  - Every implementation task must pass module acceptance verification and surface integration verification.
28
31
  - Before mutating external state, run the closest available dry-run, check, plan, diff, validate, or equivalent command.
29
32
  - Limit each task to two verification passes by default. After two failed passes, record the blocker or split it into sub-tasks instead of continuing a repeated loop.
30
- - User-visible output must follow the OS locale unless the user asks for another language.
33
+ - User-visible responses and generated or updated documentation, plans, and memory artifacts must follow the OS locale unless the user asks for another language.
31
34
 
32
35
  ## Delegation Defaults
33
36
 
@@ -20,7 +20,7 @@ Claude-family models are strong at long-context retention, policy interpretation
20
20
  - Do not allow open-ended verification loops. Require a blocker or sub-task split after two failed passes.
21
21
  - On Heavy Path, check plan gaps before implementation.
22
22
  - Before asking the user, use repository evidence and available `explorer`/`worker` delegation when it materially improves speed or quality.
23
- - Write user-visible output in the OS locale unless the user asks for another language.
23
+ - Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
24
24
 
25
25
  ## Path Guidance
26
26
 
@@ -25,7 +25,7 @@ Codex-family models are strong at small implementation tasks, explicit tool use,
25
25
  - Do not trust success-looking output alone. Confirm real files, commands, and surface evidence.
26
26
  - Do not skip LSP, typecheck, lint, dry-run, or verification because a tool is missing. Try repository-local installation or record the failed install attempt as a blocker.
27
27
  - Do not continue an open-ended verification loop. Use at most two verification passes per task unless the plan records a risk-based exception.
28
- - Write user-visible output in the OS locale unless the user asks for another language.
28
+ - Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
29
29
 
30
30
  ## Path Guidance
31
31
 
package/hooks/hooks.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "type": "command",
8
8
  "command": "node \"${PLUGIN_ROOT}/scripts/cairn-state.mjs\" session-start",
9
9
  "timeout": 10,
10
- "statusMessage": "Cairn: preparing repository memory and plan indexes"
10
+ "statusMessage": "Cairn: loading read-only repository context"
11
11
  }
12
12
  ]
13
13
  }
@@ -19,7 +19,7 @@
19
19
  "type": "command",
20
20
  "command": "node \"${PLUGIN_ROOT}/scripts/cairn-state.mjs\" user-prompt-submit",
21
21
  "timeout": 10,
22
- "statusMessage": "Cairn: loading compact work context"
22
+ "statusMessage": "Cairn: loading read-only work context"
23
23
  }
24
24
  ]
25
25
  }
@@ -32,7 +32,7 @@
32
32
  "type": "command",
33
33
  "command": "node \"${PLUGIN_ROOT}/scripts/cairn-state.mjs\" post-tool-use",
34
34
  "timeout": 10,
35
- "statusMessage": "Cairn: checking memory and plan indexes"
35
+ "statusMessage": "Cairn: reminding current goal receipt requirements"
36
36
  }
37
37
  ]
38
38
  }
@@ -44,7 +44,7 @@
44
44
  "type": "command",
45
45
  "command": "node \"${PLUGIN_ROOT}/scripts/cairn-state.mjs\" stop",
46
46
  "timeout": 10,
47
- "statusMessage": "Cairn: checking two-gate evidence requirements"
47
+ "statusMessage": "Cairn: checking the active goal task"
48
48
  }
49
49
  ]
50
50
  }
@@ -56,7 +56,7 @@
56
56
  "type": "command",
57
57
  "command": "node \"${PLUGIN_ROOT}/scripts/cairn-state.mjs\" subagent-stop",
58
58
  "timeout": 10,
59
- "statusMessage": "Cairn: checking subagent handoff evidence"
59
+ "statusMessage": "Cairn: checking this subagent's assigned task"
60
60
  }
61
61
  ]
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cairn-ai",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "Token-efficient agent harness with tool readiness for Codex, Claude Code, and Antigravity",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -39,7 +39,7 @@
39
39
  "README.*.md"
40
40
  ],
41
41
  "scripts": {
42
- "check": "node --check scripts/cairn.mjs && node --check scripts/cairn-state.mjs && node --check scripts/cairn-lifecycle.mjs && node --check scripts/cairn-toolcheck.mjs && node -e \"JSON.parse(require('node:fs').readFileSync('package.json','utf8')); JSON.parse(require('node:fs').readFileSync('.codex-plugin/plugin.json','utf8')); JSON.parse(require('node:fs').readFileSync('hooks/hooks.json','utf8'))\" && npm test",
42
+ "check": "node --check scripts/cairn.mjs && node --check scripts/cairn-paths.mjs && node --check scripts/cairn-goal.mjs && node --check scripts/cairn-state.mjs && node --check scripts/cairn-lifecycle.mjs && node --check scripts/cairn-toolcheck.mjs && node -e \"JSON.parse(require('node:fs').readFileSync('package.json','utf8')); JSON.parse(require('node:fs').readFileSync('.codex-plugin/plugin.json','utf8')); JSON.parse(require('node:fs').readFileSync('hooks/hooks.json','utf8'))\" && npm test",
43
43
  "test": "node --test",
44
44
  "prepack": "npm run check"
45
45
  },