opencode-effect-enforcer 0.2.4 → 0.2.5
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 +1 -1
- package/package.json +2 -2
- package/src/enforcer.ts +1 -1
- package/src/index.ts +1 -1
- package/src/skills.ts +4 -4
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ That is the complete installation. OpenCode resolves published package entries
|
|
|
25
25
|
for you; there is no separate `npm install` step. Use the global config at
|
|
26
26
|
`~/.config/opencode/opencode.jsonc` to enable it everywhere, or a project config
|
|
27
27
|
to enable it only for that project. You can also pin a release, for example
|
|
28
|
-
`"opencode-effect-enforcer@0.2.
|
|
28
|
+
`"opencode-effect-enforcer@0.2.5"`.
|
|
29
29
|
|
|
30
30
|
Start a new OpenCode session, then verify the plugin if needed:
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "opencode-effect-enforcer",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"description": "OpenCode V2 plugin for Effect v4 skills, guidance, and pattern enforcement",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"opencode",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@ast-grep/napi": "^0.42.3",
|
|
47
|
-
"@opencode
|
|
47
|
+
"@opencode/plugin": "2.0.8",
|
|
48
48
|
"diff": "^9.0.0",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"picomatch": "^4.0.3",
|
package/src/enforcer.ts
CHANGED
package/src/index.ts
CHANGED
package/src/skills.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Skill } from "@opencode
|
|
1
|
+
import { Skill } from "@opencode/plugin"
|
|
2
2
|
import { readdir, readFile } from "node:fs/promises"
|
|
3
3
|
import path from "node:path"
|
|
4
4
|
|
|
@@ -9,8 +9,8 @@ export const loadSkills = async (skillsDirectory: string): Promise<ReadonlyArray
|
|
|
9
9
|
const entries = await readdir(skillsDirectory, { withFileTypes: true })
|
|
10
10
|
const skills = await Promise.all(
|
|
11
11
|
entries.filter((entry) => entry.isDirectory()).map(async (entry) => {
|
|
12
|
-
const
|
|
13
|
-
const markdown = await readFile(
|
|
12
|
+
const skillPath = path.resolve(skillsDirectory, entry.name, "SKILL.md")
|
|
13
|
+
const markdown = await readFile(skillPath, "utf8")
|
|
14
14
|
const frontmatter = parseFrontmatter(markdown)
|
|
15
15
|
const displayName = typeof frontmatter.name === "string" ? frontmatter.name : entry.name
|
|
16
16
|
const description = typeof frontmatter.description === "string"
|
|
@@ -20,7 +20,7 @@ export const loadSkills = async (skillsDirectory: string): Promise<ReadonlyArray
|
|
|
20
20
|
id: Skill.ID.make(entry.name),
|
|
21
21
|
name: Skill.Name.make(displayName),
|
|
22
22
|
description,
|
|
23
|
-
|
|
23
|
+
path: Skill.Info.fields.path.make(skillPath),
|
|
24
24
|
content: extractBody(markdown)
|
|
25
25
|
})
|
|
26
26
|
})
|