Skip to content

Commit 68d00a5

Browse files
committed
docs: update AGENTS.md to reflect current codebase state
1 parent 6f4f711 commit 68d00a5

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

AGENTS.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Composables get a `use` prefix. The file name matches the exported function name
5454

5555
**✅ ALWAYS IMPORT MANUALLY:**
5656

57-
- Shadcn UI: `import * as Select from '@/components/ui/shadcn/select'`
57+
- Shadcn UI: `import { Button } from '@/components/ui/shadcn/button'` or `import * as Select from '@/components/ui/shadcn/select'`
5858
- Composables: `import { useApp } from '@/composables'`
5959
- Utils: `import { cn } from '@/utils'`
6060
- VueUse: `import { useClipboard } from '@vueuse/core'`
@@ -78,7 +78,7 @@ Composables get a `use` prefix. The file name matches the exported function name
7878
### D. System & IPC
7979

8080
- **File System/System Ops:** Use `ipc.invoke('channel:action', data)`.
81-
- **Channels:** `fs:*`, `system:*`, `db:*`, `main-menu:*`, `prettier:*`, `spaces:*`.
81+
- **Channels:** `fs:*`, `system:*`, `db:*`, `main-menu:*`, `prettier:*`, `spaces:*`, `theme:*`.
8282
- **Renderer:** Access Electron only via `src/renderer/electron.ts`.
8383

8484
### E. Spaces Architecture
@@ -88,8 +88,9 @@ massCode uses a **Spaces** system to organize different functional areas:
8888
| Space | ID | Description |
8989
|-------|----|-------------|
9090
| Code | `code` | Main snippet management (folders, snippets, tags) |
91-
| Tools | `tools` | Developer utilities (converters, generators) |
91+
| Notes | `notes` | Notebook with folders, tags, and markdown notes |
9292
| Math | `math` | Math Notebook with calculation sheets |
93+
| Tools | `tools` | Developer utilities (converters, generators) |
9394

9495
**Space Definitions:** `src/renderer/spaceDefinitions.ts``SpaceId`, `getSpaceDefinitions()`, `getActiveSpaceId()`.
9596

@@ -107,7 +108,8 @@ massCode uses a **Spaces** system to organize different functional areas:
107108

108109
**Space-Aware Sync:**
109110
- `system:storage-synced` event dispatches refresh based on `getActiveSpaceId()`:
110-
- `code` / `null` → refresh folders + snippets
111+
- `code` → refresh folders + snippets
112+
- `notes` → refresh notes + note folders
111113
- `math``reloadFromDisk()` via `useMathNotebook()`
112114
- `tools` → no-op (no vault data)
113115
- Mutable operations must call `markPersistedStorageMutation()` to prevent sync loops.
@@ -119,6 +121,7 @@ massCode uses a **Spaces** system to organize different functional areas:
119121
- **Usage:** Use `i18n.t('namespace:key.path')` in both templates and scripts.
120122
- **Default Namespace:** The `ui` namespace is the default. You can use `i18n.t('key.path')` instead of `i18n.t('ui:key.path')`.
121123
- **Imports:** `import { i18n } from '@/electron'`
124+
- **After adding/changing locales:** Run `pnpm i18n:copy` to sync locale files.
122125

123126
## 6. UI/UX Guidelines
124127

@@ -133,7 +136,7 @@ massCode uses a **Spaces** system to organize different functional areas:
133136
- **NEVER** reimplement basic UI elements (buttons, inputs, checkboxes, etc.).
134137
- **ALWAYS** use existing components from `src/renderer/components/ui/`.
135138
- **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.
136-
- **Naming:** They are auto-imported with a `Ui` prefix (e.g., `<UiButton />`, `<UiInput />`, `<UiCheckbox />`).
139+
- **Naming:** They are auto-imported with a `Ui` prefix (e.g., `<UiInput />`, `<UiActionButton />`, `<UiText />`).
137140

138141
## 7. Component Decomposition
139142

@@ -154,6 +157,12 @@ Keep no logic in `<template>` more complex than a ternary operator.
154157
- **NEVER** run lint on the whole project during a task.
155158
- Usage: `pnpm lint <path>` or `pnpm lint:fix <path>`
156159

160+
**Testing:**
161+
162+
- **ALWAYS** scope test commands to specific files/dirs when working on a feature.
163+
- **NEVER** run tests on the whole project during a task.
164+
- Usage: `pnpm test <path>` or `pnpm test:watch <path>`
165+
157166
**Other Commands:**
158167

159168
- `pnpm dev`: Start dev server
@@ -166,6 +175,7 @@ Keep no logic in `<template>` more complex than a ternary operator.
166175

167176
```html
168177
<script setup lang="ts">
178+
import { Button } from '@/components/ui/shadcn/button' // Manual import
169179
import * as Dialog from '@/components/ui/shadcn/dialog' // Manual import
170180
import { useSnippets } from '@/composables' // Manual import
171181
@@ -175,13 +185,10 @@ const { snippets } = useSnippets()
175185

176186
<template>
177187
<div>
178-
<!-- Use auto-imported UI component -->
179-
<UiButton>Click me</UiButton>
180-
181-
<!-- Use Shadcn components with namespace -->
188+
<!-- Use Shadcn components -->
182189
<Dialog.Dialog>
183190
<Dialog.DialogTrigger as-child>
184-
<UiButton variant="outline">Open</UiButton>
191+
<Button variant="outline">Open</Button>
185192
</Dialog.DialogTrigger>
186193
<Dialog.DialogContent>
187194
Snippet count: {{ snippets.length }}

0 commit comments

Comments
 (0)