# Alpha.9 / 1.0.0-rc.1 Hardening Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Harden the package for RC release: improved `autopilot init` next-steps, public API surface exports, and version bump to `1.0.0-rc.1`.

**Architecture:** Three self-contained changes with no interdependencies. (1) Extend init.ts next-steps text to guide users through hook install → snapshot generate → CI. (2) Add `src/index.ts` re-exporting the four canonical public symbols, update `package.json` with `exports` field. (3) Bump version.

**Tech Stack:** TypeScript ESM, Node 22, no new dependencies.

---

### Task 1: Improved `autopilot init` next-steps

**Files:**
- Modify: `src/cli/init.ts:66-70`

Current output (lines 67-70):
```
Next steps:
  1. Review autopilot.config.yaml and adjust testCommand / protectedPaths
  2. Set OPENAI_API_KEY in your .env file for Codex review
  3. Run: npx autopilot run
```

Replace with a richer 5-step guide that covers hook install, snapshot generation, CI, and the first run.

- [ ] **Step 1: Update the next-steps block in `src/cli/init.ts`**

Replace lines 67-70 with:

```typescript
  console.log('\nNext steps:');
  console.log('  1. Review autopilot.config.yaml and adjust testCommand / protectedPaths');
  console.log('  2. Set OPENAI_API_KEY in your environment (for Codex review)');
  console.log('  3. Install the pre-push git hook:');
  console.log('       npx autopilot hook install');
  console.log('  4. Generate snapshot baselines after your next feature lands:');
  console.log('       npx autopilot autoregress generate');
  console.log('  5. (Optional) Add CI with GitHub Actions:');
  console.log('       uses: axledbetter/claude-autopilot/.github/actions/ci@main');
  console.log('  6. Run your first pipeline:');
  console.log('       npx autopilot run\n');
```

- [ ] **Step 2: Verify compile**

```bash
cd /tmp/claude-autopilot/.worktrees/v1-alpha9
npx tsc --noEmit
```

Expected: 0 errors.

- [ ] **Step 3: Commit**

```bash
git add src/cli/init.ts
git commit -m "feat(init): expand next-steps to cover hook, autoregress, CI"
```

---

### Task 2: Public API exports

**Files:**
- Create: `src/index.ts`
- Modify: `package.json` (add `exports` field, add `src/index.ts` to `files`)

Public surface the spec calls for:
- `Finding` — from `src/core/findings/types.ts`
- `RunResult` — from `src/core/pipeline/run.ts`
- `AutopilotConfig` — from `src/core/config/types.ts`
- `normalizeSnapshot` — from `src/snapshots/serializer.ts`

- [ ] **Step 1: Write `src/index.ts`**

```typescript
export type { Finding, Severity, FindingSource } from './core/findings/types.js';
export type { RunResult, RunInput, PhaseResult } from './core/pipeline/run.js';
export type { AutopilotConfig, AdapterRef, AdapterReference } from './core/config/types.js';
export { normalizeSnapshot } from './snapshots/serializer.js';
```

Note: `.js` extensions required for ESM resolution even when source is `.ts`.

- [ ] **Step 2: Verify the re-exports resolve cleanly**

```bash
cd /tmp/claude-autopilot/.worktrees/v1-alpha9
npx tsc --noEmit
```

Expected: 0 errors.

- [ ] **Step 3: Add `exports` field to `package.json`**

In `package.json`, after the `"bin"` field, add:

```json
  "exports": {
    ".": {
      "import": "./src/index.ts",
      "types": "./src/index.ts"
    }
  },
```

Also add `"src/index.ts"` to the `"files"` array (it's already covered by `"src/"` glob, but make it explicit).

Actually `"src/"` in `files` already covers `src/index.ts` — no change to `files` needed.

- [ ] **Step 4: Commit**

```bash
git add src/index.ts package.json
git commit -m "feat: add public API exports (Finding, RunResult, AutopilotConfig, normalizeSnapshot)"
```

---

### Task 3: Version bump to `1.0.0-rc.1`

**Files:**
- Modify: `package.json` — `"version"` field
- Modify: `CHANGELOG.md` — prepend new section

- [ ] **Step 1: Read current CHANGELOG.md**

```bash
head -30 /tmp/claude-autopilot/.worktrees/v1-alpha9/CHANGELOG.md
```

- [ ] **Step 2: Bump version in `package.json`**

Change:
```json
"version": "1.0.0-alpha.8",
```
To:
```json
"version": "1.0.0-rc.1",
```

- [ ] **Step 3: Prepend RC section to `CHANGELOG.md`**

Add this at the top (before the existing `## [1.0.0-alpha.8]` section):

```markdown
## [1.0.0-rc.1] — 2026-04-21

### Added
- `autopilot init` now shows full next-steps: hook install, autoregress generate, CI snippet, first run
- Public API surface: `Finding`, `RunResult`, `AutopilotConfig`, `normalizeSnapshot` exported from package root via `exports` field in package.json

### Changed
- Version promoted from 1.0.0-alpha.8 → 1.0.0-rc.1

```

- [ ] **Step 4: Commit**

```bash
git add package.json CHANGELOG.md
git commit -m "chore: bump version to 1.0.0-rc.1"
```

---
