bobs-workshop 3.1.5 → 3.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.
package/README.md CHANGED
@@ -94,6 +94,19 @@ That's it. The installer:
94
94
  - ✅ Shows clear error messages if conflicts exist
95
95
  - ✅ Follows OpenCode's official directory structure
96
96
 
97
+ ### Configure OpenCode
98
+
99
+ Add bobs-workshop to your `opencode.jsonc` plugins list:
100
+
101
+ ```json
102
+ {
103
+ "$schema": "https://opencode.ai/config.json",
104
+ "plugin": ["bobs-workshop"]
105
+ }
106
+ ```
107
+
108
+ Both npm and scoped packages are supported (e.g., `@my-org/bobs-workshop`).
109
+
97
110
  ### See it working
98
111
 
99
112
  Once installed, try your first workflow:
@@ -200,26 +213,26 @@ Bob's Workshop integrates with OpenCode through:
200
213
 
201
214
  ```
202
215
  .opencode/
203
- ├── agents/ # Flat structure (per OpenCode docs)
216
+ ├── agents/ # Agent definitions (alice, bob, bob-rev, trace, bob-send)
204
217
  │ ├── alice.md
205
218
  │ ├── bob.md
206
219
  │ ├── bob-rev.md
207
220
  │ ├── trace.md
208
221
  │ └── bob-send.md
209
- ├── skills/ # Flat structure (per OpenCode docs)
222
+ ├── skills/ # 16 specialized skills for agent invocation
210
223
  │ ├── architecture/SKILL.md
211
224
  │ ├── exploration/SKILL.md
212
225
  │ ├── api-patterns/SKILL.md
213
226
  │ └── ... (16 total skills)
214
- ├── tools/bobs-workshop/ # Namespaced tools
227
+ ├── tools/bobs-workshop/ # Plugin tools (loaded from npm package)
215
228
  │ ├── background-agent/
216
229
  │ ├── manual/
217
230
  │ └── index.js
218
- ├── plugins/bobs-workshop/ # Namespaced plugin
219
- │ └── plugin.js
220
- └── opencode.jsonc # Merged agent configs
231
+ └── opencode.jsonc # Config with plugin reference
221
232
  ```
222
233
 
234
+ The plugin is loaded from npm, so no local plugin file is needed. Just reference `"bobs-workshop"` in the `plugin` array.
235
+
223
236
 
224
237
  ## CLI (Optional)
225
238
 
@@ -239,8 +252,6 @@ bobs-workshop doctor
239
252
  npm uninstall bobs-workshop
240
253
  ```
241
254
 
242
- All files and configs are removed automatically.
243
-
244
255
  ## Development
245
256
 
246
257
  ```bash
@@ -263,7 +274,7 @@ npm publish
263
274
  - **[Tailscale](https://tailscale.com)** - Seamless phone/laptop interoperability across devices
264
275
 
265
276
  **AI Models**
266
- - **GLM-4.7** - Primary model for planning and architecture (Alice, Trace agents)
277
+ - **Kimi K2.5** - Primary model for planning and architecture (Alice, Trace agents)
267
278
  - **MiniMax M2.1** - Primary model for implementation and verification (Bob, Bob-Rev, Bob-Send agents)
268
279
  - **Break-glass Models (via OpenRouter)**: GPT 5.1, Gemini 3, or Sonnet 4.5
269
280
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "alice": {
3
3
  "description": "Architect agent - planning and manual authoring",
4
- "model": "zai-coding-plan/glm-4.7",
4
+ "model": "kimi-for-coding/k2p5",
5
5
  "temperature": 0.2
6
6
  },
7
7
  "bob": {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "trace": {
18
18
  "description": "Debug agent - root cause analysis and fixes",
19
- "model": "zai-coding-plan/glm-4.7",
19
+ "model": "kimi-for-coding/k2p5",
20
20
  "temperature": 0.15
21
21
  },
22
22
  "bob-send": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bobs-workshop",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
4
4
  "description": "MANUAL-driven development with background agents for OpenCode",
5
5
  "type": "module",
6
6
  "main": "./dist/plugins/bobs-workshop.js",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@opencode-ai/plugin": "^1.1.36",
31
+ "bobs-workshop": "^3.1.6",
31
32
  "jsonc-parser": "^3.2.1",
32
33
  "skills": "^1.3.1"
33
34
  },
package/postinstall.js CHANGED
@@ -16,19 +16,50 @@ const PACKAGE_NAME = 'bobs-workshop';
16
16
  * Skip when: global npm update, or running from within bobs-workshop repo itself.
17
17
  */
18
18
  function isInstalledAsDependencyInThisRepo() {
19
- // Use INIT_CWD which npm sets to the directory where 'npm install' was invoked
20
- // process.cwd() returns the package directory (node_modules/bobs-workshop/) during postinstall
21
- const projectRoot = process.env.INIT_CWD || process.cwd();
22
- const pkgPath = join(projectRoot, 'package.json');
23
- if (!existsSync(pkgPath)) return false;
24
- let pkg;
25
- try {
26
- pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
27
- } catch {
28
- return false;
19
+ // Try multiple methods to detect if we're in a dependent project
20
+
21
+ // Method 1: INIT_CWD (set by npm during install)
22
+ const cwdCandidates = [
23
+ process.env.INIT_CWD,
24
+ process.env.npm_config_local_prefix,
25
+ ].filter(Boolean);
26
+
27
+ for (const projectRoot of cwdCandidates) {
28
+ const pkgPath = join(projectRoot, 'package.json');
29
+ if (existsSync(pkgPath)) {
30
+ try {
31
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
32
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
33
+ if (typeof deps[PACKAGE_NAME] === 'string') {
34
+ return true;
35
+ }
36
+ } catch {
37
+ continue;
38
+ }
39
+ }
29
40
  }
30
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
31
- return typeof deps[PACKAGE_NAME] === 'string';
41
+
42
+ // Method 2: Check parent directories for node_modules/bobs-workshop
43
+ let currentDir = dirname(__dirname);
44
+ for (let i = 0; i < 5; i++) { // Check up to 5 levels up
45
+ const pkgPath = join(currentDir, 'package.json');
46
+ if (existsSync(pkgPath)) {
47
+ try {
48
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
49
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
50
+ if (typeof deps[PACKAGE_NAME] === 'string') {
51
+ return true;
52
+ }
53
+ } catch {
54
+ // Continue to parent
55
+ }
56
+ }
57
+ const parentDir = dirname(currentDir);
58
+ if (parentDir === currentDir) break;
59
+ currentDir = parentDir;
60
+ }
61
+
62
+ return false;
32
63
  }
33
64
 
34
65
  function checkConflicts(opencodeDir) {
@@ -65,13 +96,56 @@ function checkConflicts(opencodeDir) {
65
96
  return conflicts;
66
97
  }
67
98
 
68
- function postinstall() {
69
- if (!isInstalledAsDependencyInThisRepo()) {
70
- return; // Not a repo that depends on bobs-workshop (e.g. global update or bobs-workshop repo itself)
99
+ function findProjectRoot() {
100
+ // Try INIT_CWD first
101
+ if (process.env.INIT_CWD) {
102
+ const pkgPath = join(process.env.INIT_CWD, 'package.json');
103
+ if (existsSync(pkgPath)) {
104
+ try {
105
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
106
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
107
+ if (typeof deps[PACKAGE_NAME] === 'string') {
108
+ return process.env.INIT_CWD;
109
+ }
110
+ } catch {}
111
+ }
112
+ }
113
+
114
+ // Try npm_config_local_prefix
115
+ if (process.env.npm_config_local_prefix) {
116
+ return process.env.npm_config_local_prefix;
71
117
  }
118
+
119
+ // Fallback: walk up from current location
120
+ let currentDir = dirname(__dirname);
121
+ for (let i = 0; i < 5; i++) {
122
+ const pkgPath = join(currentDir, 'package.json');
123
+ if (existsSync(pkgPath)) {
124
+ try {
125
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
126
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
127
+ if (typeof deps[PACKAGE_NAME] === 'string') {
128
+ return currentDir;
129
+ }
130
+ } catch {}
131
+ }
132
+ const parentDir = dirname(currentDir);
133
+ if (parentDir === currentDir) break;
134
+ currentDir = parentDir;
135
+ }
136
+
137
+ return null;
138
+ }
72
139
 
73
- // Use INIT_CWD to get the actual project directory where npm install was run
74
- const projectRoot = process.env.INIT_CWD || process.cwd();
140
+ function postinstall() {
141
+ const projectRoot = findProjectRoot();
142
+
143
+ if (!projectRoot) {
144
+ console.log('⚠️ bobs-workshop: Could not detect project root. Skipping installation.');
145
+ console.log(' This is normal if installing globally or in a monorepo.');
146
+ console.log(' To manually install, run: npx bobs-workshop install');
147
+ return;
148
+ }
75
149
  const opencodeDir = join(projectRoot, '.opencode');
76
150
 
77
151
  console.log('🔧 Installing bobs-workshop...');
@@ -173,6 +247,17 @@ function postinstall() {
173
247
  console.log('ℹ️ All agents already configured');
174
248
  }
175
249
 
250
+ // Add bobs-workshop to plugins array
251
+ if (!config.plugin) {
252
+ config.plugin = [];
253
+ }
254
+ if (!config.plugin.includes('bobs-workshop')) {
255
+ config.plugin.push('bobs-workshop');
256
+ console.log('✅ Added bobs-workshop to plugins');
257
+ } else {
258
+ console.log('⏭️ bobs-workshop already in plugins, skipping');
259
+ }
260
+
176
261
  const newConfig = JSON.stringify(config, null, 2);
177
262
  writeFileSync(configPath, newConfig);
178
263