Built for Claude Code, Cursor and Copilot

The Electron Boilerplate Your AI Agent Already Understands

Electron 41, React 19 and TypeScript, with 950 lines of rules your coding agent reads before it writes anything. Same request, same structure, with a test, every time. Measured against a plain scaffold: 83 percent consistent versus 61.

Claude Codeready CLAUDE.md950 lines Cursor Copilot
83%agent consistency 334files 45components 78tests passing 3OS · Win · Mac · Linux
01 why this exists

The second feature is where AI-built apps come apart

Feature one

Your agent builds it, it works, you ship. Nothing looks wrong yet.

Feature five

A second folder layout, a second way of doing IPC, and styling written from scratch again.

Feature twenty

Nobody can tell the agent where anything goes, including you, so every change turns into a rewrite.

That is not a coding problem, it is a conventions problem, and an empty project has no conventions to give. We measured it: the same agent, the same one-sentence request, three times, in a plain Electron scaffold produced three different architectures. In this repo it produced the same thirteen files every time.

what your agent reads first

Your agent reads 950 lines of rules before it writes a line of code

Not a README it might skim. A file Claude Code, Cursor and Copilot load first, that tells them where every kind of code goes in this repo.

CLAUDE.md
# CLAUDE.md — Instructions for Claude Code

> **Read this file before writing any code.** It defines
> the architecture, rules, and conventions for this
> project. **These rules override generic best
> practices.** When this file conflicts with a habit,
> follow this file.

⋮

## Common AI mistakes to avoid

These are the mistakes AI tools commonly make on this
codebase. Don't make them.

1. **Over-abstracting after one example.** If you write
   a function once, don't generalize it. Wait for a real
   second use case. The "rule of three" applies — extract
   on the third use, not the second.

2. **Adding unused exports.** If a function isn't
   imported anywhere, delete it. Don't "expose for
   future use." Dead exports rot.

3. **Generic catch-all error handling.** Don't
   `catch (e) { console.log(e) }`. Either handle the
   specific error meaningfully or let it bubble to the
   IPC boundary or ErrorBoundary.
CLAUDE.md: the opening rule, then the mistakes section 717 lines later. Wrapped to fit; the ⋮ marks the gap.
81
rows telling it where code goes

Four lookup tables covering screens, IPC channels, components, hooks and services. Your agent looks the answer up instead of inventing one.

19
named AI mistakes

A section called "Common AI mistakes to avoid" that lists them one at a time, from over-abstracting after a single example to claiming work is done before testing it.

2
generators instead of guesswork

npm run new:feature and npm run new:ipc write the wiring across all five places a feature touches, so your agent fills in logic rather than layout.

83%
structural consistency, measured

Same agent, same one-sentence request, three runs. Here it touched the same thirteen files every time. In a bare electron-vite scaffold: 61 percent, three different architectures, and no tests at all.

the stack, at the versions you get
Electron 41 React 19 TypeScript 5.9 Tailwind CSS 4 electron-vite 5 electron-builder 26 Radix UI Zod 4 i18next better-sqlite3 Vitest 4 Playwright Claude Agent SDK OpenAI SDK
02 what's inside

Every system you'd build yourself — already wired up

The first group is the one that matters if you build with an agent. The rest is the chassis it gets to build on.

Rules Your Agent Reads First

CLAUDE.md, 950 lines of it
It opens with "read this file before writing any code" and "these rules override generic best practices". Inside: 81 rows across four lookup tables saying where everything goes, 6 hard architecture rules, and a section called "Common AI mistakes to avoid" listing 19 of them by name.
Generators instead of guesswork
npm run new:feature and npm run new:ipc write the wiring across all five places a feature touches. Your agent fills in logic rather than inventing a layout.
Every message checked at the border
A Zod schema on every IPC channel. If the agent sends the wrong shape, it is rejected before it reaches a handler, and the failure is loud instead of silent.
TypeScript that refuses the sloppy version
Strict mode with no-unchecked-index. Three of the shortcuts an agent reaches for do not compile, so you find out in ten seconds instead of in a bug report.
78 tests as a tripwire
They run in under 4 seconds. When your agent changes something it did not mean to touch, that is how you hear about it.
45 components it can find
A Components screen showing every primitive, and one barrel to import from, so the agent reuses what exists instead of writing a fourth button.

Distribution & Auto-Update

Auto-update that was actually tested
electron-updater against GitHub Releases or any S3 compatible host (R2, B2, MinIO), switched with one env var. The download path is verified end to end on a packaged build, not assumed.
Windows installer in one command
npm run build:win produces an NSIS installer. Measured on a clean machine: 151 MB, installs in 22 seconds, first window 2.7 seconds later.
macOS notarization ready
Universal arm64 and x64 DMG with entitlements and the notarize step wired. Point CSC_LINK and the Apple API key at your certs.
Linux AppImage and .deb
Both formats from one command, with a proper .desktop entry. A GitHub Actions matrix builds all three on every v* tag.

Licensing & Activation

License activation, refusal included
Activate, deactivate, and reject an invalid key through one surface. The refusal path returns a reason, so your UI has something to show.
Keys encrypted by the OS
Stored through Electron safeStorage. Verified on the packaged app: the key does not appear in plaintext in any file under userData.
7 day offline grace
A validated license keeps working for 7 days without a network. Revalidation fails quietly rather than locking a paying user out on a plane.
Bring your own backend
The bundled provider accepts any key so you can build the screens first. Swap in your own by implementing one interface.

AI Inside the App

Claude Agent SDK and OpenAI
Both installed and demoed on their own screens, so your agent has a working example to copy rather than an API to guess at.
Streaming already parsed
The server-sent-events handling lives in the main process. In a component, a streaming answer is a for-await loop.
Keys that stay out of the renderer
API keys go through the same encrypted store as licenses. The rule is written into CLAUDE.md as mistake number 15, because it is the one agents make most.

The Desktop Chassis

Data that survives restarts
SQLite through better-sqlite3, with migrations and typed repositories, and a Notes screen showing the whole pattern end to end.
Sign-in without a backend rewrite
OAuth 2 with PKCE through the system browser, returning through a deep link. GitHub, Google and a generic provider ship working.
Native behaviour users expect
Tray icon, global shortcuts, a Cmd+K command palette that registers new screens automatically, drag and drop, recent files, auto-launch.
Themes and two languages
Light, dark and system over Tailwind 4 tokens, plus i18next with English and Spanish and type-safe keys.
Background jobs with progress
A job runner with progress reporting and cancellation, so long work does not freeze your window.

When Something Goes Wrong

Sandboxed renderer
contextIsolation and sandbox on by default. Your UI reaches the operating system only through channels you declared.
The update feed must be HTTPS
The build refuses to bake an http:// update URL. An intercepted update channel is remote code execution on every install you have shipped.
Crash recovery and a log viewer
The app restarts with window state intact, and an in-app Logs screen means a buyer can tell you what happened.
Diagnostics you can safely receive
One-click export with secrets, emails and file paths redacted before it leaves the machine.
Security scanning in CI
Electronegativity and an eslint security config run on every push and flag risky Electron patterns before merge.
03 see it running

Real screens, not mockups

Every screen below is the boilerplate running unmodified. Tap through the tour.

Desktop App Boilerplate
Electron Starter Template home screen with sidebar navigation Components gallery showing buttons, dialogs, popovers, and form controls A file statistics screen showing line, word and character counts Claude agent screen streaming a response inside the app AI screen with API key panel License key activation screen Notes screen backed by a local SQLite database Settings screen with theme switcher and language picker Sign-in screen showing the OAuth provider flow Batch screen showing background jobs with progress bars In-app logs viewer showing structured log lines About screen with auto-update status and diagnostics export

The app shell: sidebar navigation, 15 working screens, theme switcher, status bar The Components screen. 45 primitives your agent can find instead of rewriting A feature an agent added in this repo, following the existing pattern Claude Agent SDK running inside the desktop app API keys for OpenAI and Anthropic, encrypted and out of the renderer License activation, with the 7 day offline grace window Notes, backed by SQLite with migrations and typed repositories Settings: theme, language, telemetry consent, auto-launch, API keys OAuth 2 with PKCE through the system browser and a deep link callback Background jobs with progress reporting and cancellation The in-app log viewer, the first thing you want when a buyer reports a bug About, with the update channel and one-click redacted diagnostics

04 why not just…

This template vs. the alternatives

The middle column is measured, not guessed: the same AI agent, given the same request, three times, in a plain electron-vite scaffold instead of this repo.

Feature This template Build from scratch Generic boilerplate
Same structure when your agent builds the same feature twice 83% 61% ~
Agent writes a test without being asked (3 of 3 runs)
Agent leaves your app shell alone (3 of 3 runs) ~
Written rules the agent reads first 950 lines none a README
Generators that wire a new feature
Validated IPC on every channel
Auto-update, verified against a real feed
Code signing and notarization set up
License activation with offline grace
Themed UI components 45 write them some
SQLite with migrations and repositories
Tests covering the main process 78 yours to write few
Time to a running app ~30 seconds ~3 weeks ~1 week
05 who it's for

You'll get the most out of it if…

You build with Claude Code, Cursor or Copilot

You describe features rather than typing them. What you need is a codebase that tells your agent where things go, so the fiftieth feature still fits the first.

You have shipped web, never desktop

Installers, code signing, auto-update and licensing are all solved here. You do not have to learn which Electron edge cases matter before your first release.

You are building an AI tool that needs to be native

Local files, a long-running agent process, tray, notifications, real filesystem access. The Claude Agent SDK is already running on its own screen.

You are a small team adding a desktop app

One shared set of conventions that both your people and your agents follow, so the codebase does not fork into two styles in a month.

pricing

Buy it solo — or bundled and save

Just this boilerplate, or a bundle that unlocks the courses and every other boilerplate too.

Desktop App Boilerplate

Electron 41 + React 19 + TypeScript desktop app boilerplate built for Claude Code, Cursor and Copilot. 950 lines of rules your agent reads first, so feature fifty looks like feature one.

  • Desktop App Boilerplate $49
  • Lifetime access to all updates
$49 one-time
Get Desktop App Boilerplate
14-day money-back guarantee
★ Best value
Build With AI 1.0

The course + all 4 boilerplates.

  • Build With AI 1.0Course $149
  • Desktop App Boilerplate $49
  • Python MCP Server Boilerplate $79
  • Mobile App Boilerplate $59
  • Django Web App BoilerplateComing $49
  • Private Discord community $99
  • Lifetime access to all updates
Total value $484
$149 one-time
You save $335 (69%)
Get Build With AI 1.0
14-day money-back guarantee
Bundle
Solo Builder Complete

Every course, boilerplate, and product I build, in one bundle.

  • Build With AI 1.0Course $149
  • Self Hosting 2.0Course $69
  • Business Ideas LibraryComing $49
  • Desktop App Boilerplate $49
  • Python MCP Server Boilerplate $79
  • Mobile App Boilerplate $59
  • Django Web App BoilerplateComing $49
  • Private Discord community $99
  • Lifetime access to all updates
Total value $602
$199 one-time
You save $403 (67%)
Get Solo Builder Complete
14-day money-back guarantee
🔒 Secure checkout · Stripe & PayPal ⚡ Instant GitHub access
questions

Frequently asked questions

Does this actually change what my AI agent produces?

It changed it measurably. We gave Claude Code the same one-sentence request three times in this repo and three times in a plain electron-vite scaffold. Here it touched the same 13 files every run and wrote a unit test every run without being asked. In the bare scaffold it invented a different file layout each time, rewrote the app shell each time, and wrote no tests at all. Both versions worked; only one of them would still make sense at feature twenty.

Do I need to be able to code?

You need to be able to read code well enough to tell when something looks wrong, and to describe what you want clearly. You do not need to write React or learn Electron. The docs on this site are written for that: each step is the prompt to give your agent, what it should have touched, and how to check it worked, with the code shown afterwards for when you want to read it.

What exactly do I get?

An invite to a private GitHub repository with the full source: 334 tracked files, 45 UI components, 15 working screens, 78 passing tests, 19 reference docs, and the 950-line CLAUDE.md your agent reads. Clone it, run npm run rebrand, ship under your own name. Repo access is for the life of the product, so updates arrive with git pull.

Is it slower to work in a big codebase like this?

Yes, slightly, and the number is worth knowing: across three runs the agent took about 32 percent longer per feature here than in an empty scaffold, because it reads the conventions first. You are trading a couple of minutes per feature for not having four architectures by the end of the month.

How long until I see it running?

Measured on a fresh clone: git clone 4.7 seconds, npm install 25 seconds on a warm npm cache, npm run setup under a second, and the window opens 2.3 seconds after npm run dev. A first ever install takes a few minutes longer because Electron downloads its own runtime.

Electron vs Tauri: why does this template use Electron?

Tauri produces smaller binaries. Electron wins when you want the Node ecosystem without writing Rust: better-sqlite3, electron-updater, electron-store and the Claude Agent SDK all work immediately, and there is far more training data for your agent to draw on. This template runs Electron 41 with sandbox and contextIsolation on by default.

How do updates reach my customers?

electron-updater is wired for GitHub Releases, which needs one env var, or any S3 compatible host such as Cloudflare R2, Backblaze B2 or MinIO. npm run publish uploads the artifacts and the feed. The docs walk through verifying the first release, because an update feed pointing at the wrong filename fails silently.

What do I need for code signing?

For Windows, an Authenticode certificate from a CA such as SSL.com or DigiCert, around $200 a year. For macOS, an Apple Developer account at $99 a year. The signing and notarization scripts are already in the build. Unsigned builds run fine while you develop.

Can I ship a commercial app with it?

Yes. The license is a single-app commercial license: one commercial desktop app per purchase, priced however you like, and you keep all the revenue. A second product needs a second license.

Is there a refund policy?

Yes. If it does not work for you, email me within 14 days for a full refund. No questions asked.

Give your agent a codebase with opinions.

$49 once. Lifetime updates. One commercial app.

Get Desktop App Boilerplate →