cairn-ai 0.1.2

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 (58) hide show
  1. package/.agents/workflows/cairn-doctor.md +22 -0
  2. package/.agents/workflows/cairn-install.md +17 -0
  3. package/.agents/workflows/cairn-memory.md +15 -0
  4. package/.agents/workflows/cairn-plan.md +21 -0
  5. package/.agents/workflows/cairn-review.md +14 -0
  6. package/.agents/workflows/cairn-toolcheck.md +17 -0
  7. package/.agents/workflows/cairn-uninstall.md +17 -0
  8. package/.agents/workflows/cairn-upgrade.md +17 -0
  9. package/.agents/workflows/cairn-work.md +20 -0
  10. package/.claude/agents/explorer.md +5 -0
  11. package/.claude/agents/worker.md +5 -0
  12. package/.claude/commands/cairn-doctor.md +13 -0
  13. package/.claude/commands/cairn-install.md +13 -0
  14. package/.claude/commands/cairn-memory.md +5 -0
  15. package/.claude/commands/cairn-plan.md +5 -0
  16. package/.claude/commands/cairn-review.md +5 -0
  17. package/.claude/commands/cairn-toolcheck.md +10 -0
  18. package/.claude/commands/cairn-uninstall.md +13 -0
  19. package/.claude/commands/cairn-upgrade.md +13 -0
  20. package/.claude/commands/cairn-work.md +5 -0
  21. package/.codex-plugin/plugin.json +30 -0
  22. package/LICENSE +21 -0
  23. package/README.de.md +130 -0
  24. package/README.es.md +130 -0
  25. package/README.fr.md +130 -0
  26. package/README.ja.md +130 -0
  27. package/README.ko.md +130 -0
  28. package/README.md +138 -0
  29. package/README.pt.md +130 -0
  30. package/README.zh.md +130 -0
  31. package/agents/explorer.md +31 -0
  32. package/agents/worker.md +32 -0
  33. package/commands/cairn-doctor.md +27 -0
  34. package/commands/cairn-install.md +24 -0
  35. package/commands/cairn-memory.md +17 -0
  36. package/commands/cairn-plan.md +23 -0
  37. package/commands/cairn-review.md +16 -0
  38. package/commands/cairn-toolcheck.md +19 -0
  39. package/commands/cairn-uninstall.md +24 -0
  40. package/commands/cairn-upgrade.md +23 -0
  41. package/commands/cairn-work.md +22 -0
  42. package/docs/model-guidance/README.md +31 -0
  43. package/docs/model-guidance/claude.md +46 -0
  44. package/docs/model-guidance/codex.md +48 -0
  45. package/hooks/hooks.json +65 -0
  46. package/package.json +49 -0
  47. package/scripts/cairn +115 -0
  48. package/scripts/cairn-lifecycle.mjs +343 -0
  49. package/scripts/cairn-state.sh +104 -0
  50. package/scripts/cairn-toolcheck.mjs +205 -0
  51. package/skills/cairn-memory/SKILL.md +40 -0
  52. package/skills/cairn-plan/SKILL.md +137 -0
  53. package/skills/cairn-review/SKILL.md +44 -0
  54. package/skills/cairn-work/SKILL.md +81 -0
  55. package/templates/MEMORY.md +14 -0
  56. package/templates/PLAN.md +17 -0
  57. package/templates/domain-memory.md +20 -0
  58. package/templates/work-plan.md +86 -0
@@ -0,0 +1,22 @@
1
+ # cairn-doctor
2
+
3
+ Goal: diagnose Cairn installation status.
4
+
5
+ Run:
6
+
7
+ ```sh
8
+ bunx cairn-ai@latest doctor
9
+ ```
10
+
11
+ When running from local source:
12
+
13
+ ```sh
14
+ scripts/cairn doctor
15
+ ```
16
+
17
+ Checks:
18
+
19
+ - Codex plugin, marketplace, hook trust state.
20
+ - Claude Code commands and agents mirror files.
21
+ - Antigravity skills and workflows mirror files.
22
+ - Antigravity CLI skills and workflows mirror files.
@@ -0,0 +1,17 @@
1
+ # cairn-install
2
+
3
+ Goal: install Cairn into Codex, Claude Code, and Antigravity.
4
+
5
+ Run:
6
+
7
+ ```sh
8
+ bunx cairn-ai@latest install
9
+ ```
10
+
11
+ When running from local source:
12
+
13
+ ```sh
14
+ scripts/cairn install
15
+ ```
16
+
17
+ After installation, check status with the `cairn-doctor` workflow.
@@ -0,0 +1,15 @@
1
+ # cairn-memory
2
+
3
+ Use the `cairn-memory` skill.
4
+
5
+ Goal: create or update repository memory without asking the user for discoverable facts.
6
+
7
+ Procedure:
8
+
9
+ 1. Ensure `MEMORY.md`, `PLAN.md`, `docs/memory`, and `docs/plan`.
10
+ 2. Read `MEMORY.md`.
11
+ 3. Explore repository facts with focused tools.
12
+ 4. Use `explorer` for read-only domain discovery and contradiction checks when available; use `worker` for exact references, command checks, and bounded evidence capture.
13
+ 5. Write details to `docs/memory/<domain>.md`.
14
+ 6. Keep `MEMORY.md` as a short index.
15
+ 7. Use the OS locale for user-visible output unless the user asks for another language.
@@ -0,0 +1,21 @@
1
+ # cairn-plan
2
+
3
+ Use the `cairn-plan` skill.
4
+
5
+ Goal: leave a decision-complete plan for the current task in files.
6
+
7
+ Procedure:
8
+
9
+ 1. Read `MEMORY.md` and relevant `docs/memory/*.md`.
10
+ 2. If the active or assigned model is Claude-family, read `docs/model-guidance/claude.md`; if Codex-family, read `docs/model-guidance/codex.md`.
11
+ 3. Run `scripts/cairn toolcheck` when available.
12
+ 4. If required LSP/check tools are missing, run `scripts/cairn toolcheck --install` or a repository-native install command before accepting a fallback.
13
+ 5. Explore before asking the user.
14
+ 6. Run complexity triage before applying agent, plugin, or delegated workflow guidance.
15
+ 7. Use Light Path by default unless a Heavy Path condition clearly applies.
16
+ 8. Use `explorer` for independent read-only discovery, impact analysis, pattern search, and read-only verification when available.
17
+ 9. Use `worker` for bounded implementation or verification tasks with clear file ownership. Keep urgent blocking work local.
18
+ 10. Write `docs/plan/<topic>.md`.
19
+ 11. Add the topic link and status to `PLAN.md`.
20
+ 12. Put tool readiness, module acceptance verification, and surface integration verification on every module slice.
21
+ 13. Use the OS locale for user-visible output unless the user asks for another language.
@@ -0,0 +1,14 @@
1
+ # cairn-review
2
+
3
+ Use the `cairn-review` skill.
4
+
5
+ Goal: review completed work against plan, memory, policy, and evidence.
6
+
7
+ Procedure:
8
+
9
+ 1. Read the plan slice and memory inputs.
10
+ 2. Check changed files, tool readiness evidence, and verification evidence.
11
+ 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.
12
+ 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.
13
+ 5. Record review evidence in `docs/plan/<topic>.md`.
14
+ 6. Use the OS locale for user-visible output unless the user asks for another language.
@@ -0,0 +1,17 @@
1
+ # cairn-toolcheck
2
+
3
+ Goal: detect repository stacks and check required LSP, typecheck, lint, dry-run, and verification tools.
4
+
5
+ Run the local command first:
6
+
7
+ ```sh
8
+ scripts/cairn toolcheck
9
+ ```
10
+
11
+ If required tools are missing, attempt repository-native installation:
12
+
13
+ ```sh
14
+ scripts/cairn toolcheck --install
15
+ ```
16
+
17
+ Record detected stacks, missing tools, install attempts, and blockers in the related `docs/plan/<topic>.md`.
@@ -0,0 +1,17 @@
1
+ # cairn-uninstall
2
+
3
+ Goal: remove the Codex, Claude Code, and Antigravity entries installed by Cairn.
4
+
5
+ Run:
6
+
7
+ ```sh
8
+ bunx cairn-ai@latest uninstall
9
+ ```
10
+
11
+ When running from local source:
12
+
13
+ ```sh
14
+ scripts/cairn uninstall
15
+ ```
16
+
17
+ The source work folder and user-created `MEMORY.md`, `PLAN.md`, `docs/memory`, and `docs/plan` files are not deleted.
@@ -0,0 +1,17 @@
1
+ # cairn-upgrade
2
+
3
+ Goal: update the current Cairn installation from the latest source.
4
+
5
+ Run:
6
+
7
+ ```sh
8
+ bunx cairn-ai@latest upgrade
9
+ ```
10
+
11
+ When running from local source:
12
+
13
+ ```sh
14
+ scripts/cairn upgrade
15
+ ```
16
+
17
+ After upgrade, check status with the `cairn-doctor` workflow.
@@ -0,0 +1,20 @@
1
+ # cairn-work
2
+
3
+ Use the `cairn-work` skill.
4
+
5
+ Goal: execute the next incomplete module slice in `PLAN.md`.
6
+
7
+ Procedure:
8
+
9
+ 1. Read `PLAN.md`, the detailed plan, `MEMORY.md`, and relevant memory notes.
10
+ 2. Read the Codex or Claude model guidance recorded in the plan.
11
+ 3. Select one small module slice.
12
+ 4. Confirm required tool readiness. If a required LSP/check tool is missing, run `scripts/cairn toolcheck --install` or a repository-native install command before accepting a fallback.
13
+ 5. Confirm the complexity triage and selected Light/Heavy Path recorded in the plan.
14
+ 6. For Light Path, implement directly or use one bounded `worker`, then run focused verification.
15
+ 7. For Heavy Path, follow the plan's staged implementation and review gates without role-mapping shortcuts.
16
+ 8. When delegating implementation to `worker`, state the file ownership clearly and tell the worker not to revert others' edits.
17
+ 9. Re-run module acceptance verification.
18
+ 10. Re-run surface integration verification.
19
+ 11. Record tool readiness and verification evidence in `docs/plan/<topic>.md` and update `PLAN.md`.
20
+ 12. Use the OS locale for user-visible output unless the user asks for another language.
@@ -0,0 +1,5 @@
1
+ # explorer
2
+
3
+ Read-only discovery agent for codebase questions, impact analysis, pattern search, and verification.
4
+
5
+ Refer to `agents/explorer.md`.
@@ -0,0 +1,5 @@
1
+ # worker
2
+
3
+ Focused execution agent for search, small edits, command checks, and QA artifacts.
4
+
5
+ Refer to `agents/worker.md`.
@@ -0,0 +1,13 @@
1
+ # cairn-doctor
2
+
3
+ Diagnose Cairn installation status.
4
+
5
+ ```sh
6
+ scripts/cairn doctor
7
+ ```
8
+
9
+ Published package:
10
+
11
+ ```sh
12
+ bunx cairn-ai@latest doctor
13
+ ```
@@ -0,0 +1,13 @@
1
+ # cairn-install
2
+
3
+ Install Cairn into Codex, Claude Code, and Antigravity.
4
+
5
+ ```sh
6
+ scripts/cairn install
7
+ ```
8
+
9
+ Published package:
10
+
11
+ ```sh
12
+ bunx cairn-ai@latest install
13
+ ```
@@ -0,0 +1,5 @@
1
+ # cairn-memory
2
+
3
+ Create or update `MEMORY.md` and `docs/memory/<domain>.md`.
4
+
5
+ Follow plugin command `commands/cairn-memory.md`.
@@ -0,0 +1,5 @@
1
+ # cairn-plan
2
+
3
+ Create or update `PLAN.md` and `docs/plan/<topic>.md`, including tool readiness.
4
+
5
+ Follow plugin command `commands/cairn-plan.md`.
@@ -0,0 +1,5 @@
1
+ # cairn-review
2
+
3
+ Review completed slices against memory, plan, policy, tool readiness, and evidence.
4
+
5
+ Follow plugin command `commands/cairn-review.md`.
@@ -0,0 +1,10 @@
1
+ # cairn-toolcheck
2
+
3
+ Detect repository stacks and check required LSP, typecheck, lint, dry-run, and verification tools.
4
+
5
+ ```sh
6
+ scripts/cairn toolcheck
7
+ scripts/cairn toolcheck --install
8
+ ```
9
+
10
+ Use `--install` before accepting a missing required tool as unavailable.
@@ -0,0 +1,13 @@
1
+ # cairn-uninstall
2
+
3
+ Remove the Codex, Claude Code, and Antigravity entries installed by Cairn.
4
+
5
+ ```sh
6
+ scripts/cairn uninstall
7
+ ```
8
+
9
+ Published package:
10
+
11
+ ```sh
12
+ bunx cairn-ai@latest uninstall
13
+ ```
@@ -0,0 +1,13 @@
1
+ # cairn-upgrade
2
+
3
+ Update the Cairn installation from the current source.
4
+
5
+ ```sh
6
+ scripts/cairn upgrade
7
+ ```
8
+
9
+ Published package:
10
+
11
+ ```sh
12
+ bunx cairn-ai@latest upgrade
13
+ ```
@@ -0,0 +1,5 @@
1
+ # cairn-work
2
+
3
+ Execute the next incomplete module slice with tool readiness, module acceptance verification, and surface integration verification.
4
+
5
+ Follow plugin command `commands/cairn-work.md`.
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "cairn",
3
+ "version": "0.1.1",
4
+ "description": "Token-efficient agent harness with tool readiness for Codex, Claude Code, and Antigravity.",
5
+ "author": {
6
+ "name": "WkNam"
7
+ },
8
+ "skills": "./skills/",
9
+ "interface": {
10
+ "displayName": "Cairn",
11
+ "shortDescription": "Memory, planning, tool readiness, and two-gate verification harness for agent teams.",
12
+ "longDescription": "Cairn brings a LazyCodex-inspired flow to Codex, Claude Code, and Antigravity while reducing token use through repository-local MEMORY.md, PLAN.md, domain notes, tool readiness checks, module-slice execution, and two-gate verification.",
13
+ "developerName": "WkNam",
14
+ "category": "Productivity",
15
+ "capabilities": [
16
+ "Hooks",
17
+ "Skills",
18
+ "Agent Workflow",
19
+ "Context Management",
20
+ "Planning",
21
+ "Tool Readiness"
22
+ ],
23
+ "defaultPrompt": [
24
+ "Use Cairn to create MEMORY.md and PLAN.md for this repository.",
25
+ "Run cairn-toolcheck before planning implementation work.",
26
+ "Run cairn-plan for this task without asking me for discoverable facts.",
27
+ "Run cairn-work from the current PLAN.md and pass both verification gates."
28
+ ]
29
+ }
30
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WkNam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.de.md ADDED
@@ -0,0 +1,130 @@
1
+ # Cairn
2
+
3
+ Cairn ist ein token-effizientes Multi-Agent-Harness-Plugin für Codex, Claude Code und Antigravity.
4
+
5
+ [English](README.md)
6
+
7
+ Die Grundidee ist, nützliches agent-harness-Verhalten beizubehalten: hooks, persistent state, explicit planning, focused delegation und stop-time guards. Cairn macht wiederholte TDD verification loops nicht zum Standard. Stattdessen teilt es Arbeit in kleine module slices und belegt jeden slice mit zwei verification gates.
8
+
9
+ 1. Module acceptance verification: belegt den geänderten module contract.
10
+ 2. Surface integration verification: belegt Verhalten über die echte surface, etwa CLI, HTTP, browser oder file artifacts.
11
+
12
+ Bevor ein slice externen Zustand verändert, zeichnet Cairn den nächstliegenden dry-run oder check mode auf und führt ihn aus. Verification ist begrenzt: Jeder slice erhält standardmäßig zwei verification passes; danach zeichnet der agent einen blocker auf oder teilt den slice, statt eine offene Schleife fortzusetzen.
13
+
14
+ Cairn behandelt tool readiness ebenfalls als Teil der Arbeit. LSP, typecheck, lint, dry-run und verification tools werden gegen den repository stack geprüft. Fehlt ein erforderliches tool, versucht Cairn eine project-local oder repository-native installation, bevor ein fallback akzeptiert wird.
15
+
16
+ ## LazyCodex Attribution
17
+
18
+ Cairn ist von LazyCodex (`https://github.com/code-yeongyu/lazycodex`) beeinflusst. Übernommene Ideen sind die installierbare agent-harness-Form, Codex hook trust/setup handling, project memory, planning skills, executable workflow commands, diagnostics und skill/agent packaging über local agent surfaces hinweg.
19
+
20
+ Cairn weicht in der execution policy bewusst von LazyCodex ab. Es übernimmt nicht das role-chain execution model oder die open-ended completion loops von LazyCodex. Cairn verwendet Light/Heavy Path triage, begrenzte `explorer`/`worker` delegation, zwei verification gates und explicit stop conditions.
21
+
22
+ ## Complexity Triage
23
+
24
+ Jede implementation task durchläuft zuerst complexity triage, bevor agent, plugin oder delegated workflow guidance angewendet werden. Triage wird aus repository exploration, erwartetem Änderungsumfang und risk signals entschieden, ohne den user nach auffindbaren Fakten zu fragen.
25
+
26
+ - Light Path: schmale Änderungen innerhalb existing architecture layers. Das ist der Standard. Direkt implementieren oder einen begrenzten `worker` verwenden, danach bleibt das verification gate bestehen.
27
+ - Heavy Path: new directory/module/layer, new domain model/service/abstraction, security/session/auth, external API/message queue/payment, DB schema/migration, concurrency/transaction/cache changes, cross-domain refactor oder explicit extra-care request.
28
+
29
+ Der gewählte path und die Begründung werden in `docs/plan/<topic>.md` festgehalten, wenn ein plan artifact existiert. Auch auf Light Path bleiben die zwei verification gates bestehen.
30
+
31
+ ## Tool Readiness
32
+
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
+
35
+ ```sh
36
+ cairn toolcheck
37
+ cairn toolcheck --install
38
+ ```
39
+
40
+ - `toolcheck` meldet detected stacks und missing tools.
41
+ - `toolcheck --install` versucht den nächstliegenden project-local oder repository-native install path, etwa package-manager dev dependencies, Composer dev dependencies, `uv`, Java LSP bootstrap, `go install` oder `rustup component add`.
42
+ - Cairn plans erfassen detected stack, required tools, install commands und blockers.
43
+ - Ein fehlender LSP server ist kein gültiger Grund, precise codebase exploration zu überspringen, bevor installation oder ein gleichwertiger symbol-aware fallback versucht wurde.
44
+
45
+ ## Dry-Run And Loop Policy
46
+
47
+ - Migrations und database changes verwenden vor write/apply commands `--pretend`, dry-run, schema diff, rollback feasibility checks oder das nächstliegende repository-native equivalent.
48
+ - Package, release, infrastructure, deployment, code generation und formatting work verwenden, wenn verfügbar, check, plan, diff, validate oder dry-run modes, bevor Zustand verändert wird.
49
+ - Wenn kein dry-run existiert, hält der plan dies fest und wählt den kleinsten reversiblen command oder test artifact.
50
+ - Wenn ein verification gate fehlschlägt, diagnostiziert Cairn einmal, verkleinert oder teilt den slice und führt beide gates erneut aus.
51
+ - Nach zwei fehlgeschlagenen verification passes für denselben slice zeichnet Cairn den blocker in `docs/plan/<topic>.md` auf, statt eine wiederholte Schleife fortzusetzen.
52
+
53
+ ## Model Guidance
54
+
55
+ Cairn wendet model-specific adjustment nur auf Claude-family und Codex-family models an.
56
+
57
+ - Claude-family: geeignet für long context, policy interpretation und plan/evidence review.
58
+ - Codex-family: geeignet für small implementation slices, explicit file edits, command-based verification und bounded `worker` tasks.
59
+
60
+ Details stehen in `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` und `docs/model-guidance/codex.md`.
61
+
62
+ ## Repository Artifacts
63
+
64
+ Das harness erstellt und pflegt diese files im Ziel-repository root.
65
+
66
+ - `MEMORY.md`: kurzer Index persistent domain knowledge.
67
+ - `docs/memory/*.md`: detailliertes Wissen je domain.
68
+ - `docs/model-guidance/*.md`: Claude- und Codex-model adjustment guidance.
69
+ - `PLAN.md`: kurzer Index aktiver und abgeschlossener work topics.
70
+ - `docs/plan/*.md`: detailed execution plans.
71
+
72
+ Root files bleiben kurz, Details wandern unter `docs/`, damit agents nur den benötigten context lesen.
73
+
74
+ ## Commands
75
+
76
+ Das veröffentlichte package kann mit `bunx` oder global installierten `cairn` commands ausgeführt werden.
77
+
78
+ ```sh
79
+ bunx cairn-ai@latest install
80
+ bunx cairn-ai@latest upgrade
81
+ bunx cairn-ai@latest doctor
82
+ bunx cairn-ai@latest uninstall
83
+ bunx cairn-ai@latest toolcheck
84
+ ```
85
+
86
+ Nach globaler installation sind auch kurze commands verfügbar.
87
+
88
+ ```sh
89
+ bun add -g cairn-ai
90
+ cairn install
91
+ cairn upgrade
92
+ cairn doctor
93
+ cairn uninstall
94
+ cairn toolcheck
95
+ ```
96
+
97
+ - `cairn install`: installiert das plugin in den Codex marketplace cache und konfiguriert hook trust state, Claude Code mirror files und Antigravity skills/workflows.
98
+ - `cairn upgrade`: aktualisiert installation, hook trust state, Claude Code mirror files und Antigravity skills/workflows aus der aktuellen source.
99
+ - `cairn doctor`: diagnostiziert Codex settings, installation, hook trust state, Claude Code mirror files und Antigravity mirror files.
100
+ - `cairn uninstall`: entfernt von Cairn hinzugefügte Codex settings, cache, Claude Code mirror files und Antigravity mirror files.
101
+ - `cairn toolcheck`: erkennt repository stacks und prüft oder installiert required LSP und verification tools.
102
+ - `cairn-memory`: erkundet domain knowledge und aktualisiert `MEMORY.md`.
103
+ - `cairn-plan`: erstellt einen decision-complete plan unter `docs/plan/`.
104
+ - `cairn-work`: führt den nächsten module slice im aktuellen `PLAN.md` mit zwei verification gates aus.
105
+ - `cairn-review`: prüft completed slices gegen plan, memory und evidence.
106
+
107
+ `install` und `upgrade` erstellen `*.cairn-backup-*` backups, bevor `~/.codex/config.toml` verändert wird. Das source plugin manifest bleibt validator-friendly; nur die installed cache copy erhält ein `hooks` field zur Aktivierung von Codex hooks.
108
+
109
+ Codex verwendet `skills/` und `commands/`. Claude Code verwendet gespiegelte commands und agent definitions unter `.claude/`. Antigravity verwendet `.agents/workflows` und globale skills mirrors.
110
+
111
+ ## Antigravity Compatibility
112
+
113
+ Antigravity unterstützt `SKILL.md`-basierte Agent Skills und Workflows, die als `/workflow-name` aufgerufen werden. Cairn installiert für diese Oberfläche die folgenden paths.
114
+
115
+ - Antigravity IDE: `~/.agents/skills/cairn-*`, `~/.agents/workflows/cairn-*.md`.
116
+ - Antigravity CLI: `~/.gemini/antigravity-cli/skills/cairn-*`, `~/.gemini/antigravity-cli/workflows/cairn-*.md`.
117
+
118
+ Codex-only hooks werden nicht nach Antigravity portiert. Stattdessen laufen dieselben planning-, memory-, complexity triage- und two-gate verification procedures über Skills und Workflows. Setze `ANTIGRAVITY_HOME` oder `ANTIGRAVITY_CLI_HOME`, um paths zu überschreiben.
119
+
120
+ ## Locale Policy
121
+
122
+ Cairns reusable instructions sind für global use auf Englisch geschrieben. User-visible output folgt der konfigurierten OS locale, sofern der user nicht ausdrücklich eine andere Sprache verlangt. Die CLI lokalisiert common messages für `en`, `ko`, `ja`, `zh`, `es`, `fr`, `de` und `pt` und fällt bei unsupported locales auf English zurück. Codex hook `statusMessage` text bleibt static English, während hook command output English oder Korean ist.
123
+
124
+ ## Delegation
125
+
126
+ - `explorer`: erledigt read-only codebase discovery, impact analysis, pattern searches und read-only verification, wenn verfügbar.
127
+ - `worker`: erledigt bounded implementation oder verification tasks mit klarem file ownership.
128
+ - Main session: hält urgent blocking work lokal, wenn der nächste Schritt sofort vom Ergebnis abhängt.
129
+
130
+ Jeder delegation prompt verwendet sechs sections: TASK, EXPECTED OUTCOME, REQUIRED TOOLS, MUST DO, MUST NOT DO, CONTEXT.
package/README.es.md ADDED
@@ -0,0 +1,130 @@
1
+ # Cairn
2
+
3
+ Cairn es un plugin de harness multi-agente eficiente en tokens para Codex, Claude Code y Antigravity.
4
+
5
+ [English](README.md)
6
+
7
+ La idea central es conservar comportamientos útiles de agent harness: hooks, estado persistente, planificación explícita, delegación enfocada y guardas al detenerse. Cairn no hace que los bucles repetidos de verificación TDD sean el comportamiento predeterminado. En su lugar, divide el trabajo en pequeños module slices y prueba cada slice con dos verification gates.
8
+
9
+ 1. Module acceptance verification: prueba el contrato del módulo modificado.
10
+ 2. Surface integration verification: prueba el comportamiento a través de una superficie real, como CLI, HTTP, navegador o artefactos de archivo.
11
+
12
+ Antes de que un slice modifique estado externo, Cairn registra y ejecuta el dry-run o check mode más cercano disponible. La verificación está acotada: cada slice tiene dos verification passes por defecto; después, el agente registra un blocker o divide el slice en lugar de continuar un bucle abierto.
13
+
14
+ Cairn también trata la preparación de herramientas como parte del trabajo. LSP, typecheck, lint, dry-run y verification tools se revisan contra el stack del repositorio. Si falta una herramienta requerida, Cairn intenta una instalación project-local o repository-native antes de aceptar un fallback.
15
+
16
+ ## LazyCodex Attribution
17
+
18
+ Cairn está influido por LazyCodex (`https://github.com/code-yeongyu/lazycodex`). Las ideas tomadas son la forma de agent harness instalable, el manejo de Codex hook trust/setup, project memory, planning skills, executable workflow commands, diagnostics y skill/agent packaging entre local agent surfaces.
19
+
20
+ Cairn diverge intencionalmente de LazyCodex en la execution policy. No adopta el role-chain execution model ni los open-ended completion loops de LazyCodex. Cairn usa Light/Heavy Path triage, delegación acotada con `explorer`/`worker`, dos verification gates y explicit stop conditions.
21
+
22
+ ## Complexity Triage
23
+
24
+ Cada implementation task pasa primero por complexity triage, antes de aplicar agent, plugin o delegated workflow guidance. El triage se decide a partir de la exploración del repositorio, el alcance esperado del cambio y señales de riesgo, sin preguntar al usuario por hechos que se puedan descubrir.
25
+
26
+ - Light Path: cambios estrechos dentro de existing architecture layers. Es el valor predeterminado. Implementa directamente o usa un `worker` acotado, y conserva el verification gate.
27
+ - Heavy Path: new directory/module/layer, new domain model/service/abstraction, security/session/auth, external API/message queue/payment, DB schema/migration, concurrency/transaction/cache changes, cross-domain refactor o una explicit extra-care request.
28
+
29
+ El path seleccionado y su justificación se registran en `docs/plan/<topic>.md` cuando existe un plan artifact. Incluso en Light Path, se mantienen los dos verification gates.
30
+
31
+ ## Tool Readiness
32
+
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
+
35
+ ```sh
36
+ cairn toolcheck
37
+ cairn toolcheck --install
38
+ ```
39
+
40
+ - `toolcheck` reporta detected stacks y missing tools.
41
+ - `toolcheck --install` intenta la ruta de instalación project-local o repository-native más cercana, como dev dependencies del package manager, dev dependencies de Composer, `uv`, Java LSP bootstrap, `go install` o `rustup component add`.
42
+ - Los planes de Cairn registran detected stack, required tools, install commands y blockers.
43
+ - Que falte un LSP server no es razón válida para saltarse precise codebase exploration hasta intentar installation o un fallback symbol-aware equivalente.
44
+
45
+ ## Dry-Run And Loop Policy
46
+
47
+ - Migrations y database changes usan `--pretend`, dry-run, schema diff, rollback feasibility checks o el equivalente repository-native más cercano antes de comandos write/apply.
48
+ - Package, release, infrastructure, deployment, code generation y formatting work usan check, plan, diff, validate o dry-run modes antes de mutar estado cuando están disponibles.
49
+ - Si no existe dry-run, el plan registra ese hecho y elige el comando reversible más pequeño o el artefacto de prueba disponible.
50
+ - Si falla un verification gate, Cairn diagnostica una vez, reduce o divide el slice y vuelve a ejecutar ambos gates.
51
+ - Después de dos verification passes fallidos para el mismo slice, Cairn registra el blocker en `docs/plan/<topic>.md` en lugar de continuar un bucle repetido.
52
+
53
+ ## Model Guidance
54
+
55
+ Cairn solo aplica ajustes específicos de modelo a modelos Claude-family y Codex-family.
56
+
57
+ - Claude-family: útil para long context, policy interpretation y plan/evidence review.
58
+ - Codex-family: útil para small implementation slices, explicit file edits, command-based verification y bounded `worker` tasks.
59
+
60
+ La guía detallada vive en `docs/model-guidance/README.md`, `docs/model-guidance/claude.md` y `docs/model-guidance/codex.md`.
61
+
62
+ ## Repository Artifacts
63
+
64
+ El harness crea y mantiene estos archivos en la raíz del repositorio objetivo.
65
+
66
+ - `MEMORY.md`: índice corto de conocimiento persistente del dominio.
67
+ - `docs/memory/*.md`: conocimiento detallado por dominio.
68
+ - `docs/model-guidance/*.md`: guía de ajuste de modelos Claude y Codex.
69
+ - `PLAN.md`: índice corto de temas activos y completados.
70
+ - `docs/plan/*.md`: planes de ejecución detallados.
71
+
72
+ Los archivos raíz se mantienen cortos y los detalles pasan a `docs/`, para que los agentes lean solo el contexto que necesitan.
73
+
74
+ ## Commands
75
+
76
+ El paquete publicado puede ejecutarse con `bunx` o con comandos `cairn` instalados globalmente.
77
+
78
+ ```sh
79
+ bunx cairn-ai@latest install
80
+ bunx cairn-ai@latest upgrade
81
+ bunx cairn-ai@latest doctor
82
+ bunx cairn-ai@latest uninstall
83
+ bunx cairn-ai@latest toolcheck
84
+ ```
85
+
86
+ Después de una instalación global, también están disponibles comandos cortos.
87
+
88
+ ```sh
89
+ bun add -g cairn-ai
90
+ cairn install
91
+ cairn upgrade
92
+ cairn doctor
93
+ cairn uninstall
94
+ cairn toolcheck
95
+ ```
96
+
97
+ - `cairn install`: instala el plugin en el Codex marketplace cache y configura hook trust state, mirror files de Claude Code y skills/workflows de Antigravity.
98
+ - `cairn upgrade`: actualiza la instalación, hook trust state, mirror files de Claude Code y skills/workflows de Antigravity desde la fuente actual.
99
+ - `cairn doctor`: diagnostica Codex settings, installation, hook trust state, mirror files de Claude Code y mirror files de Antigravity.
100
+ - `cairn uninstall`: elimina Codex settings, cache, mirror files de Claude Code y mirror files de Antigravity agregados por Cairn.
101
+ - `cairn toolcheck`: detecta repository stacks y revisa o instala required LSP y verification tools.
102
+ - `cairn-memory`: explora domain knowledge y actualiza `MEMORY.md`.
103
+ - `cairn-plan`: crea un decision-complete plan bajo `docs/plan/`.
104
+ - `cairn-work`: ejecuta el siguiente module slice del `PLAN.md` actual con dos verification gates.
105
+ - `cairn-review`: revisa completed slices contra plan, memory y evidence.
106
+
107
+ `install` y `upgrade` crean backups `*.cairn-backup-*` antes de modificar `~/.codex/config.toml`. El source plugin manifest permanece validator-friendly; solo la copia instalada en cache recibe un campo `hooks` para activar Codex hooks.
108
+
109
+ Codex usa `skills/` y `commands/`. Claude Code usa comandos reflejados y definiciones de agentes bajo `.claude/`. Antigravity usa `.agents/workflows` y mirrors globales de skills.
110
+
111
+ ## Antigravity Compatibility
112
+
113
+ Antigravity soporta Agent Skills y Workflows basados en `SKILL.md` invocados como `/workflow-name`. Cairn instala estas rutas para esa superficie.
114
+
115
+ - Antigravity IDE: `~/.agents/skills/cairn-*`, `~/.agents/workflows/cairn-*.md`.
116
+ - Antigravity CLI: `~/.gemini/antigravity-cli/skills/cairn-*`, `~/.gemini/antigravity-cli/workflows/cairn-*.md`.
117
+
118
+ Los hooks exclusivos de Codex no se portan a Antigravity. En su lugar, los mismos procedimientos de planning, memory, complexity triage y two-gate verification se ejecutan mediante Skills y Workflows. Define `ANTIGRAVITY_HOME` o `ANTIGRAVITY_CLI_HOME` para sobrescribir las rutas.
119
+
120
+ ## Locale Policy
121
+
122
+ Las instrucciones reutilizables de Cairn están escritas en inglés para uso global. El output visible para el usuario debe seguir el OS locale configurado, salvo que el usuario pida otro idioma explícitamente. La CLI localiza mensajes comunes para `en`, `ko`, `ja`, `zh`, `es`, `fr`, `de` y `pt`, y vuelve a English para locales no soportados. El texto `statusMessage` de Codex hooks permanece en inglés estático, mientras que hook command output es English o Korean.
123
+
124
+ ## Delegation
125
+
126
+ - `explorer`: maneja read-only codebase discovery, impact analysis, pattern searches y read-only verification cuando está disponible.
127
+ - `worker`: maneja bounded implementation o verification tasks con file ownership claro.
128
+ - Main session: mantiene local el urgent blocking work cuando el siguiente paso depende inmediatamente del resultado.
129
+
130
+ Cada delegation prompt usa seis secciones: TASK, EXPECTED OUTCOME, REQUIRED TOOLS, MUST DO, MUST NOT DO, CONTEXT.