opencode-agent-skills-md 1.0.0 → 1.0.1
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 +33 -2
- package/package.json +2 -2
- package/packages/opencode-agent-skills-md/package.json +29 -5
- package/packages/opencode-agent-skills-md/rolldown.config.js +3 -4
- package/packages/opencode-agent-skills-md/src/cli/main.ts +20 -4
- package/packages/opencode-agent-skills-md/tests/package-boundary.test.ts +12 -13
package/README.md
CHANGED
|
@@ -52,9 +52,30 @@ Both packages live in this repo as a pnpm workspace. From the repo root, `pnpm i
|
|
|
52
52
|
|
|
53
53
|
## Installation
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Quick install (recommended)
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
```bash
|
|
58
|
+
npx opencode-agent-skills-md install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This registers the plugin in your global OpenCode config and verifies the installation. Restart OpenCode to activate.
|
|
62
|
+
|
|
63
|
+
### CLI commands
|
|
64
|
+
|
|
65
|
+
After installing, the following commands are available:
|
|
66
|
+
|
|
67
|
+
- `oas install` — register the plugin in the global OpenCode config
|
|
68
|
+
- `oas uninstall` — remove the plugin from the global OpenCode config
|
|
69
|
+
- `oas status` — check whether the plugin is currently installed
|
|
70
|
+
- `oas doctor` — validate the OpenCode configuration health
|
|
71
|
+
|
|
72
|
+
### From npm (alternative)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install -g opencode-agent-skills-md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then add the plugin to `~/.config/opencode/opencode.json`:
|
|
58
79
|
|
|
59
80
|
```json
|
|
60
81
|
{
|
|
@@ -70,6 +91,16 @@ To pin a specific version:
|
|
|
70
91
|
}
|
|
71
92
|
```
|
|
72
93
|
|
|
94
|
+
### Manual configuration (fallback)
|
|
95
|
+
|
|
96
|
+
If you prefer not to use the CLI, add the plugin entry manually to `~/.config/opencode/opencode.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"plugin": ["opencode-agent-skills-md"]
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
73
104
|
Restart OpenCode after updating the config.
|
|
74
105
|
|
|
75
106
|
### Custom harness (standalone engine)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-agent-skills-md",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "pnpm workspace root for opencode-agent-skills-md. The user-facing OpenCode plugin lives at packages/opencode-agent-skills-md and the portable engine at packages/core. This manifest exists only to wire the workspace — it has no exports of its own; consumers install one of the workspace packages directly.",
|
|
6
6
|
"author": "Josh Thomas <josh@joshthomas.dev>",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/node": "^25.9.1",
|
|
24
24
|
"tsx": "^4.22.3",
|
|
25
25
|
"typescript": "^6.0.3",
|
|
26
|
-
"opencode-agent-skills-md": "0.
|
|
26
|
+
"opencode-agent-skills-md": "1.0.1",
|
|
27
27
|
"opencode-agent-skills-md-core": "0.0.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"name": "opencode-agent-skills-md",
|
|
3
3
|
"version": "0.7.0",
|
|
4
4
|
"description": "OpenCode adapter for the opencode-agent-skills-md workspace: plugin factory, host, and the four skill tools.",
|
|
5
|
-
"private": true,
|
|
6
5
|
"type": "module",
|
|
7
6
|
"main": "src/index.ts",
|
|
8
7
|
"exports": {
|
|
@@ -14,29 +13,54 @@
|
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"dist",
|
|
17
|
-
"src"
|
|
16
|
+
"src",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
18
19
|
],
|
|
19
20
|
"bin": {
|
|
20
21
|
"oas": "./dist/cli.mjs"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "rm -rf dist && rolldown -c && tsc -p tsconfig.build.json",
|
|
25
|
+
"prepack": "pnpm run build",
|
|
24
26
|
"pretest": "npm run build",
|
|
25
27
|
"test": "node --import tsx --test \"tests/**/*.test.ts\"",
|
|
26
28
|
"typecheck": "tsc --noEmit"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
29
|
-
"@opencode-ai/plugin": "^1.15.11",
|
|
30
|
-
"opencode-agent-skills-md-core": "workspace:*",
|
|
31
31
|
"yaml": "^2.9.0"
|
|
32
32
|
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@opencode-ai/plugin": ">=1.0.0"
|
|
35
|
+
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@types/node": "^25.9.1",
|
|
38
|
+
"opencode-agent-skills-md-core": "workspace:*",
|
|
35
39
|
"rolldown": "^1.0.3",
|
|
36
40
|
"tsx": "^4.22.3",
|
|
37
41
|
"typescript": "^6.0.3"
|
|
38
42
|
},
|
|
39
43
|
"engines": {
|
|
40
44
|
"node": ">=18.0.0"
|
|
41
|
-
}
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/MetalbolicX/opencode-agent-skills-md.git"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/MetalbolicX/opencode-agent-skills-md",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/MetalbolicX/opencode-agent-skills-md/issues"
|
|
54
|
+
},
|
|
55
|
+
"author": {
|
|
56
|
+
"name": "Josh Thomas",
|
|
57
|
+
"url": "https://github.com/joshjoshthomas"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"opencode",
|
|
61
|
+
"plugin",
|
|
62
|
+
"skills",
|
|
63
|
+
"agent",
|
|
64
|
+
"ai"
|
|
65
|
+
]
|
|
42
66
|
}
|
|
@@ -6,9 +6,9 @@ import { defineConfig } from 'rolldown';
|
|
|
6
6
|
* - `dist/plugin.mjs` — the OpenCode host adapter + default-export plugin factory.
|
|
7
7
|
* - `dist/cli.mjs` — the `oas` CLI entry point (shebang + parseArgs dispatch).
|
|
8
8
|
*
|
|
9
|
-
* The core engine (`opencode-agent-skills-md-core`) is
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* The core engine (`opencode-agent-skills-md-core`) is inlined into the plugin
|
|
10
|
+
* bundle — it is removed from externals so rolldown treeshakes and bundles it
|
|
11
|
+
* directly. The plugin stays self-contained at runtime.
|
|
12
12
|
*
|
|
13
13
|
* `node:util` (parseArgs) and `node:url` (pathToFileURL for entry-point
|
|
14
14
|
* detection) are only used by the CLI; the plugin entry doesn't need them,
|
|
@@ -17,7 +17,6 @@ import { defineConfig } from 'rolldown';
|
|
|
17
17
|
*/
|
|
18
18
|
const sharedExternal = [
|
|
19
19
|
'@opencode-ai/plugin',
|
|
20
|
-
'opencode-agent-skills-md-core',
|
|
21
20
|
'node:fs',
|
|
22
21
|
'node:fs/promises',
|
|
23
22
|
'node:os',
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
17
|
|
|
18
18
|
import { pathToFileURL } from "node:url";
|
|
19
|
+
import { realpathSync } from "node:fs";
|
|
19
20
|
import { parseArgs } from "node:util";
|
|
20
21
|
import { runInstall } from "./install";
|
|
21
22
|
import { runDoctor, runStatus } from "./status";
|
|
@@ -186,15 +187,30 @@ export const runMain = (argv: readonly string[] = process.argv): MainResult => {
|
|
|
186
187
|
* cli.mjs`), `false` when it was imported from a test harness. We avoid
|
|
187
188
|
* `import.meta.main` because the package floor is Node 18 and that field
|
|
188
189
|
* only landed in Node 22.
|
|
190
|
+
*
|
|
191
|
+
* Symlink-aware: when the script is invoked through a symlink (e.g. the
|
|
192
|
+
* pnpm global store, where `node_modules/<pkg>` is a symlink into a
|
|
193
|
+
* content-addressable store), `process.argv[1]` carries the symlink path
|
|
194
|
+
* while `import.meta.url` carries the real path after symlink resolution.
|
|
195
|
+
* Comparing the two verbatim would always be `false` under pnpm, causing
|
|
196
|
+
* the CLI to silently exit. We resolve both sides through `realpathSync`
|
|
197
|
+
* before comparing.
|
|
189
198
|
*/
|
|
190
|
-
const
|
|
199
|
+
const checkInvokedAsMain = (): boolean => {
|
|
191
200
|
if (!process.argv[1]) return false;
|
|
192
201
|
try {
|
|
193
|
-
|
|
202
|
+
const realArgv = pathToFileURL(realpathSync(process.argv[1])).href;
|
|
203
|
+
return import.meta.url === realArgv;
|
|
194
204
|
} catch {
|
|
195
|
-
|
|
205
|
+
try {
|
|
206
|
+
return import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
207
|
+
} catch {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
196
210
|
}
|
|
197
|
-
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const invokedAsMain = checkInvokedAsMain();
|
|
198
214
|
|
|
199
215
|
if (invokedAsMain) {
|
|
200
216
|
runMain(process.argv);
|
|
@@ -41,36 +41,35 @@ const TESTS_DIR = path.join(PKG_DIR, "tests");
|
|
|
41
41
|
const REPO_ROOT = path.resolve(PKG_DIR, "..", "..");
|
|
42
42
|
|
|
43
43
|
describe("opencode-agent-skills-md package boundary", () => {
|
|
44
|
-
test("manifest declares the plugin as `opencode-agent-skills-md`, ESM, and
|
|
44
|
+
test("manifest declares the plugin as `opencode-agent-skills-md`, ESM, and publishable", async () => {
|
|
45
45
|
const pkgPath = path.join(PKG_DIR, "package.json");
|
|
46
46
|
const raw = await readFile(pkgPath, "utf8");
|
|
47
47
|
const manifest = JSON.parse(raw) as Record<string, unknown>;
|
|
48
48
|
|
|
49
49
|
assert.equal(manifest.name, "opencode-agent-skills-md", "package name preserves the existing install surface");
|
|
50
50
|
assert.equal(manifest.type, "module", "package type must be ESM");
|
|
51
|
-
assert.equal(
|
|
52
|
-
manifest.private,
|
|
53
|
-
true,
|
|
54
|
-
"package must be private until publishing is wired in a later PR",
|
|
55
|
-
);
|
|
51
|
+
assert.equal(manifest.private, undefined, "package must not be private — it is published to npm");
|
|
56
52
|
});
|
|
57
53
|
|
|
58
|
-
test("manifest
|
|
54
|
+
test("manifest has the correct dependency shape for publishing", async () => {
|
|
59
55
|
const raw = await readFile(path.join(PKG_DIR, "package.json"), "utf8");
|
|
60
56
|
const manifest = JSON.parse(raw) as Record<string, unknown>;
|
|
61
57
|
|
|
62
58
|
const dependencies = (manifest.dependencies ?? {}) as Record<string, string>;
|
|
59
|
+
const devDependencies = (manifest.devDependencies ?? {}) as Record<string, string>;
|
|
60
|
+
const peerDependencies = (manifest.peerDependencies ?? {}) as Record<string, string>;
|
|
61
|
+
|
|
63
62
|
assert.ok(
|
|
64
|
-
"
|
|
65
|
-
"dependencies must
|
|
63
|
+
"yaml" in dependencies,
|
|
64
|
+
"dependencies must include yaml (runtime dependency for the core engine)",
|
|
66
65
|
);
|
|
67
66
|
assert.ok(
|
|
68
|
-
"@opencode-ai/plugin" in
|
|
69
|
-
"
|
|
67
|
+
"@opencode-ai/plugin" in peerDependencies,
|
|
68
|
+
"@opencode-ai/plugin must be a peerDependency (provided by the OpenCode host)",
|
|
70
69
|
);
|
|
71
70
|
assert.ok(
|
|
72
|
-
"
|
|
73
|
-
"
|
|
71
|
+
"opencode-agent-skills-md-core" in devDependencies,
|
|
72
|
+
"opencode-agent-skills-md-core must be a devDependency (bundled into the plugin at build time)",
|
|
74
73
|
);
|
|
75
74
|
});
|
|
76
75
|
|