Takazudo Modular Docs

Type to search...

to open search from anywhere

/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: MercariDataModel with 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.json like a database to preserve. Entries can disappear (intentionally) between sessions.
  • A diff that removes entries from draft.json is usually correct cleanup, not data loss — confirm with the operator if unsure.
  • /l-add-mercari-item writes 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

  1. Download CSV from Mercari Shops, save as product_data_YYYY-MM-DD.csv in /mercari-data/
  2. Run pnpm update:mercari-prices (from project root) to update product-master-data.mjs
  3. Use pnpm mercari:dev to review and edit CSV data
  4. Click “Save CSV” to export edited version

Testing

pnpm test           # Run all tests (Vitest)
pnpm test:watch     # Watch mode