ReviewOS

also looking at this

stacks/buddy

feat(events): one notification story — fire every declared event, trim setup to its real job

#1449
Merged glennmichael123 wants to merge refactor/setup-plugin-trim into main
14 files +308 -81
CLAUDE.mdmodified+11-12
Changes to CLAUDE.md
@@ -1149,7 +1149,7 @@ const result = await migrator.migrateFromRenovate('renovate.json')
11491149
11501150## Integration Ecosystem
11511151
1152Buddy includes an extensible plugin system that enables integrations with popular collaboration and project management tools.
1152Buddy includes a setup-time plugin system that notifies your collaboration tools when `buddy setup` completes. (Runtime events — scans, pull requests, merges — go through the `notifications` key in `buddy.config.ts` instead; that is the system a new integration should hook into.)
11531153
11541154### Built-in Integrations
11551155
@@ -1167,8 +1167,7 @@ echo "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" > .buddy/slack-webhoo
11671167
11681168- Rich setup completion notifications
11691169- Repository and project details
1170- Error notifications for setup failures
1171- Configurable channel and username
1170- Reads the webhook from the env var, or from the `.buddy/slack-webhook` file
11721171
11731172#### Discord Integration
11741173
@@ -1214,8 +1213,7 @@ Create custom integrations by defining plugins in `.buddy/plugins/`:
12141213 "version": "1.0.0",
12151214 "enabled": true,
12161215 "triggers": [
1217 { "event": "setup_complete" },
1218 { "event": "validation_error" }
1216 { "event": "setup_complete" }
12191217 ],
12201218 "hooks": [
12211219 {
@@ -1240,13 +1238,14 @@ hooks run, and the plugin file chooses the URL.
12401238
12411239### Plugin Events
12421240
1243| Event | Description | Context |
1244|-------|-------------|---------|
1245| `pre_setup` | Before setup begins | Initial configuration |
1246| `post_setup` | After setup completes | Full setup context |
1247| `step_complete` | After each setup step | Step-specific progress |
1248| `validation_error` | When validation fails | Error details and recovery |
1249| `setup_complete` | Final setup completion | Complete project context |
1241Setup fires exactly one event: **`setup_complete`**, once, when setup finishes
1242— in interactive and non-interactive runs alike. Triggers naming anything else
1243still load (files written against the retired `pre_setup` / `post_setup` /
1244`step_complete` / `validation_error` vocabulary are tolerated) but never fire.
1245
1246For runtime notifications — scans, pull requests, merges — use the
1247`notifications` key in `buddy.config.ts`: an exported webhook env var alone
1248does nothing at runtime.
12501249
12511250### Programmatic Usage
12521251