opencode-skills-doctor 0.8.0 → 0.8.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/package.json +3 -2
- package/src/audit.mjs +2 -1
- package/src/cli.mjs +8 -1
- package/src/discover.mjs +7 -1
- package/src/i18n.mjs +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-skills-doctor",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Audit, fix and update agent skills: token cost, broken references, shadowed duplicates, HTML reports, catalog sync. CLI, OpenCode plugin, MCP server; works with OpenCode, Claude Code, Codex, Grok CLI, Cursor and DeepSeek Harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"./plugin": "./src/plugin.mjs",
|
|
9
9
|
"./server": "./src/plugin-v1.mjs",
|
|
10
10
|
"./v1": "./src/plugin-v1.mjs",
|
|
11
|
-
"./audit": "./src/audit.mjs"
|
|
11
|
+
"./audit": "./src/audit.mjs",
|
|
12
|
+
"./cli": "./src/cli.mjs"
|
|
12
13
|
},
|
|
13
14
|
"bin": {
|
|
14
15
|
"skills-doctor": "./bin/skills-doctor.mjs"
|
package/src/audit.mjs
CHANGED
|
@@ -16,13 +16,14 @@ export function auditSkills({
|
|
|
16
16
|
configPath = null,
|
|
17
17
|
budget = null,
|
|
18
18
|
staleDays = null,
|
|
19
|
+
extraDirs = [],
|
|
19
20
|
} = {}) {
|
|
20
21
|
const loaded = loadConfig(cwd, configPath)
|
|
21
22
|
const config = loaded.config
|
|
22
23
|
const resolvedLang = normalizeLang(lang) ?? normalizeLang(config.lang) ?? detectLang()
|
|
23
24
|
const t = translator(resolvedLang)
|
|
24
25
|
|
|
25
|
-
const discovered = scanAll(discoverSources({ cwd, includeGlobal }))
|
|
26
|
+
const discovered = scanAll(discoverSources({ cwd, includeGlobal, extraDirs }))
|
|
26
27
|
const managedInfo = inspectManaged(discovered.scans, { t })
|
|
27
28
|
|
|
28
29
|
const effectiveBudget = Number.isFinite(budget) && budget > 0 ? budget : config.budget ?? 1200
|
package/src/cli.mjs
CHANGED
|
@@ -77,6 +77,7 @@ function parseArgs(argv) {
|
|
|
77
77
|
profile: null,
|
|
78
78
|
dshHome: null,
|
|
79
79
|
kimiHome: null,
|
|
80
|
+
extraDirs: [],
|
|
80
81
|
configDir: null,
|
|
81
82
|
noNpm: false,
|
|
82
83
|
html: null,
|
|
@@ -167,6 +168,9 @@ function parseArgs(argv) {
|
|
|
167
168
|
case "--kimi-home":
|
|
168
169
|
options.kimiHome = path.resolve(args[++i] ?? ".")
|
|
169
170
|
break
|
|
171
|
+
case "--extra-dir":
|
|
172
|
+
options.extraDirs.push(path.resolve(args[++i] ?? "."))
|
|
173
|
+
break
|
|
170
174
|
case "--no-npm":
|
|
171
175
|
options.noNpm = true
|
|
172
176
|
break
|
|
@@ -814,6 +818,7 @@ export async function main(argv) {
|
|
|
814
818
|
configPath: options.config,
|
|
815
819
|
budget: options.budget,
|
|
816
820
|
staleDays: options.staleDays,
|
|
821
|
+
extraDirs: options.extraDirs,
|
|
817
822
|
})
|
|
818
823
|
const plan = planBudget(audit, { descTarget: options.descTarget, steps: options.steps })
|
|
819
824
|
if (options.json) console.log(JSON.stringify(plan, null, 2))
|
|
@@ -829,6 +834,7 @@ export async function main(argv) {
|
|
|
829
834
|
configPath: options.config,
|
|
830
835
|
budget: options.budget,
|
|
831
836
|
staleDays: options.staleDays,
|
|
837
|
+
extraDirs: options.extraDirs,
|
|
832
838
|
})
|
|
833
839
|
const result = buildCheckResult(audit, options)
|
|
834
840
|
|
|
@@ -855,7 +861,7 @@ export async function main(argv) {
|
|
|
855
861
|
return
|
|
856
862
|
}
|
|
857
863
|
|
|
858
|
-
const discovered = scanAll(discoverSources({ cwd, includeGlobal: options.global }))
|
|
864
|
+
const discovered = scanAll(discoverSources({ cwd, includeGlobal: options.global, extraDirs: options.extraDirs }))
|
|
859
865
|
const managedInfo = inspectManaged(discovered.scans, { t })
|
|
860
866
|
|
|
861
867
|
if (options.command === "scan") {
|
|
@@ -893,6 +899,7 @@ export async function main(argv) {
|
|
|
893
899
|
configPath: options.config,
|
|
894
900
|
budget: options.budget,
|
|
895
901
|
staleDays: options.staleDays,
|
|
902
|
+
extraDirs: options.extraDirs,
|
|
896
903
|
})
|
|
897
904
|
process.exitCode = runFix(audit, options, t)
|
|
898
905
|
}
|
package/src/discover.mjs
CHANGED
|
@@ -128,7 +128,7 @@ function isUnder(parent, child) {
|
|
|
128
128
|
* 14. 项目 .opencode/skills(项目根 → cwd)
|
|
129
129
|
* 15. opencode.json(c) 里的 skills 数组 / skills.paths
|
|
130
130
|
*/
|
|
131
|
-
export function discoverSources({ cwd = process.cwd(), home = os.homedir(), includeGlobal = true } = {}) {
|
|
131
|
+
export function discoverSources({ cwd = process.cwd(), home = os.homedir(), includeGlobal = true, extraDirs = [] } = {}) {
|
|
132
132
|
const projectRoot = findProjectRoot(cwd) ?? path.resolve(cwd)
|
|
133
133
|
const projectChain = pathChain(projectRoot, cwd)
|
|
134
134
|
const sources = []
|
|
@@ -164,6 +164,12 @@ export function discoverSources({ cwd = process.cwd(), home = os.homedir(), incl
|
|
|
164
164
|
if (includeGlobal) addSource("opencode-global", "global", path.join(home, ".config", "opencode", "skills"))
|
|
165
165
|
for (const dir of projectChain) addSource("opencode-project", "project", path.join(dir, ".opencode", "skills"))
|
|
166
166
|
|
|
167
|
+
for (const dir of extraDirs) {
|
|
168
|
+
if (typeof dir !== "string" || !dir.trim()) continue
|
|
169
|
+
const abs = path.resolve(dir)
|
|
170
|
+
if (fs.existsSync(abs)) addSource("extra", isUnder(projectRoot, abs) ? "project" : "global", abs)
|
|
171
|
+
}
|
|
172
|
+
|
|
167
173
|
const configFiles = []
|
|
168
174
|
if (includeGlobal) {
|
|
169
175
|
for (const file of configCandidates(path.join(home, ".config", "opencode"))) {
|
package/src/i18n.mjs
CHANGED
|
@@ -40,6 +40,7 @@ Options:
|
|
|
40
40
|
--profile <name> dsh: profile to install into (default: desktop, or the only one)
|
|
41
41
|
--dsh-home <dir> dsh: DSH home directory (default: ~/.dsh)
|
|
42
42
|
--kimi-home <dir> kimi: Kimi Code home (default: ~/.kimi-code or $KIMI_CODE_HOME)
|
|
43
|
+
--extra-dir <dir> scan an additional skill directory (repeatable; e.g. ~/.openclaw/skills)
|
|
43
44
|
--no-npm install/uninstall: do not run npm (1.x)
|
|
44
45
|
--apply upgrade: run npm install -g opencode-skills-doctor@latest
|
|
45
46
|
--no-update-check skip the automatic update check for this run
|
|
@@ -269,6 +270,7 @@ Exit codes: 0 ok; 1 errors (and warnings with --strict); 2 bad arguments or runt
|
|
|
269
270
|
--profile <name> dsh: 安装到哪个 profile(默认 desktop,或唯一的一个)
|
|
270
271
|
--dsh-home <dir> dsh: DSH 主目录(默认 ~/.dsh)
|
|
271
272
|
--kimi-home <dir> kimi: Kimi Code 主目录(默认 ~/.kimi-code 或 $KIMI_CODE_HOME)
|
|
273
|
+
--extra-dir <dir> 额外扫描一个 skill 目录(可重复;例如 ~/.openclaw/skills)
|
|
272
274
|
--no-npm install/uninstall: 不执行 npm(1.x)
|
|
273
275
|
--apply upgrade: 执行 npm install -g opencode-skills-doctor@latest
|
|
274
276
|
--no-update-check 本次运行跳过自动更新检查
|