sdtk-spec-kit 0.9.2 → 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.
- package/README.md +1 -1
- package/assets/manifest/toolkit-bundle.manifest.json +200 -25
- package/assets/manifest/toolkit-bundle.sha256.txt +47 -12
- package/assets/toolkit/toolkit/AGENTS.md +1 -1
- package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +7 -3
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +3 -0
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +28 -0
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +18 -0
- package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +2 -0
- package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +1 -1
- package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/SKILL.md +69 -0
- package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/scripts/test_validate_smoke_test.py +58 -0
- package/assets/toolkit/toolkit/skills/sdtk-smoke-test-spec/scripts/validate_smoke_test.py +152 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/SKILL.md +297 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/prompts/agent_brief_template.md +59 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/check_coverage.py +50 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/extract_sources.py +224 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/merge_parts.py +78 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/render_testcase.py +421 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/template_set.py +57 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/test_write_results.py +89 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-xlsx/scripts/write_results.py +126 -0
- package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/SKILL.md +146 -0
- package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/pictures.py +68 -0
- package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/test_pictures.py +55 -0
- package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsafe.py +137 -0
- package/assets/toolkit/toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsx_xml_edit.py +153 -0
- package/assets/toolkit/toolkit/skills/skills.catalog.yaml +76 -0
- package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +1 -1
- package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +1 -1
- package/assets/toolkit/toolkit/skills-claude/smoke-test-spec/SKILL.md +66 -0
- package/assets/toolkit/toolkit/skills-claude/test-case-xlsx/SKILL.md +294 -0
- package/assets/toolkit/toolkit/skills-claude/xlsx-safe-edit/SKILL.md +143 -0
- package/assets/toolkit/toolkit/templates/README.md +8 -1
- package/assets/toolkit/toolkit/templates/smoke-test/PROFILE_TEMPLATE.md +36 -0
- package/assets/toolkit/toolkit/templates/smoke-test/vi-default/AUTHORING_RULES.md +32 -0
- package/assets/toolkit/toolkit/templates/smoke-test/vi-default/SMOKE_TEST_TEMPLATE.md +147 -0
- package/assets/toolkit/toolkit/templates/smoke-test/vi-default/TEMPLATE.md +25 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/PROFILE_TEMPLATE.md +78 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/TEMPLATE.md +28 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/README.md +73 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/_template.xlsx +0 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/common/common.xlsx +0 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/mobile_app.xlsx +0 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/smartphone_web.xlsx +0 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/web.xlsx +0 -0
- package/assets/toolkit/toolkit/templates/test-case-xlsx/ja-default/viewpoints/platform/windows_app.xlsx +0 -0
- 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
- 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
- package/package.json +1 -1
- package/src/lib/scope.js +4 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"""XML route: change cell values / row heights in ONE worksheet of an .xlsx without Excel saving the workbook.
|
|
2
|
+
|
|
3
|
+
Only that sheet's part (xl/worksheets/sheetN.xml) is rewritten; every other part is copied byte-for-byte, so fonts,
|
|
4
|
+
styles, row heights and column widths of every other sheet cannot drift. Strings are written as inline strings
|
|
5
|
+
(Excel converts them to shared strings on its next save).
|
|
6
|
+
|
|
7
|
+
from xlsx_xml_edit import SheetXml, package_diff, layout_diff, excel_open_check
|
|
8
|
+
sx = SheetXml(src_path, "Sheet name")
|
|
9
|
+
sx.set_row(46, {"D": 43, "N": "text\\nline 2"}, template_row=48, height=120) # fill/insert a row
|
|
10
|
+
sx.extend_ranges(old_last_row=48, new_last_row=58) # DV / CF / dimension
|
|
11
|
+
sx.save(out_path)
|
|
12
|
+
package_diff(src_path, out_path) # -> ['xl/worksheets/sheet6.xml']
|
|
13
|
+
excel_open_check(out_path, "Sheet name", ["N46"]) # read-only, private Excel instance
|
|
14
|
+
"""
|
|
15
|
+
import re, zipfile
|
|
16
|
+
from xml.sax.saxutils import escape
|
|
17
|
+
|
|
18
|
+
_CELL = re.compile(r'<c r="([A-Z]+)(\d+)"([^>]*?)(?:/>|>(.*?)</c>)', re.S)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def col_num(col):
|
|
22
|
+
n = 0
|
|
23
|
+
for ch in col:
|
|
24
|
+
n = n * 26 + ord(ch) - 64
|
|
25
|
+
return n
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def sheet_part(zf, sheet_name):
|
|
29
|
+
wb = zf.read("xl/workbook.xml").decode("utf-8")
|
|
30
|
+
m = re.search(r'<sheet [^>]*name="%s"[^>]*r:id="(rId\d+)"' % re.escape(escape(sheet_name, {'"': """})), wb)
|
|
31
|
+
if not m:
|
|
32
|
+
raise KeyError(f"sheet not found: {sheet_name}")
|
|
33
|
+
rels = zf.read("xl/_rels/workbook.xml.rels").decode("utf-8")
|
|
34
|
+
t = re.search(r'<Relationship [^>]*Id="%s"[^>]*Target="([^"]+)"' % m.group(1), rels) or \
|
|
35
|
+
re.search(r'<Relationship [^>]*Target="([^"]+)"[^>]*Id="%s"' % m.group(1), rels)
|
|
36
|
+
target = t.group(1).lstrip("/")
|
|
37
|
+
return target if target.startswith("xl/") else "xl/" + target
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class SheetXml:
|
|
41
|
+
def __init__(self, path, sheet_name):
|
|
42
|
+
self.path, self.zf = path, zipfile.ZipFile(path)
|
|
43
|
+
self.part = sheet_part(self.zf, sheet_name)
|
|
44
|
+
self.xml = self.zf.read(self.part).decode("utf-8")
|
|
45
|
+
|
|
46
|
+
def _row_span(self, r):
|
|
47
|
+
m = re.search(r'<row r="%d"[^>]*?(?:/>|>.*?</row>)' % r, self.xml, re.S)
|
|
48
|
+
return (m.start(), m.end()) if m else None
|
|
49
|
+
|
|
50
|
+
def row_cells(self, r):
|
|
51
|
+
span = self._row_span(r)
|
|
52
|
+
if not span:
|
|
53
|
+
return {}
|
|
54
|
+
return {c: (attrs, inner) for c, rr, attrs, inner in _CELL.findall(self.xml[span[0]:span[1]]) if int(rr) == r}
|
|
55
|
+
|
|
56
|
+
def cell_value_raw(self, ref):
|
|
57
|
+
col, r = re.match(r"([A-Z]+)(\d+)", ref).groups()
|
|
58
|
+
return self.row_cells(int(r)).get(col)
|
|
59
|
+
|
|
60
|
+
def set_row(self, r, values, template_row, height=None):
|
|
61
|
+
"""Write `values` {col: str|int|float|None} into row r. Missing cells/row are created with the styles of
|
|
62
|
+
template_row. Existing cells keep their style; other existing cells are left as they are."""
|
|
63
|
+
tmpl = {c: re.search(r's="(\d+)"', a).group(1) for c, (a, _) in self.row_cells(template_row).items() if 's="' in a}
|
|
64
|
+
cur = self.row_cells(r)
|
|
65
|
+
cols = sorted(set(tmpl) | set(cur) | set(values), key=col_num)
|
|
66
|
+
out = []
|
|
67
|
+
for c in cols:
|
|
68
|
+
attrs = cur[c][0] if c in cur else (f' s="{tmpl[c]}"' if c in tmpl else "")
|
|
69
|
+
style = re.search(r's="\d+"', attrs)
|
|
70
|
+
s = f" {style.group(0)}" if style else ""
|
|
71
|
+
if c in values:
|
|
72
|
+
v = values[c]
|
|
73
|
+
if v is None or v == "":
|
|
74
|
+
out.append(f'<c r="{c}{r}"{s}/>')
|
|
75
|
+
elif isinstance(v, (int, float)):
|
|
76
|
+
out.append(f'<c r="{c}{r}"{s}><v>{v}</v></c>')
|
|
77
|
+
else:
|
|
78
|
+
out.append(f'<c r="{c}{r}"{s} t="inlineStr"><is><t xml:space="preserve">{escape(str(v))}</t></is></c>')
|
|
79
|
+
elif c in cur:
|
|
80
|
+
a, inner = cur[c]
|
|
81
|
+
out.append(f'<c r="{c}{r}"{a}>{inner}</c>' if inner else f'<c r="{c}{r}"{a}/>')
|
|
82
|
+
else:
|
|
83
|
+
out.append(f'<c r="{c}{r}"{s}/>')
|
|
84
|
+
span = self._row_span(r) or self._row_span(template_row)
|
|
85
|
+
head = re.match(r'<row [^>]*?(?=/?>)', self.xml[span[0]:span[1]]).group(0)
|
|
86
|
+
head = re.sub(r' r="\d+"', f' r="{r}"', head, 1)
|
|
87
|
+
if height is not None:
|
|
88
|
+
head = re.sub(r' (ht|customHeight)="[^"]*"', "", head) + f' ht="{height}" customHeight="1"'
|
|
89
|
+
new_row = head + ">" + "".join(out) + "</row>"
|
|
90
|
+
own = self._row_span(r)
|
|
91
|
+
if own:
|
|
92
|
+
self.xml = self.xml[:own[0]] + new_row + self.xml[own[1]:]
|
|
93
|
+
else:
|
|
94
|
+
later = [m for m in re.finditer(r'<row r="(\d+)"', self.xml) if int(m.group(1)) > r]
|
|
95
|
+
pos = later[0].start() if later else self.xml.index("</sheetData>")
|
|
96
|
+
self.xml = self.xml[:pos] + new_row + self.xml[pos:]
|
|
97
|
+
|
|
98
|
+
def extend_ranges(self, old_last_row, new_last_row):
|
|
99
|
+
"""Grow every DV / CF range and the <dimension> that ends exactly at old_last_row."""
|
|
100
|
+
def grow(m):
|
|
101
|
+
return f"{m.group(1)}{new_last_row}" if int(m.group(2)) == old_last_row else m.group(0)
|
|
102
|
+
def fix(attr_value):
|
|
103
|
+
return re.sub(r"(\b[A-Z]+\d+:[A-Z]+)(\d+)\b", grow, attr_value)
|
|
104
|
+
self.xml = re.sub(r'(<dimension ref=")([^"]+)(")', lambda m: m.group(1) + fix(m.group(2)) + m.group(3), self.xml)
|
|
105
|
+
self.xml = re.sub(r'(<(?:dataValidation|conditionalFormatting)\b[^>]*?sqref=")([^"]+)(")',
|
|
106
|
+
lambda m: m.group(1) + fix(m.group(2)) + m.group(3), self.xml)
|
|
107
|
+
|
|
108
|
+
def save(self, out_path):
|
|
109
|
+
with zipfile.ZipFile(out_path, "w") as zout:
|
|
110
|
+
for info in self.zf.infolist():
|
|
111
|
+
data = self.xml.encode("utf-8") if info.filename == self.part else self.zf.read(info.filename)
|
|
112
|
+
zout.writestr(info, data, compress_type=info.compress_type)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def package_diff(a, b):
|
|
116
|
+
za, zb = zipfile.ZipFile(a), zipfile.ZipFile(b)
|
|
117
|
+
names = set(za.namelist()) | set(zb.namelist())
|
|
118
|
+
return sorted(n for n in names if n not in za.namelist() or n not in zb.namelist() or za.read(n) != zb.read(n))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def layout_diff(a, b, skip_sheets=()):
|
|
122
|
+
"""Row heights, column widths and cell font names that differ per sheet (openpyxl, read-only)."""
|
|
123
|
+
from openpyxl import load_workbook
|
|
124
|
+
wa, wb = load_workbook(a), load_workbook(b)
|
|
125
|
+
report = {}
|
|
126
|
+
for name in wa.sheetnames:
|
|
127
|
+
if name in skip_sheets or name not in wb.sheetnames:
|
|
128
|
+
continue
|
|
129
|
+
x, y = wa[name], wb[name]
|
|
130
|
+
rows = [r for r in set(x.row_dimensions) | set(y.row_dimensions) if x.row_dimensions[r].height != y.row_dimensions[r].height]
|
|
131
|
+
cols = [c for c in set(x.column_dimensions) | set(y.column_dimensions) if x.column_dimensions[c].width != y.column_dimensions[c].width]
|
|
132
|
+
fonts = sum(1 for row in x.iter_rows() for c in row if c.has_style and c.font.name != y[c.coordinate].font.name)
|
|
133
|
+
if rows or cols or fonts:
|
|
134
|
+
report[name] = {"row_heights": len(rows), "col_widths": len(cols), "cell_fonts": fonts}
|
|
135
|
+
return report
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def excel_open_check(path, sheet_name, refs):
|
|
139
|
+
"""Open read-only in a private Excel instance; fail if Excel repairs the file. Returns {ref: value}."""
|
|
140
|
+
import win32com.client as win32
|
|
141
|
+
xl = win32.DispatchEx("Excel.Application")
|
|
142
|
+
xl.Visible, xl.DisplayAlerts = False, False
|
|
143
|
+
wb = None
|
|
144
|
+
try:
|
|
145
|
+
wb = xl.Workbooks.Open(path, UpdateLinks=0, ReadOnly=True, CorruptLoad=0)
|
|
146
|
+
if "修復" in wb.Name or "Repaired" in wb.Name:
|
|
147
|
+
raise RuntimeError(f"Excel repaired the file: {wb.Name}")
|
|
148
|
+
ws = wb.Worksheets(sheet_name)
|
|
149
|
+
return {ref: ws.Range(ref).Value for ref in refs}
|
|
150
|
+
finally:
|
|
151
|
+
if wb is not None:
|
|
152
|
+
wb.Close(False)
|
|
153
|
+
xl.Quit()
|
|
@@ -350,3 +350,79 @@ skills:
|
|
|
350
350
|
runtime_support: [claude, codex]
|
|
351
351
|
dependencies: []
|
|
352
352
|
pack: core
|
|
353
|
+
|
|
354
|
+
- name: sdtk-xlsx-safe-edit
|
|
355
|
+
phase: specialist
|
|
356
|
+
role_tag: /xlsx-safe-edit
|
|
357
|
+
use_when: Read or modify a hand-maintained .xlsx/.xlsm (manuals, specs, test cases, Q&A logs, design documents) without losing pictures, layout or the person's edits.
|
|
358
|
+
primary_inputs:
|
|
359
|
+
- the target workbook (closed in Excel)
|
|
360
|
+
primary_outputs:
|
|
361
|
+
- the same workbook, only the requested cells / sheets / shapes changed
|
|
362
|
+
- backup copy and a change report
|
|
363
|
+
hard_gates:
|
|
364
|
+
- Never save a workbook with openpyxl; never attach to the person's Excel (Dispatch); never kill EXCEL.EXE.
|
|
365
|
+
- Check requests are read-only; touch only what was asked and verify package and layout diffs.
|
|
366
|
+
- A generated workbook the person finalized by hand is never re-rendered (final mode).
|
|
367
|
+
references: []
|
|
368
|
+
prompts: []
|
|
369
|
+
scripts:
|
|
370
|
+
- toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsafe.py
|
|
371
|
+
- toolkit/skills/sdtk-xlsx-safe-edit/scripts/xlsx_xml_edit.py
|
|
372
|
+
- toolkit/skills/sdtk-xlsx-safe-edit/scripts/pictures.py
|
|
373
|
+
runtime_support: [claude, codex]
|
|
374
|
+
dependencies: []
|
|
375
|
+
pack: core
|
|
376
|
+
- name: sdtk-smoke-test-spec
|
|
377
|
+
phase: qa
|
|
378
|
+
role_tag: /smoke-test-spec
|
|
379
|
+
use_when: Write or update a manual smoke / acceptance test document for one feature or task, traceable to the spec and runnable by testers or an automation runner keyed by case id.
|
|
380
|
+
primary_inputs:
|
|
381
|
+
- docs/qa/smoke_test_profile.md
|
|
382
|
+
- spec sources, decisions log and existing smoke suites named by the profile
|
|
383
|
+
primary_outputs:
|
|
384
|
+
- one smoke-test markdown file per feature or task (template set layout)
|
|
385
|
+
hard_gates:
|
|
386
|
+
- Never guess undecided behaviour; record it as an open point and mark the case.
|
|
387
|
+
- Expected results are visible to a tester; only section 4 holds cases; delivered case ids are never renumbered.
|
|
388
|
+
- validate_smoke_test.py exits 0 and the section 8 totals equal its counts before hand-over.
|
|
389
|
+
references:
|
|
390
|
+
- toolkit/templates/smoke-test/PROFILE_TEMPLATE.md
|
|
391
|
+
- toolkit/templates/smoke-test/vi-default/TEMPLATE.md
|
|
392
|
+
- toolkit/templates/smoke-test/vi-default/AUTHORING_RULES.md
|
|
393
|
+
- toolkit/templates/smoke-test/vi-default/SMOKE_TEST_TEMPLATE.md
|
|
394
|
+
prompts: []
|
|
395
|
+
scripts:
|
|
396
|
+
- toolkit/skills/sdtk-smoke-test-spec/scripts/validate_smoke_test.py
|
|
397
|
+
runtime_support: [claude, codex]
|
|
398
|
+
dependencies: []
|
|
399
|
+
pack: core
|
|
400
|
+
- name: sdtk-test-case-xlsx
|
|
401
|
+
phase: qa
|
|
402
|
+
role_tag: /test-case-xlsx
|
|
403
|
+
use_when: QA test cases must be an Excel workbook from the customer's template (testCaseSpecMode = xlsx) — create / update them, convert existing smoke-test or test-case markdown, or write executed results back.
|
|
404
|
+
primary_inputs:
|
|
405
|
+
- testcase_profile.md and testcase_profile.base.json of the project
|
|
406
|
+
- spec sources and existing test cases named by the profile
|
|
407
|
+
primary_outputs:
|
|
408
|
+
- test specification workbook (.xlsx) + markdown + spec.json (template set layout)
|
|
409
|
+
- executed results written into the tester's workbook
|
|
410
|
+
hard_gates:
|
|
411
|
+
- Never guess scope, check locations or undecided behaviour; ask or report them (§11).
|
|
412
|
+
- Cases are written as JSON and rendered; render_testcase.py exits 0; every existing case is converted (check_coverage.py).
|
|
413
|
+
- Never save a workbook with openpyxl; results go through write_results.py; cases are matched by sheet + No, never by position.
|
|
414
|
+
references:
|
|
415
|
+
- toolkit/templates/test-case-xlsx/PROFILE_TEMPLATE.md
|
|
416
|
+
- toolkit/templates/test-case-xlsx/ja-default/TEMPLATE.md
|
|
417
|
+
prompts:
|
|
418
|
+
- toolkit/skills/sdtk-test-case-xlsx/prompts/agent_brief_template.md
|
|
419
|
+
scripts:
|
|
420
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/template_set.py
|
|
421
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/extract_sources.py
|
|
422
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/merge_parts.py
|
|
423
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/render_testcase.py
|
|
424
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/check_coverage.py
|
|
425
|
+
- toolkit/skills/sdtk-test-case-xlsx/scripts/write_results.py
|
|
426
|
+
runtime_support: [claude, codex]
|
|
427
|
+
dependencies: [sdtk-xlsx-safe-edit]
|
|
428
|
+
pack: core
|
|
@@ -70,7 +70,7 @@ sdtk-spec generate --feature-key YOUR_FEATURE --feature-name "Your Feature"
|
|
|
70
70
|
- If phase is `ARCH` and API detail spec is in scope, invoke `sdtk-api-design-spec`.
|
|
71
71
|
- If phase is `ARCH` and UI flow behavior is in scope, invoke `sdtk-screen-design-spec`.
|
|
72
72
|
- If phase is `DEV`, stop at `FEATURE_IMPL_PLAN + CODE_HANDOFF`; downstream implementation runs in SDTK-CODE, not here.
|
|
73
|
-
- If phase is `QA` and test-case specification is in scope, invoke `sdtk-test-case-spec
|
|
73
|
+
- If phase is `QA` and test-case specification is in scope, invoke `sdtk-test-case-spec` — or `sdtk-test-case-xlsx` when `orchestration.testCaseSpecMode = xlsx` (Excel workbook from the customer's template).
|
|
74
74
|
- Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md`.
|
|
75
75
|
- Hand off only after the current phase has fresh evidence.
|
|
76
76
|
|
|
@@ -43,7 +43,7 @@ If no arguments are provided, read current feature context from SHARED_PLANNING.
|
|
|
43
43
|
1. Validate prerequisites: `FEATURE_IMPL_PLAN`, `CODE_HANDOFF`, `REVIEW_PACKET`, `OPS_HANDOFF`, downstream implementation evidence, and downstream OPS evidence are available and aligned.
|
|
44
44
|
2. Treat SDTK-CODE workflow evidence as the normal bridge into QA. In the current formal suite flow, `OPS_HANDOFF` plus downstream OPS evidence are also required before final QA approval.
|
|
45
45
|
3. Create test strategy mapped to UC/AC.
|
|
46
|
-
4. If test-case specification artifact is required, invoke `/test-case-spec` and align counts/coverage with release testing scope. Keep the structured TEST_CASE total consistent with the release-report baseline; track E2E separately if needed.
|
|
46
|
+
4. If test-case specification artifact is required, invoke `/test-case-spec` (`/test-case-xlsx` when `orchestration.testCaseSpecMode = xlsx`) and align counts/coverage with release testing scope. Keep the structured TEST_CASE total consistent with the release-report baseline; track E2E separately if needed.
|
|
47
47
|
5. Apply `governance/ai/core/SDTK_BENCHMARK_QA_MODE_POLICY.md` for benchmark-mode verdict rules when no executable build exists.
|
|
48
48
|
6. If acceptance criteria / expected behavior is unclear, record OQ-xx in QA report and preserve benchmark-expected ambiguity per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`; escalate to PM.
|
|
49
49
|
7. Execute/record results (unit/integration/e2e as applicable).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: smoke-test-spec
|
|
3
|
+
description: Use when writing or updating a manual smoke-test / acceptance-test document (kịch bản kiểm thử, スモークテスト) for one feature or task, before the feature is fully implemented or after a spec change, when the cases must trace to the customer's spec and later be run by testers or by an automation runner keyed by case id.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Input
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
# SDTK-SPEC Smoke Test Spec
|
|
10
|
+
|
|
11
|
+
One markdown file per feature/task, cases grouped UI / FN / ER / BV / RG, every case traceable to a spec source,
|
|
12
|
+
expected results limited to what a tester can see. The file is also the input of automation runners (they read the
|
|
13
|
+
case ids of section 4), so its structure is checked by a script, not by eye.
|
|
14
|
+
|
|
15
|
+
## Critical Constraints
|
|
16
|
+
|
|
17
|
+
1. **Never guess behaviour that is not decided.** Write what the spec says, put the open point in §7, mark the case
|
|
18
|
+
("record actual behaviour" or `保留`).
|
|
19
|
+
2. **On-screen strings verbatim** from the spec / mockup / running app; a missing one is the template's placeholder.
|
|
20
|
+
3. **Expected results are what a tester can see.** Logs, DB, registry and code go to Appendix A.
|
|
21
|
+
4. **Only section 4 holds cases.** Ids of older suites listed elsewhere (e.g. §1 "impact on older suites") are not
|
|
22
|
+
cases of this suite.
|
|
23
|
+
5. **Never renumber delivered cases.** Append new ids; mark removed ones.
|
|
24
|
+
6. **The validator must exit 0 before hand-over**, and the §8 totals are its counts, never typed by hand.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
### 1. Read the inputs in full
|
|
29
|
+
|
|
30
|
+
1. The project profile `docs/qa/smoke_test_profile.md` (copy `./references/templates/smoke-test/PROFILE_TEMPLATE.md` if
|
|
31
|
+
missing and fill it with the person). It names the template set, the spec sources and their codes, the task list,
|
|
32
|
+
the existing smoke suites, devices and accounts.
|
|
33
|
+
2. The template set, resolved in this order: the profile's `template_set` path → `docs/templates/smoke-test/<set>/`
|
|
34
|
+
in the project → `./references/templates/smoke-test/<set>/` (default set `vi-default`). Read its `TEMPLATE.md`,
|
|
35
|
+
`AUTHORING_RULES.md` and `SMOKE_TEST_TEMPLATE.md`.
|
|
36
|
+
3. Every spec source the profile lists for the feature, the decisions log, and the existing smoke suites that cover
|
|
37
|
+
the same screens (for the "impact on older suites" list and for regression cases).
|
|
38
|
+
|
|
39
|
+
### 2. Write
|
|
40
|
+
|
|
41
|
+
- Copy `SMOKE_TEST_TEMPLATE.md`, keep its sections and column names, follow `AUTHORING_RULES.md`.
|
|
42
|
+
- Undecided behaviour, missing strings: rules 1–2 above.
|
|
43
|
+
|
|
44
|
+
### 3. Check before handing over
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
python .claude/skills/smoke-test-spec/scripts/validate_smoke_test.py <file> --template-dir <set dir>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Exit 0 is required. It checks sections, columns, ids (pattern, uniqueness, subsection), Spec / severity / result
|
|
51
|
+
cells and that the §8 totals equal the counted cases and 🔴 cases; it counts placeholders left for developers.
|
|
52
|
+
Asked how many cases a file has, run the validator and give its section-4 count.
|
|
53
|
+
|
|
54
|
+
## Common mistakes
|
|
55
|
+
|
|
56
|
+
| Mistake | Effect | Instead |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| Counting ids anywhere in the file | Old suites' ids listed in §1 inflate the count | Only section 4 holds cases (the validator does this) |
|
|
59
|
+
| Typing the §8 totals by hand | Totals drift from the table | Copy the validator's counts |
|
|
60
|
+
| `|` inside a cell (forbidden characters, commands) | Row splits into an extra cell | Escape it as `\|` |
|
|
61
|
+
| Expected result names a log line or DB column | Tester cannot see it | Visible result in the table, the rest in Appendix A |
|
|
62
|
+
| Renumbering cases after delivery | Results and automation lose their case | Append new ids; mark removed ones |
|
|
63
|
+
|
|
64
|
+
## Report
|
|
65
|
+
|
|
66
|
+
File name, cases / 🔴 per group (from the validator), open points (§7), what the PM must decide.
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-case-xlsx
|
|
3
|
+
description: Use when test cases / テストケース / テスト仕様書 must be an Excel workbook from a customer's template: create or update them, convert existing smoke-test / test-case markdown into one, or write executed results (OK / NG / 保留) back. Selected by orchestration.testCaseSpecMode = xlsx; the markdown form is sdtk-test-case-spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Input
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
# SDTK-SPEC Test Case Spec (Excel workbook)
|
|
10
|
+
|
|
11
|
+
Three parts, kept apart so each customer can have its own format:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
.claude/skills/test-case-xlsx/ (core — workflow and scripts, no project or customer content)
|
|
15
|
+
SKILL.md, prompts/agent_brief_template.md
|
|
16
|
+
scripts/template_set.py <- finds the template set (below)
|
|
17
|
+
scripts/extract_sources.py <- collect the viewpoints of each output sheet + dump the output template
|
|
18
|
+
scripts/merge_parts.py <- merge sub-agent part_*.json files into spec.json
|
|
19
|
+
scripts/render_testcase.py <- validate the JSON + render .md (+ --xlsx)
|
|
20
|
+
scripts/check_coverage.py <- check that every existing test-case ID was converted
|
|
21
|
+
scripts/write_results.py <- write executed results into the workbook (XML route, nothing else changes)
|
|
22
|
+
|
|
23
|
+
./references/templates/test-case-xlsx/<set>/ (template set — replaceable per customer; default ja-default)
|
|
24
|
+
TEMPLATE.md <- manifest + ```json config``` (output template, columns of the results)
|
|
25
|
+
テスト仕様書作成ルール.md <- MANDATORY authoring rules (§1–§11) of this set
|
|
26
|
+
テスト仕様書雛型.xlsx <- output template
|
|
27
|
+
viewpoints/common | platform/<platform>.xlsx | customer/<customer>/ <- test viewpoints, see viewpoints/README.md
|
|
28
|
+
./references/templates/test-case-xlsx/PROFILE_TEMPLATE.md <- template for a new project profile
|
|
29
|
+
|
|
30
|
+
<project repo>/…/testcase_profile.md (project — sources, sheets, conventions, test data)
|
|
31
|
+
<project repo>/…/testcase_profile.base.json (project — "template_set", cover, viewpoints selection, sheets, db_prefixes)
|
|
32
|
+
<project repo>/docs/templates/test-case-xlsx/<customer>/ (optional — a customer's own template set; wins over the toolkit's)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Template set resolution (`scripts/template_set.py`): `--template-dir` / base.json `"template_set"` (name or path) →
|
|
36
|
+
`docs/templates/test-case-xlsx/<name>/` in the project → `./references/templates/test-case-xlsx/<name>/` → `$SDTK_TEMPLATES_DIR`.
|
|
37
|
+
A customer's own format = copy `ja-default` into the project, change the workbook / rules / viewpoints, set its name.
|
|
38
|
+
|
|
39
|
+
You **never write the markdown or Excel tables by hand**: write the test cases as JSON (green columns only);
|
|
40
|
+
the scripts sort by band / minor category, number the rows, fill 中分類, run the §11 self-check and render.
|
|
41
|
+
Run every command from the **repo root**; use `python` (Windows) or `python3` (Linux/macOS).
|
|
42
|
+
`S=.claude/skills/test-case-xlsx`; `T` = the resolved template set folder (printed by extract_sources.py).
|
|
43
|
+
`W` = a temporary working directory (the session scratchpad) for part_*.json, the brief and generator scripts —
|
|
44
|
+
never committed. `P` = the directory holding the project profile.
|
|
45
|
+
|
|
46
|
+
Terminology: 観点 (kanten) = test viewpoint; 大分類 / 中分類 / 小分類 = major / middle / minor category;
|
|
47
|
+
帯 = band (§4-B of the rules); 正常系 / 異常系 / 境界値 = normal / abnormal / boundary.
|
|
48
|
+
|
|
49
|
+
## Critical Constraints
|
|
50
|
+
|
|
51
|
+
1. **Never guess.** Scope, output location, column-H check locations and authoritative test files come from the
|
|
52
|
+
project profile or the person; open / unconfirmed spec points become report items §11-3 / §11-4, not cases.
|
|
53
|
+
2. **Never write the markdown or Excel tables by hand** and never edit the rendered `.md` / `.xlsx`: edit the JSON and
|
|
54
|
+
render again. `render_testcase.py` must exit 0.
|
|
55
|
+
3. **Every existing case is converted** (original ID kept in column E) and checked with `check_coverage.py`.
|
|
56
|
+
4. **Never save a workbook with openpyxl.** Results go in with `write_results.py` (XML route of sdtk-xlsx-safe-edit)
|
|
57
|
+
into the tester's latest copy only.
|
|
58
|
+
5. **Cases are identified by sheet + No**, never by position; delivered cases are never renumbered.
|
|
59
|
+
6. **The template set's rules file is mandatory** (`テスト仕様書作成ルール.md`); this skill only adds to it.
|
|
60
|
+
|
|
61
|
+
## Process
|
|
62
|
+
|
|
63
|
+
0. Locate (or create) the project profile.
|
|
64
|
+
1. Read the spec sources in full.
|
|
65
|
+
2. Read the existing test cases the profile lists.
|
|
66
|
+
3. Read the viewpoints, rules and template (`extract_sources.py`).
|
|
67
|
+
4. Write the JSON source (split across sub-agents when large).
|
|
68
|
+
5. Validate and render (`render_testcase.py`, `check_coverage.py`).
|
|
69
|
+
6. Report to the person (§11).
|
|
70
|
+
7. Later rounds: write executed results into the workbook (`write_results.py`).
|
|
71
|
+
|
|
72
|
+
The steps in detail:
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 0 — Locate the project profile
|
|
77
|
+
|
|
78
|
+
Search the repo for `testcase_profile.md` (Glob `**/testcase_profile.md`). If found, read it in full; every
|
|
79
|
+
project-specific decision comes from it. If the user names a profile path, use that.
|
|
80
|
+
|
|
81
|
+
If none exists: copy `./references/templates/test-case-xlsx/PROFILE_TEMPLATE.md` to `<dir>/testcase_profile.md` (ask the user for `<dir>`; suggest the
|
|
82
|
+
folder where the test specification will be written) and create `<dir>/testcase_profile.base.json`. Fill each section
|
|
83
|
+
by reading the project's docs. Anything that cannot be derived from the docs (scope, output location, how results are
|
|
84
|
+
checked in column H, which existing test files are authoritative …) → **ask the user before writing any case**; never guess.
|
|
85
|
+
|
|
86
|
+
If the output already exists (`<output>.spec.json` in the profile) and the user only asks for an update: edit that
|
|
87
|
+
spec.json directly (add / remove / change cases for the changed spec or source test cases), then run Step 5 again.
|
|
88
|
+
Do not regenerate from scratch.
|
|
89
|
+
|
|
90
|
+
## Step 1 — Read the spec sources (mandatory, in full)
|
|
91
|
+
|
|
92
|
+
Read every file listed under **Spec sources** in the profile (files > 25k tokens: read with `offset`/`limit`).
|
|
93
|
+
Always take the latest decision; ignore struck-through or "replaced by" content. Open / unconfirmed points → do not
|
|
94
|
+
write cases based on guesses; record them in report items §11-3 / §11-4.
|
|
95
|
+
|
|
96
|
+
## Step 2 — Read the existing test cases (when the profile lists them)
|
|
97
|
+
|
|
98
|
+
The profile section **Existing test cases** lists existing test-case / smoke-test files and their target sheets.
|
|
99
|
+
They are a **mandatory source**: the team has already verified them against the real system.
|
|
100
|
+
|
|
101
|
+
- Every existing case → at least one case in the spec. Keep its original ID in column E, in the profile's format
|
|
102
|
+
(e.g. `REQ-7 / SCR-02 / SYNC-NF-01`), so it can be traced both ways.
|
|
103
|
+
- Keep the meaning of the operation and the expected result; rewrite them to the rules (§4-F numbered steps with
|
|
104
|
+
concrete values; §4-G verifiable results) and write them in Japanese (main) + Vietnamese.
|
|
105
|
+
- An existing case that the rules require to be split (one row checking things of different 大分類) → several cases
|
|
106
|
+
with the same original ID plus a suffix `-a`, `-b`.
|
|
107
|
+
- **Never** write a case that contradicts the source file's "known limitations / not a bug" section. Cases in an
|
|
108
|
+
"already covered by automated tests" section → follow the profile (default: leave them out, list them in §11-3).
|
|
109
|
+
- An existing case that contradicts the latest spec → follow the latest spec, record it in §11-4 (with the original ID).
|
|
110
|
+
- Rule §7.2 (use only viewpoints of the reference viewpoint set) restricts **adding cases from viewpoints**, not existing
|
|
111
|
+
cases — existing cases are always included.
|
|
112
|
+
- Two existing cases with the same content → merge into one case; column E lists both original IDs.
|
|
113
|
+
- An existing case that is not an operation of the system (only an environment check or tool preparation) → turn it
|
|
114
|
+
into `data_prep`, put its ID into `--exclude` of the coverage check, and record it in §11-3.
|
|
115
|
+
- A result that is neither on the screen nor in a column-H check location (e.g. a process exit code) → write it in
|
|
116
|
+
column G as an observable fact (e.g. 「PowerShell に `2` が表示される」).
|
|
117
|
+
- The source defines no message wording → column G states the observable result (dialog title, resulting screen
|
|
118
|
+
state); never invent wording; record it in §11-3.
|
|
119
|
+
- **The spec and the existing cases define the expected results.** Reading the code is allowed to get table/column
|
|
120
|
+
names and to detect differences; if the code differs from the spec, still write to the spec and record it in §11-4
|
|
121
|
+
(name the code file and quote both wordings).
|
|
122
|
+
|
|
123
|
+
## Step 3 — Read the viewpoints, rules and template
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python $S/scripts/extract_sources.py $P/testcase_profile.base.json $W/src
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Using `viewpoints` (platforms, customer, customer_tags) and each sheet's `screen_types` from the base JSON, this writes
|
|
130
|
+
`$W/src/viewpoints/<output sheet>.tsv` — the **reference viewpoint set** of that sheet (rules §7.2), customer rows
|
|
131
|
+
first, then platform, then common; the first column names the source. Also `_index.tsv` (every viewpoint sheet found
|
|
132
|
+
and whether it was used), `_meta.txt` (non-viewpoint sheets such as the customer's rules / open questions — read them)
|
|
133
|
+
and `$W/src/template.txt`. Read `$T/テスト仕様書作成ルール.md` (the rules file of the template set) **in full** — the rules are mandatory; this SKILL.md
|
|
134
|
+
and the profile only add to them, never replace them. Check the WARN lines (screen type without viewpoints, customer
|
|
135
|
+
sheet not used by any output sheet) before going on.
|
|
136
|
+
|
|
137
|
+
For each output sheet, go through **every row** of its `.tsv`:
|
|
138
|
+
- Same check in several layers → use the most specific row only (customer > platform > common).
|
|
139
|
+
- Viewpoint already covered by an existing case → do not duplicate.
|
|
140
|
+
- Viewpoint applicable but not yet covered → create a new case (column E has the spec / screen ID, no original ID).
|
|
141
|
+
- Viewpoint not applicable (control does not exist, the 備考 condition 「〜のみ」 is not met) → skip.
|
|
142
|
+
- Viewpoint under §7.1 (px / #RRGGBB / font, hover, 過去障害あり …) → must become a case, or be reported as
|
|
143
|
+
"mandatory viewpoint not implemented" (未実施の必須観点).
|
|
144
|
+
|
|
145
|
+
## Step 4 — Write the JSON source
|
|
146
|
+
|
|
147
|
+
`$W/spec.json` = `$P/testcase_profile.base.json` (cover, sheets, db_prefixes, common report_notes) + cases.
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"cover": {"system_name": {"ja": "…", "vi": "…"}, "subsystem_name": {…}, "function_name": {…}, "related_specs": {…}},
|
|
152
|
+
"extra_majors": [],
|
|
153
|
+
"db_prefixes": ["[DB]", "[API]"],
|
|
154
|
+
"viewpoints": {"platforms": ["web"], "customer": "<folder under viewpoints/customer> or null", "customer_tags": ["PC"]},
|
|
155
|
+
"data_prep": [
|
|
156
|
+
{"target_screen": "共通", "category": {"ja","vi"}, "target": {"ja","vi"}, "state": {"ja","vi"}, "count": {"ja","vi"}, "method": {"ja","vi"}}
|
|
157
|
+
],
|
|
158
|
+
"sheets": [
|
|
159
|
+
{"name": "01_ログイン画面", "screen_name": "ログイン画面", "screen_name_vi": "Màn hình đăng nhập",
|
|
160
|
+
"screen_types": ["登録・編集画面", "ダイアログ"],
|
|
161
|
+
"cases": [
|
|
162
|
+
{"major": "登録", "minor": "正常系", "spec": "REQ-1 / SCR-01 / LOGIN-NL-01",
|
|
163
|
+
"steps": {"ja": ["…", "…"], "vi": ["…", "…"]},
|
|
164
|
+
"screen": {"ja": "…", "vi": "…"},
|
|
165
|
+
"db": {"ja": "[DB] users.last_login_dt = 実行日時", "vi": "…"}}
|
|
166
|
+
]}
|
|
167
|
+
],
|
|
168
|
+
"report": [{"title_ja": "3. …", "title_vi": "…", "items": [{"ja": "…", "vi": "…"}]}]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- `screen_types` (per sheet) and `viewpoints` (per project) select the reference viewpoint set (§7.2); they come from
|
|
173
|
+
the base JSON — change them there, not in spec.json only.
|
|
174
|
+
- `major` ∈ the 大分類 of §4-B (or `extra_majors: [{"ja","vi","band"}]` — placed at the end of that band; must be
|
|
175
|
+
reported in §11-5). `minor` ∈ `正常系 / 異常系 / 境界値`.
|
|
176
|
+
- `steps.*` are lists of strings, **not** numbered by you. A case-specific precondition → step 1; shared
|
|
177
|
+
preconditions → `data_prep`.
|
|
178
|
+
- No check needed in column H → `db.ja` is exactly `-(画面表示のみのため確認不要)` and `db.vi` is `""`.
|
|
179
|
+
If the profile defines `db_prefixes`, every line of `db.ja` must start with one prefix (one line = one check location).
|
|
180
|
+
- `report` = all 10 items of §11 (merge_parts.py builds it from `report_notes`). Every note starts with
|
|
181
|
+
「<sheet name>:」 or 「全シート:」 so reviewers know which sheet it belongs to.
|
|
182
|
+
- Bilingual: `ja` is the main text, `vi` has the same meaning and the same number of steps. Never translate: UI labels
|
|
183
|
+
in 「」, table/column names, spec / case IDs, messages, input values. Input values must be concrete (§4-F).
|
|
184
|
+
|
|
185
|
+
**Split across sub-agents** when the total is large (> ~150 cases): follow the profile's **Work split** table, one
|
|
186
|
+
part per agent, run in parallel (Agent tool, `general-purpose`, background):
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
sed "s#<W>#$W#g; s#<S>#$S#g; s#<T>#$T#g; s#<PROFILE>#$P/testcase_profile.md#g" $S/prompts/agent_brief_template.md > $W/AGENT_BRIEF.md
|
|
190
|
+
cp $P/testcase_profile.base.json $W/base.json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Prompt for each agent: "read `$W/AGENT_BRIEF.md`, do part <N>: <scope from the profile>, write `$W/part_<N>.json`".
|
|
194
|
+
Each part: `{"sheet", "cases", "data_prep", "report_notes": [{"item": 3..10, "ja", "vi"}]}`
|
|
195
|
+
(several sheets: `{"parts": [...]}`). Merge:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
python $S/scripts/merge_parts.py $W/base.json $W/spec.json $W/part_*.json
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Step 5 — Validate and render
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
python $S/scripts/render_testcase.py $W/spec.json --check-only
|
|
205
|
+
python $S/scripts/render_testcase.py $W/spec.json --md <output>.md --xlsx <output>.xlsx
|
|
206
|
+
cp $W/spec.json <output>.spec.json # source for later in-place updates
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The script prints case counts per sheet × 大分類 × 小分類 and exits non-zero on any `ERROR`: valid 大分類 / 小分類,
|
|
210
|
+
columns E/F/G/H not empty, column H uses the exact "no check" string or a valid prefix, same number of JA / VI steps,
|
|
211
|
+
banned vague phrases (`正しく` / `適切に` / `問題なく` / `任意の文字列` / `仕様どおり` … — text inside 「」 is ignored
|
|
212
|
+
because it is verbatim UI text), sheet names (`NN_画面名`, ≤ 31 characters), `data_prep.target_screen`.
|
|
213
|
+
A `WARN` about missing 異常系 / 境界値 → re-check, never ignore.
|
|
214
|
+
|
|
215
|
+
Check yourself (the script cannot): every existing case was converted — run the coverage command from the profile
|
|
216
|
+
(`scripts/check_coverage.py`); content matches the latest spec; G / H are concrete; no undefined numeric values
|
|
217
|
+
were guessed (§7.3); data_prep matches the steps.
|
|
218
|
+
|
|
219
|
+
## Step 6 — Report to the user
|
|
220
|
+
|
|
221
|
+
Per §11: cases per sheet (大分類 × 小分類 — copy from the script output), number of data_prep items, existing
|
|
222
|
+
cases converted / total, then items 3–10. For an update: state which cases were added / removed / changed and why.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Step 7 — Write executed results into the workbook
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
python $S/scripts/write_results.py <workbook.xlsx> "<sheet>" $W/results.json [--template-dir $T]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
`results.json` = `{"tester", "date": "YYYY-MM-DD", "cases": {"<No>": {"result", "note", "shots", "reviewer", "reviewer_comment"}}}`.
|
|
233
|
+
Columns and labels come from the template set. Only that sheet's XML part changes (pictures, styles and other sheets
|
|
234
|
+
stay byte-identical); a `要目視` result or an unknown case No stops the write. Never save the workbook with openpyxl.
|
|
235
|
+
**REQUIRED BACKGROUND:** sdtk-xlsx-safe-edit (preflight, backup, "check" = read-only).
|
|
236
|
+
|
|
237
|
+
Before writing into a workbook a tester also maintains: confirm it is their latest copy (modified time, row count,
|
|
238
|
+
the case No column), read their comments in it, and keep cases marked for deletion as they are (status `delete`)
|
|
239
|
+
unless the person says to remove them.
|
|
240
|
+
|
|
241
|
+
## Case identity
|
|
242
|
+
|
|
243
|
+
A case is identified by its sheet + No (column A) for the whole life of the workbook. Matching cases between the
|
|
244
|
+
workbook, spec.json, the markdown and any results file is done **by that id, never by position**: after a row is
|
|
245
|
+
deleted or the sheet renumbered, positional matching silently pairs the wrong cases. Do not renumber delivered cases;
|
|
246
|
+
append new ones and mark removed ones.
|
|
247
|
+
`render_testcase.py` numbers the cases from 1 on every render. Once a workbook is delivered, do not re-render it
|
|
248
|
+
after a deletion: change the tester's workbook only through `write_results.py` / the XML route, keep spec.json in
|
|
249
|
+
step, and tell the person that a re-rendered `.md` would carry different numbers than the workbook.
|
|
250
|
+
|
|
251
|
+
## 対象外 / 未実施 analysis
|
|
252
|
+
|
|
253
|
+
When cases end as 対象外 (not applicable) or 未実施 (not run), classify each before proposing anything:
|
|
254
|
+
(a) the precondition cannot be set up in the real environment → describe another way to set it up (on the PC,
|
|
255
|
+
through the API, by a database change with the SQL attached) or propose dropping the case; (b) the expected result
|
|
256
|
+
does not match the product's real behaviour → propose the corrected expectation with evidence; (c) the spec is not
|
|
257
|
+
decided → raise it as an open question. An NG verdict names the expected item that failed.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Adding viewpoints (customer files, new platforms)
|
|
262
|
+
|
|
263
|
+
See `$T/viewpoints/README.md`. In short: drop a customer's files into `viewpoints/customer/<name>/` of the project's copy of the template set, unchanged, run
|
|
264
|
+
`python $S/scripts/extract_sources.py --list` to check that every sheet was recognized (screen type + tag), add
|
|
265
|
+
`sheet_map.tsv` only if one was not, then set `viewpoints.customer` / `customer_tags` in the project's base JSON.
|
|
266
|
+
A new platform is a new `viewpoints/platform/<name>.xlsx` (start from `viewpoints/_template.xlsx`). Common and
|
|
267
|
+
platform files must stay project-independent (no product / customer names, no design values of a specific system).
|
|
268
|
+
|
|
269
|
+
## Gotchas
|
|
270
|
+
|
|
271
|
+
- **report_notes end up in a document delivered to the customer / QA** → never mention "brief", "part" or "agent";
|
|
272
|
+
`merge_parts.py` warns when it sees those words.
|
|
273
|
+
- **A sub-agent stopped midway** (usage limit): do NOT spawn a new one from scratch — resume the same agent with
|
|
274
|
+
`SendMessage`. Have agents generate their JSON with a script `$W/gen_part<N>.py` so finished work is not lost.
|
|
275
|
+
- **Never edit the output `.md` / `.xlsx` by hand** — edit spec.json and render again.
|
|
276
|
+
- Output `.xlsx`: columns I–M, columns H–I of テストデータ準備 and the yellow cells of 表紙 stay empty for the testers (§6, §10).
|
|
277
|
+
- `|` inside a markdown cell is escaped by the script; a line break inside a cell becomes `<br>`. View with a Markdown preview.
|
|
278
|
+
- Windows: the cp1252 console cannot print Japanese → all scripts call `reconfigure(utf-8)`; any script you write
|
|
279
|
+
must do the same and open files with `encoding="utf-8"`.
|
|
280
|
+
- Never put real credentials, server URLs, IP addresses or personal e-mail addresses into the spec; use the
|
|
281
|
+
placeholder test data defined in the profile.
|
|
282
|
+
|
|
283
|
+
## Troubleshooting
|
|
284
|
+
|
|
285
|
+
| Symptom | Fix |
|
|
286
|
+
|---|---|
|
|
287
|
+
| `ERROR … db.vi is empty` | Fill `db.vi`, unless `db.ja` is exactly `-(画面表示のみのため確認不要)` |
|
|
288
|
+
| `ERROR … 期待結果(DB) must be '-(画面表示のみのため確認不要)'` | You wrote `-` / `-` / `なし` — replace with the full string |
|
|
289
|
+
| `ERROR … 期待結果(DB) line '…' must start with one of […]` | Add a check-location prefix (profile `db_prefixes`) at the start of every line |
|
|
290
|
+
| `ERROR … banned vague phrase '正しく'` | Rewrite as a verifiable result (concrete label, value, position) |
|
|
291
|
+
| `ERROR … steps.ja and steps.vi have different number of steps` | The VI version must have the same number of steps as JA |
|
|
292
|
+
| `ERROR data_prep target_screen …` | Use `共通` or an exact sheet name |
|
|
293
|
+
| `UnicodeEncodeError: 'charmap'` | In your own script: `sys.stdout.reconfigure(encoding="utf-8")`, open files with `encoding="utf-8"` |
|
|
294
|
+
| Read tool says "exceeds maximum allowed tokens" | Continue with `offset` / `limit`, ~200–250 lines per read |
|