apify-actorization – skill DevOps & Hạ tầng cho agent AI
Actorization chuyển phần mềm có sẵn thành ứng dụng serverless có thể tái sử dụng, tương thích với nền tảng Apify. Actor là chương trình được đóng gói dưới dạng Docker image, nhận input JSON xác định rõ, thực hiện một hành động và tùy chọn tạo output JSON có cấu trúc.
Cài skill apify-actorization bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/apify-actorization-a3aec.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /apify-actorization – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/apify-actorization-a3aec.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $apify-actorization – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/apify-actorization-a3aec.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /apify-actorization – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/apify-actorization-a3aec.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /apify-actorization – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Apify Actorization
Actorization converts existing software into reusable serverless applications compatible with the Apify platform. Actors are programs packaged as Docker images that accept well-defined JSON input, perform an action, and optionally produce structured JSON output.
Before initialization/install/deploy, inspect existing files and preserve their state. Confirm target account/Actor, source license, uploaded files/secrets, network targets and spending/charging limits. Authorizing local conversion does not authorize cloud upload, Store publication or monetization. Pin reviewed SDK/CLI/base images and verify schemas against that version.
Quick Start
1. Run apify init in project root
2. Wrap code with SDK lifecycle (see language-specific section below)
3. Configure .actor/input_schema.json
4. Test with apify run --input '{"key": "value"}'
5. Deploy with apify push
When to Use This Skill
- Converting an existing project to run on Apify platform
- Adding Apify SDK integration to a project
- Wrapping a CLI tool or script as an Actor
- Migrating a Crawlee project to Apify
Prerequisites
Verify apify CLI is installed:
apify --helpIf not installed:
brew install apify-cli
# Or: npm install -g apify-cli
# Or install from an official release package that your OS package manager verifiesVerify CLI is logged in:
apify info # Should return your usernameIf not logged in, check if APIFY_TOKEN environment variable is defined. If not, ask the user to generate one at https://console.apify.com/settings/integrations, add it to their shell or secret manager without putting the literal token in command history, then run:
apify loginActorization Checklist
Copy this checklist to track progress:
- [ ] Step 1: Analyze project (language, entry point, inputs, outputs)
- [ ] Step 2: Run
apify initto create Actor structure - [ ] Step 3: Apply language-specific SDK integration
- [ ] Step 4: Configure
.actor/input_schema.json - [ ] Step 5: Configure
.actor/output_schema.json(if applicable) - [ ] Step 6: Update
.actor/actor.jsonmetadata - [ ] Step 7: Test locally with
apify run - [ ] Step 8: Deploy with
apify push
Step 1: Analyze the Project
Before making changes, understand the project:
1. Identify the language - JavaScript/TypeScript, Python, or other
2. Find the entry point - The main file that starts execution
3. Identify inputs - Command-line arguments, environment variables, config files
4. Identify outputs - Files, console output, API responses
5. Check for state - Does it need to persist data between runs?
Step 2: Initialize Actor Structure
Run in the project root:
apify initThis creates:
.actor/actor.json- Actor configuration and metadata.actor/input_schema.json- Input definition for the Apify ConsoleDockerfile(if not present) - Container image definition
Step 3: Apply Language-Specific Changes
Choose based on your project's language:
- JavaScript/TypeScript: See [js-ts-actorization.md](references/js-ts-actorization.md)
- Python: See [python-actorization.md](references/python-actorization.md)
- Other Languages (CLI-based): See [cli-actorization.md](references/cli-actorization.md)
Quick Reference
| Language | Install | Wrap Code |
|----------|---------|-----------|
| JS/TS | npm install apify | await Actor.init() ... await Actor.exit() |
| Python | pip install apify | async with Actor: |
| Other | Use CLI in wrapper script | apify actor:get-input / apify actor:push-data |
Steps 4-6: Configure Schemas
See [schemas-and-output.md](references/schemas-and-output.md) for detailed configuration of:
- Input schema (
.actor/input_schema.json) - Output schema (
.actor/output_schema.json) - Actor configuration (
.actor/actor.json) - State management (request queues, key-value stores)
Validate schemas against @apify/json_schemas npm package.
Step 7: Test Locally
Run the actor with inline input (for JS/TS and Python actors):
apify run --input '{"startUrl": "https://example.com", "maxItems": 10}'Or use an input file:
apify run --input-file ./test-input.jsonUse the documented local CLI flow for the selected language; inspect storage purge defaults and preserve unrelated local data. Direct SDK/test execution may also be appropriate. Local execution can still make network requests or use cloud storage when configured; use synthetic fixtures and a test account.
Step 8: Deploy
apify pushThis uploads and builds your actor on the Apify platform.
Monetization (Optional)
After deploying, you can monetize your actor in the Apify Store. The recommended model is Pay Per Event (PPE):
- Per result/item scraped
- Per page processed
- Per API call made
Configure PPE in the Apify Console under Actor > Monetization. Charge for events in your code with await Actor.charge('result').
Other options: other currently supported Store models or free execution. A free Actor is not automatically open-source; license and source availability are separate.
Pre-Deployment Checklist
- [ ]
.actor/actor.jsonexists with correct name and description - [ ]
.actor/actor.jsonvalidates against@apify/json_schemas(actor.schema.json) - [ ]
.actor/input_schema.jsondefines all required inputs - [ ]
.actor/input_schema.jsonvalidates against@apify/json_schemas(input.schema.json) - [ ]
.actor/output_schema.jsondefines output structure (if applicable) - [ ]
.actor/output_schema.jsonvalidates against@apify/json_schemas(output.schema.json) - [ ]
Dockerfileis present and builds successfully - [ ]
Actor.init()/Actor.exit()wraps main code (JS/TS) - [ ]
async with Actor:wraps main code (Python) - [ ] Inputs are read via
Actor.getInput()/Actor.get_input() - [ ] Outputs use
Actor.pushData()or key-value store - [ ]
apify runexecutes successfully with test input - [ ]
generatedByis set in actor.json meta section
Apify MCP Tools
If MCP server is configured, use these tools for documentation:
search-apify-docs- Search documentationfetch-apify-docs- Get full doc pages
Otherwise, the MCP Server url: https://mcp.apify.com/?tools=docs.
Resources
- [Actorization Academy](https://docs.apify.com/academy/actorization) - Comprehensive guide
- [Apify SDK for JavaScript](https://docs.apify.com/sdk/js) - Full SDK reference
- [Apify SDK for Python](https://docs.apify.com/sdk/python) - Full SDK reference
- [Apify CLI Reference](https://docs.apify.com/cli) - CLI commands
- [Actor Specification](https://raw.githubusercontent.com/apify/actor-whitepaper/refs/heads/master/README.md) - Complete specification
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- appdeploy – Triển khai ứng dụng web có API backend, cơ sở dữ liệu và lưu trữ tệp. Dùng khi người…
- render-deploy – Triển khai ứng dụng lên Render bằng cách phân tích codebase, tạo Blueprint render.yaml…
- docker-management – Quản lý container, image, volume và Compose trong Docker.
- apple-container – Xây dựng, chạy và quản lý container OCI/Linux dưới dạng máy ảo nhẹ riêng cho từng…
- hunt-firebase – Săn khai thác Firebase / Firestore / GCP — phát hiện API key Firebase trong bundle JS…
- argocd-gitops – Triển khai GitOps với ArgoCD cho việc triển khai Kubernetes theo kiểu khai báo.
- arm-templates – Triển khai tài nguyên Azure bằng ARM template và Bicep. Tạo triển khai theo module và…
- asset-inventory – Duy trì kho tài sản CNTT và cơ sở dữ liệu quản lý cấu hình (CMDB). Theo dõi phần cứng…