apify-actor-development
它能做什么
这个助手可以帮你在 Apify 平台上创建和管理 “Actor”。Actor 是一些小程序,专门执行某项特定任务,比如从网页上收集数据。
适用场景
- ✓当你想创建一个新程序来收集数据时。
- ✓当你需要调整现有程序时。
- ✓当你想建立与 Apify 平台的安全连接时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/apify-actor-development/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想创建一个新的 Python Actor,用来收集某个网站上的信息。”
每周 5 个新技能,1 分钟读完。
工作原理
它会一步步指导你安装必要的工具,为你的程序选择合适的起始模板,并配置相关技术细节,确保它能在 Apify 平台上正常运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Apify Actor Development
Important: Before you begin, fill in the generatedBy property in the meta section of .actor/actor.json. Replace it with the tool and model you're currently using, such as "Claude Code with Claude Sonnet 4.5". This helps Apify monitor and improve AGENTS.md for specific AI tools and models.
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
apifyCLI authentication, project bootstrap, or deployment workflow.
What are Apify Actors?
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 createcommand based on user's language preference (see Template Selection above) - Install dependencies (verify package names match intended packages before installing)
- 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)
- JavaScript/TypeScript:
- Implement logic - Write the actor code in
src/main.py,src/main.js, orsrc/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.jsonwith actor metadata (see references/actor-json.md) - Write documentation - Create comprehensive README.md for the marketplace
- Test locally - Run
apify runto verify functionality (see Local Testing section below) - Deploy - Run
apify pushto deploy the actor on the Apify platform (actor name is defined in.actor/actor.json)
Security
…
常见问题
什么是 “Actor”?
Actor 就像你可以在 Apify 上创建的小型机器人或程序,用来执行自动化任务,比如从网站上抓取数据。
我需要很懂编程吗?
助手会帮你完成前期准备和设置,但具体要执行的任务,还需要你自己编写相应的代码。
使用起来安全吗?
是的。Apify 提供了一个安全的运行环境,助手也会指导你遵循安全最佳实践,比如不要把密码直接暴露在代码里。
详情
作者的原始描述
Important: Before you begin, fill in the generatedBy property in the meta section of .actor/actor.json. Replace it with the tool and model you're currently using, such as \"Claude Code with Claude Sonnet 4.5\". This helps Apify monitor and improve AGENTS.md for specific AI tools and models.
热度
- GitHub 星标
- 48k
- 排名
- #3783
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。