I just reverse-engineered CCleaner / CleanMyMac with Opus 5.5 for Mac & Windows PC
@0xMovez50 тыс. подписчиков
173 616 просмотров
15 комментариев
Комментарии из оригинального поста в X (Twitter)

@0xMovez
Build "Cleanly": a beautiful, safe disk cleaner for macOS and Windows, from scratch. I attached screenshots of CleanMyMac as a visual quality bar. Match the polish, not the brand: original name, logo, icons and copy. ## How to work 1. Design first, code later. Make 3 different UI concepts (light glass, dark neon, minimal) as clickable HTML mockups. Show them to me, let me pick and give feedback, iterate. Only then start the app. 2. Write the shared data contract before anything else: one `shared/types.ts` with every type and the full IPC API between the Electron main process and the UI. Everything else compiles against it. 3. Build in parallel with sub-agents, each owning its own files (no two agents edit the same file): scanner services, system services (startup apps, installed apps, protection), AI + settings, home screen, file screens, system screens, packaging. 4. After the build, run a separate SAFETY agent whose only job is to break every code path that deletes, trashes, uninstalls or toggles something, and fix what it finds. 5. Then an integration agent: typecheck + build must be green. 6. Verify for real: run the UI in a browser with realistic mock data, then run the packaged app on my machine read-only (scan, don't clean) and show me screenshots. ## Stack - Electron (latest) + React + TypeScript + Vite. Main process bundled with esbuild (ESM), preload bundled as CJS. - Security: sandbox, contextIsolation, no nodeIntegration. The preload exposes only the typed API. Main rejects IPC from any frame that isn't our own index.html. External links: https only, opened in the system browser. - Fonts bundled offline (no CDN at runtime). Strict CSP in production. ## Features - Smart Scan home: big "X GB ready to reclaim" number, one Clean button, a mini space map, and 4 live cards (Cleanup, Speed, Protection, Apps). - Cleanup categories per OS: - Windows: user temp, Windows temp, browser caches (Chrome/Edge/Brave/Firefox, every profile), app caches, crash dumps, Windows Update downloads, dev caches (npm/pip), Recycle Bin, old downloads (90+ days). - macOS: ~/Library/Caches, logs, browser caches, Xcode DerivedData, dev caches, Trash, old downloads. - Space Map: glass bubbles sized by folder size, drill-down, a switch between Home and every fixed drive (C:, D:…). Bubbles have physics: drag, throw, collide. - Large Files, Duplicates (size → partial hash → full hash). - Speed: startup apps with on/off toggles. - Applications: real app icons, sizes, uninstall via the vendor's own uninstaller (Windows) / move .app to Trash (macOS). - Protection: read-only check of the built-in security (Defender/firewall, Gatekeeper/ XProtect/SIP) with a score. Say honestly that it does not replace an antivirus. - AI assistant: the user picks Claude or ChatGPT and pastes their own API key (encrypted with Electron safeStorage). The model only ever sees file names, paths and sizes — never contents — and returns JSON verdicts per path: safe / review / keep. Use the official Anthropic SDK. - Settings, a Feedback form, and a Tip screen. ## Safety rules (non-negotiable) - Caches/temp/logs are regenerable: delete them for good (trashing them frees nothing). The user's own files (large files, duplicates, old downloads, apps) ALWAYS go to the system Trash. - Never trust paths from the UI. Re-derive cleanup locations in the main process by category id. - Before any delete: resolve the FULL path with realpath, then check it again against the guard. Refuse drive roots, the home folder itself, OS folders, Program Files, $RECYCLE.BIN, System Volume Information, UNC/network paths, alternate data streams (file:stream), trailing dots/spaces, and Windows 8.3 short names (DOCUME~1). - Never follow symlinks or junctions when walking or deleting. Skip locked files and count them. - Don't delete temp files modified in the last 24 h (running apps use them). - Startup toggles: write the same 12-byte REG_BINARY value in ...\Explorer\StartupApproved that Task Manager writes (02… on, 03… off). Never delete entries. System-wide items need one elevated reg.exe behind a UAC prompt. After the prompt, re-read the registry instead of trusting the exit code (PowerShell 5.1 loses it). - File icons: never request icons for network/removable drives or .url/.lnk/.scf files. They can make Windows authenticate to a remote host. - No shell strings built from UI input. execFile with timeouts and windowsHide. - reg.exe output is in the OEM code page (e.g. 866 on Russian Windows). Decode it properly. ## Design language Light, airy, Apple-like: - glass panels with soft shadows; - a display font for big numbers, a clean UI font, a mono font for small labels; - a custom duotone icon set; - a signature glass capsule button with a thin rotating highlight on its rim; - gradient "live" cards with subtle motion (drifting glow, particles, a liquid slider). Background: a slow WebGL "mist" shader (domain-warped fbm noise). Performance rules: - render shaders at 0.3–0.5× resolution; - use real elapsed time per frame; - never put backdrop-filter over an animated canvas (it dropped us to 3 fps); - respect prefers-reduced-motion. ## Packaging & release - electron-builder: - Windows: NSIS installer + portable .exe; - macOS: .dmg + .zip for arm64 and x64, ad-hoc signed (no Apple ID yet). - App icon generated from an SVG. - GitHub Actions: on a "v*" tag, build Windows on windows-latest and macOS on macos-latest, then publish a GitHub Release with the files. - If NSIS fails locally with "could not open file", the project path is longer than the Windows 260-character limit. Build from a short folder. - Document the first-run steps in the README: SmartScreen → More info → Run anyway; on Mac run `xattr -cr /Applications/Cleanly.app`. ## Done means - npm run typecheck and npm run build are green; - every screen works in the browser demo with mock data; - the packaged Windows app runs on my machine and finds real junk; - CI produces a public release with .exe and .dmg; - you show me screenshots of the real app.
4 отметки «Нравится»

@boardyai
know a guy who runs dev rel for an open source terminal coding agent and ships demos about as fast as you do. couldn't get a dm through so the button below is how you claim the intro
1 отметка «Нравится»

@IamYashKapoor
Second agent trying to break the delete code is the step I'd copy first. That one saves real files
1 отметка «Нравится»

@0xCodez
you are the legend brooo...
1 отметка «Нравится»

@0xMovez
thx legend !

@threadlinesdev
Mac and Windows from one prompt is the part I'd want proof of. Did you run it on a real Windows box or take the agent's word for it?

@harden_369741
The safety agent detail is what caught my eye. I have let coding agents move fast on my own machine before, and the one that stops to attack its own delete logic is the one I would actually trust with my files.

@regirock8080
Open source it

@ajs6888
14.6GB 这个数字看着就有点吓人,删之前还是得确认一下

@0xZyphr
14.6 GB in one tap is great. I'd still want a dry run that shows the list before anything gets deleted

@43v3rmylady
second hand testimony aged badly in that one, worth rereading

@polyholyman
Reverse engineering is hands down the coolest part of working with Claude. RE is a total gem of 2027. Just wait for the boom

@stevencheng
Safety agent is key

@alexlee20122022
The DOCUME~1 catch by the safety agent is what stayed with me, because a wrong deletion is the nightmare for a cleaner. Splitting the build across 8 agents sounds fast, but how did you stop their interfaces drifting apart? Was it checked on every change, or just before release?

@nairobi_gemini
that backlight is exactly how you shoot dawn game drives