diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index f48183a..034c8b5 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,6 +1,6 @@ { "name": "Minecraft269-skills", - "description": "Minecraft269's Claude Code skill collection: GitHub PR Manager, Proactive Skill Discovery, Universal Project Kickoff Workflow", + "description": "Minecraft269's Claude Code skill collection: GitHub PR Manager, Universal Project Kickoff & Capability Discovery (with Fork mode), Quick Plugin Installer, PR Code Reviewer", "owner": { "name": "Minecraft269" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index d832530..1735e1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,4 +34,4 @@ ### 移除 - 删除已废弃的 `proactive-skill-discovery` 技能目录及文档 -- 清理所有残留引用(CLAUDE.md 项目结构树、scanner-patterns.md、hook-config.md) +- 将残留引用转为历史说明和迁移指南(CLAUDE.md 项目结构树标注"已吸收"、scanner-patterns.md/hook-config.md 保留合并迁移说明) diff --git a/skills/universal-project-kickoff/SKILL.md b/skills/universal-project-kickoff/SKILL.md index 668811e..435130e 100644 --- a/skills/universal-project-kickoff/SKILL.md +++ b/skills/universal-project-kickoff/SKILL.md @@ -93,10 +93,17 @@ Match the following patterns in the user's message (case-insensitive): | "fork" / "participate" / "contribute" / "submit PR" / "upstream" **+** "project" / "repo" / "open source" / "code" / "repository" | 🍴 Fork Project | → Step 0a Fork Branch | **Matching Rules:** -- If a **unique intent** matches → route directly, skip `AskUserQuestion`, confirm with one sentence before routing (e.g., "I see you want to [intent], let's get started…") -- If **multiple intents match** or **no match** → use `AskUserQuestion` +- If a **unique intent** matches → **⚠️ must confirm with the user before routing.** Use `AskUserQuestion`: + > "I detected you want to [intent]. Is that correct?" -#### 0.2 Interactive Prompt (Only When Intent Is Unclear) + | Option | Description | + |--------|-------------| + | ✅ **Yes, proceed** | Continue with the detected intent workflow | + | ❌ **No, let me choose** | Fall through to 0.2 Interactive Prompt to let the user pick manually | + +- If **multiple intents match** or **no match** → use `AskUserQuestion` (see 0.2 Interactive Prompt) + +#### 0.2 Interactive Prompt > "What would you like to do?" @@ -212,10 +219,19 @@ The "Fork Project" intent requires executing five steps in order: Get Repository 1. First check if a fork already exists: - Use `gh repo list --json name --jq '.[].name'` or `mcp__plugin_github_github__list_commits` to check -2. If not exists → execute fork: +2. **⚠️ Always confirm with the user before forking.** Use `AskUserQuestion`: + > "I'm about to fork `owner/repo` to your GitHub account. Proceed?" + + | Option | Description | + |--------|-------------| + | ✅ **Fork this repo** | Fork `owner/repo` to your account | + | ❌ **Cancel** | Abort the Fork operation | + + If user confirms → execute fork: - Prefer `gh repo fork --clone=false` (more reliable) - Fallback: GitHub MCP `mcp__plugin_github_github__fork_repository` -3. If exists → `AskUserQuestion`: + If user cancels → stop the Fork sub-process and return to intent selection. +3. If a fork already exists → `AskUserQuestion`: > "I found you already forked ``. Would you like to use the existing fork?" | Option | Description | @@ -228,22 +244,46 @@ The "Fork Project" intent requires executing five steps in order: Get Repository 4. After successful fork, record variables: - `_FORK_UPSTREAM = "owner/repo"` (upstream repository) - `_FORK_REPO = "your-username/repo"` (your fork) +6. **⚠️ Confirm transition to clone.** Use `AskUserQuestion`: + > "✅ Forked successfully! Would you like to clone it to your local machine now?" + + | Option | Description | + |--------|-------------| + | ✅ **Clone now** | Proceed to Step 0a-fork-3 (Clone to Local) | + | ⏭️ **Stop here** | Keep the fork on GitHub; you can clone it later manually | **Step 0a-fork-3: Clone to Local** 1. Ask the user for the clone target directory (default: `` under the current workspace) -2. Check if the directory already exists locally: - - Not exists → execute `gh repo clone ` or `git clone https://github.com/.git` - - Exists → `AskUserQuestion`: - > "A directory with the same name already exists locally. How would you like to proceed?" - - ✅ Reuse existing directory / 🔄 Re-clone / ❌ Cancel -3. After cloning, set up upstream: +2. **⚠️ Always confirm with the user before cloning.** Use `AskUserQuestion`: + > "I'll clone `your-username/repo` to ``. Proceed?" + + | Option | Description | + |--------|-------------| + | ✅ **Clone to this directory** | Clone the repository to the specified path | + | 📁 **Choose a different directory** | Let the user specify a different target directory | + | ❌ **Cancel** | Abort the Clone operation | + +3. If user confirms: + - Check if the directory already exists locally: + - Not exists → execute `gh repo clone ` or `git clone https://github.com/.git` + - Exists → `AskUserQuestion`: + > "A directory with the same name already exists locally. How would you like to proceed?" + - ✅ Reuse existing directory / 🔄 Re-clone / ❌ Cancel +4. After cloning, set up upstream: ```bash cd git remote add upstream https://github.com/.git # If not already added git fetch upstream ``` -4. Record `_FORK_LOCAL_PATH = ""` +5. Record `_FORK_LOCAL_PATH = ""` +6. **⚠️ Confirm transition to project analysis.** Use `AskUserQuestion`: + > "✅ Cloned successfully! Would you like to scan the project tech stack now?" + + | Option | Description | + |--------|-------------| + | ✅ **Start Analysis** | Proceed to Step 0a-fork-4 (Project Analysis) | + | ⏭️ **Skip Analysis** | Go directly to Step 0a-fork-5 (Contribution Workflow Guide) | **Step 0a-fork-4: Project Analysis** @@ -263,8 +303,13 @@ The "Fork Project" intent requires executing five steps in order: Get Repository 4. Display project overview summary (tech stack + contribution guide highlights + license type) **Linkage Hooks (only when PACKAGE_MODE = true):** -After project analysis completes, match `integrates_with: pr-management`: -- If sibling skill `github-pr-manager` is detected as available → prompt: "💡 After making changes, you can use the **GitHub PR Manager** to create and manage your Pull Request." + +⚠️ Before showing linkage suggestions, ask the user: +> "I can suggest related tools that may help with your contribution workflow. Would you like to see recommendations?" + +- If user agrees → match `integrates_with: pr-management`: + - If sibling skill `github-pr-manager` is detected as available → prompt: "💡 After making changes, you can use the **GitHub PR Manager** to create and manage your Pull Request." +- If user declines → skip linkage hooks, proceed directly to Step 0a-fork-5. **Step 0a-fork-5: Contribution Workflow Guide** @@ -285,8 +330,12 @@ After project analysis completes, match `integrates_with: pr-management`: - Let the user enter a branch name, or auto-suggest based on description 3. **Linkage Hooks (only when PACKAGE_MODE = true):** - - Match `integrates_with: pr-management` → prompt: "💡 After making changes, you can use the **GitHub PR Manager** to create and manage your Pull Request." - - Match `git-commit` within `integrates_with: plugin-installation` → prompt: "💡 When committing code, you can use the **Git Commit Helper** to auto-generate Conventional Commits messages." + + ⚠️ Before showing tool suggestions, ask the user: + > "I can recommend related tools (PR Manager, Commit Helper) for your contribution workflow. Would you like to see them?" + + - If user agrees → match sibling skills and show recommendations (PR Manager, Git Commit Helper) + - If user declines → skip directly to step 4 (summarize next steps) 4. Summarize next steps: > "Your project is ready. Next steps: make changes → `git add` + `git commit` → `git push origin ` → create PR. Let me know if you need any help." @@ -382,7 +431,7 @@ Scan existing projects. Use `Glob` to check for the following files (extended de **Output:** Project fingerprint (comma-separated tags, e.g., `java, spring-boot, maven, postgresql`). -**Linkage Hooks (only when PACKAGE_MODE = true):** Check `.git/config` for a GitHub remote. If found, match `integrates_with: pr-management`, prompt "💡 GitHub project detected. It is recommended to use the **GitHub PR Manager** to manage Pull Requests for this repository." +**Linkage Hooks (only when PACKAGE_MODE = true):** If a GitHub remote is detected in `.git/config`, do NOT prompt immediately. Instead, note the finding silently and defer the recommendation to Step 0c-4 (Interactive Recommendation), where all linkage suggestions are presented together with user opt-in. --- @@ -491,8 +540,10 @@ Provide the following options: **Linkage Hooks (only when PACKAGE_MODE = true):** -Mark uninstalled plugins in the recommendation list with 🆕. After user selection, match `integrates_with: plugin-installation`: -- If the user selected an uninstalled capability → prompt: "💡 It looks like [name] is not yet installed. Would you like to use the **Quick Plugin Installer** to install it?" +Mark uninstalled plugins in the recommendation list with 🆕. After user selection in 0c-4, if any selected item is uninstalled: +- First ask: "💡 Some of your selections are not yet installed. Would you like help installing them?" +- If user agrees → match `integrates_with: plugin-installation` and provide specific installation prompts (e.g., "Would you like to use the **Quick Plugin Installer** to install [name]?") +- If user declines → note the uninstalled items but proceed without further prompts --- @@ -631,8 +682,12 @@ Ask the user to list all desired features for the first version, then: **Linkage Hooks (only when PACKAGE_MODE = true):** -After confirming the project tech stack, scan sibling skills' `capabilities`, match `integrates_with: plugin-installation`: -- Match succeeds → prompt user: "💡 I see your project uses [tech stack]. Would you like to install related MCP Servers (such as GitHub MCP, Playwright, Context7) to enhance the development experience?" +After confirming the project tech stack, **⚠️ first ask the user if they want plugin recommendations** before scanning: +> "I can check if there are related MCP Servers (such as GitHub MCP, Playwright, Context7) that would help with your [tech stack] project. Would you like me to check?" + +- If user agrees → scan sibling skills' `capabilities`, match `integrates_with: plugin-installation`, show recommendations +- If user declines → skip linkage hooks for this step, continue to Step 3 +- Do NOT show recommendations without prior opt-in. ### Step 3: Quick Risk Assessment Have the user respond to: @@ -685,11 +740,17 @@ After `/init` completes: **Linkage Hooks (only when PACKAGE_MODE = true, after 6c succeeds):** -After CLAUDE.md is generated, this skill already has built-in complete skill discovery capability (Step 0c), so it can directly prompt the user: -> "✅ CLAUDE.md has been generated. Would you like to scan the current project's tech stack and recommend matching skills and plugins?" +⚠️ Before showing any post-init suggestions, ask the user once: +> "✅ CLAUDE.md has been generated. I can also scan your project's tech stack and recommend matching skills and plugins. Would you like me to do that?" -(No need for cross-skill linkage via `integrates_with: skill-discovery` — this capability is built into this skill.) -- Also check other sibling skills' `integrates_with`, and prompt if matches are found +| Option | Description | +|--------|-------------| +| ✅ **Yes, scan and recommend** | Execute Step 0c capability discovery for this project | +| ❌ **No, I'm done** | Skip all further suggestions; end the kickoff workflow here | + +This skill already has built-in complete skill discovery capability (Step 0c). Do NOT separately trigger cross-skill linkage via `integrates_with: skill-discovery` — it's redundant. If user agrees, execute Step 0c directly. + +If the user chose "Yes, scan and recommend", after Step 0c completes, do NOT trigger additional linkage hooks — the user has already received recommendations. #### 6d. Fallback Plan If the user chooses not to run `/init`, output the complete startup summary (see template below) and inform: @@ -822,6 +883,67 @@ Minimal mode content: --- +## Examples + +### Example 1: Java Spring Boot Project + +**Input:** User opens project with `pom.xml`, Spring Boot starter dependencies. + +**Project fingerprint:** `java, spring-boot, maven` + +**Recommended Skills (top 5):** +| # | Name | Description | Match Reason | Source | +|---|------|-------------|-------------|--------| +| 1 | `springboot-patterns` | Spring Boot development patterns | Direct Spring Boot framework match | community | +| 2 | `java-pro` | Java professional development | Java language match | community | +| 3 | `springboot-tdd` | TDD development workflow | Spring Boot + testing match | community | +| 4 | `springboot-security` | Spring Boot security | Spring Boot framework match | community | +| 5 | `git-workflow` | Git workflow | General development skill | community | + +**Recommended Plugins:** +| # | Name | Description | Match Reason | Type | +|---|------|-------------|-------------|------| +| 1 | `plugin:github:github` | GitHub PR/Issue management | General development plugin | MCP | +| 2 | `plugin:context7:context7` | Documentation lookup | Referencing Spring Boot docs | MCP | + +*After user selects both plugins, Step 0c-5 would show their available commands (e.g., `mcp__github__create_pull_request`, `mcp__context7__query-docs`) plus relevant slash commands (`/commit`, `/code-review`, `/create-pr`).* + +### Example 2: React + Vite Frontend Project + +**Input:** User opens project with `package.json` (react, vite deps) and `vite.config.ts`. + +**Project fingerprint:** `javascript/typescript, react, vite, nodejs` + +**Recommended Skills (top 5):** +| # | Name | Description | Match Reason | Source | +|---|------|-------------|-------------|--------| +| 1 | `react-best-practices` | React best practices | Direct React framework match | community | +| 2 | `frontend-patterns` | Frontend development patterns | Frontend domain match | community | +| 3 | `javascript-pro` | JS professional development | JavaScript language match | community | +| 4 | `vite-patterns` | Vite build patterns | Vite tool match | community | +| 5 | `ui-ux-designer` | UI/UX design | Frontend domain related | community | + +**Recommended Plugins:** +| # | Name | Description | Match Reason | Type | +|---|------|-------------|-------------|------| +| 1 | `plugin:playwright:playwright` | Browser automation testing | Frontend E2E testing | MCP | +| 2 | `plugin:github:github` | PR management | General development plugin | MCP | + +*After user selects, Step 0c-5 shows: `mcp__github__search_code`, `mcp__github__create_pull_request` plus slash commands `/frontend-design`, `/code-review`, `/commit`.* + +### Example 3: Unknown/Empty Project + +**Input:** Empty or unrecognized directory structure. + +**Behavior:** +- Display: "\u{1F195} No known project type detected. Here are general recommendations:" +- Skills: `git-workflow`, `code-review`, `commit`, `file-organizer` +- Plugins: `plugin:github:github` (PR/Issue), `plugin:longhand:longhand` (session memory) +- Selected commands (Step 0c-5): `/commit` (when committing code), `/code-review` (when reviewing code), `/discover` (when re-discovering) +- Offer: "If you'd like to see a full list of all installed capabilities, I can export the complete catalog for you." + +--- + ## Interaction Style - Use concise checklist-style questions, asking at most 3 questions at a time to avoid information overload. - Summarize and paraphrase the user's answers to ensure alignment. diff --git a/skills/universal-project-kickoff/locale/SKILL.cn.md b/skills/universal-project-kickoff/locale/SKILL.cn.md index e968308..56459ce 100644 --- a/skills/universal-project-kickoff/locale/SKILL.cn.md +++ b/skills/universal-project-kickoff/locale/SKILL.cn.md @@ -94,10 +94,17 @@ locale: zh-CN | "fork" / "参与" / "贡献" / "提 PR" / "contribute" / "上游" **+** "项目" / "仓库" / "开源" / "代码" / "repo" | 🍴 Fork 项目 | → Step 0a Fork 分支 | **匹配规则:** -- 若匹配到**唯一意图** → 直接分流,跳过 AskUserQuestion,在分流前用一句话确认(如"识别到你想要[意图],直接开始…") -- 若**多个意图匹配**或**无匹配** → 使用 `AskUserQuestion` 询问 +- 若匹配到**唯一意图** → **⚠️ 必须先向用户确认再分流。** 使用 `AskUserQuestion`: + > "识别到你想要[意图]。是否正确?" -#### 0.2 交互式询问(仅在意图不明确时使用) + | 选项 | 说明 | + |------|------| + | ✅ **是的,继续** | 进入对应意图的工作流 | + | ❌ **不对,让我自己选** | 回退到 0.2 交互式询问,让用户手动选择 | + +- 若**多个意图匹配**或**无匹配** → 使用 `AskUserQuestion` 询问(参见 0.2 交互式询问) + +#### 0.2 交互式询问 > "你想要做什么?" @@ -213,10 +220,19 @@ locale: zh-CN 1. 先检查是否已存在 fork: - 使用 `gh repo list --json name --jq '.[].name'` 或 `mcp__plugin_github_github__list_commits` 检查 -2. 若不存在 → 执行 fork: +2. **⚠️ 无论是否存在 fork,都先向用户确认。** 使用 `AskUserQuestion`: + > "我将在你的 GitHub 账户中 fork `owner/repo`。是否继续?" + + | 选项 | 说明 | + |------|------| + | ✅ **Fork 此仓库** | 将 `owner/repo` fork 到你的账户 | + | ❌ **取消** | 放弃 Fork 操作 | + + 若用户确认 → 执行 fork: - 优先使用 `gh repo fork --clone=false`(更可靠) - 备用:GitHub MCP `mcp__plugin_github_github__fork_repository` -3. 若已存在 → `AskUserQuestion`: + 若用户取消 → 停止 Fork 子流程,返回意图选择。 +3. 若已存在 fork → `AskUserQuestion`: > "检测到你已 fork 过 ``。是否使用已有 fork?" | 选项 | 说明 | @@ -229,22 +245,46 @@ locale: zh-CN 4. Fork 成功后记录变量: - `_FORK_UPSTREAM = "owner/repo"`(上游仓库) - `_FORK_REPO = "your-username/repo"`(你的 fork) +5. **⚠️ 确认是否继续 clone。** 使用 `AskUserQuestion`: + > "✅ Fork 成功!是否要 clone 到本地?" + + | 选项 | 说明 | + |------|------| + | ✅ **立即 clone** | 进入 Step 0a-fork-3(Clone 到本地) | + | ⏭️ **到此为止** | 保留 GitHub 上的 fork;以后可以手动 clone | **Step 0a-fork-3:Clone 到本地** 1. 询问用户 clone 目标目录(默认当前工作区下的 ``) -2. 检查本地是否已存在该目录: - - 不存在 → 执行 `gh repo clone ` 或 `git clone https://github.com/.git` - - 已存在 → `AskUserQuestion`: - > "本地已存在同名目录。怎么处理?" - - ✅ 复用现有目录 / 🔄 重新 clone / ❌ 取消 -3. Clone 后设置 upstream: +2. **⚠️ 无论目录是否存在,都先向用户确认 clone。** 使用 `AskUserQuestion`: + > "我将 clone `your-username/repo` 到 ``。是否继续?" + + | 选项 | 说明 | + |------|------| + | ✅ **Clone 到此目录** | 将仓库 clone 到指定路径 | + | 📁 **选择其他目录** | 让用户指定不同的目标目录 | + | ❌ **取消** | 放弃 Clone 操作 | + +3. 若用户确认: + - 检查本地是否已存在该目录: + - 不存在 → 执行 `gh repo clone ` 或 `git clone https://github.com/.git` + - 已存在 → `AskUserQuestion`: + > "本地已存在同名目录。怎么处理?" + - ✅ 复用现有目录 / 🔄 重新 clone / ❌ 取消 +4. Clone 后设置 upstream: ```bash cd git remote add upstream https://github.com/.git # 如尚未添加 git fetch upstream ``` -4. 记录 `_FORK_LOCAL_PATH = ""` +5. 记录 `_FORK_LOCAL_PATH = ""` +6. **⚠️ 确认是否继续项目分析。** 使用 `AskUserQuestion`: + > "✅ Clone 成功!是否扫描项目技术栈?" + + | 选项 | 说明 | + |------|------| + | ✅ **开始分析** | 进入 Step 0a-fork-4(项目分析) | + | ⏭️ **跳过分析** | 直接进入 Step 0a-fork-5(贡献工作流引导) | **Step 0a-fork-4:项目分析** @@ -264,8 +304,13 @@ locale: zh-CN 4. 展示项目概览摘要(技术栈 + 贡献指南要点 + 许可证类型) **联动钩子(仅 PACKAGE_MODE = true 时执行):** -在项目分析完成后,匹配 `integrates_with: pr-management`: -- 若检测到兄弟技能 `github-pr-manager` 可用 → 提示:"💡 完成改动后,可以使用 **GitHub PR 管理器** 来创建和管理你的 Pull Request。" + +⚠️ 在显示联动建议前,先询问用户: +> "我可以推荐一些与贡献工作流相关的工具。是否查看推荐?" + +- 若用户同意 → 匹配 `integrates_with: pr-management`: + - 若检测到兄弟技能 `github-pr-manager` 可用 → 提示:"💡 完成改动后,可以使用 **GitHub PR 管理器** 来创建和管理你的 Pull Request。" +- 若用户拒绝 → 跳过联动钩子,直接进入 Step 0a-fork-5。 **Step 0a-fork-5:贡献工作流引导** @@ -286,8 +331,12 @@ locale: zh-CN - 让用户输入分支名,或根据描述自动建议 3. **联动钩子(仅 PACKAGE_MODE = true)**: - - 匹配 `integrates_with: pr-management` → 提示:"💡 改动完成后,可使用 **GitHub PR 管理器** 创建和管理你的 Pull Request。" - - 匹配 `integrates_with: plugin-installation` 中的 `git-commit` → 提示:"💡 提交代码时,可使用 **Git 提交助手** 自动生成 Conventional Commits 消息。" + + ⚠️ 在显示工具建议前,先询问用户: + > "我可以推荐贡献工作流相关的工具(PR 管理器、提交助手)。是否查看?" + + - 若用户同意 → 匹配兄弟技能并展示推荐(PR 管理器、Git 提交助手) + - 若用户拒绝 → 直接跳到步骤 4(总结下一步) 4. 总结下一步: > "项目已就绪。接下来的流程:做改动 → `git add` + `git commit` → `git push origin ` → 创建 PR。如需帮助,随时告诉我。" @@ -383,7 +432,7 @@ locale: zh-CN **输出:** 项目指纹(逗号分隔标签,如 `java, spring-boot, maven, postgresql`)。 -**联动钩子(仅 PACKAGE_MODE = true):** 检测 `.git/config` 中 GitHub remote,若存在则匹配 `integrates_with: pr-management`,提示 "💡 检测到 GitHub 项目。推荐使用 **GitHub PR 管理器** 来管理此仓库的 Pull Request。" +**联动钩子(仅 PACKAGE_MODE = true):** 若检测到 `.git/config` 中有 GitHub remote,不立即提示。静默记录此发现,将推荐延迟到 Step 0c-4(交互式推荐),与其他联动建议统一展示并获取用户 opt-in。 --- @@ -492,8 +541,10 @@ locale: zh-CN **联动钩子(仅 PACKAGE_MODE = true):** -对推荐列表中未安装的插件标记 🆕。用户选择后,匹配 `integrates_with: plugin-installation`: -- 若用户选择了未安装的能力 → 提示:"💡 检测到你尚未安装 [name]。是否需要使用 **快速插件安装器** 来安装它?" +对推荐列表中未安装的插件标记 🆕。在 0c-4 用户选择后,若所选项目包含未安装插件: +- 先询问:"💡 你选择的部分项目尚未安装。是否需要帮助安装?" +- 若用户同意 → 匹配 `integrates_with: plugin-installation` 并提供具体安装指引(如"是否需要使用 **快速插件安装器** 来安装 [name]?") +- 若用户拒绝 → 记录未安装项但不继续提示 --- @@ -632,8 +683,12 @@ locale: zh-CN **联动钩子(仅 PACKAGE_MODE = true 时执行):** -确认项目技术栈后,扫描兄弟技能的 `capabilities`,匹配 `integrates_with: plugin-installation`: -- 匹配成功 → 提示用户:"💡 检测到你的项目使用 [技术栈]。是否需要安装相关的 MCP Server(如 GitHub MCP、Playwright、Context7)来增强开发体验?" +确认项目技术栈后,**⚠️ 先询问用户是否需要插件推荐**: +> "我可以检查是否有适合你的 [技术栈] 项目的 MCP Server(如 GitHub MCP、Playwright、Context7)。是否需要我检查?" + +- 若用户同意 → 扫描兄弟技能的 `capabilities`,匹配 `integrates_with: plugin-installation`,展示推荐 +- 若用户拒绝 → 跳过此步联动钩子,继续第三步 +- 禁止在未获得 opt-in 前展示推荐。 ### 第三步:快速风险摸底 让用户回答: @@ -686,11 +741,17 @@ locale: zh-CN **联动钩子(仅 PACKAGE_MODE = true 时执行,在 6c 成功后):** -CLAUDE.md 生成成功后,本技能已内置完整的技能发现能力(Step 0c),可直接提示用户: -> "✅ CLAUDE.md 已生成。是否需要扫描当前项目技术栈,推荐匹配的技能和插件?" +⚠️ 在显示任何后续建议前,仅询问一次: +> "✅ CLAUDE.md 已生成。我还可以扫描你的项目技术栈,推荐匹配的技能和插件。是否需要我执行?" + +| 选项 | 说明 | +|------|------| +| ✅ **是,扫描并推荐** | 对此项目执行 Step 0c 能力发现 | +| ❌ **不需要,结束了** | 跳过所有后续建议;结束 kickoff 工作流 | + +本技能已内置完整的技能发现能力(Step 0c)。不要单独触发 `integrates_with: skill-discovery` 跨技能联动——是冗余操作。若用户同意,直接执行 Step 0c。 -(无需通过 `integrates_with: skill-discovery` 跨技能联动——此能力内置于本技能中。) -- 同时检查其他兄弟技能的 `integrates_with`,如发现匹配则一并提示 +若用户选择「是,扫描并推荐」,Step 0c 完成后不要再触发额外的联动钩子——用户已收到推荐。 #### 6d. 后备方案 如果用户选择不执行 `/init`,输出完整的启动摘要(见下方模板),并告知: @@ -823,6 +884,67 @@ CLAUDE.md 生成成功后,本技能已内置完整的技能发现能力(Step --- +## 示例 + +### 示例 1:Java Spring Boot 项目 + +**输入:** 用户打开包含 `pom.xml` 的项目,Spring Boot starter 依赖。 + +**项目指纹:** `java, spring-boot, maven` + +**推荐技能(top 5):** +| # | 名称 | 描述 | 匹配理由 | 来源 | +|---|------|------|---------|------| +| 1 | `springboot-patterns` | Spring Boot 开发模式 | Spring Boot 框架直接匹配 | community | +| 2 | `java-pro` | Java 专业开发 | Java 语言匹配 | community | +| 3 | `springboot-tdd` | TDD 开发流程 | Spring Boot + 测试匹配 | community | +| 4 | `springboot-security` | Spring Boot 安全 | Spring Boot 框架匹配 | community | +| 5 | `git-workflow` | Git 工作流 | 通用开发技能 | community | + +**推荐插件:** +| # | 名称 | 描述 | 匹配理由 | 类型 | +|---|------|------|---------|------| +| 1 | `plugin:github:github` | GitHub PR/Issue 管理 | 通用开发插件 | MCP | +| 2 | `plugin:context7:context7` | 文档查询 | 查阅 Spring Boot 文档 | MCP | + +*用户选择两个插件后,Step 0c-5 会展示其可用命令(如 `mcp__github__create_pull_request`、`mcp__context7__query-docs`)以及相关斜杠命令(`/commit`、`/code-review`、`/create-pr`)。* + +### 示例 2:React + Vite 前端项目 + +**输入:** 用户打开包含 `package.json`(react、vite 依赖)和 `vite.config.ts` 的项目。 + +**项目指纹:** `javascript/typescript, react, vite, nodejs` + +**推荐技能(top 5):** +| # | 名称 | 描述 | 匹配理由 | 来源 | +|---|------|------|---------|------| +| 1 | `react-best-practices` | React 最佳实践 | React 框架直接匹配 | community | +| 2 | `frontend-patterns` | 前端开发模式 | 前端领域匹配 | community | +| 3 | `javascript-pro` | JS 专业开发 | JavaScript 语言匹配 | community | +| 4 | `vite-patterns` | Vite 构建模式 | Vite 工具匹配 | community | +| 5 | `ui-ux-designer` | UI/UX 设计 | 前端领域相关 | community | + +**推荐插件:** +| # | 名称 | 描述 | 匹配理由 | 类型 | +|---|------|------|---------|------| +| 1 | `plugin:playwright:playwright` | 浏览器自动化测试 | 前端 E2E 测试 | MCP | +| 2 | `plugin:github:github` | PR 管理 | 通用开发插件 | MCP | + +*用户选择后,Step 0c-5 展示:`mcp__github__search_code`、`mcp__github__create_pull_request` 以及斜杠命令 `/frontend-design`、`/code-review`、`/commit`。* + +### 示例 3:未知/空项目 + +**输入:** 空目录或无法识别的目录结构。 + +**行为:** +- 显示:"🆕 未检测到已知项目类型。以下是通用推荐:" +- 技能:`git-workflow`、`code-review`、`commit`、`file-organizer` +- 插件:`plugin:github:github`(PR/Issue)、`plugin:longhand:longhand`(会话记忆) +- 已选命令(Step 0c-5):`/commit`(提交代码时)、`/code-review`(审查代码时)、`/discover`(重新发现时) +- 提示:"如需查看所有已安装的能力,我可以为您导出完整列表。" + +--- + ## 交互风格 - 使用简洁的清单式提问,每次最多问 3 个问题,避免信息过载。 - 对用户的回答进行总结并复述,确保对齐。 diff --git a/skills/universal-project-kickoff/references/scanner-patterns.cn.md b/skills/universal-project-kickoff/references/scanner-patterns.cn.md index 131fb28..9497e80 100644 --- a/skills/universal-project-kickoff/references/scanner-patterns.cn.md +++ b/skills/universal-project-kickoff/references/scanner-patterns.cn.md @@ -1,6 +1,6 @@ # Scanner Patterns Reference -Detailed reference for the universal-project-kickoff skill's scanning and matching engine (proactive-skill-discovery capabilities merged here). +universal-project-kickoff 技能扫描与匹配引擎的详细参考文档(已合并原 proactive-skill-discovery 的能力)。 ## Project Fingerprint Detection Map