# `scaffold`

The files `alta new` writes, as data: a valid start for each genre.

## Example

```js [example.mjs]
// The files `alta new` writes, without writing them: a valid start for each genre.
import { GENRES, scaffold, validate } from "@altasystem/sdk";

console.log(GENRES.join(", "));
for (const f of scaffold("quest-pack", { id: "my-pack" })) {
  const doc = JSON.parse(f.content);
  console.log(f.path, doc.schema, validate(doc).ok);
}
```

Run it from a folder where the package is installed: `node example.mjs`.

```text [Output]
chart, quest-pack, onboarding, cinematics, universe, mission, signin
quests.json alta.quests/0.3 true
```

## Functions

### `scaffold`

```ts
function scaffold(genre: Genre, opts: ScaffoldOptions): ScaffoldFile[]
```

The files of a new piece of content. Throws on an unknown genre or a malformed id.

### `resolveGenre`

```ts
function resolveGenre(name: string): Genre | undefined
```

## See also

- [SDK](https://docs.altasystem.ai/reference/sdk/)
- [Errors](https://docs.altasystem.ai/reference/errors)
