/apify-pack:apify-debug-bundlefrom apify-pack
Collects Apify debug evidence including run metadata, logs, dataset samples, and environment info for troubleshooting failed Actor runs and preparing support tickets.
Ships in apify-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Collect all diagnostic information needed to troubleshoot failed Actor runs and prepare Apify support tickets. Pulls run metadata, logs, dataset samples, and environment info into a single bundle.
apify-client installedAPIFY_TOKEN configuredimport { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
async function investigateRun(runId: string) {
// Get run details
const run = await client.run(runId).get();
console.log('=== Run Summary ===');
console.log(`Status: ${run.status}`);
console.log(`Message: ${run.statusMessage}`);
console.log(`Started: ${run.startedAt}`);
console.log(`Finished: ${run.finishedAt}`);
console.log(`Memory MB: ${run.options?.memoryMbytes}`);
console.log(`Timeout sec: ${run.options?.timeoutSecs}`);
console.log(`Build: ${run.buildNumber}`);
console.log(`Origin: ${run.meta?.origin}`);
console.log(`CU used: ${run.usage?.ACTOR_COMPUTE_UNITS?.toFixed(4)}`);
console.log(`Cost USD: $${run.usageTotalUsd?.toFixed(4)}`);
// Get dataset stats
if (run.defaultDatasetId) {
const ds = await client.dataset(run.defaultDatasetId).get();
console.log(`\nDataset items: ${ds.itemCount}`);
}
// Get run log (last 5000 chars)
const log = await client.run(runId).log().get();
console.log('\n=== Last 2000 chars of log ===');
console.log(log?.slice(-2000));
return { run, log };
}
#!/bin/bash
# apify-debug-bundle.sh <RUN_ID>
RUN_ID="${1:?Usage: apify-debug-bundle.sh <RUN_ID>}"
BUNDLE_DIR="apify-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
echo "Collecting debug info for run $RUN_ID..."
# Environment info
{
echo "=== Environment ==="
echo "Date: $(date -u)"
echo "Node: $(node --version 2>/dev/null || echo 'not found')"
echo "npm: $(npm --version 2>/dev/null || echo 'not found')"
echo ""
echo "=== Apify Packages ==="
npm list apify-client apify crawlee 2>/dev/null || echo "No packages found"
echo ""
echo "=== Apify CLI ==="
apify --version 2>/dev/null || echo "CLI not installed"
} > "$BUNDLE_DIR/environment.txt"
# Run details via API
curl -sf -H "Authorization: Bearer $APIFY_TOKEN" \
"https://api.apify.com/v2/actor-runs/$RUN_ID" | \
jq '.data | {id, actId, status, statusMessage, startedAt, finishedAt,
options: {memoryMbytes: .options.memoryMbytes, timeoutSecs: .options.timeoutSecs},
stats: .stats, usage: .usage, usageTotalUsd}' \
> "$BUNDLE_DIR/run-details.json" 2>/dev/null
# Run log (secrets auto-redacted by platform)
curl -sf -H "Authorization: Bearer $APIFY_TOKEN" \
"https://api.apify.com/v2/actor-runs/$RUN_ID/log" \
> "$BUNDLE_DIR/run-log.txt" 2>/dev/null
# Dataset sample (first 5 items)
DATASET_ID=$(jq -r '.defaultDatasetId // empty' "$BUNDLE_DIR/run-details.json" 2>/dev/null)
if [ -n "$DATASET_ID" ]; then
curl -sf -H "Authorization: Bearer $APIFY_TOKEN" \
"https://api.apify.com/v2/datasets/$DATASET_ID/items?limit=5" \
> "$BUNDLE_DIR/dataset-sample.json" 2>/dev/null
fi
# Key-value store keys
KV_ID=$(jq -r '.defaultKeyValueStoreId // empty' "$BUNDLE_DIR/run-details.json" 2>/dev/null)
if [ -n "$KV_ID" ]; then
curl -sf -H "Authorization: Bearer $APIFY_TOKEN" \
"https://api.apify.com/v2/key-value-stores/$KV_ID/keys" \
> "$BUNDLE_DIR/kv-store-keys.json" 2>/dev/null
fi
# Local config (redacted)
if [ -f .env ]; then
sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR/env-redacted.txt"
fi
# Platform health
curl -sf https://api.apify.com/v2/health > "$BUNDLE_DIR/platform-health.json" 2>/dev/null
# Package it up
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "Bundle created: $BUNDLE_DIR.tar.gz"
echo ""
echo "Attach this file to your Apify support ticket."
async function compareRuns(successId: string, failId: string) {
const success = await client.run(successId).get();
const fail = await client.run(failId).get();
console.log('=== Run Comparison ===');
const fields = [
'status', 'buildNumber', 'options.memoryMbytes',
'options.timeoutSecs', 'stats.requestsFinished',
'stats.requestsFailed', 'stats.runTimeSecs',
] as const;
console.log(`${'Field'.padEnd(25)} | ${'Success'.padEnd(15)} | Failed`);
console.log('-'.repeat(60));
const get = (obj: any, path: string) =>
path.split('.').reduce((o, k) => o?.[k], obj);
for (const field of fields) {
const sVal = get(success, field) ?? 'N/A';
const fVal = get(fail, field) ?? 'N/A';
const marker = sVal !== fVal ? ' <--' : '';
console.log(`${field.padEnd(25)} | ${String(sVal).padEnd(15)} | ${fVal}${marker}`);
}
}
# Stream logs from a running Actor
RUN_ID="your-run-id"
while true; do
curl -sf -H "Authorization: Bearer $APIFY_TOKEN" \
"https://api.apify.com/v2/actor-runs/$RUN_ID/log?stream=1" 2>/dev/null
sleep 2
done
Always redact before sharing:
apify_api_*)Safe to include:
| Issue | Cause | Solution |
|---|---|---|
Run not found | Invalid run ID or expired | Unnamed runs expire after 7 days |
Log unavailable | Run still in progress | Wait for completion or stream live |
| Empty dataset | Actor produced no output | Check failedRequestHandler in code |
| High CU usage | Memory too high or slow execution | Reduce memory, optimize code |
For rate limit issues, see apify-rate-limits.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/apify-ci-integrationConfigure CI/CD pipelines for Apify Actor builds and deployments.
Use when automating Actor deployment via GitHub Actions,
running integration tests against Apify, or building CI/CD for scrapers.
Trigger: "apify CI", "apify GitHub Actions", "apify automated deploy",
"CI apify", "apify pipeline", "auto deploy actor".
/apify-common-errorsDiagnose and fix common Apify Actor and API errors.
Use when encountering run failures, API errors, proxy issues,
or Actor crashes on the Apify platform.
Trigger: "apify error", "fix apify", "actor failed",
"apify not working", "debug apify", "apify 429".
/apify-core-workflow-aBuild a complete web scraping Actor with Crawlee and deploy to Apify.
Use when implementing end-to-end scraping: input schema, crawler,
data extraction, dataset output, and platform deployment.
Trigger: "apify scrape website", "build apify actor",
"crawlee scraper", "apify main workflow".
/apify-core-workflow-bManage Apify datasets, key-value stores, and request queues programmatically.
Use when reading/writing datasets, exporting data, managing Actor storage,
or orchestrating multi-Actor pipelines.
Trigger: "apify dataset", "apify key-value store", "apify storage",
"export apify data", "apify pipeline", "apify request queue".
/apify-cost-tuningOptimize Apify platform costs through memory tuning, compute unit management, and proxy budgeting.
Use when analyzing Apify billing, reducing Actor run costs,
or implementing usage monitoring and budget alerts.
Trigger: "apify cost", "apify billing", "reduce apify costs",
"apify pricing", "apify expensive", "apify budget", "compute units".
/apify-deploy-integrationDeploy Apify Actors and integrate scraping into external applications.
Use when deploying Actors to the platform, integrating Actor results
into web apps, or connecting Apify with external services.
Trigger: "deploy apify actor", "apify Vercel integration",
"apify production deploy", "integrate apify results", "apify API endpoint".
npx claudepluginhub flight505/skill-forge --plugin apify-packOther plugins' skills for the same job