github-create-issues

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

github-create-issues

github-create-issues

Take a
github_backlog_input.json
and create the issues in GitHub by driving the bundled
create_github_issues.py
. The script creates the milestone and labels if needed, creates each issue, then creates a tracking issue with a task list linking them all.
Creating issues is effectively un-undoable (close is manual; notifications already fired). So this skill is built around a hard gate: visual dry-run always, real run only on an explicit "yes".
For the exact JSON shapes see
${CLAUDE_PLUGIN_ROOT}/references/data-contracts.md
.
通过运行内置的
create_github_issues.py
脚本,读取
github_backlog_input.json
文件并在GitHub中创建Issues。该脚本会在需要时创建里程碑和标签,逐个创建Issue,然后生成一个包含所有Issue任务列表的追踪Issue。
创建Issue的操作基本无法撤销(关闭需手动操作,且通知已发出)。因此该技能设置了严格的确认机制:始终先执行可视化预执行,仅在用户明确回复“yes”后才执行实际创建操作。
关于具体的JSON格式,请参考
${CLAUDE_PLUGIN_ROOT}/references/data-contracts.md
。

Prerequisites

前置条件

  • Auth —
    gh auth login
    once (the script reads
    gh auth token
    ). Or set
    $env:GH_TOKEN
    . See the
    github-auth
    skill.
  • Owner/repo — set
    $env:GH_OWNER
    /
    $env:GH_REPO
    , or include
    owner
    /
    repo
    in the JSON. Env vars override the JSON.
  • Python + requests + openpyxl — run the setup checker if unsure:
    powershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup_check_github.ps1"
  • 身份验证 — 先执行
    gh auth login
    (脚本会读取
    gh auth token
    )。或者设置环境变量
    $env:GH_TOKEN
    。可查看
    github-auth
    技能了解详情。
  • 仓库所有者/仓库名 — 设置环境变量
    $env:GH_OWNER
    /
    $env:GH_REPO
    ,或在JSON文件中包含
    owner
    /
    repo
    字段。环境变量优先级高于JSON文件中的配置。
  • Python + requests + openpyxl — 若不确定是否已安装,可运行检查脚本:
    powershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup_check_github.ps1"

Step 1 — VISUAL DRY-RUN (creates nothing)

步骤1 — 可视化预执行(不会创建任何内容)

GitHub Issues has no
validateOnly
API. Instead: read
github_backlog_input.json
and render a formatted table for the user to review before any API call.
Present:
 # | Key    | Title                              | Labels               | Assignee
---|--------|------------------------------------|----------------------|---------
 1 | row-1  | Portal label "Auto" should show... | bug, P1, size:S      | —
 2 | row-2  | Add rate limiting to API           | enhancement, P2, ... | pon
...
Milestone: Audit Wave 1
Tracking issue: yes (created last, links all above)
Total: 2 issues
GATE — stop here. Do not proceed until the user has explicitly approved the list (e.g. "create them", "go ahead", "yes").
If the user requests changes, update
github_backlog_input.json
and re-render the table. The table is free — re-rendering costs nothing.
GitHub Issues没有
validateOnly
API。因此我们采取的方式是:读取
github_backlog_input.json
文件,渲染格式化表格供用户在调用任何API前进行审核。
展示格式如下:
 # | Key    | Title                              | Labels               | Assignee
---|--------|------------------------------------|----------------------|---------
 1 | row-1  | Portal label "Auto" should show... | bug, P1, size:S      | —
 2 | row-2  | Add rate limiting to API           | enhancement, P2, ... | pon
...
Milestone: Audit Wave 1
Tracking issue: yes (created last, links all above)
Total: 2 issues
确认关卡 — 在此暂停。在用户明确批准该列表前(例如“创建它们”“继续”“yes”),请勿继续执行。
如果用户要求修改,请更新
github_backlog_input.json
并重新渲染表格。渲染表格无任何成本,可以反复操作。

Step 2 — REAL RUN (only after explicit approval)

步骤2 — 实际执行(仅在明确批准后进行)

powershell
$env:GH_OWNER = "Cartagena365"
$env:GH_REPO  = "GlassHull"
python "${CLAUDE_PLUGIN_ROOT}/scripts/create_github_issues.py" `
  --input  "<workdir>/github_backlog_input.json" `
  --output "<workdir>/github_backlog_result.json"
The script prints one line per created issue (
key X -> #N <url>
) and a final
tracking issue -> #N <url>
. Then it writes
github_backlog_result.json
.
Relay the output to the user. Surface any failure clearly — a partial run is better visible than silent.
powershell
$env:GH_OWNER = "Cartagena365"
$env:GH_REPO  = "GlassHull"
python "${CLAUDE_PLUGIN_ROOT}/scripts/create_github_issues.py" `
  --input  "<workdir>/github_backlog_input.json" `
  --output "<workdir>/github_backlog_result.json"
脚本会为每个创建的Issue打印一行信息(格式为
key X -> #N <url>
),最后打印追踪Issue的信息(
tracking issue -> #N <url>
)。随后会生成
github_backlog_result.json
文件。
将脚本输出信息同步给用户。若出现失败需清晰告知用户——部分执行失败比静默失败更易被察觉。

After creating — verify

创建完成后 — 验证

Confirm the items landed. Check
github_backlog_result.json
— every item should have a
number
and
url
. Items without a
number
failed; surface them to the user.
确认所有条目已成功创建。检查
github_backlog_result.json
文件——每个条目都应包含
number
和
url
字段。没有
number
字段的条目表示创建失败,需告知用户。

Idempotency — don't double-create

幂等性 — 避免重复创建

create_github_issues.py
is not idempotent: re-running on the same
github_backlog_input.json
creates a second set of issues. After a successful run, hand off to github-writeback-tracking to stamp
Issue #
/
Issue URL
back onto source rows. Once a row carries an Issue #, treat it as done. To re-file a subset, prune the input to only the un-filed
key
s first.
create_github_issues.py
不具备幂等性:对同一个
github_backlog_input.json
文件重复运行脚本会创建第二组相同的Issues。执行成功后,将任务移交至github-writeback-tracking,将
Issue #
/
Issue URL
标记回源数据行。一旦某行已标记Issue编号,即视为已完成。若需重新提交部分条目,请先将输入文件中已提交的
key
条目移除。