chore: initial commit
This commit is contained in:
51
skills/test-cli2/SKILL.md
Normal file
51
skills/test-cli2/SKILL.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
name: test-cli2
|
||||
description: test
|
||||
version: 0.1.0
|
||||
author: sgclaw-skill-converter
|
||||
tags:
|
||||
- sgclaw
|
||||
- browser_script
|
||||
- converter
|
||||
---
|
||||
|
||||
# Use Cases
|
||||
- 输入 JS 脚本并生成可被 sgclaw 加载的技能包
|
||||
- 适配 browser_script 执行模型,优先返回结构化结果
|
||||
- 与运行时兼容,遵循 expected_domain 与 CSS 选择器约束
|
||||
|
||||
# Workflow
|
||||
1. 解析脚本参数与返回结构
|
||||
2. 生成 SKILL.toml 与 SKILL.md
|
||||
3. 保持 JS 逻辑原样,落盘到 scripts/<tool>.js
|
||||
4. 输出 references 与 assets 文档
|
||||
|
||||
# Runtime Contract
|
||||
- expected_domain: `www.example.com`
|
||||
- tool name: `extract_test_cli2`
|
||||
- tool description: test
|
||||
- args:
|
||||
- 无
|
||||
- kind: browser_script
|
||||
- command: scripts/extract_test_cli2.js
|
||||
|
||||
# Blocked-Page Rule
|
||||
- 遇到登录、验证码、权限不足时必须 throw Error,不得返回空数组或空对象。
|
||||
- 明确报错文案,例如:登录/验证码拦截/权限不足。
|
||||
|
||||
# Output Contract
|
||||
- structured-first:返回对象或对象数组,避免 getText 二次采集。
|
||||
- artifact_fields: [source sheet_name columns rows]
|
||||
- superrpa_browser 优先;使用 CSS 选择器,禁止 XPath 与 jQuery :contains
|
||||
|
||||
# Partial/Fallback Rule
|
||||
- blocked_page: 登录/验证码/反爬场景要抛错
|
||||
- partial_data: 数据不足要在注释或结果中说明
|
||||
|
||||
# References
|
||||
- `references/implementation-notes.md`
|
||||
- `assets/notes.md`
|
||||
|
||||
## 模式
|
||||
- preferred_mode: compact
|
||||
|
||||
12
skills/test-cli2/SKILL.toml
Normal file
12
skills/test-cli2/SKILL.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[skill]
|
||||
name = "test-cli2"
|
||||
description = "test"
|
||||
version = "0.1.0"
|
||||
author = "sgclaw-skill-converter"
|
||||
tags = ["sgclaw", "browser_script", "converter"]
|
||||
|
||||
[[tools]]
|
||||
name = "extract_test_cli2"
|
||||
description = "test"
|
||||
kind = "browser_script"
|
||||
command = "scripts/extract_test_cli2.js"
|
||||
6
skills/test-cli2/assets/notes.md
Normal file
6
skills/test-cli2/assets/notes.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## Asset Notes
|
||||
|
||||
- skill_name: test-cli2
|
||||
- expected_domain: www.example.com
|
||||
- mode: compact
|
||||
- 资源仅使用本地相对文档,不包含远程 markdown 链接。
|
||||
8
skills/test-cli2/references/implementation-notes.md
Normal file
8
skills/test-cli2/references/implementation-notes.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## Implementation Notes
|
||||
|
||||
- skill_name: test-cli2
|
||||
- tool: extract_test_cli2
|
||||
- args:
|
||||
- artifact_fields: source, sheet_name, columns, rows
|
||||
- generator: main.go
|
||||
- 说明: 保持脚本业务逻辑不变,仅包装与文档产出。
|
||||
1
skills/test-cli2/scripts/extract_test_cli2.js
Normal file
1
skills/test-cli2/scripts/extract_test_cli2.js
Normal file
@@ -0,0 +1 @@
|
||||
return { source: 'x', columns: ['a'], rows: [{a:1}], sheet_name: 'demo' };
|
||||
Reference in New Issue
Block a user