Skip to content

Commit 0348053

Browse files
committed
docs: update AGENTS & add CLAUDE as symlink
1 parent 7852d1a commit 0348053

2 files changed

Lines changed: 36 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ Follow these rules strictly when generating code for massCode.
1212
- **Backend:** Electron (Main), `better-sqlite3` (DB), Elysia.js (API)
1313
- **Utilities:** `@vueuse/core`, `vue-sonner` (Notifications)
1414

15-
## 2. Architecture & Communication
15+
## 2. Philosophy
16+
17+
**YAGNI — simplicity above all.** Do not overcomplicate code for hypothetical future scenarios. The minimum viable implementation is the correct implementation. Three similar lines of code are better than a premature abstraction.
18+
19+
Signs of overengineering:
20+
- A function guards against a case that will never happen
21+
- A factory used in exactly one place that doesn't encapsulate state
22+
- Abstraction for its own sake (a wrapper around a single line of code)
23+
- Constants or patterns invented in advance without a real need
24+
25+
## 3. Architecture & Communication
1626

1727
**Strict Separation of Concerns:**
1828

@@ -24,7 +34,16 @@ Follow these rules strictly when generating code for massCode.
2434

2535
**Data Flow:** Renderer → REST API (Elysia) → Service/DB Layer → Response
2636

27-
## 3. Critical Rules & Conventions
37+
## 4. File Naming
38+
39+
| Type | Convention | Example |
40+
|------|------------|---------|
41+
| Vue components | PascalCase | `Folders.vue`, `CreateDialog.vue` |
42+
| TypeScript files | camelCase | `useSnippets.ts`, `errorMessage.ts` |
43+
44+
Composables get a `use` prefix. The file name matches the exported function name: `useSnippets.ts``export function useSnippets()`.
45+
46+
## 5. Critical Rules & Conventions
2847

2948
### A. Imports (STRICT)
3049

@@ -70,7 +89,7 @@ Follow these rules strictly when generating code for massCode.
7089
- **Default Namespace:** The `ui` namespace is the default. You can use `i18n.t('key.path')` instead of `i18n.t('ui:key.path')`.
7190
- **Imports:** `import { i18n } from '@/electron'`
7291

73-
## 4. UI/UX Guidelines
92+
## 6. UI/UX Guidelines
7493

7594
- **Variants:** Use `cva` for component variants.
7695
- **Classes:** Use `cn()` to merge Tailwind classes.
@@ -85,7 +104,18 @@ Follow these rules strictly when generating code for massCode.
85104
- **Missing Elements:** If a required UI element does not exist, create it in `src/renderer/components/ui/` first, following established patterns (Tailwind, cva, cn), then use it.
86105
- **Naming:** They are auto-imported with a `Ui` prefix (e.g., `<UiButton />`, `<UiInput />`, `<UiCheckbox />`).
87106

88-
## 5. Development Workflow & Commands
107+
## 7. Component Decomposition
108+
109+
Split a component when it exceeds ~300 lines or has more than 3 unrelated responsibilities:
110+
111+
1. Extract constants and static data
112+
2. Extract pure functions into utils (only if used in multiple places)
113+
3. Move state and effects into a composable
114+
4. Break the template into child components
115+
116+
Keep no logic in `<template>` more complex than a ternary operator.
117+
118+
## 8. Development Workflow & Commands
89119

90120
**Linting (CRITICAL):**
91121

@@ -99,7 +129,7 @@ Follow these rules strictly when generating code for massCode.
99129
- `pnpm api:generate`: Regenerate API client (required after API changes)
100130
- `pnpm build`: Build for production
101131

102-
## 6. Code Examples
132+
## 9. Code Examples
103133

104134
**Component Setup:**
105135

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)