shortcuts-playground 1.2.3 → 1.2.4

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
@@ -14,24 +14,37 @@ OpenCode now supports plugin-bundled hooks via `tool.execute.after`. This packag
14
14
 
15
15
  ## Installation
16
16
 
17
- For published npm distribution (native for generic `tool` plugins — `opencode plugin` is `tui`/`server` only):
17
+ For published npm distribution:
18
18
 
19
19
  ```json
20
- // opencode.json (project or ~/.config/opencode/opencode.jsonc)
20
+ // opencode.json (project or ~/.config/opencode/opencode.jsonc) — validator
21
21
  {
22
22
  "$schema": "https://opencode.ai/config.json",
23
23
  "plugin": ["shortcuts-playground"]
24
24
  }
25
25
  ```
26
+ Bun installs the validator on next startup. Pin with `shortcuts-playground@1.2.4`.
26
27
 
27
- Bun installs the validator on next startup to `~/.cache/opencode`. Skills/commands/agents are installed automatically on `npm i` via `postinstall`, or manually:
28
+ Skills use the standard open-skills CLI (no `postinstall` like `claude`/`codex` via marketplace, OpenCode skills are file-discovered at `.opencode/skills` / `~/.config/opencode/skills` / `.agents/skills` per `https://opencode.ai/docs/skills#place-files`):
28
29
 
29
30
  ```bash
30
- npx shortcuts-playground # project .opencode/
31
- npx shortcuts-playground --global # ~/.config/opencode/
31
+ # from GitHub (recommended)
32
+ npx skills add viticci/shortcuts-playground-plugin -a opencode --skill shortcuts-playground
33
+ # or local checkout
34
+ npx skills add ./opencode -a opencode --skill shortcuts-playground
35
+ # global
36
+ npx skills add viticci/shortcuts-playground-plugin -a opencode -g --skill shortcuts-playground
32
37
  ```
33
38
 
34
- Pin with `shortcuts-playground@1.2.3`.
39
+ This symlinks to `.agents/skills/shortcuts-playground/` (discovered by OpenCode) — verified `npx skills add -a opencode --list` finds 1 skill.
40
+
41
+ Commands (`/build-shortcut` + `/remix-shortcut`) and subagents have no `npx skills` installer — copy if you want slash commands (otherwise natural language triggers the skill):
42
+
43
+ ```bash
44
+ mkdir -p .opencode/commands .opencode/agents
45
+ cp opencode/commands/*.md .opencode/commands/
46
+ cp opencode/agents/*.md .opencode/agents/
47
+ ```
35
48
 
36
49
  For local development from a checkout:
37
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shortcuts-playground",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Build, validate, sign, and archive macOS/iOS Shortcuts from OpenCode — thin skill wrapper over ToolKit v78 catalog, /build-shortcut and /remix-shortcut commands, and tool.execute.after validator",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,11 +24,7 @@
24
24
  "plugin"
25
25
  ],
26
26
  "main": "plugin/validator.ts",
27
- "bin": {
28
- "shortcuts-playground": "./bin/install.js"
29
- },
30
27
  "files": [
31
- "bin/",
32
28
  "plugin/",
33
29
  "skills/",
34
30
  "commands/",
@@ -44,9 +40,6 @@
44
40
  "peerDependencies": {
45
41
  "@opencode-ai/plugin": "^1.17.0"
46
42
  },
47
- "scripts": {
48
- "postinstall": "node ./bin/install.js || true"
49
- },
50
43
  "engines": {
51
44
  "node": ">=18"
52
45
  },
package/bin/install.js DELETED
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env node
2
- // shortcuts-playground installer for OpenCode
3
- // Copies skills/commands/agents from the npm package into .opencode/
4
- // Usage: npx shortcuts-playground or npx shortcuts-playground --global
5
-
6
- import { cpSync, existsSync, mkdirSync, readdirSync } from "node:fs";
7
- import { join, dirname } from "node:path";
8
- import { fileURLToPath } from "node:url";
9
-
10
- const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
11
- const isGlobal = process.argv.includes("--global") || process.argv.includes("-g");
12
-
13
- function findProjectRoot(start) {
14
- let dir = start;
15
- for (let i = 0; i < 10; i++) {
16
- if (existsSync(join(dir, ".git"))) return dir;
17
- if (existsSync(join(dir, "opencode.json")) || existsSync(join(dir, ".opencode"))) return dir;
18
- const parent = dirname(dir);
19
- if (parent === dir) break;
20
- dir = parent;
21
- }
22
- return start;
23
- }
24
-
25
- const destRoot = isGlobal
26
- ? join(process.env.HOME || "~", ".config", "opencode")
27
- : findProjectRoot(process.cwd());
28
-
29
- const destBase = join(destRoot, ".opencode");
30
- if (isGlobal) {
31
- // global directly uses ~/.config/opencode
32
- // destRoot already is that
33
- }
34
-
35
- function copyDir(src, dest) {
36
- if (!existsSync(src)) return 0;
37
- mkdirSync(dest, { recursive: true });
38
- let count = 0;
39
- for (const entry of readdirSync(src, { withFileTypes: true })) {
40
- const s = join(src, entry.name);
41
- const d = join(dest, entry.name);
42
- if (entry.isDirectory()) {
43
- cpSync(s, d, { recursive: true, force: true });
44
- count++;
45
- } else {
46
- cpSync(s, d, { force: true });
47
- count++;
48
- }
49
- }
50
- return count;
51
- }
52
-
53
- const skillsSrc = join(pkgRoot, "skills", "shortcuts-playground");
54
- const skillsDest = isGlobal
55
- ? join(destRoot, "skills", "shortcuts-playground")
56
- : join(destBase, "skills", "shortcuts-playground");
57
-
58
- const commandsSrc = join(pkgRoot, "commands");
59
- const commandsDest = isGlobal
60
- ? join(destRoot, "commands")
61
- : join(destBase, "commands");
62
-
63
- const agentsSrc = join(pkgRoot, "agents");
64
- const agentsDest = isGlobal
65
- ? join(destRoot, "agents")
66
- : join(destBase, "agents");
67
-
68
- mkdirSync(skillsDest, { recursive: true });
69
- mkdirSync(commandsDest, { recursive: true });
70
- mkdirSync(agentsDest, { recursive: true });
71
-
72
- cpSync(skillsSrc, skillsDest, { recursive: true, force: true });
73
- for (const f of readdirSync(commandsSrc)) {
74
- if (f.endsWith(".md")) cpSync(join(commandsSrc, f), join(commandsDest, f), { force: true });
75
- }
76
- for (const f of readdirSync(agentsSrc)) {
77
- if (f.endsWith(".md")) cpSync(join(agentsSrc, f), join(agentsDest, f), { force: true });
78
- }
79
-
80
- console.log(`✓ Installed skills → ${skillsDest}`);
81
- console.log(`✓ Installed commands → ${commandsDest} (/build-shortcut, /remix-shortcut)`);
82
- console.log(`✓ Installed agents → ${agentsDest} (shortcut-builder, shortcut-remixer)`);
83
- console.log(`\nPlugin already registered via opencode.json "plugin": ["shortcuts-playground"] — restart OpenCode TUI and run /build-shortcut`);
84
- if (!isGlobal) console.log(`(global: npx shortcuts-playground --global)`);