wtf.setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Setup

安装设置

Pre-flight check and installer for the WTF workflow. Validates the GitHub CLI, installs required extensions, ensures
.github/ISSUE_TEMPLATE/
contains all required templates, creates all lifecycle labels, and installs the PR template so both agents and humans can create structured issues and pull requests.
WTF工作流的预检与安装工具。验证GitHub CLI,安装所需扩展,确保
.github/ISSUE_TEMPLATE/
包含所有必填模板,创建全生命周期标签,并安装PR模板,以便Agent和人员都能创建结构化的问题与拉取请求。

Process

流程

1. Verify
gh
is installed

1. 验证
gh
已安装

bash
gh --version
If not found: tell the user that the GitHub CLI is required, link them to https://cli.github.com, and stop. Do not proceed until
gh
is confirmed installed.
bash
gh --version
若未找到:告知用户需要安装GitHub CLI,链接至https://cli.github.com,然后停止操作。确认`gh`安装完成前不得继续。

2. Verify
gh
is authenticated

2. 验证
gh
已完成认证

bash
gh auth status
If not authenticated: tell the user to run
gh auth login
and stop. Do not proceed until authentication is confirmed.
bash
gh auth status
若未认证:告知用户运行
gh auth login
并停止操作。确认认证完成前不得继续。

3. Check and install required extensions

3. 检查并安装所需扩展

bash
gh extension list
Check the output for both of the following extensions. For each that is missing, install it:
bash
undefined
bash
gh extension list
检查输出中是否包含以下两个扩展。对于缺失的扩展,执行安装:
bash
undefined

Sub-issue hierarchy (epic → feature → task)

子问题层级结构(epic → feature → task)

gh extension install yahsan2/gh-sub-issue
gh extension install yahsan2/gh-sub-issue

Issue dependency tracking (X blocks Y)

问题依赖追踪(X 阻塞 Y)

gh extension install xiduzo/gh-issue-dependency

If installation fails (e.g. network error, permissions), warn the user that relationship tracking will be unavailable until the extension is installed. Note the failure — it will be included in the final status report.

After attempting installation, verify the command syntax for any newly installed extension:

```bash
gh sub-issue --help
gh issue-dependency --help
Record two booleans for the final report:
  • gh-sub-issue-available
    : true if
    yahsan2/gh-sub-issue
    is installed and working
  • gh-issue-dependency-available
    : true if
    xiduzo/gh-issue-dependency
    is installed and working
gh extension install xiduzo/gh-issue-dependency

若安装失败(如网络错误、权限问题),向用户发出警告,说明在扩展安装完成前,关系追踪功能将无法使用。记录失败情况——该信息会包含在最终状态报告中。

尝试安装后,验证新安装扩展的命令语法:

```bash
gh sub-issue --help
gh issue-dependency --help
为最终报告记录两个布尔值:
  • gh-sub-issue-available
    :若
    yahsan2/gh-sub-issue
    已安装且可用则为true
  • gh-issue-dependency-available
    :若
    xiduzo/gh-issue-dependency
    已安装且可用则为true

4. Detect repo context

4. 检测仓库上下文

bash
gh repo view --json nameWithOwner -q .nameWithOwner
If this fails (not inside a git repo, or no GitHub remote), warn the user and note that issue creation will not work until the repo is connected to GitHub. Continue to the template check regardless.
bash
gh repo view --json nameWithOwner -q .nameWithOwner
若此命令失败(不在git仓库内,或无GitHub远程仓库),向用户发出警告,并说明在仓库连接到GitHub前,问题创建功能将无法使用。无论结果如何,继续执行模板检查步骤。

5. Check issue templates

5. 检查问题模板

Check whether
.github/ISSUE_TEMPLATE/
exists and contains all four required templates:
bash
ls .github/ISSUE_TEMPLATE/
Required files:
  • BUG.md
  • EPIC.md
  • FEATURE.md
  • TASK.md
For each missing file, copy it from this skill's bundled references:
bash
mkdir -p .github/ISSUE_TEMPLATE
检查
.github/ISSUE_TEMPLATE/
是否存在,且包含所有四个必填模板:
bash
ls .github/ISSUE_TEMPLATE/
必填文件:
  • BUG.md
  • EPIC.md
  • FEATURE.md
  • TASK.md
对于每个缺失的文件,从本Skill的捆绑参考文件中复制:
bash
mkdir -p .github/ISSUE_TEMPLATE

Copy each missing template from the skill's references folder.

从Skill的参考文件夹中复制每个缺失的模板。

The references folder is at: skills/wtf-setup/references/

参考文件夹路径为:skills/wtf-setup/references/

cp skills/wtf-setup/references/BUG.md .github/ISSUE_TEMPLATE/BUG.md cp skills/wtf-setup/references/EPIC.md .github/ISSUE_TEMPLATE/EPIC.md cp skills/wtf-setup/references/FEATURE.md .github/ISSUE_TEMPLATE/FEATURE.md cp skills/wtf-setup/references/TASK.md .github/ISSUE_TEMPLATE/TASK.md

Only copy files that are missing — do not overwrite existing templates. After copying, list the final contents of `.github/ISSUE_TEMPLATE/` to confirm.
cp skills/wtf-setup/references/BUG.md .github/ISSUE_TEMPLATE/BUG.md cp skills/wtf-setup/references/EPIC.md .github/ISSUE_TEMPLATE/EPIC.md cp skills/wtf-setup/references/FEATURE.md .github/ISSUE_TEMPLATE/FEATURE.md cp skills/wtf-setup/references/TASK.md .github/ISSUE_TEMPLATE/TASK.md

仅复制缺失的文件——不得覆盖现有模板。复制完成后,列出`.github/ISSUE_TEMPLATE/`的最终内容以确认。

6. Check PR template

6. 检查PR模板

Check whether
.github/pull_request_template.md
exists:
bash
ls .github/pull_request_template.md 2>/dev/null
If missing, copy it from the skill's bundled references:
bash
cp skills/wtf-setup/references/pull_request_template.md .github/pull_request_template.md
Do not overwrite if it already exists.
检查
.github/pull_request_template.md
是否存在:
bash
ls .github/pull_request_template.md 2>/dev/null
若缺失,从本Skill的捆绑参考文件中复制:
bash
cp skills/wtf-setup/references/pull_request_template.md .github/pull_request_template.md
若文件已存在,不得覆盖。

7. Create required GitHub labels

7. 创建所需GitHub标签

Create all lifecycle labels the workflow depends on. Using
--force
makes the command idempotent — it updates the description/color if the label already exists and creates it if it does not:
bash
gh label create epic        --color 5319e7 --description "Strategic initiative spanning multiple features"      --force
gh label create feature     --color 0075ca --description "User-facing capability delivered as a vertical slice" --force
gh label create task        --color e4e669 --description "Implementable vertical slice of a Feature"            --force
gh label create bug         --color d73a4a --description "Something is broken"                                  --force
gh label create implemented --color 0e8a16 --description "Implementation complete — ready for QA"              --force
gh label create designed    --color f9d0c4 --description "Design coverage added to the Task"                   --force
gh label create verified    --color 006b75 --description "QA verified — ready for merge"                       --force
If any label creation fails (e.g. insufficient permissions), warn the user — note that the affected skills will fall back to creating labels on first use.
Closing convention: GitHub has no native setting to require PR-based closure, so this is enforced by skill behavior. Issues are only "closed as completed" when a merged PR contains
Closes #<n>
. Direct
gh issue close
calls are reserved for
--reason "not planned"
(won't implement) and
--reason "duplicate"
only. Surface this convention in the status report.
创建工作流依赖的所有生命周期标签。使用
--force
参数可确保命令的幂等性——若标签已存在则更新其描述/颜色,若不存在则创建:
bash
gh label create epic        --color 5319e7 --description "Strategic initiative spanning multiple features"      --force
gh label create feature     --color 0075ca --description "User-facing capability delivered as a vertical slice" --force
gh label create task        --color e4e669 --description "Implementable vertical slice of a Feature"            --force
gh label create bug         --color d73a4a --description "Something is broken"                                  --force
gh label create implemented --color 0e8a16 --description "Implementation complete — ready for QA"              --force
gh label create designed    --color f9d0c4 --description "Design coverage added to the Task"                   --force
gh label create verified    --color 006b75 --description "QA verified — ready for merge"                       --force
若任何标签创建失败(如权限不足),向用户发出警告——说明受影响的Skill会在首次使用时自动创建标签作为 fallback。
关闭约定: GitHub没有原生设置要求基于PR关闭问题,因此此规则由Skill行为强制执行。只有当合并的PR中包含
Closes #<n>
时,问题才会被“标记为已完成关闭”。直接调用
gh issue close
仅适用于
--reason "not planned"
(不会实现)和
--reason "duplicate"
(重复问题)的情况。请在状态报告中说明此约定。

8. Report status

8. 报告状态

Print a clear status summary covering every check:
WTF Setup — Status Report
─────────────────────────
gh CLI installed          ✅
gh authenticated          ✅
gh-sub-issue extension    ✅  (or ⚠️ not installed — relationship links unavailable)
gh-issue-dependency ext   ✅  (or ⚠️ not installed — dependency links unavailable)
Repo context              ✅  owner/repo  (or ⚠️ not detected)
Issue templates
  BUG.md                  ✅  (or ✅ installed from references)
  EPIC.md                 ✅  (or ✅ installed from references)
  FEATURE.md              ✅  (or ✅ installed from references)
  TASK.md                 ✅  (or ✅ installed from references)
PR template               ✅  (or ✅ installed from references)
GitHub labels             ✅  epic, feature, task, bug, implemented, designed, verified
─────────────────────────
Ready to use WTF. Start with `write-epic` to plan your first initiative.
If any item failed (gh not installed, not authenticated), replace the closing line with a clear "Fix the issues above before proceeding." and do not suggest next steps.
打印清晰的状态摘要,涵盖所有检查项:
WTF Setup — Status Report
─────────────────────────
gh CLI installed          ✅
gh authenticated          ✅
gh-sub-issue extension    ✅  (或 ⚠️ 未安装 — 关系链接不可用)
gh-issue-dependency ext   ✅  (或 ⚠️ 未安装 — 依赖链接不可用)
Repo context              ✅  owner/repo  (或 ⚠️ 未检测到)
Issue templates
  BUG.md                  ✅  (或 ✅ 从参考文件安装)
  EPIC.md                 ✅  (或 ✅ 从参考文件安装)
  FEATURE.md              ✅  (或 ✅ 从参考文件安装)
  TASK.md                 ✅  (或 ✅ 从参考文件安装)
PR template               ✅  (或 ✅ 从参考文件安装)
GitHub labels             ✅  epic, feature, task, bug, implemented, designed, verified
─────────────────────────
Ready to use WTF. Start with `write-epic` to plan your first initiative.
若有任何项失败(如gh未安装、未认证),将结尾行替换为清晰的“请先修复上述问题,再继续操作。”,且不给出下一步建议。

9. Offer to set up steering docs

9. 询问是否设置指导文档

If setup completed without fatal errors, call
AskUserQuestion
with:
  • question
    : "Setup complete. The steering docs (VISION.md, TECH.md, DESIGN.md, QA.md) capture your project's principles and standards — every skill reads them automatically. Would you like to create them now?"
  • header
    : "Steering docs"
  • options
    :
    [{label: "Yes — set them up now", description: "Run 
    steer-vision
     (it will chain to the others)"}, {label: "Not now", description: "Skip — skills will prompt you to create them on first use"}]
  • Yes → follow the
    steer-vision
    process (it will offer to chain to TECH, DESIGN, and QA at the end).
  • Not now → exit.
若设置完成且无致命错误,调用
AskUserQuestion
,参数如下:
  • question
    : "设置完成。指导文档(VISION.md、TECH.md、DESIGN.md、QA.md)用于记录项目的原则与标准——所有Skill都会自动读取这些文档。是否现在创建它们?"
  • header
    : "指导文档"
  • options
    :
    [{label: "是 — 现在设置", description: "运行
    steer-vision
    (后续会自动触发TECH、DESIGN和QA文档的设置)"}, {label: "暂时不设置", description: "跳过 — Skill会在首次使用时提示您创建"}]
  • → 执行
    steer-vision
    流程(流程结束时会提供继续设置TECH、DESIGN和QA文档的选项)。
  • 暂时不设置 → 退出。