architecture
Skill9 starsChanged 8 months agoApache-2.0View on GitHub
Project architecture and file structure conventions for all process types. Use when: (1) Creating new files or modules, (2) Deciding where code should go, (3) Converting single-file components to directories, (4) Reviewing code for structure compliance, (5) Adding new bridges, services, agents, or workers.
136 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- lklimek/claudiustheir own version, first seen Nov 8, 2026
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- denormans/claude-code-workflowtheir own version, first seen Nov 8, 2026
- xiaoyangtx996/Searching-skilltheir own version, first seen Nov 8, 2026
Used with
Projects with it also use intelligent-routing, bash-linux and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 6 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 8 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 8 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
- +8 more from xenitV1
Other versions136 projects use a version of this.
Word for word · 1
- CES-Ltd/TitanX★ 47100% same
Edited · 2
- iOfficeAI/AionUi★ 34k84% same
- FerroxLabs/wayland★ 606100% same
Wrote their own version · 133
- anthropics/knowledge-work-plugins★ 35ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- nativewind/nativewind★ 8.1ksame name
- PaulWoitaschek/Voice★ 3.3ksame name
- wellwelwel/poku★ 1.2ksame name
- Alwurts/simple-ai★ 755same name
- patrickjaja/claude-desktop-extra★ 734same name
- ktnyt/cclsp★ 673same name
- matrixorigin/Memoria★ 624same name
123 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bump-versionSkill
- fix-issuesSkill
- fix-sentrySkill
- i18nSkill
- oss-prSkill
- pr-automationSkill
- pr-fixSkill
- pr-reviewSkill
- pr-shipSkill
- pr-verifySkill
- testingSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 117 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 111
Single file vs directory: If a component needs a private sub-component or hook, convert to a directory with index.tsx.
- Very specific: line 112
Page-private first: Start code in pages/<PageName>/.
- Very specific: line 124
When tests/unit/ exceeds 10 direct children, group into subdirectories matching source structure.
“Common” is measured: kept by at least 6 in 10 of the 117 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 & src/ layout (directory structure, migration status): references/project-layout.md
Decision Tree — Where Does New Code Go?
Is it UI (React components, hooks, pages)?
└── YES → src/renderer/ → see references/renderer.md
Is it an IPC handler responding to renderer calls?
└── YES → src/process/bridge/ → see references/process.md
Is it business logic running in the main process?
└── YES → src/process/services/ → see references/process.md
Is it an AI platform connection (API client, message protocol)?
└── YES → src/process/agent/<platform>/
Is it a background task that runs in a worker thread?
└── YES → src/process/worker/
Is it used by BOTH main and renderer processes?
└── YES → src/common/
Is it an HTTP/WebSocket endpoint?
└── YES → src/process/webserver/
Is it a plugin/extension resolver or loader?
└── YES → src/process/extensions/
Is it a messaging channel (Lark, DingTalk, Telegram)?
└── YES → src/process/channels/Process Boundary Rules
Hard rules — violating them causes runtime crashes.
| Process | Can use | Cannot use |
Main (src/process/) | Node.js, Electron main APIs, fs, path, child_process | DOM APIs (document, window, React) |
Renderer (src/renderer/) | DOM APIs, React, browser APIs | Node.js APIs (fs, path), Electron main APIs |
Worker (src/process/worker/) | Node.js APIs | DOM APIs, Electron APIs |
Preload (src/preload.ts) | contextBridge, ipcRenderer | DOM manipulation, Node.js fs |
Cross-process communication:
- Main ↔ Renderer: IPC via
src/preload.ts+src/process/bridge/*.ts - Main ↔ Worker: fork protocol via
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 preloadNaming Conventions
Directories
| Scope | Convention | Reason |
| Renderer component/module dirs | PascalCase | React convention — dir name = component name |
| Everything else | lowercase | Node.js convention |
| Categorical dirs (everywhere) | lowercase | components/, hooks/, utils/, services/ |
| Platform dirs (everywhere) | lowercase | acp/, codex/, gemini/ — cross-process consistency |
Quick test: "Inside
src/renderer/AND represents a specific component/feature (not a category)?" → PascalCase. Otherwise → lowercase.
Files
| Content | Convention | Examples |
| React components, classes | PascalCase | SettingsModal.tsx, CronService.ts |
| Hooks | camelCase with use prefix | useTheme.ts, useCronJobs.ts |
| Utilities, helpers | camelCase | formatDate.ts, cronUtils.ts |
| Entry points | index.ts / index.tsx | Required for directory-based modules |
| Config, types, constants | camelCase | types.ts, constants.ts |
| Styles | kebab-case or Name.module.css | chat-layout.css |
Structural Rules
- Directory size limit: Max 10 direct children. Split into subdirectories by responsibility when approaching.
- No single-file directories: Merge into parent or related directory.
- Single file vs directory: If a component needs a private sub-component or hook, convert to a directory with
index.tsx. - 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:
| Source | Test |
src/process/services/CronService.ts | tests/unit/cronService.test.ts |
src/renderer/hooks/ui/useAutoScroll.ts | tests/unit/useAutoScroll.dom.test.ts |
src/process/extensions/ExtensionLoader.ts | tests/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.tsentry 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.ts→coverage.exclude - New services separate pure logic from IO
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

