---
description: Sync documentation with recent code changes.
argument-hint: [scope]
---

# /update-docs

## Purpose

Keep `docs/`, READMEs, ADRs, and `knowledge/` in step with the code.

## Required context

- `git diff main...HEAD`, `docs/`, `knowledge/`, folder READMEs

## Inputs

- `$1` — optional scope (folder or feature)

## Execution steps

1. Diff the branch; list code changes that invalidate docs.
2. Update affected READMEs, runbooks, onboarding, and the repo map.
3. If a decision changed, update or supersede the relevant ADR.
4. Regenerate `tools/validators/repository-map.json`.

## Validation checklist

- [ ] No doc references a removed file/function
- [ ] New folders have a README
- [ ] i18n/onboarding still accurate
- [ ] `pnpm validate:repo-map` passes

## Expected output

Docs that match the code.

## Failure handling

If unsure whether a doc is stale, flag it rather than guessing.
