@wwkit/harness 1.0.33 → 1.0.35
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/LICENSE +21 -21
- package/README.md +128 -128
- package/agents/scrum.md +206 -186
- package/agents/sprint.md +130 -121
- package/bin/index.js +291 -226
- package/commands/fix.md +87 -87
- package/commands/git-sync.md +217 -217
- package/commands/net-port.md +364 -364
- package/commands/pytest.md +10 -10
- package/commands/resume.md +104 -104
- package/commands/tl.md +11 -11
- package/commands/tsl.md +12 -0
- package/package.json +5 -4
- package/plugin.js +19 -19
- package/readme/development.md +39 -39
- package/readme/publish.md +41 -41
- package/readme/testing.md +44 -44
- package/scripts/postinstall.js +58 -58
- package/skills/better-agents/SKILL.md +300 -0
- package/skills/better-agents/references/evidence-map.md +102 -0
- package/skills/better-agents/references/format-spec.md +91 -0
- package/skills/better-agents/references/section-template.md +116 -0
- package/skills/better-skill/SKILL.md +319 -124
- package/skills/better-skill/references/new-mode.md +126 -0
- package/skills/blame-agents/SKILL.md +270 -0
- package/skills/blame-agents/references/check-agents.js +364 -0
- package/skills/blame-agents/references/scoring-rules.md +259 -0
- package/skills/blame-skill/SKILL.md +163 -201
- package/skills/blame-skill/references/scoring-rules.md +190 -0
- package/skills/blame-sprint-agent/SKILL.md +172 -0
- package/skills/blame-sprint-agent/references/scoring-rules.md +113 -0
- package/skills/blame-sprint-skill/SKILL.md +165 -0
- package/skills/blame-sprint-skill/references/scoring-rules.md +101 -0
- package/skills/extract/SKILL.md +119 -119
- package/skills/extract/references/build-xpath.js +30 -30
- package/skills/extract/references/clean-html.js +90 -90
- package/skills/extract/references/detail.md +54 -54
- package/skills/extract/references/detail.schema.json5 +48 -48
- package/skills/extract/references/extract-detail.js +71 -71
- package/skills/extract/references/extract-regex.js +81 -81
- package/skills/extract/references/extract-sample.js +48 -48
- package/skills/extract/references/list-rule-gen.md +109 -109
- package/skills/extract/references/list.md +134 -134
- package/skills/extract/references/list.schema.json5 +33 -33
- package/skills/extract/references/navi.md +44 -44
- package/skills/extract/references/navi.schema.json5 +23 -23
- package/skills/extract/references/text.md +40 -40
- package/skills/extract/references/text.schema.json5 +21 -21
- package/skills/extract/references/to-text.js +20 -20
- package/skills/extract/references/validate-schema.js +39 -39
- package/skills/jstest/SKILL.md +561 -561
- package/skills/jstest/references/case-create.md +327 -327
- package/skills/jstest/references/case-fix.md +273 -273
- package/skills/jstest/references/config.md +148 -148
- package/skills/jstest/references/coverage-analyze.md +247 -247
- package/skills/jstest/references/env-ensure.md +210 -210
- package/skills/jstest/references/execute.md +168 -168
- package/skills/jstest/references/sample.md +166 -166
- package/skills/jstest/references/scoring-rules.md +75 -75
- package/skills/jstest/references/src/jstest-sample/Calculator.js +80 -80
- package/skills/jstest/references/src/jstest-sample/ConfigManager.js +72 -72
- package/skills/jstest/references/src/jstest-sample/FileProcessor.js +57 -57
- package/skills/jstest/references/src/jstest-sample/OrderService.js +98 -98
- package/skills/jstest/references/src/jstest-sample/TokenGenerator.js +60 -60
- package/skills/jstest/references/src/jstest-sample/UserService.js +56 -56
- package/skills/jstest/references/src/jstest-sample/index.js +6 -6
- package/skills/jstest/references/suitability-check.md +232 -232
- package/skills/jstest/references/test-standards.md +288 -288
- package/skills/lint/SKILL.md +440 -440
- package/skills/lint/references/ai-fix.md +137 -137
- package/skills/lint/references/config-setup.md +102 -102
- package/skills/lint/references/config.md +65 -65
- package/skills/lint/references/detect-language.js +65 -65
- package/skills/lint/references/env-ensure.md +88 -88
- package/skills/lint/references/language-detect.md +75 -75
- package/skills/lint/references/languages/js.md +110 -110
- package/skills/lint/references/languages/py.md +89 -89
- package/skills/lint/references/rules-analyze.md +125 -125
- package/skills/lint/references/suitability-check.md +81 -81
- package/skills/lint/references/tool-fix.md +90 -90
- package/skills/pytest/SKILL.md +555 -555
- package/skills/pytest/references/case-create.md +324 -324
- package/skills/pytest/references/case-fix.md +271 -271
- package/skills/pytest/references/config.md +145 -145
- package/skills/pytest/references/coverage-analyze.md +223 -223
- package/skills/pytest/references/env-ensure.md +195 -195
- package/skills/pytest/references/execute.md +152 -152
- package/skills/pytest/references/sample.md +159 -159
- package/skills/pytest/references/scoring-rules.md +57 -57
- package/skills/pytest/references/src/pytest-sample/Calculator.py +67 -67
- package/skills/pytest/references/src/pytest-sample/ConfigManager.py +68 -68
- package/skills/pytest/references/src/pytest-sample/FileProcessor.py +53 -53
- package/skills/pytest/references/src/pytest-sample/OrderService.py +82 -82
- package/skills/pytest/references/src/pytest-sample/TokenGenerator.py +50 -50
- package/skills/pytest/references/src/pytest-sample/UserService.py +45 -45
- package/skills/pytest/references/suitability-check.md +220 -220
- package/skills/pytest/references/test-standards.md +244 -244
- package/skills/query/SKILL.md +71 -71
- package/skills/read-docs/SKILL.md +134 -134
- package/skills/read-docs/references/opencode/agents/cases.md +206 -206
- package/skills/read-docs/references/opencode/agents/design-pattern.md +47 -47
- package/skills/read-docs/references/opencode/agents/detail.md +191 -191
- package/skills/read-docs/references/opencode/agents/examples.md +100 -100
- package/skills/read-docs/references/opencode/agents/index.md +309 -309
- package/skills/read-docs/references/opencode/agents/parallel-dispatch.md +149 -149
- package/skills/read-docs/references/opencode/agents/subagent-internals.md +217 -217
- package/skills/read-docs/references/opencode/agents/workflow.md +161 -161
- package/skills/read-docs/references/opencode/cli/commands/acp.md +31 -31
- package/skills/read-docs/references/opencode/cli/commands/agent.md +16 -16
- package/skills/read-docs/references/opencode/cli/commands/attach.md +20 -20
- package/skills/read-docs/references/opencode/cli/commands/mcp.md +37 -37
- package/skills/read-docs/references/opencode/cli/commands/others.md +48 -48
- package/skills/read-docs/references/opencode/cli/commands/plugin.md +12 -12
- package/skills/read-docs/references/opencode/cli/commands/provider.md +43 -43
- package/skills/read-docs/references/opencode/cli/commands/run.md +81 -81
- package/skills/read-docs/references/opencode/cli/commands/serve.md +84 -84
- package/skills/read-docs/references/opencode/cli/commands/session.md +37 -37
- package/skills/read-docs/references/opencode/cli/commands/web.md +14 -14
- package/skills/read-docs/references/opencode/cli/env.md +38 -38
- package/skills/read-docs/references/opencode/cli/index.md +18 -18
- package/skills/read-docs/references/opencode/cli/tui.md +35 -35
- package/skills/read-docs/references/opencode/commands/examples.md +42 -42
- package/skills/read-docs/references/opencode/commands/index.md +185 -185
- package/skills/read-docs/references/opencode/config/provider.md +151 -151
- package/skills/read-docs/references/opencode/formatter/index.md +70 -70
- package/skills/read-docs/references/opencode/guide/config.md +419 -419
- package/skills/read-docs/references/opencode/guide/formatters.md +70 -70
- package/skills/read-docs/references/opencode/guide/index.md +37 -37
- package/skills/read-docs/references/opencode/guide/providers.md +31 -31
- package/skills/read-docs/references/opencode/guide/rules.md +63 -63
- package/skills/read-docs/references/opencode/plugins/examples.md +75 -75
- package/skills/read-docs/references/opencode/plugins/index.md +188 -188
- package/skills/read-docs/references/opencode/reference/index.md +118 -118
- package/skills/read-docs/references/opencode/rule/index.md +77 -77
- package/skills/read-docs/references/opencode/skills/detail.md +113 -113
- package/skills/read-docs/references/opencode/skills/examples.md +141 -141
- package/skills/read-docs/references/opencode/skills/index.md +126 -126
- package/skills/read-docs/references/opencode/skills/workflow.md +146 -146
- package/skills/read-docs/references/opencode/tests/agent.md +9 -9
- package/skills/read-docs/references/opencode/tests/config.md +59 -59
- package/skills/read-docs/references/opencode/tests/file.md +11 -11
- package/skills/read-docs/references/opencode/tests/serve.md +17 -17
- package/skills/read-docs/references/opencode/tests/session.md +30 -30
- package/skills/read-docs/references/opencode/tests/web.md +16 -16
- package/skills/read-docs/references/opencode/tools/arguments.md +305 -305
- package/skills/read-docs/references/opencode/tools/context.md +17 -17
- package/skills/read-docs/references/opencode/tools/custom.md +110 -110
- package/skills/read-docs/references/opencode/tools/detail.md +104 -104
- package/skills/read-docs/references/opencode/tools/examples.md +71 -71
- package/skills/read-docs/references/opencode/tools/index.md +56 -56
- package/skills/read-docs/references/opencode/tools/lsp.md +25 -25
- package/skills/read-docs/references/opencode/tools/mcp.md +132 -132
- package/skills/read-docs/references/opencode/train/README.md +134 -134
- package/skills/read-docs/references/opencode/train/agent-basic.md +771 -771
- package/skills/read-docs/references/opencode/train/command-basic.md +667 -667
- package/skills/read-docs/references/opencode/train/config-basic.md +508 -508
- package/skills/read-docs/references/opencode/train/index.md +163 -163
- package/skills/read-docs/references/opencode/train/practice.md +872 -872
- package/skills/read-docs/references/opencode/train/skill-basic.md +607 -607
- package/skills/read-docs/references/opencode/tui/commands/config.md +31 -31
- package/skills/read-docs/references/opencode/tui/commands/editor.md +46 -46
- package/skills/read-docs/references/opencode/tui/commands/index.md +124 -124
- package/skills/read-docs/references/opencode/tui/commands/init.md +4 -4
- package/skills/read-docs/references/opencode/tui/index.md +26 -26
- package/skills/read-docs/references/superpowers/bootstrap.md +107 -107
- package/skills/read-docs/references/superpowers/comparison.md +77 -77
- package/skills/read-docs/references/superpowers/context.md +71 -71
- package/skills/read-docs/references/superpowers/index.md +58 -58
- package/skills/read-docs/references/superpowers/parallel.md +49 -49
- package/skills/read-docs/references/superpowers/sdd.md +183 -183
- package/skills/read-docs/references/superpowers/skills.md +68 -68
- package/skills/read-docs/references/superpowers/workflow.md +83 -83
- package/skills/revise/SKILL.md +121 -121
- package/skills/revise/references/article.md +36 -36
- package/skills/revise/references/article.schema.json5 +40 -40
- package/skills/revise/references/gallery.md +34 -34
- package/skills/revise/references/gallery.schema.json5 +40 -40
- package/skills/revise/references/question.md +32 -32
- package/skills/revise/references/question.schema.json5 +31 -31
- package/skills/revise/references/status.md +31 -31
- package/skills/revise/references/status.schema.json5 +27 -27
- package/skills/revise/references/validate-schema.js +39 -39
- package/skills/step-extract/SKILL.md +205 -0
- package/skills/tsl/SKILL.md +393 -0
- package/skills/tsl/package.json +10 -0
- package/skills/tsl/references/global-review-rules.md +25 -0
- package/skills/tsl/references/prepare-prompt.md +150 -0
- package/skills/tsl/references/terminology-rules.md +93 -0
- package/skills/tsl/references/translation-guide.md +23 -0
- package/skills/tsl/references/translation-prompt.md +115 -0
- package/skills/tsl/references/translation-rules.md +48 -0
- package/skills/tsl/references/verification-rules.md +58 -0
- package/skills/tsl/scripts/check-boundaries.js +140 -0
- package/skills/tsl/scripts/chunk-text.js +144 -0
- package/skills/tsl/scripts/clean-text.js +121 -0
- package/skills/tsl/scripts/cleanup-glossary.js +160 -0
- package/skills/tsl/scripts/extract-pdf.js +94 -0
- package/skills/tsl/scripts/generate-review.js +179 -0
- package/skills/tsl/scripts/merge-result.js +164 -0
- package/skills/tsl/scripts/verify-chunk.js +170 -0
- package/skills/tsl-format/SKILL.md +298 -0
- package/skills/tsl-format/references/format-prompt.md +103 -0
- package/skills/tsl-format/references/format-rules.md +58 -0
- package/skills/tsl-format/scripts/chunk-bilingual.js +96 -0
- package/skills/tsl-format/scripts/merge-format.js +105 -0
- package/src/config.js +29 -29
- package/src/config.json5 +19 -19
- package/skills/new-skill/SKILL.md +0 -227
- package/skills/new-skill/references/template.md +0 -53
- package/skills/new-skill/references/workflow-patterns.md +0 -104
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
-
"title": "图集格式",
|
|
4
|
-
"description": "社交媒体图集(gallery)输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
-
"type": "array",
|
|
6
|
-
"minItems": 1,
|
|
7
|
-
"items": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"properties": {
|
|
10
|
-
"title": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"description": "图集标题,10-30 字(cn_length)"
|
|
13
|
-
},
|
|
14
|
-
"images": {
|
|
15
|
-
"type": "array",
|
|
16
|
-
"description": "图片列表,1-50 张",
|
|
17
|
-
"minItems": 1,
|
|
18
|
-
"maxItems": 50,
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"url": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"format": "uri",
|
|
25
|
-
"description": "图片地址"
|
|
26
|
-
},
|
|
27
|
-
"title": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"description": "图片标题/简短说明,10-30 字(cn_length)"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"required": ["url", "title"],
|
|
33
|
-
"additionalProperties": false
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"required": ["title", "images"],
|
|
38
|
-
"additionalProperties": false
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
+
"title": "图集格式",
|
|
4
|
+
"description": "社交媒体图集(gallery)输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
+
"type": "array",
|
|
6
|
+
"minItems": 1,
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"title": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "图集标题,10-30 字(cn_length)"
|
|
13
|
+
},
|
|
14
|
+
"images": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"description": "图片列表,1-50 张",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"maxItems": 50,
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"url": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uri",
|
|
25
|
+
"description": "图片地址"
|
|
26
|
+
},
|
|
27
|
+
"title": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "图片标题/简短说明,10-30 字(cn_length)"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": ["url", "title"],
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": ["title", "images"],
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# 社交媒体风格问题(question)创作 Sprint
|
|
2
|
-
|
|
3
|
-
## Sprint Goal
|
|
4
|
-
|
|
5
|
-
产出 `{{count}}` 条适合社交媒体传播的问题内容,整体为 JSON 数组。
|
|
6
|
-
|
|
7
|
-
## Style(默认创作风格,可由 `style` 参数覆盖)
|
|
8
|
-
|
|
9
|
-
基于原始素材创作:
|
|
10
|
-
|
|
11
|
-
1. **标题尖锐**:有争议性、冲突点,能激发讨论欲和互动
|
|
12
|
-
2. **描述简洁**:说明背景,引出矛盾点,不要太长
|
|
13
|
-
|
|
14
|
-
## Format(输出契约,不可被 `style` 覆盖)
|
|
15
|
-
|
|
16
|
-
- **结构**:每 item = `title`(10-30 cn_length)+ `content`(20-500 cn_length)+ `images`(string[],≤5 张)
|
|
17
|
-
- **图片**:从素材提取图片地址,最多 5 张;素材无图片时为空数组
|
|
18
|
-
- **真实性**:从素材中提取核心矛盾点,不能凭空编造
|
|
19
|
-
- **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;仅输出数组,不包含任何解释、思考过程或额外文本,禁止输出单个对象
|
|
20
|
-
|
|
21
|
-
> 字数计算采用 **cn_length** 规则:中文字符算 1,非中文字符(英文/数字/符号)算 0.5,结果向上取整。
|
|
22
|
-
|
|
23
|
-
示例:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
[
|
|
27
|
-
{
|
|
28
|
-
"title": "为什么同样的努力,有人成功有人失败?",
|
|
29
|
-
"content": "在职场中发现,同样勤奋的两个人,结局却天差地别。差距到底在哪里?",
|
|
30
|
-
"images": ["https://example.com/pic1.jpg"]
|
|
31
|
-
}
|
|
32
|
-
]
|
|
1
|
+
# 社交媒体风格问题(question)创作 Sprint
|
|
2
|
+
|
|
3
|
+
## Sprint Goal
|
|
4
|
+
|
|
5
|
+
产出 `{{count}}` 条适合社交媒体传播的问题内容,整体为 JSON 数组。
|
|
6
|
+
|
|
7
|
+
## Style(默认创作风格,可由 `style` 参数覆盖)
|
|
8
|
+
|
|
9
|
+
基于原始素材创作:
|
|
10
|
+
|
|
11
|
+
1. **标题尖锐**:有争议性、冲突点,能激发讨论欲和互动
|
|
12
|
+
2. **描述简洁**:说明背景,引出矛盾点,不要太长
|
|
13
|
+
|
|
14
|
+
## Format(输出契约,不可被 `style` 覆盖)
|
|
15
|
+
|
|
16
|
+
- **结构**:每 item = `title`(10-30 cn_length)+ `content`(20-500 cn_length)+ `images`(string[],≤5 张)
|
|
17
|
+
- **图片**:从素材提取图片地址,最多 5 张;素材无图片时为空数组
|
|
18
|
+
- **真实性**:从素材中提取核心矛盾点,不能凭空编造
|
|
19
|
+
- **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;仅输出数组,不包含任何解释、思考过程或额外文本,禁止输出单个对象
|
|
20
|
+
|
|
21
|
+
> 字数计算采用 **cn_length** 规则:中文字符算 1,非中文字符(英文/数字/符号)算 0.5,结果向上取整。
|
|
22
|
+
|
|
23
|
+
示例:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
"title": "为什么同样的努力,有人成功有人失败?",
|
|
29
|
+
"content": "在职场中发现,同样勤奋的两个人,结局却天差地别。差距到底在哪里?",
|
|
30
|
+
"images": ["https://example.com/pic1.jpg"]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
33
|
```
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
-
"title": "社交媒体问题格式",
|
|
4
|
-
"description": "社交媒体风格问题的输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
-
"type": "array",
|
|
6
|
-
"minItems": 1,
|
|
7
|
-
"items": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"properties": {
|
|
10
|
-
"title": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"description": "问题标题,10-30 cn_length"
|
|
13
|
-
},
|
|
14
|
-
"content": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"description": "问题描述,20-500 cn_length"
|
|
17
|
-
},
|
|
18
|
-
"images": {
|
|
19
|
-
"type": "array",
|
|
20
|
-
"description": "问题图片地址列表,最多 5 张",
|
|
21
|
-
"items": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"format": "uri"
|
|
24
|
-
},
|
|
25
|
-
"maxItems": 5
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"required": ["title", "content", "images"],
|
|
29
|
-
"additionalProperties": false
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
+
"title": "社交媒体问题格式",
|
|
4
|
+
"description": "社交媒体风格问题的输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
+
"type": "array",
|
|
6
|
+
"minItems": 1,
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"title": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "问题标题,10-30 cn_length"
|
|
13
|
+
},
|
|
14
|
+
"content": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "问题描述,20-500 cn_length"
|
|
17
|
+
},
|
|
18
|
+
"images": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"description": "问题图片地址列表,最多 5 张",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"format": "uri"
|
|
24
|
+
},
|
|
25
|
+
"maxItems": 5
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": ["title", "content", "images"],
|
|
29
|
+
"additionalProperties": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# 社交媒体动态(status)创作 Sprint
|
|
2
|
-
|
|
3
|
-
## Sprint Goal
|
|
4
|
-
|
|
5
|
-
产出 `{{count}}` 条适合社交媒体传播的动态内容,整体为 JSON 数组。
|
|
6
|
-
|
|
7
|
-
## Style(默认创作风格,可由 `style` 参数覆盖)
|
|
8
|
-
|
|
9
|
-
基于原始素材创作:
|
|
10
|
-
|
|
11
|
-
1. **正文精炼**:短平快,提炼核心信息,避免大段照抄原文
|
|
12
|
-
2. **有观点、易互动**:口语化表达,带个人观点或情绪,能引发讨论和转发
|
|
13
|
-
|
|
14
|
-
## Format(输出契约,不可被 `style` 覆盖)
|
|
15
|
-
|
|
16
|
-
- **结构**:每 item = `content`(20-500 cn_length)+ `images`(string[],≤5 张)
|
|
17
|
-
- **图片**:从素材中提取图片地址,最多 5 张;素材无图片时为空数组
|
|
18
|
-
- **真实性**:从素材中提炼要点,不能凭空编造
|
|
19
|
-
- **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;仅输出数组,不包含任何解释、思考过程或额外文本,禁止输出单个对象
|
|
20
|
-
|
|
21
|
-
> 字数计算采用 **cn_length** 规则:中文字符算 1,非中文字符(英文/数字/符号)算 0.5,结果向上取整。
|
|
22
|
-
|
|
23
|
-
示例:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
[
|
|
27
|
-
{
|
|
28
|
-
"content": "三星二季度营业利润预计同比暴涨18倍,AI存储需求成最大推手,你怎么看?",
|
|
29
|
-
"images": ["https://example.com/pic1.jpg"]
|
|
30
|
-
}
|
|
31
|
-
]
|
|
1
|
+
# 社交媒体动态(status)创作 Sprint
|
|
2
|
+
|
|
3
|
+
## Sprint Goal
|
|
4
|
+
|
|
5
|
+
产出 `{{count}}` 条适合社交媒体传播的动态内容,整体为 JSON 数组。
|
|
6
|
+
|
|
7
|
+
## Style(默认创作风格,可由 `style` 参数覆盖)
|
|
8
|
+
|
|
9
|
+
基于原始素材创作:
|
|
10
|
+
|
|
11
|
+
1. **正文精炼**:短平快,提炼核心信息,避免大段照抄原文
|
|
12
|
+
2. **有观点、易互动**:口语化表达,带个人观点或情绪,能引发讨论和转发
|
|
13
|
+
|
|
14
|
+
## Format(输出契约,不可被 `style` 覆盖)
|
|
15
|
+
|
|
16
|
+
- **结构**:每 item = `content`(20-500 cn_length)+ `images`(string[],≤5 张)
|
|
17
|
+
- **图片**:从素材中提取图片地址,最多 5 张;素材无图片时为空数组
|
|
18
|
+
- **真实性**:从素材中提炼要点,不能凭空编造
|
|
19
|
+
- **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;仅输出数组,不包含任何解释、思考过程或额外文本,禁止输出单个对象
|
|
20
|
+
|
|
21
|
+
> 字数计算采用 **cn_length** 规则:中文字符算 1,非中文字符(英文/数字/符号)算 0.5,结果向上取整。
|
|
22
|
+
|
|
23
|
+
示例:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
"content": "三星二季度营业利润预计同比暴涨18倍,AI存储需求成最大推手,你怎么看?",
|
|
29
|
+
"images": ["https://example.com/pic1.jpg"]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
32
|
```
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
-
"title": "动态格式",
|
|
4
|
-
"description": "社交媒体动态(status)输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
-
"type": "array",
|
|
6
|
-
"minItems": 1,
|
|
7
|
-
"items": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"properties": {
|
|
10
|
-
"content": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"description": "动态正文,20-500 cn_length"
|
|
13
|
-
},
|
|
14
|
-
"images": {
|
|
15
|
-
"type": "array",
|
|
16
|
-
"description": "动态配图地址列表,最多 5 张,素材无图片时可为空",
|
|
17
|
-
"items": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"format": "uri"
|
|
20
|
-
},
|
|
21
|
-
"maxItems": 5
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"required": ["content", "images"],
|
|
25
|
-
"additionalProperties": false
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
|
|
3
|
+
"title": "动态格式",
|
|
4
|
+
"description": "社交媒体动态(status)输出校验 schema(数组,至少 1 个 item)",
|
|
5
|
+
"type": "array",
|
|
6
|
+
"minItems": 1,
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"content": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "动态正文,20-500 cn_length"
|
|
13
|
+
},
|
|
14
|
+
"images": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"description": "动态配图地址列表,最多 5 张,素材无图片时可为空",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "uri"
|
|
20
|
+
},
|
|
21
|
+
"maxItems": 5
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["content", "images"],
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import Ajv from 'ajv';
|
|
4
|
-
import json5 from 'json5';
|
|
5
|
-
|
|
6
|
-
const ajv = new Ajv({ strict: false, validateFormats: true });
|
|
7
|
-
ajv.addFormat('uri', /^[a-z][a-z0-9+.-]*:(\/\/)?[^\s]*$/i);
|
|
8
|
-
|
|
9
|
-
export function validateSchema(data, schemaPath) {
|
|
10
|
-
const schemaContent = readFileSync(schemaPath, 'utf-8');
|
|
11
|
-
let schema;
|
|
12
|
-
try {
|
|
13
|
-
schema = JSON.parse(schemaContent);
|
|
14
|
-
} catch {
|
|
15
|
-
schema = json5.parse(schemaContent);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const validate = ajv.compile(schema);
|
|
19
|
-
const valid = validate(data);
|
|
20
|
-
|
|
21
|
-
if (valid) return { valid: true, message: 'VALID' };
|
|
22
|
-
return { valid: false, message: 'INVALID: ' + (validate.errors?.[0]?.message || 'unknown error') };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function main() {
|
|
26
|
-
const chunks = [];
|
|
27
|
-
process.stdin.on('data', chunk => chunks.push(chunk));
|
|
28
|
-
process.stdin.on('end', () => {
|
|
29
|
-
try {
|
|
30
|
-
const input = JSON.parse(Buffer.concat(chunks).toString());
|
|
31
|
-
const result = validateSchema(input.data, input.schema_path);
|
|
32
|
-
console.log(result.message);
|
|
33
|
-
} catch (e) {
|
|
34
|
-
console.log('INVALID: ' + e.message);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default validateSchema;
|
|
1
|
+
import { fileURLToPath } from 'url';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import Ajv from 'ajv';
|
|
4
|
+
import json5 from 'json5';
|
|
5
|
+
|
|
6
|
+
const ajv = new Ajv({ strict: false, validateFormats: true });
|
|
7
|
+
ajv.addFormat('uri', /^[a-z][a-z0-9+.-]*:(\/\/)?[^\s]*$/i);
|
|
8
|
+
|
|
9
|
+
export function validateSchema(data, schemaPath) {
|
|
10
|
+
const schemaContent = readFileSync(schemaPath, 'utf-8');
|
|
11
|
+
let schema;
|
|
12
|
+
try {
|
|
13
|
+
schema = JSON.parse(schemaContent);
|
|
14
|
+
} catch {
|
|
15
|
+
schema = json5.parse(schemaContent);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const validate = ajv.compile(schema);
|
|
19
|
+
const valid = validate(data);
|
|
20
|
+
|
|
21
|
+
if (valid) return { valid: true, message: 'VALID' };
|
|
22
|
+
return { valid: false, message: 'INVALID: ' + (validate.errors?.[0]?.message || 'unknown error') };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function main() {
|
|
26
|
+
const chunks = [];
|
|
27
|
+
process.stdin.on('data', chunk => chunks.push(chunk));
|
|
28
|
+
process.stdin.on('end', () => {
|
|
29
|
+
try {
|
|
30
|
+
const input = JSON.parse(Buffer.concat(chunks).toString());
|
|
31
|
+
const result = validateSchema(input.data, input.schema_path);
|
|
32
|
+
console.log(result.message);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.log('INVALID: ' + e.message);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default validateSchema;
|
|
40
40
|
if (process.argv[1] === fileURLToPath(import.meta.url)) main();
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-extract
|
|
3
|
+
description: Use when extracting actionable execution steps from guidance/tutorial documents to create a verification checklist. Triggers on: step extraction from docs, guide-to-checklist conversion, tutorial step parsing, 执行步骤提取, 验证步骤生成, 指导文档步骤提取. Reads a document path or directory, extracts main execution steps with preserved links and commands, outputs a verification steps MD in the same directory with notes and related links at the bottom.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
workflow: sequential
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# step-extract 技能(固定 Sprint 冲刺)
|
|
10
|
+
|
|
11
|
+
自包含执行步骤提取器:输入文档路径或目录,从指导文档中提取主要执行步骤(安装命令、配置操作、验证流程等),在文档同目录下输出验证步骤实施 MD 文档。步骤中保留相关链接与命令片段便于直接参考,注意点和相关文档链接放在文档底部。调用方直接传原始任务消息即可,无需预处理。
|
|
12
|
+
|
|
13
|
+
## 执行范式
|
|
14
|
+
|
|
15
|
+
每次调用 = 一个固定 Sprint,三个事件:
|
|
16
|
+
|
|
17
|
+
1. **Sprint Planning**:解析入参 → 定义 Sprint Goal → todowrite 落固定 4 项 Sprint Backlog(每项带 DoD)
|
|
18
|
+
2. **Sprint Execution**:逐项执行,每项 = 执行 → 验证 DoD → todowrite 勾单 Done
|
|
19
|
+
3. **Sprint Review**:对照 Sprint Goal 验证 Increment(验证步骤 MD + 输出报告)
|
|
20
|
+
|
|
21
|
+
**Sprint Goal** = `从指导文档中提取主要执行步骤,在文档同目录下输出验证步骤实施 MD 文档`。
|
|
22
|
+
|
|
23
|
+
## 输入参数
|
|
24
|
+
|
|
25
|
+
入参为调用方传入的**原始任务消息**,可为 JSON 对象、key=value 或自然语言等任意形态,agent 依据字段语义自主提取。字段清单:
|
|
26
|
+
|
|
27
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `source` | string | ✅ | 文档路径或目录路径(绝对或相对路径),支持 `.md` 文件 |
|
|
30
|
+
|
|
31
|
+
## 适用 / 不适用
|
|
32
|
+
|
|
33
|
+
**适用**:
|
|
34
|
+
- 指导文档、教程文档、操作手册的执行步骤提取
|
|
35
|
+
- 需要快速了解文档中"要做什么"而非"为什么做"的场景
|
|
36
|
+
- 多文档批量提取(传入目录路径)
|
|
37
|
+
|
|
38
|
+
**不适用**:
|
|
39
|
+
- 纯概念性/理论性文档(无执行步骤)
|
|
40
|
+
- API 参考文档(非步骤型内容)
|
|
41
|
+
- 需要理解文档深层逻辑而非执行步骤的场景
|
|
42
|
+
|
|
43
|
+
## Quick Reference
|
|
44
|
+
|
|
45
|
+
| Item | 做什么 | 关键操作 |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| 1 | 解析输入 + 读取文档 | 提取 `source` 路径 → `read` 读取文档内容 |
|
|
48
|
+
| 2 | 提取执行步骤 | 过滤背景/图片/元数据 → 保留命令/链接 → 收集注意点 |
|
|
49
|
+
| 3 | 生成验证步骤 MD | `write` 写入 `<原文件名>-steps.md` 到文档同目录 |
|
|
50
|
+
| 4 | 验证输出 + 报告 | `read` 验证输出文件 → 输出提取报告 |
|
|
51
|
+
|
|
52
|
+
## 固定 Sprint Backlog(todowrite 落单,覆盖历史 todos)
|
|
53
|
+
|
|
54
|
+
1. 解析输入 + 读取文档 | DoD: 输入路径已解析、文档已读取、文档内容已加载到上下文
|
|
55
|
+
2. 提取执行步骤 | DoD: 主要执行步骤已提取并编号、命令/代码片段保留、相关链接保留在步骤中、注意点已收集
|
|
56
|
+
3. 生成验证步骤 MD | DoD: 验证步骤 MD 已生成、注意点和相关文档链接放在底部、文件已写入文档同目录
|
|
57
|
+
4. 验证输出 + 输出报告 | DoD: 输出文件已验证内容完整、提取报告已输出
|
|
58
|
+
|
|
59
|
+
## Sprint Execution
|
|
60
|
+
|
|
61
|
+
按固定 4 项逐项执行(勾单机制:进入前 todowrite 标记 in_progress,完成后验证 DoD 并标记 completed)。
|
|
62
|
+
|
|
63
|
+
### Item 1:解析输入 + 读取文档
|
|
64
|
+
|
|
65
|
+
从原始任务消息中提取 `source`(文档路径或目录路径)。
|
|
66
|
+
|
|
67
|
+
**短路规则(命中即结束):**
|
|
68
|
+
|
|
69
|
+
1. `source` 为空或仅含空白 → stderr 报错结束
|
|
70
|
+
2. 路径不存在 → stderr 报错结束
|
|
71
|
+
|
|
72
|
+
未短路时:
|
|
73
|
+
|
|
74
|
+
- 若 `source` 为**目录**:用 `bash ls` 列出目录下的 `.md` 文件,逐个处理(每个文件独立执行 Item 2-3)
|
|
75
|
+
- 若 `source` 为**文件**:直接处理该文件
|
|
76
|
+
- 用 `read` 工具读取文档完整内容
|
|
77
|
+
|
|
78
|
+
### Item 2:提取执行步骤
|
|
79
|
+
|
|
80
|
+
从文档内容中提取主要执行步骤。
|
|
81
|
+
|
|
82
|
+
**提取标准:**
|
|
83
|
+
|
|
84
|
+
| 内容类型 | 处理方式 |
|
|
85
|
+
|---|---|
|
|
86
|
+
| 安装命令、配置步骤、执行命令 | ✅ 提取为编号步骤 |
|
|
87
|
+
| 步骤中的 URL 链接 | ✅ 保留在对应步骤中 |
|
|
88
|
+
| 命令/代码片段 | ✅ 保留,用 ` ``` ` 代码块包裹 |
|
|
89
|
+
| 环境准备、测试验证等章节标题 | ✅ 保留为章节结构 |
|
|
90
|
+
| 背景说明、概念介绍 | ❌ 过滤 |
|
|
91
|
+
| 图片引用(`alt`、`image`) | ❌ 过滤 |
|
|
92
|
+
| 元数据(日期、浏览量、评论数) | ❌ 过滤 |
|
|
93
|
+
| 注意事项、提示、警告 | 收集到底部"注意点"节 |
|
|
94
|
+
|
|
95
|
+
**步骤组织规则:**
|
|
96
|
+
|
|
97
|
+
- 按文档原有章节结构组织步骤(保留 `##` / `###` 层级)
|
|
98
|
+
- 每个章节内步骤连续编号(1, 2, 3...)
|
|
99
|
+
- 步骤描述简洁:动作 + 对象(如"安装 AIDK-installer"、"clone Demo 项目")
|
|
100
|
+
- 命令紧跟步骤描述,用代码块包裹
|
|
101
|
+
- 链接以"参考链接:[URL]"格式附在步骤末尾
|
|
102
|
+
|
|
103
|
+
**注意点收集规则:**
|
|
104
|
+
|
|
105
|
+
- 识别文档中的提示性内容:含"非必须"、"建议"、"注意"、"注意点"等关键词
|
|
106
|
+
- 识别文档中的限制性说明:含"受...影响"、"有概率不成功"等
|
|
107
|
+
- 收集为列表,输出到底部"注意点"节
|
|
108
|
+
|
|
109
|
+
### Item 3:生成验证步骤 MD
|
|
110
|
+
|
|
111
|
+
生成验证步骤实施 MD 文档,用 `write` 工具写入文档同目录。
|
|
112
|
+
|
|
113
|
+
**输出文件名**:`<原文件名>-steps.md`(如 `guide.md` → `guide-steps.md`)
|
|
114
|
+
|
|
115
|
+
**输出文档结构:**
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# [原文档标题] - 验证步骤
|
|
119
|
+
|
|
120
|
+
> 来源:[原文件名]
|
|
121
|
+
|
|
122
|
+
## [章节1名称]
|
|
123
|
+
|
|
124
|
+
1. [步骤1描述]
|
|
125
|
+
```bash
|
|
126
|
+
[命令]
|
|
127
|
+
```
|
|
128
|
+
参考链接:[URL]
|
|
129
|
+
|
|
130
|
+
2. [步骤2描述]
|
|
131
|
+
...
|
|
132
|
+
|
|
133
|
+
## [章节2名称]
|
|
134
|
+
|
|
135
|
+
1. [步骤1描述]
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 注意点
|
|
141
|
+
|
|
142
|
+
- [注意点1]
|
|
143
|
+
- [注意点2]
|
|
144
|
+
|
|
145
|
+
## 相关文档链接
|
|
146
|
+
|
|
147
|
+
- [链接描述]:[URL]
|
|
148
|
+
- [链接描述]:[URL]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**底部内容规则:**
|
|
152
|
+
|
|
153
|
+
- **注意点**节:列出文档中的注意事项、提示、限制性说明
|
|
154
|
+
- **相关文档链接**节:列出文档中出现的所有参考性 URL(安装文档、下载链接、方案工具等),去重后列出
|
|
155
|
+
|
|
156
|
+
### Item 4:验证输出 + 输出报告
|
|
157
|
+
|
|
158
|
+
1. 用 `read` 工具读取生成的 MD 文件,验证内容完整
|
|
159
|
+
2. 输出提取报告:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
## 步骤提取报告:[文件名]
|
|
163
|
+
|
|
164
|
+
### 输出文件
|
|
165
|
+
- 路径:[输出文件路径]
|
|
166
|
+
- 行数:[行数] 行
|
|
167
|
+
|
|
168
|
+
### 提取统计
|
|
169
|
+
- 执行步骤:[N] 项
|
|
170
|
+
- 保留链接:[N] 个
|
|
171
|
+
- 注意点:[N] 条
|
|
172
|
+
- 相关文档链接:[N] 个
|
|
173
|
+
|
|
174
|
+
### 章节概览
|
|
175
|
+
1. [章节1]:[N] 步
|
|
176
|
+
2. [章节2]:[N] 步
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Common Mistakes
|
|
180
|
+
|
|
181
|
+
| 错误 | 修复方案 |
|
|
182
|
+
|---|---|
|
|
183
|
+
| 将背景说明提取为步骤 | 步骤必须是可执行的操作(含命令或具体操作),非描述性文字 |
|
|
184
|
+
| 将链接移到底部"相关文档链接" | 步骤中的链接保留在步骤中;底部仅放文档级参考链接 |
|
|
185
|
+
| 丢失命令/代码片段 | 所有命令和代码必须用代码块保留,不可省略 |
|
|
186
|
+
| 输出文件写入错误目录 | 必须写入 `source` 文档的同目录,非当前工作目录 |
|
|
187
|
+
| 未过滤图片引用 | `alt`、`image` 等纯图片标记必须过滤 |
|
|
188
|
+
|
|
189
|
+
## Sprint Review
|
|
190
|
+
|
|
191
|
+
本 skill 每次调用 = 无状态独立 Sprint,无跨轮次状态,故不进行 Retrospective。所有 Backlog Items 完成后:
|
|
192
|
+
|
|
193
|
+
- **对照 Sprint Goal 验证**:验证步骤 MD 是否已生成?是否从指导文档提取了主要执行步骤?是否在文档同目录下输出?步骤中是否保留了相关链接?注意点和相关文档链接是否放在底部?
|
|
194
|
+
- **验证 Increment**:本 skill 的 Increment = 验证步骤 MD + 输出报告,验证其已生成且内容完整。
|
|
195
|
+
|
|
196
|
+
## 约束
|
|
197
|
+
|
|
198
|
+
- 只处理已声明字段(`source`),忽略所有其他传入参数。
|
|
199
|
+
- **禁止使用 WebFetch 或任何网络请求**。
|
|
200
|
+
- 读文件用 `read` 工具;写文件用 `write` 工具;列目录用 `bash ls`。
|
|
201
|
+
- 输出文件必须写入 `source` 文档的同目录下,文件名格式为 `<原文件名>-steps.md`。
|
|
202
|
+
- 步骤中的相关链接必须保留在步骤中,不移动到底部。
|
|
203
|
+
- 注意点和相关文档链接放在文档底部。
|
|
204
|
+
- 过滤非步骤内容(背景说明、图片引用、元数据)。
|
|
205
|
+
- 目录输入时逐个文件处理,每个文件独立输出一个 `-steps.md`。
|