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:
- Collect Information - Get product URLs and shipping discount
- Match Products - Find products in master data by Mercari URLs
- Calculate Totals - Sum prices and apply shipping discount
- Format Output - Generate formatted まとめ買い text
- 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
-
Read product master data:
src/data/product-master-data.mjs -
Match products by comparing:
- Extract product ID from each Mercari URL
- Find products where
shopHrefcontains that product ID - Example:
// URL: https://jp.mercari.com/shops/product/eWhuJVL47JakTTodgTSb34 // Match product where shopHref contains "eWhuJVL47JakTTodgTSb34"
- Extract product information:
brand- Brand name (lookup full name fromsrc/data/brands.mjs)name- Product nameseriesName- Series name (if exists)shopPrice- Price for calculation
- 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:
-
Report the issue:
⚠️ Could not find product for URL: https://jp.mercari.com/shops/product/xyz123 -
Ask user:
- “Would you like to continue without this product?”
- “Or provide the product slug manually?”
Step 3: Calculate Totals
Price Calculation
-
Calculate per-product subtotals:
Product Price × Quantity = Subtotal -
Sum all subtotals:
Subtotal 1 + Subtotal 2 + ... = Products Total -
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
- Product Lines:
- Format:
{Brand}: {Name} {SeriesName} x{Quantity} - If
seriesNameis empty, omit it - Include quantity even if it’s 1
- Price Lines:
- Format:
{Price}円 x{Quantity} - Add comma separators for thousands (e.g.,
2,680円not2680円) - Always show quantity
- Shipping Discount:
- Always show as negative number with minus sign
- Format:
-210円 x1 - Always quantity of 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.mdfor 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
-
Read brands data:
src/data/brands.mjs -
Find brand entry matching product’s
brandfield -
Use
brand.namefor display
Example Mappings
| Product brand field | Display name |
|---|---|
takazudo-modular | Takazudo Modular |
oxi-instruments | OXI Instruments |
4ms | 4ms Company |
addac-system | ADDAC 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:
-
Report the issue:
⚠️ Product {slug} does not have shopPrice in master data -
Ask user for price:
Please provide the price for this product:
Invalid URLs
If URL format is invalid:
-
Show expected format:
Expected format: https://jp.mercari.com/shops/product/{PRODUCT_ID} -
Ask user to correct or skip
Zero Products
If no valid products found:
-
Report the issue:
⚠️ No valid products found from the provided URLs -
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:
- Ask for or parse arguments:
- Mercari product URLs
- Shipping discount amount
- Read product data:
src/data/product-master-data.mjssrc/data/brands.mjs
- Match and calculate:
- Find products by URL
- Count quantities
- Calculate totals
- Format output:
- Generate まとめ買い text
- Apply proper formatting
- Save file:
- Save to
__inbox/_mercari-matome-YYYYMMDD.md - Confirm completion
Related Commands
/l-add-mercari-item- Create individual Mercari listings/update:mercari-prices- Update prices from CSV
Your Task
When this command runs, provide:
- Mercari product URLs - One per line or comma-separated
- Shipping discount - Amount to deduct for bulk purchase
Claude will handle the rest!