cairn-ai 0.1.11 → 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 (52) 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 +2 -0
  4. package/.agents/workflows/cairn-plan.md +5 -3
  5. package/.agents/workflows/cairn-review.md +2 -0
  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 +3 -1
  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 +4 -4
  23. package/README.es.md +4 -4
  24. package/README.fr.md +4 -4
  25. package/README.ja.md +4 -4
  26. package/README.ko.md +10 -7
  27. package/README.md +10 -7
  28. package/README.pt.md +4 -4
  29. package/README.zh.md +4 -4
  30. package/commands/cairn-doctor.md +2 -7
  31. package/commands/cairn-install.md +4 -7
  32. package/commands/cairn-memory.md +2 -2
  33. package/commands/cairn-plan.md +8 -7
  34. package/commands/cairn-review.md +2 -2
  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 +8 -5
  40. package/hooks/hooks.json +5 -5
  41. package/package.json +2 -2
  42. package/scripts/cairn-goal.mjs +539 -0
  43. package/scripts/cairn-lifecycle.mjs +140 -7
  44. package/scripts/cairn-paths.mjs +103 -0
  45. package/scripts/cairn-state.mjs +128 -130
  46. package/scripts/cairn-toolcheck.mjs +312 -79
  47. package/scripts/cairn.mjs +20 -11
  48. package/skills/cairn-memory/SKILL.md +7 -1
  49. package/skills/cairn-plan/SKILL.md +25 -9
  50. package/skills/cairn-review/SKILL.md +3 -0
  51. package/skills/cairn-work/SKILL.md +34 -13
  52. package/templates/work-plan.md +20 -3
@@ -2,17 +2,7 @@
2
2
 
3
3
  Goal: diagnose Cairn installation status.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- bunx cairn-ai@latest doctor
9
- ```
10
-
11
- When running from local source:
12
-
13
- ```sh
14
- node scripts/cairn.mjs doctor
15
- ```
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value and `["doctor"]`; do not build a shell-interpolated command from the path.
16
6
 
17
7
  Checks:
18
8
 
@@ -20,3 +10,4 @@ Checks:
20
10
  - Claude Code commands and agents mirror files.
21
11
  - Antigravity skills and workflows mirror files.
22
12
  - Antigravity CLI skills and workflows mirror files.
13
+ - Installed runtime locators and the referenced scripts, templates, and model guidance.
@@ -8,10 +8,6 @@ Run:
8
8
  bunx cairn-ai@latest install
9
9
  ```
10
10
 
11
- When running from local source:
12
-
13
- ```sh
14
- node scripts/cairn.mjs install
15
- ```
11
+ Installation must run from the package/global source because the cached plugin is the destination. Do not copy Cairn runtime files into the target project and do not invoke install from a cached plugin locator.
16
12
 
17
13
  After installation, check status with the `cairn-doctor` workflow.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Use the `cairn-memory` skill.
4
4
 
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Cairn scripts and policy resources must be resolved through that locator, not from the target project.
6
+
5
7
  Goal: create or update repository memory without asking the user for discoverable facts.
6
8
 
7
9
  Procedure:
@@ -2,15 +2,17 @@
2
2
 
3
3
  Use the `cairn-plan` skill.
4
4
 
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve Cairn scripts, model guidance, templates, commands, and agents through that locator; only repository state such as `MEMORY.md`, `PLAN.md`, and `docs/plan/` belongs to the target project.
6
+
5
7
  Goal: leave a decision-complete plan for the current task in files before non-trivial implementation.
6
8
 
7
9
  Procedure:
8
10
 
9
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.
10
12
  2. Read relevant `docs/memory/*.md`.
11
- 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`.
12
- 4. Run `node scripts/cairn.mjs toolcheck` when available.
13
- 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 `claude.md` under the locator's `resources.modelGuidance`; if Codex-family, read `codex.md` there.
14
+ 4. Invoke Node directly with the locator's absolute `entrypoints.cli`, `toolcheck`, and `--root` for the target repository.
15
+ 5. If required LSP/check tools are missing, follow the installed toolcheck policy before any explicitly approved installation attempt.
14
16
  6. Explore before asking the user.
15
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.
16
18
  8. Run complexity triage before applying agent, plugin, or delegated workflow guidance, and record it before mutating files.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Use the `cairn-review` skill.
4
4
 
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Cairn scripts and policy resources must be resolved through that locator, not from the target project.
6
+
5
7
  Goal: review completed work against plan, memory, policy, and evidence.
6
8
 
7
9
  Procedure:
@@ -2,16 +2,8 @@
2
2
 
3
3
  Goal: detect repository stacks and check required LSP, typecheck, lint, dry-run, and verification tools.
4
4
 
5
- Run the local command first:
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value, `toolcheck`, and an explicit `--root` argument for the target repository; do not build a shell-interpolated command from the path.
6
6
 
7
- ```sh
8
- node scripts/cairn.mjs toolcheck
9
- ```
10
-
11
- If required tools are missing, attempt repository-native installation:
12
-
13
- ```sh
14
- node scripts/cairn.mjs toolcheck --install
15
- ```
7
+ If required tools are missing, follow the installed command policy before any explicitly approved installation attempt.
16
8
 
17
9
  Record detected stacks, missing tools, install attempts, and blockers in the related `docs/plan/<topic>.md`.
@@ -2,16 +2,6 @@
2
2
 
3
3
  Goal: remove the Codex, Claude Code, and Antigravity entries installed by Cairn.
4
4
 
5
- Run:
6
-
7
- ```sh
8
- bunx cairn-ai@latest uninstall
9
- ```
10
-
11
- When running from local source:
12
-
13
- ```sh
14
- node scripts/cairn.mjs uninstall
15
- ```
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value and `["uninstall"]`; do not build a shell-interpolated command from the path.
16
6
 
17
7
  The source work folder and user-created `MEMORY.md`, `PLAN.md`, `docs/memory`, and `docs/plan` files are not deleted.
@@ -8,10 +8,6 @@ Run:
8
8
  bunx cairn-ai@latest upgrade
9
9
  ```
10
10
 
11
- When running from local source:
12
-
13
- ```sh
14
- node scripts/cairn.mjs upgrade
15
- ```
11
+ Upgrade must run from the package/global source because the cached plugin is replaced. Do not invoke upgrade from a cached plugin locator.
16
12
 
17
13
  After upgrade, check status with the `cairn-doctor` workflow.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Use the `cairn-work` skill.
4
4
 
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve Cairn scripts and policy resources through that locator; only work artifacts and state belong to the target project.
6
+
5
7
  Goal: execute the next incomplete module task in `PLAN.md` without bypassing the recorded complexity triage.
6
8
 
7
9
  Procedure:
@@ -10,7 +12,7 @@ Procedure:
10
12
  2. Read `PLAN.md`, the detailed plan, and relevant memory notes.
11
13
  3. Read the Codex or Claude model guidance recorded in the plan.
12
14
  4. Select one small module task.
13
- 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.
15
+ 5. Confirm required tool readiness by invoking Node directly with the locator's absolute `entrypoints.cli`, `toolcheck`, and `--root` for the target repository. Follow the installed toolcheck policy before any explicitly approved installation attempt.
14
16
  6. Confirm the complexity triage and selected Light/Heavy Path recorded in the plan. If missing, update the plan before mutating files.
15
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.
16
18
  8. For Heavy Path, follow the plan's staged implementation and review gates without role-mapping shortcuts.
@@ -4,4 +4,4 @@ Read-only discovery agent for codebase questions, impact analysis, pattern searc
4
4
 
5
5
  Before any task, read the project-root `MEMORY.md` for domain knowledge and repository policy.
6
6
 
7
- Refer to `agents/explorer.md`.
7
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.agents` from that JSON object and follow `explorer.md` in that directory. Do not resolve Cairn agent files from the target project.
@@ -4,4 +4,4 @@ Focused execution agent for search, small edits, command checks, and QA artifact
4
4
 
5
5
  Before any task, read the project-root `MEMORY.md` for domain knowledge and repository policy.
6
6
 
7
- Refer to `agents/worker.md`.
7
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.agents` from that JSON object and follow `worker.md` in that directory. Do not resolve Cairn agent files from the target project.
@@ -2,12 +2,4 @@
2
2
 
3
3
  Diagnose Cairn installation status.
4
4
 
5
- ```sh
6
- node scripts/cairn.mjs doctor
7
- ```
8
-
9
- Published package:
10
-
11
- ```sh
12
- bunx cairn-ai@latest doctor
13
- ```
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value and the argument array `["doctor"]`; do not build a shell-interpolated command from the path.
@@ -2,11 +2,7 @@
2
2
 
3
3
  Install Cairn into Codex, Claude Code, and Antigravity.
4
4
 
5
- ```sh
6
- node scripts/cairn.mjs install
7
- ```
8
-
9
- Published package:
5
+ Installation must run from the package/global source because the cached installation is the destination. Do not copy runtime files into the target project and do not invoke install from the cached plugin locator.
10
6
 
11
7
  ```sh
12
8
  bunx cairn-ai@latest install
@@ -2,4 +2,4 @@
2
2
 
3
3
  Create or update `MEMORY.md` and `docs/memory/<domain>.md`.
4
4
 
5
- Follow plugin command `commands/cairn-memory.md`.
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.commands` from that JSON object and follow `cairn-memory.md` in that directory. Do not resolve Cairn command files from the target project.
@@ -2,4 +2,4 @@
2
2
 
3
3
  Start by reading the project-root `MEMORY.md`, then create or update `PLAN.md` and `docs/plan/<topic>.md` before non-trivial implementation, including Light/Heavy Path complexity triage and tool readiness.
4
4
 
5
- Follow plugin command `commands/cairn-plan.md`.
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.commands` from that JSON object and follow `cairn-plan.md` in that directory. Resolve model guidance and templates through the same locator. Do not resolve Cairn runtime resources from the target project.
@@ -2,4 +2,4 @@
2
2
 
3
3
  Review completed tasks against memory, plan, policy, tool readiness, and evidence.
4
4
 
5
- Follow plugin command `commands/cairn-review.md`.
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.commands` from that JSON object and follow `cairn-review.md` in that directory. Do not resolve Cairn command files from the target project.
@@ -2,9 +2,6 @@
2
2
 
3
3
  Detect repository stacks and check required LSP, typecheck, lint, dry-run, and verification tools.
4
4
 
5
- ```sh
6
- node scripts/cairn.mjs toolcheck
7
- node scripts/cairn.mjs toolcheck --install
8
- ```
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value, `toolcheck`, and an explicit `--root` pointing at the target repository; do not build a shell-interpolated command from the path.
9
6
 
10
- Use `--install` before accepting a missing required tool as unavailable.
7
+ If required tools are missing, report the proposed install and obtain explicit user approval. Only then add `--install --yes` for a pinned/supported installer or use the approved repository-native command.
@@ -2,12 +2,4 @@
2
2
 
3
3
  Remove the Codex, Claude Code, and Antigravity entries installed by Cairn.
4
4
 
5
- ```sh
6
- node scripts/cairn.mjs uninstall
7
- ```
8
-
9
- Published package:
10
-
11
- ```sh
12
- bunx cairn-ai@latest uninstall
13
- ```
5
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Invoke Node directly with the absolute `entrypoints.cli` value and the argument array `["uninstall"]`; do not build a shell-interpolated command from the path.
@@ -2,11 +2,7 @@
2
2
 
3
3
  Update the Cairn installation from the current source.
4
4
 
5
- ```sh
6
- node scripts/cairn.mjs upgrade
7
- ```
8
-
9
- Published package:
5
+ Upgrade must run from the package/global source because the cached installation is replaced. Do not invoke upgrade from the cached plugin locator.
10
6
 
11
7
  ```sh
12
8
  bunx cairn-ai@latest upgrade
@@ -4,4 +4,4 @@ Start by reading the project-root `MEMORY.md`, then execute the next incomplete
4
4
 
5
5
  If the user asks a side question, status question, or narrow clarification while a 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.
6
6
 
7
- Follow plugin command `commands/cairn-work.md`.
7
+ Read the installed Cairn runtime locator at `{{CAIRN_RUNTIME_LOCATOR_JSON}}`. Resolve `resources.commands` from that JSON object and follow `cairn-work.md` in that directory. Do not resolve Cairn command files from the target project.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cairn",
3
- "version": "0.1.11",
3
+ "version": "0.2.0",
4
4
  "description": "Token-efficient agent harness with tool readiness for Codex, Claude Code, and Antigravity.",
5
5
  "author": {
6
6
  "name": "WkNam"
@@ -24,6 +24,7 @@
24
24
  "Use Cairn to create MEMORY.md and PLAN.md for this repository.",
25
25
  "At the start of each task, every agent must read the project-root MEMORY.md for domain knowledge and repository policy before planning, implementation, review, or delegation.",
26
26
  "Run cairn-toolcheck before planning implementation work.",
27
+ "Resolve Cairn scripts, templates, commands, agents, and model guidance from the installed plugin runtime locator; never search for those runtime files in the target repository. Keep the target repository root separate and pass it explicitly to Cairn commands.",
27
28
  "Before non-trivial implementation, run cairn-plan for this task without asking me for discoverable facts.",
28
29
  "When planning, first understand the whole work, then classify it into small executable tasks; if a task needs further breakdown, split it into sub-tasks.",
29
30
  "The user-called/main agent is the orchestrator: plan, assign, verify, and record evidence; actual implementation edits must be delegated to worker subagents whenever subagent tools are available, on both Light Path and Heavy Path.",
@@ -33,6 +34,10 @@
33
34
  "If subagent tools are unavailable, the main agent takes over implementation directly and records that takeover in evidence; do not stop before local implementation solely because subagent tools are unavailable.",
34
35
  "Record Light Path or Heavy Path complexity triage in docs/plan/<topic>.md before mutating files.",
35
36
  "Run cairn-work from the current PLAN.md and pass dry-run/check, module acceptance, and surface integration gates.",
37
+ "For implementation requests, persist one active Cairn goal with stable task IDs. After a task passes its required bound receipts, advance immediately to the next task and continue until goal-level final review completes; active is never a completion state.",
38
+ "Missing, failed, skipped, stale, or placeholder evidence never completes a task. A worker may report only its assigned task; the main agent reviews the handoff and advances the goal.",
39
+ "If progress cannot continue, explicitly pause, block with a concrete reason, or cancel the Cairn goal instead of silently stopping. Do not repeatedly block a re-entered stop hook in the same turn.",
40
+ "Tool installation is an external-state change: report the proposal and obtain explicit user approval before using a pinned/supported installer.",
36
41
  "If I ask a side question, status question, or narrow clarification while a plan or task is still active, answer it briefly and then resume the previous active work unless I explicitly ask you to pause, stop, or switch tasks."
37
42
  ]
38
43
  }
package/README.de.md CHANGED
@@ -33,8 +33,8 @@ Der gewählte path und die Begründung werden in `docs/plan/<topic>.md` festgeha
33
33
  `cairn toolcheck` untersucht das aktuelle repository auf JavaScript-, TypeScript-, Python-, PHP-, Java-, Kotlin-, Swift-, Go- und Rust-stacks und prüft die passenden LSP- und 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` meldet detected stacks und missing tools.
@@ -57,7 +57,7 @@ Cairn wendet model-specific adjustment nur auf Claude-family und Codex-family mo
57
57
  - Claude-family: geeignet für long context, policy interpretation und plan/evidence review.
58
58
  - Codex-family: geeignet für small implementation tasks, explicit file edits, command-based verification und bounded `worker` tasks.
59
59
 
60
- Details stehen in `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` und `docs/model-guidance/codex.md`.
60
+ Details stehen im installierten Plugin unter `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md` und `cairn://docs/model-guidance/codex.md`.
61
61
 
62
62
  ## Repository Artifacts
63
63
 
@@ -65,7 +65,7 @@ Das harness erstellt und pflegt diese files im Ziel-repository root.
65
65
 
66
66
  - `MEMORY.md`: kurzer Index persistent domain knowledge.
67
67
  - `docs/memory/*.md`: detailliertes Wissen je domain.
68
- - `docs/model-guidance/*.md`: Claude- und Codex-model adjustment guidance.
68
+ - `.cairn/state.json`: git-ignorierter Goal-, Task- und Receipt-Status für Wiederaufnahme und scoped stop gates.
69
69
  - `PLAN.md`: kurzer Index aktiver und abgeschlossener work topics.
70
70
  - `docs/plan/*.md`: detailed execution plans.
71
71
 
package/README.es.md CHANGED
@@ -33,8 +33,8 @@ El path seleccionado y su justificación se registran en `docs/plan/<topic>.md`
33
33
  `cairn toolcheck` inspecciona el repositorio actual para stacks JavaScript, TypeScript, Python, PHP, Java, Kotlin, Swift, Go y Rust, y luego revisa los LSP y verification tools correspondientes.
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` reporta detected stacks y missing tools.
@@ -57,7 +57,7 @@ Cairn solo aplica ajustes específicos de modelo a modelos Claude-family y Codex
57
57
  - Claude-family: útil para long context, policy interpretation y plan/evidence review.
58
58
  - Codex-family: útil para small implementation tasks, explicit file edits, command-based verification y bounded `worker` tasks.
59
59
 
60
- La guía detallada vive en `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` y `docs/model-guidance/codex.md`.
60
+ La guía detallada vive en el plugin instalado y se referencia como `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md` y `cairn://docs/model-guidance/codex.md`.
61
61
 
62
62
  ## Repository Artifacts
63
63
 
@@ -65,7 +65,7 @@ El harness crea y mantiene estos archivos en la raíz del repositorio objetivo.
65
65
 
66
66
  - `MEMORY.md`: índice corto de conocimiento persistente del dominio.
67
67
  - `docs/memory/*.md`: conocimiento detallado por dominio.
68
- - `docs/model-guidance/*.md`: guía de ajuste de modelos Claude y Codex.
68
+ - `.cairn/state.json`: estado git-ignored de goal, task y receipt para reanudación y stop gates acotados.
69
69
  - `PLAN.md`: índice corto de temas activos y completados.
70
70
  - `docs/plan/*.md`: planes de ejecución detallados.
71
71
 
package/README.fr.md CHANGED
@@ -33,8 +33,8 @@ Le path choisi et sa justification sont enregistrés dans `docs/plan/<topic>.md`
33
33
  `cairn toolcheck` inspecte le repository courant pour les stacks JavaScript, TypeScript, Python, PHP, Java, Kotlin, Swift, Go et Rust, puis vérifie les LSP et verification tools correspondants.
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` signale les detected stacks et missing tools.
@@ -57,7 +57,7 @@ Cairn applique des ajustements spécifiques uniquement aux modèles Claude-famil
57
57
  - Claude-family : utile pour long context, policy interpretation et plan/evidence review.
58
58
  - Codex-family : utile pour small implementation tasks, explicit file edits, command-based verification et bounded `worker` tasks.
59
59
 
60
- Les détails se trouvent dans `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` et `docs/model-guidance/codex.md`.
60
+ Les détails se trouvent dans le plugin installé sous `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md` et `cairn://docs/model-guidance/codex.md`.
61
61
 
62
62
  ## Repository Artifacts
63
63
 
@@ -65,7 +65,7 @@ Le harness crée et maintient ces fichiers à la racine du repository cible.
65
65
 
66
66
  - `MEMORY.md` : index court de persistent domain knowledge.
67
67
  - `docs/memory/*.md` : connaissances détaillées par domaine.
68
- - `docs/model-guidance/*.md` : guidance d'ajustement pour les modèles Claude et Codex.
68
+ - `.cairn/state.json` : état git-ignored des goals, tasks et receipts pour la reprise et les stop gates ciblés.
69
69
  - `PLAN.md` : index court des sujets actifs et terminés.
70
70
  - `docs/plan/*.md` : detailed execution plans.
71
71
 
package/README.ja.md CHANGED
@@ -33,8 +33,8 @@ Cairn は execution policy では LazyCodex と異なります。LazyCodex の r
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 に次の files を作成して維持します
65
65
 
66
66
  - `MEMORY.md`: persistent domain knowledge の短い index。
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 の短い index。
70
70
  - `docs/plan/*.md`: detailed execution plans。
71
71
 
package/README.ko.md CHANGED
@@ -37,12 +37,14 @@ subagent 도구가 progress-reporting channel을 제공하면 subagent는 작업
37
37
  `cairn toolcheck`는 현재 저장소에서 JavaScript, TypeScript, Python, PHP, Java, Kotlin, Swift, Go, Rust 스택을 감지하고, 해당 LSP와 검증 도구를 확인합니다.
38
38
 
39
39
  ```sh
40
- cairn toolcheck
41
- cairn toolcheck --install
40
+ cairn toolcheck --root .
41
+ # 명시적 승인을 받은 경우에만:
42
+ cairn toolcheck --install --yes --root .
42
43
  ```
43
44
 
44
45
  - `toolcheck`는 감지된 스택과 누락 도구를 보고합니다.
45
- - `toolcheck --install`은 package manager dev dependency, Composer dev dependency, `uv`, Java LSP bootstrap, `go install`, `rustup component add` 같은 가장 가까운 프로젝트 로컬 또는 저장소 네이티브 설치 경로를 시도합니다.
46
+ - 기본 검사는 읽기 전용이고 timeout으로 제한되며, 저장소 로컬 wrapper를 단순 탐지를 위해 실행하지 않습니다.
47
+ - `toolcheck --install`은 사용자의 명시적 승인과 `--yes`를 모두 요구합니다. 버전이 고정되지 않았거나 checksum이 없는 installer는 `latest`를 내려받는 대신 사용할 수 없는 것으로 보고합니다.
46
48
  - Cairn 계획은 감지된 스택, 필요한 도구, 설치 명령, blocker를 기록합니다.
47
49
  - LSP server가 없다는 사실만으로 정밀한 코드베이스 탐색을 건너뛸 수 없습니다. 설치 또는 동등한 symbol-aware fallback을 먼저 시도해야 합니다.
48
50
 
@@ -61,7 +63,7 @@ Cairn은 Claude-family와 Codex-family 모델에만 모델별 조정을 적용
61
63
  - Claude-family: 긴 컨텍스트, 정책 해석, 계획/증거 검토에 유용합니다.
62
64
  - Codex-family: 작은 구현 작업, 명시적 파일 편집, command 기반 검증, 제한된 `worker` 작업에 유용합니다.
63
65
 
64
- 자세한 가이드는 `docs/model-guidance/README.md`, `docs/model-guidance/claude.md`, `docs/model-guidance/codex.md`에 있습니다.
66
+ 자세한 가이드는 설치된 플러그인에 있으며 `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md`, `cairn://docs/model-guidance/codex.md`로 참조합니다.
65
67
 
66
68
  ## Repository Artifacts
67
69
 
@@ -69,11 +71,11 @@ Cairn은 Claude-family와 Codex-family 모델에만 모델별 조정을 적용
69
71
 
70
72
  - `MEMORY.md`: 지속 도메인 지식의 짧은 색인.
71
73
  - `docs/memory/*.md`: 도메인별 상세 지식.
72
- - `docs/model-guidance/*.md`: Claude와 Codex 모델 조정 가이드.
73
74
  - `PLAN.md`: 활성/완료 작업 주제의 짧은 색인.
74
75
  - `docs/plan/*.md`: 상세 실행 계획.
76
+ - `.cairn/state.json`: 중단 재개와 범위가 제한된 종료 게이트에 쓰는 git-ignored 버전드 goal/task/receipt 상태.
75
77
 
76
- 루트 파일은 짧게 유지하고 상세 내용은 `docs/` 아래로 이동해, 에이전트가 필요한 컨텍스트만 읽도록 합니다.
78
+ 런타임 script, template, command, agent, model guidance는 설치된 플러그인 루트에 유지합니다. 각 표면의 locator가 같은 설치본을 가리키므로 대상 저장소에 Cairn 내부 파일을 복사하지 않습니다.
77
79
 
78
80
  ## Commands
79
81
 
@@ -103,12 +105,13 @@ cairn toolcheck
103
105
  - `cairn doctor`: Codex 설정, 설치, hook trust state, Claude Code mirror 파일, Antigravity mirror 파일을 진단합니다.
104
106
  - `cairn uninstall`: Cairn이 추가한 Codex 설정, cache, Claude Code mirror 파일, Antigravity mirror 파일을 제거합니다.
105
107
  - `cairn toolcheck`: 저장소 스택을 감지하고 필요한 LSP와 검증 도구를 확인하거나 설치합니다.
108
+ - `cairn goal ...`: 저장소의 영속 goal을 시작·조회·일시정지·재개·차단·취소·완료합니다. task 완료에는 현재 goal/task/plan에 바인딩된 성공 receipt가 필요합니다.
106
109
  - `cairn-memory`: 도메인 지식을 탐색하고 `MEMORY.md`를 갱신합니다.
107
110
  - `cairn-plan`: `docs/plan/` 아래에 decision-complete plan을 만듭니다.
108
111
  - `cairn-work`: 현재 `PLAN.md`의 다음 모듈 작업을 실행하고 두 검증 게이트를 확보합니다.
109
112
  - `cairn-review`: 계획, memory, 증거를 기준으로 완료된 작업을 검토합니다.
110
113
 
111
- `install`과 `upgrade`는 `~/.codex/config.toml`을 수정하기 전에 `*.cairn-backup-*` 백업을 만듭니다. 소스 플러그인 manifest는 validator-friendly 상태를 유지하고, 설치된 cache copy에만 Codex hook 활성화를 위한 `hooks` field가 추가됩니다.
114
+ `install`과 `upgrade`는 `~/.codex/config.toml`을 수정하기 전에 `*.cairn-backup-*` 백업을 만들고 각 표면의 runtime locator를 갱신합니다. 소스 플러그인 manifest는 validator-friendly 상태를 유지하고, 설치된 cache copy에만 Codex hook 활성화를 위한 `hooks` field가 추가됩니다. 현재 custom lifecycle은 유지하며, upgrade는 교체 대상인 cache copy가 아니라 게시/전역 package에서 실행해야 합니다.
112
115
 
113
116
  Codex는 `skills/`와 `commands/`를 사용합니다. Claude Code는 `.claude/` 아래의 mirror command와 agent definition을 사용합니다. Antigravity는 `.agents/workflows`와 global skills mirror를 사용합니다.
114
117
 
package/README.md CHANGED
@@ -45,12 +45,14 @@ When a delegated subagent finishes, it provides a final report before leaving. A
45
45
  `cairn toolcheck` inspects the current repository for JavaScript, TypeScript, Python, PHP, Java, Kotlin, Swift, Go, and Rust stacks, then checks the matching LSP and verification tools.
46
46
 
47
47
  ```sh
48
- cairn toolcheck
49
- cairn toolcheck --install
48
+ cairn toolcheck --root .
49
+ # After explicit approval only:
50
+ cairn toolcheck --install --yes --root .
50
51
  ```
51
52
 
52
53
  - `toolcheck` reports detected stacks and missing tools.
53
- - `toolcheck --install` attempts the closest project-local or repository-native install path, such as package-manager dev dependencies, Composer dev dependencies, `uv`, Java LSP bootstrap, `go install`, or `rustup component add`.
54
+ - Default checks are read-only, bounded by a timeout, and do not execute repository-local wrappers merely to discover them.
55
+ - `toolcheck --install` requires both `--yes` and explicit user approval. Unpinned or checksum-free installers are unavailable rather than silently downloading `latest`.
54
56
  - Cairn plans record detected stack, required tools, install commands, and blockers.
55
57
  - A missing LSP server is not a valid reason to skip precise codebase exploration until installation or an equivalent symbol-aware fallback has been attempted.
56
58
 
@@ -69,7 +71,7 @@ Cairn only applies model-specific adjustment to Claude-family and Codex-family m
69
71
  - Claude-family: useful for long context, policy interpretation, and plan/evidence review.
70
72
  - Codex-family: useful for small implementation tasks, explicit file edits, command-based verification, and bounded `worker` tasks.
71
73
 
72
- Detailed guidance lives in `docs/model-guidance/README.md`, `docs/model-guidance/claude.md`, and `docs/model-guidance/codex.md`.
74
+ Detailed guidance lives in the installed plugin and is referenced as `cairn://docs/model-guidance/README.md`, `cairn://docs/model-guidance/claude.md`, and `cairn://docs/model-guidance/codex.md`.
73
75
 
74
76
  ## Repository Artifacts
75
77
 
@@ -77,11 +79,11 @@ The harness creates and maintains these files at the target repository root.
77
79
 
78
80
  - `MEMORY.md`: short index of persistent domain knowledge.
79
81
  - `docs/memory/*.md`: detailed knowledge by domain.
80
- - `docs/model-guidance/*.md`: Claude and Codex model adjustment guidance.
81
82
  - `PLAN.md`: short index of active and completed work topics.
82
83
  - `docs/plan/*.md`: detailed execution plans.
84
+ - `.cairn/state.json`: git-ignored, versioned active goal/task/receipt state used for interruption recovery and scoped stop gates.
83
85
 
84
- Root files stay short and details move under `docs/`, so agents only read the context they need.
86
+ Runtime scripts, templates, commands, agents, and model guidance stay in the installed plugin root. Runtime locator files let Codex, Claude Code, and Antigravity share that installed copy without copying Cairn internals into the target repository.
85
87
 
86
88
  ## Commands
87
89
 
@@ -111,12 +113,13 @@ cairn toolcheck
111
113
  - `cairn doctor`: diagnoses Codex settings, installation, hook trust state, Claude Code mirror files, and Antigravity mirror files.
112
114
  - `cairn uninstall`: removes Cairn-added Codex settings, cache, Claude Code mirror files, and Antigravity mirror files.
113
115
  - `cairn toolcheck`: detects repository stacks and checks or installs required LSP and verification tools.
116
+ - `cairn goal ...`: starts, inspects, pauses, resumes, blocks, cancels, and completes a persisted repository goal; task completion requires bound successful receipts.
114
117
  - `cairn-memory`: explores domain knowledge and updates `MEMORY.md`.
115
118
  - `cairn-plan`: creates a decision-complete plan under `docs/plan/`.
116
119
  - `cairn-work`: executes the next module task in the current `PLAN.md` with two verification gates.
117
120
  - `cairn-review`: reviews completed tasks against plan, memory, and evidence.
118
121
 
119
- Install and upgrade create `*.cairn-backup-*` backups before modifying `~/.codex/config.toml`. The source plugin manifest stays validator-friendly; only the installed cache copy gets a `hooks` field to activate Codex hooks.
122
+ Install and upgrade create `*.cairn-backup-*` backups before modifying `~/.codex/config.toml`. They also write runtime locators for every surface. The source plugin manifest stays validator-friendly; only the installed cache copy gets a `hooks` field to activate Codex hooks. The current custom lifecycle remains in use; lifecycle upgrade should run from the published/global package, not from the cached copy that it replaces.
120
123
 
121
124
  Codex uses `skills/` and `commands/`. Claude Code uses mirrored commands and agent definitions under `.claude/`. Antigravity uses `.agents/workflows` and global skills mirrors.
122
125
 
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
 
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
 
@@ -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.