--- name: kachator description: Portable MSDL2 skill for resumable offline website archives on Windows and Linux. --- # Kachator / MSDL2 Read https://work.mathchast.com/docs/kachator-instrukciya-dlya-ai.html before starting. This skill is for one visible, resumable archive channel per resource. ## Contract 1. Give every site a unique resource ID and a separate archive root. 2. Keep one foreground capture session visible. Never use a detached or silent process. 3. Before a new site, run homepage smoke, same-host sitemap discovery, route comparison, and a bounded pilot. 4. Choose the fastest route that preserves meaningful HTML and required assets. Start with one page worker. 5. Capture in batches of 100 pages and checkpoint at least every 5 pages. 6. Do not overwrite the manifest or delete saved pages. Resume the existing root. 7. After every batch run the offline media audit. Do not report offline readiness while external or missing image references remain. 8. Pause at the batch boundary and wait for the explicit continuation command. ## Archive files / pages-0001/ assets/ reports/manifest.jsonl reports/assets.jsonl reports/msdl2-status.json reports/msdl2-events.jsonl reports/msdl2-run.log reports/offline-media-audit.json reports/site-profile.json Required status values are STARTING, RUNNING, PAUSED, STOPPED, ERROR, ASSET_INCOMPLETE, and COMPLETED. COMPLETED is allowed only when pending=0, no retryable errors remain, the final manifest exists, and the final event is recorded. ## Linux start python3 -m venv .venv source .venv/bin/activate python -m pip install requests beautifulsoup4 python -X utf8 ~/.codex/skills/msdl-site-crawl/scripts/full_site_capture.py /data/archives/RS-XX-NAME/2026-09-25 --workers 1 --batch-size 100 --timeout 30 --checkpoint-every 5 Use the same command and the same root to resume. Never run two writers against one root. ## Windows start & "$env:USERPROFILE\\.codex\\skills\\msdl-site-crawl\\scripts\\full_site_capture.py" "H:\\Mathcast-archives\\RS-XX-NAME\\2026-09-25" --workers 1 --batch-size 100 --timeout 30 --checkpoint-every 5 ## Audit python3 tools/msdl_offline_media_audit.py /data/archives/RS-XX-NAME/2026-09-25 PASS requires external_image_references_remaining=0, missing_local_image_references=0, and offline_images_ready=true. For a CDN 403/429 or blocked image, record the URL and reason in reports/asset-locality-repair.json, set ASSET_INCOMPLETE, and repair before the next production batch. ## Handoff 1. Finish the current page and checkpoint. 2. Set the resource to PAUSED; clear PID/session only after the process exits. 3. Copy the complete archive root, including pages-*, assets, and reports. 4. Validate JSON and counters on the receiving machine. 5. Continue with the same command and root. Parallel work is allowed only when resource IDs and archive roots are different. ## Report Always report resource ID/title, URL, archive root, PID/session or not running, mode, batch size, saved, pending, errors, total, saved assets, audit state, and the next action. Do not say running without a live process and fresh heartbeat.