cdspec 0.1.0 → 0.1.3
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 +86 -33
- package/dist/cli.js +1 -93
- package/dist/config/default.js +1 -48
- package/dist/config/loader.js +1 -30
- package/dist/config/path.js +1 -11
- package/dist/config/types.js +1 -1
- package/dist/skill-core/adapters/claudecode-adapter.js +1 -35
- package/dist/skill-core/adapters/codex-adapter.js +1 -28
- package/dist/skill-core/adapters/iflow-adapter.js +1 -39
- package/dist/skill-core/adapters/index.js +1 -34
- package/dist/skill-core/adapters/shared.js +1 -36
- package/dist/skill-core/manifest-loader.js +1 -63
- package/dist/skill-core/scaffold.js +1 -169
- package/dist/skill-core/service.js +1 -156
- package/dist/skill-core/tool-interactions.js +1 -70
- package/dist/skill-core/types.js +1 -1
- package/dist/skill-core/validator.js +1 -25
- package/dist/utils/frontmatter.js +1 -40
- package/dist/utils/fs.js +1 -37
- package/package.json +12 -2
- package/templates/{standards-backend → backend-standard}/SKILL.md +55 -55
- package/templates/backend-standard/agents/openai.yaml +4 -0
- package/templates/{standards-backend → backend-standard}/references/DDD/346/236/266/346/236/204/347/272/246/346/235/237.md +103 -103
- package/templates/{standards-backend → backend-standard}/references/JUC/345/271/266/345/217/221/350/247/204/350/214/203.md +232 -232
- package/templates/{standards-backend → backend-standard}/references//344/274/240/347/273/237/344/270/211/345/261/202/346/236/266/346/236/204/347/272/246/346/235/237.md +35 -35
- package/templates/{standards-backend → backend-standard}/references//345/220/216/347/253/257/345/274/200/345/217/221/350/247/204/350/214/203.md +49 -49
- package/templates/{standards-backend → backend-standard}/references//346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/350/247/204/350/214/203.md +116 -116
- package/templates/{standards-backend → backend-standard}/references//350/256/276/350/256/241/346/250/241/345/274/217/350/220/275/345/234/260/346/211/213/345/206/214.md +395 -395
- package/templates/{frontend-develop-standard → frontend-standard}/SKILL.md +63 -63
- package/templates/frontend-standard/agents/openai.yaml +4 -0
- package/templates/{frontend-develop-standard/references/frontend_develop_standard.md → frontend-standard/references/frontend_standard.md} +28 -321
- package/AGENTS.md +0 -14
- package/CLAUDE.md +0 -10
- package/dist/skill-core/agent-config.js +0 -40
- package/dist/task-core/parser.js +0 -70
- package/dist/task-core/service.js +0 -28
- package/dist/task-core/storage.js +0 -159
- package/dist/task-core/types.js +0 -1
- package/src/cli.ts +0 -105
- package/src/config/default.ts +0 -51
- package/src/config/loader.ts +0 -37
- package/src/config/path.ts +0 -13
- package/src/config/types.ts +0 -22
- package/src/skill-core/adapters/claudecode-adapter.ts +0 -45
- package/src/skill-core/adapters/codex-adapter.ts +0 -36
- package/src/skill-core/adapters/iflow-adapter.ts +0 -49
- package/src/skill-core/adapters/index.ts +0 -39
- package/src/skill-core/adapters/shared.ts +0 -45
- package/src/skill-core/manifest-loader.ts +0 -79
- package/src/skill-core/scaffold.ts +0 -192
- package/src/skill-core/service.ts +0 -199
- package/src/skill-core/tool-interactions.ts +0 -95
- package/src/skill-core/types.ts +0 -22
- package/src/skill-core/validator.ts +0 -28
- package/src/task-core/parser.ts +0 -89
- package/src/task-core/service.ts +0 -49
- package/src/task-core/storage.ts +0 -177
- package/src/task-core/types.ts +0 -15
- package/src/types/yaml.d.ts +0 -4
- package/src/utils/frontmatter.ts +0 -55
- package/src/utils/fs.ts +0 -41
- package/templates/frontend-develop-standard/agents/openai.yaml +0 -4
- package/templates/standards-backend/agents/openai.yaml +0 -4
- package/tests/skill.test.ts +0 -191
- package/tests/task.test.ts +0 -55
- package/tsconfig.json +0 -16
- package/vitest.config.ts +0 -9
package/README.md
CHANGED
|
@@ -1,55 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CDSpec
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
`cdspec` 是一个 Skill 编排 CLI,用来把项目里的模板/技能一键安装到不同智能体目录(Codex / ClaudeCode / iFlow),并自动生成可调用命令。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Installing OpenSpec-style interaction commands (`opsx-*`).
|
|
7
|
-
- Splitting markdown into task cards and archiving completed tasks.
|
|
8
|
-
- Config-driven command-skill bindings via `cdspec.config.yaml`.
|
|
5
|
+
## 功能
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
- 从 `templates/` 批量生成并安装 skills
|
|
8
|
+
- 自动为每个 skill 生成命令文件
|
|
9
|
+
- 生成命令与 skill 的绑定说明(AGENTS/CLAUDE/IFLOW)
|
|
10
|
+
- 支持任务拆分与归档(`task split/status/archive`)
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
全局安装(已发布到 npm):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm i -g cdspec
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
验证安装:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cdspec --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
本地开发方式:
|
|
11
27
|
|
|
12
28
|
```bash
|
|
13
29
|
npm install
|
|
14
30
|
npm run build
|
|
15
|
-
|
|
31
|
+
npm link
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 快速开始
|
|
35
|
+
|
|
36
|
+
在项目根目录准备 `templates/`,每个技能一个目录,目录内至少有 `SKILL.md`。
|
|
37
|
+
|
|
38
|
+
示例:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
templates/
|
|
42
|
+
design-doc/
|
|
43
|
+
SKILL.md
|
|
44
|
+
agents/openai.yaml
|
|
45
|
+
references/*
|
|
46
|
+
frontend-standards/
|
|
47
|
+
SKILL.md
|
|
16
48
|
```
|
|
17
49
|
|
|
18
|
-
|
|
50
|
+
执行初始化:
|
|
19
51
|
|
|
20
52
|
```bash
|
|
21
|
-
cdspec init
|
|
53
|
+
cdspec init
|
|
54
|
+
```
|
|
22
55
|
|
|
23
|
-
|
|
24
|
-
cdspec skill add <name> --target all
|
|
25
|
-
cdspec skill sync --target all
|
|
56
|
+
或指定智能体:
|
|
26
57
|
|
|
27
|
-
|
|
28
|
-
cdspec
|
|
29
|
-
cdspec task status --id <task-id> --to done
|
|
30
|
-
cdspec task archive --id <task-id>
|
|
58
|
+
```bash
|
|
59
|
+
cdspec init --agents codex,claudecode,iflow
|
|
31
60
|
```
|
|
32
61
|
|
|
33
|
-
|
|
62
|
+
## 生成规则(当前版本)
|
|
63
|
+
|
|
64
|
+
1. `templates/*` 下每个 skill 目录会被安装到目标智能体的 `skills/`。
|
|
65
|
+
2. 每个 skill 自动生成一个命令文件,命令名规则为:
|
|
66
|
+
`cd-<skill-name>`
|
|
67
|
+
3. `init` 默认覆盖旧文件(不需要 `--force`)。
|
|
68
|
+
|
|
69
|
+
示例:
|
|
70
|
+
|
|
71
|
+
- skill: `frontend-develop-standard`
|
|
72
|
+
- 命令文件:`cd-frontend-develop-standard.md`
|
|
73
|
+
|
|
74
|
+
## 输出目录
|
|
75
|
+
|
|
76
|
+
默认配置下:
|
|
77
|
+
|
|
78
|
+
- Codex: `~/.codex/skills/*` 和 `~/.codex/prompts/*`
|
|
79
|
+
- ClaudeCode: `.claude/skills/*` 和 `.claude/commands/opsx/*`
|
|
80
|
+
- iFlow: `.iflow/skills/*` 和 `.iflow/commands/*`
|
|
81
|
+
|
|
82
|
+
附加说明文件:
|
|
83
|
+
|
|
84
|
+
- `~/.codex/AGENTS.md`
|
|
85
|
+
- 项目根 `AGENTS.md`
|
|
86
|
+
- 项目根 `CLAUDE.md`(当启用 claudecode)
|
|
87
|
+
- `.iflow/IFLOW.md`(当启用 iflow)
|
|
88
|
+
|
|
89
|
+
## 配置
|
|
34
90
|
|
|
35
|
-
|
|
36
|
-
- `.claude/skills/*`, `.claude/commands/opsx/*.md`, `CLAUDE.md`
|
|
37
|
-
- `.iflow/skills/*`, `.iflow/commands/opsx-*.md`, `.iflow/IFLOW.md`
|
|
91
|
+
项目根配置文件:`cdspec.config.yaml`
|
|
38
92
|
|
|
39
|
-
|
|
40
|
-
It does not create extra source folders in your project tree.
|
|
41
|
-
When `templates/*.md` exists, the exported skill name is derived from template filename, and
|
|
42
|
-
command bindings are auto-pointed to that generated skill.
|
|
93
|
+
可配置项包括:
|
|
43
94
|
|
|
44
|
-
|
|
95
|
+
- 各智能体根目录(如 `~/.codex`)
|
|
96
|
+
- 命令目录位置(`prompts` / `commands`)
|
|
97
|
+
- 命令文件命名规则与 slash 展示规则
|
|
45
98
|
|
|
46
|
-
|
|
47
|
-
- Task workspace: `.cdspec/tasks` and `.cdspec/archive`
|
|
99
|
+
## 常见问题
|
|
48
100
|
|
|
49
|
-
|
|
101
|
+
1. `init` 后看不到新命令
|
|
102
|
+
重启 Codex 会话;部分客户端启动时才扫描 prompt 列表。
|
|
50
103
|
|
|
51
|
-
|
|
104
|
+
2. 命令重复(Team/个人各一份)
|
|
105
|
+
这是不同来源同时存在,清理个人或团队同名 skill 即可。
|
|
52
106
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- slash command display pattern
|
|
107
|
+
3. 发布 npm 报 401/404
|
|
108
|
+
先 `npm login`,再检查包名与权限后发布。
|
package/dist/cli.js
CHANGED
|
@@ -1,94 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
import { addSkill, initSkills, listSkills, syncSkills } from "./skill-core/service.js";
|
|
7
|
-
import { archiveTaskById, splitTasks, updateTask } from "./task-core/service.js";
|
|
8
|
-
const program = new Command();
|
|
9
|
-
program
|
|
10
|
-
.name("cdspec")
|
|
11
|
-
.description("Skill sync + task split/archive workflow CLI")
|
|
12
|
-
.version("0.1.0");
|
|
13
|
-
program
|
|
14
|
-
.command("init")
|
|
15
|
-
.description("Initialize skills for selected coding agents")
|
|
16
|
-
.option("--agents <agents>", "codex|claudecode|iflow|all or comma-separated")
|
|
17
|
-
.action(async (options) => {
|
|
18
|
-
const selected = options.agents ?? (await askAgentsSelection());
|
|
19
|
-
const files = await initSkills(process.cwd(), selected, true);
|
|
20
|
-
console.log(`Initialized OpenSpec-style setup for "${selected}".`);
|
|
21
|
-
console.log(`Generated files: ${files.map((x) => path.relative(process.cwd(), x)).join(", ")}`);
|
|
22
|
-
});
|
|
23
|
-
program
|
|
24
|
-
.command("skill")
|
|
25
|
-
.description("Skill operations")
|
|
26
|
-
.addCommand(new Command("list").action(async () => {
|
|
27
|
-
const names = await listSkills(process.cwd());
|
|
28
|
-
if (names.length === 0) {
|
|
29
|
-
console.log("No skill found under .codex/.");
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
names.forEach((name) => console.log(name));
|
|
33
|
-
}))
|
|
34
|
-
.addCommand(new Command("add")
|
|
35
|
-
.argument("<name>", "skill folder name under .codex")
|
|
36
|
-
.option("--target <target>", "codex|claudecode|iflow|all or comma-separated", "all")
|
|
37
|
-
.option("--force", "overwrite existing output", false)
|
|
38
|
-
.action(async (name, options) => {
|
|
39
|
-
await addSkill(process.cwd(), name, options.target, options.force);
|
|
40
|
-
console.log(`Skill "${name}" exported to tool folders for target "${options.target}".`);
|
|
41
|
-
}))
|
|
42
|
-
.addCommand(new Command("sync")
|
|
43
|
-
.option("--target <target>", "codex|claudecode|iflow|all or comma-separated", "all")
|
|
44
|
-
.option("--force", "overwrite existing output", false)
|
|
45
|
-
.action(async (options) => {
|
|
46
|
-
await syncSkills(process.cwd(), options.target, options.force);
|
|
47
|
-
console.log(`All skills synced to tool folders for target "${options.target}".`);
|
|
48
|
-
}));
|
|
49
|
-
program
|
|
50
|
-
.command("task")
|
|
51
|
-
.description("Task split/archive operations")
|
|
52
|
-
.addCommand(new Command("split")
|
|
53
|
-
.requiredOption("--from <file>", "source markdown file")
|
|
54
|
-
.requiredOption("--title <title>", "task group title")
|
|
55
|
-
.action(async (options) => {
|
|
56
|
-
const count = await splitTasks(process.cwd(), options.from, options.title);
|
|
57
|
-
console.log(`Generated ${count} tasks from "${options.from}".`);
|
|
58
|
-
}))
|
|
59
|
-
.addCommand(new Command("status")
|
|
60
|
-
.requiredOption("--id <id>", "task id")
|
|
61
|
-
.requiredOption("--to <status>", "todo|in_progress|done")
|
|
62
|
-
.action(async (options) => {
|
|
63
|
-
await updateTask(process.cwd(), options.id, options.to);
|
|
64
|
-
console.log(`Task "${options.id}" updated to "${options.to}".`);
|
|
65
|
-
}))
|
|
66
|
-
.addCommand(new Command("archive")
|
|
67
|
-
.requiredOption("--id <id>", "task id")
|
|
68
|
-
.action(async (options) => {
|
|
69
|
-
await archiveTaskById(process.cwd(), options.id);
|
|
70
|
-
console.log(`Task "${options.id}" archived.`);
|
|
71
|
-
}));
|
|
72
|
-
program.parseAsync(process.argv).catch((error) => {
|
|
73
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
74
|
-
console.error(message);
|
|
75
|
-
process.exitCode = 1;
|
|
76
|
-
});
|
|
77
|
-
async function askAgentsSelection() {
|
|
78
|
-
if (!process.stdin.isTTY)
|
|
79
|
-
return "all";
|
|
80
|
-
const values = await checkbox({
|
|
81
|
-
message: "Select coding agents",
|
|
82
|
-
choices: [
|
|
83
|
-
{ name: "codex", value: "codex", checked: true },
|
|
84
|
-
{ name: "claudecode", value: "claudecode" },
|
|
85
|
-
{ name: "iflow", value: "iflow" },
|
|
86
|
-
{ name: "all", value: "all" }
|
|
87
|
-
]
|
|
88
|
-
});
|
|
89
|
-
if (values.length === 0)
|
|
90
|
-
return "all";
|
|
91
|
-
if (values.includes("all"))
|
|
92
|
-
return "all";
|
|
93
|
-
return values.join(",");
|
|
94
|
-
}
|
|
2
|
+
const _0x4586ae=_0x2ae6;(function(_0x952b63,_0x19c83a){const _0x589d6a=_0x2ae6,_0x4ae186=_0x952b63();while(!![]){try{const _0x44ad2d=parseInt(_0x589d6a(0xf1))/(-0x8f4*0x1+0x25cf*-0x1+0x2ec4)+parseInt(_0x589d6a(0x102))/(-0xd*0x115+-0x1d9*0x4+0x1577)+parseInt(_0x589d6a(0xfd))/(-0x15b1+0x30*-0xc5+0x3aa4)*(parseInt(_0x589d6a(0x103))/(-0xb*0x23d+-0x3*-0x2cf+0x53*0x32))+parseInt(_0x589d6a(0xf2))/(0xbda+-0x1a28+0xc1*0x13)+-parseInt(_0x589d6a(0xfa))/(0x1fec+-0x3a0+0x1*-0x1c46)+-parseInt(_0x589d6a(0xf4))/(0xbc7+-0x230b*-0x1+-0x2ecb)+-parseInt(_0x589d6a(0x100))/(-0x27f*-0x2+0x207a+-0x2570);if(_0x44ad2d===_0x19c83a)break;else _0x4ae186['push'](_0x4ae186['shift']());}catch(_0x26c43b){_0x4ae186['push'](_0x4ae186['shift']());}}}(_0x4cca,-0x1dbe33+0x1584ad*0x1+-0xbb209*-0x2));import _0x18a232 from'@inquirer/checkbox';import{Command}from'commander';import _0x414dbc from'node:path';function _0x4cca(){const _0x13d22e=['command','Initialized\x20setup\x20for\x20\x22','log','join','all','version','iflow','message','name','Select\x20coding\x20agents','error','--agents\x20<agents>','isTTY','codex|claudecode|iflow|all\x20or\x20comma-separated','1440721ofwkIH','4373925AQBeYl','option','9023161UrAXlu','0.1.0','claudecode','stdin','action','catch','6361488VqTaZQ','Initialize\x20skills\x20for\x20selected\x20coding\x20agents','codex','243kdCjWw','init','cwd','10801848dwxeRn','Generated\x20files:\x20','1258762enamVM','86348TxpcQx','includes','argv'];_0x4cca=function(){return _0x13d22e;};return _0x4cca();}function _0x2ae6(_0x3a72c1,_0x4474e6){_0x3a72c1=_0x3a72c1-(-0x23b4+0x20ff+-0x1*-0x397);const _0x52982d=_0x4cca();let _0x5a546f=_0x52982d[_0x3a72c1];return _0x5a546f;}import _0x2cb688 from'node:process';import{initSkills}from'./skill-core/service.js';const program=new Command();program[_0x4586ae(0xeb)]('cdspec')['description']('Skill\x20init\x20CLI')[_0x4586ae(0xe8)](_0x4586ae(0xf5)),program[_0x4586ae(0xe3)](_0x4586ae(0xfe))['description'](_0x4586ae(0xfb))[_0x4586ae(0xf3)](_0x4586ae(0xee),_0x4586ae(0xf0))[_0x4586ae(0xf8)](async _0x2a3372=>{const _0x120f72=_0x4586ae,_0x4dc941=_0x2a3372['agents']??await askAgentsSelection(),_0x4bd56f=await initSkills(_0x2cb688['cwd'](),_0x4dc941,!![]);console[_0x120f72(0xe5)](_0x120f72(0xe4)+_0x4dc941+'\x22.'),console[_0x120f72(0xe5)](_0x120f72(0x101)+_0x4bd56f['map'](_0x1063a1=>_0x414dbc['relative'](_0x2cb688[_0x120f72(0xff)](),_0x1063a1))[_0x120f72(0xe6)](',\x20'));}),program['parseAsync'](_0x2cb688[_0x4586ae(0xe2)])[_0x4586ae(0xf9)](_0x311986=>{const _0x31556b=_0x4586ae,_0xb7ae0f=_0x311986 instanceof Error?_0x311986[_0x31556b(0xea)]:String(_0x311986);console[_0x31556b(0xed)](_0xb7ae0f),_0x2cb688['exitCode']=0x5e3+0x2*0x2dd+0x1*-0xb9c;});async function askAgentsSelection(){const _0x4f55c0=_0x4586ae;if(!_0x2cb688[_0x4f55c0(0xf7)][_0x4f55c0(0xef)])return _0x4f55c0(0xe7);const _0x510c4a=await _0x18a232({'message':_0x4f55c0(0xec),'choices':[{'name':'codex','value':_0x4f55c0(0xfc),'checked':!![]},{'name':_0x4f55c0(0xf6),'value':_0x4f55c0(0xf6)},{'name':_0x4f55c0(0xe9),'value':'iflow'},{'name':'all','value':_0x4f55c0(0xe7)}]});if(_0x510c4a['length']===0x2455+-0x1*-0x85+-0x24da)return _0x4f55c0(0xe7);if(_0x510c4a[_0x4f55c0(0x104)](_0x4f55c0(0xe7)))return _0x4f55c0(0xe7);return _0x510c4a[_0x4f55c0(0xe6)](',');}
|
package/dist/config/default.js
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
commandBindings: [
|
|
3
|
-
{
|
|
4
|
-
id: "propose",
|
|
5
|
-
skill: "openspec-core",
|
|
6
|
-
description: "Create a change proposal with scope and impacted specs."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
id: "explore",
|
|
10
|
-
skill: "openspec-core",
|
|
11
|
-
description: "Analyze existing specs and produce planned deltas."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: "apply",
|
|
15
|
-
skill: "openspec-core",
|
|
16
|
-
description: "Implement approved tasks and keep spec updates in sync."
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: "archive",
|
|
20
|
-
skill: "openspec-core",
|
|
21
|
-
description: "Archive completed changes and update baseline specs."
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
agents: {
|
|
25
|
-
codex: {
|
|
26
|
-
rootDir: ".codex",
|
|
27
|
-
commandsDir: "prompts",
|
|
28
|
-
commandFilePattern: "opsx-{id}.md",
|
|
29
|
-
slashPattern: "/opsx-{id}",
|
|
30
|
-
guideFile: "AGENTS.md"
|
|
31
|
-
},
|
|
32
|
-
claudecode: {
|
|
33
|
-
rootDir: ".claude",
|
|
34
|
-
commandsDir: "commands/opsx",
|
|
35
|
-
commandFilePattern: "{id}.md",
|
|
36
|
-
slashPattern: "/opsx:{id}",
|
|
37
|
-
guideFile: "CLAUDE.md",
|
|
38
|
-
guideAtProjectRoot: true
|
|
39
|
-
},
|
|
40
|
-
iflow: {
|
|
41
|
-
rootDir: ".iflow",
|
|
42
|
-
commandsDir: "commands",
|
|
43
|
-
commandFilePattern: "opsx-{id}.md",
|
|
44
|
-
slashPattern: "/opsx-{id}",
|
|
45
|
-
guideFile: "IFLOW.md"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
1
|
+
const _0x3ae830=_0x4311;function _0x4311(_0x218500,_0x2547d7){_0x218500=_0x218500-(0x11*0xa9+-0xb*0x114+0x5*0x40);const _0x5a2b7b=_0x3d10();let _0x414fbe=_0x5a2b7b[_0x218500];return _0x414fbe;}(function(_0x2227e2,_0x58b444){const _0x532852=_0x4311,_0x258d5c=_0x2227e2();while(!![]){try{const _0x4f9852=parseInt(_0x532852(0xa2))/(-0x3*0x5c2+0x10c8+-0x7f*-0x1)+-parseInt(_0x532852(0xa5))/(0x1*0x1727+0x2522+-0x1*0x3c47)+parseInt(_0x532852(0xac))/(-0x1d*0x25+0x141f+-0xfeb)+parseInt(_0x532852(0xa1))/(0x1e1+0x18c6+-0x1aa3)+parseInt(_0x532852(0xaf))/(-0x173b*-0x1+-0xcf3+-0xa43)*(parseInt(_0x532852(0x9d))/(0x60+-0x9*0x41+0x1ef))+-parseInt(_0x532852(0xb2))/(0x2*-0xb1b+0xb*-0xfe+0x2127)*(parseInt(_0x532852(0xb1))/(0x38*-0xb2+-0x2*-0x685+0x19ee))+parseInt(_0x532852(0xa7))/(0x8cf+0x1*0x1105+-0x19cb)*(-parseInt(_0x532852(0xa9))/(0x1f88+0xc1b+0x1*-0x2b99));if(_0x4f9852===_0x58b444)break;else _0x258d5c['push'](_0x258d5c['shift']());}catch(_0xb859b7){_0x258d5c['push'](_0x258d5c['shift']());}}}(_0x3d10,0x1ab080+-0x151*0xe83+0x6ec94));function _0x3d10(){const _0x11b532=['2490710AhsFdV','.claude','72ZgNMth','commands/opsx','677460ftTtEq','/opsx-{id}','openspec-core','2552697ArNttS','explore','.iflow','145apVVUm','{id}.md','120aFUvWr','281183gbaswn','Analyze\x20existing\x20specs\x20and\x20produce\x20planned\x20deltas.','.codex','270888etCjcj','Create\x20a\x20change\x20proposal\x20with\x20scope\x20and\x20impacted\x20specs.','archive','Implement\x20approved\x20tasks\x20and\x20keep\x20spec\x20updates\x20in\x20sync.','1910552GYOIVL','702974BnWimk','/opsx:{id}','Archive\x20completed\x20changes\x20and\x20update\x20baseline\x20specs.'];_0x3d10=function(){return _0x11b532;};return _0x3d10();}export const defaultConfig={'commandBindings':[{'id':'propose','skill':_0x3ae830(0xab),'description':_0x3ae830(0x9e)},{'id':_0x3ae830(0xad),'skill':'openspec-core','description':_0x3ae830(0xb3)},{'id':'apply','skill':_0x3ae830(0xab),'description':_0x3ae830(0xa0)},{'id':_0x3ae830(0x9f),'skill':_0x3ae830(0xab),'description':_0x3ae830(0xa4)}],'agents':{'codex':{'rootDir':_0x3ae830(0xb4),'commandsDir':'prompts','commandFilePattern':'opsx-{id}.md','slashPattern':'/opsx-{id}','guideFile':'AGENTS.md'},'claudecode':{'rootDir':_0x3ae830(0xa6),'commandsDir':_0x3ae830(0xa8),'commandFilePattern':_0x3ae830(0xb0),'slashPattern':_0x3ae830(0xa3),'guideFile':'CLAUDE.md','guideAtProjectRoot':!![]},'iflow':{'rootDir':_0x3ae830(0xae),'commandsDir':'commands','commandFilePattern':'opsx-{id}.md','slashPattern':_0x3ae830(0xaa),'guideFile':'IFLOW.md'}}};
|
package/dist/config/loader.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { parse } from "yaml";
|
|
4
|
-
import { pathExists } from "../utils/fs.js";
|
|
5
|
-
import { defaultConfig } from "./default.js";
|
|
6
|
-
const CONFIG_FILE = "cdspec.config.yaml";
|
|
7
|
-
export async function loadConfig(cwd) {
|
|
8
|
-
const configPath = path.join(cwd, CONFIG_FILE);
|
|
9
|
-
if (!(await pathExists(configPath))) {
|
|
10
|
-
return defaultConfig;
|
|
11
|
-
}
|
|
12
|
-
const raw = await readFile(configPath, "utf8");
|
|
13
|
-
const parsed = parse(raw);
|
|
14
|
-
if (!parsed)
|
|
15
|
-
return defaultConfig;
|
|
16
|
-
const merged = {
|
|
17
|
-
commandBindings: parsed.commandBindings && parsed.commandBindings.length > 0
|
|
18
|
-
? parsed.commandBindings
|
|
19
|
-
: defaultConfig.commandBindings,
|
|
20
|
-
agents: {
|
|
21
|
-
codex: { ...defaultConfig.agents.codex, ...(parsed.agents?.codex || {}) },
|
|
22
|
-
claudecode: {
|
|
23
|
-
...defaultConfig.agents.claudecode,
|
|
24
|
-
...(parsed.agents?.claudecode || {})
|
|
25
|
-
},
|
|
26
|
-
iflow: { ...defaultConfig.agents.iflow, ...(parsed.agents?.iflow || {}) }
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return merged;
|
|
30
|
-
}
|
|
1
|
+
(function(_0x205a0c,_0x27990a){const _0x365c77=_0x2c61,_0x41850f=_0x205a0c();while(!![]){try{const _0x3e38c6=-parseInt(_0x365c77(0x148))/(0x1e25*0x1+-0x3bb*-0x1+0x1d*-0x12b)+-parseInt(_0x365c77(0x149))/(-0x2286+-0x1145+-0x1*-0x33cd)+-parseInt(_0x365c77(0x14b))/(0x12b9+-0x1952+0x69c)+parseInt(_0x365c77(0x146))/(-0x1bba+0xc19+-0x537*-0x3)+-parseInt(_0x365c77(0x14e))/(0x2*0x119+0x475+0x236*-0x3)+parseInt(_0x365c77(0x14a))/(-0x42a+-0x1*-0x1d17+-0x18e7)+parseInt(_0x365c77(0x150))/(-0xfa*0x1e+-0xa5e+0x27b1)*(parseInt(_0x365c77(0x147))/(-0x12b7+-0x2*-0x1145+0xfcb*-0x1));if(_0x3e38c6===_0x27990a)break;else _0x41850f['push'](_0x41850f['shift']());}catch(_0x5f89e3){_0x41850f['push'](_0x41850f['shift']());}}}(_0x48f7,0x9bd2a+-0x335*0x241+0x2e1bd*0x1));import _0x10540a from'node:path';import{readFile}from'node:fs/promises';function _0x2c61(_0x200928,_0x386259){_0x200928=_0x200928-(-0x1*0x26ae+-0x3*-0xbf1+0x420);const _0x1ab987=_0x48f7();let _0x31e5a2=_0x1ab987[_0x200928];return _0x31e5a2;}import{parse}from'yaml';import{pathExists}from'../utils/fs.js';import{defaultConfig}from'./default.js';function _0x48f7(){const _0x1adcf2=['commandBindings','2948375cJsTwZ','codex','20153WVZiRK','length','iflow','claudecode','1285476ALZGmV','3576GowtxX','686929QtBrHs','211092kdiVmk','2033376UpDoGI','634902wAEvGO','agents'];_0x48f7=function(){return _0x1adcf2;};return _0x48f7();}const CONFIG_FILE='cdspec.config.yaml';export async function loadConfig(_0x2c770a){const _0xa720c1=_0x2c61,_0x21524d=_0x10540a['join'](_0x2c770a,CONFIG_FILE);if(!await pathExists(_0x21524d))return defaultConfig;const _0x5e970a=await readFile(_0x21524d,'utf8'),_0x175ba0=parse(_0x5e970a);if(!_0x175ba0)return defaultConfig;const _0x9df6d2={'commandBindings':_0x175ba0[_0xa720c1(0x14d)]&&_0x175ba0[_0xa720c1(0x14d)][_0xa720c1(0x151)]>0x1cf+-0xb*0x159+0xee*0xe?_0x175ba0['commandBindings']:defaultConfig[_0xa720c1(0x14d)],'agents':{'codex':{...defaultConfig[_0xa720c1(0x14c)][_0xa720c1(0x14f)],..._0x175ba0[_0xa720c1(0x14c)]?.[_0xa720c1(0x14f)]||{}},'claudecode':{...defaultConfig['agents'][_0xa720c1(0x145)],..._0x175ba0[_0xa720c1(0x14c)]?.[_0xa720c1(0x145)]||{}},'iflow':{...defaultConfig[_0xa720c1(0x14c)][_0xa720c1(0x152)],..._0x175ba0[_0xa720c1(0x14c)]?.[_0xa720c1(0x152)]||{}}}};return _0x9df6d2;}
|
package/dist/config/path.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
export function resolveAgentRoot(cwd, rootDir) {
|
|
4
|
-
if (rootDir.startsWith("~/") || rootDir.startsWith("~\\")) {
|
|
5
|
-
return path.join(os.homedir(), rootDir.slice(2));
|
|
6
|
-
}
|
|
7
|
-
if (path.win32.isAbsolute(rootDir) || path.posix.isAbsolute(rootDir)) {
|
|
8
|
-
return path.normalize(rootDir);
|
|
9
|
-
}
|
|
10
|
-
return path.join(cwd, rootDir);
|
|
11
|
-
}
|
|
1
|
+
(function(_0xaa45ba,_0x2b4eb9){var _0x1adef6=_0x3178,_0x258b32=_0xaa45ba();while(!![]){try{var _0x181d65=-parseInt(_0x1adef6(0x1a6))/(-0x45d*-0x2+-0x15*0x1af+0x1aa2)*(parseInt(_0x1adef6(0x199))/(0x2ea+0xf1d+0x1205*-0x1))+-parseInt(_0x1adef6(0x1a4))/(0x27*0xfe+-0x1b94+-0x1*0xb1b)*(parseInt(_0x1adef6(0x19a))/(-0x2000*0x1+-0x1*-0x962+0x1*0x16a2))+parseInt(_0x1adef6(0x19b))/(0x708+0x2057+-0x275a)*(parseInt(_0x1adef6(0x1a5))/(0x1d*0x137+-0x7e*-0x3a+0x35b*-0x13))+-parseInt(_0x1adef6(0x198))/(0x170e+-0xd0d+-0x9fa)+-parseInt(_0x1adef6(0x19f))/(0x4*0x712+0x61f*0x3+-0x2e9d)*(-parseInt(_0x1adef6(0x19c))/(-0x665+-0xb5f*-0x1+-0x4f1))+-parseInt(_0x1adef6(0x19d))/(0xbd5+0x6bb*0x2+-0x1941)+-parseInt(_0x1adef6(0x1a2))/(-0x4*-0x23f+0x3*-0x6f8+-0xbf7*-0x1)*(-parseInt(_0x1adef6(0x1a3))/(0x1*-0x1942+-0x1cb3+0xacd*0x5));if(_0x181d65===_0x2b4eb9)break;else _0x258b32['push'](_0x258b32['shift']());}catch(_0x3afb7b){_0x258b32['push'](_0x258b32['shift']());}}}(_0x3c68,0xdc*-0xb9d+0x1e7*-0xdf+0x11e26c));import _0x3616d1 from'node:os';function _0x3c68(){var _0x5a462a=['12wopkBC','525BmEFAA','6OuAHzU','1rAmQKV','join','2871344FagCFd','22632MogBWj','6172YDxmVq','1474315PMlyMx','1386xHyGDL','5900320LmRPrb','homedir','34552MqlCTY','slice','startsWith','8040901cqgoTC'];_0x3c68=function(){return _0x5a462a;};return _0x3c68();}function _0x3178(_0x5b692d,_0x25b984){_0x5b692d=_0x5b692d-(0x1*0x197a+0xbe9*-0x1+-0x5fd*0x2);var _0x4fc857=_0x3c68();var _0x42e409=_0x4fc857[_0x5b692d];return _0x42e409;}import _0x3c668b from'node:path';export function resolveAgentRoot(_0x401d15,_0x5a2768){var _0x507f66=_0x3178;if(_0x5a2768[_0x507f66(0x1a1)]('~/')||_0x5a2768[_0x507f66(0x1a1)]('~\x5c'))return _0x3c668b[_0x507f66(0x197)](_0x3616d1[_0x507f66(0x19e)](),_0x5a2768[_0x507f66(0x1a0)](0x1a4c*0x1+-0xfbc*-0x1+0x3*-0xe02));if(_0x3c668b['win32']['isAbsolute'](_0x5a2768)||_0x3c668b['posix']['isAbsolute'](_0x5a2768))return _0x3c668b['normalize'](_0x5a2768);return _0x3c668b[_0x507f66(0x197)](_0x401d15,_0x5a2768);}
|
package/dist/config/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class ClaudeCodeAdapter {
|
|
5
|
-
target = "claudecode";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.name) {
|
|
9
|
-
diagnostics.push({ level: "error", message: "[claudecode] name is required." });
|
|
10
|
-
}
|
|
11
|
-
return diagnostics;
|
|
12
|
-
}
|
|
13
|
-
async emit(manifest, outDir, force) {
|
|
14
|
-
if ((await pathExists(outDir)) && !force) {
|
|
15
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
16
|
-
}
|
|
17
|
-
if (force) {
|
|
18
|
-
await emptyDir(outDir);
|
|
19
|
-
}
|
|
20
|
-
const meta = {
|
|
21
|
-
name: manifest.name,
|
|
22
|
-
description: manifest.description,
|
|
23
|
-
entry: "SKILL.md"
|
|
24
|
-
};
|
|
25
|
-
await emitWithLayout(manifest, outDir, true, [
|
|
26
|
-
{
|
|
27
|
-
relativePath: "claudecode.skill.json",
|
|
28
|
-
content: `${JSON.stringify(meta, null, 2)}\n`
|
|
29
|
-
}
|
|
30
|
-
]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function claudecodeSkillPath(baseOutDir, skillName) {
|
|
34
|
-
return path.join(baseOutDir, "claudecode", skillName);
|
|
35
|
-
}
|
|
1
|
+
function _0x246b(){const _0xa483d8=['3158530AqAUJF','2637BKCJLg','6486907LiieVn','[claudecode]\x20name\x20is\x20required.','Target\x20already\x20exists\x20for\x20skill\x20\x22','description','validate','claudecode','\x22\x20at\x20','emit','SKILL.md','name','.\x20Use\x20--force\x20to\x20overwrite.','stringify','3445276gGGfoS','7752VTZvYx','claudecode.skill.json','error','2uENUAJ','target','1001187AdtKKa','6ZvPWTf','891675jTjKeq','3503655wXqnoU'];_0x246b=function(){return _0xa483d8;};return _0x246b();}const _0x420f5f=_0x5734;(function(_0xac7a5f,_0x2fff46){const _0x1fabd5=_0x5734,_0x554cd2=_0xac7a5f();while(!![]){try{const _0x33892f=parseInt(_0x1fabd5(0x1f6))/(-0xd*-0x235+-0x1*-0x597+-0x2247)*(parseInt(_0x1fabd5(0x1f4))/(0x1*0x1e67+0x1*0x91b+-0x2780))+parseInt(_0x1fabd5(0x1f9))/(-0x1007*-0x1+0xf*-0x154+0x3e8)+-parseInt(_0x1fabd5(0x1f0))/(-0xf58+-0x1fda+-0x179b*-0x2)+parseInt(_0x1fabd5(0x1f8))/(-0x1*-0x163f+0x11*0x173+-0x2edd)+parseInt(_0x1fabd5(0x1f7))/(0x13a6+-0x54d+-0xe53)*(-parseInt(_0x1fabd5(0x1fc))/(0x1*-0x19+-0x44*0x50+0x1560))+parseInt(_0x1fabd5(0x1f1))/(0x13*0x6b+0x14b3+-0x1c9c)*(-parseInt(_0x1fabd5(0x1fb))/(-0x13f3*-0x1+-0x10b+-0x1*0x12df))+parseInt(_0x1fabd5(0x1fa))/(-0x2*0xba4+0x4ae+0x12a4);if(_0x33892f===_0x2fff46)break;else _0x554cd2['push'](_0x554cd2['shift']());}catch(_0x33f97d){_0x554cd2['push'](_0x554cd2['shift']());}}}(_0x246b,0xd3855*0x1+-0x6d7*0x286+0xd1010));import _0x181578 from'node:path';import{emptyDir,pathExists}from'../../utils/fs.js';import{emitWithLayout}from'./shared.js';function _0x5734(_0x1507ba,_0x539b70){_0x1507ba=_0x1507ba-(-0x1c6a+-0xa5*-0x10+0x140a);const _0x881f5a=_0x246b();let _0x2464ce=_0x881f5a[_0x1507ba];return _0x2464ce;}export class ClaudeCodeAdapter{[_0x420f5f(0x1f5)]=_0x420f5f(0x201);[_0x420f5f(0x200)](_0x3acf27){const _0x359770=_0x420f5f,_0x35369d=[];return!_0x3acf27[_0x359770(0x205)]&&_0x35369d['push']({'level':_0x359770(0x1f3),'message':_0x359770(0x1fd)}),_0x35369d;}async[_0x420f5f(0x203)](_0x5d98e2,_0x5f4c14,_0x4f3e5f){const _0x114fee=_0x420f5f;if(await pathExists(_0x5f4c14)&&!_0x4f3e5f)throw new Error(_0x114fee(0x1fe)+_0x5d98e2['name']+_0x114fee(0x202)+_0x5f4c14+_0x114fee(0x206));_0x4f3e5f&&await emptyDir(_0x5f4c14);const _0x1016c4={'name':_0x5d98e2[_0x114fee(0x205)],'description':_0x5d98e2[_0x114fee(0x1ff)],'entry':_0x114fee(0x204)};await emitWithLayout(_0x5d98e2,_0x5f4c14,!![],[{'relativePath':_0x114fee(0x1f2),'content':JSON[_0x114fee(0x207)](_0x1016c4,null,0x19*-0x17e+0x2a2*-0xa+-0x3fa4*-0x1)+'\x0a'}]);}}export function claudecodeSkillPath(_0x2291a2,_0xb7d72b){return _0x181578['join'](_0x2291a2,'claudecode',_0xb7d72b);}
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class CodexAdapter {
|
|
5
|
-
target = "codex";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.description) {
|
|
9
|
-
diagnostics.push({
|
|
10
|
-
level: "error",
|
|
11
|
-
message: `[codex] ${manifest.name}: description is required.`
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return diagnostics;
|
|
15
|
-
}
|
|
16
|
-
async emit(manifest, outDir, force) {
|
|
17
|
-
if ((await pathExists(outDir)) && !force) {
|
|
18
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
19
|
-
}
|
|
20
|
-
if (force) {
|
|
21
|
-
await emptyDir(outDir);
|
|
22
|
-
}
|
|
23
|
-
await emitWithLayout(manifest, outDir, true, []);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export function codexSkillPath(baseOutDir, skillName) {
|
|
27
|
-
return path.join(baseOutDir, "codex", skillName);
|
|
28
|
-
}
|
|
1
|
+
function _0x3150(){const _0x471700=['988658eddGfG','63uQqZGr','51190sXXHGC','description','4943952KtvKZB',':\x20description\x20is\x20required.','64710aVDiYI','push','target','\x22\x20at\x20','1314089OrrHtu','name','50zjKmMu','join','validate','311908gxbPlu','emit','.\x20Use\x20--force\x20to\x20overwrite.','12HRuvad','4487812BmZNOv','45IwoUzo','codex','Target\x20already\x20exists\x20for\x20skill\x20\x22','error'];_0x3150=function(){return _0x471700;};return _0x3150();}function _0x269f(_0x5029ff,_0x1251ad){_0x5029ff=_0x5029ff-(-0x1*0x38f+-0x1d31+0x2209);const _0x42311f=_0x3150();let _0x4873ed=_0x42311f[_0x5029ff];return _0x4873ed;}const _0x5ec2da=_0x269f;(function(_0x34ea37,_0x60c25a){const _0x1a2dc4=_0x269f,_0x8848dc=_0x34ea37();while(!![]){try{const _0x292d59=parseInt(_0x1a2dc4(0x15d))/(-0x1*-0x16b5+-0x811+-0xea3*0x1)+parseInt(_0x1a2dc4(0x15f))/(0x135*-0x1d+-0x23e2+0x46e5)*(-parseInt(_0x1a2dc4(0x159))/(0xeb2+0xd61+-0x2*0xe08))+parseInt(_0x1a2dc4(0x14a))/(0x4*0x859+-0x535+0x1*-0x1c2b)*(-parseInt(_0x1a2dc4(0x14f))/(0xc37+0x8d4+-0x1a*0xcf))+parseInt(_0x1a2dc4(0x14d))/(0x13a*-0x10+-0xbe5+0x5f*0x55)*(parseInt(_0x1a2dc4(0x14e))/(0x1941+-0xb97+-0xda3))+-parseInt(_0x1a2dc4(0x157))/(-0x1*-0x13ae+-0x42e+-0xf78)+parseInt(_0x1a2dc4(0x154))/(-0xa7b*0x2+-0x1052+0x1*0x2551)*(parseInt(_0x1a2dc4(0x155))/(-0x7c+-0x9ba*-0x4+-0x2662))+-parseInt(_0x1a2dc4(0x153))/(-0x1003+0x1*0x1233+-0x225);if(_0x292d59===_0x60c25a)break;else _0x8848dc['push'](_0x8848dc['shift']());}catch(_0x41a63c){_0x8848dc['push'](_0x8848dc['shift']());}}}(_0x3150,0x17f76+-0x7b65*0x1e+0x67*0x3a21));import _0x17fabf from'node:path';import{emptyDir,pathExists}from'../../utils/fs.js';import{emitWithLayout}from'./shared.js';export class CodexAdapter{[_0x5ec2da(0x15b)]=_0x5ec2da(0x150);[_0x5ec2da(0x149)](_0x5d2826){const _0x53478d=_0x5ec2da,_0x142d9f=[];return!_0x5d2826[_0x53478d(0x156)]&&_0x142d9f[_0x53478d(0x15a)]({'level':_0x53478d(0x152),'message':'[codex]\x20'+_0x5d2826[_0x53478d(0x15e)]+_0x53478d(0x158)}),_0x142d9f;}async[_0x5ec2da(0x14b)](_0x25dac7,_0x2c6d92,_0x1332ae){const _0x529053=_0x5ec2da;if(await pathExists(_0x2c6d92)&&!_0x1332ae)throw new Error(_0x529053(0x151)+_0x25dac7[_0x529053(0x15e)]+_0x529053(0x15c)+_0x2c6d92+_0x529053(0x14c));_0x1332ae&&await emptyDir(_0x2c6d92),await emitWithLayout(_0x25dac7,_0x2c6d92,!![],[]);}}export function codexSkillPath(_0x3d9748,_0x4a0efa){const _0x7aac0d=_0x5ec2da;return _0x17fabf[_0x7aac0d(0x160)](_0x3d9748,_0x7aac0d(0x150),_0x4a0efa);}
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyDir, pathExists } from "../../utils/fs.js";
|
|
3
|
-
import { emitWithLayout } from "./shared.js";
|
|
4
|
-
export class IFlowAdapter {
|
|
5
|
-
target = "iflow";
|
|
6
|
-
validate(manifest) {
|
|
7
|
-
const diagnostics = [];
|
|
8
|
-
if (!manifest.description) {
|
|
9
|
-
diagnostics.push({
|
|
10
|
-
level: "warning",
|
|
11
|
-
message: `[iflow] ${manifest.name}: description is empty.`
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return diagnostics;
|
|
15
|
-
}
|
|
16
|
-
async emit(manifest, outDir, force) {
|
|
17
|
-
if ((await pathExists(outDir)) && !force) {
|
|
18
|
-
throw new Error(`Target already exists for skill "${manifest.name}" at ${outDir}. Use --force to overwrite.`);
|
|
19
|
-
}
|
|
20
|
-
if (force) {
|
|
21
|
-
await emptyDir(outDir);
|
|
22
|
-
}
|
|
23
|
-
const skillYaml = [
|
|
24
|
-
`name: "${manifest.name}"`,
|
|
25
|
-
`description: "${manifest.description.replace(/"/g, '\\"')}"`,
|
|
26
|
-
'entry: "prompt.md"'
|
|
27
|
-
].join("\n");
|
|
28
|
-
await emitWithLayout(manifest, outDir, false, [
|
|
29
|
-
{
|
|
30
|
-
relativePath: "prompt.md",
|
|
31
|
-
content: `# ${manifest.name}\n\n${manifest.body}\n`
|
|
32
|
-
},
|
|
33
|
-
{ relativePath: "iflow.skill.yaml", content: `${skillYaml}\n` }
|
|
34
|
-
]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export function iflowSkillPath(baseOutDir, skillName) {
|
|
38
|
-
return path.join(baseOutDir, "iflow", skillName);
|
|
39
|
-
}
|
|
1
|
+
const _0x3f1188=_0x3ea5;function _0x3ea5(_0x390eb8,_0xa7893b){_0x390eb8=_0x390eb8-(0x23e8+-0x1f*0xeb+-0x6c5*0x1);const _0x5cae66=_0x19e3();let _0x19206c=_0x5cae66[_0x390eb8];return _0x19206c;}(function(_0x307407,_0x12a3c0){const _0x222f9b=_0x3ea5,_0x4a20ae=_0x307407();while(!![]){try{const _0x1fe5a8=-parseInt(_0x222f9b(0xbb))/(0xd*0xc7+-0x1165+0x74b)+parseInt(_0x222f9b(0xb9))/(0xa8*-0xc+-0x21b*-0x2+0x3ac)+-parseInt(_0x222f9b(0xb4))/(0x168a+-0x1754*-0x1+0x2b*-0x111)+parseInt(_0x222f9b(0xc2))/(0x1*-0x778+-0x21bf+0x293b*0x1)+-parseInt(_0x222f9b(0xc5))/(-0x1638+0x13*-0x93+-0x1093*-0x2)+-parseInt(_0x222f9b(0xb1))/(0xa*0x194+-0x31+-0xf91)+parseInt(_0x222f9b(0xbf))/(0x39*-0x5f+0x246c+0x1*-0xf3e);if(_0x1fe5a8===_0x12a3c0)break;else _0x4a20ae['push'](_0x4a20ae['shift']());}catch(_0x24afe6){_0x4a20ae['push'](_0x4a20ae['shift']());}}}(_0x19e3,0x1*-0x4f563+0x36707+0xb879f));import _0x19206c from'node:path';import{emptyDir,pathExists}from'../../utils/fs.js';import{emitWithLayout}from'./shared.js';function _0x19e3(){const _0x5c29d4=['4642925hprpPq','description','prompt.md','body','7645770mLpgPx','join','name','1294275jyzRKP','\x22\x20at\x20','[iflow]\x20','push','Target\x20already\x20exists\x20for\x20skill\x20\x22','428582HWCADb','.\x20Use\x20--force\x20to\x20overwrite.','172703VEDYyf','name:\x20\x22','entry:\x20\x22prompt.md\x22','validate','22475887AvghqV',':\x20description\x20is\x20empty.','replace','142044FOaQJF','iflow','iflow.skill.yaml'];_0x19e3=function(){return _0x5c29d4;};return _0x19e3();}export class IFlowAdapter{['target']=_0x3f1188(0xc3);[_0x3f1188(0xbe)](_0x45562c){const _0x4e300c=_0x3f1188,_0x2fc45a=[];return!_0x45562c[_0x4e300c(0xae)]&&_0x2fc45a[_0x4e300c(0xb7)]({'level':'warning','message':_0x4e300c(0xb6)+_0x45562c['name']+_0x4e300c(0xc0)}),_0x2fc45a;}async['emit'](_0x14597e,_0x221ff0,_0x34e477){const _0x550c2f=_0x3f1188;if(await pathExists(_0x221ff0)&&!_0x34e477)throw new Error(_0x550c2f(0xb8)+_0x14597e[_0x550c2f(0xb3)]+_0x550c2f(0xb5)+_0x221ff0+_0x550c2f(0xba));_0x34e477&&await emptyDir(_0x221ff0);const _0x27c2ca=[_0x550c2f(0xbc)+_0x14597e[_0x550c2f(0xb3)]+'\x22','description:\x20\x22'+_0x14597e[_0x550c2f(0xae)][_0x550c2f(0xc1)](/"/g,'\x5c\x22')+'\x22',_0x550c2f(0xbd)][_0x550c2f(0xb2)]('\x0a');await emitWithLayout(_0x14597e,_0x221ff0,![],[{'relativePath':_0x550c2f(0xaf),'content':'#\x20'+_0x14597e[_0x550c2f(0xb3)]+'\x0a\x0a'+_0x14597e[_0x550c2f(0xb0)]+'\x0a'},{'relativePath':_0x550c2f(0xc4),'content':_0x27c2ca+'\x0a'}]);}}export function iflowSkillPath(_0x344c14,_0x1c64ca){const _0x1f972d=_0x3f1188;return _0x19206c['join'](_0x344c14,_0x1f972d(0xc3),_0x1c64ca);}
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { CodexAdapter } from "./codex-adapter.js";
|
|
3
|
-
import { IFlowAdapter } from "./iflow-adapter.js";
|
|
4
|
-
const adapters = {
|
|
5
|
-
codex: new CodexAdapter(),
|
|
6
|
-
claudecode: new ClaudeCodeAdapter(),
|
|
7
|
-
iflow: new IFlowAdapter()
|
|
8
|
-
};
|
|
9
|
-
export function getAdapter(target) {
|
|
10
|
-
return adapters[target];
|
|
11
|
-
}
|
|
12
|
-
export function expandTargets(raw) {
|
|
13
|
-
const value = raw.trim().toLowerCase();
|
|
14
|
-
if (value === "all")
|
|
15
|
-
return ["codex", "claudecode", "iflow"];
|
|
16
|
-
const parts = value
|
|
17
|
-
.split(",")
|
|
18
|
-
.map((item) => item.trim())
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.map(normalizeTargetAlias);
|
|
21
|
-
if (parts.length === 0) {
|
|
22
|
-
throw new Error(`Unknown target "${raw}". Use codex|claudecode|iflow|all.`);
|
|
23
|
-
}
|
|
24
|
-
const invalid = parts.filter((item) => item !== "codex" && item !== "claudecode" && item !== "iflow");
|
|
25
|
-
if (invalid.length > 0) {
|
|
26
|
-
throw new Error(`Unknown target "${invalid[0]}". Use codex|claudecode|iflow|all.`);
|
|
27
|
-
}
|
|
28
|
-
return Array.from(new Set(parts));
|
|
29
|
-
}
|
|
30
|
-
function normalizeTargetAlias(value) {
|
|
31
|
-
if (value === "ifow")
|
|
32
|
-
return "iflow";
|
|
33
|
-
return value;
|
|
34
|
-
}
|
|
1
|
+
(function(_0x56a47f,_0x3adfb3){const _0x162c35=_0x21c1,_0x44bb91=_0x56a47f();while(!![]){try{const _0x361c75=-parseInt(_0x162c35(0x15b))/(-0x15d6+0x1c80+-0x6a9)+-parseInt(_0x162c35(0x160))/(-0x288+-0x74f*-0x5+-0x2201)*(parseInt(_0x162c35(0x16c))/(0x1816+-0x4*-0x5f3+-0x2fdf))+parseInt(_0x162c35(0x15e))/(-0x3c7*-0x7+0x1*0x12ae+-0x2d1b)+parseInt(_0x162c35(0x163))/(-0x1*-0x50d+0xfa2+-0x14aa*0x1)+-parseInt(_0x162c35(0x161))/(0xab4+0x1c8c+-0x273a)+parseInt(_0x162c35(0x169))/(-0x625+0x7e5+-0x3f*0x7)+parseInt(_0x162c35(0x162))/(-0x187*-0x7+-0xf*-0xde+-0x49*0x53);if(_0x361c75===_0x3adfb3)break;else _0x44bb91['push'](_0x44bb91['shift']());}catch(_0xa1f31e){_0x44bb91['push'](_0x44bb91['shift']());}}}(_0x29a7,0x1*-0x278f8+-0x7a6a2+0x188f83));function _0x21c1(_0x1e71f7,_0x4c01bc){_0x1e71f7=_0x1e71f7-(-0x219a+-0x601+0x28f6);const _0x31ba94=_0x29a7();let _0x4f4905=_0x31ba94[_0x1e71f7];return _0x4f4905;}function _0x29a7(){const _0x171c86=['5982760jukXjW','trim','1275026rIyuJx','8962344zlOtnk','13811768MKaZGn','2047105xGPFqk','all','from','map','split','Unknown\x20target\x20\x22','3685290GYdgmu','claudecode','\x22.\x20Use\x20codex|claudecode|iflow|all.','6GHUuIk','443149wWVIuF','filter','iflow'];_0x29a7=function(){return _0x171c86;};return _0x29a7();}import{ClaudeCodeAdapter}from'./claudecode-adapter.js';import{CodexAdapter}from'./codex-adapter.js';import{IFlowAdapter}from'./iflow-adapter.js';const adapters={'codex':new CodexAdapter(),'claudecode':new ClaudeCodeAdapter(),'iflow':new IFlowAdapter()};export function getAdapter(_0x863310){return adapters[_0x863310];}export function expandTargets(_0x5cb9ec){const _0x1c326c=_0x21c1,_0x4e25de=_0x5cb9ec[_0x1c326c(0x15f)]()['toLowerCase']();if(_0x4e25de===_0x1c326c(0x164))return['codex',_0x1c326c(0x16a),_0x1c326c(0x15d)];const _0x37bae6=_0x4e25de[_0x1c326c(0x167)](',')[_0x1c326c(0x166)](_0x1ce5b6=>_0x1ce5b6['trim']())[_0x1c326c(0x15c)](Boolean)[_0x1c326c(0x166)](normalizeTargetAlias);if(_0x37bae6['length']===-0xd91+-0x5d*-0x32+-0x1*0x499)throw new Error(_0x1c326c(0x168)+_0x5cb9ec+_0x1c326c(0x16b));const _0xd988b0=_0x37bae6[_0x1c326c(0x15c)](_0x496a7c=>_0x496a7c!=='codex'&&_0x496a7c!=='claudecode'&&_0x496a7c!==_0x1c326c(0x15d));if(_0xd988b0['length']>0x18*-0xfb+0x1*0x96d+0xe1b)throw new Error(_0x1c326c(0x168)+_0xd988b0[-0xf87+0x1f8f*-0x1+-0x62*-0x7b]+_0x1c326c(0x16b));return Array[_0x1c326c(0x165)](new Set(_0x37bae6));}function normalizeTargetAlias(_0x519f5d){const _0x297ce8=_0x21c1;if(_0x519f5d==='ifow')return _0x297ce8(0x15d);return _0x519f5d;}
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { ensureDir, pathExists } from "../../utils/fs.js";
|
|
4
|
-
export async function emitWithLayout(manifest, outDir, includeOriginalSkillMd, generatedFiles) {
|
|
5
|
-
await ensureDir(outDir);
|
|
6
|
-
if (includeOriginalSkillMd) {
|
|
7
|
-
const srcSkillMd = path.join(manifest.sourcePath, "SKILL.md");
|
|
8
|
-
await copyFile(srcSkillMd, path.join(outDir, "SKILL.md"));
|
|
9
|
-
}
|
|
10
|
-
for (const file of generatedFiles) {
|
|
11
|
-
const targetFile = path.join(outDir, file.relativePath);
|
|
12
|
-
await ensureDir(path.dirname(targetFile));
|
|
13
|
-
await writeFile(targetFile, file.content, "utf8");
|
|
14
|
-
}
|
|
15
|
-
const folders = ["agents", "references", "scripts", "assets"];
|
|
16
|
-
for (const folder of folders) {
|
|
17
|
-
const sourceFolder = path.join(manifest.sourcePath, folder);
|
|
18
|
-
if (!(await pathExists(sourceFolder)))
|
|
19
|
-
continue;
|
|
20
|
-
await copyFolder(sourceFolder, path.join(outDir, folder));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function copyFolder(srcDir, dstDir) {
|
|
24
|
-
await ensureDir(dstDir);
|
|
25
|
-
const entries = await readdir(srcDir, { withFileTypes: true });
|
|
26
|
-
for (const entry of entries) {
|
|
27
|
-
const src = path.join(srcDir, entry.name);
|
|
28
|
-
const dst = path.join(dstDir, entry.name);
|
|
29
|
-
if (entry.isDirectory()) {
|
|
30
|
-
await copyFolder(src, dst);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
const data = await readFile(src);
|
|
34
|
-
await writeFile(dst, data);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
(function(_0x3d372d,_0x232efb){const _0x23873d=_0x2f8a,_0x37f1de=_0x3d372d();while(!![]){try{const _0x7c3f6e=-parseInt(_0x23873d(0x65))/(-0x757*0x3+-0x1f6c*0x1+0x3572)+parseInt(_0x23873d(0x69))/(-0xeed*-0x2+0x72+-0x1*0x1e4a)+parseInt(_0x23873d(0x76))/(-0x971+0x2*-0x302+0xf78)*(parseInt(_0x23873d(0x74))/(0x14b*-0x5+-0x6a9+-0x74*-0x1d))+-parseInt(_0x23873d(0x66))/(0x1c86+0x1ea8+-0x3b29)+parseInt(_0x23873d(0x6d))/(-0x1445+0x11aa+0x2a1)*(-parseInt(_0x23873d(0x72))/(0x1d*0x116+0x79d*-0x1+-0x17da))+-parseInt(_0x23873d(0x75))/(0x66b+-0xd26+0x6c3)+parseInt(_0x23873d(0x70))/(-0x22*-0xe9+-0x926*0x2+-0x1*0xc9d);if(_0x7c3f6e===_0x232efb)break;else _0x37f1de['push'](_0x37f1de['shift']());}catch(_0x2df19a){_0x37f1de['push'](_0x37f1de['shift']());}}}(_0x5df8,-0x7b338+0x544*0x448+-0x1223b));function _0x2f8a(_0xd2457d,_0x1e4f0a){_0xd2457d=_0xd2457d-(-0x1*0x915+-0x1018+0xbb*0x23);const _0x5d8413=_0x5df8();let _0x52fef1=_0x5d8413[_0xd2457d];return _0x52fef1;}import{copyFile,readFile,readdir,writeFile}from'node:fs/promises';import _0x52fef1 from'node:path';function _0x5df8(){const _0x2659c3=['content','35785746zxRvqq','scripts','226030HprQcN','join','4KClpxy','4787712hpLyir','1162677OMdYhr','assets','1319496SmaAcc','8736370IxPoxj','sourcePath','agents','3435176FDXQDm','SKILL.md','name','dirname','282WlcbVk','relativePath'];_0x5df8=function(){return _0x2659c3;};return _0x5df8();}import{ensureDir,pathExists}from'../../utils/fs.js';export async function emitWithLayout(_0x144ae4,_0x35a817,_0x3cfe2c,_0x2a6b80){const _0x2d68d4=_0x2f8a;await ensureDir(_0x35a817);if(_0x3cfe2c){const _0x51aba3=_0x52fef1[_0x2d68d4(0x73)](_0x144ae4[_0x2d68d4(0x67)],_0x2d68d4(0x6a));await copyFile(_0x51aba3,_0x52fef1[_0x2d68d4(0x73)](_0x35a817,_0x2d68d4(0x6a)));}for(const _0x19c07a of _0x2a6b80){const _0x1c4eac=_0x52fef1['join'](_0x35a817,_0x19c07a[_0x2d68d4(0x6e)]);await ensureDir(_0x52fef1[_0x2d68d4(0x6c)](_0x1c4eac)),await writeFile(_0x1c4eac,_0x19c07a[_0x2d68d4(0x6f)],'utf8');}const _0x42b33d=[_0x2d68d4(0x68),'references',_0x2d68d4(0x71),_0x2d68d4(0x64)];for(const _0x18a0d0 of _0x42b33d){const _0x7cba79=_0x52fef1[_0x2d68d4(0x73)](_0x144ae4[_0x2d68d4(0x67)],_0x18a0d0);if(!await pathExists(_0x7cba79))continue;await copyFolder(_0x7cba79,_0x52fef1[_0x2d68d4(0x73)](_0x35a817,_0x18a0d0));}}async function copyFolder(_0x284e35,_0x5241e8){const _0x4f19a3=_0x2f8a;await ensureDir(_0x5241e8);const _0x47b2c8=await readdir(_0x284e35,{'withFileTypes':!![]});for(const _0x43af6a of _0x47b2c8){const _0x5723ff=_0x52fef1[_0x4f19a3(0x73)](_0x284e35,_0x43af6a[_0x4f19a3(0x6b)]),_0x25d08f=_0x52fef1[_0x4f19a3(0x73)](_0x5241e8,_0x43af6a[_0x4f19a3(0x6b)]);if(_0x43af6a['isDirectory']()){await copyFolder(_0x5723ff,_0x25d08f);continue;}const _0x13f41b=await readFile(_0x5723ff);await writeFile(_0x25d08f,_0x13f41b);}}
|
|
@@ -1,63 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { parseFrontmatter } from "../utils/frontmatter.js";
|
|
4
|
-
import { listDirs, pathExists } from "../utils/fs.js";
|
|
5
|
-
const CODEX_DIR = ".codex";
|
|
6
|
-
export async function loadAllSkillManifests(cwd) {
|
|
7
|
-
const sourceRoot = path.join(cwd, CODEX_DIR);
|
|
8
|
-
const skillDirs = await listDirs(sourceRoot);
|
|
9
|
-
const manifests = [];
|
|
10
|
-
for (const dirName of skillDirs) {
|
|
11
|
-
const fullPath = path.join(sourceRoot, dirName);
|
|
12
|
-
const manifest = await loadSkillManifest(fullPath);
|
|
13
|
-
if (manifest)
|
|
14
|
-
manifests.push(manifest);
|
|
15
|
-
}
|
|
16
|
-
return manifests;
|
|
17
|
-
}
|
|
18
|
-
export async function loadSkillManifestByName(cwd, name) {
|
|
19
|
-
return loadSkillManifest(path.join(cwd, CODEX_DIR, name));
|
|
20
|
-
}
|
|
21
|
-
async function loadSkillManifest(skillDir) {
|
|
22
|
-
const skillMdPath = path.join(skillDir, "SKILL.md");
|
|
23
|
-
if (!(await pathExists(skillMdPath)))
|
|
24
|
-
return null;
|
|
25
|
-
const content = await readFile(skillMdPath, "utf8");
|
|
26
|
-
const parsed = parseFrontmatter(content);
|
|
27
|
-
const frontName = parsed.attributes.name?.trim();
|
|
28
|
-
const frontDescription = parsed.attributes.description?.trim();
|
|
29
|
-
const displayName = frontName || path.basename(skillDir);
|
|
30
|
-
const agents = await collectRelativeFiles(path.join(skillDir, "agents"), "agents");
|
|
31
|
-
const resources = await collectRelativeFiles(path.join(skillDir, "references"), "references");
|
|
32
|
-
const scripts = await collectRelativeFiles(path.join(skillDir, "scripts"), "scripts");
|
|
33
|
-
const assets = await collectRelativeFiles(path.join(skillDir, "assets"), "assets");
|
|
34
|
-
return {
|
|
35
|
-
name: displayName,
|
|
36
|
-
description: frontDescription || "",
|
|
37
|
-
body: parsed.body.trim(),
|
|
38
|
-
agents,
|
|
39
|
-
resources: [...resources, ...scripts, ...assets],
|
|
40
|
-
sourcePath: skillDir
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
async function collectRelativeFiles(dirPath, prefix) {
|
|
44
|
-
if (!(await pathExists(dirPath)))
|
|
45
|
-
return [];
|
|
46
|
-
const result = [];
|
|
47
|
-
await walk(dirPath, (absolutePath) => {
|
|
48
|
-
const relative = path.relative(path.dirname(dirPath), absolutePath);
|
|
49
|
-
result.push(relative.replaceAll("\\", "/").replace(`${prefix}/./`, `${prefix}/`));
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
async function walk(dirPath, onFile) {
|
|
54
|
-
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
55
|
-
for (const entry of entries) {
|
|
56
|
-
const absolute = path.join(dirPath, entry.name);
|
|
57
|
-
if (entry.isDirectory()) {
|
|
58
|
-
await walk(absolute, onFile);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
onFile(absolute);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
const _0x52a146=_0x15b3;(function(_0xcc5ac5,_0x49e206){const _0x576137=_0x15b3,_0x202e0f=_0xcc5ac5();while(!![]){try{const _0x2f066f=parseInt(_0x576137(0x156))/(0x5b1+0x31f*-0x1+-0x1*0x291)+parseInt(_0x576137(0x151))/(0x35d+-0x3*0xbe9+0x2060)+parseInt(_0x576137(0x15b))/(0x2*0xc1a+-0x4*0x623+0x1*0x5b)+parseInt(_0x576137(0x155))/(0x5e9+-0x5f+-0xe*0x65)+parseInt(_0x576137(0x14f))/(-0xae6+-0x1*-0xcb5+-0x2*0xe5)*(parseInt(_0x576137(0x14c))/(-0x4*-0x767+-0x1*-0x1096+-0x4*0xb8b))+parseInt(_0x576137(0x14d))/(0xb41*-0x1+0x1*-0x10df+0x1c27*0x1)*(parseInt(_0x576137(0x15d))/(0x75f+0x1aa3+-0x1*0x21fa))+-parseInt(_0x576137(0x152))/(0x2106+0x3*-0x94+-0x7*0x477);if(_0x2f066f===_0x49e206)break;else _0x202e0f['push'](_0x202e0f['shift']());}catch(_0x2410b2){_0x202e0f['push'](_0x202e0f['shift']());}}}(_0x58d8,-0x14*0xc9bf+0x9*-0x288c4+0x32c9d5));import{readdir,readFile}from'node:fs/promises';function _0x58d8(){const _0x364dbb=['4992rgAeDf','name','trim','agents','/./','body','attributes','relative','2501196kYbxcb','9107DCQTtO','join','5puwEik','push','1679850IUovLg','47700288NJOxwq','basename','scripts','5361348AfWoZQ','1304553hRnaxU','assets','dirname','utf8','.codex','4161900voYfLc','references'];_0x58d8=function(){return _0x364dbb;};return _0x58d8();}import _0x2e61ab from'node:path';import{parseFrontmatter}from'../utils/frontmatter.js';import{listDirs,pathExists}from'../utils/fs.js';const CODEX_DIR=_0x52a146(0x15a);export async function loadAllSkillManifests(_0x545981){const _0x386596=_0x52a146,_0x4dcfb4=_0x2e61ab['join'](_0x545981,CODEX_DIR),_0x1cbea0=await listDirs(_0x4dcfb4),_0x256a2d=[];for(const _0x81f554 of _0x1cbea0){const _0x485df0=_0x2e61ab['join'](_0x4dcfb4,_0x81f554),_0xf81644=await loadSkillManifest(_0x485df0);if(_0xf81644)_0x256a2d[_0x386596(0x150)](_0xf81644);}return _0x256a2d;}async function loadSkillManifest(_0x1c874b){const _0x17fe33=_0x52a146,_0x21707b=_0x2e61ab[_0x17fe33(0x14e)](_0x1c874b,'SKILL.md');if(!await pathExists(_0x21707b))return null;const _0x4137f1=await readFile(_0x21707b,_0x17fe33(0x159)),_0x265880=parseFrontmatter(_0x4137f1),_0x15ecfa=_0x265880[_0x17fe33(0x14a)][_0x17fe33(0x145)]?.['trim'](),_0x476c0d=_0x265880[_0x17fe33(0x14a)]['description']?.[_0x17fe33(0x146)](),_0x2ef52c=_0x15ecfa||_0x2e61ab[_0x17fe33(0x153)](_0x1c874b),_0x8470d8=await collectRelativeFiles(_0x2e61ab[_0x17fe33(0x14e)](_0x1c874b,_0x17fe33(0x147)),_0x17fe33(0x147)),_0x1aa86d=await collectRelativeFiles(_0x2e61ab[_0x17fe33(0x14e)](_0x1c874b,_0x17fe33(0x15c)),_0x17fe33(0x15c)),_0x8bed3=await collectRelativeFiles(_0x2e61ab[_0x17fe33(0x14e)](_0x1c874b,_0x17fe33(0x154)),_0x17fe33(0x154)),_0x5b7b20=await collectRelativeFiles(_0x2e61ab[_0x17fe33(0x14e)](_0x1c874b,_0x17fe33(0x157)),_0x17fe33(0x157));return{'name':_0x2ef52c,'description':_0x476c0d||'','body':_0x265880[_0x17fe33(0x149)]['trim'](),'agents':_0x8470d8,'resources':[..._0x1aa86d,..._0x8bed3,..._0x5b7b20],'sourcePath':_0x1c874b};}function _0x15b3(_0xeda6a6,_0x216d8a){_0xeda6a6=_0xeda6a6-(-0x97*0x19+0xc8*-0x9+0x2*0xb86);const _0x2e61ab=_0x58d8();let _0x545981=_0x2e61ab[_0xeda6a6];return _0x545981;}async function collectRelativeFiles(_0x14a6f3,_0x518a1a){if(!await pathExists(_0x14a6f3))return[];const _0x5e6dcf=[];return await walk(_0x14a6f3,_0x1f6142=>{const _0x36ac34=_0x15b3,_0xb234e8=_0x2e61ab[_0x36ac34(0x14b)](_0x2e61ab[_0x36ac34(0x158)](_0x14a6f3),_0x1f6142);_0x5e6dcf[_0x36ac34(0x150)](_0xb234e8['replaceAll']('\x5c','/')['replace'](_0x518a1a+_0x36ac34(0x148),_0x518a1a+'/'));}),_0x5e6dcf;}async function walk(_0x5ea29a,_0x53f819){const _0x2d9316=_0x52a146,_0x1a110c=await readdir(_0x5ea29a,{'withFileTypes':!![]});for(const _0x3a474e of _0x1a110c){const _0x4d142e=_0x2e61ab[_0x2d9316(0x14e)](_0x5ea29a,_0x3a474e[_0x2d9316(0x145)]);if(_0x3a474e['isDirectory']()){await walk(_0x4d142e,_0x53f819);continue;}_0x53f819(_0x4d142e);}}
|