sdtk-spec-kit 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/assets/manifest/toolkit-bundle.manifest.json +200 -25
  4. package/assets/manifest/toolkit-bundle.sha256.txt +47 -12
  5. package/assets/toolkit/toolkit/AGENTS.md +1 -1
  6. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +7 -3
  7. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +3 -0
  8. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +28 -0
  9. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +18 -0
  10. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +2 -0
  11. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +1 -1
  12. package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/SKILL.md +69 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/scripts/test_validate_smoke_test.py +58 -0
  14. package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/scripts/validate_smoke_test.py +152 -0
  15. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/SKILL.md +297 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/prompts/agent_brief_template.md +59 -0
  17. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/check_coverage.py +50 -0
  18. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/extract_sources.py +224 -0
  19. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/merge_parts.py +78 -0
  20. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/render_testcase.py +421 -0
  21. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/template_set.py +57 -0
  22. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/test_write_results.py +89 -0
  23. package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/write_results.py +126 -0
  24. package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/SKILL.md +146 -0
  25. package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/pictures.py +68 -0
  26. package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/test_pictures.py +55 -0
  27. package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsafe.py +137 -0
  28. package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsx_xml_edit.py +153 -0
  29. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +76 -0
  30. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +1 -1
  31. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +1 -1
  32. package/assets/toolkit/toolkit/skills-claude/smoke-test-spec/SKILL.md +66 -0
  33. package/assets/toolkit/toolkit/skills-claude/test-case-xlsx/SKILL.md +294 -0
  34. package/assets/toolkit/toolkit/skills-claude/xlsx-safe-edit/SKILL.md +143 -0
  35. package/assets/toolkit/toolkit/templates/README.md +8 -1
  36. package/assets/toolkit/toolkit/templates/smoke-test/PROFILE_TEMPLATE.md +36 -0
  37. package/assets/toolkit/toolkit/templates/smoke-test/vi-default/AUTHORING_RULES.md +32 -0
  38. package/assets/toolkit/toolkit/templates/smoke-test/vi-default/SMOKE_TEST_TEMPLATE.md +147 -0
  39. package/assets/toolkit/toolkit/templates/smoke-test/vi-default/TEMPLATE.md +25 -0
  40. package/assets/toolkit/toolkit/templates/test-case-xlsx/PROFILE_TEMPLATE.md +78 -0
  41. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/TEMPLATE.md +28 -0
  42. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/README.md +73 -0
  43. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/_template.xlsx +0 -0
  44. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/common/common.xlsx +0 -0
  45. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/mobile_app.xlsx +0 -0
  46. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/smartphone_web.xlsx +0 -0
  47. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/web.xlsx +0 -0
  48. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/windows_app.xlsx +0 -0
  49. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default//343/203/206/343/202/271/343/203/210/344/273/225/346/247/230/346/233/270/344/275/234/346/210/220/343/203/253/343/203/274/343/203/253.md +514 -0
  50. package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default//343/203/206/343/202/271/343/203/210/344/273/225/346/247/230/346/233/270/351/233/233/345/236/213.xlsx +0 -0
  51. package/package.json +1 -1
  52. package/src/lib/scope.js +4 -2
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: xlsx-safe-edit
3
+ description: Use when reading or modifying a hand-maintained .xlsx/.xlsm (manuals, specs, test-case sheets, Q&A logs, design documents) — adding sheets or rows, changing cells, inserting pictures, or updating a generated workbook the person has since edited; also when a save changed fonts, row heights or widths elsewhere. Windows + Excel + pywin32.
4
+ ---
5
+
6
+ ## Input
7
+ $ARGUMENTS
8
+
9
+ # SDTK-SPEC Safe Edits to Hand-Maintained Workbooks
10
+
11
+ People's workbooks carry pictures, shapes, hand-tuned formatting and edits made after your last
12
+ look. The failure modes are silent: the save succeeds and something the person made is gone, or
13
+ their own Excel window is disturbed. Every rule below comes from a real incident. Other SDTK skills
14
+ that write Excel (`sdtk-test-case-xlsx`, `sdtk-screen-design-xlsx`, document and Q&A sheets) write
15
+ through this skill's scripts.
16
+
17
+ ## Critical Constraints
18
+
19
+ 1. **Never save with `openpyxl`.** It drops every picture/shape/drawing on sheets it does not
20
+ rewrite. `openpyxl.load_workbook(...)` for *reading* is fine.
21
+ 2. **Never `win32com.client.Dispatch("Excel.Application")`.** When the person has Excel open,
22
+ `Dispatch` attaches to *their* instance: setting `Visible=False` hides their window and
23
+ `Quit()` closes their work. Always `DispatchEx` (a private, new instance). To merely *look*
24
+ at the person's instance use `GetActiveObject` and change nothing on it.
25
+ 3. **Never kill `EXCEL.EXE`** or close the person's workbooks. If the target is open, stop and ask
26
+ them to save and close it.
27
+ 4. **Preflight before every write:** no `~$<name>` lock file next to the target, and neither the
28
+ target nor any workbook with the same file name is open in a running Excel (Excel cannot open
29
+ two workbooks of the same name, even from different folders). A same-name workbook in another
30
+ folder is a *different file*: never switch the target to it and never edit it in the person's
31
+ open Excel — the target stays the path the person named; ask them to save and close the other one.
32
+ 5. **Back up first**, to a scratch location (`<name>.before-<change>.xlsx`).
33
+ 6. **Touch only what was asked** — and that includes layout. An Excel save rewrites the *whole
34
+ package*: a hidden instance re-resolves theme fonts (on thousands of cells), renames the Normal
35
+ style, re-measures auto-height rows and column widths on **every** sheet, rewrites comment
36
+ headers and recompresses images. Comparing values and shapes does not see this.
37
+ 7. **"Check" / "review" requests are read-only.** Open with `ReadOnly=True` or openpyxl; do not save.
38
+ 8. **Re-read the current file before each edit round.** The person edits between your rounds. Keep
39
+ the sha256 of the file you last read (`xlsafe.fingerprint`); if it changed, re-read before
40
+ editing. Locate anchors by content (a heading's text), never by remembered row numbers, and abort
41
+ if the anchor text is not where you expect.
42
+
43
+ ## Process
44
+
45
+ 1. **Classify the request.** "Check" / "review" / "is it OK" → read-only: report, save nothing, stop.
46
+ 2. **Re-read** the current file and record `xlsafe.fingerprint(path)`; locate anchors by content.
47
+ 3. **Preflight**: lock file and same-name workbook (rule 4). If it fails, say why and stop — never
48
+ close or kill anything to make it pass.
49
+ 4. **Back up** to a scratch location.
50
+ 5. **Choose the route** (table below) and write to a scratch copy first.
51
+ 6. **Verify** (section below), then copy over the target (preflight again) and compare sha256.
52
+ 7. **Report** (section at the end).
53
+
54
+ ## Choose the route
55
+
56
+ | Change | Route |
57
+ |---|---|
58
+ | Cell values, new/filled rows, row heights, extending data-validation / conditional-format ranges — in one sheet | **XML route** `.claude/skills/xlsx-safe-edit/scripts/xlsx_xml_edit.py`: rewrites only that sheet's part; every other part stays byte-identical |
59
+ | Pictures, shapes, inserted sheets, anything Excel must lay out | **COM route** `.claude/skills/xlsx-safe-edit/scripts/xlsafe.py`. After the save it diffs layout against the backup; on drift it restores the backup and raises. Accept drift only after the person agrees (`accept_layout_drift=True`) |
60
+ | A generated workbook the person has finalized by hand | **Final mode** (below): no re-render |
61
+
62
+ ### XML route
63
+
64
+ ```python
65
+ import sys
66
+ sys.path.insert(0, r".claude/skills/xlsx-safe-edit/scripts")
67
+ from xlsx_xml_edit import SheetXml, package_diff, excel_open_check
68
+
69
+ sx = SheetXml(BACKUP, "Sheet name") # read from the backup copy
70
+ sx.set_row(46, {"D": 43, "N": "line 1\nline 2"}, template_row=48, height=120)
71
+ sx.extend_ranges(old_last_row=48, new_last_row=58) # only if rows were added past the old end
72
+ sx.save(OUT) # write to scratch first
73
+ assert package_diff(BACKUP, OUT) == [sx.part]
74
+ excel_open_check(OUT, "Sheet name", ["N46"]) # private instance, read-only; fails if repaired
75
+ # then copy OUT over the target (preflight again) and compare sha256
76
+ ```
77
+
78
+ Row heights: Excel does not auto-fit on open. Measure with a COM `--dry` run (`Rows(r).AutoFit()`,
79
+ nothing saved) or copy a height of an existing row with the same line count; add a few points.
80
+
81
+ ### COM route
82
+
83
+ `open_for_edit` runs the preflight, the backup, the untouched-sheet check and the layout diff
84
+ itself — call it rather than re-implementing them (`xlsafe.preflight(path)` alone for a check).
85
+
86
+ ```python
87
+ from xlsafe import open_for_edit
88
+ with open_for_edit(PATH, touch=["New sheet"], backup_dir=SCRATCH, dry="--dry" in sys.argv) as (xl, wb):
89
+ ws = wb.Worksheets("New sheet")
90
+ ...
91
+ ```
92
+
93
+ ### Pictures under a heading (COM)
94
+
95
+ Screenshots go into the empty rows between a step's text and the next heading. A fixed gap overflows
96
+ as soon as a picture is taller than it, and the picture covers the next heading.
97
+
98
+ ```python
99
+ from pictures import rows_needed, insert_pictures_below
100
+ # pictures: [(path, width_pt), ...]; first_row: one empty row under the step text
101
+ insert_pictures_below(ws, first_row=11, next_heading_text="② …", pictures=pictures)
102
+ ```
103
+
104
+ `insert_pictures_below` finds the next heading by its text, inserts the missing rows before it,
105
+ places the pictures (`Placement = xlMove`, as hand-inserted ones), and fails if any picture's
106
+ `BottomRightCell.Row` reaches the heading. Pictures already below keep their place relative to their
107
+ own step because they move with the inserted rows.
108
+
109
+ ### Final mode — a generated workbook the person finalized by hand
110
+
111
+ When a workbook was generated (by a skill) and then edited by hand, the person's file is the source
112
+ of truth. Do **not** re-render it, not even one sheet, unless the person says so.
113
+ 1. Make the change in the generator's source (spec / YAML) so the next generation is right.
114
+ 2. Apply the same change to the person's file with the XML or COM route — only the cells / shapes
115
+ it touches.
116
+ 3. Report a change table: `sheet | cell or shape | before | after`, so the person can review or merge
117
+ by hand. If you cannot apply a change surgically, give the table and stop.
118
+
119
+ ## Verify (both routes)
120
+
121
+ - Package: `package_diff(backup, result)` lists exactly the parts you meant to change.
122
+ - Layout: `layout_diff(backup, result, skip_sheets=[...])` is empty for untouched sheets.
123
+ - Content: read the written cells back; picture counts per sheet unchanged elsewhere.
124
+ - Pictures: every picture ends above the next heading (`insert_pictures_below` checks it).
125
+
126
+ ## Pitfalls seen in practice
127
+
128
+ | Situation | What goes wrong | Do instead |
129
+ |---|---|---|
130
+ | Rows added after the last formatted row | Data validation / conditional formatting stop at the old last row | `extend_ranges` (XML) or copy the template row (COM) |
131
+ | Text starting with `=`, `@`, `$`, `-` (commands, formulas shown as text) | Excel parses it as a formula | XML: inline string; COM: `NumberFormat = "@"` first |
132
+ | Adding pictures to a fixed gap of empty rows | Picture covers the next heading | `insert_pictures_below` |
133
+ | Inserting rows above existing pictures | Free-floating pictures do not move | Read `Shape.Placement`; new pictures `Placement = 2` |
134
+ | Re-rendering a generated sheet edited by hand | Their edits disappear | Final mode |
135
+ | Reading page breaks through COM (`HPageBreaks`) | Throws on some sheets | Read `row_breaks` with openpyxl (read-only) |
136
+ | Windows paths in a heredoc script | `\` sequences mangled | Write scripts with a file tool; raw strings |
137
+ | Screenshots for the document | Desktop corners, personal data (e-mail, tokens, user names) | Trim ~8 px; point out personal data before publishing |
138
+ | Metadata of a shared template (`docProps`) | Author / company names travel with the file | Clear `dc:creator`, `cp:lastModifiedBy`, `Company` |
139
+
140
+ ## Reporting
141
+
142
+ Say which sheets/cells changed, the route used, the backup path, the package and layout diff
143
+ results, and anything you saw but did not change. If preflight failed, say why and stop.
@@ -48,7 +48,7 @@ The script renders templates into `docs/**` and updates:
48
48
 
49
49
  ## QA Orchestration Mapping
50
50
  - QA release decision/report scope: use `sdtk-qa`.
51
- - QA detailed test-case spec scope: use `sdtk-test-case-spec` (mode `testCaseSpecMode: auto|on|off`).
51
+ - QA detailed test-case spec scope: use `sdtk-test-case-spec` (mode `testCaseSpecMode: auto|on|off`); with `testCaseSpecMode: xlsx` use `sdtk-test-case-xlsx` (Excel workbook).
52
52
 
53
53
  ## Rules Used by Toolkit
54
54
  - API design/flowchart rules:
@@ -62,6 +62,13 @@ The script renders templates into `docs/**` and updates:
62
62
  - Numbering mode is fixed: global numbering across full document (no screen-level reset).
63
63
  - QA test-case spec rules:
64
64
  - `templates/docs/qa/TEST_CASE_CREATION_RULES.md`
65
+ - Smoke-test template sets (`sdtk-smoke-test-spec`), one folder per set; a project picks one in `docs/qa/smoke_test_profile.md`:
66
+ - `templates/smoke-test/PROFILE_TEMPLATE.md`
67
+ - `templates/smoke-test/vi-default/` (`TEMPLATE.md`, `AUTHORING_RULES.md`, `SMOKE_TEST_TEMPLATE.md`)
68
+ - Test-case workbook template sets (`sdtk-test-case-xlsx`), one folder per set; a project picks one in its
69
+ `testcase_profile.base.json` (`"template_set"`):
70
+ - `templates/test-case-xlsx/PROFILE_TEMPLATE.md`
71
+ - `templates/test-case-xlsx/ja-default/` (`TEMPLATE.md` manifest naming the Japanese rules file and output workbook, `viewpoints/`)
65
72
  - Skill-specific local helper refs retained outside `templates/docs/**`:
66
73
  - `toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md`
67
74
  - `toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md`
@@ -0,0 +1,36 @@
1
+ # Smoke test profile — <project>
2
+
3
+ > Project-specific settings for `sdtk-smoke-test-spec`. Keep this file in the project repository
4
+ > (`docs/qa/smoke_test_profile.md`); the skill itself holds nothing project-specific.
5
+
6
+ ## Template set
7
+ - `template_set`: `vi-default` <!-- or a path, e.g. docs/templates/smoke-test/<customer> -->
8
+ - Output folder: `docs/<phase>/qa/`
9
+ - File name: `SMOKE_TEST_<TASK>_<FEATURE>_VI.md`
10
+
11
+ ## Spec sources (codes used in the Spec column)
12
+
13
+ | Code | Source | Where |
14
+ |---|---|---|
15
+ | `GM-Cnn` | <customer spec, screen sheet, cell Cnn> | <path> |
16
+ | `LG-Cnn` | <customer spec, logic sheet> | <path> |
17
+ | `m1`…`mN` | <mockups> | <path> |
18
+ | `KD-nn` | <customer Q&A answers> | <path> |
19
+ | `D-0n` | <team decisions> | <path> |
20
+
21
+ ## Task list
22
+ - <path of the task list>; one suite per task id (`G1`, `G2-1`, …).
23
+
24
+ ## Existing suites (regression and "impact on older suites")
25
+ - <path pattern of the older smoke tests>
26
+
27
+ ## Devices and accounts
28
+
29
+ | Code | Meaning |
30
+ |---|---|
31
+ | Máy A | <…> |
32
+ | TK-1 | <…> |
33
+
34
+ ## Conventions
35
+ - Suite codes: <list, e.g. HOME, BKLIST, …>
36
+ - Language of the document / of on-screen strings: <…>
@@ -0,0 +1,32 @@
1
+ # Quy tắc viết smoke test (template `vi-default`)
2
+
3
+ ## 1. Khung
4
+ - Chép đúng `SMOKE_TEST_TEMPLATE.md`: §0 → §9 + Phụ lục A. Không đổi tên cột của bảng ca.
5
+ - Mã ca: `<SUITE>-<UI|FN|ER|BV|RG>-NN`; mỗi mã nằm trong tiểu mục của nhóm đó; không trùng; không đánh số lại ca đã giao.
6
+ - Mức: 🔴 mất / sai dữ liệu, kẹt, luồng chính · 🟡 hiển thị sai gây hiểu nhầm, lỗi tự phục hồi · trống: hiển thị, biên hiếm.
7
+ - KQ để `☐` khi giao.
8
+ - **Kết quả mong đợi chỉ ghi thứ nhìn thấy được** (màn hình app, khay hệ thống, Explorer / Finder, web, hộp thoại). Log, DB, registry, code → Phụ lục A.
9
+ - §8: số ca và số 🔴 **phải khớp** bảng ca — chạy `validate_smoke_test.py` trước khi giao.
10
+
11
+ ## 2. Chức năng chưa implement
12
+ - Viết kỳ vọng theo spec của khách + quyết định đã chốt. Không đoán hành vi chưa chốt.
13
+ - Câu chữ khách không đưa (team tự viết) → ghi `〔câu chữ: dev điền〕` (có thể kèm đề xuất).
14
+ - Điểm chưa chốt → §7 (`LĐ-nn`); ca liên quan ghi "Ghi lại hành vi thật" hoặc để `保留`.
15
+ - Giữ khối "⚠️ Trước khi giao tester, dev làm …" ở đầu file cho tới khi dev điền xong.
16
+
17
+ ## 3. Nguồn spec
18
+ - Mỗi ca có cột **Spec** trỏ tới nguồn: mã ô trong spec của khách, mockup, mã câu hỏi Q&A, mã quyết định. Bảng mã nguồn ở §0.
19
+ - Không bịa câu chữ trên màn hình: chép nguyên văn từ spec / mockup / app đang chạy; không có thì `〔câu chữ: dev điền〕`.
20
+
21
+ ## 4. Ảnh hưởng tới bộ cũ
22
+ - §1 có mục **"Ảnh hưởng tới bộ cũ"**: ca nào của bộ smoke test cũ không còn đúng sau thay đổi (file + mã ca + lý do), để lead loại khỏi đợt test. Các mã ca này **không** phải ca của bộ mới (validator chỉ đếm §4).
23
+
24
+ ## 5. Ca không làm được theo cách thông thường
25
+ - Bước "trên web" không làm được → mô tả cách thiết lập khác: thao tác trên máy, gọi API, sửa DB (kèm câu SQL ở phụ lục). Ca thật sự không thiết lập được → ghi chú để lead quyết bỏ.
26
+ - Dữ liệu cần lead / dev chuẩn bị → §2.3 (`CB-n`), ca ghi `CB-n` ở cột Tiền điều kiện.
27
+
28
+ ## 6. Lệnh đưa tester
29
+ - Lệnh ngắn, **mỗi lệnh một dòng**; đã chạy thử phần chỉ đọc. Lệnh có tác dụng phụ ghi rõ tác dụng.
30
+
31
+ ## 7. Bàn giao
32
+ - Trả về: tên file, số ca / số 🔴 theo nhóm (từ validator), danh sách LĐ, điểm cần PM quyết (≤ 15 dòng).
@@ -0,0 +1,147 @@
1
+ # <Tên tính năng> (<mã task>) — Kịch bản kiểm thử
2
+
3
+ ## 0. Thông tin tài liệu
4
+
5
+ | Mục | Nội dung |
6
+ |---|---|
7
+ | Mã bộ | `<SUITE>` |
8
+ | Tính năng | <tên tính năng> |
9
+ | Phiên bản | 0.1 |
10
+ | Bản build | nhánh `<branch>`, commit `<sha>` |
11
+
12
+ | Mã | Tài liệu | Mức |
13
+ |---|---|---|
14
+ | <mã nguồn spec> | <tài liệu / ô spec / mockup> | Chính / Tham khảo |
15
+
16
+ | Ngày | Phiên bản | Nội dung | Người sửa |
17
+ |---|---|---|---|
18
+ | <yyyy-mm-dd> | 0.1 | Tạo mới | <tên> |
19
+
20
+ > ⚠️ Trước khi giao tester, dev làm: (1) chạy thử mọi thao tác / lệnh trên bản build; (2) điền các chỗ 〔dev điền〕; (3) xoá ghi chú này.
21
+
22
+ ## 1. Phạm vi
23
+
24
+ **Trong phạm vi:** <…>
25
+
26
+ **Ngoài phạm vi:** <…>
27
+
28
+ **Giả định:** <…>
29
+
30
+ **Ảnh hưởng tới bộ cũ:** ca của bộ smoke test cũ không còn đúng sau thay đổi này (lead loại khỏi đợt test).
31
+
32
+ | File | Mã ca | Lý do |
33
+ |---|---|---|
34
+ | <SMOKE_TEST_xxx.md> | <OLD-FN-01> | <…> |
35
+
36
+ ## 2. Chuẩn bị
37
+
38
+ ### 2.1 Thiết bị và tài khoản
39
+
40
+ | Mã | Thiết bị / tài khoản | Ghi chú |
41
+ |---|---|---|
42
+ | Máy A | <OS, bản build> | |
43
+ | TK-1 | <vai trò, quyền> | |
44
+
45
+ ### 2.2 Dữ liệu mẫu — tester tự tạo
46
+
47
+ <danh sách file / thư mục / dữ liệu tester tự tạo>
48
+
49
+ ### 2.3 Việc lead / dev làm trước
50
+
51
+ | Mã | Việc | Dùng cho |
52
+ |---|---|---|
53
+ | CB-1 | <…> | <mã ca> |
54
+
55
+ ### 2.4 Trạng thái ban đầu của mỗi ca
56
+
57
+ <trạng thái chung trước mỗi ca, thứ tự chạy nếu có phụ thuộc>
58
+
59
+ ## 3. Thuật ngữ và thao tác chuẩn
60
+
61
+ | Thuật ngữ / thao tác | Nghĩa / cách làm |
62
+ |---|---|
63
+ | <…> | <…> |
64
+
65
+ ## 4. Ca kiểm thử
66
+
67
+ Mức: 🔴 mất / sai dữ liệu, kẹt, luồng chính · 🟡 hiển thị sai gây hiểu nhầm, lỗi tự phục hồi · (trống) hiển thị, biên hiếm.
68
+
69
+ ### 4.1 Giao diện — <SUITE>-UI
70
+
71
+ | ID | Mức | Tiền điều kiện | Bước thực hiện | Kết quả mong đợi | Spec | KQ | Ghi chú |
72
+ |---|---|---|---|---|---|---|---|
73
+ | **<SUITE>-UI-01** | | — | <bước> | <thứ nhìn thấy được> | <mã spec> | ☐ | |
74
+
75
+ ### 4.2 Chức năng chính — <SUITE>-FN
76
+
77
+ | ID | Mức | Tiền điều kiện | Bước thực hiện | Kết quả mong đợi | Spec | KQ | Ghi chú |
78
+ |---|---|---|---|---|---|---|---|
79
+ | **<SUITE>-FN-01** | 🔴 | — | <bước> | <thứ nhìn thấy được> | <mã spec> | ☐ | |
80
+
81
+ ### 4.3 Ngoại lệ — <SUITE>-ER
82
+
83
+ | ID | Mức | Tiền điều kiện | Bước thực hiện | Kết quả mong đợi | Spec | KQ | Ghi chú |
84
+ |---|---|---|---|---|---|---|---|
85
+ | **<SUITE>-ER-01** | 🟡 | — | <bước> | <thứ nhìn thấy được> | <mã spec> | ☐ | |
86
+
87
+ ### 4.4 Biên — <SUITE>-BV
88
+
89
+ | ID | Mức | Tiền điều kiện | Bước thực hiện | Kết quả mong đợi | Spec | KQ | Ghi chú |
90
+ |---|---|---|---|---|---|---|---|
91
+ | **<SUITE>-BV-01** | | — | <bước> | <thứ nhìn thấy được> | <mã spec> | ☐ | |
92
+
93
+ ### 4.5 Hồi quy — <SUITE>-RG
94
+
95
+ | ID | Mức | Tiền điều kiện | Bước thực hiện | Kết quả mong đợi | Spec | KQ | Ghi chú |
96
+ |---|---|---|---|---|---|---|---|
97
+ | **<SUITE>-RG-01** | | — | <bước> | <thứ nhìn thấy được> | <mã spec> | ☐ | |
98
+
99
+ ## 5. Ma trận truy vết
100
+
101
+ | Spec | Ca kiểm thử |
102
+ |---|---|
103
+ | <mã spec> | <SUITE>-FN-01 |
104
+
105
+ ## 6. Hạn chế đã biết — KHÔNG báo là lỗi
106
+
107
+ | Mã | Nội dung |
108
+ |---|---|
109
+ | HC-01 | <…> |
110
+
111
+ ## 7. Điểm lệch spec và câu hỏi mở — chờ PM / khách
112
+
113
+ | Mã | Nội dung | Trạng thái |
114
+ |---|---|---|
115
+ | LĐ-01 | <…> | Chờ |
116
+
117
+ ## 8. Tiêu chí đạt và tổng kết
118
+
119
+ **Điều kiện đạt:** mọi ca 🔴 phải `OK`. Ca 🟡 `NG` thì phải có ticket và được lead chấp nhận.
120
+
121
+ | Nhóm | Số ca | 🔴 | OK | NG | 保留 | N/A |
122
+ |---|:--:|:--:|:--:|:--:|:--:|:--:|
123
+ | 4.1 Giao diện | 1 | 0 | | | | |
124
+ | 4.2 Chức năng chính | 1 | 1 | | | | |
125
+ | 4.3 Ngoại lệ | 1 | 0 | | | | |
126
+ | 4.4 Biên | 1 | 0 | | | | |
127
+ | 4.5 Hồi quy | 1 | 0 | | | | |
128
+ | **Tổng** | **5** | **1** | | | | |
129
+
130
+ **Kết luận:** ☐ Đạt ☐ Không đạt
131
+
132
+ **Người xác nhận:** ______________ **Ngày:** ______________
133
+
134
+ ## 9. Mẫu báo lỗi
135
+
136
+ | Mục | Nội dung |
137
+ |---|---|
138
+ | Mã ca | |
139
+ | Bản build | |
140
+ | Bước tái hiện | |
141
+ | Kết quả thực tế | |
142
+ | Kết quả mong đợi | |
143
+ | Ảnh / log | |
144
+
145
+ ## Phụ lục A — Kiểm tra bổ sung cho dev
146
+
147
+ <log / DB / registry / file cấu hình cần kiểm cho từng ca — tester không cần đọc>
@@ -0,0 +1,25 @@
1
+ # Template set `smoke-test/vi-default`
2
+
3
+ | Key | Value |
4
+ |---|---|
5
+ | Skill | `sdtk-smoke-test-spec` (>= 0.1) |
6
+ | Document language | Vietnamese; on-screen strings kept verbatim in the product's UI language |
7
+ | Files | `SMOKE_TEST_TEMPLATE.md` (skeleton to copy), `AUTHORING_RULES.md` (rules the author follows) |
8
+ | Output name | `SMOKE_TEST_<TASK>_<FEATURE>_VI.md` |
9
+
10
+ Copy this folder to `<project>/docs/templates/smoke-test/<set name>/` and edit it to give a customer or project its own
11
+ headings, columns or language; the project profile (`docs/qa/smoke_test_profile.md`) names the set to use.
12
+
13
+ The skill's validator (`scripts/validate_smoke_test.py` of `sdtk-smoke-test-spec`) reads the block below, so a
14
+ template set with other headings or column names stays checkable.
15
+
16
+ ```json validator
17
+ {
18
+ "required_sections": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
19
+ "case_columns": ["ID", "Mức", "Tiền điều kiện", "Bước thực hiện", "Kết quả mong đợi", "Spec", "KQ", "Ghi chú"],
20
+ "severities": ["🔴", "🟡", ""],
21
+ "results": ["☐", "OK", "NG", "保留", "N/A"],
22
+ "total_label": "Tổng",
23
+ "placeholder": "〔[^〕]*〕"
24
+ }
25
+ ```
@@ -0,0 +1,78 @@
1
+ # Test-case profile: <project name>
2
+
3
+ > Copy this file into the PROJECT repository as `testcase_profile.md` (next to where the test specification is
4
+ > written) and create `testcase_profile.base.json` beside it (cover, `viewpoints`, sheets with `screen_types`,
5
+ > db_prefixes, common report_notes — see SKILL.md Step 4). Fill every section by reading the project's docs; ask the user about anything that cannot
6
+ > be derived. Write it in English; Japanese / Vietnamese only for values that appear in the spec as-is
7
+ > (screen names, UI labels, IDs).
8
+
9
+ ## 1. Output
10
+ | | |
11
+ |---|---|
12
+ | Files | `<dir>/<name>.spec.json` (source) · `.md` · `.xlsx` |
13
+ | Languages | JA (main) + VI |
14
+
15
+ ## 2. Spec sources (read in full in Step 1)
16
+ | File | Used for |
17
+ |---|---|
18
+ | `…` | Main source — requirement IDs (column E) |
19
+ | `…` | Screen names, screen IDs, UI labels |
20
+ | `…` | Table / column names for column H |
21
+ | `…` | Error codes / messages for 異常系 |
22
+
23
+ ## 3. Existing test cases (Step 2)
24
+ | Key | File | Main target sheet | Notes (cases that go to another sheet) |
25
+ |---|---|---|---|
26
+ | `…` | `…` | `NN_…` | |
27
+
28
+ - Boundary cases between sheets (decided): …
29
+ - Files that are NOT mandatory sources (superseded, summaries, notes): …
30
+ - "Known limitations / not a bug" sections: never write the opposite expectation; list in §11-3.
31
+ - "Already covered by automated tests" sections: <include / leave out and list in §11-3>.
32
+
33
+ Coverage check (Step 5):
34
+ ```bash
35
+ python $S/scripts/check_coverage.py $W/spec.json KEY=<file.md> … [--exclude KEY-ID,…]
36
+ ```
37
+
38
+ ## 4. Viewpoints and sheets
39
+ Viewpoints (§7.2, `viewpoints` in base JSON): platforms `[…]` (files in `viewpoints/platform/`), customer `<folder or none>`,
40
+ customer_tags `[…]` — and why.
41
+
42
+ Sheets (§3.2 — in the order the tester moves through the screens):
43
+
44
+ | Sheet | 中分類 (screen_name) | Screen ID (column E) | screen_types (§7.2) | Contains |
45
+ |---|---|---|---|---|
46
+ | `01_…` | … | … | … | … |
47
+
48
+ Out of scope: … (record in §11-3).
49
+
50
+ ## 5. Column conventions
51
+ - **Column E:** `<requirement ID> / <screen ID> / <KEY>-<original case ID>` (cases from viewpoints: omit the third part;
52
+ split cases: `<KEY>-<ID>-a`, `-b`).
53
+ - **Column H:** <table.column = value; or the `db_prefixes` used and what each one means>.
54
+
55
+ ## 6. Business → 大分類 mapping (§4-B — avoid new 大分類)
56
+ | 大分類 | What it covers in this project |
57
+ |---|---|
58
+ | 画面レイアウト | … |
59
+ | 各種コントロール | … |
60
+ | 登録 | … |
61
+ | 検索・絞り込み | … |
62
+ | 編集 | … |
63
+ | 削除 | … |
64
+ | 復元 | … |
65
+ | 権限・認可 | … |
66
+ | 排他制御 | … |
67
+ | 外部連携・I/F | … |
68
+
69
+ ## 7. Standard test data (every agent uses exactly these names)
70
+ Placeholder accounts, machines, files, folders and records. Never real credentials, URLs or e-mail addresses.
71
+
72
+ ## 8. Work split for sub-agents
73
+ | Part | Scope | Existing-case sources |
74
+ |---|---|---|
75
+ | 1 | … | … |
76
+
77
+ ## 9. Project gotchas
78
+ - …
@@ -0,0 +1,28 @@
1
+ # Template set `test-case-xlsx/ja-default`
2
+
3
+ | Key | Value |
4
+ |---|---|
5
+ | Skill | `sdtk-test-case-xlsx` |
6
+ | Document language | Japanese (main) + Vietnamese (secondary columns), as in the writing rules |
7
+ | Output template | `テスト仕様書雛型.xlsx` — sheets 表紙 / テストデータ準備 / 00_雛型 (copied once per output sheet) |
8
+ | Writing rules | `テスト仕様書作成ルール.md` (mandatory; the report items of §11 are checked by the renderer) |
9
+ | Viewpoints | `viewpoints/` — `common/`, `platform/<platform>.xlsx`, `customer/<customer>/` (empty here: a customer's own files are dropped into the project's copy of the set) |
10
+
11
+ To give a customer its own format: copy this folder to `<project>/docs/templates/test-case-xlsx/<customer>/`, change
12
+ the workbook, rules or viewpoints there, and set `"template_set": "<customer>"` in the project's base.json. Keep the
13
+ sheet names and column letters below in step with the workbook — the scripts read them from here.
14
+
15
+ ```json config
16
+ {
17
+ "output_template": "テスト仕様書雛型.xlsx",
18
+ "viewpoints_dir": "viewpoints",
19
+ "rules": "テスト仕様書作成ルール.md",
20
+ "results": {
21
+ "id_column": "A",
22
+ "first_row": 2,
23
+ "columns": {"date": "I", "tester": "J", "result": "K", "note": "M"},
24
+ "date_format": "%Y/%m/%d",
25
+ "labels": {"evidence": "エビデンス: ", "reviewer_comment": "確認者コメント: ", "reviewer": "確認:"}
26
+ }
27
+ }
28
+ ```
@@ -0,0 +1,73 @@
1
+ # Test viewpoints (テスト観点)
2
+
3
+ Three layers. A project uses: its customer's files (optional) + one or more platform files + common.
4
+ When the same check exists in several layers, the most specific wins: **customer > platform > common**.
5
+
6
+ ```
7
+ viewpoints/
8
+ _template.xlsx empty file with the standard columns — copy it to start a new platform/customer file
9
+ common/*.xlsx valid for every software project
10
+ platform/<platform>.xlsx one file per kind of system
11
+ customer/<customer name>/*.xlsx files delivered by a customer, dropped in unchanged
12
+ customer/<customer name>/sheet_map.tsv optional, only when a sheet name cannot be recognized (see below)
13
+ ```
14
+
15
+ Current platform files: `web.xlsx` (web on PC browsers), `smartphone_web.xlsx` (web on smartphone browsers),
16
+ `mobile_app.xlsx` (native iOS / Android apps), `windows_app.xlsx` (Windows desktop apps). Add another platform by
17
+ adding `platform/<name>.xlsx`; projects select it by that file name (without `.xlsx`).
18
+
19
+ ## Sheet format (all layers)
20
+
21
+ Any sheet whose header row (within the first 10 rows) contains 「テスト観点」 and at least two other columns below is a
22
+ viewpoint sheet. Columns are matched **by header name**, so order does not matter and missing columns are allowed:
23
+
24
+ | Column | Meaning |
25
+ |---|---|
26
+ | 画面 | Screen type (informational) |
27
+ | 状態 | State (一覧: データあり / データなし; 登録・編集: 登録 / 編集 / 複製; otherwise `-`) |
28
+ | 対象 | Area of the screen |
29
+ | 項目 | Item (optional) |
30
+ | 分類 | 値表示 / レイアウト / 操作 / 制御 / データ |
31
+ | 小分類 | Kind of check within 分類 |
32
+ | テスト観点 | What to check — ends with 「〜こと」 |
33
+ | 確認内容・期待結果 | Pass criterion (also accepted: 期待結果, 確認内容) |
34
+ | 備考 | Condition such as 「〜がある画面のみ」, or 「過去障害あり」 (makes the viewpoint mandatory, rules §7.1) |
35
+
36
+ Sheets without such a header (table of contents, rules, open questions …) are ignored as viewpoints; their text is
37
+ dumped to `_meta.txt` for reference.
38
+
39
+ ## Screen types (sheet names)
40
+
41
+ The sheet name decides the screen type. Standard types: `一覧画面`, `設定一覧画面`, `登録・編集画面`, `詳細画面`,
42
+ `ダイアログ`, `ポータル画面`. In platform files, a sheet named `全画面` applies to every screen type of that platform,
43
+ and any other name (e.g. `タスクトレイ・通知`, `プッシュ通知`) is a platform-specific screen type that projects can select.
44
+
45
+ Customer sheet names are recognized automatically (`scripts/extract_sources.py --list` shows the result):
46
+ - A trailing `(PC)` / `(SP)` / `(xxx)` becomes the sheet's **tag**; projects choose which tags apply (`customer_tags`).
47
+ - Name contains 設定一覧 → 設定一覧画面; ダイアログ / モーダル → ダイアログ; 登録 / 編集 / 複製 / 入力 → 登録・編集画面;
48
+ 詳細 → 詳細画面; 一覧 → 一覧画面; ポータル / ホーム / トップ / ダッシュボード → ポータル画面.
49
+ - Anything else becomes its own screen type (its name without the tag).
50
+
51
+ If a name is recognized wrongly, add `customer/<name>/sheet_map.tsv` (tab-separated):
52
+
53
+ ```
54
+ sheet screen_type tag
55
+ 受注入力(PC) 登録・編集画面 PC
56
+ お知らせ管理 skip
57
+ ```
58
+
59
+ `skip` excludes the sheet.
60
+
61
+ ## Adding a customer's files
62
+
63
+ 1. Create `customer/<customer name>/` and copy the customer's `.xlsx` files into it unchanged.
64
+ 2. Run `python toolkit/skills/sdtk-test-case-xlsx/scripts/extract_sources.py --list` and check that every viewpoint
65
+ sheet got the right screen type and tag; add `sheet_map.tsv` if not.
66
+ 3. In the project's `testcase_profile.base.json` set `"viewpoints": {"customer": "<customer name>", "customer_tags": [...]}`.
67
+
68
+ ## Adding viewpoints to common / platform files
69
+
70
+ Open the file in Excel and paste rows into the sheet of the right screen type (create the sheet if needed — copy an
71
+ existing sheet so the formatting stays). Keep these files project-independent: no product, customer, business-object
72
+ or screen names of a specific system, and no design values of a specific system (px, colors, fonts) — write
73
+ 「画面設計書記載の値」 instead. Concrete values belong in the customer layer.