@first-tree-ai/context-tree 0.1.7-alpha.202609010710 → 0.1.7

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 (37) hide show
  1. package/README.md +35 -38
  2. package/dist/cli/index.mjs +923 -647
  3. package/package.json +7 -28
  4. package/scripts/postinstall.mjs +53 -0
  5. package/skills/context-tree-connect/SKILL.md +9 -7
  6. package/skills/context-tree-create/SKILL.md +10 -10
  7. package/skills/context-tree-publish/SKILL.md +4 -8
  8. package/skills/context-tree-read/SKILL.md +32 -12
  9. package/skills/context-tree-setup/SKILL.md +7 -12
  10. package/skills/context-tree-write/SKILL.md +196 -17
  11. package/.agents/plugins/marketplace.json +0 -19
  12. package/.claude-plugin/marketplace.json +0 -21
  13. package/.claude-plugin/plugin.json +0 -16
  14. package/.codex-plugin/plugin.json +0 -36
  15. package/dist/cli/index.d.mts +0 -1
  16. package/dist/index.d.mts +0 -77
  17. package/dist/index.mjs +0 -1449
  18. package/dist/schemas-C_7izpsa.d.mts +0 -390
  19. package/dist/schemas-DKHE1sWt.mjs +0 -289
  20. package/dist/schemas.d.mts +0 -2
  21. package/dist/schemas.mjs +0 -2
  22. package/docs/specification.md +0 -160
  23. package/examples/basic/NODE.md +0 -15
  24. package/examples/basic/members/NODE.md +0 -8
  25. package/examples/basic/members/example-agent/NODE.md +0 -7
  26. package/examples/basic/members/example-agent/memory.md +0 -9
  27. package/examples/basic/systems/NODE.md +0 -10
  28. package/examples/basic/systems/runtime.md +0 -15
  29. package/hooks/hooks.json +0 -26
  30. package/hooks/session-start.mjs +0 -55
  31. package/policy/context-tree-policy.md +0 -156
  32. package/skills/context-tree-connect/scripts/context-tree.mjs +0 -41
  33. package/skills/context-tree-create/scripts/context-tree.mjs +0 -41
  34. package/skills/context-tree-publish/scripts/context-tree.mjs +0 -41
  35. package/skills/context-tree-read/scripts/context-tree.mjs +0 -41
  36. package/skills/context-tree-setup/scripts/context-tree.mjs +0 -41
  37. package/skills/context-tree-write/scripts/context-tree.mjs +0 -41
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Context Tree
2
2
 
3
3
  `@first-tree-ai/context-tree` provides durable, structured project context for
4
- coding agents. It ships a portable core, CLI, policy, templates, hook, and six
4
+ coding agents. It ships a portable core, CLI, templates, and six
5
5
  framework-neutral skills.
6
6
 
7
7
  A Context Tree records current decisions, constraints, relationships, and their
@@ -19,44 +19,42 @@ are credential-free `OWNER/REPO` identities, never URLs containing credentials.
19
19
 
20
20
  ## Install
21
21
 
22
- ### Codex or Claude Code plugin (recommended)
23
-
24
- Install the marketplace and plugin, then start a new session so the host can
25
- discover the skills and lifecycle hook.
26
-
27
- For Codex:
28
-
29
22
  ```bash
30
- codex plugin marketplace add first-tree-ai/context-tree
31
- codex plugin add context-tree@context-tree
23
+ npm install --global @first-tree-ai/context-tree
32
24
  ```
33
25
 
34
- For Claude Code:
26
+ That installs the `context-tree` command and copies the six skills into the
27
+ skill directory of every agent you already have:
35
28
 
36
- ```bash
37
- claude plugin marketplace add first-tree-ai/context-tree
38
- claude plugin install context-tree@context-tree
29
+ ```text
30
+ claude ~/.claude/skills/ (6 skills)
31
+ codex → ~/.codex/skills/ (6 skills)
39
32
  ```
40
33
 
41
- Both marketplaces install the same npm package, and every plugin component uses
42
- its private packaged CLI rather than a global `PATH` command — so plugin users
43
- need no separate CLI installation. Review and trust the session-start hook if
44
- your host asks. Then try asking:
34
+ Restart your agent so it discovers them, then try asking:
45
35
 
46
36
  > Set up a Context Tree for this project, then read the relevant context.
47
37
 
48
38
  > Write this architectural decision to the Context Tree.
49
39
 
50
- ### Global CLI (optional)
51
-
52
- Install globally only when scripts or terminal workflows need a `context-tree`
53
- command on `PATH`:
40
+ Skill installation is a normal command, so you can re-run it after installing a
41
+ new agent, or scope it to one project:
54
42
 
55
43
  ```bash
56
- npm install --global @first-tree-ai/context-tree
57
- context-tree --help
44
+ context-tree install # every agent you have
45
+ context-tree install --host codex # one agent
46
+ context-tree install --project . # ./.claude/skills and ./.codex/skills
58
47
  ```
59
48
 
49
+ Installing only ever writes `context-tree-*` skill directories, never touches
50
+ skills it does not own, and never creates a configuration directory for an agent
51
+ that is not present. Adding support for another agent is one entry in the host
52
+ table in `src/core/install.ts`.
53
+
54
+ Once a project is connected, `create` and `connect` record the tree in the
55
+ project's own `AGENTS.md`, so any agent that reads instruction files knows the
56
+ tree exists without host-specific configuration.
57
+
60
58
  ## Six skills
61
59
 
62
60
  ### Setup
@@ -65,8 +63,7 @@ context-tree --help
65
63
  connection. It asks whether to create a new tree or connect an existing one,
66
64
  then delegates to the create or connect workflow rather than duplicating
67
65
  lifecycle policy. Read and write invoke setup when the current project has no
68
- connection, and the session hook remains silent. Setup never publishes without
69
- explicit confirmation.
66
+ connection. Setup never publishes without explicit confirmation.
70
67
 
71
68
  ### Create
72
69
 
@@ -142,9 +139,12 @@ preserves the worktree. Prepare again and reapply the intended semantic change
142
139
  once; there is no automatic rebase, retry loop, or pull-request fallback.
143
140
 
144
141
  A preserved or abandoned write leaves its temporary worktree on disk and a
145
- `context-tree/write/<name>` branch in the tree. Nothing removes these for you:
146
- clear them with `git worktree remove <path>` and `git branch -D <branch>` in the
147
- connected tree once you no longer need the pending edits.
142
+ `context-tree/write/<name>` branch in the tree. The next `prepare-write` reclaims
143
+ one of these only when it holds no commit your checkout lacks, has no pending
144
+ change, and has gone untouched for twenty-four hours, so a worktree you are still
145
+ editing and a `WRITE_OUTDATED` worktree awaiting its retry are both left alone.
146
+ Those keep their pending edits until you clear them with
147
+ `git worktree remove <path>` and `git branch -D <branch>` in the connected tree.
148
148
 
149
149
  ### Publish
150
150
 
@@ -181,15 +181,15 @@ commit or discard them), `INVALID_TREE` (structure fails `verify`),
181
181
  The public command inventory is:
182
182
 
183
183
  ```text
184
- create connect list resolve sync prepare-write finish-write
185
- publish read verify policy
184
+ install create connect list resolve sync prepare-write
185
+ finish-write publish read verify
186
186
  ```
187
187
 
188
188
  Setup, create, connect, read, write, and publish ship as six skills; setup
189
- orchestrates the five concrete workflows. `resolve`, `sync`, `prepare-write`,
190
- `finish-write`, `verify`, and `policy` are plugin plumbing or diagnostic
191
- commands rather than separate user intentions; `list` backs setup's
192
- connect-target discovery.
189
+ orchestrates the five concrete workflows. `install` is the distribution
190
+ entry point, run for you by `npm install`. `resolve`, `sync`, `prepare-write`,
191
+ `finish-write`, and `verify` are plumbing or diagnostic commands rather than
192
+ separate user intentions; `list` backs setup's connect-target discovery.
193
193
  All machine-readable responses use strict schema version `1`.
194
194
 
195
195
  `verify` is intended for CI and diagnostics. Normal skills invoke it only after
@@ -202,10 +202,7 @@ pnpm install
202
202
  pnpm check
203
203
  pnpm typecheck
204
204
  pnpm test
205
- pnpm build
206
- pnpm validate:skills
207
205
  pnpm check:package
208
- npm pack --dry-run
209
206
  ```
210
207
 
211
208
  See [docs/specification.md](docs/specification.md) for contracts and safety