---
name: fp-customize
description: Interactively update fastpace.config.yaml — project metadata, guardrails, hook toggles, approval gates, protected branches, context level. Shows a diff before every write. Logs every change to fastpace/audit.log. Triggers on /fp-customize [area]. For a point-and-click UI use `fastpace ui` instead.
---

# fp-customize

Edit `fastpace/fastpace.config.yaml` with intent — diff, confirm, log.

## Preflight

- If `fastpace/fastpace.config.yaml` doesn't exist, tell the user to run `fastpace` in the terminal and stop.
- If it exists but is malformed (YAML parse fails), stop and show the parse error. Don't try to fix it silently.

## Areas you can edit

| Area | Keys under | Common changes |
|---|---|---|
| `project` | `project.name`, `project.type`, `project.commit_style`, `project.naming` | Rename, change commit convention. |
| `guardrails` | `require_tests`, `require_review`, `require_security_scan`, `block_on_critical_findings`, `require_branch_before_changes`, `require_pr_description`, `auto_push`, `allow_force_push`, `protected_branches` | Toggle a guardrail. Add/remove protected branch. |
| `hooks` | `hooks.<name>.enabled`, `hooks.<name>.skip_paths`, `hooks.<name>.approved_scopes` | Disable a hook. Add an approved npm scope. |
| `phases` | `phases.<phase>` ∈ `{ developer, team_lead, architect, skip }` | Raise/lower an approval gate. |
| `context` | `context.level`, `context.directory` | Mark L1→L2→…→L5 as artifacts accumulate. |

## Process

1. **Identify the area.** If the user's invocation has an area (`/fp-customize guardrails`), skip to step 3. Otherwise ask *one* question: "Which area? (project / guardrails / hooks / phases / context)".
2. **Show the current state** of that area — just the YAML block — so the user sees what's there before editing.
3. **Ask what to change.** One open question. No questionnaire.
4. **Draft the change.** Produce a *unified diff* of the edit (see format below). Show it.
5. **Confirm.** If the change weakens a guardrail, ask an explicit double-check (see "Danger prompts").
6. **Write** the YAML. Preserve comments, ordering, and indentation — parse → mutate → serialize. If the repo has a hand-rolled YAML formatter style, match it.
7. **Append an audit entry** to `fastpace/audit.log` in JSON-lines form:
   ```
   {"ts":"<iso>","kind":"config_change","area":"<area>","key":"<key>","from":<old>,"to":<new>,"author":"<user>"}
   ```
8. **Report** the one-line summary.

## Danger prompts (weaker guardrails require an explicit yes)

If the requested change is one of these, ask for explicit confirmation *in the user's words* — don't accept "sure" or "y":

- `guardrails.auto_push: false → true`
- `guardrails.allow_force_push: false → true`
- `guardrails.require_tests: true → false`
- `guardrails.require_review: true → false`
- `guardrails.block_on_critical_findings: true → false`
- Removing any entry from `guardrails.protected_branches`
- Setting any `phases.*` to `skip` that was previously an approver role

Prompt template for danger changes:

```
⚠ This weakens a guardrail.

  <guardrail key>: <old> → <new>

  Previous state logged everything. After this change, <what you lose>.

  Type "yes, weaken <guardrail key>" to confirm. Anything else cancels.
```

## Diff format (show to user before writing)

```diff
--- fastpace/fastpace.config.yaml (before)
+++ fastpace/fastpace.config.yaml (after)
@@ guardrails: @@
-  auto_push: false
+  auto_push: true
```

If multiple lines change, include all of them.

## Protected branches — rules

- Adding: fine, just show the new list.
- Removing `main`, `master`, or `release/*`: refuse unless the user types `yes, unprotect <branch>`. This is one of the most common ways teams get hurt.
- Adding duplicates: silently dedupe, don't error.

## Context level — sanity check

Don't let the user set a level higher than artifacts support. Rules:

- L1 → anytime.
- L2 → requires `fastpace/context/architecture.md` to exist and be non-empty.
- L3 → requires at least one PRD and one ERD.
- L4 → requires at least one non-sample execution plan.
- L5 → requires at least one ADR and at least one entry in `learnings.md`.

If the requested level fails its check, suggest the missing artifact and do not write.

## Failure modes to avoid

- **Don't edit the file without showing a diff.** Every change is visible before it's written.
- **Don't touch unrelated keys.** Only change what the user asked about.
- **Don't drop comments.** Preserve `# …` lines verbatim.
- **Don't skip the audit entry.** Config changes without an audit line are how policy erodes silently.
- **Don't batch unrelated changes** into one write without showing the combined diff.

## Integration

- For anything beyond a single config tweak (e.g. "make fastpace match how our repo actually works"), recommend `/fp-discover` instead.
- For a visual interface, mention `fastpace ui` → Config view in the response footer.

## Exit criteria

- The YAML file reflects exactly the confirmed diff.
- One audit entry appended per key changed.
- User told: which keys changed, the one-line rationale the user gave, and "run `git diff fastpace/fastpace.config.yaml` to review + commit."
