---
name: fp-doctor
description: Run the fastpace health check inside Claude Code. Reads the same signals as `fastpace doctor` (config parse, .claude install completeness, foundation context files, orphan watch cards, .gitignore posture) and reports pass/warn/fail with concrete fix commands. Read-only. Triggers on /fp-doctor.
---

# fp-doctor

A read-only diagnostic. Answers "why isn't fastpace working here?" by running the same checks as the CLI's `fastpace doctor`, but from inside the Claude session so the user doesn't have to leave.

## Preflight

None — this skill exists to run even when other things are broken.

## Checks (in order)

Run each; label `ok` / `warn` / `fail` with the specific fix command. The CLI has an implementation at `packages/fp/src/commands/doctor.js` if you need to cross-reference. Do not invoke the CLI recursively — reproduce the checks by reading files directly.

1. **fastpace.config.yaml** — exists, parses. If missing, fix is `run "fastpace" in terminal`.
2. **context.level + guardrails** — reported from config.
3. **.claude/ structure** — directory exists, `settings.json` is valid JSON.
4. **skills / agents / hooks** — compare bundled assets (under the CLI's `assets/<type>/`) to installed (`.claude/<type>/`). Report missing / stale counts.
5. **Hook executability** — `.claude/hooks/*.js` should have the executable bit set.
6. **Foundation context files** — `architecture.md`, `stack.md`, `conventions.md`, `glossary.md`, `patterns.md`, `decisions.md`, `learnings.md`.
7. **Orphan watch cards** — any `fastpace/watch-cards/*.json` whose `branch` no longer exists in git.
8. **Git repo presence** — warn (not fail) if the repo isn't initialized, because DORA + pr-summary will be limited.
9. **.gitignore posture** — if `fastpace/.integrations.local.json` exists, `.gitignore` must contain that line.

## Output format

Print a compact report, not prose:

```
⚡ fastpace doctor · <N ok> · <N warn> · <N fail>

  ✓ fastpace.config.yaml       parsed ok
  ! context/ foundation        4/7 present — missing: glossary.md, patterns.md, decisions.md
    → fix: run /fp-discover in Claude Code
  ✗ .claude/settings.json      invalid JSON
    → fix: delete and run `fastpace update`
  ✓ guardrails                 7 enabled
  …
```

Then a one-line summary: `N fail(s) — address before continuing.` or `Everything looks good.`

## Rules

- **Read-only.** Never run `fastpace update` or modify any files. Suggest the fix; let the user run it.
- **One fix per fail/warn.** Don't enumerate every possible remediation. The most likely cause gets the fix line.
- **Don't duplicate the CLI recursively.** You have Read and Bash; read files directly. `fastpace doctor` may be offered as an alternative at the end.
- **Cite the file.** When reporting a missing file, include its full path so the user can create it.

## Integration

- At the end, offer:
  - `fastpace doctor` — run the same check from the terminal (identical output).
  - `/fp-discover` — if foundation context files are thin.
  - `fastpace update` — if skills/agents/hooks are missing or stale.

## Exit criteria

- A ≤ 12-line report printed.
- At least one `→ fix:` line for every `!` or `✗` entry.
- No files modified.
