# Starters, recipes and ownership

## Starter

A starter helps a user begin an editable project/workspace.

Typical contents:

```text
dryv.yaml
.dryv/contracts/...
README.md
possibly initial handwritten/scaffold files
```

The starter may activate project, package and inject packs.

After initialization, the resulting `dryv.yaml` is visible and owned by the user.

## Recipe

A recipe is a reusable recommended composition that may be useful even when the resulting unit is mostly generated.

Example:

```text
standard Dart API package =
  Dart model inject pack
  + Dart HTTP operation inject pack
  + Dart package-root pack
```

A recipe can help produce the explicit usage configuration, but it does not become a hidden runtime dependency layer.

The exact product name and storage format for recipe/starter definitions are not approved yet.

## Why a generated package is not a starter

A Riderescue API package may be almost entirely Dryv-managed:

```text
packages/riderescue_api/
├── pubspec.yaml
├── analysis_options.yaml
├── lib/riderescue_api.dart
├── lib/models/*.dart
└── lib/operations/*.dart
```

The user consumes it from another project and normally does not edit it.

That is a package pack/unit, not a starter.

A starter may choose to activate that package pack.

## Why a project pack is not automatically a starter

A Flutter project pack may generate a project root:

```text
apps/mobile/
├── pubspec.yaml
├── android/
├── ios/
└── lib/
```

That is still a generator pack.

A separate starter can make it easy to initialize a workspace that activates:

- the Flutter project pack;
- a Dart API package;
- optional validation/inject packs;
- initial authored source.

## Ownership proof

A package unit will often be:

```text
managed
managed
managed
managed
```

A project unit can intentionally mix:

```text
pubspec.yaml                 scaffold
lib/main.dart                scaffold
lib/app.dart                 scaffold

lib/_generated/routes.dart   managed
lib/_generated/forms/*       managed
```

This allows the project pack to create a working starting application without forcing Dryv to permanently own every application file.

The source-resource convention is now locked:

```text
normal resource name                 → managed
*.sf[.<renderer>]               → scaffold
```

Examples:

```text
pubspec.yaml.hbs                      → managed
main.dart.sf.hbs                → scaffold
$(name).screen.dart.sf.hbs      → scaffold
$(name).routes.dart.hbs               → managed
```

Ownership is therefore visible at the exact file that carries it rather than
being duplicated at template-registry level.

## Managed-file drift

The CLI records the digest of each managed file after a successful apply. When a later definition changes the desired output and the current file also differs from that recorded digest, the CLI reports a conflict if the developer's version does not already match the desired output. Apply blocks the batch by default. Interactive use offers overwrite, keep, or cancel; automation selects with `--conflicts overwrite|keep|block`. Keeping a conflict skips that managed file while allowing unrelated generated changes to apply. A missing receipt means Dryv has no baseline for this comparison, so the CLI reports evidence as unavailable instead of claiming that an edit is manual drift.

Scaffold files remain project-owned and are skipped once they exist. This conflict rule applies only to managed artifacts with a recorded baseline; it does not change scaffold ownership.

## Starters may persist environment choices

Because a starter may create the initial project-owned `dryv.yaml`, it may also persist explicit destination choices that are known for that starter.

Example:

```yaml
destinations:
  backend:
    path: apps/backend
    choose: { js.package_manager: pnpm }
```

This does not make pnpm a hidden pack dependency. It is visible project configuration created by the starter and remains editable by the user.

A reusable pack must still not infer or force that choice merely because a starter commonly selects it.

A starter using the proposed Usage model may also declare shared pack sources once and reference them from several activations:

```yaml
sources:
  packs:
    dryv:
      repository: https://github.com/dryvcode/packs
      ref: develop
      root: packs
```

This remains visible project-owned `dryv.yaml` configuration.
