scaffold-python-worker

scaffold-python-worker is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 33 tokens per session (529 once invoked), scanned A, original, MIT.

A starter project for a standalone Python 3.14 background worker, a service that processes events or scheduled jobs without serving a REST API. It includes a structured job entry point, processors, configuration, logging, and tests.

In plain words
What is it for?
Use it for workers triggered by Pub/Sub, Cloud Scheduler, or Google Cloud Storage events. It helps create job code, mocked unit tests, and shared-library database integration.
Why use it?
It removes the repetitive setup needed for event-driven or scheduled processing services. It also keeps database access, configuration, status reporting, and external calls organized.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it for workers triggered by Pub/Sub, Cloud Scheduler, or Google Cloud Storage events. It helps create job code, mocked unit tests, and shared-library database integration.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/scaffold-python-worker
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scaffold-python-worker

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-python-worker.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-python-worker)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-python-worker"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-python-worker.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00529
Opus 5 $0.00016 $0.00264
Sonnet 5 $0.00007 $0.00106
Haiku 4.5 $0.00003 $0.00053

Measured 3d ago against content hash fbef076e5410, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

scaffold-python-worker scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/scaffold-python-worker.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scaffold: Python Background Worker

Project name: $ARGUMENTS

Use for services triggered by Pub/Sub, Cloud Scheduler, or GCS events — not for HTTP REST APIs or AI agents.

Stack

  • Python 3.14 + uv workspaces
  • Shared service library editable install via [tool.uv.sources]
  • structlog for logging
  • pytest for tests

Steps

  1. Read existing files in the target directory before adding anything
  2. Initialize with uv: uv init $ARGUMENTS --python 3.14 under the appropriate services/ subdirectory
  3. Add [tool.uv.sources] with the shared service library as an editable install in pyproject.toml
  4. Create directory structure:
    • src/config.py — pydantic-settings config, env vars (required fields have NO defaults)
    • src/job.pyasync def run_job(payload: dict) -> JobResult: entry point
    • src/processors/ — domain-specific processing modules
    • src/main.py — Pub/Sub or Cloud Scheduler handler (parses trigger payload, calls run_job)
    • tests/test_job.py — unit tests with mocked external clients
  5. Output: write results to the database via the shared session factory — never connect directly
  6. Status reporting: write job status to the canonical status store on completion/failure

Critical Constraints

  • Never bypass the shared database session factory — use the shared library's get_session / AsyncSession pattern
  • Never use inline AI framework patterns (LangChain, LangGraph, etc.) in a worker service
  • All failures must be logged via structlog and surfaced as records — never swallowed silently
  • External API clients must be injected (not instantiated inline) to enable test mocking
  • Required env vars must have NO defaults in config — missing values must raise ValidationError at startup

Post-Scaffold

  • Add the new service to pyproject.toml workspace members at repo root
  • Verify uv sync at repo root resolves without error
  • Add deployment configuration for Cloud Run or equivalent compute target
  • Dispatch python-worker-reviewer after implementation is complete

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 45 lines · 33 tokens per session scan A fbef076e5410

Subscribe to this mod's changes

scaffold-python-worker is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 529 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.