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 intotarget_dir(caller-supplied; this function does nogit initand 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 canonicalconfig/gating.jsonbody 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64d092a03da9359e77ea87e0e74e261fcfa8f3241263381fcf1705be1cfe2f4f
|
|
| MD5 |
afcfd960d120898bd96331f266db830e
|
|
| BLAKE2b-256 |
e8fd27f0e2bea84b45342b980bdbe404d9d114f678128f8a1c0fabbec139d840
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canopy_agent_factory-1.0.0.tar.gz -
Subject digest:
64d092a03da9359e77ea87e0e74e261fcfa8f3241263381fcf1705be1cfe2f4f - Sigstore transparency entry: 2813837766
- Sigstore integration time:
-
Permalink:
dimagi-internal/canopy@76943c908a9231fe7499961b37892bf190398647 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dimagi-internal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-agent-factory.yml@76943c908a9231fe7499961b37892bf190398647 -
Trigger Event:
push
-
Statement type:
File details
Details for the file canopy_agent_factory-1.0.0-py3-none-any.whl.
File metadata
- Download URL: canopy_agent_factory-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96473cecaff3f1dfd72428629b7ecbb630f295343b73a2f1b8ea130e16426b5e
|
|
| MD5 |
1ac3a6feee223f6976803e8d49ed19bc
|
|
| BLAKE2b-256 |
313dd4f479f03a7cea657f8bd1b5a539c22be4fde875a7d7f9952d8b4973d831
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canopy_agent_factory-1.0.0-py3-none-any.whl -
Subject digest:
96473cecaff3f1dfd72428629b7ecbb630f295343b73a2f1b8ea130e16426b5e - Sigstore transparency entry: 2813837783
- Sigstore integration time:
-
Permalink:
dimagi-internal/canopy@76943c908a9231fe7499961b37892bf190398647 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dimagi-internal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-agent-factory.yml@76943c908a9231fe7499961b37892bf190398647 -
Trigger Event:
push
-
Statement type: