> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt
> Use this file to discover all available pages before exploring further.

# v0.5.0-beta.19

> 2026-04-29

Beta.19 hot-fixes a regression in beta.18 that could overwrite a hand-authored `AGENTS.md` during `trellis update`.

## Bug Fixes

### `AGENTS.md` content no longer clobbered when TRELLIS markers are absent

Beta.18 introduced a `<!-- TRELLIS:START -->` / `<!-- TRELLIS:END -->` managed-block replacement for `AGENTS.md`. The fallback path — taken when the existing file does not contain the markers — returned the bare Trellis template, which silently replaced the user's content during `trellis update`.

| Pre-existing `AGENTS.md` state           | Beta.18 (regressed)                 | Beta.19                                                   |
| ---------------------------------------- | ----------------------------------- | --------------------------------------------------------- |
| Has `TRELLIS:START` / `TRELLIS:END`      | Replace block, keep outside content | Same (unchanged)                                          |
| No markers, hand-authored or pre-beta.18 | **Whole file overwritten**          | User content preserved; managed block appended at the end |
| File does not exist                      | Write fresh template                | Same (unchanged)                                          |

The fix lives in `buildAgentsMdTemplate` (`packages/cli/src/commands/update.ts`); the new fallback extracts the managed block from the canonical template via `getTrellisManagedBlock` and appends it after the existing content with a blank line separator. Recovery for projects that already lost content: `git checkout <pre-update-commit> -- AGENTS.md` and rerun `trellis update` on beta.19.

### Test coverage

Added `#4d preserves user AGENTS.md without TRELLIS markers by appending the managed block` in `packages/cli/test/commands/update.integration.test.ts`. The previous suite covered the legacy-pristine (`#4b`) and user-modified-managed-block (`#4c`) cases but missed the no-markers-at-all case where the regression was hiding.

## Upgrade

Existing projects:

```bash theme={null}
trellis update
```

No `--migrate` flag is required for this beta.
