diff --git a/.github/skills/release-notes/SKILL.md b/.agents/skills/release-notes/SKILL.md similarity index 91% rename from .github/skills/release-notes/SKILL.md rename to .agents/skills/release-notes/SKILL.md index d56f0b49b2a..280e0371d29 100644 --- a/.github/skills/release-notes/SKILL.md +++ b/.agents/skills/release-notes/SKILL.md @@ -12,7 +12,7 @@ Create matching English and Chinese release-note drafts for this repository. Do 1. Identify the latest published stable release tag from the repository's releases/tags. Do not use prereleases as the baseline unless requested. 2. Get the target version from the user's request; if the request says "current version", check the project version. Use the requested release date; if none is given, use the current date. 3. Compare the target version with the latest stable version. If the target is not newer, stop and tell the user that no release notes are needed until a newer release tag is available; do not generate notes or create/update files. In particular, a project prerelease for a version that is already stable does not count as a newer release. -4. Use GitHub's generated release notes as the default source; the user does not need to provide a separate raw file. For `dotnetcore/BootstrapBlazor`, generate notes without creating a release: +4. Use GitHub's generated release notes as the default source; the user does not need to provide a separate raw file. This step requires the `gh` CLI, an authenticated GitHub account (`gh auth status`), and network access; cloud or CI agents may not have them. For `dotnetcore/BootstrapBlazor`, generate notes without creating a release: ```sh gh api --method POST repos/dotnetcore/BootstrapBlazor/releases/generate-notes \ @@ -22,7 +22,7 @@ Create matching English and Chinese release-note drafts for this repository. Do --jq .body ``` - Replace the example tag values with the confirmed target and previous tags. The endpoint returns generated text; it does not publish a release. The GitHub draft page at `https://github.com/dotnetcore/BootstrapBlazor/releases/new` can also generate the same source. If GitHub access or authentication is unavailable, explain the blocker and use raw change data only if the user provides it. + Replace the example tag values with the confirmed target and previous tags. The endpoint returns generated text; it does not publish a release. The GitHub draft page at `https://github.com/dotnetcore/BootstrapBlazor/releases/new` can also generate the same source. If the `gh` CLI, authentication, or GitHub access is unavailable, explain the blocker and use raw change data only if the user provides it. 5. If the user supplies a source file or explicit change list, use that as the scope instead of adding unrelated PRs from elsewhere. ## Curate the changes diff --git a/AGENTS.md b/AGENTS.md index 007a98b7120..deae768574b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,3 +31,4 @@ - 依赖:`docs/agents/dependencies.md` - PR 规范:`docs/agents/pr-guide.md` - 新组件流程:`docs/agents/component-checklist.md` +- 发布说明:涉及生成、翻译或校对 release notes 时,读取并遵循 `.agents/skills/release-notes/SKILL.md`;这是仓库级 skill 的唯一副本。各工具接入方式见 `docs/agents/skills.md`。 diff --git a/docs/agents/skills.md b/docs/agents/skills.md new file mode 100644 index 00000000000..7fe55f723da --- /dev/null +++ b/docs/agents/skills.md @@ -0,0 +1,38 @@ +# 仓库级 Agent Skills + +配置 AI agent 的 skill 目录,或需要让某个工具使用本仓库的 release notes skill 前必须读取本文件,并遵守根 `AGENTS.md`。 + +## 唯一来源 + +仓库级 skill 统一放在 `.agents/skills//SKILL.md`,随仓库分发,且每个 skill 只有一份: + +- `.agents/skills/release-notes/SKILL.md`:生成、翻译、校对中英文版本发布说明。 + +`.agents/skills/` 是 Agent Skills 开放标准的跨工具目录。`SKILL.md` 的 frontmatter 只保留 `name` 和 `description`,不写任何工具专有字段;新增 skill 时同样遵守。 + +## 各工具接入方式 + +| 工具 | 接入方式 | +| --- | --- | +| GitHub Copilot(CLI、云端 agent、VS Code / VS / JetBrains) | 自动发现,无需配置 | +| Codex、Cursor、Gemini CLI | 自动发现,无需配置 | +| Claude Code、WorkBuddy 等只读 `AGENTS.md` 的工具 | 按根 `AGENTS.md` 的指路读取该文件;不会自动加载,也不能用斜杠命令调用 | + +需要斜杠调用时,可在自己的用户级目录做一次性安装(这些目录被 `.gitignore` 忽略,不要提交): + +```sh +mkdir -p ~/.claude/skills ~/.workbuddy/skills +cp -r .agents/skills/release-notes ~/.claude/skills/ +cp -r .agents/skills/release-notes ~/.workbuddy/skills/ +``` + +Windows PowerShell 可用 `Copy-Item -Recurse .agents/skills/release-notes $HOME\.workbuddy\skills\`。 + +## 约束 + +- 不要在 `.github/skills/`、`.claude/skills/` 等目录复制第二份 `SKILL.md`,避免内容漂移。 +- 不要修改 `.gitignore` 放行 `.claude`、`.workbuddy`;这些是个人工具目录,不属于仓库配置。 +- 不要用软链共享 skill:本仓库 `core.symlinks = false`,Windows 上会被当作普通文本文件。 +- `.github/agents/*.agent.md` 是 Copilot 自定义 agent(`target: github-copilot`),与 skill 无关,不要一并迁移。 +- skill 中的 `gh api` 需要 `gh` CLI、已登录的 GitHub 账号和网络;不可用时按 `SKILL.md` 内的降级说明处理。 +- 本仓库不使用 `bootstrapblazor` skill