compound-workflow 0.1.6 → 0.1.8

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
@@ -23,11 +23,11 @@ npx compound-workflow install
23
23
 
24
24
  **2. Choose how you use it:**
25
25
 
26
- - **Cursor:** If your project already has a `.cursor` directory, Install will create a symlink at `.cursor/skills/compound-workflow` so Cursor discovers the workflow skills. No plugin needed for skills. For full commands and agents, use the plugin from this repo (see repo docs for loading a local plugin).
26
+ - **Cursor:** If your project already has a `.cursor` directory, Install will create the correct structure: one symlink per skill under `.cursor/skills/`, plus `.cursor/agents`, `.cursor/commands`, and `.cursor/references` (each symlinked to the package). No plugin needed. Use the plugin from this repo if you need a different loading method.
27
27
  - **OpenCode:** Install writes `opencode.json` and a symlink at `.agents/compound-workflow-skills`; OpenCode loads from the package. Run `/install` or `npx compound-workflow install` in the project.
28
28
  - **Claude:** Add the compound-workflow plugin from this repo. In any repo, run `/install` or the CLI above.
29
29
 
30
- **What Install does:** Merges `AGENTS.md` (preserves your Repo Config Block), creates standard dirs (`docs/`, `todos/`), writes `opencode.json` (for OpenCode), and—if the project has a `.cursor` directory—creates a symlink at `.cursor/skills/compound-workflow` so Cursor picks up skills. All paths reference `node_modules/compound-workflow`; no file copying.
30
+ **What Install does:** Merges `AGENTS.md` (preserves your Repo Config Block), creates standard dirs (`docs/`, `todos/`), writes `opencode.json` (for OpenCode), and—if the project has a `.cursor` directory—creates `.cursor/skills/<skill>`, `.cursor/agents`, `.cursor/commands`, and `.cursor/references` (symlinks into the package). All paths reference `node_modules/compound-workflow`; no file copying.
31
31
 
32
32
  **CLI options:** `--dry-run` (preview), `--root /path/to/project`, `--no-config` (skip Repo Config Block reminder).
33
33
 
@@ -40,7 +40,7 @@ To update to a new release, see [Updating compound-workflow](#updating-compound-
40
40
  ## Updating compound-workflow
41
41
 
42
42
  - **Cursor (plugin):** If you load the plugin from this repo, pull latest and reload the plugin in Cursor.
43
- - **Cursor (npm + .cursor):** Run `npm update compound-workflow`, then run **Install** again (`npx compound-workflow install`) to refresh the `.cursor/skills/compound-workflow` symlink and AGENTS.md.
43
+ - **Cursor (npm + .cursor):** Run `npm update compound-workflow`, then run **Install** again (`npx compound-workflow install`) to refresh the `.cursor/skills`, `.cursor/agents`, `.cursor/commands`, and `.cursor/references` symlinks and AGENTS.md.
44
44
  - **OpenCode / npm:** Run `npm update compound-workflow` (or bump the version in `package.json` and `npm install`), then run **Install** again. This refreshes `opencode.json`, merges the latest `AGENTS.md` template, and ensures dirs exist; Repo Config Block is preserved.
45
45
  - **Claude (plugin):** Update via the editor’s plugin; if from repo, pull latest and reload.
46
46
 
@@ -151,9 +151,9 @@ Full “when to use what” and reference standards: [src/AGENTS.md](src/AGENTS.
151
151
 
152
152
  ## Troubleshooting
153
153
 
154
- **Skills not showing in Cursor?** Cursor discovers skills from (1) the plugin’s `skills/` directory when you load the plugin from this repo, or (2) the project’s `.cursor/skills/` when you use npm: ensure the project has a `.cursor` directory and run `npx compound-workflow install`—Install creates a symlink at `.cursor/skills/compound-workflow`. If skills still don’t appear, check Cursor Settings → Rules and any `permission.skill` settings.
154
+ **Skills not showing in Cursor?** Cursor discovers skills from (1) the plugin’s `skills/` directory when you load the plugin from this repo, or (2) the project’s `.cursor/skills/` when you use npm: ensure the project has a `.cursor` directory and run `npx compound-workflow install`—Install creates the full structure (`.cursor/skills/<skill>`, `.cursor/agents`, `.cursor/commands`, `.cursor/references`). If skills still don’t appear, check Cursor Settings → Rules and any `permission.skill` settings.
155
155
 
156
- **Skills not showing in OpenCode?** OpenCode uses the `.agents/compound-workflow-skills` symlink and `opencode.json` `skills.paths`. Run Install from the project root (`npx compound-workflow install`).
156
+ **Skills not showing in OpenCode?** OpenCode uses the `.agents/compound-workflow-skills` symlink and `opencode.json` `skills.paths`. Run Install from the project root (`npx compound-workflow install`). The learnings-capture skill is named **compound-docs** (hyphen, plural); **compound_doc** (underscore) is an alias that resolves to the same skill.
157
157
 
158
158
  ---
159
159
 
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"compound-workflow","version":"0.1.6","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"engines":{"node":">=18"}}
1
+ {"name":"compound-workflow","version":"0.1.8","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"engines":{"node":">=18"}}
@@ -208,23 +208,20 @@ function ensureSkillsSymlink(targetRoot, dryRun) {
208
208
  }
209
209
  }
210
210
 
211
- const CURSOR_SKILLS_LINK = ".cursor/skills/compound-workflow";
212
-
213
- function ensureCursorSkills(targetRoot, dryRun) {
211
+ function ensureCursorDirSymlink(targetRoot, cursorSubdir, pkgSubdir, dryRun, label) {
214
212
  const cursorDir = path.join(targetRoot, ".cursor");
215
213
  if (!fs.existsSync(cursorDir)) return;
214
+ const pkgPath = path.join(packageRoot, "src", ".agents", pkgSubdir);
215
+ if (!fs.existsSync(pkgPath)) return;
216
216
 
217
- const skillsDir = path.join(cursorDir, "skills");
218
- const linkPath = path.join(skillsDir, "compound-workflow");
219
- const targetRel = path.join("..", "..", "node_modules", "compound-workflow", "src", ".agents", "skills");
217
+ const linkPath = path.join(cursorDir, cursorSubdir);
218
+ const targetRel = path.join("..", "node_modules", "compound-workflow", "src", ".agents", pkgSubdir);
220
219
 
221
220
  if (dryRun) {
222
- console.log("[dry-run] Would create", CURSOR_SKILLS_LINK, "symlink (Cursor detected)");
221
+ console.log("[dry-run] Would create .cursor/" + cursorSubdir, "symlink (Cursor)");
223
222
  return;
224
223
  }
225
224
 
226
- if (!fs.existsSync(skillsDir)) fs.mkdirSync(skillsDir, { recursive: true });
227
-
228
225
  let needCreate = true;
229
226
  try {
230
227
  const stat = fs.lstatSync(linkPath);
@@ -240,8 +237,66 @@ function ensureCursorSkills(targetRoot, dryRun) {
240
237
  } catch (_) {}
241
238
  const type = process.platform === "win32" ? "dir" : "dir";
242
239
  fs.symlinkSync(targetRel, linkPath, type);
243
- console.log("Created", CURSOR_SKILLS_LINK, "-> package skills (Cursor)");
240
+ console.log("Created", ".cursor/" + cursorSubdir, "->", label || pkgSubdir, "(Cursor)");
241
+ }
242
+ }
243
+
244
+ function ensureCursorSkills(targetRoot, dryRun) {
245
+ const cursorDir = path.join(targetRoot, ".cursor");
246
+ if (!fs.existsSync(cursorDir)) return;
247
+
248
+ const packageSkillsDir = path.join(packageRoot, "src", ".agents", "skills");
249
+ if (!fs.existsSync(packageSkillsDir)) return;
250
+
251
+ const skillNames = [];
252
+ try {
253
+ for (const name of fs.readdirSync(packageSkillsDir)) {
254
+ const skillPath = path.join(packageSkillsDir, name);
255
+ if (fs.statSync(skillPath).isDirectory() && fs.existsSync(path.join(skillPath, "SKILL.md"))) {
256
+ skillNames.push(name);
257
+ }
258
+ }
259
+ } catch (_) {
260
+ return;
244
261
  }
262
+
263
+ const skillsDir = path.join(cursorDir, "skills");
264
+ const type = process.platform === "win32" ? "dir" : "dir";
265
+
266
+ if (dryRun) {
267
+ console.log("[dry-run] Would create .cursor/skills/<skill> symlinks for:", skillNames.join(", "));
268
+ return;
269
+ }
270
+
271
+ if (!fs.existsSync(skillsDir)) fs.mkdirSync(skillsDir, { recursive: true });
272
+
273
+ for (const name of skillNames) {
274
+ const linkPath = path.join(skillsDir, name);
275
+ const targetRel = path.join("..", "..", "..", "node_modules", "compound-workflow", "src", ".agents", "skills", name);
276
+ let needCreate = true;
277
+ try {
278
+ const stat = fs.lstatSync(linkPath);
279
+ if (stat.isSymbolicLink()) {
280
+ fs.realpathSync(linkPath);
281
+ needCreate = false;
282
+ }
283
+ } catch (_) {}
284
+
285
+ if (needCreate) {
286
+ try {
287
+ fs.unlinkSync(linkPath);
288
+ } catch (_) {}
289
+ fs.symlinkSync(targetRel, linkPath, type);
290
+ console.log("Created", ".cursor/skills/" + name, "-> package skill (Cursor)");
291
+ }
292
+ }
293
+ }
294
+
295
+ function ensureCursorIntegration(targetRoot, dryRun) {
296
+ ensureCursorSkills(targetRoot, dryRun);
297
+ ensureCursorDirSymlink(targetRoot, "agents", "agents", dryRun, "package agents");
298
+ ensureCursorDirSymlink(targetRoot, "commands", "commands", dryRun, "package commands");
299
+ ensureCursorDirSymlink(targetRoot, "references", "references", dryRun, "package references");
245
300
  }
246
301
 
247
302
  function writeOpenCodeJson(targetRoot, dryRun) {
@@ -369,7 +424,7 @@ function main() {
369
424
 
370
425
  writeOpenCodeJson(targetRoot, args.dryRun);
371
426
  ensureSkillsSymlink(targetRoot, args.dryRun);
372
- ensureCursorSkills(targetRoot, args.dryRun);
427
+ ensureCursorIntegration(targetRoot, args.dryRun);
373
428
  writeAgentsMd(targetRoot, args.dryRun);
374
429
  ensureDirs(targetRoot, args.dryRun);
375
430
 
@@ -250,9 +250,16 @@ function main() {
250
250
  const existing = readJsonMaybeJsonc(opencodeAbs) ?? {};
251
251
  const next = structuredClone(existing);
252
252
 
253
+ const SKILLS_COMPOUND_PATH = ".agents/compound-workflow-skills";
253
254
  next.$schema = next.$schema || "https://opencode.ai/config.json";
254
255
  next.skills = ensureObject(next.skills);
255
256
  next.skills.paths = Array.isArray(next.skills.paths) ? next.skills.paths : [".agents/skills"];
257
+ const hasCompoundWorkflow =
258
+ fs.existsSync(path.join(rootAbs, "node_modules", "compound-workflow")) ||
259
+ fs.existsSync(path.join(rootAbs, SKILLS_COMPOUND_PATH));
260
+ if (hasCompoundWorkflow && !next.skills.paths.includes(SKILLS_COMPOUND_PATH)) {
261
+ next.skills.paths.unshift(SKILLS_COMPOUND_PATH);
262
+ }
256
263
  next.command = ensureObject(next.command);
257
264
  next.agent = ensureObject(next.agent);
258
265
 
package/src/AGENTS.md CHANGED
@@ -142,7 +142,7 @@ worktree_bootstrap_notes:
142
142
  ## Implemented Components (Current Scope)
143
143
 
144
144
  - Commands: `workflow:brainstorm`, `workflow:plan`, `workflow:work`, `workflow:triage`, `workflow:review`, `workflow:compound` (under `.agents/commands/workflow/`), plus `test-browser`, `metrics`, `assess`, `setup`, `sync` (root commands)
145
- - Skills: `brainstorming`, `document-review`, `technical-review`, `compound-docs`, `file-todos`, `agent-browser`, `git-worktree`, `process-metrics`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability`, `data-foundations`
145
+ - Skills: `brainstorming`, `document-review`, `technical-review`, `compound-docs` (alias: `compound_doc`), `file-todos`, `agent-browser`, `git-worktree`, `process-metrics`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability`, `data-foundations`
146
146
  - Agents:
147
147
  - `repo-research-analyst`
148
148
  - `learnings-researcher`
@@ -197,7 +197,7 @@ Maintenance:
197
197
  | `brainstorming` | You need structured idea exploration and clarification without writing code. |
198
198
  | `document-review` | You need to review a document/spec and extract issues, gaps, and concrete next actions. |
199
199
  | `technical-review` | A plan or feature approach has passed document review and must be checked for technical correctness before build. |
200
- | `compound-docs` | A durable learning (solved problem or implementation insight) should be captured as institutional knowledge. |
200
+ | `compound-docs` (alias: `compound_doc`) | A durable learning (solved problem or implementation insight) should be captured as institutional knowledge. |
201
201
  | `file-todos` | You need a file-backed todo workflow for iterative multi-step changes. |
202
202
  | `agent-browser` | You need to inspect available agents/skills and route deterministically. |
203
203
  | `git-worktree` | You need isolated parallel work (review/feature) using git worktrees. |