github-writeback-tracking

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

github-writeback-tracking

github-writeback-tracking

Closes the loop: once issues exist in GitHub, stamp their numbers and URLs back onto the spreadsheet the findings came from. The link between a row and its issue is the
key
field, carried from [[extract-findings]] through
github_backlog_result.json
.
完成闭环:当issue在GitHub中创建完成后,将其编号和URL标记回发现问题的原始电子表格中。表格行与对应issue的关联通过**
key
**字段实现,该字段从[[extract-findings]]传递到
github_backlog_result.json
中。

When this applies

适用场景

  • Spreadsheet sources only (
    .xlsx
    /
    .csv
    /
    .tsv
    ).
  • Doc / pasted-text sources: skip the script; just report the created issue links from
    github_backlog_result.json
    in chat.
  • You need
    github_backlog_result.json
    from [[github-create-issues]].
  • 仅适用于电子表格数据源
    .xlsx
    /
    .csv
    /
    .tsv
    )。
  • 文档/粘贴文本数据源:跳过此脚本,直接在聊天中汇报
    github_backlog_result.json
    中的已创建issue链接即可。
  • 你需要来自[[github-create-issues]]的
    github_backlog_result.json
    文件。

Before you write

写入前准备

Back up the user's source file first —
github_tracking.py
edits it in place:
powershell
Copy-Item "<file>.xlsx" "<file>.bak.xlsx"
首先备份用户的源文件——
github_tracking.py
直接修改原文件
powershell
Copy-Item "<file>.xlsx" "<file>.bak.xlsx"

Step 1 — add tracking columns (idempotent)

步骤1 — 添加跟踪列(幂等操作)

Appends
Issue #
,
Issue URL
,
State
,
Created
after the last used column. Safe to run repeatedly — columns that already exist are not duplicated.
powershell
python "${CLAUDE_PLUGIN_ROOT}/scripts/github_tracking.py" add-columns --source "<file>" --key "#"
在最后一列之后追加
Issue #
Issue URL
State
Created
列。可安全重复运行——已存在的列不会被重复添加。
powershell
python "${CLAUDE_PLUGIN_ROOT}/scripts/github_tracking.py" add-columns --source "<file>" --key "#"

Step 2 — write the issue links back (idempotent)

步骤2 — 将issue链接写回表格(幂等操作)

Matches each
github_backlog_result.json
item's
key
to the source key column and fills the four tracking columns. Rows that already hold an
Issue #
are left as-is.
powershell
python "${CLAUDE_PLUGIN_ROOT}/scripts/github_tracking.py" writeback `
  --source "<file>" `
  --result "<workdir>/github_backlog_result.json" `
  --key "#"
Per row it writes:
Issue #
items[].number
,
Issue URL
items[].url
,
State
open
,
Created
YYYY-MM-DD HH:MM
.
github_backlog_result.json
中每个条目的
key
与源表格的关键字列进行匹配,并填充这四个跟踪列。已包含
Issue #
的行将保持不变。
powershell
python "${CLAUDE_PLUGIN_ROOT}/scripts/github_tracking.py" writeback `
  --source "<file>" `
  --result "<workdir>/github_backlog_result.json" `
  --key "#"
每行写入的内容为:
Issue #
items[].number
Issue URL
items[].url
State
open
Created
YYYY-MM-DD HH:MM

The
--key
must line up

--key
参数必须匹配

The
--key
column name must match the
keyColumn
chosen in [[extract-findings]] and the
key
values in
github_backlog_result.json
. Values are compared as strings.
If the script prints
warn: key <x> not found in source
, the key in the result doesn't match any value in that column — re-check
--key
and that the source hasn't been re-sorted since extraction.
--key
指定的列名必须与[[extract-findings]]中选择的
keyColumn
以及
github_backlog_result.json
中的
key
值一致。值将以字符串形式进行比较。
如果脚本输出
warn: key <x> not found in source
,说明结果文件中的key与源表格该列中的任何值都不匹配——请重新检查
--key
参数,以及源表格自提取后是否被重新排序。