planmode 0.1.3 → 0.1.5
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 +72 -0
- package/dist/index.js +11 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/lib/analytics.ts +12 -0
- package/src/lib/installer.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# planmode
|
|
2
|
+
|
|
3
|
+
The open source package manager for AI plans, rules, and prompts.
|
|
4
|
+
|
|
5
|
+
**Website:** [planmode.org](https://planmode.org)
|
|
6
|
+
**Repository:** [github.com/kaihannonen/planmode.org](https://github.com/kaihannonen/planmode.org)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g planmode
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Search for packages
|
|
18
|
+
planmode search nextjs
|
|
19
|
+
|
|
20
|
+
# Install a plan (adds to plans/ and updates CLAUDE.md)
|
|
21
|
+
planmode install nextjs-tailwind-starter
|
|
22
|
+
|
|
23
|
+
# Install a rule (goes to .claude/rules/)
|
|
24
|
+
planmode install typescript-strict
|
|
25
|
+
|
|
26
|
+
# Run a templated prompt
|
|
27
|
+
planmode run rest-api-generator --resource users --framework express
|
|
28
|
+
|
|
29
|
+
# See what's installed
|
|
30
|
+
planmode list
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Package types
|
|
34
|
+
|
|
35
|
+
| Type | What it is | Where it lives | Lifecycle |
|
|
36
|
+
|------|-----------|---------------|-----------|
|
|
37
|
+
| **Plan** | Multi-step implementation guide | `plans/*.md` | Active during task |
|
|
38
|
+
| **Rule** | Always-on constraint | `.claude/rules/*.md` | Permanent |
|
|
39
|
+
| **Prompt** | Fire-once instruction | `prompts/*.md` | Single use |
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| `planmode install <pkg>` | Install a package |
|
|
46
|
+
| `planmode uninstall <pkg>` | Remove a package |
|
|
47
|
+
| `planmode search <query>` | Search the registry |
|
|
48
|
+
| `planmode run <prompt>` | Run a templated prompt |
|
|
49
|
+
| `planmode list` | List installed packages |
|
|
50
|
+
| `planmode info <pkg>` | Show package details |
|
|
51
|
+
| `planmode update [pkg]` | Update packages |
|
|
52
|
+
| `planmode init` | Create a new package |
|
|
53
|
+
| `planmode publish` | Publish to the registry |
|
|
54
|
+
| `planmode login` | Configure GitHub auth |
|
|
55
|
+
|
|
56
|
+
## How it works
|
|
57
|
+
|
|
58
|
+
Planmode leverages Claude Code's native `@import` system. When you install a plan:
|
|
59
|
+
|
|
60
|
+
1. The CLI fetches `.md` files from the registry
|
|
61
|
+
2. Drops them into the correct directory (`plans/`, `.claude/rules/`, or `prompts/`)
|
|
62
|
+
3. Adds `@plans/<name>.md` to your `CLAUDE.md`
|
|
63
|
+
|
|
64
|
+
Claude Code is already the runtime. Planmode handles discovery, versioning, and distribution.
|
|
65
|
+
|
|
66
|
+
## Browse packages
|
|
67
|
+
|
|
68
|
+
Visit [planmode.org/packages](https://planmode.org/packages) to discover plans, rules, and prompts.
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -616,6 +616,15 @@ var logger = {
|
|
|
616
616
|
}
|
|
617
617
|
};
|
|
618
618
|
|
|
619
|
+
// src/lib/analytics.ts
|
|
620
|
+
var API_BASE = "https://api.planmode.org";
|
|
621
|
+
function trackDownload(packageName) {
|
|
622
|
+
fetch(`${API_BASE}/downloads/${encodeURIComponent(packageName)}`, {
|
|
623
|
+
method: "POST"
|
|
624
|
+
}).catch(() => {
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
619
628
|
// src/lib/installer.ts
|
|
620
629
|
function getInstallDir(type) {
|
|
621
630
|
switch (type) {
|
|
@@ -689,6 +698,7 @@ async function installPackage(packageName, options = {}) {
|
|
|
689
698
|
fs7.mkdirSync(path7.dirname(fullPath), { recursive: true });
|
|
690
699
|
fs7.writeFileSync(fullPath, content, "utf-8");
|
|
691
700
|
logger.success(`Installed ${packageName}@${version} \u2192 ${installPath}`);
|
|
701
|
+
trackDownload(packageName);
|
|
692
702
|
if (type === "plan") {
|
|
693
703
|
addImport(packageName, projectDir);
|
|
694
704
|
logger.dim(`Added @import to CLAUDE.md`);
|
|
@@ -1294,7 +1304,7 @@ var loginCommand = new Command10("login").description("Configure GitHub authenti
|
|
|
1294
1304
|
|
|
1295
1305
|
// src/index.ts
|
|
1296
1306
|
var program = new Command11();
|
|
1297
|
-
program.name("planmode").description("The open source package manager for AI plans, rules, and prompts.").version("0.1.
|
|
1307
|
+
program.name("planmode").description("The open source package manager for AI plans, rules, and prompts.").version("0.1.5");
|
|
1298
1308
|
program.addCommand(installCommand);
|
|
1299
1309
|
program.addCommand(uninstallCommand);
|
|
1300
1310
|
program.addCommand(searchCommand);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command();
|
|
|
15
15
|
program
|
|
16
16
|
.name("planmode")
|
|
17
17
|
.description("The open source package manager for AI plans, rules, and prompts.")
|
|
18
|
-
.version("0.1.
|
|
18
|
+
.version("0.1.5");
|
|
19
19
|
|
|
20
20
|
program.addCommand(installCommand);
|
|
21
21
|
program.addCommand(uninstallCommand);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const API_BASE = "https://api.planmode.org";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fire-and-forget download tracking. Never throws, never blocks.
|
|
5
|
+
*/
|
|
6
|
+
export function trackDownload(packageName: string): void {
|
|
7
|
+
fetch(`${API_BASE}/downloads/${encodeURIComponent(packageName)}`, {
|
|
8
|
+
method: "POST",
|
|
9
|
+
}).catch(() => {
|
|
10
|
+
// Silently ignore — analytics should never affect the install flow
|
|
11
|
+
});
|
|
12
|
+
}
|
package/src/lib/installer.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { addImport, removeImport } from "./claude-md.js";
|
|
|
10
10
|
import { parseManifest, readPackageContent } from "./manifest.js";
|
|
11
11
|
import { renderTemplate, collectVariableValues } from "./template.js";
|
|
12
12
|
import { logger } from "./logger.js";
|
|
13
|
+
import { trackDownload } from "./analytics.js";
|
|
13
14
|
|
|
14
15
|
function getInstallDir(type: PackageType): string {
|
|
15
16
|
switch (type) {
|
|
@@ -116,6 +117,7 @@ export async function installPackage(
|
|
|
116
117
|
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
117
118
|
fs.writeFileSync(fullPath, content, "utf-8");
|
|
118
119
|
logger.success(`Installed ${packageName}@${version} → ${installPath}`);
|
|
120
|
+
trackDownload(packageName);
|
|
119
121
|
|
|
120
122
|
// Update CLAUDE.md for plans
|
|
121
123
|
if (type === "plan") {
|