/sub-packages/mercari-viewer/CLAUDE.md
CLAUDE.md at /sub-packages/mercari-viewer/CLAUDE.md
Path: sub-packages/mercari-viewer/CLAUDE.md
Mercari CSV Viewer
Vite + React app for viewing and editing Mercari Shops CSV exports. Runs on zmercari.localhost
.Start
pnpm mercari:dev # from project root
pnpm dev # from this directory
Architecture
- Data source: Loads latest CSV from
/mercari-data/directory - State:
MercariDataModelwith field-level modification tracking (same pattern as products-viewer) - Components:
App.jsx->MercariTable.jsx+DescriptionDrawer.jsx - CSV handling: Papa Parse for robust CSV parsing (UTF-8, Shift-JIS, Japanese characters)
Key Behaviors
- Saves to
/mercari-data/updated/YYYYMMDD-timestamp.csv - SKU stock changes automatically calculate increment flags (
増減フラグ= 1 for increase, 2 for decrease) - Description editing via side drawer with full textarea
- Modified cells show yellow background
draft.json is scratch / staging — not a permanent record
sub-packages/mercari-viewer/draft.json is temporary working data for assembling Mercari Shops listings before publishing them. The name is literal: each entry represents a draft listing the operator is still preparing. Once a draft has been published on Mercari Shops, the operator typically deletes it from draft.json — the canonical record then lives on Mercari Shops itself, and the resulting Mercari product ID lands in src/data/product-master-data.mjs via /l-sync-mercari-ids (or the bigger /l-pull-mercari-shops workflow).
Implications for Claude:
- Do not treat
draft.jsonlike a database to preserve. Entries can disappear (intentionally) between sessions. - A diff that removes entries from
draft.jsonis usually correct cleanup, not data loss — confirm with the operator if unsure. /l-add-mercari-itemwrites new entries here. After Mercari publication, those entries are eventually pruned by hand.- Schema details still matter (field names like
商品名,productStatus,images[],skus[]);/l-add-mercari-item’s SKILL.md is the source of truth for the shape.
Mercari Price Update Workflow
- Download CSV from Mercari Shops, save as
product_data_YYYY-MM-DD.csvin/mercari-data/ - Run
pnpm update:mercari-prices(from project root) to updateproduct-master-data.mjs - Use
pnpm mercari:devto review and edit CSV data - Click “Save CSV” to export edited version
Testing
pnpm test # Run all tests (Vitest)
pnpm test:watch # Watch mode