Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
iofficeai avatar

Architecture

  • 39 installs
  • 31.4k repo stars
  • Updated August 5, 2026
  • iofficeai/aionui

Decide where new code belongs in the AionUi Electron multi-process project using its file-structure conventions and decision tree.

About

Defines file placement and structure conventions for the AionUi Electron multi-process project across renderer, main, and shared layers. A developer uses it when creating new files, adding bridges/services/workers, or reviewing code for structure compliance.

  • Decision tree for where new code goes in an Electron multi-process project
  • References for renderer, main/shared process, and monorepo layout

Architecture by the numbers

  • 39 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #878 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/iofficeai/aionui --skill architecture

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs39
repo stars31.4k
Last updatedAugust 5, 2026
Repositoryiofficeai/aionui

What it does

Decide where new code belongs in the AionUi Electron multi-process project using its file-structure conventions and decision tree.

Files

SKILL.mdMarkdownGitHub ↗

Architecture Skill

Determine correct file placement and structure for an Electron multi-process project.

Detailed References

  • Renderer layer (components, hooks, utils, pages, CSS): references/renderer.md
  • Main process & shared layer (bridges, services, worker, preload): references/process.md
  • Project root & monorepo layout (directory structure, migration status): references/project-layout.md

---

Decision Tree — Where Does New Code Go?

Is it UI (React components, hooks, pages)?
  └── YES → packages/desktop/src/renderer/              → see references/renderer.md

Is it an IPC handler responding to renderer calls?
  └── YES → packages/desktop/src/process/bridge/        → see references/process.md

Is it business logic running in the main process?
  └── YES → packages/desktop/src/process/services/      → see references/process.md

Is it an AI platform connection (API client, message protocol)?
  └── YES → packages/desktop/src/process/agent/<platform>/

Is it a background task that runs in a worker thread?
  └── YES → packages/desktop/src/process/worker/

Is it used by BOTH main and renderer processes?
  └── YES → packages/desktop/src/common/

Is it an HTTP/WebSocket endpoint?
  └── YES → packages/desktop/src/process/webserver/

Is it a plugin/extension resolver or loader?
  └── YES → packages/desktop/src/process/extensions/

Is it a messaging channel (Lark, DingTalk, Telegram)?
  └── YES → packages/desktop/src/process/channels/

---

Process Boundary Rules

Hard rules — violating them causes runtime crashes.

ProcessCan useCannot use
Main (packages/desktop/src/process/)Node.js, Electron main APIs, fs, path, child_processDOM APIs (document, window, React)
Renderer (packages/desktop/src/renderer/)DOM APIs, React, browser APIsNode.js APIs (fs, path), Electron main APIs
Worker (packages/desktop/src/process/worker/)Node.js APIsDOM APIs, Electron APIs
Preload (packages/desktop/src/preload/)contextBridge, ipcRendererDOM manipulation, Node.js fs

Cross-process communication:

  • Main ↔ Renderer: IPC via packages/desktop/src/preload/ + packages/desktop/src/process/bridge/*.ts
  • Main ↔ Worker: fork protocol via packages/desktop/src/process/worker/WorkerProtocol.ts
// NEVER in renderer
import { something } from '@process/services/foo'; // crashes at runtime

// Use IPC instead
const result = await window.api.someMethod(); // goes through preload

---

Naming Conventions

Directories

ScopeConventionReason
Renderer component/module dirsPascalCaseReact convention — dir name = component name
Everything elselowercaseNode.js convention
Categorical dirs (everywhere)lowercasecomponents/, hooks/, utils/, services/
Platform dirs (everywhere)lowercaseacp/, codex/, gemini/ — cross-process consistency
Quick test: "Inside packages/desktop/src/renderer/ AND represents a specific component/feature (not a category)?" → PascalCase. Otherwise → lowercase.

Files

ContentConventionExamples
React components, classesPascalCaseSettingsModal.tsx, CronService.ts
HookscamelCase with use prefixuseTheme.ts, useCronJobs.ts
Utilities, helperscamelCaseformatDate.ts, cronUtils.ts
Entry pointsindex.ts / index.tsxRequired for directory-based modules
Config, types, constantscamelCasetypes.ts, constants.ts
Styleskebab-case or Name.module.csschat-layout.css

---

Structural Rules

1. Directory size limit: Max 10 direct children. Split into subdirectories by responsibility when approaching. 2. No single-file directories: Merge into parent or related directory. 3. Single file vs directory: If a component needs a private sub-component or hook, convert to a directory with index.tsx. 4. Page-private first: Start code in pages/<PageName>/. Promote to shared only when a second consumer appears.

Test File Mapping

Tests mirror source files in tests/ subdirectories:

SourceTest
packages/desktop/src/process/services/CronService.tstests/unit/cronService.test.ts
packages/desktop/src/renderer/hooks/ui/useAutoScroll.tstests/unit/useAutoScroll.dom.test.ts
packages/desktop/src/process/extensions/ExtensionLoader.tstests/unit/extensions/extensionLoader.test.ts

When tests/unit/ exceeds 10 direct children, group into subdirectories matching source structure.

---

Quick Checklist

  • [ ] Code is in the correct process directory (no cross-process imports)
  • [ ] Renderer code does not use Node.js APIs
  • [ ] Main process code does not use DOM APIs
  • [ ] New IPC channels are bridged through preload.ts
  • [ ] Renderer component/module dirs use PascalCase; categorical dirs use lowercase
  • [ ] Platform dirs use lowercase everywhere
  • [ ] Directory-based modules have index.tsx / index.ts entry point
  • [ ] Page-private code is under pages/<PageName>/, not in shared dirs
  • [ ] No single-file directories
  • [ ] No directory exceeds 10 direct children
  • [ ] New source files are auto-included in coverage — verify they are not accidentally excluded in vitest.config.tscoverage.exclude
  • [ ] New services separate pure logic from IO

Related skills

Documentationdocsfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.