apify-reference-architecture
Production-grade architecture patterns for Apify-powered applications. Use when designing scraping infrastructure, building multi-Actor pipelines, or integrating Apify into a larger system architecture.
Install / Use
npx skills add jeremylongshore/tons-of-skills-marketplace --skill apify-reference-architectureInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Our assessment of apify-reference-architecture
apify-reference-architecture scores 91/100 on our quality scale, 973rd of 3,055 Automation skills we index (top 32%).
Its SKILL.md is 5.9 KB long, well organised into 8 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.
With 2,785 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 8 days ago, so apify-reference-architecture is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-10-02. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
apify-reference-architecture compared with similar skills
All 4 of these similar skills score higher than apify-reference-architecture; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| apify-reference-architecture (this skill)by jeremylongshore | 91 | 2.8k | 8d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 88.1k | 17d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.3k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 73.7k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 85.2k | 1d ago | MCP Server |
Frequently asked questions
- How do I install apify-reference-architecture?
- Run
npx skills add jeremylongshore/tons-of-skills-marketplace --skill apify-reference-architecture. The install tabs above show the steps for each supported agent. - Which AI agents does apify-reference-architecture work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is apify-reference-architecture safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is apify-reference-architecture still maintained?
- The repository was last updated 8 days ago, so apify-reference-architecture is actively maintained.
Skill content
View source on GitHubname: apify-reference-architecture description: | Production-grade architecture patterns for Apify-powered applications. Use when designing scraping infrastructure, building multi-Actor pipelines, or integrating Apify into a larger system architecture. Trigger with "apify architecture", "apify best practices", "apify project structure", "scraping architecture", "apify system design". allowed-tools: Read, Grep version: 1.5.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
- saas
- scraping
- automation
- apify compatibility: Designed for Claude Code
Apify Reference Architecture
Overview
Production-ready architecture patterns for applications built on Apify. Three patterns scale from a single scraper to a full-stack integration:
- Standalone Actor — one scraper deployed to the Apify platform.
- Multi-Actor Pipeline — a discover → scrape → transform chain of Actors.
- Full-Stack Integration — an application using Apify as a data source behind a service layer.
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.
Prerequisites
- Runtime: Node.js
>=18, TypeScript, and the Apify CLI (npm i -g apify-cli). - Packages:
apify+crawlee(inside an Actor),apify-client(calling Actors from an app),zod(input validation). - Auth: an Apify API token. Set
APIFY_TOKENin the environment; the Apify SDK andapify-clientread it automatically (or pass it explicitly tonew ApifyClient({ token })). Never hardcode the token — inject it via env var and validate at startup. - Access:
ReadandGrepthe target repository so you can match the recommended layout against the code already on disk before proposing changes.
Instructions
- Pick the pattern. One scraper → Pattern 1. A staged workflow that discovers, scrapes, then cleans → Pattern 2. An app that consumes scraped data → Pattern 3.
Grepthe existing repo forapify,apify-client, andActor.mainto see what is already wired, so you extend rather than duplicate structure.- Lay out the directory from the pattern's tree in references/architecture-patterns.md. Keep routing, extraction, and validation in separate modules.
- Add typed input validation with
zod(seesrc/types.tsin the reference) so bad input fails fast at the Actor boundary instead of mid-crawl. - Isolate every Apify call behind a service layer (Pattern 3) using the
ApifyServiceclass in references/implementation.md — the rest of the app never importsapify-clientdirectly. - Load configuration once at startup via
loadConfig()and layer per-environment overrides on a single base object; validate required env vars before serving traffic. - Expose an Apify health check so a bad token or platform outage surfaces before a user-facing scrape fails.
Output
Applying this skill produces an architecture, not a running command. Expect:
- A recommended directory layout for the chosen pattern.
- Skeleton TypeScript modules (
main.ts,types.ts, service layer, config loader, health check). - A per-environment configuration strategy and an Apify health signal.
- For pipelines, an orchestrator that reports per-stage item counts and total USD cost, e.g.:
=== Pipeline Summary ===
Discovered: 320 URLs
Scraped: 298 items
Clean: 271 items
Total cost: $0.4120
Error Handling
| 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 |
Examples
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.
Resources
- references/architecture-patterns.md — full trees, diagrams, and code for all three patterns
- references/implementation.md — service layer, config loader, health check
- Apify Platform Architecture
- API Client Reference
- Actor Development Best Practices
Related Skills
Agent-Reach
88.1kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.3kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.7k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Scrapling
85.2k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
