From kai
Strategies for handling bulk page operations (auditing, comparing, batch-editing) without bloating context. Teaches when to use summary tools, bulk-fetch script, or direct MCP calls based on the volume and nature of the task. Auto-activates when the user's request involves more than 3 pages or uses words like "all", "every", "across", "audit", "bulk", or "batch".
How this skill is triggered — by the user, by Claude, or both
Slash command
/kai:bulk-operationsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When working with many pages (widget pages or PDPs), avoid fetching full configs into context. Use the right tool for the volume.
When working with many pages (widget pages or PDPs), avoid fetching full configs into context. Use the right tool for the volume.
How many pages does this task touch?
│
├── 1-3 pages
│ └── Use MCP tools directly (get_widget_page_config, get_pdp_config)
│ Context cost: ~30KB per page — acceptable for small sets
│
├── 4-20 pages, need structure only
│ └── Use SUMMARY tools (get_widget_page_summary, get_pdp_summary)
│ Context cost: ~500 bytes per page
│ Covers: auditing widget types, comparing structures, finding pages with specific widgets
│
├── 4-20 pages, need full config data
│ └── Use bulk-fetch.sh → save to temp files → process with scripts
│ Context cost: ~200 bytes (manifest only)
│ The full configs live on disk, not in context
│
└── 20+ pages
└── Use bulk-fetch.sh with CONCURRENCY=5
Rate limit: 60 req/min sustained, so 20 pages takes ~4 seconds
For 100+ pages, increase timeout and consider batching
Summary tools return just the widget structure — IDs, types, titles, display order — without full widgetData.
# Widget page summary (~500 bytes vs ~30KB)
get_widget_page_summary(identifier: "home", brand: "mm")
# PDP summary (~500 bytes vs ~20KB)
get_pdp_summary(page_name: "minoxidil-5.json", brand: "mm")
Use summaries when you need to:
Use full configs when you need to:
The bulk-fetch.sh script fetches multiple configs in parallel via direct HTTP to the MCP endpoint. Responses go to temp files — they never enter context.
${CLAUDE_PLUGIN_ROOT}/scripts/bulk-fetch.sh
# Fetch widget page configs to temp files
bash ${CLAUDE_PLUGIN_ROOT}/scripts/bulk-fetch.sh \
get_widget_page_config \
temp/admin-bulk/{task-name}/ \
brand=mm \
-- home summer-sale category-hair monsoon-landing
# Fetch PDP configs
bash ${CLAUDE_PLUGIN_ROOT}/scripts/bulk-fetch.sh \
get_pdp_config \
temp/admin-bulk/{task-name}/ \
brand=mm \
-- minoxidil-5.json hair-oil.json biotin-tablets.json
# Fetch summaries (even lighter — use when you only need structure)
bash ${CLAUDE_PLUGIN_ROOT}/scripts/bulk-fetch.sh \
get_widget_page_summary \
temp/admin-bulk/{task-name}/ \
brand=mm \
-- home summer-sale category-hair
.mcp.json from the project root for URL + API keycurl (no MCP client needed)grep + sed + jq{output_dir}/{identifier}.json{identifier}.error filesCONCURRENCY=5 — Max parallel requests (default: 5, respects rate limits)MCP_CONFIG=/path/to/.mcp.json — Override config locationQUIET=1 — Suppress progress output{
"tool": "get_widget_page_config",
"output_dir": "temp/admin-bulk/audit/",
"total": 25,
"fetched": 24,
"failed": 1,
"files": ["temp/admin-bulk/audit/home.json", ...]
}
After bulk-fetching, write task-specific processing scripts to analyze the files. Only the results enter context.
for f in temp/admin-bulk/audit/*.json; do
id=$(basename "$f" .json)
has_hero=$(jq '[.config.widgetsData.widgetIDMapping | to_entries[] | select(.value.type == "BANNER")] | length' "$f" 2>/dev/null)
if [ "$has_hero" = "0" ]; then
echo "$id: NO BANNER widget"
fi
done
for f in temp/admin-bulk/audit/*.json; do
jq -r '[.config.widgetsData.widgetIDMapping | to_entries[].value.type] | unique[]' "$f" 2>/dev/null
done | sort | uniq -c | sort -rn
grep -rl "summer sale" temp/admin-bulk/audit/*.json | while read f; do
echo "$(basename "$f" .json): contains 'summer sale'"
done
For batch edits across multiple pages:
list_widget_pages(brand) or list_pdp_pages(brand) (small response)update_widget_page_section, update_pdp_section) only for the pages that need changes. These are targeted writes — one per page.This pattern keeps context lean: list (1KB) + manifest (200B) + analysis results (small) + targeted MCP writes (only for affected pages).
Temp files should be cleaned up after the task:
rm -rf temp/admin-bulk/{task-name}/
npx claudepluginhub mosaic-wellness/ai-toolkit --plugin kaiGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.