neo-skill 0.1.16 → 0.1.18

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.
Files changed (62) hide show
  1. package/.github/README.md +11 -0
  2. package/.shared/README.md +12 -0
  3. package/.shared/skill-creator/README.md +13 -0
  4. package/.shared/skill-creator/data/README.md +16 -0
  5. package/.shared/skill-creator/data_packs/README.md +80 -0
  6. package/.shared/skill-creator/data_packs/recipes/README.md +59 -0
  7. package/.shared/skill-creator/data_packs/recipes/index.json +18 -0
  8. package/.shared/skill-creator/data_packs/recipes/rss_to_email.json +114 -0
  9. package/.shared/skill-creator/data_packs/tools/README.md +66 -0
  10. package/.shared/skill-creator/data_packs/tools/beautifulsoup4.json +14 -0
  11. package/.shared/skill-creator/data_packs/tools/feedparser.json +14 -0
  12. package/.shared/skill-creator/data_packs/tools/index.json +26 -0
  13. package/.shared/skill-creator/data_packs/tools/requests.json +14 -0
  14. package/.shared/skill-creator/data_packs/tools/schedule.json +14 -0
  15. package/.shared/skill-creator/data_packs/universal/README.md +52 -0
  16. package/.shared/skill-creator/data_packs/universal/minimal_checklists/automation_basic.json +42 -0
  17. package/.shared/skill-creator/data_packs/universal/minimal_checklists/index.json +24 -0
  18. package/.shared/skill-creator/data_packs/universal/minimal_checklists/notification_basic.json +35 -0
  19. package/.shared/skill-creator/data_packs/universal/minimal_checklists/web_scraping_basic.json +42 -0
  20. package/.shared/skill-creator/data_packs/universal/output_packs/code_snippet.json +47 -0
  21. package/.shared/skill-creator/data_packs/universal/output_packs/generic.json +37 -0
  22. package/.shared/skill-creator/data_packs/universal/output_packs/index.json +36 -0
  23. package/.shared/skill-creator/data_packs/universal/output_packs/json_result.json +53 -0
  24. package/.shared/skill-creator/data_packs/universal/output_packs/markdown_report.json +47 -0
  25. package/.shared/skill-creator/data_packs/universal/output_packs/plain_text_message.json +53 -0
  26. package/.shared/skill-creator/data_packs/universal/questions.level1.json +81 -0
  27. package/.shared/skill-creator/data_packs/universal/schema.skill.json +49 -0
  28. package/.shared/skill-creator/scripts/README.md +15 -0
  29. package/README.md +38 -18
  30. package/bin/README.md +13 -0
  31. package/package.json +2 -3
  32. package/skills/README.md +15 -0
  33. package/skills/review-gate/README.md +12 -0
  34. package/skills/review-gate/references/README.md +11 -0
  35. package/skills/skill-creator/README.md +13 -0
  36. package/skills/skill-creator/references/README.md +12 -0
  37. package/skills/skill-creator/scripts/README.md +11 -0
  38. package/src/README.md +13 -0
  39. package/src/omni_skill/README.md +58 -0
  40. package/src/omni_skill/cli.py +98 -3
  41. package/src/skill_creator/README.md +21 -0
  42. package/src/skill_creator/core/README.md +69 -0
  43. package/src/skill_creator/core/__init__.py +50 -0
  44. package/src/skill_creator/core/builder.py +193 -0
  45. package/src/skill_creator/core/engine.py +253 -0
  46. package/src/skill_creator/core/interview.py +293 -0
  47. package/src/skill_creator/core/orchestrator.py +225 -0
  48. package/src/skill_creator/core/router.py +137 -0
  49. package/src/skill_creator/core/search.py +166 -0
  50. package/src/skill_creator/core/types.py +434 -0
  51. package/src/skill_creator/core/validator.py +219 -0
  52. package/src/skill_creator/packaging/README.md +12 -0
  53. package/src/skill_creator/providers/README.md +73 -0
  54. package/src/skill_creator/providers/__init__.py +14 -0
  55. package/src/skill_creator/providers/base.py +35 -0
  56. package/src/skill_creator/providers/checklist_provider.py +109 -0
  57. package/src/skill_creator/providers/recipe_provider.py +70 -0
  58. package/src/skill_creator/providers/tool_catalog_provider.py +72 -0
  59. package/src/skill_creator/spec/README.md +13 -0
  60. package/src/skill_creator/targets/README.md +15 -0
  61. package/src/skill_creator/util/README.md +12 -0
  62. package/bin/skill-creator.js +0 -33
@@ -0,0 +1,11 @@
1
+ # .github
2
+
3
+ 本目录存放 GitHub 相关配置。
4
+
5
+ ## 包含内容
6
+
7
+ - **workflows/**:GitHub Actions 工作流(CI/CD)。
8
+
9
+ ## 约定
10
+
11
+ - 仅存放 GitHub 平台所需配置文件;与核心功能无关的文档不要放在此处。
@@ -0,0 +1,12 @@
1
+ # .shared
2
+
3
+ 本目录存放跨技能复用的共享资源(shared assets),用于降低重复、保持各技能的一致性。
4
+
5
+ ## 包含内容
6
+
7
+ - **skill-creator/**:skill-creator 的共享核心资源(数据索引与确定性脚本)。
8
+
9
+ ## 约定
10
+
11
+ - 放在 `.shared/` 下的内容应尽量具备可复用性、稳定性与可维护性。
12
+ - 避免放置一次性生成物或体积过大的文件(生成物应落在目标平台目录或 `dist/` 等输出目录)。
@@ -0,0 +1,13 @@
1
+ # .shared/skill-creator
2
+
3
+ 本目录存放跨技能复用的 **skill-creator 核心资源**(会被 `omni-skill` 同步到使用方仓库)。
4
+
5
+ ## 包含内容
6
+
7
+ - **data/**:结构化索引数据(CSV/JSON),供搜索与校验使用。
8
+ - **scripts/**:确定性工具脚本(搜索、生成、校验、打包)。
9
+
10
+ ## 约定
11
+
12
+ - 该目录是 `.shared/` 下的例外:需要纳入版本控制并保持稳定。
13
+ - 不要在这里放一次性生成物或大体积文件。
@@ -0,0 +1,16 @@
1
+ # .shared/skill-creator/data
2
+
3
+ 本目录存放 `skill-creator` 使用的结构化数据索引。
4
+
5
+ ## 文件类型
6
+
7
+ - **domains.json**:定义 domain/stack 到数据文件的映射与描述。
8
+ - **\*.csv**:各类模式库与规则库(workflow/output/trigger/resource/validation 等)。
9
+
10
+ ## 用途
11
+
12
+ - 被 `.shared/skill-creator/scripts/search.py` 与 `validate.py` 等脚本读取。
13
+
14
+ ## 约定
15
+
16
+ - 数据应保持字段稳定、可增量扩展;修改字段需同步更新脚本解析逻辑。
@@ -0,0 +1,80 @@
1
+ # Data Packs
2
+
3
+ 数据包目录,包含 skill-creator 的所有数据资源。
4
+
5
+ ## 目录结构
6
+
7
+ ```
8
+ data_packs/
9
+ ├── universal/ # 必需数据包(不可删除)
10
+ │ ├── questions.level1.json
11
+ │ ├── schema.skill.json
12
+ │ ├── output_packs/
13
+ │ └── minimal_checklists/
14
+ ├── recipes/ # 可选:蓝图库
15
+ ├── tools/ # 可选:库推荐库
16
+ ├── domains/ # 可选:领域知识(待扩展)
17
+ ├── tasks/ # 可选:任务模式(待扩展)
18
+ ├── checklists_ext/ # 可选:扩展 checklist(待扩展)
19
+ ├── acceptance_templates/ # 可选:验收模板(待扩展)
20
+ └── profiles/ # 可选:环境 profile(待扩展)
21
+ ```
22
+
23
+ ## 数据包说明
24
+
25
+ ### universal/(必需)
26
+ 核心数据包,包含:
27
+ - **questions.level1.json**: Level 1 固定问题集(5-7问)
28
+ - **schema.skill.json**: Skill 输出的 schema 定义
29
+ - **output_packs/**: 5 个输出格式包(plain_text_message, markdown_report, json_result, code_snippet, generic)
30
+ - **minimal_checklists/**: 3 个基本 checklist(automation_basic, web_scraping_basic, notification_basic)
31
+
32
+ ### recipes/(可选)
33
+ 成熟方案蓝图库,每个 recipe 包含:
34
+ - workflow_steps: 步骤序列
35
+ - recommended_libraries: 推荐库栈
36
+ - config_keys: 配置键
37
+ - acceptance_template: 验收模板
38
+
39
+ ### tools/(可选)
40
+ 第三方库推荐库,每个 tool 包含:
41
+ - purpose: 用途说明
42
+ - reason: 推荐理由
43
+ - pypi_link + docs_link: 文档链接
44
+ - minimal_usage_notes: 最小使用说明(10-20行)
45
+
46
+ ## 扩展方式
47
+
48
+ ### 添加新 Recipe
49
+ 1. 在 `recipes/` 下创建 `{recipe_id}.json`
50
+ 2. 更新 `recipes/index.json`
51
+ 3. 无需修改代码
52
+
53
+ ### 添加新 Tool
54
+ 1. 在 `tools/` 下创建 `{tool_id}.json`
55
+ 2. 更新 `tools/index.json`
56
+ 3. 无需修改代码
57
+
58
+ ## 索引文件格式
59
+
60
+ 所有 `index.json` 遵循统一格式:
61
+
62
+ ```json
63
+ {
64
+ "version": "1.0",
65
+ "description": "...",
66
+ "items": {
67
+ "item_id": {
68
+ "file": "item_file.json",
69
+ "task_types": ["..."],
70
+ "tags": ["..."],
71
+ "keywords": ["..."]
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ## 相关文档
78
+
79
+ - [重构设计文档](../../../docs/skill-creator-refactoring/README.md)
80
+ - [端到端演示](../../../docs/skill-creator-refactoring/END_TO_END_DEMO.md)
@@ -0,0 +1,59 @@
1
+ # Recipes(蓝图库)
2
+
3
+ 可选增强数据包,提供成熟方案骨架。
4
+
5
+ ## 当前 Recipes
6
+
7
+ ### rss_to_email
8
+ 抓取 RSS/Atom feed 并发送邮件通知的成熟方案。
9
+
10
+ **适用场景**:
11
+ - task_types: rss_monitoring, notification, scheduled_task
12
+ - tags: rss, email_smtp, scheduler_local
13
+
14
+ **包含内容**:
15
+ - 4 步 workflow(fetch_feed → filter_new → format_email → send_email)
16
+ - 推荐库栈(feedparser, smtplib, schedule)
17
+ - 配置键(feed_url, email_to, smtp_server 等)
18
+ - 验收模板(3条)
19
+ - 假设和风险清单
20
+
21
+ ## Recipe 文件结构
22
+
23
+ ```json
24
+ {
25
+ "id": "recipe_id",
26
+ "name": "Recipe Name",
27
+ "description": "...",
28
+ "task_types": ["..."],
29
+ "tags": ["..."],
30
+ "workflow_steps": [...],
31
+ "recommended_libraries": [...],
32
+ "config_keys": [...],
33
+ "acceptance_template": [...],
34
+ "assumptions": [...],
35
+ "risks": [...]
36
+ }
37
+ ```
38
+
39
+ ## 添加新 Recipe
40
+
41
+ 1. 创建 `{recipe_id}.json` 文件
42
+ 2. 更新 `index.json`,添加索引条目:
43
+ ```json
44
+ {
45
+ "recipe_id": {
46
+ "file": "recipe_id.json",
47
+ "task_types": ["..."],
48
+ "tags": ["..."],
49
+ "keywords": ["..."]
50
+ }
51
+ }
52
+ ```
53
+ 3. 无需修改代码,系统会自动检索
54
+
55
+ ## 设计原则
56
+
57
+ - **成熟验证**: 只添加经过验证的方案
58
+ - **完整性**: 包含完整的 workflow + libraries + config
59
+ - **可选性**: Recipe 缺失时安全降级为 generic recipe
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": "1.0",
3
+ "description": "Recipe/Blueprint 索引(可选增强)",
4
+ "items": {
5
+ "rss_to_email": {
6
+ "file": "rss_to_email.json",
7
+ "task_types": ["rss_monitoring", "notification", "scheduled_task"],
8
+ "tags": ["rss", "email_smtp", "scheduler_local"],
9
+ "keywords": ["rss", "feed", "email", "notify", "daily"]
10
+ },
11
+ "web_scrape_report": {
12
+ "file": "web_scrape_report.json",
13
+ "task_types": ["web_scraping", "report_generation"],
14
+ "tags": ["http_fetch", "html_parse", "markdown", "report_gen"],
15
+ "keywords": ["scrape", "web", "report", "summary"]
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "id": "rss_to_email",
3
+ "name": "RSS Feed to Email",
4
+ "description": "抓取 RSS/Atom feed 并发送邮件通知的成熟方案",
5
+ "task_types": ["rss_monitoring", "notification", "scheduled_task"],
6
+ "tags": ["rss", "email_smtp", "scheduler_local"],
7
+ "workflow_steps": [
8
+ {
9
+ "id": "fetch_feed",
10
+ "title": "抓取 RSS Feed",
11
+ "kind": "action",
12
+ "description": "使用 feedparser 解析 RSS/Atom feed",
13
+ "commands": [],
14
+ "notes": "处理网络超时、解析错误、空 feed 等情况"
15
+ },
16
+ {
17
+ "id": "filter_new",
18
+ "title": "过滤新条目",
19
+ "kind": "action",
20
+ "description": "与上次抓取结果对比,找出新条目",
21
+ "commands": [],
22
+ "notes": "需要持久化上次抓取的条目 ID 或时间戳"
23
+ },
24
+ {
25
+ "id": "format_email",
26
+ "title": "格式化邮件内容",
27
+ "kind": "action",
28
+ "description": "将新条目格式化为邮件正文",
29
+ "commands": [],
30
+ "notes": "包含标题、链接、摘要、发布时间"
31
+ },
32
+ {
33
+ "id": "send_email",
34
+ "title": "发送邮件",
35
+ "kind": "action",
36
+ "description": "通过 SMTP 发送邮件",
37
+ "commands": [],
38
+ "notes": "处理发送失败、凭证错误等情况"
39
+ }
40
+ ],
41
+ "recommended_libraries": [
42
+ {
43
+ "name": "feedparser",
44
+ "purpose": "解析 RSS/Atom feed",
45
+ "reason": "成熟稳定,支持多种 feed 格式",
46
+ "pypi_link": "https://pypi.org/project/feedparser/",
47
+ "docs_link": "https://feedparser.readthedocs.io/",
48
+ "fallback": "使用 requests + xml.etree.ElementTree 手动解析"
49
+ },
50
+ {
51
+ "name": "smtplib",
52
+ "purpose": "发送邮件",
53
+ "reason": "Python 内置库,无需额外依赖",
54
+ "pypi_link": "https://docs.python.org/3/library/smtplib.html",
55
+ "docs_link": "https://docs.python.org/3/library/smtplib.html",
56
+ "builtin": true
57
+ }
58
+ ],
59
+ "config_keys": [
60
+ {
61
+ "key": "feed_url",
62
+ "description": "RSS feed URL",
63
+ "required": true,
64
+ "example": "https://example.com/feed.xml"
65
+ },
66
+ {
67
+ "key": "email_to",
68
+ "description": "收件人邮箱",
69
+ "required": true,
70
+ "example": "user@example.com"
71
+ },
72
+ {
73
+ "key": "email_from",
74
+ "description": "发件人邮箱",
75
+ "required": true,
76
+ "example": "bot@example.com"
77
+ },
78
+ {
79
+ "key": "smtp_server",
80
+ "description": "SMTP 服务器地址",
81
+ "required": true,
82
+ "example": "smtp.gmail.com"
83
+ },
84
+ {
85
+ "key": "smtp_port",
86
+ "description": "SMTP 端口",
87
+ "required": false,
88
+ "default": "587"
89
+ },
90
+ {
91
+ "key": "state_file",
92
+ "description": "状态文件路径(记录已发送条目)",
93
+ "required": false,
94
+ "default": ".rss_state.json"
95
+ }
96
+ ],
97
+ "acceptance_template": [
98
+ "成功抓取 feed 并解析出条目",
99
+ "只发送新条目,不重复发送",
100
+ "feed 无新条目时不发送邮件",
101
+ "feed 抓取失败时记录错误但不崩溃",
102
+ "邮件发送失败时记录错误"
103
+ ],
104
+ "assumptions": [
105
+ "可以联网访问 RSS feed",
106
+ "有可用的 SMTP 服务器",
107
+ "可以在本地写入状态文件"
108
+ ],
109
+ "risks": [
110
+ "feed 格式变化可能导致解析失败",
111
+ "SMTP 凭证过期或被封禁",
112
+ "状态文件损坏导致重复发送"
113
+ ]
114
+ }
@@ -0,0 +1,66 @@
1
+ # Tools(库推荐库)
2
+
3
+ 可选增强数据包,提供第三方库推荐信息。
4
+
5
+ ## 当前 Tools
6
+
7
+ ### feedparser
8
+ - **用途**: 解析 RSS/Atom feed
9
+ - **理由**: 成熟稳定,支持多种 feed 格式
10
+ - **链接**: [PyPI](https://pypi.org/project/feedparser/) | [Docs](https://feedparser.readthedocs.io/)
11
+
12
+ ### requests
13
+ - **用途**: 发起 HTTP 请求
14
+ - **理由**: Python 最流行的 HTTP 库,API 简洁
15
+ - **链接**: [PyPI](https://pypi.org/project/requests/) | [Docs](https://requests.readthedocs.io/)
16
+
17
+ ### beautifulsoup4
18
+ - **用途**: 解析 HTML/XML
19
+ - **理由**: 最流行的 HTML 解析库,容错性强
20
+ - **链接**: [PyPI](https://pypi.org/project/beautifulsoup4/) | [Docs](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
21
+
22
+ ### schedule
23
+ - **用途**: 简单的任务调度
24
+ - **理由**: 轻量级,API 简洁
25
+ - **链接**: [PyPI](https://pypi.org/project/schedule/) | [Docs](https://schedule.readthedocs.io/)
26
+
27
+ ## Tool 文件结构
28
+
29
+ ```json
30
+ {
31
+ "id": "tool_id",
32
+ "name": "tool_name",
33
+ "purpose": "用途说明",
34
+ "reason": "推荐理由",
35
+ "pypi_link": "https://pypi.org/project/...",
36
+ "docs_link": "https://...",
37
+ "github_link": "https://github.com/...",
38
+ "minimal_usage_notes": "简短使用说明(10-20行)",
39
+ "fallback": "零依赖/离线替代方案",
40
+ "tags": ["..."],
41
+ "stability": "high|medium|low",
42
+ "last_updated": "2023"
43
+ }
44
+ ```
45
+
46
+ ## 添加新 Tool
47
+
48
+ 1. 创建 `{tool_id}.json` 文件
49
+ 2. 更新 `index.json`,添加索引条目:
50
+ ```json
51
+ {
52
+ "tool_id": {
53
+ "file": "tool_id.json",
54
+ "tags": ["..."],
55
+ "keywords": ["..."]
56
+ }
57
+ }
58
+ ```
59
+ 3. 无需修改代码,系统会自动检索
60
+
61
+ ## 设计原则
62
+
63
+ - **链接优先**: 提供 PyPI + Docs 链接,不拉取 README
64
+ - **微摘要**: minimal_usage_notes 控制在 10-20 行
65
+ - **稳定性**: 优先推荐成熟稳定的库
66
+ - **Fallback**: 提供零依赖/离线替代方案
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "beautifulsoup4",
3
+ "name": "beautifulsoup4",
4
+ "purpose": "解析 HTML/XML",
5
+ "reason": "最流行的 HTML 解析库,容错性强,API 简洁",
6
+ "pypi_link": "https://pypi.org/project/beautifulsoup4/",
7
+ "docs_link": "https://www.crummy.com/software/BeautifulSoup/bs4/doc/",
8
+ "github_link": "https://code.launchpad.net/beautifulsoup",
9
+ "minimal_usage_notes": "from bs4 import BeautifulSoup\nsoup = BeautifulSoup(html, 'html.parser')\ntitle = soup.find('h1').text\nlinks = [a['href'] for a in soup.find_all('a')]\n# 支持 CSS 选择器: soup.select('.class')\n# 容错性强,可处理不规范的 HTML",
10
+ "fallback": "使用 html.parser (Python 内置) 或 lxml",
11
+ "tags": ["html_parse"],
12
+ "stability": "high",
13
+ "last_updated": "2023"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "feedparser",
3
+ "name": "feedparser",
4
+ "purpose": "解析 RSS/Atom feed",
5
+ "reason": "成熟稳定,支持多种 feed 格式,自动处理编码和格式差异",
6
+ "pypi_link": "https://pypi.org/project/feedparser/",
7
+ "docs_link": "https://feedparser.readthedocs.io/",
8
+ "github_link": "https://github.com/kurtmckee/feedparser",
9
+ "minimal_usage_notes": "import feedparser\nfeed = feedparser.parse('http://example.com/feed.xml')\nfor entry in feed.entries:\n print(entry.title, entry.link)\n# 自动处理编码、日期解析、多种 feed 格式\n# 返回统一的数据结构,无需关心 RSS vs Atom 差异",
10
+ "fallback": "使用 requests + xml.etree.ElementTree 手动解析 XML",
11
+ "tags": ["rss", "xml_parse"],
12
+ "stability": "high",
13
+ "last_updated": "2023"
14
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "version": "1.0",
3
+ "description": "Tool Catalog 索引(库推荐库,可选增强)",
4
+ "items": {
5
+ "feedparser": {
6
+ "file": "feedparser.json",
7
+ "tags": ["rss", "xml_parse"],
8
+ "keywords": ["rss", "atom", "feed", "parse"]
9
+ },
10
+ "requests": {
11
+ "file": "requests.json",
12
+ "tags": ["http_fetch"],
13
+ "keywords": ["http", "request", "api", "fetch"]
14
+ },
15
+ "beautifulsoup4": {
16
+ "file": "beautifulsoup4.json",
17
+ "tags": ["html_parse"],
18
+ "keywords": ["html", "parse", "scrape", "beautifulsoup"]
19
+ },
20
+ "schedule": {
21
+ "file": "schedule.json",
22
+ "tags": ["scheduler_local"],
23
+ "keywords": ["schedule", "cron", "periodic", "task"]
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "requests",
3
+ "name": "requests",
4
+ "purpose": "发起 HTTP 请求",
5
+ "reason": "Python 最流行的 HTTP 库,API 简洁,功能完善",
6
+ "pypi_link": "https://pypi.org/project/requests/",
7
+ "docs_link": "https://requests.readthedocs.io/",
8
+ "github_link": "https://github.com/psf/requests",
9
+ "minimal_usage_notes": "import requests\nresponse = requests.get('https://api.example.com', timeout=30)\nresponse.raise_for_status() # 检查状态码\ndata = response.json() # 或 response.text\n# 支持 headers, params, auth, proxies 等\n# 自动处理 cookies, redirects, encoding",
10
+ "fallback": "使用 urllib (Python 内置),但 API 较复杂",
11
+ "tags": ["http_fetch"],
12
+ "stability": "high",
13
+ "last_updated": "2023"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "schedule",
3
+ "name": "schedule",
4
+ "purpose": "简单的任务调度",
5
+ "reason": "轻量级,API 简洁,适合简单的定时任务",
6
+ "pypi_link": "https://pypi.org/project/schedule/",
7
+ "docs_link": "https://schedule.readthedocs.io/",
8
+ "github_link": "https://github.com/dbader/schedule",
9
+ "minimal_usage_notes": "import schedule\nimport time\ndef job():\n print('Running task...')\nschedule.every().day.at('10:00').do(job)\nwhile True:\n schedule.run_pending()\n time.sleep(60)\n# 支持 every().hour, every().monday, every(10).minutes 等",
10
+ "fallback": "使用系统 cron (Linux/Mac) 或 Task Scheduler (Windows)",
11
+ "tags": ["scheduler_local"],
12
+ "stability": "high",
13
+ "last_updated": "2023"
14
+ }
@@ -0,0 +1,52 @@
1
+ # Universal Data Pack
2
+
3
+ 必需数据包(不可删除),包含 skill-creator 的核心资源。
4
+
5
+ ## 文件说明
6
+
7
+ ### questions.level1.json
8
+ Level 1 固定问题集(5-7问),覆盖核心槽位:
9
+ - goal: 目标
10
+ - input: 输入来源
11
+ - output: 输出形态
12
+ - environment: 运行环境
13
+ - constraints: 硬约束
14
+ - acceptance: 验收用例
15
+
16
+ ### schema.skill.json
17
+ Skill 输出的 schema 定义,用于校验:
18
+ - required_fields: 必需字段
19
+ - field_types: 字段类型
20
+ - workflow_step_schema: workflow step 的 schema
21
+ - validation_rules: 校验规则
22
+
23
+ ## 子目录
24
+
25
+ ### output_packs/
26
+ 输出格式包(5个,必需且不可禁用):
27
+ - **plain_text_message**: 纯文本消息(邮件/IM)
28
+ - **markdown_report**: Markdown 报告
29
+ - **json_result**: JSON 结果
30
+ - **code_snippet**: 代码片段/脚本
31
+ - **generic**: 通用格式(兜底)
32
+
33
+ 每个 pack 包含:
34
+ - output_structure: 输出结构定义
35
+ - workflow_pattern: 工作流模式
36
+ - recommended_libraries: 推荐库
37
+ - acceptance_template: 验收模板
38
+
39
+ ### minimal_checklists/
40
+ 最小 checklist(3个,必需):
41
+ - **automation_basic**: 自动化任务基本可靠性检查
42
+ - **web_scraping_basic**: 网页抓取基本可靠性检查
43
+ - **notification_basic**: 通知发送基本可靠性检查
44
+
45
+ 每个 checklist 包含:
46
+ - rules: 规则列表(id, title, description, severity, example)
47
+
48
+ ## 设计原则
49
+
50
+ 1. **不可禁用**: universal 数据包是不变量,必须存在
51
+ 2. **安全降级**: 其他数据包缺失时,使用 universal 中的资源
52
+ 3. **可扩展**: 可以添加新的 output_packs 和 checklists
@@ -0,0 +1,42 @@
1
+ {
2
+ "id": "automation_basic",
3
+ "name": "Automation Basic Checklist",
4
+ "description": "自动化任务的基本可靠性检查(必需)",
5
+ "rules": [
6
+ {
7
+ "id": "timeout",
8
+ "title": "设置超时",
9
+ "description": "所有网络请求和长时间操作必须设置超时",
10
+ "severity": "error",
11
+ "example": "requests.get(url, timeout=30)"
12
+ },
13
+ {
14
+ "id": "retry",
15
+ "title": "实现重试机制",
16
+ "description": "对于可能失败的操作(网络请求、文件读写),实现重试机制",
17
+ "severity": "warning",
18
+ "example": "使用 tenacity 或手动实现 retry 逻辑"
19
+ },
20
+ {
21
+ "id": "error_handling",
22
+ "title": "错误处理",
23
+ "description": "所有关键操作必须有 try-except,并记录错误",
24
+ "severity": "error",
25
+ "example": "try: ... except Exception as e: logger.error(f'Failed: {e}')"
26
+ },
27
+ {
28
+ "id": "logging",
29
+ "title": "日志记录",
30
+ "description": "记录关键步骤和错误,便于调试",
31
+ "severity": "warning",
32
+ "example": "import logging; logger = logging.getLogger(__name__)"
33
+ },
34
+ {
35
+ "id": "graceful_degradation",
36
+ "title": "优雅降级",
37
+ "description": "无数据或失败时,不应崩溃,而是返回空结果或默认值",
38
+ "severity": "error",
39
+ "example": "if not data: return default_value"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "1.0",
3
+ "description": "最小 Checklist 索引(必需,不可禁用)",
4
+ "items": {
5
+ "automation_basic": {
6
+ "file": "automation_basic.json",
7
+ "task_types": ["automation", "scheduled_task", "monitoring"],
8
+ "tags": ["automation", "scheduler_local"],
9
+ "keywords": ["automation", "workflow", "task"]
10
+ },
11
+ "web_scraping_basic": {
12
+ "file": "web_scraping_basic.json",
13
+ "task_types": ["web_scraping", "rss_monitoring"],
14
+ "tags": ["http_fetch", "html_parse", "rss"],
15
+ "keywords": ["web", "scrape", "fetch", "rss"]
16
+ },
17
+ "notification_basic": {
18
+ "file": "notification_basic.json",
19
+ "task_types": ["notification"],
20
+ "tags": ["email_smtp"],
21
+ "keywords": ["email", "notify", "alert"]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "notification_basic",
3
+ "name": "Notification Basic Checklist",
4
+ "description": "通知发送的基本可靠性检查",
5
+ "rules": [
6
+ {
7
+ "id": "credentials",
8
+ "title": "凭证安全",
9
+ "description": "不要硬编码邮箱密码,使用环境变量或配置文件",
10
+ "severity": "error",
11
+ "example": "password = os.getenv('EMAIL_PASSWORD')"
12
+ },
13
+ {
14
+ "id": "send_failure",
15
+ "title": "发送失败处理",
16
+ "description": "邮件发送失败时记录错误,不应导致整个流程崩溃",
17
+ "severity": "error",
18
+ "example": "try: send_email() except SMTPException as e: logger.error(e)"
19
+ },
20
+ {
21
+ "id": "empty_message",
22
+ "title": "空消息处理",
23
+ "description": "无数据时,决定是发送空消息还是跳过",
24
+ "severity": "warning",
25
+ "example": "if not message_body: return # 或发送占位符"
26
+ },
27
+ {
28
+ "id": "recipient_validation",
29
+ "title": "收件人验证",
30
+ "description": "验证收件人邮箱格式",
31
+ "severity": "warning",
32
+ "example": "使用正则或 email-validator 库"
33
+ }
34
+ ]
35
+ }