jota-batuta/batuta-dots/worker-scaffold
Claude Code and agent skill by jota-batuta/batuta-dots
- community
Checking that the SKILL.md file is still in the repository.
Use when scaffolding workers: Temporal, Docker, Coolify deployment.
Install
npx vskill@latest install jota-batuta/batuta-dots/worker-scaffoldSKILL.md
The same SKILL.md was published earlier as jota-batuta/batuta-dots/worker-scaffold.
Worker Scaffold — Platform Specialist
Purpose
Scaffolding de workers hasta deploy en produccion, monitoring, y lifecycle management.
Regla: Si no puedes reconstruir tu infra desde cero en 30 minutos, no la entiendes.
When to Invoke
- Nuevo worker Temporal
- Deploy de servicio via Coolify
- Configuracion monitoring
- Docker optimization
Worker Lifecycle
1. Scaffold
Convenciones: tenant_id primero, retry explicita (3 attempts, backoff 2.0), timeouts explicitos, heartbeat >30s, claim-check >256KB, no asyncio.as_completed/set/random en workflow.
2. Temporal Config
- Task Queue:
{domain}-{function}-queue - Search Attributes: tenant_id, domain, solution_type (Keyword)
- Multi-tenant: max 5 activities/sec, max 50 concurrent
3. Dockerize
Python 3.12-slim, health check interval 30s, never include .env/secrets.
4. Deploy via Coolify
Git repo → Dockerfile → env vars → health check → resource limits → Tailscale/Cloudflare.
5. Monitor
Container restart → alert. Error rate >5% → alert. Temporal unhealthy → immediate.
6. n8n Triggers
Webhook/Cron/Email → n8n → signal/start Temporal workflow.
Infrastructure Topology
Output Files
scaffold-{domain}-{function}/(directorio completo)deploy-config-{nombre}-{fecha}.mdmonitoring-setup-{nombre}.md
Handoff
- sdd-design: Infrastructure section en design.md
- sdd-apply: Scaffold como primer paso de implementacion
- sdd-verify: Health check + monitoring como criterios
- llm-pipeline-design: Worker con capa LLM
Common Rationalizations
| Rationalization | Reality | |
|---|---|---|
| "No idempotency key needed — Temporal handles it" | Temporal handles workflow-level retry, but ACTIVITIES can still have side effects (sending emails, charging cards, calling external APIs). Without an idempotency key on the activity, a retry produces duplicate side effects. | |
| "Retries can be infinite — Temporal will eventually succeed" | Activities calling external services with permanent failures (404, validation errors) will retry forever, burning CPU and money. Configure maximum_attempts and use non-retryable error types for permanent failures. | |
| "We don't need claim-check for large payloads — Temporal can handle it" | Temporal events have a 2MB hard limit per event and 50MB per workflow history. Large payloads silently corrupt workflows. Always claim-check anything >256KB to S3/DB and pass the reference. |
Red Flags
- Activity with side effects (HTTP POST, email, DB write) without an idempotency key.
- Workflow uses
asyncio.as_completed,set()iteration,random, ordatetime.now()— non-deterministic, breaks replay. - No explicit
start_to_close_timeouton activities — defaults are usually wrong. - Heartbeat missing on activities >30 seconds — Temporal cannot detect stuck activities.
maximum_attempts=None(infinite retry) without circuit breaker for permanent failures.- Payload >256KB passed through workflow events instead of claim-check pattern.
- Worker container missing
/healthendpoint — Coolify cannot detect degraded workers. - Secrets baked into Docker image (
.envcopied) instead of injected at runtime. tenant_idnot the first argument of every activity — multi-tenant routing/observability broken.- Single Temporal task queue used for all domains — noisy neighbor problems at scale.
Verification Checklist
- [ ] Worker scaffold follows directory convention:
worker-{domain}-{function}/withsrc/workflows/,src/activities/,src/models/ - [ ]
tenant_idis the FIRST argument on every activity signature - [ ] Every activity has explicit
start_to_close_timeoutANDretry_policy(max_attempts, backoff) - [ ] Activities >30s emit heartbeats via
activity.heartbeat() - [ ] Payloads >256KB use claim-check pattern (S3/DB reference, not inline)
- [ ] Workflows are deterministic: no
asyncio.as_completed, norandom, nodatetime.now(), noset()iteration - [ ] Idempotency key passed into every side-effecting activity
- [ ] Permanent failures raised as non-retryable error types (Temporal does not retry these)
- [ ] Task queue named
{domain}-{function}-queue(one per worker domain) - [ ] Search attributes registered:
tenant_id,domain,solution_type(Keyword type) - [ ] Multi-tenant rate limits configured: max 5 activities/sec per tenant, max 50 concurrent
- [ ] Dockerfile uses
python:3.12-slim, has health check at 30s interval, NO.envfiles copied - [ ] Secrets injected via Coolify environment variables, never in image
- [ ] Container restart triggers an alert; error rate >5% triggers an alert
- [ ] Service deployed behind Tailscale or Cloudflare; Temporal :7233 reachable only via Tailscale
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingBatutaClaude/skills/worker-scaffold/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jota-batuta/batuta-dots/worker-scaffold)