- Rename commands/actor-development.md to commands/create-actor.md - Add apify-actor-commands plugin entry in marketplace.json - Register /create-actor as available command in Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
8.4 KiB
description, argument-hint
| description | argument-hint |
|---|---|
| Guided Apify Actor development with best practices and systematic workflow | Optional actor description |
Actor Development
You are helping a developer create an Apify Actor - a serverless cloud program for web scraping, automation, and data processing. Follow a systematic approach: understand requirements, configure environment, design architecture, implement, test, and deploy.
Core Principles
- Ask clarifying questions: Identify target websites, data requirements, edge cases, and constraints before implementation
- Follow Apify best practices: Use appropriate crawlers (Cheerio vs Playwright), implement proper error handling, respect rate limits
- Validate early: Check CLI installation and authentication before starting
- Use TodoWrite: Track all progress throughout
- Security first: Use
apify/logfor censoring sensitive data, validate input, handle errors gracefully
Phase 1: Discovery
Goal: Understand what actor needs to be built
Initial request: $ARGUMENTS
Actions:
- Create todo list with all phases
- Ask user for clarification if needed:
- What is the actor's primary purpose? (web scraping, automation, data processing)
- What websites/services will it interact with?
- What data should it extract or what actions should it perform?
- Any specific requirements or constraints?
- Summarize understanding and confirm with user
Phase 2: Environment Setup
Goal: Verify Apify CLI is installed and authenticated
CRITICAL: Do not proceed without proper setup
Actions:
- Check if Apify CLI is installed:
apify --help - If not installed, guide user to install:
curl -fsSL https://apify.com/install-cli.sh | bash # Or: brew install apify-cli (Mac) # Or: npm install -g apify-cli - Verify authentication:
apify info - If not logged in:
- Check for APIFY_TOKEN environment variable
- If missing, ask user to generate token at https://console.apify.com/settings/integrations
- Login with:
apify login -t $APIFY_TOKEN
Phase 3: Language Selection
Goal: Choose programming language and template
Actions:
- Ask user which language they prefer:
- JavaScript (skills/apify-actor-development/references/actor-template-js.md)
- TypeScript (skills/apify-actor-development/references/actor-template-ts.md)
- Python (skills/apify-actor-development/references/actor-template-python.md)
- Note: Additional packages (Crawlee, Playwright, etc.) can be installed later as needed
Phase 4: Requirements & Architecture Design
Goal: Define input/output schemas and implementation approach
Actions:
- Clarify detailed requirements:
- What input parameters should the actor accept?
- What output format is needed? (dataset items, key-value store files, both)
- Should it use CheerioCrawler (10x faster for static HTML) or PlaywrightCrawler (for JavaScript-heavy sites)?
- Concurrency settings? (HTTP: 10-50, Browser: 1-5)
- Rate limiting and retry strategies?
- Should standby mode be enabled?
- Design architecture:
- Input schema structure
- Output/dataset schema structure
- Key-value store schema (if needed)
- Error handling approach
- Data validation and cleaning strategy
- Present architecture to user and get approval
Phase 5: Actor Creation
Goal: Create actor from template and configure schemas
DO NOT START WITHOUT USER APPROVAL
Actions:
- Wait for explicit user approval
- Copy appropriate language template from
skills/apify-actor-development/references/directory - Update
.actor/actor.json:- Set actor name and version
- IMPORTANT: Fill in
generatedByproperty with current model name - Configure runtime, memory, timeout
- Set
usesStandbyModeif applicable
- Create/update
.actor/input_schema.jsonwith input parameters - Create/update
.actor/output_schema.jsonwith output structure - Create/update
.actor/dataset_schema.jsonif using datasets - Create/update
.actor/key_value_store_schema.jsonif using key-value store - Update todos as you progress
Reference documentation:
- skills/apify-actor-development/references/actor-json.md
- skills/apify-actor-development/references/input-schema.md
- skills/apify-actor-development/references/output-schema.md
- skills/apify-actor-development/references/dataset-schema.md
- skills/apify-actor-development/references/key-value-store-schema.md
Phase 6: Implementation
Goal: Implement actor logic following best practices
Actions:
- Implement actor code in
src/main.py,src/main.js, orsrc/main.ts - Follow best practices:
- ✓ Use Apify SDK (
apify) for code running on Apify platform - ✓ Validate input early with proper error handling
- ✓ Use CheerioCrawler for static HTML (10x faster)
- ✓ Use PlaywrightCrawler only for JavaScript-heavy sites
- ✓ Use router pattern for complex crawls
- ✓ Implement retry strategies with exponential backoff
- ✓ Use proper concurrency settings
- ✓ Clean and validate data before pushing to dataset
- ✓ Always use
apify/logpackage - censors sensitive data - ✓ Implement readiness probe handler if using standby mode
- ✗ Don't use browser crawlers when HTTP/Cheerio works
- ✗ Don't hard code values that should be in input schema
- ✗ Don't skip input validation or error handling
- ✗ Don't overload servers - use appropriate concurrency and delays
- ✓ Use Apify SDK (
- Implement standby mode readiness probe if
usesStandbyMode: true(see skills/apify-actor-development/references/standby-mode.md) - Use proper logging (see skills/apify-actor-development/references/logging.md)
- Update todos as you progress
Phase 7: Documentation
Goal: Create comprehensive README for marketplace
Actions:
- Create README.md with:
- Clear description of what the actor does
- Input parameters with examples
- Output format with examples
- Usage instructions
- Limitations and known issues
- Example runs
- Include code examples for common use cases
- Mention rate limits, costs, or legal considerations if applicable
Phase 8: Local Testing
Goal: Test actor locally before deployment
Actions:
- Install dependencies:
- JavaScript/TypeScript:
npm install - Python:
pip install -r requirements.txt
- JavaScript/TypeScript:
- Create test input file at
storage/key_value_stores/default/INPUT.jsonwith sample parameters - Run actor locally:
apify run - Verify:
- Input is parsed correctly
- Actor completes successfully
- Output is in expected format
- Error handling works
- Logging is appropriate
- Fix any issues found
- Test edge cases and error scenarios
Phase 9: Deployment
Goal: Deploy actor to Apify platform
DO NOT DEPLOY WITHOUT USER APPROVAL
Actions:
- Ask user if they want to deploy now
- If yes, deploy with:
apify push - Actor will be deployed with name from
.actor/actor.json - Provide user with:
- Deployment confirmation
- Actor URL on Apify platform
- Instructions for running on platform
Phase 10: Summary
Goal: Document what was accomplished
Actions:
- Mark all todos complete
- Summarize:
- What actor was built
- Key features and capabilities
- Input/output schemas
- Files created/modified
- Deployment status
- Suggested next steps (testing on platform, publishing to store, monitoring)
Additional Resources
MCP Tools (if configured):
search-apify-docs- Search documentationfetch-apify-docs- Get full doc pages
Documentation:
- docs.apify.com/llms.txt - Apify quick reference
- docs.apify.com/llms-full.txt - Apify complete docs
- crawlee.dev/llms.txt - Crawlee quick reference
- crawlee.dev/llms-full.txt - Crawlee complete docs
- whitepaper.actor - Complete Actor specification