/apify-pack:apify-reference-architecturefrom apify-pack
Production-grade architecture patterns for Apify-powered applications. Helps design scraping infrastructure, multi-Actor pipelines, and system integrations.
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.
Read when SKILL.md points to them.
Production-ready architecture patterns for applications built on Apify. Three patterns scale from a single scraper to a full-stack integration:
This skill helps you choose the right pattern, lay out the directory structure, and wire the skeleton code. Full directory trees, diagrams, and code for every pattern live in references/architecture-patterns.md; the service layer, configuration loader, and health check live in references/implementation.md.
>=18, TypeScript, and the Apify CLI (npm i -g apify-cli).apify + crawlee (inside an Actor), apify-client (calling Actors from an app), zod (input validation).APIFY_TOKEN in the environment; the Apify SDK and
apify-client read it automatically (or pass it explicitly to new ApifyClient({ token })).
Never hardcode the token — inject it via env var and validate at startup.Read and Grep the target repository so you can match the recommended
layout against the code already on disk before proposing changes.Grep the existing repo for apify, apify-client, and Actor.main to see what
is already wired, so you extend rather than duplicate structure.zod (see src/types.ts in the reference) so bad
input fails fast at the Actor boundary instead of mid-crawl.ApifyService
class in references/implementation.md — the rest of the
app never imports apify-client directly.loadConfig() and layer per-environment
overrides on a single base object; validate required env vars before serving traffic.Applying this skill produces an architecture, not a running command. Expect:
main.ts, types.ts, service layer, config loader, health check).=== Pipeline Summary ===
Discovered: 320 URLs
Scraped: 298 items
Clean: 271 items
Total cost: $0.4120
| Issue | Cause | Solution |
|---|---|---|
| Circular dependencies | Service imports service | Use dependency injection |
| Missing config | Env var not set | Validate at startup with loadConfig() |
| Pipeline stage failure | Actor crash mid-pipeline | Add retry logic per stage |
| State management | Tracking run status | Use webhook handler + database |
Run not ready error | Fetching results before SUCCEEDED | Poll getRunStatus or use a completion webhook |
Standalone Actor entry point — the minimal skeleton; full file in references/architecture-patterns.md:
// src/main.ts
import { Actor } from 'apify';
import { CheerioCrawler } from 'crawlee';
import { router } from './routes/listing';
import { validateInput, ScraperInput } from './types';
await Actor.main(async () => {
const input = validateInput(await Actor.getInput<ScraperInput>());
const crawler = new CheerioCrawler({
requestHandler: router,
maxRequestsPerCrawl: input.maxItems ?? 100,
maxConcurrency: input.concurrency ?? 10,
});
await crawler.run(input.startUrls.map(s => s.url));
});
Calling an Actor from an app — via the service layer:
const apify = new ApifyService(process.env.APIFY_TOKEN!);
const { runId } = await apify.startScrape(['https://example.com']);
const results = await apify.getResults<ProductOutput>(runId);
More: the multi-stage pipeline orchestrator and the full ApifyService class are in
references/architecture-patterns.md and
references/implementation.md. For multi-environment
setup, see the companion apify-deploy-integration skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
apify, reference-architecture, scraping, pipeline, architecture-patterns
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 the live Apify API, or building CI/CD for
scrapers that push to the Apify platform.
Trigger with "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 an Apify run fails, an API call returns 401/403/404/413/429,
a proxy connection drops, an Actor build breaks, or a scrape hits an
anti-bot block, and you need the cause plus a copy-paste fix.
Trigger with "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 you need end-to-end web scraping on Apify: defining an input schema, building a router-based Crawlee crawler, extracting structured data, storing results in a dataset, testing locally, and deploying the Actor to the platform.
Trigger with "apify scrape website", "build apify actor", "crawlee scraper", "apify main workflow".
/apify-core-workflow-bManage Apify datasets, key-value stores, and request queues programmatically,
and orchestrate multi-Actor pipelines.
Use when you need to read or write Apify datasets, export scraped data to
CSV/JSON/XLSX, store config or binary artifacts in a key-value store, manage a
resumable request queue, chain Actors into a scrape → transform → export
pipeline, or monitor Actor run status and cost.
Trigger with "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 with "apify cost", "apify billing", "reduce apify costs", "apify pricing", "apify expensive", "apify budget", "compute units"./apify-debug-bundleCollect Apify debug evidence for support tickets and troubleshooting.
Use when an Actor run has failed, is stuck, or produced empty output and
you need to gather run metadata, logs, dataset samples, and environment
info before opening a support ticket.
Trigger with "apify debug", "apify support bundle", "collect apify logs",
"apify diagnostic", "apify run failed why".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin apify-packOther plugins' skills for the same job