Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 2 týdny
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. ---
  2. name: fp-mtms-version-checklist
  3. description: >-
  4. Updates the FP-MTMS Version Programs and Functions Checklist Excel on each
  5. developer's synced SharePoint folder. Use only when the user explicitly
  6. invokes this skill or asks to update the FP-MTMS version control checklist,
  7. page/program version sheet, or function version sheet.
  8. disable-model-invocation: true
  9. ---
  10. # FP-MTMS Version Checklist Excel
  11. ## Purpose
  12. Maintain the team **FP-MTMS System Version Control Checklist**: page/program
  13. level and function-level version history in a shared SharePoint Excel file.
  14. ## Language
  15. Keep Excel **column headers** exactly as in the file (English).
  16. ### 中英對照 (required for cell content)
  17. All written cell values must be **Traditional Chinese + English**
  18. (中英對照), using i18n labels where they exist.
  19. **Exception — do NOT bilingualize:**
  20. - `Functions in Page&Program` column **F — Name of Function within
  21. Program** (English symbol + source path only; see Column F rule)
  22. - Version & Date fields (e.g. `v1.0.0 2026-07-14`)
  23. - Developed By (person name as-is)
  24. - Ref. No. (number)
  25. ### Format
  26. **Short labels** (subsystem / page names):
  27. ```text
  28. 批號追溯 / Item Tracing
  29. 倉庫管理 / Store Management
  30. ```
  31. **Longer prose** (purpose, highlights, major changes): Chinese first,
  32. then English on the **next line**. For usage/呼叫來源, keep it on its
  33. own line(s) as well:
  34. ```text
  35. 工單提料執行頁面(/jodetail)。
  36. Job Order Pick Execution page (/jodetail).
  37. 使用/呼叫來源:批號追溯(單據深連結開啟已完成提料紀錄)。
  38. Used / called from: Item Tracing (doc deep-link to open completed pick record).
  39. ```
  40. **Major Changes** (Page col F / history I,L,O and Functions col I / history
  41. L,O,R) must also list **file + line range + short per-line explanation** —
  42. see **Major Changes: file, lines, explanation** below.
  43. Prefer EN/ZH pairs from `src/i18n/en/*` and `src/i18n/zh/*` for menu and
  44. feature terms. Enable Excel wrap text when a cell has multiple lines.
  45. ## Excel path (per developer)
  46. Path varies by Windows user / OneDrive sync root. Resolve in this order:
  47. 1. If the user provides a full path, use it.
  48. 2. Else try under the user profile home:
  49. `{USERPROFILE}/2Fi Business Solutions Limited/2Fi Business Solutions Limited - FP-MTMS VERSION CONTROL/FP-MTMS Version Programs and Functions Checklist v0.1.xlsx`
  50. 3. If missing, search under `{USERPROFILE}` for
  51. `FP-MTMS Version Programs and Functions Checklist v0.1.xlsx` (real `.xlsx` only).
  52. 4. **Always confirm the resolved path with the user before writing.**
  53. Do not edit `.url` shortcuts or Downloads copies unless the user explicitly asks.
  54. Use `openpyxl` to read/write. If the file is locked (PermissionError), ask the
  55. user to close Excel / Excel Online sync lock, then retry.
  56. ## Hard rule: preview first — do not interview column by column
  57. **Never** ask the user one question per cell / column.
  58. Instead:
  59. 1. Infer all planned adds/updates from conversation context, git diff, PR,
  60. feature description, and existing Excel rows.
  61. 2. Before any write, show a **full preview** of every row that will be added or
  62. changed (including history shifts).
  63. 3. Ask **one** confirmation: whether this preview is correct (yes / no / what
  64. to fix). Prefer the Ask Questions tool when available; otherwise ask once
  65. in chat.
  66. 4. Only after explicit approval, write with `openpyxl` and save.
  67. If the preview is wrong, adjust and show a **revised preview**; do not write
  68. until approved.
  69. If critical facts are truly unknown (e.g. version number or developer name
  70. cannot be inferred), ask at most a short batch of missing items — never walk
  71. the sheet column by column.
  72. ## Pre-check: matching program / feature must exist
  73. Before drafting or writing any row:
  74. 1. Open the workbook and search both sheets for the target
  75. **System Page / Program Name** (and for Functions sheet, also
  76. **Name of Function within Program**).
  77. 2. Match on existing rows when the program/page already exists.
  78. 3. If updating a function: the parent page/program should already exist on
  79. `Page&Program Name` (or be included in the same preview as a new page row).
  80. 4. If nothing matches and the user intends a **new** program or function, say so
  81. clearly in the preview as `NEW ROW`.
  82. 5. Do **not** invent duplicate rows for the same page + same function.
  83. 6. Different **功能** (distinct functions) → **different Ref. No. rows**, even
  84. under the same System Page / Program Name.
  85. ## History shift (required on every update)
  86. Each page or function keeps **Latest** plus up to **3 previous** history slots
  87. (1st, 2nd, 3rd). On every new change to an existing row, **push history
  88. rightward** before writing the new Latest:
  89. | Before write | After shift |
  90. |--------------|-------------|
  91. | Latest | → 1st previous |
  92. | 1st previous | → 2nd previous |
  93. | 2nd previous | → 3rd previous |
  94. | 3rd previous | → **deleted** (dropped) |
  95. Then write the new change into **Latest** (version/date, highlights, Developed By).
  96. ### Page&Program Name — fields that shift together
  97. Treat each “slot” as a triple:
  98. - **Latest**: D (Version & Date), F (Major Changes), G (Developed By)
  99. - **1st**: H, I, J
  100. - **2nd**: K, L, M
  101. - **3rd**: N, O, P
  102. Shift: `(D,F,G) → (H,I,J) → (K,L,M) → (N,O,P)` then drop old 3rd; write new into D/F/G.
  103. Leave identity columns A–C and purpose E unchanged unless the user asked to
  104. change them (purpose may be refreshed if the preview says so).
  105. ### Functions in Page&Program — fields that shift together
  106. - **Latest**: H (Function Version & Date), I (Major Changes), J (Developed By)
  107. - **1st**: K, L, M
  108. - **2nd**: N, O, P
  109. - **3rd**: Q, R, S
  110. Shift: `(H,I,J) → (K,L,M) → (N,O,P) → (Q,R,S)` then drop old 3rd; write new into H/I/J.
  111. Leave A–G (Ref, subsystem, page, page version/purpose, function name/highlight)
  112. unchanged unless the preview explicitly updates them.
  113. Always show the shift in the preview (old Latest → new 1st, etc.).
  114. ### Function history only when that function changed (required)
  115. **Do not** push or invent a Functions-sheet history slot for a commit / release
  116. that did **not** change the symbols listed in column F for that row.
  117. - **Page&Program Name** may still advance Latest / history for a page-level
  118. release (e.g. backend-only fix under the same page).
  119. - **Functions in Page&Program**: shift H→K→N→Q **only** when this row’s
  120. function(s) actually changed (diff touches the verified F symbol(s) / paths).
  121. - If a commit updates the **page** but not this function:
  122. - You may refresh column **D** (Latest Page Version) to match the page row.
  123. - Leave **H/I/J** and previous function history **unchanged**.
  124. - Do **not** write filler Latest/history text such as「頁面版本對齊;本功能無程式變更」
  125. / “Page version align; no UI change this release”.
  126. - When mapping several commits into history for a **new** function row: include
  127. only commits that changed that function; leave unused 1st/2nd/3rd slots empty.
  128. Different function rows under the same page may have **different** Latest
  129. versions and history depths.
  130. Example: page Latest = v1.0.3 (backend TRF fix). Frontend transfer UI row last
  131. changed at v1.0.2 → keep function H = v1.0.2; optional D = v1.0.3; no fake
  132. v1.0.3 function history slot.
  133. ### Major Changes: file, lines, explanation (required)
  134. For every **Major Changes Highlights** cell written into Excel (Page sheet
  135. Latest F and history I/L/O; Functions sheet Latest I and history L/O/R),
  136. include concrete code locations from the commit / diff — not only a summary
  137. sentence.
  138. **Required content (中英對照 for prose; paths/lines stay as-is):**
  139. 1. **Summary** — short ZH then EN (what the release did).
  140. 2. **Per changed file** — repo-relative path.
  141. 3. **Line range(s)** — current file line numbers after the change (prefer
  142. `start–end`; single line OK). Re-resolve with `git show` / Read / Grep;
  143. do not guess.
  144. 4. **Short explanation by line/range** — what that hunk does (ZH then EN, or
  145. one ZH+EN pair per bullet).
  146. **Cell layout example:**
  147. ```text
  148. 轉倉出庫批次 ledger 餘額鏈結修正。
  149. TRF stock-out batch ledger balance chaining fix.
  150. StockOutLineService.kt
  151. L1518: ledger 查詢改為 findFirstByItemIdAndDeletedFalseOrderByDateDescIdDesc。
  152. L1518: ledger lookup → findFirstByItemIdAndDeletedFalseOrderByDateDescIdDesc.
  153. L2318–2347 (createStockOutBatch): 同 batch 多行依 runningLedgerBalance 扣帳,不再每次用 onHandQty。
  154. L2318–2347 (createStockOutBatch): chain per-item running ledger balance within a batch instead of onHandQty each line.
  155. StockInLineService.kt
  156. L269 / L312: assignLotNo / assignLotNoForJo 改為 open fun(無邏輯變更)。
  157. L269 / L312: assignLotNo / assignLotNoForJo marked open (no logic change).
  158. ```
  159. **Rules:**
  160. - Fact-check path + line numbers against the repo at write time (lines drift;
  161. re-check before save).
  162. - Group by file; under each file, one bullet per meaningful hunk / line range.
  163. - Prefer the member / symbol name in the explanation when helpful
  164. (e.g. `createStockOutBatch`, `assignLotNo`).
  165. - If many files: keep bullets short; still list each touched path that belongs
  166. to this row (Functions row → only files/symbols in column F, plus closely
  167. related hunks in those files for this change).
  168. - Page-sheet Major Changes may summarize all files for that page release;
  169. Functions-sheet Major Changes stay scoped to that function row’s F symbols
  170. and their files.
  171. - Show the same file/line bullets in the **preview** before write.
  172. - Pure i18n-only or one-liner UI copy changes: still cite file + line(s)
  173. (e.g. `InventoryLotLineTable.tsx L508–518: success message by API code`).
  174. ## Batch updates
  175. Many rows may change in one invocation (multiple pages and/or functions).
  176. - Build **one combined preview** covering all affected rows.
  177. - One approval covers the whole batch.
  178. - Still one Ref. No. row per distinct 功能 / function.
  179. ## Sheets and columns
  180. Data starts at **row 5** (rows 1–4 are title/headers).
  181. ### Sheet: `Page&Program Name`
  182. | Col | Header |
  183. |-----|--------|
  184. | A | Ref. No. |
  185. | B | Name of Subsystem / Module / Menu Selection |
  186. | C | System Page / Program Name |
  187. | D | Latest Page Version & Date |
  188. | E | Page Purpose Highlights |
  189. | F | Major Changes Highlights |
  190. | G | Developed By |
  191. | H | 1st Previous Page Version & Date |
  192. | I | 1st Major Changes Highlights |
  193. | J | Developed By |
  194. | K | 2nd Previous Page Version & Date |
  195. | L | 2nd Major Changes Highlights |
  196. | M | Developed By |
  197. | N | 3rd Previous Page Version & Date |
  198. | O | 3rd Major Changes Highlights |
  199. | P | Developed By |
  200. ### Sheet: `Functions in Page&Program`
  201. | Col | Header |
  202. |-----|--------|
  203. | A | Ref. No. |
  204. | B | Name of Subsystem / Module / Menu Selection |
  205. | C | System Page / Program Name |
  206. | D | Latest Page Version & Date |
  207. | E | Page Purpose Highlights |
  208. | F | Name of Function within Program |
  209. | G | Functions Highlight |
  210. | H | Latest Function Version & Date |
  211. | I | Major Changes Highlights |
  212. | J | Developed By |
  213. | K | 1st Previous Page Version & Date |
  214. | L | 1st Major Changes Highlights |
  215. | M | Developed By |
  216. | N | 2nd Previous Page Version & Date |
  217. | O | 2nd Major Changes Highlights |
  218. | P | Developed By |
  219. | Q | 3rd Previous Page Version & Date |
  220. | R | 3rd Major Changes Highlights |
  221. | S | Developed By |
  222. #### Column F — English symbol + source file (required)
  223. **Name of Function within Program (F)** must use the real English
  224. identifier from code (component / class / function / endpoint name),
  225. **and** state which file(s) it comes from. Do **not** put only a
  226. localized UI label in F.
  227. Format:
  228. ```text
  229. <EnglishSymbol> — <repo-relative path>
  230. ```
  231. Examples:
  232. - `ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx`
  233. - `GoodPickExecutionWorkbenchRecord — src/components/DoWorkbench/GoodPickExecutionWorkbenchRecord.tsx`
  234. If one checklist function spans multiple primary files, put **each**
  235. symbol + path on its **own new line** (do not join with `; ` on one line):
  236. ```text
  237. ItemTracingSummary — src/components/ItemTracing/ItemTracingSummary.tsx
  238. ItemTracingLocations — src/components/ItemTracing/ItemTracingLocations.tsx
  239. ```
  240. ##### Service / controller / class files — also list member functions
  241. When the primary symbol is a **service, controller, or other class**
  242. (not a React page component), F must also name the **member function(s)**
  243. that were added or changed — not only the class name.
  244. Put **each class + its methods + its path on its own line** (Excel `\n`,
  245. wrap text). Do not squeeze multiple files onto one line with `; `.
  246. Format (one file per line):
  247. ```text
  248. <ClassName>.<fun1> / .<fun2> — <path-to-that-file>
  249. ```
  250. Multi-file example:
  251. ```text
  252. ItemLotTraceService.trace / .traceLocation — src/main/java/com/ffii/fpsms/modules/stock/service/ItemLotTraceService.kt
  253. InventoryLotLineController.traceLot / .traceLocation — src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt
  254. ```
  255. ```text
  256. PickOrderLifecycleController.getLifecycle / .getLifecycleByCode — src/main/java/.../PickOrderLifecycleController.kt
  257. PickOrderLifecycleService.getLifecycle / .getLifecycleByCode — src/main/java/.../PickOrderLifecycleService.kt
  258. ```
  259. For multi-file **component** rows, also one path per line:
  260. ```text
  261. ItemTracingSummary — src/components/ItemTracing/ItemTracingSummary.tsx
  262. ItemTracingLocations — src/components/ItemTracing/ItemTracingLocations.tsx
  263. ```
  264. Fact-check each listed member function exists in that file (same casing).
  265. If only one method changed, list that one method. Do not cite a class
  266. without its relevant `fun` / method names when the change is in a
  267. `*Service` / `*Controller` (or similar) file.
  268. **Functions Highlight (G)** and **Major Changes (I)** must be 中英對照
  269. (Chinese then English on the next line). Prefer i18n terms. Page /
  270. subsystem names (B/C) use `中文 / English`.
  271. #### Column E — Page Purpose + where the function is used (required)
  272. On **Functions in Page&Program**, **Page Purpose Highlights (E)** must
  273. include:
  274. 1. The owning page purpose (what page C is for), **and**
  275. 2. **Where this function is used / called from** — especially when the
  276. caller is a **different** page than column C.
  277. Owning page (C) = where the code/feature primarily lives.
  278. Usage location = which page(s) invoke, deep-link into, or depend on it.
  279. Examples:
  280. - Function lives on `工單提料` but is opened from Item Tracing doc links:
  281. ```text
  282. 工單提料執行頁面(/jodetail)。
  283. Job Order Pick Execution page (/jodetail).
  284. 使用/呼叫來源:批號追溯(單據深連結開啟已完成提料紀錄)。
  285. Used / called from: Item Tracing (doc deep-link to open completed pick record).
  286. ```
  287. - Function lives on `提料單` (lifecycle API) but is consumed for tracing:
  288. ```text
  289. 提料單管理。
  290. Pick Order management.
  291. 使用/呼叫來源:批號追溯(追溯流程/單據生命週期查詢)。
  292. Used / called from: Item Tracing (trace flow / document lifecycle query).
  293. ```
  294. - Function lives on `成品出倉` but is deep-linked from tracing:
  295. ```text
  296. 成品出倉(DO Workbench)揀貨與紀錄作業。
  297. DO Workbench pick execution and records.
  298. 使用/呼叫來源:批號追溯(單據深連結開啟成品出倉紀錄)。
  299. Used / called from: Item Tracing (doc deep-link to open DO Workbench record).
  300. ```
  301. - Function lives on and is only used by the same page (e.g. 批號追溯):
  302. ```text
  303. …頁面目的(中文)…
  304. …page purpose (English)…
  305. 使用/呼叫來源:本頁(批號追溯 / Item Tracing)。
  306. Used / called from: this page (批號追溯 / Item Tracing).
  307. ```
  308. Put **使用/呼叫來源** (and its English line) on **new lines** after the
  309. page-purpose ZH/EN pair. Do not run usage on the same line as purpose.
  310. When inferring usage, fact-check callers (imports, links, API consumers)
  311. from the change/diff. Do not invent a caller. If usage is only the owning
  312. page, say `本頁(<page>)`. If multiple callers, list them (i18n names).
  313. Do **not** leave E as only the generic page blurb when the function was
  314. added/changed for another page’s flow (e.g. refs that support 批號追溯
  315. but sit under 工單提料/提料單/成品出倉).
  316. #### Fact-check column F before preview (required)
  317. Never invent a symbol or path. For **every** Functions-sheet row in the
  318. preview (new or updated), verify against the real repos:
  319. 1. **Path exists** — each repo-relative path resolves under the correct
  320. workspace (`FPSMS-frontend` or `FPSMS-backend`). Prefer `Glob` / `Read`
  321. / `Grep`; do not guess.
  322. 2. **Symbol is in that file** — the English symbol must actually be defined
  323. or exported in the cited file (e.g. `const ItemTracingScanBar`,
  324. `export default ItemTracingScanBar`, `open class ItemLotTraceService`,
  325. `fun traceLot`, `class PickOrderLifecycleController`). Match casing
  326. exactly as in code (`CompleteJobOrderRecord`, not `completeJobOrderRecord`).
  327. For service/controller rows, also verify each listed **member function**
  328. (e.g. `trace`, `traceLocation`, `getLifecycle`) exists in that file.
  329. 3. **Multi-path rows** — each symbol + path must be on its **own line**:
  330. - Every line’s symbol must be defined in that line’s file.
  331. - Example OK:
  332. ```text
  333. ItemTracingSummary — …/ItemTracingSummary.tsx
  334. ItemTracingLocations — …/ItemTracingLocations.tsx
  335. ```
  336. - Do not join multiple files with `; ` on one line.
  337. 4. **Wrong location** — if the symbol lives elsewhere, correct the path to
  338. the real file; do not keep a convenient-but-false path.
  339. 5. **Not found** — if the file or symbol cannot be verified, do **not** put
  340. it in F. Omit the row or ask the user; never write an unverified F.
  341. In the preview, mark verified rows (optional short note), e.g.
  342. `F verified: symbol+path OK`. If any F failed fact-check, fix before asking
  343. for confirmation.
  344. ## Preview format (required before save)
  345. Show a clear preview, for example:
  346. ```text
  347. Excel: <resolved path>
  348. Sheet: Functions in Page&Program
  349. Row 12 (UPDATE existing | Ref 7 | Page: 批號追溯 | Function: ItemTracingFlowGraphSearch — src/components/ItemTracing/ItemTracingFlowGraphSearch.tsx)
  350. History shift:
  351. old Latest (H/I/J) → 1st
  352. old 1st → 2nd
  353. old 2nd → 3rd
  354. old 3rd → DROP
  355. New Latest:
  356. H: v1.2.0 2026-07-14
  357. I: 新增流程圖節點搜尋。
  358. Add flow-graph node search.
  359. ItemTracingFlowGraphSearch.tsx
  360. L42–88: 搜尋框與節點高亮。
  361. L42–88: search box and node highlight.
  362. J: <developer>
  363. Row NEW (append | next Ref 15 | Page: 批號追溯 / Item Tracing | Function: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx)
  364. A: 15
  365. B: 倉庫管理 / Store Management
  366. C: 批號追溯 / Item Tracing
  367. E: …頁面目的(中文)…
  368. …page purpose (English)…
  369. 使用/呼叫來源:本頁(批號追溯 / Item Tracing)。
  370. Used / called from: this page (批號追溯 / Item Tracing).
  371. F: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx
  372. G: 相機掃碼/手動查詢
  373. Camera scan / manual search
  374. ...
  375. H/I/J: <new latest>
  376. history slots: empty
  377. Row NEW (… | Page: 工單提料 / Job Order Pick Execution | Function: CompleteJobOrderRecord — …)
  378. C: 工單提料 / Job Order Pick Execution
  379. E: 工單提料執行頁面(/jodetail)。
  380. Job Order Pick Execution page (/jodetail).
  381. 使用/呼叫來源:批號追溯(單據深連結)。
  382. Used / called from: Item Tracing (doc deep-link).
  383. F: CompleteJobOrderRecord — src/components/Jodetail/completeJobOrderRecord.tsx
  384. JodetailSearch — src/components/Jodetail/JodetailSearch.tsx
  385. Confirm: Is this preview correct? [Yes / No — tell me what to change]
  386. ```
  387. For page-sheet rows, use the same style with D/F/G and H–P history.
  388. ## Workflow
  389. 1. Confirm Excel path exists (and is writable when saving).
  390. 2. Infer target sheets and rows from the user’s change description / diff.
  391. 3. **Pre-check** existing program/page/function rows in Excel.
  392. 4. For each Functions row: **fact-check** English symbol + every source path
  393. against the codebase (see Fact-check column F). Correct or drop failures.
  394. 5. For each Functions row: set **E** with page purpose **and** usage/呼叫來源
  395. (owning page vs caller page; see Column E rule).
  396. 6. For each existing match: plan history shift + new Latest values
  397. (**only** shift function history when that function’s F symbols changed).
  398. 7. For each Major Changes cell (page + functions, Latest and any filled history
  399. slots): resolve **file path + line range(s) + short per-hunk explanation**
  400. from git diff / current sources (see Major Changes: file, lines, explanation).
  401. 8. For each new function/page: plan a new Ref. No. row (next integer after max used).
  402. 9. Present the **full preview** (verified F + file/line Major Changes) → ask once
  403. if correct.
  404. 10. On approval: apply shifts + writes with `openpyxl`, save, report sheet names,
  405. row numbers, Ref. Nos., and key Latest fields.
  406. 11. **Code comments** — for every Functions-sheet symbol that was added or
  407. updated, add or refresh the FP-MTMS checklist comment on that
  408. component / class member (see Code comments rule). Include this in the
  409. preview (list of files/symbols that will get comments).
  410. 12. Note that OneDrive may take a few seconds to sync; refresh Excel Online if open.
  411. ## Code comments on every updated function (required)
  412. After the user approves the checklist preview (or as part of the same
  413. approved batch), **add or update a source comment** on every function /
  414. component listed in column F for each affected Functions-sheet row.
  415. ### Comment contents (required fields)
  416. Must include:
  417. 1. **Ref. No.** — Functions sheet Ref. No. for that row
  418. 2. **Version** — Latest Function Version (column H), e.g. `v1.0.0`
  419. 3. **Update date** — the date from column H, e.g. `2026-07-14`
  420. ### Canonical format
  421. Parse column H `vX.Y.Z YYYY-MM-DD` into version + date.
  422. **TypeScript / TSX** (JSDoc immediately above the component / export /
  423. function):
  424. ```ts
  425. /** FP-MTMS Version Checklist | Functions Ref. No. 1 | v1.0.0 | 2026-07-14 */
  426. const ItemTracingScanBar: React.FC<ScanBarProps> = (...) => {
  427. ```
  428. **Kotlin** (KDoc immediately above the `fun` / class member):
  429. ```kotlin
  430. /** FP-MTMS Version Checklist | Functions Ref. No. 7 | v1.0.0 | 2026-07-14 */
  431. open fun trace(...): ItemLotTraceResponse = ...
  432. ```
  433. If a KDoc/JSDoc already exists, **prepend or merge** this checklist line
  434. into it (do not delete useful existing documentation). Prefer keeping the
  435. checklist line as the first line of the block:
  436. ```kotlin
  437. /**
  438. * FP-MTMS Version Checklist | Functions Ref. No. 7 | v1.0.0 | 2026-07-14
  439. * Lazy-load: returns the full location-scoped trace block...
  440. */
  441. ```
  442. ### Placement rules
  443. - **React component**: above the primary `const ComponentName` / `export
  444. default` that matches column F.
  445. - **Service / controller**: above **each** listed member function
  446. (e.g. both `trace` and `traceLocation`).
  447. - Multi-line F (one symbol per line): comment **each** symbol in its file.
  448. - On later checklist updates to the same row: **replace** the old Ref/version/date
  449. in the comment with the new Latest values (do not stack duplicate checklist lines).
  450. ### Preview
  451. The Excel preview must also list planned comment updates, e.g.:
  452. ```text
  453. Code comments to add/update:
  454. Ref 7 → ItemLotTraceService.trace / .traceLocation (v1.0.0 | 2026-07-14)
  455. Ref 1 → ItemTracingScanBar (v1.0.0 | 2026-07-14)
  456. ```
  457. Only edit comments after preview approval (same gate as Excel write), unless
  458. the user explicitly asks to sync comments only.
  459. ## Inference hints (for filling the preview)
  460. - **Version & Date**: next patch/semver from conversation/git if known; else
  461. `vX.Y.Z YYYY-MM-DD` with today’s date.
  462. - **Developed By**: `git config user.name` or chat context.
  463. - **Purpose / Changes / Function highlight**: 中英對照; short bullets from
  464. recent PR/diff; prefer i18n terms.
  465. - **Major Changes (Page F / Functions I and history slots)**: summary ZH/EN
  466. **plus** each changed file, line range(s), and short per-hunk explanation
  467. (see Major Changes: file, lines, explanation). Resolve lines from git diff
  468. + current file; do not omit locations.
  469. - **Subsystem / Page names**: `中文 / English` from i18n EN+ZH.
  470. - **Function name (col F)**: English code symbol + source file path only
  471. (no 中英對照). **Fact-check** symbol+path before preview.
  472. - **Page Purpose (E)**: 中英對照 + usage/呼叫來源 lines (ZH then EN).
  473. - **Ref. No.**: for new rows, next integer after the last used Ref. No. on that sheet.
  474. - Prefer updating an existing row over creating a duplicate when page +
  475. English function symbol (and file) match.
  476. ## Do not
  477. - Ask the user to fill cells one column at a time
  478. - Save without an approved preview
  479. - Skip history shift when updating an existing Latest
  480. - Push or invent **function** history (H–S) for a commit that did not change
  481. that row’s column F symbols — no “page align / no code change” filler slots
  482. - Write Major Changes as summary-only without **file path + line range(s) +
  483. short per-hunk explanation** (Page F / Functions I and matching history cols)
  484. - Write Chinese-only or English-only prose in bilingual-required columns
  485. (everything except Function name F, versions, Developed By, Ref. No., and
  486. the path/line tokens inside Major Changes)
  487. - Put only a Chinese UI label in **Name of Function within Program** without
  488. the English symbol and source file
  489. - Bilingualize column F (keep symbol + path English-only)
  490. - Omit usage/呼叫來源 from **Page Purpose Highlights (E)** when the function
  491. is invoked from another page (e.g. 批號追溯 deep-link into 工單提料)
  492. - Cite a `*Service` / `*Controller` class in F without its relevant member
  493. function names (e.g. write `ItemLotTraceService.trace / .traceLocation`,
  494. not only `ItemLotTraceService`)
  495. - Write an F value whose symbol or path was not verified in the codebase
  496. - Guess file paths or rename symbols to “look right” without opening the file
  497. - Put two different 功能 on the same Ref. No. row
  498. - Create a function row when the parent program/page was neither found nor
  499. included in the same approved preview as a new page row
  500. - Clear history columns without showing that drop in the preview
  501. - Skip adding/updating FP-MTMS checklist comments on code for Functions rows
  502. that were just written (must include Ref. No., version, and update date)
  503. - Commit the Excel file to git
  504. - Edit cloud URLs / `.url` files as if they were workbooks