# playstack-integrate

Materialize package-authored application integration wiring


## When to use it

Connect a supported Playstack capability to an application in your workspace. Choose the application directory explicitly, review proposed files, and supply the persistence and test configuration the integration needs. Test the complete application flow before switching existing behavior.

## Usage

```sh
npm exec -- nx generate @megamono/plugin:playstack-integrate --packages="<packages>" --dry-run
```

Replace angle-bracket placeholders with reviewed values. Nx's `--dry-run` previews generator writes; remove it only after reviewing the plan. Examples use npm; use your workspace's package manager if it differs.

## Options

Use these options with `@megamono/plugin:playstack-integrate`. Nx uses the camelCase names shown here; the [CLI reference](/docs/cli) describes command-line aliases. Some options are required only for particular choices.

| Option | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `composition` | No | string | — | Reviewed JSON composition: existing Nx library project, configured Nest modules [{file,export}], optional connect {file,module,importPath}. Nest templates are emitted into the library. |
| `packages` | Yes | string | — | Comma-separated installed @playstack package names. |
| `web` | No | string | — | Workspace-relative web application root. |
| `api` | No | string | — | Workspace-relative API application root. |
| `worker` | No | string | — | Workspace-relative worker application root. |
| `portable` | No | string | — | Workspace-relative portable library root. |
| `adapters` | No | string | — | Comma-separated selected Playstack adapter names used to resolve adapter:<name> conditions. |
| `persistence` | No | string | — | Persistence ownership used to resolve package-authored persistence conditions and decisions. Allowed: "package", "application". |
| `adoptionMode` | No | string | — | Migration phase recorded in the integration plan. Allowed: "fresh", "compare", "shadow", "cutover". |
| `decisions` | No | string | — | JSON object mapping package-authored decision keys to selected string values. |
| `conditions` | No | string | — | JSON object mapping human-readable package conditions to booleans. |
| `equivalences` | No | string | — | Reviewed JSON mapping of environment keys to names, module/provider symbols to existing:file#export, or package:integration:template keys to existing:file. |
| `verification` | No | string | — | Reviewed JSON map from each package:integration:test ID to an existing project:target. |
| `verificationProject` | No | string | — | Existing Nx project receiving the playstack-verify aggregator target. |
| `qualification` | No | string | — | Reviewed JSON map from package:integration:test ID to required environments (real-database, real-queue, native-device, live-provider, typecheck, browser-bundle, tauri-build, expo-build, clean-install, container, unit, in-memory). Binds migration evidence to these environments. |
| `migrationContracts` | No | string | — | Reviewed JSON package:integration map to migration profiles: queue-jobs, application-persistence, auth-policy, billing-cutover. Supplements package tests and requires qualified hashed evidence for stage transitions. |
| `ciWorkflow` | No | string | — | Explicit existing GitHub workflow to augment after review. |
| `ciJob` | No | string | — | Explicit existing CI job receiving the verification step; install/toolchain setup remains repository-owned. |
| `dryRun` | No | boolean | false | — |
| `planOnly` | No | boolean | false | Print the integration plan without writes. Use this for direct Nx invocation; Nx consumes its own dryRun flag. |
| `migrationStages` | No | string | — | Reviewed JSON package:integration transition map with stage, verificationReport and rollbackPlan paths; separate from advisory adoptionMode. |
| `yes` | No | boolean | false | — |

## Next steps

Review changed files and run the affected project's checks. For options that accept structured values, run the generator's `--help` or consult the schema in the installed package.

- [All generators](/docs/generators)
- [CLI overview](/docs/cli)
- [Adopt an existing workspace](/docs/workflows/adoption)
