@wwkit/harness 1.0.33 → 1.0.34
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-skill/SKILL.md +192 -124
- package/skills/blame-skill/SKILL.md +148 -201
- package/skills/blame-skill/references/scoring-rules.md +190 -0
- package/skills/blame-sprint-agent/SKILL.md +167 -0
- package/skills/blame-sprint-agent/references/scoring-rules.md +113 -0
- package/skills/blame-sprint-skill/SKILL.md +154 -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/new-skill/SKILL.md +193 -227
- 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/references/template.md +0 -53
- package/skills/new-skill/references/workflow-patterns.md +0 -104
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
# rules
|
|
2
|
-
You can provide custom instructions to opencode by creating an `AGENTS.md` file.
|
|
3
|
-
|
|
4
|
-
It contains instructions that will be included in the LLM’s context to customize its behavior for your specific project.
|
|
5
|
-
|
|
6
|
-
## Initialize
|
|
7
|
-
To create a new AGENTS.md file, you can run the `/init` command in opencode.
|
|
8
|
-
|
|
9
|
-
It focuses on the things future agent sessions are most likely to need:
|
|
10
|
-
- build, lint, and test commands
|
|
11
|
-
- command order and focused verification steps when they matter
|
|
12
|
-
- architecture and repo structure that are not obvious from filenames alone
|
|
13
|
-
- project-specific conventions, setup quirks, and operational gotchas
|
|
14
|
-
|
|
15
|
-
## Manual
|
|
16
|
-
You can also just create this file manually.
|
|
17
|
-
```md
|
|
18
|
-
# SST v3 Monorepo Project
|
|
19
|
-
|
|
20
|
-
This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management.
|
|
21
|
-
|
|
22
|
-
## Project Structure
|
|
23
|
-
|
|
24
|
-
- `packages/` - Contains all workspace packages (functions, core, web, etc.)
|
|
25
|
-
- `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts)
|
|
26
|
-
- `sst.config.ts` - Main SST configuration with dynamic imports
|
|
27
|
-
|
|
28
|
-
## Code Standards
|
|
29
|
-
|
|
30
|
-
- Use TypeScript with strict mode enabled
|
|
31
|
-
- Shared code goes in `packages/core/` with proper exports configuration
|
|
32
|
-
- Functions go in `packages/functions/`
|
|
33
|
-
- Infrastructure should be split into logical files in `infra/`
|
|
34
|
-
|
|
35
|
-
## Monorepo Conventions
|
|
36
|
-
|
|
37
|
-
- Import shared modules using workspace names: `@my-app/core/example`
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Location
|
|
41
|
-
#### Project
|
|
42
|
-
Place an AGENTS.md in your project root for project-specific rules.
|
|
43
|
-
|
|
44
|
-
#### Global
|
|
45
|
-
in a `~/.config/opencode/AGENTS.md` file.
|
|
46
|
-
|
|
47
|
-
Since this isn’t committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.
|
|
48
|
-
|
|
49
|
-
#### Custom Instructions
|
|
50
|
-
You can specify custom instruction files in your `opencode.json` or the global `~/.config/opencode/opencode.json`.
|
|
51
|
-
|
|
52
|
-
All instruction files are combined with your AGENTS.md files.
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"$schema": "https://opencode.ai/config.json",
|
|
57
|
-
"instructions": [
|
|
58
|
-
"CONTRIBUTING.md", "docs/guidelines.md", ".cursor/rules/*.md",
|
|
59
|
-
// remote URLs with a 5 second timeout
|
|
60
|
-
"https://raw.githubusercontent.com/my-org/shared-rules/main/style.md"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
You can teach opencode to read external files by providing explicit instructions in your AGENTS.md. Here’s a practical example:
|
|
66
|
-
```md
|
|
67
|
-
# TypeScript Project Rules
|
|
68
|
-
|
|
69
|
-
## External File Loading
|
|
70
|
-
|
|
71
|
-
CRITICAL: When you encounter a file reference (e.g., @rules/general.md), use your Read tool to load it on a need-to-know basis. They're relevant to the SPECIFIC task at hand.
|
|
72
|
-
|
|
73
|
-
Instructions:
|
|
74
|
-
|
|
75
|
-
- Do NOT preemptively load all references - use lazy loading based on actual need
|
|
76
|
-
- When loaded, treat content as mandatory instructions that override defaults
|
|
77
|
-
- Follow references recursively when needed
|
|
1
|
+
# rules
|
|
2
|
+
You can provide custom instructions to opencode by creating an `AGENTS.md` file.
|
|
3
|
+
|
|
4
|
+
It contains instructions that will be included in the LLM’s context to customize its behavior for your specific project.
|
|
5
|
+
|
|
6
|
+
## Initialize
|
|
7
|
+
To create a new AGENTS.md file, you can run the `/init` command in opencode.
|
|
8
|
+
|
|
9
|
+
It focuses on the things future agent sessions are most likely to need:
|
|
10
|
+
- build, lint, and test commands
|
|
11
|
+
- command order and focused verification steps when they matter
|
|
12
|
+
- architecture and repo structure that are not obvious from filenames alone
|
|
13
|
+
- project-specific conventions, setup quirks, and operational gotchas
|
|
14
|
+
|
|
15
|
+
## Manual
|
|
16
|
+
You can also just create this file manually.
|
|
17
|
+
```md
|
|
18
|
+
# SST v3 Monorepo Project
|
|
19
|
+
|
|
20
|
+
This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management.
|
|
21
|
+
|
|
22
|
+
## Project Structure
|
|
23
|
+
|
|
24
|
+
- `packages/` - Contains all workspace packages (functions, core, web, etc.)
|
|
25
|
+
- `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts)
|
|
26
|
+
- `sst.config.ts` - Main SST configuration with dynamic imports
|
|
27
|
+
|
|
28
|
+
## Code Standards
|
|
29
|
+
|
|
30
|
+
- Use TypeScript with strict mode enabled
|
|
31
|
+
- Shared code goes in `packages/core/` with proper exports configuration
|
|
32
|
+
- Functions go in `packages/functions/`
|
|
33
|
+
- Infrastructure should be split into logical files in `infra/`
|
|
34
|
+
|
|
35
|
+
## Monorepo Conventions
|
|
36
|
+
|
|
37
|
+
- Import shared modules using workspace names: `@my-app/core/example`
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Location
|
|
41
|
+
#### Project
|
|
42
|
+
Place an AGENTS.md in your project root for project-specific rules.
|
|
43
|
+
|
|
44
|
+
#### Global
|
|
45
|
+
in a `~/.config/opencode/AGENTS.md` file.
|
|
46
|
+
|
|
47
|
+
Since this isn’t committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.
|
|
48
|
+
|
|
49
|
+
#### Custom Instructions
|
|
50
|
+
You can specify custom instruction files in your `opencode.json` or the global `~/.config/opencode/opencode.json`.
|
|
51
|
+
|
|
52
|
+
All instruction files are combined with your AGENTS.md files.
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"$schema": "https://opencode.ai/config.json",
|
|
57
|
+
"instructions": [
|
|
58
|
+
"CONTRIBUTING.md", "docs/guidelines.md", ".cursor/rules/*.md",
|
|
59
|
+
// remote URLs with a 5 second timeout
|
|
60
|
+
"https://raw.githubusercontent.com/my-org/shared-rules/main/style.md"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You can teach opencode to read external files by providing explicit instructions in your AGENTS.md. Here’s a practical example:
|
|
66
|
+
```md
|
|
67
|
+
# TypeScript Project Rules
|
|
68
|
+
|
|
69
|
+
## External File Loading
|
|
70
|
+
|
|
71
|
+
CRITICAL: When you encounter a file reference (e.g., @rules/general.md), use your Read tool to load it on a need-to-know basis. They're relevant to the SPECIFIC task at hand.
|
|
72
|
+
|
|
73
|
+
Instructions:
|
|
74
|
+
|
|
75
|
+
- Do NOT preemptively load all references - use lazy loading based on actual need
|
|
76
|
+
- When loaded, treat content as mandatory instructions that override defaults
|
|
77
|
+
- Follow references recursively when needed
|
|
78
78
|
```
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
# 技能详解
|
|
2
|
-
|
|
3
|
-
## 渐进式加载(Progressive Disclosure)
|
|
4
|
-
|
|
5
|
-
技能不是把所有内容塞进上下文,而是分层加载:
|
|
6
|
-
|
|
7
|
-
| 层级 | 内容 | 大小 | 加载时机 |
|
|
8
|
-
|------|------|------|----------|
|
|
9
|
-
| 第一层 | name + description | ~100 词 | 始终可见,判断是否需要加载 |
|
|
10
|
-
| 第二层 | SKILL.md 正文 | 中等 | 任务匹配时加载,包含主要指令 |
|
|
11
|
-
| 第三层 | references/ 目录 | 详细 | 仅在需要具体细节时加载 |
|
|
12
|
-
|
|
13
|
-
## 目录结构
|
|
14
|
-
|
|
15
|
-
基本结构:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
.opencode/
|
|
19
|
-
└── skill/
|
|
20
|
-
└── code-review/
|
|
21
|
-
└── SKILL.md # 技能定义文件(必须大写)
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
完整结构:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
.opencode/
|
|
28
|
-
└── skill/
|
|
29
|
-
└── sql-analysis/
|
|
30
|
-
├── SKILL.md # 主文件:工作流程和关键逻辑
|
|
31
|
-
└── references/ # 详细文档(按需加载)
|
|
32
|
-
├── finance.md # 财务表结构
|
|
33
|
-
├── product.md # 产品表结构
|
|
34
|
-
└── examples.md # 查询示例
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Description 编写
|
|
38
|
-
|
|
39
|
-
Description 是唯一决定技能是否被触发的因素。OpenCode 使用语义理解(不是关键词匹配)来判断任务是否需要某个技能。
|
|
40
|
-
|
|
41
|
-
### 反面示例
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
description: 帮助处理文档
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 正面示例
|
|
48
|
-
|
|
49
|
-
```md
|
|
50
|
-
description: |
|
|
51
|
-
从 PDF 中提取表格并转换为 CSV 格式,用于数据分析工作流。
|
|
52
|
-
适用:填写 PDF 表单、批量处理 PDF 文档、提取 PDF 内嵌数据。
|
|
53
|
-
不适用:简单 PDF 查看、基本格式转换、PDF 编辑。
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Description 模板
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
description: |
|
|
60
|
-
[一句话说明核心能力]
|
|
61
|
-
提供:[该技能包含的资源,如表结构、公式、模板]
|
|
62
|
-
适用:[触发场景1]、[触发场景2]、[触发场景3]
|
|
63
|
-
不适用:[边界场景1]、[边界场景2]
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Description 要素
|
|
67
|
-
|
|
68
|
-
| 要素 | 说明 | 示例 |
|
|
69
|
-
|------|------|------|
|
|
70
|
-
| 具体能力 | 能做什么 | 提取表格、转换格式 |
|
|
71
|
-
| 提供资源 | 包含什么 | 表结构、公式、模板 |
|
|
72
|
-
| 触发场景 | 什么时候用 | 批量处理、表单填写 |
|
|
73
|
-
| 边界限制 | 什么时候不用 | 简单查看 |
|
|
74
|
-
|
|
75
|
-
## 创建步骤
|
|
76
|
-
|
|
77
|
-
### 步骤 1:明确需求
|
|
78
|
-
|
|
79
|
-
在写任何内容之前,回答这些问题:
|
|
80
|
-
|
|
81
|
-
1. 这个技能解决什么具体问题?→ 明确价值
|
|
82
|
-
2. 什么情况下应该触发?→ 设计 description
|
|
83
|
-
3. 成功的输出是什么样?→ 定义验收标准
|
|
84
|
-
4. 有哪些边缘情况?→ 避免遗漏
|
|
85
|
-
|
|
86
|
-
### 步骤 2:写 name
|
|
87
|
-
|
|
88
|
-
简短清晰,反映核心功能。
|
|
89
|
-
|
|
90
|
-
### 步骤 3:写 description(最重要)
|
|
91
|
-
|
|
92
|
-
Description 决定触发,是最关键的部分。
|
|
93
|
-
|
|
94
|
-
### 步骤 4:写主要指令
|
|
95
|
-
|
|
96
|
-
写作原则:
|
|
97
|
-
|
|
98
|
-
1. 用 Markdown 结构 — 标题、列表、表格增加可读性
|
|
99
|
-
2. 提供具体示例 — 代码块展示正确用法
|
|
100
|
-
3. 说明不能做什么 — 避免误用
|
|
101
|
-
4. 引用详细文档 — 保持主文件精简
|
|
102
|
-
|
|
103
|
-
### 步骤 5:测试验证
|
|
104
|
-
|
|
105
|
-
系统化测试技能,确保在各种场景下都能正常工作。
|
|
106
|
-
|
|
107
|
-
## 技能 + MCP
|
|
108
|
-
|
|
109
|
-
| MCP 提供 | 技能提供 |
|
|
110
|
-
|----------|----------|
|
|
111
|
-
| 连接到各种服务(Notion、Linear、GitHub...) | 如何使用这些工具的最佳实践 |
|
|
112
|
-
| 实时数据访问 | 多步骤工作流编排 |
|
|
113
|
-
| 工具调用能力 | 领域专业知识 |
|
|
1
|
+
# 技能详解
|
|
2
|
+
|
|
3
|
+
## 渐进式加载(Progressive Disclosure)
|
|
4
|
+
|
|
5
|
+
技能不是把所有内容塞进上下文,而是分层加载:
|
|
6
|
+
|
|
7
|
+
| 层级 | 内容 | 大小 | 加载时机 |
|
|
8
|
+
|------|------|------|----------|
|
|
9
|
+
| 第一层 | name + description | ~100 词 | 始终可见,判断是否需要加载 |
|
|
10
|
+
| 第二层 | SKILL.md 正文 | 中等 | 任务匹配时加载,包含主要指令 |
|
|
11
|
+
| 第三层 | references/ 目录 | 详细 | 仅在需要具体细节时加载 |
|
|
12
|
+
|
|
13
|
+
## 目录结构
|
|
14
|
+
|
|
15
|
+
基本结构:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
.opencode/
|
|
19
|
+
└── skill/
|
|
20
|
+
└── code-review/
|
|
21
|
+
└── SKILL.md # 技能定义文件(必须大写)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
完整结构:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
.opencode/
|
|
28
|
+
└── skill/
|
|
29
|
+
└── sql-analysis/
|
|
30
|
+
├── SKILL.md # 主文件:工作流程和关键逻辑
|
|
31
|
+
└── references/ # 详细文档(按需加载)
|
|
32
|
+
├── finance.md # 财务表结构
|
|
33
|
+
├── product.md # 产品表结构
|
|
34
|
+
└── examples.md # 查询示例
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Description 编写
|
|
38
|
+
|
|
39
|
+
Description 是唯一决定技能是否被触发的因素。OpenCode 使用语义理解(不是关键词匹配)来判断任务是否需要某个技能。
|
|
40
|
+
|
|
41
|
+
### 反面示例
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
description: 帮助处理文档
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 正面示例
|
|
48
|
+
|
|
49
|
+
```md
|
|
50
|
+
description: |
|
|
51
|
+
从 PDF 中提取表格并转换为 CSV 格式,用于数据分析工作流。
|
|
52
|
+
适用:填写 PDF 表单、批量处理 PDF 文档、提取 PDF 内嵌数据。
|
|
53
|
+
不适用:简单 PDF 查看、基本格式转换、PDF 编辑。
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Description 模板
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
description: |
|
|
60
|
+
[一句话说明核心能力]
|
|
61
|
+
提供:[该技能包含的资源,如表结构、公式、模板]
|
|
62
|
+
适用:[触发场景1]、[触发场景2]、[触发场景3]
|
|
63
|
+
不适用:[边界场景1]、[边界场景2]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Description 要素
|
|
67
|
+
|
|
68
|
+
| 要素 | 说明 | 示例 |
|
|
69
|
+
|------|------|------|
|
|
70
|
+
| 具体能力 | 能做什么 | 提取表格、转换格式 |
|
|
71
|
+
| 提供资源 | 包含什么 | 表结构、公式、模板 |
|
|
72
|
+
| 触发场景 | 什么时候用 | 批量处理、表单填写 |
|
|
73
|
+
| 边界限制 | 什么时候不用 | 简单查看 |
|
|
74
|
+
|
|
75
|
+
## 创建步骤
|
|
76
|
+
|
|
77
|
+
### 步骤 1:明确需求
|
|
78
|
+
|
|
79
|
+
在写任何内容之前,回答这些问题:
|
|
80
|
+
|
|
81
|
+
1. 这个技能解决什么具体问题?→ 明确价值
|
|
82
|
+
2. 什么情况下应该触发?→ 设计 description
|
|
83
|
+
3. 成功的输出是什么样?→ 定义验收标准
|
|
84
|
+
4. 有哪些边缘情况?→ 避免遗漏
|
|
85
|
+
|
|
86
|
+
### 步骤 2:写 name
|
|
87
|
+
|
|
88
|
+
简短清晰,反映核心功能。
|
|
89
|
+
|
|
90
|
+
### 步骤 3:写 description(最重要)
|
|
91
|
+
|
|
92
|
+
Description 决定触发,是最关键的部分。
|
|
93
|
+
|
|
94
|
+
### 步骤 4:写主要指令
|
|
95
|
+
|
|
96
|
+
写作原则:
|
|
97
|
+
|
|
98
|
+
1. 用 Markdown 结构 — 标题、列表、表格增加可读性
|
|
99
|
+
2. 提供具体示例 — 代码块展示正确用法
|
|
100
|
+
3. 说明不能做什么 — 避免误用
|
|
101
|
+
4. 引用详细文档 — 保持主文件精简
|
|
102
|
+
|
|
103
|
+
### 步骤 5:测试验证
|
|
104
|
+
|
|
105
|
+
系统化测试技能,确保在各种场景下都能正常工作。
|
|
106
|
+
|
|
107
|
+
## 技能 + MCP
|
|
108
|
+
|
|
109
|
+
| MCP 提供 | 技能提供 |
|
|
110
|
+
|----------|----------|
|
|
111
|
+
| 连接到各种服务(Notion、Linear、GitHub...) | 如何使用这些工具的最佳实践 |
|
|
112
|
+
| 实时数据访问 | 多步骤工作流编排 |
|
|
113
|
+
| 工具调用能力 | 领域专业知识 |
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
# 技能示例
|
|
2
|
-
|
|
3
|
-
## 简单示例:translate
|
|
4
|
-
|
|
5
|
-
```md
|
|
6
|
-
---
|
|
7
|
-
name: translate
|
|
8
|
-
description: 专业翻译,保留格式和术语。用于翻译技术文档、API 文档、代码注释。
|
|
9
|
-
---
|
|
10
|
-
# 翻译技能
|
|
11
|
-
## 翻译规范
|
|
12
|
-
1. 保持原文格式和段落结构
|
|
13
|
-
2. 专有名词保留原文并标注
|
|
14
|
-
3. 技术术语查阅术语表
|
|
15
|
-
4. 翻译后进行通读润色
|
|
16
|
-
## 输出格式
|
|
17
|
-
翻译结果用代码块包裹;
|
|
18
|
-
对于不确定的翻译,用括号标注原文。
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 简单示例:brand-guidelines
|
|
22
|
-
|
|
23
|
-
```md
|
|
24
|
-
---
|
|
25
|
-
name: brand-guidelines
|
|
26
|
-
description: 应用公司官方品牌色和排版规范。用于创建需要公司视觉风格的文档、演示文稿、界面设计。
|
|
27
|
-
---
|
|
28
|
-
# 品牌规范技能
|
|
29
|
-
## 颜色
|
|
30
|
-
**主色**:
|
|
31
|
-
- 深色:`#141413` - 主要文字和深色背景
|
|
32
|
-
- 浅色:`#faf9f5` - 浅色背景和深色上的文字
|
|
33
|
-
- 中灰:`#b0aea5` - 次要元素
|
|
34
|
-
**强调色**:
|
|
35
|
-
- 橙色:`#d97757` - 主强调色
|
|
36
|
-
- 蓝色:`#6a9bcc` - 次强调色
|
|
37
|
-
- 绿色:`#788c5d` - 第三强调色
|
|
38
|
-
## 字体
|
|
39
|
-
- **标题**:Poppins(备选 Arial)
|
|
40
|
-
- **正文**:Lora(备选 Georgia)
|
|
41
|
-
## 应用规则
|
|
42
|
-
- 标题(24pt 及以上)使用 Poppins
|
|
43
|
-
- 正文使用 Lora
|
|
44
|
-
- 根据背景智能选择文字颜色
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 中级示例:sql-analysis(含 references/)
|
|
48
|
-
|
|
49
|
-
`SKILL.md` 只包含工作流程和关键逻辑,详细的表结构放在 `references/` 目录中。
|
|
50
|
-
|
|
51
|
-
### SKILL.md
|
|
52
|
-
|
|
53
|
-
```md
|
|
54
|
-
---
|
|
55
|
-
name: sql-analysis
|
|
56
|
-
description: |
|
|
57
|
-
用于分析业务数据:收入趋势、ARR 计算、客户分群、产品使用、销售管道。
|
|
58
|
-
提供:公司表结构、指标定义公式、标准过滤器、常用查询模板。
|
|
59
|
-
适用:需要写 SQL 分析业务数据、理解公司指标定义、查询数据仓库。
|
|
60
|
-
不适用:数据库管理、DDL 操作、性能调优、通用 SQL 教学。
|
|
61
|
-
---
|
|
62
|
-
# SQL 分析技能
|
|
63
|
-
## 快速工作流程
|
|
64
|
-
当用户请求数据分析时:
|
|
65
|
-
1. **明确需求**
|
|
66
|
-
- 什么时间范围?(默认当年)
|
|
67
|
-
- 哪个客户分群?
|
|
68
|
-
- 这个分析用于什么决策?
|
|
69
|
-
2. **检查现有看板**
|
|
70
|
-
- 查看 `references/dashboards.md` 是否有现成报表
|
|
71
|
-
- 如果有,优先引导用户使用
|
|
72
|
-
3. **确定数据源**
|
|
73
|
-
- 优先使用汇总表而非原始事件数据
|
|
74
|
-
- 查询前确认表有必需字段
|
|
75
|
-
4. **执行分析**
|
|
76
|
-
- 应用必需过滤器(排除测试账户等)
|
|
77
|
-
- 用已知基准验证结果
|
|
78
|
-
## 标准查询过滤器
|
|
79
|
-
所有收入查询必须:
|
|
80
|
-
- 排除测试账户:`WHERE account != 'Test'`
|
|
81
|
-
- 只用完整周期:`WHERE month <= DATE_TRUNC(CURRENT_DATE(), MONTH)`
|
|
82
|
-
## ARR 计算方式
|
|
83
|
-
- 月收入转 ARR:`monthly_revenue * 12`
|
|
84
|
-
- 7 日运行率:`rolling_7d * 52`
|
|
85
|
-
## 详细文档
|
|
86
|
-
需要表结构和查询模式时,参考:
|
|
87
|
-
- **收入与财务** → `references/finance.md`
|
|
88
|
-
- **产品使用** → `references/product.md`
|
|
89
|
-
- **销售管道** → `references/sales.md`
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### references/finance.md(第三层)
|
|
93
|
-
|
|
94
|
-
```md
|
|
95
|
-
# 财务表详细结构
|
|
96
|
-
## monthly_revenue 表
|
|
97
|
-
| 字段 | 类型 | 说明 |
|
|
98
|
-
|-----|------|------|
|
|
99
|
-
| account_id | STRING | 账户 ID |
|
|
100
|
-
| month | DATE | 月份(每月第一天) |
|
|
101
|
-
| mrr | FLOAT | 月度经常性收入 |
|
|
102
|
-
| arr | FLOAT | 年度经常性收入 |
|
|
103
|
-
| segment | STRING | 客户分群 |
|
|
104
|
-
## 常用查询
|
|
105
|
-
### 按分群统计月收入
|
|
106
|
-
```sql
|
|
107
|
-
SELECT
|
|
108
|
-
segment,
|
|
109
|
-
DATE_TRUNC(month, MONTH) as period,
|
|
110
|
-
SUM(mrr) as total_mrr
|
|
111
|
-
FROM monthly_revenue
|
|
112
|
-
WHERE account_id != 'Test'
|
|
113
|
-
GROUP BY 1, 2
|
|
114
|
-
ORDER BY 2 DESC, 3 DESC
|
|
115
|
-
```
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Anthropic 示例:docx
|
|
119
|
-
|
|
120
|
-
```md
|
|
121
|
-
---
|
|
122
|
-
name: docx
|
|
123
|
-
description: "文档创建、编辑和分析,支持修订、批注、格式保留和文本提取。当 Claude 需要处理 .docx 文件时使用:(1) 创建新文档 (2) 修改内容 (3) 处理修订 (4) 添加批注"
|
|
124
|
-
license: Proprietary. LICENSE.txt has complete terms
|
|
125
|
-
---
|
|
126
|
-
# DOCX 创建、编辑和分析
|
|
127
|
-
## 概述
|
|
128
|
-
用户可能要求创建、编辑或分析 .docx 文件。.docx 本质上是包含 XML 文件的 ZIP 压缩包。
|
|
129
|
-
## 工作流程决策树
|
|
130
|
-
### 读取/分析内容
|
|
131
|
-
使用下面的"文本提取"或"原始 XML 访问"部分
|
|
132
|
-
### 创建新文档
|
|
133
|
-
使用"创建新 Word 文档"工作流程
|
|
134
|
-
### 编辑现有文档
|
|
135
|
-
- **你自己的文档 + 简单修改**:使用"基础 OOXML 编辑"
|
|
136
|
-
- **别人的文档**:使用**修订工作流程**(推荐默认)
|
|
137
|
-
- **法律、学术、商业、政府文档**:**必须**使用修订工作流程
|
|
138
|
-
## 文本提取
|
|
139
|
-
使用 pandoc 转换为 markdown:
|
|
140
|
-
`pandoc --track-changes=all path-to-file.docx -o output.md`
|
|
141
|
-
```
|
|
1
|
+
# 技能示例
|
|
2
|
+
|
|
3
|
+
## 简单示例:translate
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
---
|
|
7
|
+
name: translate
|
|
8
|
+
description: 专业翻译,保留格式和术语。用于翻译技术文档、API 文档、代码注释。
|
|
9
|
+
---
|
|
10
|
+
# 翻译技能
|
|
11
|
+
## 翻译规范
|
|
12
|
+
1. 保持原文格式和段落结构
|
|
13
|
+
2. 专有名词保留原文并标注
|
|
14
|
+
3. 技术术语查阅术语表
|
|
15
|
+
4. 翻译后进行通读润色
|
|
16
|
+
## 输出格式
|
|
17
|
+
翻译结果用代码块包裹;
|
|
18
|
+
对于不确定的翻译,用括号标注原文。
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 简单示例:brand-guidelines
|
|
22
|
+
|
|
23
|
+
```md
|
|
24
|
+
---
|
|
25
|
+
name: brand-guidelines
|
|
26
|
+
description: 应用公司官方品牌色和排版规范。用于创建需要公司视觉风格的文档、演示文稿、界面设计。
|
|
27
|
+
---
|
|
28
|
+
# 品牌规范技能
|
|
29
|
+
## 颜色
|
|
30
|
+
**主色**:
|
|
31
|
+
- 深色:`#141413` - 主要文字和深色背景
|
|
32
|
+
- 浅色:`#faf9f5` - 浅色背景和深色上的文字
|
|
33
|
+
- 中灰:`#b0aea5` - 次要元素
|
|
34
|
+
**强调色**:
|
|
35
|
+
- 橙色:`#d97757` - 主强调色
|
|
36
|
+
- 蓝色:`#6a9bcc` - 次强调色
|
|
37
|
+
- 绿色:`#788c5d` - 第三强调色
|
|
38
|
+
## 字体
|
|
39
|
+
- **标题**:Poppins(备选 Arial)
|
|
40
|
+
- **正文**:Lora(备选 Georgia)
|
|
41
|
+
## 应用规则
|
|
42
|
+
- 标题(24pt 及以上)使用 Poppins
|
|
43
|
+
- 正文使用 Lora
|
|
44
|
+
- 根据背景智能选择文字颜色
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 中级示例:sql-analysis(含 references/)
|
|
48
|
+
|
|
49
|
+
`SKILL.md` 只包含工作流程和关键逻辑,详细的表结构放在 `references/` 目录中。
|
|
50
|
+
|
|
51
|
+
### SKILL.md
|
|
52
|
+
|
|
53
|
+
```md
|
|
54
|
+
---
|
|
55
|
+
name: sql-analysis
|
|
56
|
+
description: |
|
|
57
|
+
用于分析业务数据:收入趋势、ARR 计算、客户分群、产品使用、销售管道。
|
|
58
|
+
提供:公司表结构、指标定义公式、标准过滤器、常用查询模板。
|
|
59
|
+
适用:需要写 SQL 分析业务数据、理解公司指标定义、查询数据仓库。
|
|
60
|
+
不适用:数据库管理、DDL 操作、性能调优、通用 SQL 教学。
|
|
61
|
+
---
|
|
62
|
+
# SQL 分析技能
|
|
63
|
+
## 快速工作流程
|
|
64
|
+
当用户请求数据分析时:
|
|
65
|
+
1. **明确需求**
|
|
66
|
+
- 什么时间范围?(默认当年)
|
|
67
|
+
- 哪个客户分群?
|
|
68
|
+
- 这个分析用于什么决策?
|
|
69
|
+
2. **检查现有看板**
|
|
70
|
+
- 查看 `references/dashboards.md` 是否有现成报表
|
|
71
|
+
- 如果有,优先引导用户使用
|
|
72
|
+
3. **确定数据源**
|
|
73
|
+
- 优先使用汇总表而非原始事件数据
|
|
74
|
+
- 查询前确认表有必需字段
|
|
75
|
+
4. **执行分析**
|
|
76
|
+
- 应用必需过滤器(排除测试账户等)
|
|
77
|
+
- 用已知基准验证结果
|
|
78
|
+
## 标准查询过滤器
|
|
79
|
+
所有收入查询必须:
|
|
80
|
+
- 排除测试账户:`WHERE account != 'Test'`
|
|
81
|
+
- 只用完整周期:`WHERE month <= DATE_TRUNC(CURRENT_DATE(), MONTH)`
|
|
82
|
+
## ARR 计算方式
|
|
83
|
+
- 月收入转 ARR:`monthly_revenue * 12`
|
|
84
|
+
- 7 日运行率:`rolling_7d * 52`
|
|
85
|
+
## 详细文档
|
|
86
|
+
需要表结构和查询模式时,参考:
|
|
87
|
+
- **收入与财务** → `references/finance.md`
|
|
88
|
+
- **产品使用** → `references/product.md`
|
|
89
|
+
- **销售管道** → `references/sales.md`
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### references/finance.md(第三层)
|
|
93
|
+
|
|
94
|
+
```md
|
|
95
|
+
# 财务表详细结构
|
|
96
|
+
## monthly_revenue 表
|
|
97
|
+
| 字段 | 类型 | 说明 |
|
|
98
|
+
|-----|------|------|
|
|
99
|
+
| account_id | STRING | 账户 ID |
|
|
100
|
+
| month | DATE | 月份(每月第一天) |
|
|
101
|
+
| mrr | FLOAT | 月度经常性收入 |
|
|
102
|
+
| arr | FLOAT | 年度经常性收入 |
|
|
103
|
+
| segment | STRING | 客户分群 |
|
|
104
|
+
## 常用查询
|
|
105
|
+
### 按分群统计月收入
|
|
106
|
+
```sql
|
|
107
|
+
SELECT
|
|
108
|
+
segment,
|
|
109
|
+
DATE_TRUNC(month, MONTH) as period,
|
|
110
|
+
SUM(mrr) as total_mrr
|
|
111
|
+
FROM monthly_revenue
|
|
112
|
+
WHERE account_id != 'Test'
|
|
113
|
+
GROUP BY 1, 2
|
|
114
|
+
ORDER BY 2 DESC, 3 DESC
|
|
115
|
+
```
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Anthropic 示例:docx
|
|
119
|
+
|
|
120
|
+
```md
|
|
121
|
+
---
|
|
122
|
+
name: docx
|
|
123
|
+
description: "文档创建、编辑和分析,支持修订、批注、格式保留和文本提取。当 Claude 需要处理 .docx 文件时使用:(1) 创建新文档 (2) 修改内容 (3) 处理修订 (4) 添加批注"
|
|
124
|
+
license: Proprietary. LICENSE.txt has complete terms
|
|
125
|
+
---
|
|
126
|
+
# DOCX 创建、编辑和分析
|
|
127
|
+
## 概述
|
|
128
|
+
用户可能要求创建、编辑或分析 .docx 文件。.docx 本质上是包含 XML 文件的 ZIP 压缩包。
|
|
129
|
+
## 工作流程决策树
|
|
130
|
+
### 读取/分析内容
|
|
131
|
+
使用下面的"文本提取"或"原始 XML 访问"部分
|
|
132
|
+
### 创建新文档
|
|
133
|
+
使用"创建新 Word 文档"工作流程
|
|
134
|
+
### 编辑现有文档
|
|
135
|
+
- **你自己的文档 + 简单修改**:使用"基础 OOXML 编辑"
|
|
136
|
+
- **别人的文档**:使用**修订工作流程**(推荐默认)
|
|
137
|
+
- **法律、学术、商业、政府文档**:**必须**使用修订工作流程
|
|
138
|
+
## 文本提取
|
|
139
|
+
使用 pandoc 转换为 markdown:
|
|
140
|
+
`pandoc --track-changes=all path-to-file.docx -o output.md`
|
|
141
|
+
```
|