{"agent":"claude","input":"Make this Electron app remember its window size, position and maximized state between launches. Read package.json, release/app/package.json, electron.vite.config.ts, jest.config.js, tsconfig.json, src/main/main.ts, src/main/util.ts, src/main/updates.ts, src/__tests__/updates.test.ts and .github/workflows/test.yml first. Add src/main/window-state.ts that stores x, y, width, height and isMaximized as JSON under app.getPath('userData'), written to a temporary file and renamed into place; returns BrowserWindow options with the current 1024 by 728 defaults when the file is missing or invalid; validates the saved bounds against screen.getAllDisplays after the app is ready and falls back to defaults when they fit no display; saves on debounced resize and move and on close, using getNormalBounds when maximized; and re-applies maximized state. Wire it into createWindow in main.ts without changing the ready-to-show or START_MINIMIZED behaviour. Add src/__tests__/window-state.test.ts in the style of updates.test.ts with a node environment and mocked electron, covering a missing file, a corrupt file, a round trip, an off-screen rectangle and a maximized window. Run npm ci, npm run lint, npm exec tsc -- --noEmit, npm test and the smoke test under xvfb-run as test.yml does, and open a pull request that explains the clamping rule and quotes the test output.","resources":[{"url":"https://github.com/your-org/your-app"}]}