# Releasing and npm Publish

This is the release checklist for `never2average-clone`.

## 1. Verify version intent

Check:

```bash
node -p "require('./package.json').version"
npm view never2average-clone version dist-tags --json
```

If local code is ahead of the published artifact, bump the version before publish.

## 2. Run the release gate

From the repo root:

```bash
npm run typecheck
npm run build
npm run test:skills
npm run test:subagent-resume
npm run test:fullscreen-ui
npm run test:fullscreen-pty
npm run test:actuarial-artifacts
npm run test:parallel-analyst-pty
npm run test:live-usecases
npm run test:mlx-parity
```

If the live parity matrix changed intentionally:

```bash
npm run test:live-usecases:update-snapshots
```

## 3. Verify the package artifact

Run:

```bash
npm pack --dry-run
```

Check for:

- `dist/` present
- packaged `SKILL.md` files present
- `README.md` present
- `docs/` present
- no local `config.json`
- no live `.env`
- no API keys or secrets

## 4. Publish

```bash
npm publish
```

## 5. Verify after publish

Check:

```bash
npm view never2average-clone version dist-tags --json
```

Then install the just-published package on a clean machine or clean shell:

```bash
npm install -g never2average-clone@latest
never2average-clone doctor
```

## 6. Post-publish smoke path

Run:

```bash
never2average-clone login
never2average-clone doctor
never2average-clone value-creation-analyst
```

Inside the TUI:

```text
/help
/dataset register
/actuarial create
```

## 7. If a publish is wrong

Do not guess. First identify whether the problem is:

- versioning only
- packaging only
- runtime regression
- documentation gap

Then fix forward with the next patch or minor version. The normal path should be:

- bump version
- rerun release gate
- publish corrected artifact

Do not rely on undocumented rollback behavior as the primary release strategy.
