Skip to content

Commit f3fac8d

Browse files
feat: 通过 GitHub Releases 发布 skill 包
- tools/build-skills.sh:把 17 个 skill 打成根级 SKILL.md 的 .skill 包,再合成单个 dbskill-{VERSION}.zip - .github/workflows/release.yml:tag 推 v* 时自动构建并 gh release create - README:新增 Trae Solo 安装段,去掉 Manus、Trae 改为 Trae Solo - .gitignore:忽略 dist/
1 parent 82ad0b4 commit f3fac8d

4 files changed

Lines changed: 134 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release Trae Solo Skills
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Verify tag matches VERSION
18+
run: |
19+
set -euo pipefail
20+
VERSION="$(tr -d '[:space:]' < VERSION)"
21+
TAG="${GITHUB_REF_NAME#v}"
22+
if [ "$VERSION" != "$TAG" ]; then
23+
echo "tag ${GITHUB_REF_NAME} doesn't match VERSION ${VERSION}" >&2
24+
exit 1
25+
fi
26+
27+
- name: Build skill bundle
28+
run: bash tools/build-skills.sh
29+
30+
- name: Create GitHub Release
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
set -euo pipefail
35+
VERSION="$(tr -d '[:space:]' < VERSION)"
36+
gh release create "${GITHUB_REF_NAME}" \
37+
--title "${GITHUB_REF_NAME}" \
38+
--generate-notes \
39+
"dist/skills/dbskill-${VERSION}.zip"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ skills 版本管理/
88
AGENTS.md
99
CLAUDE.md
1010
SOURCE_OF_TRUTH.md
11+
dist/
1112

1213
# 知识库:只发 Skill 需要的部分
1314
知识库/legacy/

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
dontbesilent 商业诊断工具箱。从 12,307 条推文中提炼方法论,做成 17 个 Agent skill。
44

5-
可在 Claude Code、Codex、Cursor、Trae、Manus 等任意支持 skill / system prompt 的 Agent 上使用。
5+
可在 Claude Code、Codex、Cursor、Trae Solo 等任意支持 skill / system prompt 的 Agent 上使用。
66

77
**最新更新:v2.8.0**
88

@@ -33,6 +33,12 @@ claude plugin install dbs@dontbesilent-skills
3333
npx skills add dontbesilent2025/dbskill
3434
```
3535

36+
#### Trae Solo
37+
38+
Trae Solo 支持上传包含根级 `SKILL.md` 的 zip 或 `.skill` 文件。从 [GitHub Releases](https://github.com/dontbesilent2025/dbskill/releases) 下载最新的 `dbskill-版本号.zip`,解压后里面是 17 个 `.skill` 文件,逐个拖进 Trae Solo 的「上传技能」窗口即可。
39+
40+
如果想本地构建,运行 `bash tools/build-skills.sh`,产物在 `dist/skills/`
41+
3642
## 如何更新 dbskill
3743

3844
#### Claude Code 插件市场安装的用户

tools/build-skills.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
OUT_DIR="${1:-"$ROOT_DIR/dist/skills"}"
6+
VERSION="$(tr -d '[:space:]' < "$ROOT_DIR/VERSION")"
7+
8+
if ! command -v python3 >/dev/null 2>&1; then
9+
echo "error: python3 command is required" >&2
10+
exit 1
11+
fi
12+
13+
rm -rf "$OUT_DIR"
14+
mkdir -p "$OUT_DIR"
15+
16+
build_one() {
17+
local skill_dir="$1"
18+
local name
19+
local work_dir
20+
local package_path
21+
local refs
22+
23+
name="$(basename "$skill_dir")"
24+
work_dir="$(mktemp -d)"
25+
package_path="$OUT_DIR/${name}-${VERSION}.skill"
26+
27+
cp "$skill_dir/SKILL.md" "$work_dir/SKILL.md"
28+
29+
refs="$(grep -Eo '知识库/[^`,。 、)]*\.md' "$skill_dir/SKILL.md" || true)"
30+
if [ -n "$refs" ]; then
31+
while IFS= read -r ref; do
32+
[ -n "$ref" ] || continue
33+
if [ -f "$ROOT_DIR/$ref" ]; then
34+
mkdir -p "$work_dir/$(dirname "$ref")"
35+
cp "$ROOT_DIR/$ref" "$work_dir/$ref"
36+
fi
37+
done <<< "$refs"
38+
fi
39+
40+
python3 - "$work_dir" "$package_path" <<'PY'
41+
import os
42+
import sys
43+
import zipfile
44+
45+
source_dir, package_path = sys.argv[1], sys.argv[2]
46+
47+
with zipfile.ZipFile(package_path, "w", compression=zipfile.ZIP_DEFLATED) as archive:
48+
for root, _, files in os.walk(source_dir):
49+
for filename in files:
50+
path = os.path.join(root, filename)
51+
archive.write(path, os.path.relpath(path, source_dir))
52+
PY
53+
54+
rm -rf "$work_dir"
55+
echo "built $(basename "$package_path")"
56+
}
57+
58+
for skill_md in "$ROOT_DIR"/skills/*/SKILL.md; do
59+
build_one "$(dirname "$skill_md")"
60+
done
61+
62+
python3 - "$OUT_DIR" "dbskill-${VERSION}.zip" <<'PY'
63+
import os
64+
import sys
65+
import zipfile
66+
67+
out_dir, archive_name = sys.argv[1], sys.argv[2]
68+
archive_path = os.path.join(out_dir, archive_name)
69+
70+
with zipfile.ZipFile(archive_path, "w", compression=zipfile.ZIP_DEFLATED) as archive:
71+
for filename in sorted(os.listdir(out_dir)):
72+
if filename.endswith(".skill"):
73+
archive.write(os.path.join(out_dir, filename), filename)
74+
PY
75+
76+
cat > "$OUT_DIR/README.md" <<EOF
77+
# dbskill skill 包
78+
79+
版本:${VERSION}
80+
81+
从 GitHub Releases 下载 dbskill-${VERSION}.zip 解压后,里面是 17 个 .skill 文件。每个 .skill 是一个 zip,根目录是 SKILL.md(带 YAML frontmatter,含 name + description),并自动带上该 skill 引用的知识库文件。
82+
83+
格式遵循 Anthropic Skills 规范,可用于 Trae Solo、Claude Code 等支持该格式的产品。把 .skill 逐个上传即可。
84+
EOF
85+
86+
echo
87+
echo "done: $OUT_DIR"

0 commit comments

Comments
 (0)