Test Report from GitHub Issue
Ask first if not already provided
- Tester name
- Which GitHub issue (number or URL)
If either is missing, ask the user — do not assume or default.
Output language
The report's language must match the language the user is writing in (e.g. reply
in Traditional Chinese if the user is chatting in Traditional Chinese, English if
they're chatting in English). Do not hardcode a language — pass localized label
strings to the script (see step 4).
Workflow
Read the issue: gh issue view <issue_number> --json title,body,comments,url
If the target repo isn't obvious, check git remote -v first, or ask the user
for owner/repo.
Find the verification/test checklist (a judgment task — read and decide
yourself, don't hardcode keyword rules)
- Look through the body and all comments for a checklist (
- [ ] ... items),
commonly under a heading like "Test Plan", "Checklist", "驗證項目", or
"測試項目"
- If there are multiple checklists, or it's unclear which one is the final
version (e.g. a later comment revised the list), list the options for the
user to pick — don't decide on your own
- If no checklist exists at all, ask the user to provide the test items directly
Confirm you have everything: issue title, tester name, date (default
today, format YYYY/MM/DD), the list of items, and the target language.
Generate the document (a deterministic step — call the script, don't
hand-write the XML, and don't fall back to an HTML-disguised-as-.doc trick —
that approach was tested and its tables overflow the page margins unreliably)
Write the items to a temp JSON file first (avoids command-line escaping
issues with non-ASCII/special characters), then run:
pwsh scripts/New-TestReport.ps1 `
-Title "<issue title>" `
-IssueNumber "<issue number>" `
-Tester "<tester name>" `
-Date "2026/07/15" `
-ItemsJson "<path to temp JSON file, string array>" `
-OutputDir "$HOME/Desktop" `
-ReportLabel "<localized 'TestReport' label, used in the filename>" `
-DateLabel "<localized 'Date: ' label>" `
-TesterLabel "<localized 'Tester: ' label>" `
-SummaryHeading "<localized '1. Test Result Summary' heading>" `
-DetailHeading "<localized '2. Test Item Details' heading>" `
-ColNoHeader "<localized 'No.' column header>" `
-ColItemHeader "<localized 'Test Item' column header>" `
-ColResultHeader "<localized 'Result (Pass/Failed)' column header>" `
-ResultLabel "<localized 'Result: ' label>"
All the -...Label / -...Heading / -Col...Header parameters default to
English if omitted. Override them to match the user's language — see the
Traditional Chinese example below for the values used previously.
The script prints the full output path as the last line of stdout.
Report back: reply with that path.
Fixed formatting rules (script-enforced, no need to ask the user)
- Filename:
Issue{issueNumber}{ReportLabel}_{YYYYMMDD}_{tester}.docx
- Page: A4, "Moderate" margins (top/bottom 2.54cm, left/right 1.91cm); tables use
table-layout:fixed with explicit column widths so long text (e.g. a URL)
never pushes a column past the margin
- Title is the issue title; below it, a
<DateLabel><date> line and a
<TesterLabel><tester> line
- Summary section: a 3-column table (No. / Test Item / Result (Pass/Failed)),
header row has no fill color
- Detail section: each item listed in order, followed by a bordered blank box
for pasting the actual result
Example (generic, not tied to any specific project)
Issue #123 "Add user avatar upload", checklist found in a comment:
- [ ] Uploading an image writes the correct path to the database
- [ ] An oversized image shows an error and is not uploaded
- [ ] Deleting the avatar also removes the database record
English conversation → ask for tester name (e.g. "Harris") → generate
Issue123TestReport_20260715_Harris.docx using the script's default English labels.
Traditional Chinese conversation → same issue, ask for 測試人員姓名 (e.g. "黃信翰")
→ generate Issue123測試報告_20260715_黃信翰.docx, calling the script with:
-ReportLabel "測試報告" -DateLabel "Date:" -TesterLabel "測試人員:" -SummaryHeading "一:測試結果 Summary" -DetailHeading "二:測試項目明細" -ColNoHeader "編號" -ColItemHeader "測試項目" -ColResultHeader "測試結果(Pass/Failed)" -ResultLabel "測試結果:"
Notes
- Windows filenames are case-insensitive. If a same-named file is open in Word,
overwriting it will fail with a lock error — tell the user to close it first
and retry.
- To adjust the format (add/remove columns, change margins, etc.), edit the
constants/parameters in
scripts/New-TestReport.ps1 directly.
1---2name: test-report-from-issue3description: Generates a Word (.docx) test report from a GitHub issue's verification checklist — a summary table plus a per-item detail section with blank space to paste results. Use when the user asks to create a test report / QA report / 測試報告 / 驗證報告 for a specific GitHub issue, or wants to turn an issue's checklist ("Test Plan", "Checklist", "驗證項目", "測試項目", or a raw "- [ ]" list) into a fillable Word document.4---56# Test Report from GitHub Issue78## Ask first if not already provided9101. Tester name112. Which GitHub issue (number or URL)1213If either is missing, ask the user — do not assume or default.1415## Output language1617The report's language must match the language the user is writing in (e.g. reply18in Traditional Chinese if the user is chatting in Traditional Chinese, English if19they're chatting in English). Do not hardcode a language — pass localized label20strings to the script (see step 4).2122## Workflow23241. **Read the issue**: `gh issue view <issue_number> --json title,body,comments,url`25 If the target repo isn't obvious, check `git remote -v` first, or ask the user26 for `owner/repo`.27282. **Find the verification/test checklist** (a judgment task — read and decide29 yourself, don't hardcode keyword rules)30 - Look through the body and all comments for a checklist (`- [ ] ...` items),31 commonly under a heading like "Test Plan", "Checklist", "驗證項目", or32 "測試項目"33 - If there are multiple checklists, or it's unclear which one is the final34 version (e.g. a later comment revised the list), list the options for the35 user to pick — don't decide on your own36 - If no checklist exists at all, ask the user to provide the test items directly37383. **Confirm you have everything**: issue title, tester name, date (default39 today, format `YYYY/MM/DD`), the list of items, and the target language.40414. **Generate the document** (a deterministic step — call the script, don't42 hand-write the XML, and don't fall back to an HTML-disguised-as-.doc trick —43 that approach was tested and its tables overflow the page margins unreliably)4445 Write the items to a temp JSON file first (avoids command-line escaping46 issues with non-ASCII/special characters), then run:4748 ```powershell49 pwsh scripts/New-TestReport.ps1 `50 -Title "<issue title>" `51 -IssueNumber "<issue number>" `52 -Tester "<tester name>" `53 -Date "2026/07/15" `54 -ItemsJson "<path to temp JSON file, string array>" `55 -OutputDir "$HOME/Desktop" `56 -ReportLabel "<localized 'TestReport' label, used in the filename>" `57 -DateLabel "<localized 'Date: ' label>" `58 -TesterLabel "<localized 'Tester: ' label>" `59 -SummaryHeading "<localized '1. Test Result Summary' heading>" `60 -DetailHeading "<localized '2. Test Item Details' heading>" `61 -ColNoHeader "<localized 'No.' column header>" `62 -ColItemHeader "<localized 'Test Item' column header>" `63 -ColResultHeader "<localized 'Result (Pass/Failed)' column header>" `64 -ResultLabel "<localized 'Result: ' label>"65 ```6667 All the `-...Label` / `-...Heading` / `-Col...Header` parameters default to68 English if omitted. Override them to match the user's language — see the69 Traditional Chinese example below for the values used previously.7071 The script prints the full output path as the last line of stdout.72735. **Report back**: reply with that path.7475## Fixed formatting rules (script-enforced, no need to ask the user)7677- Filename: `Issue{issueNumber}{ReportLabel}_{YYYYMMDD}_{tester}.docx`78- Page: A4, "Moderate" margins (top/bottom 2.54cm, left/right 1.91cm); tables use79 `table-layout:fixed` with explicit column widths so long text (e.g. a URL)80 never pushes a column past the margin81- Title is the issue title; below it, a `<DateLabel><date>` line and a82 `<TesterLabel><tester>` line83- Summary section: a 3-column table (No. / Test Item / Result (Pass/Failed)),84 header row has no fill color85- Detail section: each item listed in order, followed by a bordered blank box86 for pasting the actual result8788## Example (generic, not tied to any specific project)8990Issue #123 "Add user avatar upload", checklist found in a comment:9192```93- [ ] Uploading an image writes the correct path to the database94- [ ] An oversized image shows an error and is not uploaded95- [ ] Deleting the avatar also removes the database record96```9798English conversation → ask for tester name (e.g. "Harris") → generate99`Issue123TestReport_20260715_Harris.docx` using the script's default English labels.100101Traditional Chinese conversation → same issue, ask for 測試人員姓名 (e.g. "黃信翰")102→ generate `Issue123測試報告_20260715_黃信翰.docx`, calling the script with:103`-ReportLabel "測試報告" -DateLabel "Date:" -TesterLabel "測試人員:" -SummaryHeading "一:測試結果 Summary" -DetailHeading "二:測試項目明細" -ColNoHeader "編號" -ColItemHeader "測試項目" -ColResultHeader "測試結果(Pass/Failed)" -ResultLabel "測試結果:"`104105## Notes106107- Windows filenames are case-insensitive. If a same-named file is open in Word,108 overwriting it will fail with a lock error — tell the user to close it first109 and retry.110- To adjust the format (add/remove columns, change margins, etc.), edit the111 constants/parameters in `scripts/New-TestReport.ps1` directly.