---
name: regen
description: Validate the canonical .ai/ YAML and regenerate all
  platform-specific output files.
when_to_use: When the user asks to regenerate output, apply .ai/ changes, or
  update .claude/ and .github/ from the canonical source.
user-invocable: true
effort: low
allowed-tools:
  - Bash
---

Validate the canonical .ai/ configuration and regenerate all platform-specific output files.

Steps:
1. If `dist/cli/index.js` doesn't exist, build the CLI first: `npm run build`
2. Run `node dist/cli/index.js validate` to check the canonical YAML for errors.
   If validation fails, print the diagnostics and stop — do not proceed to generation.
3. Run `node dist/cli/index.js update-schema` to refresh `.ai/schema.json`.
4. Run `node dist/cli/index.js generate` to write all output files.
5. Report which files were written.
