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

# Feature generator

> Create a minimal Nx package with an AMiSi import path and domain tags

The `feature` generator delegates to the Nx JavaScript library generator and creates a minimal package under `packages/`.

## Command

```sh theme={null}
bun run nx g @amisi-mobile-starter/generators:feature account-preferences
```

The first positional argument is required and becomes the package name and import path.

## Options

| Option | Required | Description                                              |
| ------ | -------- | -------------------------------------------------------- |
| `name` | Yes      | Package name, read from the first positional argument    |
| `tags` | No       | Comma-separated Nx tags applied to the generated project |

Pass custom tags with:

```sh theme={null}
bun run nx g @amisi-mobile-starter/generators:feature account-preferences --tags="scope:domain,type:domain,domain:account-preferences"
```

Without `--tags`, the generator creates:

```text theme={null}
scope:domain,type:domain,domain:account-preferences
```

## Generated configuration

For `account-preferences`, the generator configures the Nx library with:

* directory `packages`
* import path `@amisi-mobile-starter/account-preferences`
* no bundler
* no generated linter target
* no generated unit-test target
* minimal library files

<Warning>
  The generated package is intentionally minimal. Add its public exports, package metadata where needed, tests, lint/typecheck targets, and dependency boundaries before treating it as a shipped package.
</Warning>

## Next steps

1. Define the package’s responsibility and public API.
2. Add implementation under `packages/account-preferences/src`.
3. Add tests and Nx targets consistent with neighboring packages.
4. Add the package to mobile dependencies or TypeScript paths only if consumers require it.
5. Run `bun run verify`.

<Card title="Add an adapter" icon="plug" href="/generators/adapter">
  Scaffold a provider adapter inside an existing package.
</Card>
