Skip to main content

canopy-agent-factory

Stamp out a new Claude Code agent from the canopy operating model — a persona, the turn orchestrator, reads-free / writes-gated guarding via a config-driven PreToolUse hook, and a canopy-web-ready layout. Extracted from the canopy distribution's src/orchestrator/agent_factory.py so a second consumer (canopy-web, a Django app) can scaffold an agent repo without inheriting canopy's video-tooling dependency footprint (Pillow, NumPy).

Zero runtime dependencies. Versions independently of canopy.

Public API

from canopy_agent_factory import AgentSpec, create_agent, normalize_slug, AgentFactoryError
from canopy_agent_factory import templates, gating_config  # canonical stamp-table baseline
  • AgentSpec — dataclass describing the agent to scaffold.
  • create_agent(spec, target_dir, *, force=False) -> list[Path] — writes the templated files into target_dir (caller-supplied; this function does no git init and no other I/O beyond writing the scaffold) and returns the paths it wrote.
  • normalize_slug(raw) -> str — validate + normalize an agent slug.
  • AgentFactoryError — raised for bad input or an unsafe target directory.
  • templates() -> Mapping[str, str] — the canonical stamp table (repo-relative path → rendered-template source), read-only. Ground truth for "what a factory-stamped agent looks like"; used by canopy's fleet-alignment lens to diff real agent repos against the baseline.
  • gating_config() -> str — the canonical config/gating.json body a stamped agent ships with.

Development

uv run --with pytest pytest -q

Runs standalone — no orchestrator import, no Django.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canopy_agent_factory-1.0.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canopy_agent_factory-1.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file canopy_agent_factory-1.0.0.tar.gz.

File metadata

  • Download URL: canopy_agent_factory-1.0.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for canopy_agent_factory-1.0.0.tar.gz
Algorithm Hash digest
SHA256 64d092a03da9359e77ea87e0e74e261fcfa8f3241263381fcf1705be1cfe2f4f
MD5 afcfd960d120898bd96331f266db830e
BLAKE2b-256 e8fd27f0e2bea84b45342b980bdbe404d9d114f678128f8a1c0fabbec139d840

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopy_agent_factory-1.0.0.tar.gz:

Publisher: release-agent-factory.yml on dimagi-internal/canopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canopy_agent_factory-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for canopy_agent_factory-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96473cecaff3f1dfd72428629b7ecbb630f295343b73a2f1b8ea130e16426b5e
MD5 1ac3a6feee223f6976803e8d49ed19bc
BLAKE2b-256 313dd4f479f03a7cea657f8bd1b5a539c22be4fde875a7d7f9952d8b4973d831

See more details on using hashes here.

Provenance

The following attestation bundles were made for canopy_agent_factory-1.0.0-py3-none-any.whl:

Publisher: release-agent-factory.yml on dimagi-internal/canopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page