简介
在 Apify 平台上开发、调试和部署高性能无服务器 Actor,用于爬取、数据处理和自动化。
原始描述
Develops, debugs, and deploys high-performance serverless actors for web scraping, data processing, and automation on the Apify platform.
通过你的 Agent 添加
安装目录:apify-actor-development/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: apify-actor-development
description: Create, modify and validate Apify Actors with scoped inputs, storage schemas, runtime logic and deployment review.
category: Document Processing
source: antigravity
tags: [python, javascript, typescript, node, api, mcp, ai, llm, automation, workflow]
url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/apify-actor-development
Apify Actor Development
Execution and data scope
Execution and data scope
This is documentation, not a ready Actor. Use reviewed pinned CLI/SDK/templates and inspect lifecycle/install scripts; package managers do not guarantee safety. Reuse the existing language/lockfile rather than repeatedly asking. Use npm ci for an unchanged lockfile; exact Python versions alone do not pin all artifacts. Local Actors can access the network/cloud through configured clients, so inspect storage settings and credentials before testing; the default local storage is not a guarantee of no upload. Bound crawl origins, redirects, private-network access, page counts, concurrency, retries and cloud/proxy costs. Push/build/run/standby activation publishes code or starts paid work and requires the authorized account/Actor and rollback plan. Redact logs explicitly.
Generation attribution is optional task metadata, not an instruction to modify unrelated files or guess the model. Preserve existing metadata/history and share it only as authorized.
When to Use
- You need to create, modify, or debug an Apify Actor project.
- The task involves choosing an Apify template, wiring actor inputs/outputs, or implementing actor runtime logic.
- You need safe setup guidance for
apify CLI authentication, project bootstrap, or deployment workflow.
What are Apify Actors?
apify CLI authentication, project bootstrap, or deployment workflow.Actors are serverless programs inspired by the UNIX philosophy - programs that do one thing well and can be easily combined to build complex systems. They're packaged as Docker images and run in isolated containers in the cloud.
Core Concepts:
- Accept well-defined JSON input
- Perform isolated tasks (web scraping, automation, data processing)
- Produce structured JSON output to datasets and/or store data in key-value stores
- Can run from seconds to hours or even indefinitely
- Persist state and can be restarted
Prerequisites & Setup (MANDATORY)
Before creating or modifying actors, verify that apify CLI is installed apify --help.
If it is not installed, use one of these methods (listed in order of preference):
# Preferred: install via a package manager (provides integrity checks)
npm install -g apify-cli
# Or (Mac): brew install apify-cli
Security note: Do NOT install the CLI by piping remote scripts directly into a shell. Always use a package manager.
When the apify CLI is installed, check that it is logged in with:
apify info # Should return your username
If it is not logged in, check if the APIFY_TOKEN environment variable is defined (if not, ask the user to generate one on https://console.apify.com/settings/integrations and then define APIFY_TOKEN with it).
Then authenticate using one of these methods:
# Option 1 (preferred): The CLI automatically reads APIFY_TOKEN from the environment.
# Just ensure the env var is exported and run any apify command — no explicit login needed.
# Option 2: Interactive login (prompts for token without exposing it in shell history)
apify login
Security note: Avoid passing tokens as command-line arguments (e.g.
apify login -t <token>). Arguments are visible in process listings and may be recorded in shell history. Prefer environment variables or interactive login instead. Never log, print, or embedAPIFY_TOKENin source code or configuration files. Use a token with the minimum required permissions (scoped token) and rotate it periodically.
Template Selection
IMPORTANT: Before starting actor development, always ask the user which programming language they prefer:
- JavaScript - Use
apify create <actor-name> -t project_empty - TypeScript - Use
apify create <actor-name> -t ts_empty - Python - Use
apify create <actor-name> -t python-empty
Use the appropriate CLI command based on the user's language choice. Additional packages (Crawlee, Playwright, etc.) can be installed later as needed.
Quick Start Workflow
- Create actor project - Run the appropriate
apify create command based on user's language preference (see Template Selection above)
- Install dependencies (verify package names match intended packages before installing)
- JavaScript/TypeScript:
npm install (uses package-lock.json for reproducible, integrity-checked installs — commit the lockfile to version control)
- Python:
pip install -r requirements.txt (pin exact versions in requirements.txt, e.g. crawlee==1.2.3, and commit the file to version control)
- Implement logic - Write the actor code in
src/main.py, src/main.js, or src/main.ts
- Configure schemas - Update input/output schemas in
.actor/input_schema.json, .actor/output_schema.json, .actor/dataset_schema.json
- Configure platform settings - Update
.actor/actor.json with actor metadata (see references/actor-json.md)
- Write documentation - Create comprehensive README.md for the marketplace
- Test locally - Run
apify run to ver
apify create command based on user's language preference (see Template Selection above)- JavaScript/TypeScript:
npm install(usespackage-lock.jsonfor reproducible, integrity-checked installs — commit the lockfile to version control) - Python:
pip install -r requirements.txt(pin exact versions inrequirements.txt, e.g.crawlee==1.2.3, and commit the file to version control)
src/main.py, src/main.js, or src/main.ts.actor/input_schema.json, .actor/output_schema.json, .actor/dataset_schema.json.actor/actor.json with actor metadata (see references/actor-json.md)apify run to ver原始仓库
作者的项目地址:https://github.com/Kench001/antigravity-awesome-skills