# `presets/` — Stack / Business / Theme presets

Presets are the menu that `_init.ps1` consumes. Each preset folder declares a `preset.json` manifest (validated against [`preset.schema.json`](preset.schema.json)) and describes what gets materialized into the spawned project when listed in `project.config.json#extends`.

```
presets/
├── project.config.schema.json    JSON Schema for project.config.json
├── preset.schema.json            JSON Schema for individual preset manifests
├── stacks/                       angular / nextjs / nestjs / dotnet -enterprise
├── business/                     portal-platform (full) + crm / ecommerce / pdpa / saas (stubs)
└── themes/                       premium-theme (full + tokens) + fintech / enterprise / glass (stubs)
```

## Resolution order

The `extends` array is order-sensitive. Conflict resolution: **last preset wins** on overwrite, but `merge: skip` and `merge: merge-json` modes are honored per `materialize` entry.

Recommended order:

1. Stack (`*-enterprise`)
2. Business (`*-platform`)
3. Theme

Within stacks, the primary frontend and backend (per `project.config.json#frontend.primary` and `#backend.primary`) come first.

## Promoting a stub

1. Add `preset.json` + `manifest.md` to the stub folder, conforming to [`preset.schema.json`](preset.schema.json).
2. Add the actual templates under the folder.
3. Update the parent README's status column.
4. Open an ADR in `docs/decisions/` if it changes architecture.

## Adding a brand-new preset

1. Create a new folder under the appropriate kind (`stacks/`, `business/`, `themes/`).
2. Update the `extends` enum in [`project.config.schema.json`](project.config.schema.json).
3. Add the new slug to the parent README's table.
4. Open an ADR.
