@windyroad/jtbd 0.1.1 → 0.1.2-preview.13

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/bin/install.mjs CHANGED
@@ -20,6 +20,7 @@ Jobs-to-be-done enforcement for UI changes
20
20
  Options:
21
21
  --update Update this plugin and its skills
22
22
  --uninstall Remove this plugin
23
+ --scope Installation scope: project (default) or user
23
24
  --dry-run Show what would be done without executing
24
25
  --help, -h Show this help
25
26
  `);
@@ -38,5 +39,5 @@ if (flags.uninstall) {
38
39
  } else if (flags.update) {
39
40
  utils.updatePackage(PLUGIN);
40
41
  } else {
41
- utils.installPackage(PLUGIN, { deps: DEPS });
42
+ utils.installPackage(PLUGIN, { deps: DEPS, scope: flags.scope });
42
43
  }
@@ -46,15 +46,6 @@ export function checkPrerequisites() {
46
46
  );
47
47
  process.exit(1);
48
48
  }
49
-
50
- try {
51
- execSync("npx --version", { stdio: "pipe" });
52
- } catch {
53
- console.error(
54
- "Error: 'npx' not found. Install Node.js first:\n https://nodejs.org\n"
55
- );
56
- process.exit(1);
57
- }
58
49
  }
59
50
 
60
51
  export function addMarketplace() {
@@ -64,9 +55,9 @@ export function addMarketplace() {
64
55
  );
65
56
  }
66
57
 
67
- export function installPlugin(pluginName) {
58
+ export function installPlugin(pluginName, { scope = "project" } = {}) {
68
59
  return run(
69
- `claude plugin install ${pluginName}@${MARKETPLACE_NAME}`,
60
+ `claude plugin install ${pluginName}@${MARKETPLACE_NAME} --scope ${scope}`,
70
61
  pluginName
71
62
  );
72
63
  }
@@ -79,33 +70,14 @@ export function uninstallPlugin(pluginName) {
79
70
  return run(`claude plugin uninstall ${pluginName}`, `Removing ${pluginName}`);
80
71
  }
81
72
 
82
- export function installSkills() {
83
- return run(
84
- `npx -y skills add --yes --all ${MARKETPLACE_REPO}`,
85
- "Skills (via skills package)"
86
- );
87
- }
88
-
89
- export function updateSkills() {
90
- return run("npx -y skills update", "Skills update");
91
- }
92
-
93
- export function removeSkills() {
94
- return run(
95
- `npx -y skills remove --yes --all ${MARKETPLACE_REPO}`,
96
- "Removing skills"
97
- );
98
- }
99
-
100
73
  /**
101
- * Install a single package: marketplace add + plugin install + skills.
74
+ * Install a single package: marketplace add + plugin install.
102
75
  */
103
- export function installPackage(pluginName, { deps = [] } = {}) {
104
- console.log(`\nInstalling @windyroad/${pluginName.replace("wr-", "")}...\n`);
76
+ export function installPackage(pluginName, { deps = [], scope = "project" } = {}) {
77
+ console.log(`\nInstalling @windyroad/${pluginName.replace("wr-", "")} (${scope} scope)...\n`);
105
78
 
106
79
  addMarketplace();
107
- installPlugin(pluginName);
108
- installSkills();
80
+ installPlugin(pluginName, { scope });
109
81
 
110
82
  if (deps.length > 0) {
111
83
  console.log(`\nNote: This plugin works best with:`);
@@ -130,7 +102,6 @@ export function updatePackage(pluginName) {
130
102
  "Updating marketplace"
131
103
  );
132
104
  updatePlugin(pluginName);
133
- updateSkills();
134
105
 
135
106
  console.log("\nDone! Restart Claude Code to apply updates.\n");
136
107
  }
@@ -144,9 +115,6 @@ export function uninstallPackage(pluginName) {
144
115
  uninstallPlugin(pluginName);
145
116
 
146
117
  console.log("\nDone. Restart Claude Code to apply changes.\n");
147
- console.log("Note: Skills are shared across packages. Run");
148
- console.log(" npx @windyroad/agent-plugins --uninstall");
149
- console.log("to remove all skills.\n");
150
118
  }
151
119
 
152
120
  /**
@@ -154,10 +122,22 @@ export function uninstallPackage(pluginName) {
154
122
  */
155
123
  export function parseStandardArgs(argv) {
156
124
  const args = argv.slice(2);
157
- return {
125
+ const flags = {
158
126
  help: args.includes("--help") || args.includes("-h"),
159
127
  uninstall: args.includes("--uninstall"),
160
128
  update: args.includes("--update"),
161
129
  dryRun: args.includes("--dry-run"),
130
+ scope: "project",
162
131
  };
132
+ const scopeIdx = args.indexOf("--scope");
133
+ if (scopeIdx !== -1 && args[scopeIdx + 1]) {
134
+ const val = args[scopeIdx + 1];
135
+ if (["project", "user", "local"].includes(val)) {
136
+ flags.scope = val;
137
+ } else {
138
+ console.error("--scope requires: project, user, or local");
139
+ process.exit(1);
140
+ }
141
+ }
142
+ return flags;
163
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/jtbd",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-preview.13",
4
4
  "description": "Jobs-to-be-done enforcement for UI changes",
5
5
  "bin": {
6
6
  "windyroad-jtbd": "./bin/install.mjs"