Community编程与开发github.com

mattpocock/wizard

生成一个交互式 bash 向导脚本,逐步引导人类完成只有他们能执行的操作。适用于配置基础设施、设置凭据或 CI 密钥、操作不熟悉的第三方仪表板,或执行一次性迁移或切换。不要为 AI 自己能完成的步骤调用此技能。

wizard 是什么?

Wizard 是一种 bash 脚本工具,旨在将繁琐的手动过程(如配置第三方服务、设置 CI 密钥、执行一次性迁移)转化为分步交互式向导。它通过模板化脚本 `template.sh` 提供了所有底层 UX 支持:分阶段进度显示、确认关卡、跨平台 URL 打开(包括 WSL)、隐藏输入秘密、幂等地更新 `.env`、写入 `gh secret`/`gh variable`,以及结束摘要。用户只需在脚本的 `STAGES` 标记之上定义各阶段和捕获的值,无需修改底层的库代码。该技能强调从仓库上下文(如 `.env.example`、GitHub Actions 工作流中的 `secrets.*` 引用)中自动识别需要捕获的值,并确保每个阶段都有明确的指令、目标位置和可见性标志。默认情况下,向导是临时的,仅在需要可重复的初始化路径时才提交到仓库。支持平台:任何能运行 bash 的系统,包括 WSL,以及 GitHub CLI 对应的 CI 集成。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mattpocock/skills/tree/main/skills/engineering/wizard

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

向导

向导 是一个 bash 脚本,它逐步引导人类完成一个手动流程——这个流程手动做既繁琐,每次都要重新向 AI 解释也令人厌烦。它会打开每个 URL,精确说明要点击和复制的内容,捕获这些值,将它们写入正确的位置(.env、GitHub 密钥),在每个阶段都进行确认,并显示剩余阶段数。它可能配置第三方服务、运行一次性迁移,或让项目从一个状态过渡到另一个状态。

令人愉悦的用户体验已经由 template.sh 解决:分阶段进度、确认关卡、跨平台 URL 打开(包括 WSL)、隐藏输入秘密、幂等的 .env 更新、gh secret/gh variable 写入,以及结束摘要。你的工作只是确定流程的范围并编写它的各个阶段。 每个向导中 STAGES 标记之上的库代码都是相同的;这种一致性正是关键:永远不要手动编辑它。

默认情况下,向导是临时的:为一次运行而构建,保存到临时目录或 scripts/ 路径,任务完成后删除。只有当用户希望有一个可重复的设置路径且该路径应存在于仓库中时,才将其提交。

流程

1. 确定流程范围

列出每个手动步骤——人类必须执行且每个被捕获的值都在其中。首先阅读仓库,不要凭空提问:

  • 对于设置:.env、.env.example、.env.*、README、docker-compose*、框架配置以及 .github/workflows/*(每个 secrets.* / vars.* 引用都是向导必须产生的值)。
  • 对于迁移或过渡:当前状态、目标状态以及两者之间不可逆的操作。

然后向用户展示排序后的阶段列表以及每个阶段产生的值,并确认:用户可以添加、删除或重新排序。

完成条件: 每个阶段都有名称且按顺序排列,对于每个被捕获的值,你知道 (a) 人类从哪里获取它,(b) 它写入到哪里(.env、GitHub 密钥、两者都写,或不写;有些阶段只是纯操作),以及 (c) 它是否是秘密(隐藏输入)还是公开的。

2. 规划每个阶段的路径

为每个阶段编写人类遵循的精确路径:要打开哪个 URL,在那里做什么,值在哪里显示,它填充哪个变量:例如“仪表板 → 开发者 → API 密钥 → 显示测试密钥 → 复制”。如果你实际上不知道当前的 UI 或确切的命令,说出来并询问用户或查看文档:永远不要编造可能不存在的步骤。

完成条件: 每个阶段都对应到陌生人也能遵循的具体指令。

3. 编写向导脚本

将 template.sh 复制到目标路径。按照依赖顺序,用每个步骤一个 stage 替换示例阶段。使用库中的辅助函数:stage、say/step、open_url、ask/ask_secret、write_env、set_secret/set_var、pause/confirm。将 TOTAL_STAGES 设置为你编写的阶段数量。

保持模板设定的标准:在询问其值之前先打开 URL,对任何秘密内容使用 ask_secret,对每个持久化的值使用 write_env,只对 CI 实际需要的值使用 set_secret,在任何不可逆操作之前使用 confirm。每个 stage 会清屏,这样只有当前步骤可见:保持一个阶段只做一项任务,这样人类需要的内容就不会滚走。不要触碰标记以上的库代码。

4. 验证并移交

  • bash -n <script>;如果可用则运行 shellcheck。
  • chmod +x <script>。
  • 不要自己完整运行它:它会打开浏览器并阻塞等待输入。改为静态跟踪它:步骤 1 中的每个值都被捕获并写入步骤 1 指定的位置,并且每个 set_secret 名称与 CI 中的 secrets.* 引用完全匹配。
  • 告诉用户如何运行它。如果这是一个可重复的设置路径,提交它并在 README 中链接它,以便下一个人运行脚本而不是询问 AI。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mattpocock/ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

mattpocock/caveman

Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman.

mattpocock/claude-handoff

Hand the current conversation off to a fresh background agent that picks up the work immediately.

mattpocock/codebase-design

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock/design-an-interface

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

mattpocock/diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

mattpocock/diagnosing-bugs

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

mattpocock/domain-modeling

Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.

mattpocock/edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

mattpocock/git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

mattpocock/grilling

Grill the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses any 'grill' trigger phrases.

mattpocock/grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

mattpocock/grill-with-docs

Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.

mattpocock/handoff

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock/implement

Implement a piece of work based on a PRD or set of issues.

mattpocock/implement-spec

Implement a specification in code.

mattpocock/improve-codebase-architecture

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock/loop-me

Grill me about specs for the workflows I want to build, within this workspace.

mattpocock/migrate-to-shoehorn

Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

mattpocock/obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

相关技能