@theglitchking/persistent-planning 1.0.1 → 3.0.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.
- package/.claude-plugin/marketplace.json +45 -0
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +132 -0
- package/LICENSE +0 -0
- package/README.md +46 -35
- package/bin/persistent-planning.js +57 -232
- package/commands/policy.md +16 -0
- package/commands/relink.md +6 -0
- package/commands/start-atom.md +93 -0
- package/commands/start-planning.md +115 -0
- package/commands/start-task.md +83 -0
- package/commands/status.md +6 -0
- package/commands/update.md +6 -0
- package/docs/atom-granularity.md +156 -0
- package/docs/examples.md +0 -0
- package/docs/lg-mode.md +135 -0
- package/docs/reference.md +0 -0
- package/docs/workspace-json.md +85 -0
- package/hooks/hooks.json +15 -0
- package/hooks/session-start.js +13 -0
- package/package.json +17 -11
- package/scripts/link-skills.js +23 -0
- package/skills/{SKILL.md → persistent-planning/SKILL.md} +0 -0
- package/.claude/commands/start-planning.md +0 -65
- package/.claude/settings.local.json +0 -13
- package/postinstall.js +0 -34
- package/scripts/init-planning.sh +0 -233
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "persistent-planning-marketplace",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "TheGlitchKing",
|
|
5
|
+
"email": "theglitchking@users.noreply.github.com"
|
|
6
|
+
},
|
|
7
|
+
"metadata": {
|
|
8
|
+
"description": "Official marketplace for persistent-planning - Persistent markdown-based planning for Claude Code. Context engineering pattern with task directories, progress tracking, and working memory that persists across sessions.",
|
|
9
|
+
"version": "3.0.0"
|
|
10
|
+
},
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"name": "persistent-planning",
|
|
14
|
+
"description": "Persistent markdown-based planning for Claude Code. Uses on-disk markdown files as working memory for planning, progress tracking, and knowledge storage. Plans persist across sessions and support multiple concurrent tasks.",
|
|
15
|
+
"version": "3.0.0",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "TheGlitchKing"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/TheGlitchKing/persistent-planning",
|
|
20
|
+
"repository": "https://github.com/TheGlitchKing/persistent-planning.git",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"planning",
|
|
24
|
+
"persistent",
|
|
25
|
+
"markdown",
|
|
26
|
+
"context-engineering",
|
|
27
|
+
"task-tracking",
|
|
28
|
+
"working-memory",
|
|
29
|
+
"goal-tracking",
|
|
30
|
+
"claude-code"
|
|
31
|
+
],
|
|
32
|
+
"category": "productivity",
|
|
33
|
+
"tags": [
|
|
34
|
+
"planning",
|
|
35
|
+
"context-engineering",
|
|
36
|
+
"working-memory"
|
|
37
|
+
],
|
|
38
|
+
"source": {
|
|
39
|
+
"source": "npm",
|
|
40
|
+
"package": "@theglitchking/persistent-planning"
|
|
41
|
+
},
|
|
42
|
+
"strict": true
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "persistent-planning",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Persistent markdown-based planning with task directories, progress tracking, and context engineering for multi-step Claude Code workflows",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TheGlitchKing"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,138 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.0.0] - 2026-05-07
|
|
6
|
+
|
|
7
|
+
### Added — Lg-mode (large/team) layered planning
|
|
8
|
+
|
|
9
|
+
v3.0 introduces a new **layered planning mode** alongside the existing single-task flow. The mode is auto-detected (90-day git-author-count heuristic; ≥2 distinct authors → lg) and is sticky once chosen.
|
|
10
|
+
|
|
11
|
+
**Four layers** in lg mode:
|
|
12
|
+
|
|
13
|
+
- **Phase** — strategic grouping of related tasks (top)
|
|
14
|
+
- **Task** — bounded deliverable; declares `depends_on` + `parallelizable` for subagent team scheduling
|
|
15
|
+
- **Atom** — subagent hand-off unit; sequential within a task; status: `ready | in_progress | done | blocked` with reopen support
|
|
16
|
+
- **Notes** — cross-cutting references scoped to a phase or task
|
|
17
|
+
|
|
18
|
+
All four layers carry HEWTD-aligned frontmatter (`tier: plan`). `version` is intentionally omitted — HEWTD 2.2.0+ makes it conditionally optional for plan-tier docs.
|
|
19
|
+
|
|
20
|
+
### Added — `/start-task` and `/start-atom` slash commands
|
|
21
|
+
|
|
22
|
+
- `/start-task "<name>" --parent <phase>` — adds a task under an existing phase (lg only)
|
|
23
|
+
- `/start-atom "<name>" --parent <task>` — adds an atom (subagent hand-off unit) under a task (lg only); auto-resolves the parent phase by walking `.planning/`; auto-assigns sequence number
|
|
24
|
+
- `/start-planning` updated to dispatch sm vs lg based on detect-mode.sh; accepts `--mode sm|lg` for explicit override
|
|
25
|
+
|
|
26
|
+
### Added — `.planning/.meta/workspace.json`
|
|
27
|
+
|
|
28
|
+
Per-project mode tracker. Fields: `schema_version`, `mode`, `auto_detected`, `detected_contributors`, `created_at`. Bootstrapped on first lg-mode init. See `docs/workspace-json.md` for the full schema.
|
|
29
|
+
|
|
30
|
+
### Added — Documentation
|
|
31
|
+
|
|
32
|
+
- `docs/lg-mode.md` — full lg-mode guide
|
|
33
|
+
- `docs/atom-granularity.md` — anti-pattern guide for inline-checkbox-vs-standalone-atom
|
|
34
|
+
- `docs/workspace-json.md` — workspace.json schema reference
|
|
35
|
+
|
|
36
|
+
### Added — Scripts
|
|
37
|
+
|
|
38
|
+
- `scripts/detect-mode.sh` — sm/lg resolution
|
|
39
|
+
- `scripts/lib/planning.sh` — shared bash helpers
|
|
40
|
+
- `scripts/init-phase.sh`, `scripts/init-task.sh`, `scripts/init-atom.sh` — lg-mode init scripts
|
|
41
|
+
|
|
42
|
+
### Added — Templates
|
|
43
|
+
|
|
44
|
+
- `templates/lg/{phase,task,atom,notes}.md` — HEWTD-frontmattered layer templates
|
|
45
|
+
|
|
46
|
+
### Subagent contract (requires semantic-memory 1.0)
|
|
47
|
+
|
|
48
|
+
Lg-mode plans are designed to be read by subagents via semantic-memory's MCP verbs (registered conditionally on the `plans` corpus). When semantic-memory is absent, persistent-planning falls back to filesystem-based reads — slash commands still work; subagent comprehension degrades.
|
|
49
|
+
|
|
50
|
+
### Backwards compatibility
|
|
51
|
+
|
|
52
|
+
- **Sm mode preserved exactly**: existing `.planning/<task-slug>/{task_plan.md, notes.md}` directories continue to work without changes. The original `/start-planning "Task name"` flow is identical to v2.
|
|
53
|
+
- **Auto-detection is non-disruptive**: existing v2 plans aren't migrated. New `/start-planning` invocations auto-detect mode and create new artifacts using the resolved mode.
|
|
54
|
+
|
|
55
|
+
### Optional dependencies
|
|
56
|
+
|
|
57
|
+
- `@theglitchking/hit-em-with-the-docs ^2.2.0` — required for `hewtd validate` to accept lg-mode plan frontmatter (introduces `tier: "plan"` + conditional `version`)
|
|
58
|
+
- `@theglitchking/semantic-memory ^1.0.0` (formerly `semantic-sidekick`) — required for the planning MCP verbs that subagents use to read/mutate lg-mode plans
|
|
59
|
+
|
|
60
|
+
When neither is installed, lg mode still works as a pure file-authoring flow.
|
|
61
|
+
|
|
62
|
+
## [2.0.0] - 2026-04-18
|
|
63
|
+
|
|
64
|
+
### ⚠️ Breaking changes
|
|
65
|
+
|
|
66
|
+
v2.0.0 removes the hand-rolled `persistent-planning install|uninstall`
|
|
67
|
+
flow in favor of standard Claude Code plugin distribution and npm install
|
|
68
|
+
paths. Plugin skill and command files are now delivered **automatically**
|
|
69
|
+
— no manual copy step.
|
|
70
|
+
|
|
71
|
+
**If you're an existing v1 user**, here's what to expect and how to
|
|
72
|
+
upgrade:
|
|
73
|
+
|
|
74
|
+
- `persistent-planning install --scope user` is gone. Install instead via
|
|
75
|
+
the plugin marketplace:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/plugin marketplace add TheGlitchKing/persistent-planning
|
|
79
|
+
/plugin install persistent-planning@persistent-planning-marketplace
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or, for a project-local install that's visible to teammates and CI:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
npm install --save-dev @theglitchking/persistent-planning
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- `persistent-planning uninstall` is gone. Use `/plugin uninstall` or
|
|
89
|
+
`npm uninstall @theglitchking/persistent-planning` depending on how you
|
|
90
|
+
installed it.
|
|
91
|
+
|
|
92
|
+
- **Old skill/command files in `~/.claude/` or `./.claude/`** placed by
|
|
93
|
+
v1's installer will keep working until you remove them — but the
|
|
94
|
+
marketplace plugin and the npm postinstall both place their own copies,
|
|
95
|
+
so to avoid duplication you should delete the manually-installed
|
|
96
|
+
copies once you've adopted v2:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
# If you installed with --scope user:
|
|
100
|
+
rm -rf ~/.claude/skills/persistent-planning
|
|
101
|
+
rm ~/.claude/commands/start-planning.md
|
|
102
|
+
|
|
103
|
+
# If you installed with --scope project:
|
|
104
|
+
rm -rf .claude/skills/persistent-planning
|
|
105
|
+
rm .claude/commands/start-planning.md
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- The old `install`/`uninstall` subcommands still exist as deprecation
|
|
109
|
+
shims — running them prints a migration pointer and exits cleanly
|
|
110
|
+
instead of failing.
|
|
111
|
+
|
|
112
|
+
### Added
|
|
113
|
+
- Adopts `@theglitchking/claude-plugin-runtime` for postinstall skill
|
|
114
|
+
symlinking, SessionStart update nudge/auto-apply, and standardized
|
|
115
|
+
`update`/`policy`/`status`/`relink` CLI subcommands.
|
|
116
|
+
- Default `updatePolicy: "nudge"` — on session start, the plugin checks
|
|
117
|
+
npm for a newer version and prints a one-liner when one exists. Opt
|
|
118
|
+
into `auto` for background auto-update, or `off` to silence entirely.
|
|
119
|
+
- Four new slash commands: `/persistent-planning:update`,
|
|
120
|
+
`/persistent-planning:policy`, `/persistent-planning:status`,
|
|
121
|
+
`/persistent-planning:relink`.
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
- **Skill layout**: `skills/SKILL.md` moved to
|
|
125
|
+
`skills/persistent-planning/SKILL.md` so the runtime can symlink it
|
|
126
|
+
into consuming projects' `.claude/skills/persistent-planning/`.
|
|
127
|
+
- **Slash command location**: `.claude/commands/start-planning.md` moved
|
|
128
|
+
to `commands/start-planning.md` (top-level, matching the marketplace
|
|
129
|
+
plugin convention).
|
|
130
|
+
- Node >= 20 required (was >= 16).
|
|
131
|
+
|
|
132
|
+
### Removed
|
|
133
|
+
- `install.sh`, `uninstall.sh`, and the `postinstall.js` banner script.
|
|
134
|
+
- The root-level `plugin.json` — manifest is now only at
|
|
135
|
+
`.claude-plugin/plugin.json`.
|
|
136
|
+
|
|
5
137
|
## [1.0.0] - 2026-02-12
|
|
6
138
|
|
|
7
139
|
### Added
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -43,43 +43,48 @@ For every complex task, create three files:
|
|
|
43
43
|
|
|
44
44
|
## Installation
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
> **v1 → v2 breaking change**: the hand-rolled `persistent-planning install --scope ...` flow was removed. Skills and slash commands are now placed automatically — either by the Claude Code plugin marketplace, or by npm's postinstall symlinking. See [CHANGELOG.md](./CHANGELOG.md) for the full migration guide.
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
# Install globally
|
|
50
|
-
npm install -g @theglitchking/persistent-planning
|
|
51
|
-
persistent-planning install --scope user
|
|
48
|
+
### Option A: Claude Code Plugin Marketplace (Recommended)
|
|
52
49
|
|
|
53
|
-
# Or via npx (no global install)
|
|
54
|
-
npx @theglitchking/persistent-planning install --scope user
|
|
55
50
|
```
|
|
51
|
+
/plugin marketplace add TheGlitchKing/persistent-planning
|
|
52
|
+
/plugin install persistent-planning@persistent-planning-marketplace
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Option B: Project-level npm install
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Pins the exact version in `package.json`, visible to teammates, CI, and LLMs reading the repo. Postinstall symlinks `skills/persistent-planning/` into `<project>/.claude/skills/`, writes a default `.claude/persistent-planning.json` (update policy `nudge`), and registers a SessionStart hook in `.claude/settings.json` if one is present. Dedup: if the plugin marketplace version is already enabled in `~/.claude/settings.json`, the npm hook registration is skipped.
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
|
|
61
|
-
cd persistent-planning
|
|
62
|
-
./install.sh --scope user # Available in all projects
|
|
63
|
-
# OR
|
|
64
|
-
./install.sh --scope project # Current project only
|
|
60
|
+
npm install --save-dev @theglitchking/persistent-planning
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
### Option
|
|
63
|
+
### Option C: Try it (no install)
|
|
68
64
|
|
|
69
|
-
```
|
|
70
|
-
|
|
65
|
+
```bash
|
|
66
|
+
npx @theglitchking/persistent-planning status
|
|
71
67
|
```
|
|
72
68
|
|
|
73
|
-
|
|
69
|
+
## Update management
|
|
70
|
+
|
|
71
|
+
Each install ships with an update policy. By default the plugin checks npm at session start and prints a one-liner when a newer version is available — no changes made. Opt into automatic updates or silence the check entirely:
|
|
74
72
|
|
|
75
73
|
```bash
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
# Slash commands
|
|
75
|
+
/persistent-planning:policy auto # auto-update on session start
|
|
76
|
+
/persistent-planning:policy nudge # one-liner nudge only (default)
|
|
77
|
+
/persistent-planning:policy off # silent
|
|
78
|
+
|
|
79
|
+
# CLI equivalents
|
|
80
|
+
npx --no @theglitchking/persistent-planning policy auto
|
|
81
|
+
npx --no @theglitchking/persistent-planning status # installed, latest, policy, hook state
|
|
82
|
+
npx --no @theglitchking/persistent-planning update # runs npm update + relinks skills
|
|
83
|
+
npx --no @theglitchking/persistent-planning relink # re-symlink skills only
|
|
81
84
|
```
|
|
82
85
|
|
|
86
|
+
Policy resolution order: `PERSISTENT_PLANNING_UPDATE_POLICY` env var → `<project>/.claude/persistent-planning.json` → default `nudge`.
|
|
87
|
+
|
|
83
88
|
## Usage
|
|
84
89
|
|
|
85
90
|
### Quick Start
|
|
@@ -151,23 +156,29 @@ Each task gets its own directory. No conflicts, no overwrites.
|
|
|
151
156
|
```
|
|
152
157
|
persistent-planning/
|
|
153
158
|
├── .claude-plugin/
|
|
154
|
-
│ └── plugin.json # Plugin manifest
|
|
155
|
-
├──
|
|
156
|
-
│ └──
|
|
157
|
-
|
|
158
|
-
├──
|
|
159
|
-
│
|
|
159
|
+
│ └── plugin.json # Plugin manifest (marketplace loader)
|
|
160
|
+
├── bin/
|
|
161
|
+
│ └── persistent-planning.js # CLI (update/policy/status/relink)
|
|
162
|
+
├── commands/
|
|
163
|
+
│ ├── start-planning.md # /start-planning slash command
|
|
164
|
+
│ ├── update.md # /persistent-planning:update
|
|
165
|
+
│ ├── policy.md # /persistent-planning:policy
|
|
166
|
+
│ ├── status.md # /persistent-planning:status
|
|
167
|
+
│ └── relink.md # /persistent-planning:relink
|
|
168
|
+
├── hooks/
|
|
169
|
+
│ ├── hooks.json # SessionStart hook manifest
|
|
170
|
+
│ └── session-start.js # Runtime-delegated hook
|
|
160
171
|
├── scripts/
|
|
161
|
-
│ └──
|
|
172
|
+
│ └── link-skills.js # Postinstall (runtime-delegated)
|
|
173
|
+
├── skills/
|
|
174
|
+
│ └── persistent-planning/
|
|
175
|
+
│ └── SKILL.md # Core skill definition
|
|
162
176
|
├── docs/
|
|
163
177
|
│ ├── reference.md # Manus context engineering principles
|
|
164
178
|
│ └── examples.md # Worked examples
|
|
165
|
-
├──
|
|
166
|
-
├──
|
|
167
|
-
|
|
168
|
-
├── README.md # This file
|
|
169
|
-
├── LICENSE # MIT license
|
|
170
|
-
└── CHANGELOG.md # Version history
|
|
179
|
+
├── README.md
|
|
180
|
+
├── LICENSE
|
|
181
|
+
└── CHANGELOG.md
|
|
171
182
|
```
|
|
172
183
|
|
|
173
184
|
## Cleanup
|
|
@@ -1,241 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${colors.green}Usage:${colors.reset}
|
|
22
|
-
persistent-planning install [--scope user|project]
|
|
23
|
-
persistent-planning uninstall [--scope user|project]
|
|
24
|
-
persistent-planning status
|
|
25
|
-
persistent-planning help
|
|
26
|
-
|
|
27
|
-
${colors.green}Commands:${colors.reset}
|
|
28
|
-
install Install persistent-planning skill and /start-planning command
|
|
29
|
-
uninstall Remove persistent-planning from Claude Code
|
|
30
|
-
status Show installation status
|
|
31
|
-
help Show this help message
|
|
32
|
-
|
|
33
|
-
${colors.green}Install Options:${colors.reset}
|
|
34
|
-
--scope {user|project} Install scope (default: user)
|
|
35
|
-
user - Install globally (~/.claude/)
|
|
36
|
-
project - Install in current project (.claude/)
|
|
37
|
-
|
|
38
|
-
${colors.green}Examples:${colors.reset}
|
|
39
|
-
persistent-planning install --scope user
|
|
40
|
-
persistent-planning install --scope project
|
|
41
|
-
persistent-planning uninstall --scope user
|
|
42
|
-
persistent-planning status
|
|
43
|
-
|
|
44
|
-
${colors.green}After Installation:${colors.reset}
|
|
45
|
-
Run this command in Claude Code:
|
|
46
|
-
/start-planning "Your task name"
|
|
47
|
-
`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function copyRecursive(src, dest) {
|
|
51
|
-
const stats = fs.statSync(src);
|
|
52
|
-
if (stats.isDirectory()) {
|
|
53
|
-
if (!fs.existsSync(dest)) {
|
|
54
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
55
|
-
}
|
|
56
|
-
fs.readdirSync(src).forEach(file => {
|
|
57
|
-
copyRecursive(path.join(src, file), path.join(dest, file));
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
fs.copyFileSync(src, dest);
|
|
3
|
+
import { program } from "commander";
|
|
4
|
+
import { registerUpdateCommands } from "@theglitchking/claude-plugin-runtime";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { join, resolve } from "node:path";
|
|
9
|
+
|
|
10
|
+
const require_ = createRequire(import.meta.url);
|
|
11
|
+
const { version } = require_("../package.json");
|
|
12
|
+
|
|
13
|
+
const PKG = "@theglitchking/persistent-planning";
|
|
14
|
+
|
|
15
|
+
function runRelink(cwd) {
|
|
16
|
+
const linker = join(cwd, "node_modules", "@theglitchking", "persistent-planning", "scripts", "link-skills.js");
|
|
17
|
+
const script = existsSync(linker) ? linker : resolve(process.cwd(), "scripts", "link-skills.js");
|
|
18
|
+
if (!existsSync(script)) {
|
|
19
|
+
console.error("link-skills.js not found — is the package installed?");
|
|
20
|
+
return;
|
|
61
21
|
}
|
|
22
|
+
spawnSync(process.execPath, [script], {
|
|
23
|
+
cwd,
|
|
24
|
+
env: { ...process.env, INIT_CWD: cwd },
|
|
25
|
+
stdio: "inherit",
|
|
26
|
+
});
|
|
62
27
|
}
|
|
63
28
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
29
|
+
program
|
|
30
|
+
.name("persistent-planning")
|
|
31
|
+
.description("Persistent markdown-based planning for Claude Code.")
|
|
32
|
+
.version(version);
|
|
33
|
+
|
|
34
|
+
registerUpdateCommands(program, {
|
|
35
|
+
packageName: PKG,
|
|
36
|
+
pluginName: "persistent-planning",
|
|
37
|
+
configFile: "persistent-planning.json",
|
|
38
|
+
onAfterUpdate: (cwd) => runRelink(cwd),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Deprecated subcommands from v1. Accept them so existing automation
|
|
42
|
+
// doesn't silently break — print a migration pointer and exit 0.
|
|
43
|
+
function deprecationNotice(name) {
|
|
44
|
+
console.error(`\n⚠️ 'persistent-planning ${name}' was removed in v2.0.0.\n`);
|
|
45
|
+
console.error(`The plugin now installs via the Claude Code plugin marketplace:`);
|
|
46
|
+
console.error(` /plugin marketplace add TheGlitchKing/persistent-planning`);
|
|
47
|
+
console.error(` /plugin install persistent-planning@persistent-planning-marketplace\n`);
|
|
48
|
+
console.error(`Or, at the project level, via npm:`);
|
|
49
|
+
console.error(` npm install --save-dev @theglitchking/persistent-planning\n`);
|
|
50
|
+
console.error(`See the v2.0.0 CHANGELOG for migration details:`);
|
|
51
|
+
console.error(` https://github.com/TheGlitchKing/persistent-planning/blob/main/CHANGELOG.md\n`);
|
|
68
52
|
}
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
skill: fs.existsSync(skillPath),
|
|
76
|
-
command: fs.existsSync(commandPath)
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function showStatus() {
|
|
81
|
-
console.log(`\n${colors.blue}persistent-planning Installation Status${colors.reset}\n`);
|
|
82
|
-
|
|
83
|
-
const userInstall = checkInstallation('user');
|
|
84
|
-
const projectInstall = checkInstallation('project');
|
|
85
|
-
|
|
86
|
-
console.log(`User Scope (~/.claude/):`);
|
|
87
|
-
console.log(` Skill: ${userInstall.skill ? colors.green + 'Installed' : colors.yellow + 'Not installed'}${colors.reset}`);
|
|
88
|
-
console.log(` Command: ${userInstall.command ? colors.green + 'Installed' : colors.yellow + 'Not installed'}${colors.reset}`);
|
|
89
|
-
|
|
90
|
-
console.log(`\nProject Scope (./.claude/):`);
|
|
91
|
-
console.log(` Skill: ${projectInstall.skill ? colors.green + 'Installed' : colors.yellow + 'Not installed'}${colors.reset}`);
|
|
92
|
-
console.log(` Command: ${projectInstall.command ? colors.green + 'Installed' : colors.yellow + 'Not installed'}${colors.reset}`);
|
|
93
|
-
|
|
94
|
-
if (!userInstall.skill && !projectInstall.skill) {
|
|
95
|
-
console.log(`\n${colors.yellow}Run: persistent-planning install${colors.reset}`);
|
|
96
|
-
}
|
|
97
|
-
console.log();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function runInstall(args) {
|
|
101
|
-
const scope = args.includes('--scope') ? args[args.indexOf('--scope') + 1] : 'user';
|
|
102
|
-
const installDir = getInstallDir(scope);
|
|
103
|
-
|
|
104
|
-
console.log(`${colors.blue}Installing persistent-planning...${colors.reset}`);
|
|
105
|
-
console.log(` Scope: ${scope} (${installDir})\n`);
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
// Create directories
|
|
109
|
-
const skillDir = path.join(installDir, 'skills', 'persistent-planning');
|
|
110
|
-
const scriptsDir = path.join(skillDir, 'scripts');
|
|
111
|
-
const docsDir = path.join(skillDir, 'docs');
|
|
112
|
-
const commandsDir = path.join(installDir, 'commands');
|
|
54
|
+
program
|
|
55
|
+
.command("install")
|
|
56
|
+
.description("[removed in v2.0.0] use the Claude Code plugin marketplace or npm")
|
|
57
|
+
.option("--scope <scope>")
|
|
58
|
+
.action(() => { deprecationNotice("install"); process.exit(0); });
|
|
113
59
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
60
|
+
program
|
|
61
|
+
.command("uninstall")
|
|
62
|
+
.description("[removed in v2.0.0] use /plugin uninstall or npm uninstall")
|
|
63
|
+
.option("--scope <scope>")
|
|
64
|
+
.action(() => { deprecationNotice("uninstall"); process.exit(0); });
|
|
117
65
|
|
|
118
|
-
|
|
119
|
-
fs.copyFileSync(
|
|
120
|
-
path.join(PLUGIN_ROOT, 'skills', 'SKILL.md'),
|
|
121
|
-
path.join(skillDir, 'SKILL.md')
|
|
122
|
-
);
|
|
123
|
-
console.log(`${colors.green}+${colors.reset} Installed SKILL.md`);
|
|
124
|
-
|
|
125
|
-
// Copy init script
|
|
126
|
-
const initScript = path.join(scriptsDir, 'init-planning.sh');
|
|
127
|
-
fs.copyFileSync(
|
|
128
|
-
path.join(PLUGIN_ROOT, 'scripts', 'init-planning.sh'),
|
|
129
|
-
initScript
|
|
130
|
-
);
|
|
131
|
-
fs.chmodSync(initScript, 0o755);
|
|
132
|
-
console.log(`${colors.green}+${colors.reset} Installed init-planning.sh`);
|
|
133
|
-
|
|
134
|
-
// Copy docs
|
|
135
|
-
fs.copyFileSync(
|
|
136
|
-
path.join(PLUGIN_ROOT, 'docs', 'reference.md'),
|
|
137
|
-
path.join(docsDir, 'reference.md')
|
|
138
|
-
);
|
|
139
|
-
fs.copyFileSync(
|
|
140
|
-
path.join(PLUGIN_ROOT, 'docs', 'examples.md'),
|
|
141
|
-
path.join(docsDir, 'examples.md')
|
|
142
|
-
);
|
|
143
|
-
console.log(`${colors.green}+${colors.reset} Installed reference docs`);
|
|
144
|
-
|
|
145
|
-
// Copy command
|
|
146
|
-
fs.copyFileSync(
|
|
147
|
-
path.join(PLUGIN_ROOT, '.claude', 'commands', 'start-planning.md'),
|
|
148
|
-
path.join(commandsDir, 'start-planning.md')
|
|
149
|
-
);
|
|
150
|
-
console.log(`${colors.green}+${colors.reset} Installed /start-planning command`);
|
|
151
|
-
|
|
152
|
-
// Update .gitignore if project scope
|
|
153
|
-
if (scope === 'project') {
|
|
154
|
-
const gitignorePath = '.gitignore';
|
|
155
|
-
if (fs.existsSync(gitignorePath)) {
|
|
156
|
-
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
157
|
-
if (!content.includes('.claude/')) {
|
|
158
|
-
fs.appendFileSync(gitignorePath, '\n.claude/\n');
|
|
159
|
-
console.log(`${colors.green}+${colors.reset} Updated .gitignore`);
|
|
160
|
-
}
|
|
161
|
-
} else {
|
|
162
|
-
fs.writeFileSync(gitignorePath, '.claude/\n');
|
|
163
|
-
console.log(`${colors.green}+${colors.reset} Created .gitignore`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
console.log(`\n${colors.green}Installation Complete!${colors.reset}\n`);
|
|
168
|
-
console.log(`${colors.yellow}Usage:${colors.reset}`);
|
|
169
|
-
console.log(` In Claude Code, run: ${colors.cyan}/start-planning "Your task name"${colors.reset}\n`);
|
|
170
|
-
console.log(`${colors.yellow}Uninstall:${colors.reset}`);
|
|
171
|
-
console.log(` ${colors.cyan}persistent-planning uninstall --scope ${scope}${colors.reset}\n`);
|
|
172
|
-
|
|
173
|
-
} catch (error) {
|
|
174
|
-
console.error(`${colors.red}Installation failed: ${error.message}${colors.reset}`);
|
|
175
|
-
process.exit(1);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function runUninstall(args) {
|
|
180
|
-
const scope = args.includes('--scope') ? args[args.indexOf('--scope') + 1] : 'user';
|
|
181
|
-
const installDir = getInstallDir(scope);
|
|
182
|
-
|
|
183
|
-
console.log(`${colors.blue}Uninstalling persistent-planning...${colors.reset}`);
|
|
184
|
-
console.log(` Scope: ${scope} (${installDir})\n`);
|
|
185
|
-
|
|
186
|
-
let removed = 0;
|
|
187
|
-
|
|
188
|
-
try {
|
|
189
|
-
const skillDir = path.join(installDir, 'skills', 'persistent-planning');
|
|
190
|
-
if (fs.existsSync(skillDir)) {
|
|
191
|
-
fs.rmSync(skillDir, { recursive: true, force: true });
|
|
192
|
-
console.log(`${colors.green}+${colors.reset} Removed skill`);
|
|
193
|
-
removed++;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const commandFile = path.join(installDir, 'commands', 'start-planning.md');
|
|
197
|
-
if (fs.existsSync(commandFile)) {
|
|
198
|
-
fs.unlinkSync(commandFile);
|
|
199
|
-
console.log(`${colors.green}+${colors.reset} Removed /start-planning command`);
|
|
200
|
-
removed++;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (removed === 0) {
|
|
204
|
-
console.log(`${colors.yellow}Nothing to remove. persistent-planning not found in ${installDir}/${colors.reset}`);
|
|
205
|
-
} else {
|
|
206
|
-
console.log(`\n${colors.green}Uninstall complete.${colors.reset}`);
|
|
207
|
-
console.log(`\nNote: .planning/ directories in your projects are not removed.`);
|
|
208
|
-
console.log(`To clean those up: rm -rf .planning/\n`);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
} catch (error) {
|
|
212
|
-
console.error(`${colors.red}Uninstallation failed: ${error.message}${colors.reset}`);
|
|
213
|
-
process.exit(1);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Main
|
|
218
|
-
const args = process.argv.slice(2);
|
|
219
|
-
const command = args[0];
|
|
220
|
-
|
|
221
|
-
switch (command) {
|
|
222
|
-
case 'install':
|
|
223
|
-
runInstall(args.slice(1));
|
|
224
|
-
break;
|
|
225
|
-
case 'uninstall':
|
|
226
|
-
runUninstall(args.slice(1));
|
|
227
|
-
break;
|
|
228
|
-
case 'status':
|
|
229
|
-
showStatus();
|
|
230
|
-
break;
|
|
231
|
-
case 'help':
|
|
232
|
-
case '--help':
|
|
233
|
-
case '-h':
|
|
234
|
-
case undefined:
|
|
235
|
-
showHelp();
|
|
236
|
-
break;
|
|
237
|
-
default:
|
|
238
|
-
console.error(`${colors.red}Unknown command: ${command}${colors.reset}`);
|
|
239
|
-
console.log(`Run 'persistent-planning help' for usage information`);
|
|
240
|
-
process.exit(1);
|
|
241
|
-
}
|
|
66
|
+
program.parse();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Get or set the persistent-planning update policy (auto | nudge | off)
|
|
3
|
+
allowed-tools: Bash(npx:*)
|
|
4
|
+
argument-hint: "[auto|nudge|off]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Arguments: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
- If `$ARGUMENTS` is empty, run `npx --no @theglitchking/persistent-planning policy` and report the current policy and config path.
|
|
10
|
+
- If `$ARGUMENTS` is one of `auto`, `nudge`, `off`, run `npx --no @theglitchking/persistent-planning policy $ARGUMENTS` and confirm the new setting to the user.
|
|
11
|
+
- If `$ARGUMENTS` is anything else, tell the user the valid values are `auto`, `nudge`, `off`.
|
|
12
|
+
|
|
13
|
+
Policies:
|
|
14
|
+
- `auto` — auto-run `npm update @theglitchking/persistent-planning` at session start when a newer version is available.
|
|
15
|
+
- `nudge` — print a one-liner when a newer version is available (default).
|
|
16
|
+
- `off` — do not check for updates.
|