# Decisions ## 2026-10-10 · Phase 0 bootstrap - **TypeScript is pinned to `~6.0`, not 7.** TS 7 is `latest` on npm, but `typescript-eslint` 8.x only supports `<6.1`. Move to 7 once typescript-eslint does. - **`moduleResolution: bundler` + `module: preserve`.** tsdown bundles everything into `dist/index.js`, so source imports stay extensionless and Node never resolves them directly. `tsc` is used for type-checking only (`noEmit`). - **The CLI's version comes from `package.json`**, imported as JSON and inlined by tsdown. It is never written by hand anywhere else, so a changeset bump updates `--version` automatically. - **citty is in from Phase 0.** It gives `--version` and `--help` for free and is the arg parser PLAN.md §4 already names. Runtime deps of the CLI itself go in `package.json` as usual; `src/core/versions.ts` (Phase 1) is only for versions used in *generated* projects. - **tsdown emits `.js` (`fixedExtension: false`)** so the `bin` path is `dist/index.js`, matching PLAN.md's Done-when check. - **Prettier skips Markdown.** It would reflow PLAN.md and the other hand-written docs; code and config are still format-checked in CI. - **`pnpm test:e2e` already exists** with its own Vitest config (`tests/e2e/`) and passes with no tests until Phase 2 adds the matrix. - **CI runs on Node from `.nvmrc` (24)** and finishes with a smoke test that compares `node dist/index.js --version` to `package.json`. ## 2026-10-10 · Default template stack These pick the ★ defaults that `--yes` and `--preset api` use. PLAN.md §2 already marks most of them; this section records why, and settles the three items in §10 plus a few gaps the table leaves open. ### Settled in PLAN.md, recorded here with the reason - **Framework: Express 5.** It's the one most users already know, and v5 finally handles async errors natively. *Tradeoff:* Fastify is faster and has first-class schema/OpenAPI support. Hono is lighter and runs on edge runtimes. Both stay as options; Express is the safest default for a "production-ready" first run. - **Database: Prisma + PostgreSQL.** Postgres is the default most teams pick. Prisma 7 ships without the Rust engine binary, is ESM-first, and has the smoothest migrate story for a generated project. *Tradeoff:* Drizzle is thinner, closer to SQL, and has no codegen step. It stays an option for people who'd rather write SQL. - **Validation: Zod 4** for request bodies and typed env. The same schemas also feed OpenAPI, so it's one dependency doing three jobs. - **Lint/format: ESLint (flat config) + Prettier.** It has the widest plugin ecosystem and matches what the CLI repo itself uses. *Tradeoff:* Biome is one fast tool with no config sprawl, but it has fewer rules. It's offered as the alternative. - **Testing: Vitest + Supertest.** It's ESM-native with no transform config, and Supertest works against the `app.ts` factory without opening a port. - **API docs: on by default** (OpenAPI from Zod + Scalar UI). It costs little once Zod is in, and it's what people expect from an API template. *Tradeoff:* it's one more route and dependency in a minimal service. The `minimal` preset turns it off. - **CI: GitHub Actions on.** Most users host on GitHub. The workflow mirrors our e2e steps (lint → typecheck → test → build → docker build). `--no-ci` drops it. - **Git hooks: Husky + lint-staged + commitlint on.** *Tradeoff:* commitlint annoys people who don't use conventional commits. It's kept in `api` and `full` and dropped in `minimal`. ### Open items, with a recommendation - **Docker base image: `node:24-alpine` (non-root `node` user), not distroless.** Distroless has no shell, so `prisma migrate deploy` at startup and compose `healthcheck` commands (`wget`) don't work without extra steps. Prisma 7 dropping engine binaries removes the old musl/alpine pain. *Tradeoff:* distroless has a smaller attack surface. That can become a `--docker-base distroless` option later. (Settles PLAN.md §10.) - **Docker and PM2 are both on, but PM2 never runs inside the container.** The Dockerfile runs `node dist/server.js` directly. Docker/k8s already handles restarts, and scaling happens through replicas. `ecosystem.config.cjs` is for VM/bare-metal deploys. *Tradeoff:* users who want PM2 cluster mode in a container have to switch to `pm2-runtime` themselves. We document how, but it isn't the default. - **Example CRUD module: on when a database is selected, off otherwise.** The `users` module is what proves the DB wiring works (Phase 4's Done-when runs migrations against it), and with no DB it has nothing to show. `--no-example` removes it. *Tradeoff:* some users will delete it on day one, but deleting a folder is cheaper than wiring a DB from scratch. (Settles PLAN.md §10.) - **Auth: none by default.** Auth choices depend heavily on the product (sessions vs. tokens, third-party IdP), and a wrong default is worse than none. JWT and Better Auth stay opt-in. The `full` preset uses Better Auth. *Tradeoff:* `--yes` gives you an API with no auth, and the generated README says so. - **Cache/queue: none by default.** Most new services don't need Redis on day one, and it adds a compose service and an env var. `full` turns on Redis + BullMQ. - **Observability: `/health` + `/ready` always on, OpenTelemetry off.** The endpoints are needed for the Docker healthcheck and PM2 readiness. OTel adds several packages and a collector to configure, so it stays opt-in (and is in `full`). - **Package manager fallback: pnpm if installed, else npm.** It's detected from the invoking `npm create` / `pnpm create` user agent. When detection fails (e.g. a bare `npx create-prodforge`), we use pnpm if it's on PATH, to match the e2e matrix, and otherwise npm with a one-line notice. *Tradeoff:* the lockfile type can surprise someone who ran it with npx, so `--pm` overrides it. - **Runtime: Node 24 LTS default, Node 22 allowed.** Node 22 is supported until April 2027. The generated `engines` field and `.nvmrc` follow the choice. ### Presets that follow from the above | | minimal | api (= `--yes`) | full | |---|---|---|---| | Framework | Express | Express | Express | | DB | none | Prisma + Postgres | Prisma + Postgres | | Example module | off | on | on | | OpenAPI | off | on | on | | Docker / PM2 / CI | Docker only | all on | all on | | Git hooks | off | on | on | | Redis/BullMQ, Auth, OTel | off | off | Redis + BullMQ, Better Auth, OTel | ## 2026-10-10 · Phase 1 core engine - **`versions.ts` holds exact versions; the generated `package.json` gets caret ranges.** Exact pins keep the e2e matrix meaningful (we test what's in the file), and `^` lets users pick up patches after generation. Renovate reads the file through a regex custom manager in `renovate.json`, so entries must stay one `'name': 'x.y.z',` per line. Prettier's `quoteProps: "consistent"` keeps every key quoted so the regex matches. - **`dependsOn` is ordering only.** A feature runs after the listed features *if they're enabled*; a disabled one is skipped, not an error. An id no registered feature has *is* an error, to catch typos. Ties keep registry order so output is deterministic. - **`conflictsWith` is checked in both directions** among enabled features, so only one side needs to declare it. - **Features get an optional `finalize()` hook** that runs after every `apply()`. It lets a feature consume what others registered (the docker feature reading compose services, for example) without having to `dependsOn` every feature that might add one. - **Slot injections are queued and applied after all features run**, so the file can be written by a feature that runs later. Code is indented to the marker, multiple injections keep their order, and every marker line is removed at the end, including unfilled ones. Injecting into a missing slot or file throws with the available slot names. - **Conflicts throw instead of last-write-wins.** Two features adding the same dependency, script or env var with different values is a bug in one of them, so the pipeline stops and names both values. - **A package in both `dependencies` and `devDependencies` stays only in `dependencies`.** - **eta renders with `autoEscape: false`** (we generate code, not HTML) **and no automatic trimming.** Auto-trim also ate the newline after a `<%= %>` at the end of a line, merging it with the next one. Control-flow tags opt in with `-%>` (`<% if (it.cfg.docker) { -%>`) so they leave no blank line. - **Install and `git init` aren't in the pipeline yet.** Phase 1 stops at `writeProject()`; Phase 2 adds them along with the CLI wiring. How the bundled CLI finds each feature's `files/` directory after tsdown bundling is also left to Phase 2, when the first real feature exists. - **`ProjectConfig.example` defaults from `db`** (on with a database, off without), matching the default-stack decision above. ## 2026-10-10 · Phase 2 minimal generator - **Options without a feature yet are reported, not silently dropped.** `--yes` uses the `api` preset from the default-stack decision, which includes Prisma, Docker, PM2 and more that later phases build. The CLI prints one "Not available yet, so not generated: …" line for those and generates the rest. A framework or linter with no feature yet (`--framework hono`) is an error instead, because there's no sensible project without it. `src/cli/availability.ts` holds the list and shrinks phase by phase. - **Prompts only ask what can be generated today:** project name, install, git. Framework, database and extras prompts arrive with their features, so nobody picks an option that does nothing. (Phase 5 adds the framework, linter and extras prompts.) - **Templates ship next to the bundle.** The build copies `src/features/*/files/` to `dist/features/*/files/`, and `featureFiles(id)` looks in both places, so the same code works from source (`pnpm dev`, tests) and from the published CLI. - **`_name` in a template directory becomes `.name`.** npm drops `.gitignore` (and some other dotfiles) from published packages, so templates store `_gitignore`, `_prettierrc.json`, etc. Only a single leading underscore is converted, so `__tests__` stays as is. - **Generated projects use `module: preserve` + `moduleResolution: bundler`**, same as this repo. tsx (dev), Vitest (tests) and tsdown (build) all resolve extensionless imports, so `import { createApp } from './app'` works everywhere and `node dist/server.js` runs the bundle. - **`dev` and `start` load `.env` with Node's `--env-file-if-exists`.** No dotenv dependency. Typed env validation with Zod comes in Phase 3. - **pnpm projects allow esbuild's build script** (`pnpm.onlyBuiltDependencies`), which pnpm 10 blocks by default and tsx needs. - **The health check test lives in the framework feature**, not testing-vitest, because how a test drives the app (Supertest against an Express app vs. Fastify's `inject`) depends on the framework. testing-vitest owns the runner config and scripts. - **The e2e test runs the built CLI**, installs real dependencies, and checks lint, format, typecheck, test and build, then boots `pnpm start` and `pnpm dev` and calls `/health`. It runs as its own CI job; the main job also smoke-tests that the bundle ships its templates. - **Install failures stop the CLI with pnpm's output; a failed initial git commit doesn't.** The commit usually fails only because no git identity is configured, so the repository is left initialized with everything staged. ## 2026-10-10 · Phase 3 production essentials - **Env is validated once, at startup, in `src/config/env.ts`.** A bad or missing variable prints Zod's readable error and exits before the server starts. Base owns the shared variables (NODE_ENV, PORT, LOG_LEVEL, SHUTDOWN_TIMEOUT_MS); each feature adds its own through the `env` slot, so the schema only lists what the project actually uses. - **Pino for logs, pino-http for request logs.** JSON in production, pino-pretty only in development (it's a devDependency). Each request gets an id, reusing an incoming `x-request-id` so ids line up across services, and it's echoed in the response and in error bodies. `/health` and `/ready` aren't logged, since probes would drown everything else. Authorization and cookie headers are redacted. - **One error shape for every failure:** `{ error: { message, details?, requestId } }`. `HttpError` sets its own status, a `ZodError` becomes 400 with flattened details, other errors become 500 with a generic message, and only 5xx are logged as errors. - **`/health` is liveness, `/ready` is readiness.** `/health` only says the process is up. `/ready` runs the checks features push into `src/lib/readiness.ts` (a database ping in later phases) and returns 503 while shutting down, so a load balancer stops sending traffic before the server closes. Both sit before cors and the rate limiter so probes are never throttled. - **Graceful shutdown** on SIGTERM/SIGINT: mark not-ready, stop accepting connections, run the `shutdown` slot (closing pools later), then exit; a timer forces exit after SHUTDOWN_TIMEOUT_MS. Crashes (`uncaughtException`, `unhandledRejection`) go through the same path with exit code 1. - **Docker is generated only for pnpm and npm for now.** The Dockerfile installs from the lockfile, and yarn and bun need different setup, so they're reported as "not available yet" like other missing options. The image is multi-stage (build with all deps, ship prod deps and `dist` only), runs as the `node` user, and starts with `node` directly, not through a package manager, so SIGTERM reaches the app. - **pnpm projects pin `packageManager`** to the version in `versions.ts`. Docker installs the same pnpm version, so the lockfile format always matches. - **`compose.yaml` is built in `finalize()` with the `yaml` package**, from the services other features registered, with the app depending on each one being healthy. Strings use single quotes to match the generated Prettier config. - **PM2 isn't a dependency of the generated project.** It's a process manager usually installed on the server (`npm i -g pm2`), so the feature ships `ecosystem.config.cjs` (cluster mode, one worker per CPU, waits for the app's `ready` signal) and README instructions. Its version in `versions.ts` is what the README and the e2e test use. - **Slot markers can also be Markdown comments** (``), so features add their own README sections. - **Generated ESLint ignores unused names starting with `_`**, the usual way to mark a required but unused parameter such as Express's `next` in an error handler. - **The e2e test also runs pm2 and `docker compose up --wait`** against the generated project. The Docker step can be skipped with `PRODFORGE_E2E_SKIP_DOCKER=1` on machines without a daemon; CI always runs it. ## 2026-10-10 · Phase 4 databases - **Prisma 7.10 (stable), not 8.** npm's `latest` tag for `prisma` points at an 8.0 release candidate while `@prisma/client` is on 7.10, so both are pinned to 7.10. It uses the new `prisma-client` generator (TypeScript output in `src/generated/prisma`, gitignored), `prisma.config.ts`, and the `@prisma/adapter-pg` driver adapter, so there is no Rust query engine at runtime. The bundled `dist/server.js` includes the generated client and runs on prod dependencies only. - **Every database uses `DATABASE_URL`** and a `src/db/client.ts` with the same two exports, `connectDatabase()` and `disconnectDatabase()`. The server connects before it listens and exits with a clear "Is it running?" log if it can't, disconnects during graceful shutdown, and only then registers the `database` readiness check. Registering at connect time (not on import) keeps `/ready` green in tests, which import the app without a database. - **Readiness checks are registered with `addReadinessCheck()`** instead of the Phase 3 slot in `readiness.ts`, so the code that owns a connection also owns its check. `server.ts` gained a `startup` slot for code that runs before `listen`. - **The example users module is split three ways so any framework works with any database.** `example-users` owns the Zod schemas, the `User` type and the `UsersRepository` interface; each database feature implements `users.repository.ts`; the framework feature adds the routes and tests. Features still never import each other: they agree on file paths. A duplicate email surfaces as `EmailTakenError` (409 through the existing `status` + `expose` path), and an unknown or malformed id is a 404 for every database. Ids are app-generated UUIDs on Postgres (text column, so any id string is a valid lookup) and ObjectIds on MongoDB. - **Unit tests don't need a database.** `tests/users.test.ts` mocks the repository with an in-memory one, and the Vitest config loads `.env.example` (with `NODE_ENV=test` and silent logs) so required variables such as `DATABASE_URL` are set. The real database is exercised by the e2e test. - **Initial migrations ship with the project.** Prisma's `prisma/migrations/…_init` and Drizzle's `drizzle/0000_init.sql` were generated by the pinned tool versions and create the `users` table, so `db:deploy` works on a fresh database. Without the example module Prisma has no migrations and Drizzle gets an empty journal (`drizzle-kit migrate` fails without one). The journal is written from code because a template named `_journal.json` would be turned into a dotfile. - **Script names are shared:** `db:generate`, `db:migrate`, `db:deploy` (apply pending migrations, for deploys) and `db:studio`. For Drizzle, `db:migrate` and `db:deploy` are the same command; Prisma's `db:migrate` is `migrate dev`. Mongoose has none: MongoDB has no schema migrations and indexes are built from the models on connect (the server waits for them so the unique email holds from the first request). - **Prisma generates its client in `postinstall`**, so a fresh clone typechecks after `pnpm install`. The Dockerfile copies the schema and config before installing (`install-files` slot), and the prod-deps stage installs with `--ignore-scripts`, because the Prisma CLI is a dev dependency and the client was already generated and bundled. pnpm projects allow the `prisma` and `@prisma/engines` install scripts, which fetch the schema engine that `migrate` uses. - **Compose runs migrations in a one-off `migrate` service** built from the Dockerfile's `build` stage (it has the dev tools and migration files). The app waits for it with `service_completed_successfully`, so the runtime image stays free of migration tooling. Database features register the service, a named volume and the app's `DATABASE_URL` (pointing at the compose host name) through `ctx.compose`; the docker feature turns them into YAML. Postgres and MongoDB publish their ports so `pnpm dev` on the host can use them. - **Compose image tags live in `versions.ts`** under `images`, with unquoted keys so the npm Renovate manager skips them and a second, Docker-datasource manager updates them. - **Injections can be optional** (`{ optional: true }`), for files another feature may not write, such as the Dockerfile when Docker is off or unsupported for the package manager. Features can also have more template directories than `files/` (`files-example/` holds what the example module adds). - **The e2e test runs once per database** (a CI matrix job each): lint, format, typecheck, test and build; then `docker compose up -d --wait` for the database, `db:deploy` from the host, the users API through `pnpm start`, dev and pm2 against it, and finally the whole stack in compose including the `migrate` service. ## 2026-10-11 · Phase 5 more frameworks and options - **Every framework provides the same slots and files**, so database, OpenAPI and example features work with all three unchanged: `app.ts` with `imports`, `middleware` and `routes` slots and a `createApp()` factory; `server.ts` with `startup` and `shutdown`; the same error body, request ids, `/health` and `/ready`, and the same env variables (`CORS_ORIGIN`, `RATE_LIMIT_PER_MINUTE`, `BODY_LIMIT_KB`, added by a shared helper). `BODY_LIMIT` became `BODY_LIMIT_KB`, a number, because Fastify and Hono take bytes rather than Express's `"100kb"` strings. - **Fastify uses its own plugins** (`@fastify/helmet`, `@fastify/cors`, `@fastify/rate-limit`) and Pino directly as its logger, so there's no pino-http. Tests use `app.inject()`. - **Hono runs on Node through `@hono/node-server`**, with Hono's built-in request id, secure headers, CORS and body limit middleware, and `hono-rate-limiter` (in-memory store, keyed on the client IP). Tests use `app.request()`, which needs no server. *Tradeoff:* the rate limiter's in-memory store is per process, same as Express and Fastify; a shared store comes with Redis in Phase 6. - **The users tests share one in-memory repository** (`tests/support/memory-users-repository.ts`, from the example module) that each framework's test mocks in, instead of three copies. - **Biome replaces ESLint + Prettier** when `--lint biome` is picked: one dev dependency and a `biome.jsonc` with the same style (single quotes, 100 columns). It reads `.gitignore` for ignores, and features add their own through an `ignore` slot (Drizzle's tab-indented snapshots). The scripts keep their names (`lint`, `format`, `format:check`) so CI and docs don't change. - **Git hooks: Husky runs lint-staged before each commit and commitlint on each message.** lint-staged runs ESLint + Prettier or `biome check --write` on staged files only. The CLI now runs `git init` before installing, so the `prepare: husky` script installs the hooks; the initial commit uses `--no-verify` and a conventional message (`chore: initial commit from create-prodforge`). Docker builds are unaffected: `husky` exits quietly without a `.git` directory, and the prod install skips scripts. - **The generated CI workflow** (`.github/workflows/ci.yml`) installs from the lockfile and runs lint, format check, typecheck, test and build; the docker feature adds a job that builds the image (no push, GitHub Actions cache). Action versions live in `versions.ts` under `actions`, updated by a third Renovate manager. - **OpenAPI comes from the Zod schemas with zod-openapi.** `src/openapi/document.ts` holds the document and a `paths` slot; the example module adds the users paths from its own schemas. Each framework serves `/openapi.json` and a Scalar page at `/docs` with its Scalar package. *Tradeoff:* the document is written by hand next to the routes, not inferred from them, because Express has no route schemas to infer from; it keeps all three frameworks identical. - **The docs page loads a pinned Scalar version** (`@scalar/api-reference` in `versions.ts`) from jsDelivr, since an unpinned CDN URL would change under you. It needs an inline script, so `/docs` gets its own Content-Security-Policy instead of helmet's strict default. Fastify's plugin serves the script from the package instead of the CDN. - **No option is blocked any more.** Every framework and linter has a feature, so `availability.ts` only reports the Phase 6 add-ons it skips. The prompts now ask for framework, database, linter and extras (OpenAPI, Docker, PM2, CI, git hooks; all on by default). - **The e2e matrix is framework × database with ESLint, plus Biome on two cases**, one CI job each (`e2e (fastify, prisma, eslint)`). It also commits through the generated hooks and checks `/openapi.json` and `/docs`. ## 2026-10-11 · Phase 6 advanced options - **Redis is one shared ioredis connection** in `src/lib/redis.ts`, opened before the server listens (failing fast like the database), closed on shutdown and reported in `/ready` as `redis`. It's created with `lazyConnect`, so tests import modules that use it without a Redis server. Compose gets a `redis` service (image tag in `versions.ts`) and the app's `REDIS_URL`. - **BullMQ jobs run in a separate worker process** (`src/worker.ts`, its own tsdown entry and `dev:worker` / `start:worker` scripts), so slow jobs never hold up requests and the two scale separately. Queues and workers open their own connections from `REDIS_URL` (`maxRetriesPerRequest: null`, which blocking workers need). The example job shows the pattern: a processor the worker runs and an `enqueue…()` helper the app calls, with retries and backoff. Compose runs the worker from the app image as a `worker` service (via `ctx.compose.addAppProcess()`), with a liveness health check in place of the image's HTTP one (`docker compose up --wait` refuses services whose check is disabled), and PM2 gets a fork-mode worker app. - **OpenTelemetry loads with `--import ./dist/instrumentation.js`**, a separate entry built by tsdown. ESM modules are only patched if the loader hook is registered before they load, so importing it from `server.ts` wouldn't work. The otel feature adds the flag to every script that runs the server or worker (in `finalize()`, so it sees scripts added by other features), sets `NODE_OPTIONS` in the Docker image and PM2 env, and configures itself from the standard `OTEL_*` variables. `.env.example` ships with `OTEL_TRACES_EXPORTER=none`, so nothing is exported until you point it at a collector. - **Auth needs a database**, so `--auth` with `--db none` is skipped with a notice. Each option is split like the example module: the auth feature owns the service, tokens and env; the database feature owns storage (tables, migration, repository); the framework owns routes, middleware and tests. - **`--auth jwt` is a small, readable implementation**: `jose` signs HS256 access and refresh tokens (each with a `type` claim, so one can't stand in for the other), and passwords are hashed with Node's built-in scrypt, so there's no native dependency. Routes: `POST /auth/register`, `/auth/login`, `/auth/refresh` and `GET /auth/me`, plus a `requireAuth` middleware to copy onto your own routes. Accounts live in an `accounts` table (or collection), separate from the example users. *Tradeoff:* refresh tokens are stateless, so they can't be revoked before they expire; use Better Auth if you need sessions you can end. - **`--auth better-auth` mounts Better Auth at `/api/auth`** with email and password sign-in and the bearer plugin, so browsers use the session cookie and other clients the `set-auth-token` header. Its tables were generated by the Better Auth CLI and prefixed `auth_` (`authUser` and so on) so they don't clash with the example `users`. Express mounts the handler before the JSON body parser (an `app.ts` `before-body` slot); Fastify forwards `/api/auth/*` to it as a web Request. On MongoDB it uses the driver directly with transactions off, because the compose `mongo` service isn't a replica set. - **New engine hooks:** `pkg.updateScript()` for deliberate rewrites (adding never overwrites), `ctx.compose.addAppProcess()`, and slots for tsdown entries, the Dockerfile runtime stage and PM2 env/apps. - **e2e reads the generated project to decide its checks** (compose services, migrations, docs, worker, hooks, PM2), so add-on flags and presets need no special cases. `PRODFORGE_E2E_FLAGS` adds flags to every case, and CI runs a few add-on combinations next to the framework × database matrix. - **Presets are partial configs** in `src/core/presets.ts`: `minimal`, `api` (the `--yes` defaults) and `full`, as in the table above. Precedence is flags, then the preset, then prompts for anything still unset, then defaults. `api` and `full` leave `example` unset so it follows the database. A preset file (`--preset ./team.json`) may set any config field except `name`, `install` and `git`, which belong to each run; unknown keys are an error, and `$schema` is allowed. - **The prompts now ask for Redis, auth and OpenTelemetry** too (auth only when a database is picked), so every option is reachable interactively. - **`--dry-run` prints the file tree and the generated package.json** and writes nothing. It also skips install and git. There's nothing to diff against for a new project, so it prints the whole package.json. - **`--latest` rewrites the generated package.json** with npm's `latest` version of each dependency, after a warning that the combination is untested. It skips a `latest` tag that is a prerelease (Prisma's points at an 8.0 RC as of writing) and `@types/node`, which follows the Node version you picked; both keep their pins and are listed. Docker image tags, GitHub Action versions and the Scalar CDN pin aren't npm dependencies and stay as pinned. ## 2026-10-11 · Phase 7 polish and release - **Publishing is manual.** The `Release` workflow only maintains the changesets "Version Packages" PR; merging it bumps the version but publishes nothing. `Publish` is a `workflow_dispatch` workflow that defaults to a dry run, then publishes with npm provenance and pushes the tag. A maintainer can also publish from their machine (CONTRIBUTING.md). *Why:* the first releases should be a deliberate step by the owner, and an npm token shouldn't sit in CI until it's needed. - **Provenance is set in the workflow (`NPM_CONFIG_PROVENANCE`), not `publishConfig`**, because provenance only works from CI and would break a local `npm publish`. - **The packed tarball is smoke-tested on every PR** (`scripts/smoke-pack.sh`): it checks the package has `dist/` and no sources, installs it in an empty directory and generates all three presets with it. It replaced the CI step that ran `dist/` from the repo, which couldn't catch files missing from `files`. - **The README demo GIF is drawn by `scripts/demo-gif.py`** (Pillow frames, then ffmpeg) from a script of the real prompts, so it can be redrawn when the prompts change without a screen recorder. *Tradeoff:* it's a re-enactment, so the answers and file count in the script must be kept in step with the CLI. ## 2026-10-11 · Phase 8 `create-prodforge add` - **It's a subcommand of the same package** (`npx create-prodforge add bullmq`), not a second `prodforge` package, so there's one thing to install and version. The cost: a new project can't be named `add`. - **Generated projects record their options in `.prodforge.json`** (the config minus install/git, and the CLI version). It's written by the CLI, not a feature, so snapshot tests don't change on every version bump. - **Adding re-runs the generator twice in memory** (recorded options, then with the add-ons) and applies the difference to disk as a three-way merge, with the first run as the base. Features stay unchanged: they still only write to the virtual FS. New files are created; a file you haven't changed is replaced; `package.json` is merged key by key (yours wins on a clash, which is reported); other files go through `git merge-file`, which leaves standard conflict markers. Without git, the new version is written next to yours as `.prodforge-new`. A generated file you deleted stays deleted. - **New env variables are appended to `.env`** with their `.env.example` values, so the app starts after an `add` without editing config by hand. - **Only additive options can be added.** Switching framework, database, linter or auth kind would mean rewriting code you've built on, so `add` refuses those. Adding `redis` to a BullMQ project is a no-op. - **The install after `add` unfreezes the lockfile** (`--no-frozen-lockfile` for pnpm), since CI-mode installs refuse an out-of-date lockfile by default. - **e2e upgrades a generated project** when `PRODFORGE_E2E_ADD` is set, then runs every check on the result; CI has two such cases.