Takazudo Modular Docs

Type to search...

to open search from anywhere

l-support-make-mercari-matome-text

Generate bulk purchase (まとめ買い) text for Mercari shops with automatic price calculations from product master data.

Add Mercari Matome (Bulk Purchase)

This command generates まとめ買い (bulk purchase) text for Mercari shops with automatic price calculation and formatting.

Overview

When this command is executed, Claude will:

  1. Collect Information - Get product URLs and shipping discount
  2. Match Products - Find products in master data by Mercari URLs
  3. Calculate Totals - Sum prices and apply shipping discount
  4. Format Output - Generate formatted まとめ買い text
  5. Save File - Save to __inbox/_mercari-matome-YYYYMMDD.md

Command Arguments

Users may provide arguments when running the command:

# With all arguments
/add-mercari-matome

# Arguments can include:
# - Mercari product URLs (one per line or comma-separated)
# - Shipping discount amount

If arguments are not provided, Claude will ask for them interactively.

Step 1: Collect Information

Required Information

Claude needs two pieces of information:

1. Items for Bulk Purchase

Mercari product URLs in the format:

https://jp.mercari.com/shops/product/eWhuJVL47JakTTodgTSb34
https://jp.mercari.com/shops/product/RnEDoRrFWVBKhA9H58VZPh
https://jp.mercari.com/shops/product/abc123def456ghi789

What to do:

  • Accept URLs as text input (one per line or comma-separated)
  • Extract product IDs from URLs (the last part after /product/)
  • URLs can be provided as command arguments or asked interactively

2. Shipping Fee Discount

The shipping discount amount. Common values:

  • 通常配送: -850円
  • ネコポス配送: -210円

What to do:

  • If not provided in arguments, show options:
    通常配送: -850
    ネコポス配送: -210
  • Accept custom amounts if user specifies

Step 2: Match Products

Find Products in Master Data

  1. Read product master data:

    src/data/product-master-data.mjs
  2. Match products by comparing:

  • Extract product ID from each Mercari URL
  • Find products where shopHref contains that product ID
  • Example:
    // URL: https://jp.mercari.com/shops/product/eWhuJVL47JakTTodgTSb34
    // Match product where shopHref contains "eWhuJVL47JakTTodgTSb34"
  1. Extract product information:
  • brand - Brand name (lookup full name from src/data/brands.mjs)
  • name - Product name
  • seriesName - Series name (if exists)
  • shopPrice - Price for calculation
  1. Count quantities:
  • If same product appears multiple times in URL list, count as quantity > 1
  • Track quantity for each unique product

Handle Missing Products

If a Mercari URL cannot be matched:

  1. Report the issue:

    ⚠️ Could not find product for URL:
    https://jp.mercari.com/shops/product/xyz123
  2. Ask user:

  • “Would you like to continue without this product?”
  • “Or provide the product slug manually?”

Step 3: Calculate Totals

Price Calculation

  1. Calculate per-product subtotals:

    Product Price × Quantity = Subtotal
  2. Sum all subtotals:

    Subtotal 1 + Subtotal 2 + ... = Products Total
  3. Add shipping discount:

    Products Total + Shipping Discount = Final Total

Example Calculation

Product A: 2,680円 × 1 = 2,680円
Product B: 66,800円 × 2 = 133,600円
Products Total: 136,280円
Shipping Discount: -210円
Final Total: 136,070円

Step 4: Format Output

Output Template

Generate text in this exact format:

まとめ買いをしていただく時にこの商品を更新します。

## 明細

{Brand Name}: {Product Name} {Series Name} x{Quantity}
{Price}円 x{Quantity}

{Brand Name}: {Product Name} {Series Name} x{Quantity}
{Price}円 x{Quantity}

配送料分値引き
{Shipping Discount}円 x1

## 合計

{Final Total}円

Formatting Rules

  1. Product Lines:
  • Format: {Brand}: {Name} {SeriesName} x{Quantity}
  • If seriesName is empty, omit it
  • Include quantity even if it’s 1
  1. Price Lines:
  • Format: {Price}円 x{Quantity}
  • Add comma separators for thousands (e.g., 2,680円 not 2680円)
  • Always show quantity
  1. Shipping Discount:
  • Always show as negative number with minus sign
  • Format: -210円 x1
  • Always quantity of 1
  1. Final Total:
  • Add comma separators
  • Format: 136,070円

Complete Example

まとめ買いをしていただく時にこの商品を更新します。

## 明細

Takazudo Modular: zudo-rail-60 Lite-set1 x1
2,680円 x1

OXI Instruments: OXI Coral x2
66,800円 x2

配送料分値引き
-210円 x1

## 合計

136,070円

Step 5: Save File

File Path

Save to __inbox/_mercari-matome-{YYYYMMDD}.md

Where {YYYYMMDD} is today’s date:

  • Example: __inbox/_mercari-matome-20251225.md for December 25, 2025

After Saving

Inform the user:

✅ Bulk purchase text saved to:
__inbox/_mercari-matome-20251225.md

You can now copy this text to update the Mercari product listing.

Brand Name Lookup

When formatting product lines, use full brand names from src/data/brands.mjs:

How to Get Brand Name

  1. Read brands data:

    src/data/brands.mjs
  2. Find brand entry matching product’s brand field

  3. Use brand.name for display

Example Mappings

Product brand fieldDisplay name
takazudo-modularTakazudo Modular
oxi-instrumentsOXI Instruments
4ms4ms Company
addac-systemADDAC System

If brand not found in brands.mjs, use the product’s brand field as-is.

Error Handling

Missing Product Data

If shopPrice is missing from product:

  1. Report the issue:

    ⚠️ Product {slug} does not have shopPrice in master data
  2. Ask user for price:

    Please provide the price for this product:

Invalid URLs

If URL format is invalid:

  1. Show expected format:

    Expected format: https://jp.mercari.com/shops/product/{PRODUCT_ID}
  2. Ask user to correct or skip

Zero Products

If no valid products found:

  1. Report the issue:

    ⚠️ No valid products found from the provided URLs
  2. Cannot proceed - command should exit

Validation Checklist

Before saving the file, verify:

  • All product URLs matched to products in master data
  • All products have valid prices
  • Quantities calculated correctly
  • Shipping discount applied
  • Total calculated correctly
  • Brand names formatted correctly
  • Price formatting has comma separators
  • Output file name uses correct date format

Workflow Execution

When you invoke this command, Claude will:

  1. Ask for or parse arguments:
  • Mercari product URLs
  • Shipping discount amount
  1. Read product data:
  • src/data/product-master-data.mjs
  • src/data/brands.mjs
  1. Match and calculate:
  • Find products by URL
  • Count quantities
  • Calculate totals
  1. Format output:
  • Generate まとめ買い text
  • Apply proper formatting
  1. Save file:
  • Save to __inbox/_mercari-matome-YYYYMMDD.md
  • Confirm completion
  • /l-add-mercari-item - Create individual Mercari listings
  • /update:mercari-prices - Update prices from CSV

Your Task

When this command runs, provide:

  1. Mercari product URLs - One per line or comma-separated
  2. Shipping discount - Amount to deduct for bulk purchase

Claude will handle the rest!