Skip to content

Commit 063cff5

Browse files
authored
Merge branch 'main' into feature/add-switch-assistant-and-topic-shortcuts
2 parents 4dd584d + 38c29c1 commit 063cff5

File tree

196 files changed

+8631
-2708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+8631
-2708
lines changed

.agents/skills/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# AUTO-GENERATED by `pnpm skills:sync`.
2+
# Do not edit manually.
3+
*
4+
!.gitignore
5+
!README*.md
6+
!public-skills.txt
7+
!gh-create-pr/
8+
!gh-create-pr/**

.agents/skills/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Skills Management
2+
3+
This directory is the single source of truth for repository skills.
4+
5+
## Add a New Skill
6+
7+
1. Create a new folder under `.agents/skills/<skill-name>/`.
8+
2. Add a `SKILL.md` file with:
9+
- `name` and `description` in YAML frontmatter
10+
- concise workflow instructions in the body
11+
3. (Optional) Add `agents/openai.yaml` if Codex UI metadata is needed.
12+
4. If this skill should be shared in the repository, append `<skill-name>` to `.agents/skills/public-skills.txt`.
13+
14+
## Naming Rules
15+
16+
- Use lowercase letters, digits, and hyphens only.
17+
- Prefer short, action-oriented names (for example: `gh-create-pr`).
18+
19+
## Claude Compatibility
20+
21+
For each new public skill, run:
22+
23+
```bash
24+
pnpm skills:sync
25+
```
26+
27+
`skills:sync` will create/update `.claude/skills/<skill-name>/SKILL.md` as:
28+
29+
- a copied file from `.agents/skills/<skill-name>/SKILL.md`.
30+
- symlinks are not allowed; check enforces regular files for compatibility.
31+
32+
## White-list Tracking Rules
33+
34+
The public white-list is defined in `.agents/skills/public-skills.txt`.
35+
36+
- Skills listed there are synced to both `.agents/skills/.gitignore` and `.claude/skills/.gitignore`.
37+
- Private/local-only skills should stay out of `public-skills.txt`.
38+
- Use one skill name per line. Comment lines must start with `#` and cannot be appended inline.
39+
40+
After updating `public-skills.txt`, run:
41+
42+
```bash
43+
pnpm skills:sync
44+
```
45+
46+
Then validate:
47+
48+
```bash
49+
pnpm skills:check
50+
```
51+
52+
The sync/check scripts manage and verify:
53+
54+
- `.agents/skills/.gitignore`
55+
- `.claude/skills/.gitignore`
56+
- `.claude/skills/<skill-name>/SKILL.md` content matches `.agents/skills/<skill-name>/SKILL.md`

.agents/skills/README.zh.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Skills 管理说明
2+
3+
本目录是仓库内 skills 的唯一维护来源(single source of truth)。
4+
5+
## 新增 Skill 流程
6+
7+
1.`.agents/skills/<skill-name>/` 下创建新目录。
8+
2. 添加 `SKILL.md`,包含:
9+
- YAML frontmatter 中的 `name``description`
10+
- 正文中的精简流程说明
11+
3. (可选)如需 Codex UI 元数据,添加 `agents/openai.yaml`
12+
4. 若该 skill 需要作为仓库公共 skill 跟踪,请将 `<skill-name>` 追加到 `.agents/skills/public-skills.txt`
13+
14+
## 命名规则
15+
16+
- 仅使用小写字母、数字和连字符(`-`)。
17+
- 优先使用简短、动作导向的名称(例如:`gh-create-pr`)。
18+
19+
## Claude 兼容
20+
21+
每个新增的公共 skill,请执行:
22+
23+
```bash
24+
pnpm skills:sync
25+
```
26+
27+
`skills:sync` 会自动创建/更新 `.claude/skills/<skill-name>/SKILL.md`
28+
29+
- 复制 `.agents/skills/<skill-name>/SKILL.md` 的内容。
30+
- 不允许使用符号链接;check 会强制要求为普通文件以保证兼容性。
31+
32+
## 白名单跟踪规则
33+
34+
公共白名单由 `.agents/skills/public-skills.txt` 定义。
35+
36+
- 写入该文件的 skill 会同步到 `.agents/skills/.gitignore``.claude/skills/.gitignore`
37+
- 私有/仅本地使用的 skill 不应写入 `public-skills.txt`
38+
- 每行只写一个 skill 名称。注释行必须以 `#` 开头,不能写行尾注释。
39+
40+
更新 `public-skills.txt` 后,请执行:
41+
42+
```bash
43+
pnpm skills:sync
44+
```
45+
46+
然后校验:
47+
48+
```bash
49+
pnpm skills:check
50+
```
51+
52+
上述脚本会自动维护并校验:
53+
54+
- `.agents/skills/.gitignore`
55+
- `.claude/skills/.gitignore`
56+
- `.claude/skills/<skill-name>/SKILL.md``.agents/skills/<skill-name>/SKILL.md` 的内容一致性
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: gh-create-pr
3+
description: Create or update GitHub pull requests using the repository-required workflow and template compliance. Use when asked to create/open/update a PR so the assistant reads `.github/pull_request_template.md`, fills every template section, preserves markdown structure exactly, and marks missing data as N/A or None instead of skipping sections.
4+
---
5+
6+
# GitHub PR Creation
7+
8+
## Workflow
9+
10+
1. Read `.github/pull_request_template.md` before drafting the PR body.
11+
2. Collect PR context from the current branch (base/head, scope, linked issues, testing status, breaking changes, release note content).
12+
3. Draft the PR body using the template structure exactly:
13+
- Keep section order and headings.
14+
- Keep checkbox and code block formatting.
15+
- Fill every section; if not applicable, write `N/A` or `None`.
16+
4. Present the full Markdown PR body in chat for review before creating the PR.
17+
5. Ask for explicit confirmation to create the PR with that body.
18+
6. After confirmation, create the PR with `gh pr create --body-file` using a unique temp file path.
19+
7. Report the created PR URL and summarize title/base/head and any required follow-up.
20+
21+
## Constraints
22+
23+
- Never skip template sections.
24+
- Never rewrite the template format.
25+
- Keep content concise and specific to the current change set.
26+
- PR title and body must be written in English.
27+
- Never create the PR before showing the full final body to the user.
28+
- Never rely on command permission prompts as PR body preview.
29+
30+
## Command Pattern
31+
32+
```bash
33+
# read template
34+
cat .github/pull_request_template.md
35+
36+
# show this full Markdown body in chat first
37+
pr_body_file="$(mktemp /tmp/gh-pr-body-XXXXXX).md"
38+
cat > "$pr_body_file" <<'EOF'
39+
...filled template body...
40+
EOF
41+
42+
# run only after explicit user confirmation
43+
gh pr create --base <base> --head <head> --title "<title>" --body-file "$pr_body_file"
44+
rm -f "$pr_body_file"
45+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Create GitHub PR"
3+
short_description: "Create PRs with required template compliance"
4+
default_prompt: "Create a pull request for my current branch using the repository template workflow."

.agents/skills/public-skills.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Public skills tracked by skills:sync and skills:check.
2+
# One skill name per line.
3+
gh-create-pr

.claude/skills/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# AUTO-GENERATED by `pnpm skills:sync`.
2+
# Do not edit manually.
3+
*
4+
!.gitignore
5+
!README*.md
6+
!gh-create-pr/
7+
!gh-create-pr/**

.claude/skills/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Claude Skills Mirror
2+
3+
This directory is a synced mirror for Claude-compatible skill files.
4+
5+
- Do not create new skills directly under `.claude/skills`.
6+
- Create and maintain skills under `.agents/skills` only.
7+
- Update `.agents/skills/public-skills.txt`, then run `pnpm skills:sync`.
8+
- `pnpm skills:check` verifies `.claude/skills/<skill>/SKILL.md` matches `.agents/skills/<skill>/SKILL.md`.

.claude/skills/README.zh.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Claude Skills 镜像说明
2+
3+
本目录是面向 Claude 的 skill 文件镜像目录。
4+
5+
- 不要直接在 `.claude/skills` 下创建新 skill。
6+
- 所有 skill 仅在 `.agents/skills` 中创建和维护。
7+
- 更新 `.agents/skills/public-skills.txt` 后,执行 `pnpm skills:sync`
8+
- `pnpm skills:check` 会校验 `.claude/skills/<skill>/SKILL.md``.agents/skills/<skill>/SKILL.md` 内容一致。
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: gh-create-pr
3+
description: Create or update GitHub pull requests using the repository-required workflow and template compliance. Use when asked to create/open/update a PR so the assistant reads `.github/pull_request_template.md`, fills every template section, preserves markdown structure exactly, and marks missing data as N/A or None instead of skipping sections.
4+
---
5+
6+
# GitHub PR Creation
7+
8+
## Workflow
9+
10+
1. Read `.github/pull_request_template.md` before drafting the PR body.
11+
2. Collect PR context from the current branch (base/head, scope, linked issues, testing status, breaking changes, release note content).
12+
3. Draft the PR body using the template structure exactly:
13+
- Keep section order and headings.
14+
- Keep checkbox and code block formatting.
15+
- Fill every section; if not applicable, write `N/A` or `None`.
16+
4. Present the full Markdown PR body in chat for review before creating the PR.
17+
5. Ask for explicit confirmation to create the PR with that body.
18+
6. After confirmation, create the PR with `gh pr create --body-file` using a unique temp file path.
19+
7. Report the created PR URL and summarize title/base/head and any required follow-up.
20+
21+
## Constraints
22+
23+
- Never skip template sections.
24+
- Never rewrite the template format.
25+
- Keep content concise and specific to the current change set.
26+
- PR title and body must be written in English.
27+
- Never create the PR before showing the full final body to the user.
28+
- Never rely on command permission prompts as PR body preview.
29+
30+
## Command Pattern
31+
32+
```bash
33+
# read template
34+
cat .github/pull_request_template.md
35+
36+
# show this full Markdown body in chat first
37+
pr_body_file="$(mktemp /tmp/gh-pr-body-XXXXXX).md"
38+
cat > "$pr_body_file" <<'EOF'
39+
...filled template body...
40+
EOF
41+
42+
# run only after explicit user confirmation
43+
gh pr create --base <base> --head <head> --title "<title>" --body-file "$pr_body_file"
44+
rm -f "$pr_body_file"
45+
```

0 commit comments

Comments
 (0)