跨平台磁盘清理应用
- 播放
- 13.7万
- 点赞
- 1,236
- 评论
- 46
- 收藏
- 1,729
Cleanly 是一款开源的 macOS 和 Windows 磁盘清理工具,在 Claude Code 中用 Opus 5.5 构建。作者提供了提示词、CleanMyMac 截图和一段渐变视频,开发由多个并行代理完成,并另设安全审查代理。
完整提示词6,041 字符
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.
出处:作者在原帖下的回复。提示词保留原文语言,未做改写。
需自备参考素材:原作除了文字提示词,还用了图片、视频、音频、文档或代码库作为输入,本站未收录这些素材。只复制提示词得不到同样的结果。
作者提到的工具
Claude CodeElectronReactTypeScriptViteWebGLGitHub Actions
原帖:https://x.com/0xMovez/status/2115870373300326503
全部作品数据开源在 GitHub · awesome-opus-5.5-video。
模型归属以作者自述为准,本站未独立复现。播放量为 2026-10-31 的快照。作品版权归原作者,修改署名或下架请在 X 私信 @GoSailGlobal。