| @@ -2,9 +2,10 @@ | |||
| name: fp-mtms-version-checklist | |||
| description: >- | |||
| Updates the FP-MTMS Version Programs and Functions Checklist Excel on each | |||
| developer's synced SharePoint folder. Use only when the user explicitly | |||
| invokes this skill or asks to update the FP-MTMS version control checklist, | |||
| page/program version sheet, or function version sheet. | |||
| developer's synced SharePoint folder. Overflow beyond Latest+3 previous | |||
| versions is appended to the Archive long-table Excel. Use only when the user | |||
| explicitly invokes this skill or asks to update the FP-MTMS version control | |||
| checklist, page/program version sheet, function version sheet, or archive. | |||
| disable-model-invocation: true | |||
| --- | |||
| @@ -26,8 +27,8 @@ All written cell values must be **Traditional Chinese + English** | |||
| **Exception — do NOT bilingualize:** | |||
| - `Functions in Page&Program` column **F — Name of Function within | |||
| Program** (English symbol + source path only; see Column F rule) | |||
| - `Functions in Page&Program` column **G — Name of Function within | |||
| Program** (English symbol + source path only; see Column G rule) | |||
| - Version & Date fields (e.g. `v1.0.0 2026-07-14`) | |||
| - Developed By (person name as-is) | |||
| - Ref. No. (number) | |||
| @@ -52,8 +53,8 @@ Job Order Pick Execution page (/jodetail). | |||
| Used / called from: Item Tracing (doc deep-link to open completed pick record). | |||
| ``` | |||
| **Major Changes** (Page col F / history I,L,O and Functions col I / history | |||
| L,O,R) must also list **file + line range + short per-line explanation** — | |||
| **Major Changes** (Page col F / history I,L,O and Functions col J / history | |||
| M,P,S) must also list **file + line range + short per-line explanation** — | |||
| see **Major Changes: file, lines, explanation** below. | |||
| Prefer EN/ZH pairs from `src/i18n/en/*` and `src/i18n/zh/*` for menu and | |||
| @@ -72,10 +73,18 @@ Path varies by Windows user / OneDrive sync root. Resolve in this order: | |||
| `FP-MTMS Version Programs and Functions Checklist v0.1.xlsx` (real `.xlsx` only). | |||
| 4. **Always confirm the resolved path with the user before writing.** | |||
| Do not edit `.url` shortcuts or Downloads copies unless the user explicitly asks. | |||
| ### Archive Excel path | |||
| Use `openpyxl` to read/write. If the file is locked (PermissionError), ask the | |||
| user to close Excel / Excel Online sync lock, then retry. | |||
| Same folder as the main checklist. Default: | |||
| `{USERPROFILE}/2Fi Business Solutions Limited/2Fi Business Solutions Limited - FP-MTMS VERSION CONTROL/FP-MTMS Version Programs and Functions Checklist v0.1 - Archive.xlsx` | |||
| If the user provides an archive path, use it. Confirm both main and archive | |||
| paths before writing. Do not edit `.url` shortcuts or Downloads copies unless | |||
| the user explicitly asks. | |||
| Use `openpyxl` to read/write. If either file is locked (PermissionError), ask | |||
| the user to close Excel / Excel Online sync lock, then retry. | |||
| ## Hard rule: preview first — do not interview column by column | |||
| @@ -86,7 +95,7 @@ Instead: | |||
| 1. Infer all planned adds/updates from conversation context, git diff, PR, | |||
| feature description, and existing Excel rows. | |||
| 2. Before any write, show a **full preview** of every row that will be added or | |||
| changed (including history shifts). | |||
| changed (including history shifts and any Archive long-table appends). | |||
| 3. Ask **one** confirmation: whether this preview is correct (yes / no / what | |||
| to fix). Prefer the Ask Questions tool when available; otherwise ask once | |||
| in chat. | |||
| @@ -109,6 +118,7 @@ Before drafting or writing any row: | |||
| 2. Match on existing rows when the program/page already exists. | |||
| 3. If updating a function: the parent page/program should already exist on | |||
| `Page&Program Name` (or be included in the same preview as a new page row). | |||
| Set **Page Ref. No. (B)** to that page row’s Ref. No. | |||
| 4. If nothing matches and the user intends a **new** program or function, say so | |||
| clearly in the preview as `NEW ROW`. | |||
| 5. Do **not** invent duplicate rows for the same page + same function. | |||
| @@ -126,10 +136,12 @@ rightward** before writing the new Latest: | |||
| | Latest | → 1st previous | | |||
| | 1st previous | → 2nd previous | | |||
| | 2nd previous | → 3rd previous | | |||
| | 3rd previous | → **deleted** (dropped) | | |||
| | 3rd previous | → **Archive Excel** (append long-table row; then clear 3rd on main) | | |||
| Then write the new change into **Latest** (version/date, highlights, Developed By). | |||
| If the old 3rd previous slot is **empty**, skip archive append for that shift. | |||
| ### Page&Program Name — fields that shift together | |||
| Treat each “slot” as a triple: | |||
| @@ -139,35 +151,114 @@ Treat each “slot” as a triple: | |||
| - **2nd**: K, L, M | |||
| - **3rd**: N, O, P | |||
| Shift: `(D,F,G) → (H,I,J) → (K,L,M) → (N,O,P)` then drop old 3rd; write new into D/F/G. | |||
| Shift: `(D,F,G) → (H,I,J) → (K,L,M) → (N,O,P)` then **archive** old 3rd | |||
| (N/O/P) to the Archive Excel long table if filled; clear N/O/P on main; write | |||
| new into D/F/G. | |||
| Leave identity columns A–C and purpose E unchanged unless the user asked to | |||
| change them (purpose may be refreshed if the preview says so). | |||
| ### Functions in Page&Program — fields that shift together | |||
| - **Latest**: H (Function Version & Date), I (Major Changes), J (Developed By) | |||
| - **1st**: K, L, M | |||
| - **2nd**: N, O, P | |||
| - **3rd**: Q, R, S | |||
| - **Latest**: I (Function Version & Date), J (Major Changes), K (Developed By) | |||
| - **1st**: L, M, N | |||
| - **2nd**: O, P, Q | |||
| - **3rd**: R, S, T | |||
| Shift: `(I,J,K) → (L,M,N) → (O,P,Q) → (R,S,T)` then **archive** old 3rd | |||
| (R/S/T) to the Archive Excel long table if filled; clear R/S/T on main; write | |||
| new into I/J/K. | |||
| Leave A–H (Ref, **Page Ref. No.**, subsystem, page, page version/purpose, | |||
| function name/highlight) unchanged unless the preview explicitly updates them. | |||
| Always show the shift **and any archive appends** in the preview (old Latest → | |||
| new 1st, old 3rd → Archive, etc.). | |||
| #### Column B — Page Ref. No. (required) | |||
| **Page Ref. No. (B)** on every Functions row must equal the parent row’s | |||
| **Ref. No. (A)** on sheet `Page&Program Name`. | |||
| Rules: | |||
| 1. Resolve the parent by matching **System Page / Program Name** (and | |||
| subsystem when needed) on the Page sheet; use that page row’s A. | |||
| 2. Never leave B blank on a Functions data row. | |||
| 3. Do **not** invent a Page Ref that has no matching Page sheet row (unless | |||
| that page row is included in the same approved preview as NEW). | |||
| 4. Multiple function rows under the same page share the **same** Page Ref. No. | |||
| 5. Function **Ref. No. (A)** stays independent (one per 功能 row). | |||
| 6. Preview must show `Page Ref. No. = <n> → Page sheet Ref <n> (<page name>)`. | |||
| Page sheet columns A–P are unchanged by this field (Page sheet has no | |||
| Page Ref column). | |||
| ## Archive Excel — long table (required on 3rd overflow) | |||
| When a filled **3rd previous** is pushed off the main checklist, **append one | |||
| row** to the Archive workbook (never overwrite existing archive rows). | |||
| Data starts at **row 5** (rows 1–3 title/notes, row 4 headers). | |||
| ### Sheet: `Page&Program Name` (archive) | |||
| | Col | Header | | |||
| |-----|--------| | |||
| | A | Ref. No. | | |||
| | B | Name of Subsystem / Module / Menu Selection | | |||
| | C | System Page / Program Name | | |||
| | D | Version & Date | | |||
| | E | Major Changes Highlights | | |||
| | F | Developed By | | |||
| | G | Archived At | | |||
| | H | Source | | |||
| Map from main page row 3rd slot: A←A, B←B, C←C, D←N, E←O, F←P. | |||
| `Archived At` = today's date (`YYYY-MM-DD`). | |||
| `Source` = `overflow from 3rd previous` (unless the user specifies another reason). | |||
| Shift: `(H,I,J) → (K,L,M) → (N,O,P) → (Q,R,S)` then drop old 3rd; write new into H/I/J. | |||
| Leave A–G (Ref, subsystem, page, page version/purpose, function name/highlight) | |||
| unchanged unless the preview explicitly updates them. | |||
| ### Sheet: `Functions in Page&Program` (archive) | |||
| Always show the shift in the preview (old Latest → new 1st, etc.). | |||
| | Col | Header | | |||
| |-----|--------| | |||
| | A | Ref. No. | | |||
| | B | Page Ref. No. | | |||
| | C | Name of Subsystem / Module / Menu Selection | | |||
| | D | System Page / Program Name | | |||
| | E | Name of Function within Program | | |||
| | F | Version & Date | | |||
| | G | Major Changes Highlights | | |||
| | H | Developed By | | |||
| | I | Archived At | | |||
| | J | Source | | |||
| Map from main functions row 3rd slot: | |||
| A←A, B←B (Page Ref. No.), C←C, D←D, E←G, F←R, G←S, H←T. | |||
| `Archived At` / `Source` same rules as page archive. | |||
| Always copy **Page Ref. No.** so archive rows stay linked to the parent page. | |||
| ### Archive write rules | |||
| 1. **Append only** — find the next empty data row (after last non-empty row ≥ 5). | |||
| 2. Keep **中英對照** and Major Changes content exactly as they were on main 3rd. | |||
| 3. Do **not** invent archive rows for empty 3rd slots. | |||
| 4. Do **not** edit older archive rows. | |||
| 5. Write archive **before or in the same approved batch as** the main shift; if | |||
| archive save fails (lock), do not leave main half-shifted — abort and ask the | |||
| user to close the file, then retry the whole approved batch. | |||
| 6. Never commit either Excel file to git. | |||
| ### Function history only when that function changed (required) | |||
| **Do not** push or invent a Functions-sheet history slot for a commit / release | |||
| that did **not** change the symbols listed in column F for that row. | |||
| that did **not** change the symbols listed in column G for that row. | |||
| - **Page&Program Name** may still advance Latest / history for a page-level | |||
| release (e.g. backend-only fix under the same page). | |||
| - **Functions in Page&Program**: shift H→K→N→Q **only** when this row’s | |||
| function(s) actually changed (diff touches the verified F symbol(s) / paths). | |||
| - **Functions in Page&Program**: shift I→L→O→R **only** when this row’s | |||
| function(s) actually changed (diff touches the verified G symbol(s) / paths). | |||
| - If a commit updates the **page** but not this function: | |||
| - You may refresh column **D** (Latest Page Version) to match the page row. | |||
| - Leave **H/I/J** and previous function history **unchanged**. | |||
| - You may refresh column **E** (Latest Page Version) to match the page row. | |||
| - Leave **I/J/K** and previous function history **unchanged**. | |||
| - Do **not** write filler Latest/history text such as「頁面版本對齊;本功能無程式變更」 | |||
| / “Page version align; no UI change this release”. | |||
| - When mapping several commits into history for a **new** function row: include | |||
| @@ -176,13 +267,13 @@ that did **not** change the symbols listed in column F for that row. | |||
| versions and history depths. | |||
| Example: page Latest = v1.0.3 (backend TRF fix). Frontend transfer UI row last | |||
| changed at v1.0.2 → keep function H = v1.0.2; optional D = v1.0.3; no fake | |||
| changed at v1.0.2 → keep function I = v1.0.2; optional E = v1.0.3; no fake | |||
| v1.0.3 function history slot. | |||
| ### Major Changes: file, lines, explanation (required) | |||
| For every **Major Changes Highlights** cell written into Excel (Page sheet | |||
| Latest F and history I/L/O; Functions sheet Latest I and history L/O/R), | |||
| Latest F and history I/L/O; Functions sheet Latest J and history M/P/S), | |||
| include concrete code locations from the commit / diff — not only a summary | |||
| sentence. | |||
| @@ -219,10 +310,10 @@ StockInLineService.kt | |||
| - Prefer the member / symbol name in the explanation when helpful | |||
| (e.g. `createStockOutBatch`, `assignLotNo`). | |||
| - If many files: keep bullets short; still list each touched path that belongs | |||
| to this row (Functions row → only files/symbols in column F, plus closely | |||
| to this row (Functions row → only files/symbols in column G, plus closely | |||
| related hunks in those files for this change). | |||
| - Page-sheet Major Changes may summarize all files for that page release; | |||
| Functions-sheet Major Changes stay scoped to that function row’s F symbols | |||
| Functions-sheet Major Changes stay scoped to that function row’s G symbols | |||
| and their files. | |||
| - Show the same file/line bullets in the **preview** before write. | |||
| - Pure i18n-only or one-liner UI copy changes: still cite file + line(s) | |||
| @@ -266,31 +357,41 @@ Data starts at **row 5** (rows 1–4 are title/headers). | |||
| | Col | Header | | |||
| |-----|--------| | |||
| | A | Ref. No. | | |||
| | B | Name of Subsystem / Module / Menu Selection | | |||
| | C | System Page / Program Name | | |||
| | D | Latest Page Version & Date | | |||
| | E | Page Purpose Highlights | | |||
| | F | Name of Function within Program | | |||
| | G | Functions Highlight | | |||
| | H | Latest Function Version & Date | | |||
| | I | Major Changes Highlights | | |||
| | J | Developed By | | |||
| | K | 1st Previous Page Version & Date | | |||
| | L | 1st Major Changes Highlights | | |||
| | M | Developed By | | |||
| | N | 2nd Previous Page Version & Date | | |||
| | O | 2nd Major Changes Highlights | | |||
| | P | Developed By | | |||
| | Q | 3rd Previous Page Version & Date | | |||
| | R | 3rd Major Changes Highlights | | |||
| | S | Developed By | | |||
| #### Column F — English symbol + source file (required) | |||
| **Name of Function within Program (F)** must use the real English | |||
| | B | Page Ref. No. | | |||
| | C | Name of Subsystem / Module / Menu Selection | | |||
| | D | System Page / Program Name | | |||
| | E | Latest Page Version & Date | | |||
| | F | Page Purpose Highlights | | |||
| | G | Name of Function within Program | | |||
| | H | Functions Highlight | | |||
| | I | Latest Function Version & Date | | |||
| | J | Major Changes Highlights | | |||
| | K | Developed By | | |||
| | L | 1st Previous Page Version & Date | | |||
| | M | 1st Major Changes Highlights | | |||
| | N | Developed By | | |||
| | O | 2nd Previous Page Version & Date | | |||
| | P | 2nd Major Changes Highlights | | |||
| | Q | Developed By | | |||
| | R | 3rd Previous Page Version & Date | | |||
| | S | 3rd Major Changes Highlights | | |||
| | T | Developed By | | |||
| (Main workbook may also show helper note columns such as U `Archive`; do | |||
| **not** require filling them unless the user asks. Page Ref. No. is the | |||
| required parent link.) | |||
| #### Column B — Page Ref. No. (see also history section) | |||
| Must point at the parent `Page&Program Name` row’s **Ref. No. (A)**. Required | |||
| on every Functions data row (main and archive). | |||
| #### Column G — English symbol + source file (required) | |||
| **Name of Function within Program (G)** must use the real English | |||
| identifier from code (component / class / function / endpoint name), | |||
| **and** state which file(s) it comes from. Do **not** put only a | |||
| localized UI label in F. | |||
| localized UI label in G. | |||
| Format: | |||
| @@ -313,7 +414,7 @@ ItemTracingLocations — src/components/ItemTracing/ItemTracingLocations.tsx | |||
| ##### Service / controller / class files — also list member functions | |||
| When the primary symbol is a **service, controller, or other class** | |||
| (not a React page component), F must also name the **member function(s)** | |||
| (not a React page component), G must also name the **member function(s)** | |||
| that were added or changed — not only the class name. | |||
| Put **each class + its methods + its path on its own line** (Excel `\n`, | |||
| @@ -348,13 +449,13 @@ Fact-check each listed member function exists in that file (same casing). | |||
| If only one method changed, list that one method. Do not cite a class | |||
| without its relevant `fun` / method names when the change is in a | |||
| `*Service` / `*Controller` (or similar) file. | |||
| **Functions Highlight (G)** and **Major Changes (I)** must be 中英對照 | |||
| **Functions Highlight (H)** and **Major Changes (J)** must be 中英對照 | |||
| (Chinese then English on the next line). Prefer i18n terms. Page / | |||
| subsystem names (B/C) use `中文 / English`. | |||
| subsystem names (C/D) use `中文 / English`. | |||
| #### Column E — Page Purpose + where the function is used (required) | |||
| #### Column F — Page Purpose + where the function is used (required) | |||
| On **Functions in Page&Program**, **Page Purpose Highlights (E)** must | |||
| On **Functions in Page&Program**, **Page Purpose Highlights (F)** must | |||
| include: | |||
| 1. The owning page purpose (what page C is for), **and** | |||
| @@ -409,11 +510,11 @@ When inferring usage, fact-check callers (imports, links, API consumers) | |||
| from the change/diff. Do not invent a caller. If usage is only the owning | |||
| page, say `本頁(<page>)`. If multiple callers, list them (i18n names). | |||
| Do **not** leave E as only the generic page blurb when the function was | |||
| Do **not** leave F as only the generic page blurb when the function was | |||
| added/changed for another page’s flow (e.g. refs that support 批號追溯 | |||
| but sit under 工單提料/提料單/成品出倉). | |||
| #### Fact-check column F before preview (required) | |||
| #### Fact-check column G before preview (required) | |||
| Never invent a symbol or path. For **every** Functions-sheet row in the | |||
| preview (new or updated), verify against the real repos: | |||
| @@ -441,10 +542,10 @@ preview (new or updated), verify against the real repos: | |||
| 4. **Wrong location** — if the symbol lives elsewhere, correct the path to | |||
| the real file; do not keep a convenient-but-false path. | |||
| 5. **Not found** — if the file or symbol cannot be verified, do **not** put | |||
| it in F. Omit the row or ask the user; never write an unverified F. | |||
| it in G. Omit the row or ask the user; never write an unverified G. | |||
| In the preview, mark verified rows (optional short note), e.g. | |||
| `F verified: symbol+path OK`. If any F failed fact-check, fix before asking | |||
| `G verified: symbol+path OK`. If any G failed fact-check, fix before asking | |||
| for confirmation. | |||
| ## Preview format (required before save) | |||
| @@ -452,46 +553,60 @@ for confirmation. | |||
| Show a clear preview, for example: | |||
| ```text | |||
| Excel: <resolved path> | |||
| Excel: <resolved main path> | |||
| Archive: <resolved archive path> | |||
| Sheet: Functions in Page&Program | |||
| Row 12 (UPDATE existing | Ref 7 | Page: 批號追溯 | Function: ItemTracingFlowGraphSearch — src/components/ItemTracing/ItemTracingFlowGraphSearch.tsx) | |||
| Row 12 (UPDATE existing | Ref 7 | Page Ref 3 → 批號追溯 / Item Tracing | Function: ItemTracingFlowGraphSearch — src/components/ItemTracing/ItemTracingFlowGraphSearch.tsx) | |||
| History shift: | |||
| old Latest (H/I/J) → 1st | |||
| old Latest (I/J/K) → 1st | |||
| old 1st → 2nd | |||
| old 2nd → 3rd | |||
| old 3rd → DROP | |||
| old 3rd → ARCHIVE (append) | |||
| Archive append (Functions in Page&Program): | |||
| A: 7 | |||
| B: 3 | |||
| C: 倉庫管理 / Store Management | |||
| D: 批號追溯 / Item Tracing | |||
| E: ItemTracingFlowGraphSearch — src/components/ItemTracing/ItemTracingFlowGraphSearch.tsx | |||
| F: <old 3rd version & date> | |||
| G: <old 3rd major changes> | |||
| H: <old 3rd developed by> | |||
| I: 2026-07-16 | |||
| J: overflow from 3rd previous | |||
| New Latest: | |||
| H: v1.2.0 2026-07-14 | |||
| I: 新增流程圖節點搜尋。 | |||
| I: v1.2.0 2026-07-14 | |||
| J: 新增流程圖節點搜尋。 | |||
| Add flow-graph node search. | |||
| ItemTracingFlowGraphSearch.tsx | |||
| L42–88: 搜尋框與節點高亮。 | |||
| L42–88: search box and node highlight. | |||
| J: <developer> | |||
| K: <developer> | |||
| Row NEW (append | next Ref 15 | Page: 批號追溯 / Item Tracing | Function: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx) | |||
| Row NEW (append | next Ref 15 | Page Ref 3 → 批號追溯 / Item Tracing | Function: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx) | |||
| A: 15 | |||
| B: 倉庫管理 / Store Management | |||
| C: 批號追溯 / Item Tracing | |||
| E: …頁面目的(中文)… | |||
| B: 3 | |||
| C: 倉庫管理 / Store Management | |||
| D: 批號追溯 / Item Tracing | |||
| F: …頁面目的(中文)… | |||
| …page purpose (English)… | |||
| 使用/呼叫來源:本頁(批號追溯 / Item Tracing)。 | |||
| Used / called from: this page (批號追溯 / Item Tracing). | |||
| F: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx | |||
| G: 相機掃碼/手動查詢 | |||
| G: ItemTracingScanBar — src/components/ItemTracing/ItemTracingScanBar.tsx | |||
| H: 相機掃碼/手動查詢 | |||
| Camera scan / manual search | |||
| ... | |||
| H/I/J: <new latest> | |||
| I/J/K: <new latest> | |||
| history slots: empty | |||
| Row NEW (… | Page: 工單提料 / Job Order Pick Execution | Function: CompleteJobOrderRecord — …) | |||
| C: 工單提料 / Job Order Pick Execution | |||
| E: 工單提料執行頁面(/jodetail)。 | |||
| Row NEW (… | Page Ref <n> → 工單提料 / Job Order Pick Execution | Function: CompleteJobOrderRecord — …) | |||
| B: <page Ref. No.> | |||
| D: 工單提料 / Job Order Pick Execution | |||
| F: 工單提料執行頁面(/jodetail)。 | |||
| Job Order Pick Execution page (/jodetail). | |||
| 使用/呼叫來源:批號追溯(單據深連結)。 | |||
| Used / called from: Item Tracing (doc deep-link). | |||
| F: CompleteJobOrderRecord — src/components/Jodetail/completeJobOrderRecord.tsx | |||
| G: CompleteJobOrderRecord — src/components/Jodetail/completeJobOrderRecord.tsx | |||
| JodetailSearch — src/components/Jodetail/JodetailSearch.tsx | |||
| … | |||
| @@ -502,23 +617,26 @@ For page-sheet rows, use the same style with D/F/G and H–P history. | |||
| ## Workflow | |||
| 1. Confirm Excel path exists (and is writable when saving). | |||
| 1. Confirm **main and archive** Excel paths exist (and are writable when saving). | |||
| 2. Infer target sheets and rows from the user’s change description / diff. | |||
| 3. **Pre-check** existing program/page/function rows in Excel. | |||
| 4. For each Functions row: **fact-check** English symbol + every source path | |||
| against the codebase (see Fact-check column F). Correct or drop failures. | |||
| 5. For each Functions row: set **E** with page purpose **and** usage/呼叫來源 | |||
| (owning page vs caller page; see Column E rule). | |||
| against the codebase (see Fact-check column G). Correct or drop failures. | |||
| Also set / verify **Page Ref. No. (B)** against the parent Page sheet Ref. | |||
| 5. For each Functions row: set **F** with page purpose **and** usage/呼叫來源 | |||
| (owning page vs caller page; see Column F rule). | |||
| 6. For each existing match: plan history shift + new Latest values | |||
| (**only** shift function history when that function’s F symbols changed). | |||
| (**only** shift function history when that function’s G symbols changed). | |||
| If old 3rd is filled, plan an **Archive long-table append**. | |||
| 7. For each Major Changes cell (page + functions, Latest and any filled history | |||
| slots): resolve **file path + line range(s) + short per-hunk explanation** | |||
| from git diff / current sources (see Major Changes: file, lines, explanation). | |||
| 8. For each new function/page: plan a new Ref. No. row (next integer after max used). | |||
| 9. Present the **full preview** (verified F + file/line Major Changes) → ask once | |||
| if correct. | |||
| 10. On approval: apply shifts + writes with `openpyxl`, save, report sheet names, | |||
| row numbers, Ref. Nos., and key Latest fields. | |||
| 9. Present the **full preview** (verified G + Page Ref + file/line Major Changes + | |||
| archive appends) → ask once if correct. | |||
| 10. On approval: with `openpyxl`, **append archive rows first** (if any), then | |||
| apply main shifts + writes; save both workbooks; report sheet names, row | |||
| numbers, Ref. Nos., Page Ref. Nos., archive rows appended, and key Latest fields. | |||
| 11. **Code comments** — for every Functions-sheet symbol that was added or | |||
| updated, add or refresh the FP-MTMS checklist comment on that | |||
| component / class member (see Code comments rule). Include this in the | |||
| @@ -529,19 +647,19 @@ For page-sheet rows, use the same style with D/F/G and H–P history. | |||
| After the user approves the checklist preview (or as part of the same | |||
| approved batch), **add or update a source comment** on every function / | |||
| component listed in column F for each affected Functions-sheet row. | |||
| component listed in column G for each affected Functions-sheet row. | |||
| ### Comment contents (required fields) | |||
| Must include: | |||
| 1. **Ref. No.** — Functions sheet Ref. No. for that row | |||
| 2. **Version** — Latest Function Version (column H), e.g. `v1.0.0` | |||
| 3. **Update date** — the date from column H, e.g. `2026-07-14` | |||
| 2. **Version** — Latest Function Version (column I), e.g. `v1.0.0` | |||
| 3. **Update date** — the date from column I, e.g. `2026-07-14` | |||
| ### Canonical format | |||
| Parse column H `vX.Y.Z YYYY-MM-DD` into version + date. | |||
| Parse column I `vX.Y.Z YYYY-MM-DD` into version + date. | |||
| **TypeScript / TSX** (JSDoc immediately above the component / export / | |||
| function): | |||
| @@ -572,10 +690,10 @@ checklist line as the first line of the block: | |||
| ### Placement rules | |||
| - **React component**: above the primary `const ComponentName` / `export | |||
| default` that matches column F. | |||
| default` that matches column G. | |||
| - **Service / controller**: above **each** listed member function | |||
| (e.g. both `trace` and `traceLocation`). | |||
| - Multi-line F (one symbol per line): comment **each** symbol in its file. | |||
| - Multi-line G (one symbol per line): comment **each** symbol in its file. | |||
| - On later checklist updates to the same row: **replace** the old Ref/version/date | |||
| in the comment with the new Latest values (do not stack duplicate checklist lines). | |||
| @@ -599,14 +717,15 @@ the user explicitly asks to sync comments only. | |||
| - **Developed By**: `git config user.name` or chat context. | |||
| - **Purpose / Changes / Function highlight**: 中英對照; short bullets from | |||
| recent PR/diff; prefer i18n terms. | |||
| - **Major Changes (Page F / Functions I and history slots)**: summary ZH/EN | |||
| - **Major Changes (Page F / Functions J and history slots)**: summary ZH/EN | |||
| **plus** each changed file, line range(s), and short per-hunk explanation | |||
| (see Major Changes: file, lines, explanation). Resolve lines from git diff | |||
| + current file; do not omit locations. | |||
| - **Subsystem / Page names**: `中文 / English` from i18n EN+ZH. | |||
| - **Function name (col F)**: English code symbol + source file path only | |||
| - **Function name (col G)**: English code symbol + source file path only | |||
| (no 中英對照). **Fact-check** symbol+path before preview. | |||
| - **Page Purpose (E)**: 中英對照 + usage/呼叫來源 lines (ZH then EN). | |||
| - **Page Purpose (F)**: 中英對照 + usage/呼叫來源 lines (ZH then EN). | |||
| - **Page Ref. No. (B)**: parent Page sheet Ref. No. for column D’s page. | |||
| - **Ref. No.**: for new rows, next integer after the last used Ref. No. on that sheet. | |||
| - Prefer updating an existing row over creating a duplicate when page + | |||
| English function symbol (and file) match. | |||
| @@ -616,27 +735,30 @@ the user explicitly asks to sync comments only. | |||
| - Ask the user to fill cells one column at a time | |||
| - Save without an approved preview | |||
| - Skip history shift when updating an existing Latest | |||
| - Push or invent **function** history (H–S) for a commit that did not change | |||
| that row’s column F symbols — no “page align / no code change” filler slots | |||
| - Drop a filled **3rd previous** without appending it to the Archive long table | |||
| - Overwrite or edit existing Archive rows (append only) | |||
| - Push or invent **function** history (I–T) for a commit that did not change | |||
| that row’s column G symbols — no “page align / no code change” filler slots | |||
| - Write Major Changes as summary-only without **file path + line range(s) + | |||
| short per-hunk explanation** (Page F / Functions I and matching history cols) | |||
| short per-hunk explanation** (Page F / Functions J and matching history cols) | |||
| - Write Chinese-only or English-only prose in bilingual-required columns | |||
| (everything except Function name F, versions, Developed By, Ref. No., and | |||
| (everything except Function name G, versions, Developed By, Ref. No., Page Ref. No., and | |||
| the path/line tokens inside Major Changes) | |||
| - Put only a Chinese UI label in **Name of Function within Program** without | |||
| the English symbol and source file | |||
| - Bilingualize column F (keep symbol + path English-only) | |||
| - Omit usage/呼叫來源 from **Page Purpose Highlights (E)** when the function | |||
| - Bilingualize column G (keep symbol + path English-only) | |||
| - Omit usage/呼叫來源 from **Page Purpose Highlights (F)** when the function | |||
| is invoked from another page (e.g. 批號追溯 deep-link into 工單提料) | |||
| - Cite a `*Service` / `*Controller` class in F without its relevant member | |||
| - Cite a `*Service` / `*Controller` class in G without its relevant member | |||
| function names (e.g. write `ItemLotTraceService.trace / .traceLocation`, | |||
| not only `ItemLotTraceService`) | |||
| - Write an F value whose symbol or path was not verified in the codebase | |||
| - Write a G value whose symbol or path was not verified in the codebase | |||
| - Leave **Page Ref. No. (B)** blank or pointing at a non-existent Page row | |||
| - Guess file paths or rename symbols to “look right” without opening the file | |||
| - Put two different 功能 on the same Ref. No. row | |||
| - Create a function row when the parent program/page was neither found nor | |||
| included in the same approved preview as a new page row | |||
| - Clear history columns without showing that drop in the preview | |||
| - Clear history columns without showing that shift/archive in the preview | |||
| - Skip adding/updating FP-MTMS checklist comments on code for Functions rows | |||
| that were just written (must include Ref. No., version, and update date) | |||
| - Commit the Excel file to git | |||