---
name: fp-init
description: Verify fastpace is ready to use in this Claude Code session — reads fastpace.config.yaml, reports installation health, and tells the user the single best next command based on current repo state. Does not write files or reinstall anything (that's what the `fastpace` CLI is for). Triggers on /fp-init.
---

# fp-init

A read-only session probe. Answers three questions: is fastpace installed, what state is the project in, and what should the user do next.

## Preflight (stop conditions)

Bail early with a clear message if any of these are true:

1. **No `fastpace/fastpace.config.yaml`** — tell the user to run `fastpace` in their terminal (not here). Don't attempt to scaffold it.
2. **No `.claude/settings.json`** — tell the user to run `fastpace update`. The hooks won't fire without it.
3. **No `.claude/skills/` directory** — same message; the skills (including this one, paradoxically) need to be installed via the CLI.

## Process

1. Read `fastpace/fastpace.config.yaml` with Read. Extract:
   - `project.name`, `project.type`, `context.level`
   - `guardrails.*` (which are on/off)
   - `hooks.*.enabled` (count of enabled hooks)
   - `phases.*` (the approval gates)
2. List `fastpace/context/*.md` to confirm foundation files exist:
   - `architecture.md`, `stack.md`, `conventions.md`, `glossary.md`, `patterns.md`, `decisions.md`, `learnings.md`
3. Count artifacts to infer maturity:
   - `ls fastpace/docs/prd/*.md` — any PRDs?
   - `ls fastpace/docs/erd/*.md` — any ERDs?
   - `ls fastpace/docs/adr/*.md` — any ADRs?
   - `ls fastpace/exec-plans/*.json` — any plans?
   - `ls fastpace/watch-cards/*.json` — anything in flight?
4. Pick the single best next command (see decision tree below).

## Next-command decision tree

In priority order — the **first match wins**:

| If… | Tell the user |
|---|---|
| No `context/architecture.md` | `/fp-discover` — seed the domain context. |
| Any `watch-cards/*.json` with `status != completed` | Resume: `/fp-new-feature <slug>` — they have work in flight. |
| `learnings-inbox/` has pending drafts | Open `fastpace ui` → Learnings inbox and review them. |
| No PRDs | `/fp-write-prd <feature>` — start the funnel. |
| PRDs but no matching ERDs | `/fp-prd-to-erd <slug>` for the newest PRD. |
| ERDs but no matching exec plan | `/fp-erd-to-execplan <slug>` for the newest ERD. |
| Exec plan exists, nothing in flight | `/fp-new-feature "<pick a story from the plan>"`. |
| Everything covered | `fastpace ui` — the UI will suggest what's next. |

## Output format

Print a compact block, not prose. Template:

```
⚡ fastpace ready

  project       <project.name>
  type          <project.type>
  level         L<n>   (<count> context files, <count> decisions, <count> ADRs)
  hooks         <n enabled> of <n total>
  in flight     <n watch cards>  (<n phases done> / <n total> on <most-recent.name>)

  next:  <the-one-command-from-decision-tree>  — <one-line reason>
```

Example:

```
⚡ fastpace ready

  project       checkout-svc
  type          node-service
  level         L4   (7 context files, 3 decisions, 2 ADRs)
  hooks         7 of 7
  in flight     1 watch card   (3 / 8 on credit-card-validation)

  next:  /fp-new-feature credit-card-validation — resume your in-flight feature
```

## Failure modes to avoid

- **Don't install or scaffold anything.** This skill is read-only. If the install looks broken, tell the user to run `fastpace update` in their terminal — don't attempt to fix it from inside Claude.
- **Don't dump raw YAML at the user.** Parse it and summarize.
- **Don't list every skill.** The user can run `ls .claude/skills/` themselves; that's not useful.
- **Don't recommend more than one next step.** Pick the single best command and explain why in one line.
- **If multiple watch cards are active**, mention the most recently updated one — not all of them.

## Exit criteria

- A ≤ 10-line status block printed.
- Exactly one `next:` command suggested with a one-line reason.
- No files written.
