Amazon CSV Export
Mission
Produce validated list.csv, details.csv, and reviews.csv artifacts from existing stage data while preserving search rank, ASIN identity, coverage status, and extra template fields.
When to use
Use this Skill after collection stages or for re-export of an existing run. Require stage-result files or their referenced raw JSON rows.
Hard constraints
- Announce
amazon-csv-exportbefore writing files. - Create no cloud task and call none of
execute_task,get_task_status, orstart_or_stop_task. - Accept only version
1.0stage contracts with explicit statuses, row paths, warnings, and errors. - Write RFC 4180 CSV using UTF-8 with BOM.
- Place fixed core fields first and append extra source fields in stable lexical order.
- Preserve embedded commas, quotes, Unicode text, and newlines through CSV quoting.
- Derive status and counts from stage data, not prose.
- Write no API key, MCP session ID, or signed export URL secret.
Core workflow
- Load
stage-list.json,stage-details.json, andstage-reviews.jsonwhen available. - Validate contract version, stage name, status, raw path, counts, and task identities.
- Load every referenced raw JSON array.
- Normalize metadata keys to
search_rank,keyword,site,collection_status, anderrorwhile preserving source fields. - Use the fixed field sets in
../../contracts/csv-fields.json; append unknown fields lexically. - Write filenames
amazon_<SITE>_<KEYWORD>_<UTCSTAMP>_list.csv,_details.csv, and_reviews.csvinside the run directory. - Re-open each file as UTF-8-BOM CSV, verify header width and row width, and reconcile row counts.
- Save
stage-export.json; updaterun-state.jsontoCSV_READYonly after successful verification.
Output format
{
"contract_version": "1.0",
"stage": "export",
"status": "CSV_READY|PARTIAL|FAILED",
"files": {"list": "...csv", "details": "...csv", "reviews": "...csv"},
"row_counts": {"list": 30, "details": 30, "reviews": 3000},
"encoding": "utf-8-sig",
"warnings": [],
"errors": []
}
Done criteria
- Every available valid stage produced its corresponding CSV.
- Each CSV begins with the UTF-8 BOM and passes a read-back width check.
- Core fields appear in contract order and extra fields are preserved.
- Row counts match loaded raw arrays.
- No collection task was created or changed.
stage-export.jsontruthfully records files, counts, warnings, and errors.
Scan to join WeChat group