{"agent":"claude","input":"Add an unsaved changes guard to this Angular app and open a pull request. Read package.json, vitest.config.ts, src/app/app.routes.ts, src/app/features/article/pages/editor/editor.component.ts and its template, src/app/features/settings/settings.component.ts and its template, src/app/core/auth/services/user.service.ts and src/app/features/article/services/articles.service.spec.ts first. Add src/app/core/guards/unsaved-changes.guard.ts with a HasUnsavedChanges interface and a functional CanDeactivateFn that passes a clean component and otherwise asks an injectable ConfirmService wrapping window.confirm. Implement hasUnsavedChanges on EditorComponent from articleForm.dirty and a changed tagList, cleared by a saved flag set in submitForm before navigation, and on SettingsComponent from settingsForm.dirty after markAsPristine following the patchValue in ngOnInit. Add a window:beforeunload HostListener to both that sets returnValue when there are unsaved changes. Register canDeactivate on the editor, editor/:slug and settings routes. Add unsaved-changes.guard.spec.ts and editor.component.spec.ts with TestBed in the existing Vitest style covering clean, dirty and confirmed cases and the saved flag after submit. Run bun run test, bun run format:check and bun run build, then start the app, type in the editor, navigate away and include a screenshot of the dialog in the pull request. Do not change the auth guard or the forms' validators.","resources":[{"url":"https://github.com/your-org/your-app"}]}