plan-tree 0.2.1

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.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # Plan Tree
2
+
3
+ [中文说明](README.zh-CN.md)
4
+
5
+ ![Plan Tree](assets/plan-tree.jpg)
6
+
7
+ > Turn short-lived plans into a long-term, stable, structured tree.
8
+
9
+ `plan-tree` is a portable AI planning skill for keeping project planning durable. It turns temporary provider plans, discussions, decisions, open questions, handoff state, and verification evidence into a Markdown planning tree that can survive many sessions and many agents.
10
+
11
+ ## Core Idea
12
+
13
+ Provider-native `plan` features are usually short-term, session-local task plans. They can answer "what should happen next", but they rarely preserve why a direction was chosen, what was rejected, which questions remain open, where progress stands, or where the next session should resume.
14
+
15
+ AI makes this failure mode sharper. Many older projects looked like `10% planning + 90% implementation`: implementation was slow enough that humans could keep correcting direction while coding. In AI-assisted work, implementation is compressed, and complex projects often move closer to `90% planning + 10% implementation`. The numbers are not exact accounting; they describe where quality is now won or lost.
16
+
17
+ That means the workflow must change. Do not keep doing small planning, small execution, and planning while mutating production files. `plan-tree` favors a larger loop: discuss and clarify first, shape an implementation-ready solution map, then let AI execute in larger batches. After execution, write progress, evidence, and remaining questions back into the planning tree.
18
+
19
+ ## Why It Matters
20
+
21
+ Structured plans are easier to maintain than structured code because they organize expression and collaboration. Structured code must also carry executable behavior, compatibility, performance, dependencies, failures, and change. Plan nodes such as roadmap, status, decisions, open questions, risks, and history are stable semantic slots: new information can usually be classified without changing the tree. Code modules, classes, functions, and interfaces are executable boundaries; real requirements such as partial validation, user configuration, recovery, multi-tenancy, retries, old data, third-party failures, and performance pressure can pierce those boundaries.
22
+
23
+ In that sense, `plan-tree` acts as an intent space or control plane for code evolution. The codebase is the implementation space; the planning tree is the space of intent, constraints, evaluation, and projection. A plan item such as "parser and storage must stay decoupled" is not code, but it is a useful observation and constraint over code. Most implementation changes can project back into plan state as `Done`, `Blocked`, `Risk reduced`, `Decision changed`, or `Question opened`. Changes that never project back into the plan become invisible drift.
24
+
25
+ This is why plan drift is easier to see: `Next` contains completed work, `Open Questions` contains settled issues, roadmap and status disagree, or two files describe the same decision. Code drift is more hidden: the program may still run and tests may still pass while module ownership widens, abstractions stop matching reality, shared utilities become junk drawers, and layers learn too much about each other.
26
+
27
+ Design and maintenance principles:
28
+
29
+ - Keep node types stable and semantic: roadmap, status, decisions, open questions, topics, history, and ideas.
30
+ - Separate intent, decision, current state, unresolved uncertainty, execution evidence, and historical detail.
31
+ - Treat implementation discoveries as plan updates before they become silent architecture changes.
32
+ - Link related files instead of duplicating the same rule in many places.
33
+ - Archive old evidence so active roadmap and handoff files stay short.
34
+ - Mark work done only when the artifact, decision, or verification exists.
35
+ - Use open questions only for unresolved questions, not as a task list.
36
+
37
+ ## What It Stores
38
+
39
+ A mature planning tree keeps durable state such as:
40
+
41
+ - Entry point and reading path.
42
+ - Roadmap and current progress.
43
+ - Stable decisions.
44
+ - Open questions.
45
+ - Topic notes for solution maps, boundaries, risks, and acceptance criteria.
46
+ - Implementation status and handoff notes.
47
+ - Historical verification and checkpoint evidence.
48
+
49
+ Default shape:
50
+
51
+ ```text
52
+ docs/plantree/
53
+ README.md
54
+ baseline/
55
+ plans/<plan-name>/
56
+ README.md
57
+ roadmap.md
58
+ implementation-status.md
59
+ open-questions.md
60
+ topics/
61
+ decisions/
62
+ history/
63
+ ideas/inbox.md
64
+ ```
65
+
66
+ Mature existing planning trees do not need to be forced into `docs/plantree/`. They can be registered, bridged, and migrated gradually.
67
+
68
+ ## Versioning
69
+
70
+ `plan-tree` uses Semantic Versioning for public releases:
71
+
72
+ - `MAJOR`: incompatible changes to the skill contract or default tree model.
73
+ - `MINOR`: new work modes, document roles, templates, or provider metadata that remain compatible.
74
+ - `PATCH`: wording fixes, small documentation updates, and compatibility-safe refinements.
75
+
76
+ The current version is stored in `VERSION`. Release tags use the `vX.Y.Z` format, for example `v0.1.0`.
77
+
78
+ ## Usage
79
+
80
+ The main usage pattern is to add this English memory rule to `AGENTS.md`, team memory, or agent memory. Providers can then invoke `plan-tree` automatically whenever planning, clarification, progress tracking, or plan-to-execution coordination is involved.
81
+
82
+ ```md
83
+ ## Plan Tree Usage Rule
84
+
85
+ Any project planning, roadmap discussion, requirement clarification, scope negotiation, implementation strategy, progress tracking, handoff, decision recording, open-question management, or plan-to-execution coordination must use the `plan-tree` skill as the planning authority and state store.
86
+
87
+ When a request is related to planning or implementation direction, first inspect the relevant plan-tree entrypoint and current plan state when available. If no plan-tree exists and the task needs durable planning state, initialize or propose the minimal `docs/plantree/` structure according to the skill rules.
88
+
89
+ Before the solution is mature enough to implement, stay in planning and clarification mode. Deeply elicit and expand the user's intent into a concrete solution map: goals, non-goals, constraints, options, tradeoffs, risks, dependencies, acceptance criteria, verification path, and rollout or rollback notes. Record durable clarification results, open questions, assumptions, and decisions in plan-tree files when useful.
90
+
91
+ Do not start formal implementation in the main project surface while the plan still contains unresolved core ambiguity. At most, create a small isolated prototype or sample only when it helps validate the direction, and keep it clearly separate from the production path.
92
+
93
+ A plan is implementation-ready only when the scope, chosen approach, expected behavior, affected surfaces, acceptance criteria, verification method, and remaining risks are explicit enough that execution should not rely on "figure it out while coding." Once implementation-ready, proceed autonomously with the project changes, then update plan-tree status, decisions, open questions, and handoff notes to reflect the result.
94
+
95
+ `plan-tree` governs planning documents and execution readiness. It does not by itself authorize commits, pushes, releases, destructive file operations, or broad unrelated refactors unless the user explicitly asks for them.
96
+ ```
97
+
98
+ ## Installation
99
+
100
+ Install the lightweight installer from PyPI or npm, then install the skill for your provider:
101
+
102
+ ```bash
103
+ python -m pip install seemseam-plan-tree
104
+ plan-tree install --provider claude
105
+ ```
106
+
107
+ ```bash
108
+ npm install -g plan-tree
109
+ plan-tree install --provider opencode
110
+ ```
111
+
112
+ Supported providers:
113
+
114
+ ```bash
115
+ plan-tree install --provider claude
116
+ plan-tree install --provider opencode
117
+ plan-tree install --provider codex
118
+ plan-tree install --provider all
119
+ ```
120
+
121
+ The installer copies only the skill payload: `SKILL.md`, `VERSION`, README files, `references/`, `assets/`, and Codex/OpenAI metadata when installing for Codex. It does not install `.ccb/`, git state, logs, generated artifacts, or project runtime files.
122
+
123
+ For local development or offline installation, point the installer at this repository:
124
+
125
+ ```bash
126
+ plan-tree install --provider claude --source /path/to/plan-tree
127
+ ```
128
+
129
+ You can also clone this repository directly into your skill directory:
130
+
131
+ ```bash
132
+ mkdir -p "$SKILLS_HOME"
133
+ git clone https://github.com/SeemSeam/plan-tree.git "$SKILLS_HOME/plan-tree"
134
+ ```
135
+
136
+ Set `SKILLS_HOME` to the skill root used by your provider. Or clone directly to an explicit path:
137
+
138
+ ```bash
139
+ git clone https://github.com/SeemSeam/plan-tree.git /path/to/skills/plan-tree
140
+ ```
141
+
142
+ ## Repository Contents
143
+
144
+ ```text
145
+ VERSION
146
+ SKILL.md
147
+ pyproject.toml
148
+ package.json
149
+ bin/plan-tree.js
150
+ agents/openai.yaml
151
+ references/maintenance-patterns.md
152
+ references/legacy-migration.md
153
+ assets/plan-tree.jpg
154
+ README.md
155
+ README.zh-CN.md
156
+ ```
@@ -0,0 +1,156 @@
1
+ # Plan Tree
2
+
3
+ [English](README.md)
4
+
5
+ ![Plan Tree](assets/plan-tree.jpg)
6
+
7
+ > 把短期 plans 变成一棵长期稳定、结构化的树。
8
+
9
+ `plan-tree` 是一个通用的 AI planning skill,用于长期保存项目规划状态。它把临时 provider plans、讨论、决策、开放问题、交接状态和验证证据沉淀成一棵 Markdown 规划树,让项目跨会话、跨 agent 推进时不漂移。
10
+
11
+ ## 核心思想
12
+
13
+ Provider 自带的 `plan` 通常是短期的、会话内的、任务级的。它能安排“下一步做什么”,但很难长期保存“为什么这么做、哪些方案被排除、哪些问题未决、当前进度到哪里、下一次应该从哪里继续”。结果是:计划用后即丢,项目越推进越容易漂移。
14
+
15
+ AI 让这个问题更明显。过去很多项目接近 `10% 规划 + 90% 实施`:实现本身很慢,开发者有足够长的反馈周期边做边修正方向。AI 时代实现速度被大幅压缩,复杂项目更接近 `90% 规划 + 10% 实施`。这个比例不是精确工时,而是工作重心变化:质量越来越取决于前置方案是否充分、边界是否稳定、验收是否清楚、状态源是否统一。
16
+
17
+ 因此工作流也必须改变:不要继续“小规划 + 小推进 + 边落盘边想”。`plan-tree` 推荐大循环模式:先充分讨论、澄清、形成可落地方案图谱,再让 AI 批量执行;执行完成后,再把进度、证据和剩余问题回写到规划树。
18
+
19
+ ## Plan Tree 的意义
20
+
21
+ 结构化 plans 比结构化代码更好维护,是因为 plan 的结构主要约束表达和协作;代码结构还必须承载可执行行为、历史兼容、性能、依赖、失败和变化。Roadmap、Status、Decision、Open Questions、Risks、History 这些 plan 节点是稳定的语义槽位,新信息通常可以归类进去,不必改变树的结构。代码里的模块、类、函数、接口则是可执行边界;部分校验、用户配置、失败恢复、多租户、后台重试、老数据、第三方失败和性能压力都会穿透原来的边界。
22
+
23
+ 从这个角度看,`plan-tree` 是代码演化的意图空间和控制平面。代码库是实现空间;规划树是意图、约束、评价和投影空间。比如“parser 与 storage 必须解耦”不是代码,但它是作用在代码状态上的观察和约束。大部分实现变化都应该能投影回 plan:`Done`、`Blocked`、`Risk reduced`、`Decision changed` 或 `Question opened`。长期没有投影回 plan 的变化,就会变成不可见的漂移。
24
+
25
+ Plan 的漂移更容易看见:`Next` 里全是已完成事项,`Open Questions` 里有已决问题,roadmap 和 status 对不上,两个文件重复表达同一个决策。代码漂移更隐蔽:程序还能跑、测试还能过,但模块职责变宽,抽象不再贴合现实,公共工具变成杂物间,层与层之间互相知道太多。
26
+
27
+ 设计和维护原则:
28
+
29
+ - 保持节点类型稳定且语义化:roadmap、status、decisions、open questions、topics、history、ideas。
30
+ - 分离意图、决策、当前状态、未解决问题、执行证据和历史细节。
31
+ - 实现中发现新事实时,先更新 plan,避免它沉淀成无记录的架构变化。
32
+ - 用链接关联文件,不要在多个地方重复同一条规则。
33
+ - 把旧证据归档,让活跃 roadmap 和 handoff 保持短小。
34
+ - 只有当 artifact、decision 或 verification 存在时,才把事项标为 done。
35
+ - Open questions 只放未解决问题,不要当任务列表使用。
36
+
37
+ ## Plan Tree 保存什么
38
+
39
+ 一棵成熟的 planning tree 通常保存这些长期状态:
40
+
41
+ - 规划入口和阅读路径:从哪里读、哪个文件说了算。
42
+ - Roadmap 和当前进度:什么完成了、什么正在做、下一步是什么。
43
+ - Decisions:稳定决策、上下文和后果。
44
+ - Open questions:仍未解决的问题,而不是隐藏任务。
45
+ - Topics:方案图谱,包括业务流程、架构边界、验收标准、风险和执行门禁。
46
+ - Implementation status:当前交接、活跃 TODO、blockers、最近验证。
47
+ - History:旧验证、检查点和过期证据,避免污染活跃状态。
48
+
49
+ 默认结构可以是:
50
+
51
+ ```text
52
+ docs/plantree/
53
+ README.md
54
+ baseline/
55
+ plans/<plan-name>/
56
+ README.md
57
+ roadmap.md
58
+ implementation-status.md
59
+ open-questions.md
60
+ topics/
61
+ decisions/
62
+ history/
63
+ ideas/inbox.md
64
+ ```
65
+
66
+ 已有成熟规划树不必强行迁移到 `docs/plantree/`。可以先注册、桥接,再逐步整理。
67
+
68
+ ## 版本管理
69
+
70
+ `plan-tree` 使用语义化版本管理公开发布:
71
+
72
+ - `MAJOR`:skill 契约或默认树模型出现不兼容变化。
73
+ - `MINOR`:新增 work modes、文档角色、模板或 provider metadata,且保持兼容。
74
+ - `PATCH`:措辞修正、小型文档更新和兼容性安全的细节优化。
75
+
76
+ 当前版本写在 `VERSION` 文件中。发布 tag 使用 `vX.Y.Z` 格式,例如 `v0.1.0`。
77
+
78
+ ## 使用方式
79
+
80
+ 最重要的使用方式不是记命令,而是把下面英文规则写进项目记忆文件,例如 `AGENTS.md`、团队 memory 或 agent memory。之后 provider 会在相关任务中自动使用 `plan-tree`。
81
+
82
+ ```md
83
+ ## Plan Tree Usage Rule
84
+
85
+ Any project planning, roadmap discussion, requirement clarification, scope negotiation, implementation strategy, progress tracking, handoff, decision recording, open-question management, or plan-to-execution coordination must use the `plan-tree` skill as the planning authority and state store.
86
+
87
+ When a request is related to planning or implementation direction, first inspect the relevant plan-tree entrypoint and current plan state when available. If no plan-tree exists and the task needs durable planning state, initialize or propose the minimal `docs/plantree/` structure according to the skill rules.
88
+
89
+ Before the solution is mature enough to implement, stay in planning and clarification mode. Deeply elicit and expand the user's intent into a concrete solution map: goals, non-goals, constraints, options, tradeoffs, risks, dependencies, acceptance criteria, verification path, and rollout or rollback notes. Record durable clarification results, open questions, assumptions, and decisions in plan-tree files when useful.
90
+
91
+ Do not start formal implementation in the main project surface while the plan still contains unresolved core ambiguity. At most, create a small isolated prototype or sample only when it helps validate the direction, and keep it clearly separate from the production path.
92
+
93
+ A plan is implementation-ready only when the scope, chosen approach, expected behavior, affected surfaces, acceptance criteria, verification method, and remaining risks are explicit enough that execution should not rely on "figure it out while coding." Once implementation-ready, proceed autonomously with the project changes, then update plan-tree status, decisions, open questions, and handoff notes to reflect the result.
94
+
95
+ `plan-tree` governs planning documents and execution readiness. It does not by itself authorize commits, pushes, releases, destructive file operations, or broad unrelated refactors unless the user explicitly asks for them.
96
+ ```
97
+
98
+ ## 安装
99
+
100
+ 先从 PyPI 或 npm 安装轻量 installer,再用 installer 安装 skill:
101
+
102
+ ```bash
103
+ python -m pip install seemseam-plan-tree
104
+ plan-tree install --provider claude
105
+ ```
106
+
107
+ ```bash
108
+ npm install -g plan-tree
109
+ plan-tree install --provider opencode
110
+ ```
111
+
112
+ 支持的 provider:
113
+
114
+ ```bash
115
+ plan-tree install --provider claude
116
+ plan-tree install --provider opencode
117
+ plan-tree install --provider codex
118
+ plan-tree install --provider all
119
+ ```
120
+
121
+ installer 只复制 skill payload:`SKILL.md`、`VERSION`、README 文件、`references/`、`assets/`,以及安装到 Codex 时需要的 Codex/OpenAI metadata。它不会安装 `.ccb/`、git 状态、日志、生成物或项目运行态文件。
122
+
123
+ 本地开发或离线安装时,可以显式指定当前仓库:
124
+
125
+ ```bash
126
+ plan-tree install --provider claude --source /path/to/plan-tree
127
+ ```
128
+
129
+ 也可以直接把仓库克隆到你的 skill 目录:
130
+
131
+ ```bash
132
+ mkdir -p "$SKILLS_HOME"
133
+ git clone https://github.com/SeemSeam/plan-tree.git "$SKILLS_HOME/plan-tree"
134
+ ```
135
+
136
+ 将 `SKILLS_HOME` 设置为你的 provider 使用的 skill 根目录。也可以直接克隆到明确路径:
137
+
138
+ ```bash
139
+ git clone https://github.com/SeemSeam/plan-tree.git /path/to/skills/plan-tree
140
+ ```
141
+
142
+ ## 仓库内容
143
+
144
+ ```text
145
+ VERSION
146
+ SKILL.md
147
+ pyproject.toml
148
+ package.json
149
+ bin/plan-tree.js
150
+ agents/openai.yaml
151
+ references/maintenance-patterns.md
152
+ references/legacy-migration.md
153
+ assets/plan-tree.jpg
154
+ README.md
155
+ README.zh-CN.md
156
+ ```
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.1
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const os = require("os");
5
+ const path = require("path");
6
+ const { spawnSync } = require("child_process");
7
+
8
+ const PACKAGE_VERSION = "0.2.1";
9
+ const REPO_URL = "https://github.com/SeemSeam/plan-tree.git";
10
+ const SKILL_NAME = "plan-tree";
11
+
12
+ const CORE_FILES = ["SKILL.md", "VERSION", "README.md", "README.zh-CN.md"];
13
+ const CORE_DIRS = ["references", "assets"];
14
+
15
+ const PROVIDER_TARGETS = {
16
+ claude: () => path.join(os.homedir(), ".claude", "skills", SKILL_NAME),
17
+ opencode: () => path.join(os.homedir(), ".config", "opencode", "skill", SKILL_NAME),
18
+ codex: () => path.join(process.env.CODEX_HOME || path.join(os.homedir(), ".codex"), "skills", SKILL_NAME)
19
+ };
20
+
21
+ function main(argv) {
22
+ const [command, ...rest] = argv;
23
+ if (command === "version") {
24
+ console.log(PACKAGE_VERSION);
25
+ return 0;
26
+ }
27
+ if (command === "install") {
28
+ return install(parseInstallArgs(rest));
29
+ }
30
+ usage();
31
+ return 2;
32
+ }
33
+
34
+ function usage() {
35
+ console.log("Use `plan-tree install --provider claude|opencode|codex`.");
36
+ }
37
+
38
+ function parseInstallArgs(args) {
39
+ const options = {
40
+ provider: "claude",
41
+ target: null,
42
+ source: null,
43
+ version: PACKAGE_VERSION,
44
+ force: false,
45
+ dryRun: false
46
+ };
47
+
48
+ for (let i = 0; i < args.length; i += 1) {
49
+ const arg = args[i];
50
+ if (arg === "--provider") options.provider = requireValue(args, ++i, arg);
51
+ else if (arg === "--target") options.target = requireValue(args, ++i, arg);
52
+ else if (arg === "--source") options.source = requireValue(args, ++i, arg);
53
+ else if (arg === "--version") options.version = requireValue(args, ++i, arg);
54
+ else if (arg === "--force") options.force = true;
55
+ else if (arg === "--dry-run") options.dryRun = true;
56
+ else if (arg === "--help" || arg === "-h") {
57
+ usage();
58
+ process.exit(0);
59
+ } else {
60
+ throw new Error(`Unknown argument: ${arg}`);
61
+ }
62
+ }
63
+
64
+ const allowed = [...Object.keys(PROVIDER_TARGETS), "all"];
65
+ if (!allowed.includes(options.provider)) {
66
+ throw new Error(`--provider must be one of: ${allowed.join(", ")}`);
67
+ }
68
+ if (options.target && options.provider === "all") {
69
+ throw new Error("--target cannot be combined with --provider all");
70
+ }
71
+ return options;
72
+ }
73
+
74
+ function requireValue(args, index, flag) {
75
+ const value = args[index];
76
+ if (!value || value.startsWith("--")) {
77
+ throw new Error(`${flag} requires a value`);
78
+ }
79
+ return value;
80
+ }
81
+
82
+ function install(options) {
83
+ const providers = options.provider === "all" ? Object.keys(PROVIDER_TARGETS) : [options.provider];
84
+ const source = options.source ? path.resolve(options.source) : cloneSource(options.version);
85
+
86
+ validateSource(source);
87
+ for (const provider of providers) {
88
+ const target = path.resolve(expandHome(options.target || PROVIDER_TARGETS[provider]()));
89
+ installToProvider(source, target, provider, options.force, options.dryRun);
90
+ }
91
+ return 0;
92
+ }
93
+
94
+ function cloneSource(version) {
95
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "plan-tree-"));
96
+ const target = path.join(tmp, "source");
97
+ const result = spawnSync("git", ["clone", "--depth=1", "--branch", `v${version}`, REPO_URL, target], {
98
+ stdio: "inherit"
99
+ });
100
+ if (result.status !== 0) {
101
+ throw new Error("Failed to clone plan-tree. Install git or use --source /path/to/plan-tree.");
102
+ }
103
+ return target;
104
+ }
105
+
106
+ function validateSource(source) {
107
+ const missing = [];
108
+ for (const item of CORE_FILES) {
109
+ if (!fs.existsSync(path.join(source, item))) missing.push(item);
110
+ }
111
+ for (const item of CORE_DIRS) {
112
+ if (!fs.existsSync(path.join(source, item))) missing.push(item);
113
+ }
114
+ if (missing.length > 0) {
115
+ throw new Error(`${source} is not a valid plan-tree source; missing: ${missing.join(", ")}`);
116
+ }
117
+ }
118
+
119
+ function installToProvider(source, target, provider, force, dryRun) {
120
+ const planned = [...CORE_FILES, ...CORE_DIRS];
121
+ if (provider === "codex" && fs.existsSync(path.join(source, "agents"))) {
122
+ planned.push("agents");
123
+ }
124
+
125
+ console.log(`Installing plan-tree for ${provider} -> ${target}`);
126
+ if (dryRun) {
127
+ for (const item of planned) console.log(` would copy ${item}`);
128
+ return;
129
+ }
130
+
131
+ if (fs.existsSync(target)) {
132
+ if (!force) throw new Error(`${target} already exists. Use --force to replace it.`);
133
+ fs.rmSync(target, { recursive: true, force: true });
134
+ }
135
+ fs.mkdirSync(target, { recursive: true });
136
+
137
+ for (const item of planned) {
138
+ copyPath(path.join(source, item), path.join(target, item));
139
+ }
140
+
141
+ console.log(`Installed plan-tree ${readVersion(target)}`);
142
+ }
143
+
144
+ function copyPath(source, target) {
145
+ const stat = fs.statSync(source);
146
+ if (stat.isDirectory()) {
147
+ fs.cpSync(source, target, { recursive: true });
148
+ } else {
149
+ fs.copyFileSync(source, target);
150
+ }
151
+ }
152
+
153
+ function readVersion(target) {
154
+ const versionPath = path.join(target, "VERSION");
155
+ if (fs.existsSync(versionPath)) {
156
+ return `v${fs.readFileSync(versionPath, "utf8").trim()}`;
157
+ }
158
+ return "unknown version";
159
+ }
160
+
161
+ function expandHome(value) {
162
+ if (value === "~") return os.homedir();
163
+ if (value.startsWith("~/")) return path.join(os.homedir(), value.slice(2));
164
+ return value;
165
+ }
166
+
167
+ try {
168
+ process.exitCode = main(process.argv.slice(2));
169
+ } catch (error) {
170
+ console.error(error.message);
171
+ process.exitCode = 1;
172
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "plan-tree",
3
+ "version": "0.2.1",
4
+ "description": "Installer for the portable plan-tree AI planning skill.",
5
+ "homepage": "https://github.com/SeemSeam/plan-tree",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/SeemSeam/plan-tree.git"
9
+ },
10
+ "keywords": [
11
+ "ai",
12
+ "agents",
13
+ "skills",
14
+ "planning",
15
+ "plan-tree"
16
+ ],
17
+ "bin": {
18
+ "plan-tree": "bin/plan-tree.js"
19
+ },
20
+ "files": [
21
+ "bin/plan-tree.js",
22
+ "README.md",
23
+ "README.zh-CN.md",
24
+ "VERSION"
25
+ ],
26
+ "engines": {
27
+ "node": ">=18"
28
+ },
29
+ "license": "UNLICENSED"
30
+ }