Skip to main content
Use @pack.initialize to add company files and defaults to a newly scaffolded agent. It runs after Harnest prepares its scaffold and before company configuration validation.

Decorator contract

Add defaults and generated files

The following hook assumes pack declares a team option and a templates directory containing ci.yml:
Replace your pack’s existing initializer with this function; do not register both. Ensure its config_model matches the fields the initializer produces. Operations default to WritePolicy.IF_MISSING. They preserve values already provided by Harnest’s scaffold or an earlier pack. The planner still blocks overlapping ownership between different packs. See write policies.

Use the context

Reads see the current staged project. Operations returned by one hook execute in order after that hook returns; constructing an operation does not update later reads inside the same function.

Preview before creating

The first command leaves the target untouched. The second creates it using a fresh plan. Init requires an absent or empty directory; it never upgrades an existing agent. A failed hook, invalid company configuration, or ownership conflict blocks application. See plans and recovery for error handling and backups.