---
updatedAt: 2026-10-15T14:06:23.000Z
agentTools:
  projectIndex: https://docs.pebblestream.com/llms.txt
---

# template-out-generate-clean

A **sheet-level flag** for output worksheets: before filling, Zen **deletes the template worksheet (if it exists) and recreates it blank**, so the generated output lands in a clean worksheet instead of being merged into the user's template.

`pebblestream:template-out-generate-clean`

Use it when the pebble generates the whole worksheet itself (a report built from
scratch) rather than writing into an existing template layout.

## Syntax

```
pebblestream:template-out-generate-clean
```

* No arguments.
* Placed on any cell of the output worksheet.
* Requires [`template-name`](template-name.md) on the same worksheet — the name
  still identifies which worksheet to (re)create and fill.

## Consequences

* Because the recreated worksheet has **no headers to locate**,
  [`template-out-header`](template-out-header.md) cannot be used on such a sheet
  — combining them fails with `template-out-clean-conflict`. Anchor every column
  with [`template-out-cell`](template-out-cell.md) instead.
* The template worksheet may be **missing** from the user's workbook entirely;
  the fill tolerates that and simply creates it.
* Since the worksheet starts blank, the stored styles from
  [`template-out-style`](template-out-style.md) are applied without first
  clearing existing formatting (there is none).

## Example

Output worksheet `Generated` that rebuilds the `Report` worksheet from scratch:

| column | header | comment                          |
| ------ | ------ | -------------------------------- |
| A      | `A1`   | `pebblestream:template-out-cell` |
| B      | `A2`   | `pebblestream:template-out-cell` |

plus, on any cell of the sheet:

```
pebblestream:template-name:Report
pebblestream:template-out-generate-clean
```

## Errors

| Error                                 | Cause                                      |
| ------------------------------------- | ------------------------------------------ |
| `dir-too-many-args`                   | Arguments were supplied.                   |
| `template-out-clean-conflict`         | The sheet also uses `template-out-header`. |
| `missing-the-template-name-directive` | The sheet has no `template-name`.          |

## Related

* [Template directives](template-directives.md) — the output fill flow
* [template-out-cell](template-out-cell.md) — the only anchor usable on a clean sheet
* [template-out-style](template-out-style.md) — styling the generated cells