create-nala 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/.agents/skills/nala-project/SKILL.md +24 -20
- package/template/AGENTS.md +114 -14
- package/template/CLAUDE.md +83 -13
- package/template/GEMINI.md +83 -13
- package/template/package.json +1 -1
- package/template/src/components/BrandIcon.vue +258 -0
- package/template/src/components.d.ts +1 -0
- package/template/src/layouts/AuthSplitLayout.vue +216 -0
- package/template/src/router/index.ts +100 -0
- package/template/src/style.css +0 -2
- package/template/src/views/auth/LockScreenView.vue +1 -1
- package/template/src/views/auth/MagicLinkView.vue +278 -0
- package/template/src/views/auth/SelectTenantView.vue +673 -0
- package/template/src/views/auth/SsoLoginView.vue +337 -0
- package/template/src/views/auth/SuspendedView.vue +341 -0
- package/template/src/views/auth/TwoFactorChallengeView.vue +307 -0
package/package.json
CHANGED
|
@@ -18,19 +18,20 @@ You are an expert frontend engineer building features for this **Nala Admin Dash
|
|
|
18
18
|
## 🏗️ Project Structure
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
src/
|
|
22
21
|
├── components/
|
|
23
22
|
│ ├── AppLogo.vue ← Auto-imported brand logo component
|
|
23
|
+
│ ├── BrandIcon.vue ← Auto-imported 24+ brand & social SVG icons
|
|
24
24
|
│ ├── EmptyState.vue ← Auto-imported zero-data empty state component
|
|
25
25
|
│ ├── PageHeader.vue ← Auto-imported standard page top header
|
|
26
26
|
│ ├── layout/ ← AdminLayout sub-components (Navbar, Sidebar, etc.)
|
|
27
|
-
│ └── ui/ ←
|
|
27
|
+
│ └── ui/ ← 46 Reka UI primitives (all auto-imported)
|
|
28
28
|
├── composables/
|
|
29
29
|
│ ├── useFormatter.ts ← Auto-imported: currency, date, number, relative time formatting
|
|
30
30
|
│ └── useThemeConfig.ts ← Auto-imported: layout mode, border radius, accent color
|
|
31
31
|
├── layouts/
|
|
32
32
|
│ ├── AdminLayout.vue ← Main dashboard shell (sidebar + navbar + content slot)
|
|
33
|
-
│
|
|
33
|
+
│ ├── AuthLayout.vue ← Centered auth card layout
|
|
34
|
+
│ └── AuthSplitLayout.vue ← Split-screen side-banner auth layout
|
|
34
35
|
├── lib/
|
|
35
36
|
│ ├── axios.ts ← Pre-configured Axios instance with interceptors
|
|
36
37
|
│ ├── formatters.ts ← Core formatter functions (used by useFormatter)
|
|
@@ -49,7 +50,7 @@ src/
|
|
|
49
50
|
└── views/
|
|
50
51
|
├── _starter/
|
|
51
52
|
│ └── BlankView.vue ← Scaffolding starting point for new pages
|
|
52
|
-
├── auth/ ← Full auth suite (Login, Register,
|
|
53
|
+
├── auth/ ← Full enterprise auth suite (Login, Register, 2FA, SSO, Magic Link, etc.)
|
|
53
54
|
├── dashboard/
|
|
54
55
|
│ └── IndexView.vue ← Minimal dashboard with KPI stat cards (your starting point)
|
|
55
56
|
└── errors/ ← 404, 500, 403, Maintenance, Coming Soon pages
|
|
@@ -79,18 +80,21 @@ src/
|
|
|
79
80
|
|
|
80
81
|
## 🛑 Strict Guardrails (MUST FOLLOW)
|
|
81
82
|
|
|
82
|
-
1. **
|
|
83
|
-
2. **
|
|
84
|
-
3. **
|
|
85
|
-
4. **
|
|
86
|
-
5. **
|
|
87
|
-
6. **No
|
|
88
|
-
7. **No
|
|
89
|
-
8. **No
|
|
90
|
-
9. **
|
|
91
|
-
10. **
|
|
83
|
+
1. **Direct & Fluff-Free Responses (Token Efficiency):** Never use conversational filler, pleasantries, apologies, or verbose preambles. Deliver concise, direct, and actionable technical deliverables to conserve tokens.
|
|
84
|
+
2. **Surgical & Focused Edits:** Only modify files directly related to the user's explicit request. Do not arbitrarily refactor untouched files.
|
|
85
|
+
3. **Composition API Only:** Never use Options API — always use `<script setup lang="ts">`.
|
|
86
|
+
4. **Strict TypeScript:** No `any` type — define explicit TypeScript interfaces for all props, emits, and API payloads.
|
|
87
|
+
5. **English Standard:** All user-facing UI text, form labels, placeholders, error messages, toast notifications, and in-code comments **MUST be in English**.
|
|
88
|
+
6. **No Build Commands:** NEVER run `pnpm build` or `npm run build` autonomously. Build only on explicit user request.
|
|
89
|
+
7. **No Automatic Tests:** NEVER run `vitest`, `pnpm test`, or `pnpm test:run` autonomously.
|
|
90
|
+
8. **No Git Operations:** NEVER run `git add`, `git commit`, or `git push` autonomously.
|
|
91
|
+
9. **No New Packages Without Confirmation:** Always ask in chat before running `pnpm add` or `npm install`.
|
|
92
|
+
10. **Semantic Color & Token System:** NEVER use arbitrary palette classes like `text-gray-500` or `bg-blue-600`. ALWAYS use semantic tokens: `bg-background`, `bg-card`, `bg-primary`, `text-foreground`, `text-muted-foreground`, `border-border`.
|
|
93
|
+
11. **No Scoped CSS:** Use Tailwind utility classes. Do not write `<style scoped>`.
|
|
94
|
+
12. **Dialog Accessibility:** Every `DialogContent` MUST include `DialogTitle` and `DialogDescription` (use `sr-only` if visually hidden) to comply with Reka UI ARIA standards.
|
|
95
|
+
13. **Tailwind CSS v4 Strict Syntax Compliance:**
|
|
92
96
|
- **Gradients:** ALWAYS use `bg-linear-to-r`, `bg-linear-to-b`, `bg-linear-to-tr` (NEVER `bg-gradient-to-*`).
|
|
93
|
-
- **Sizing:** NEVER use arbitrary brackets like `max-w-[170px]`, `w-[300px]`, `p-[1px]`. Use Tailwind v4 scale (`max-w-44`, `w-75`, `p-px`).
|
|
97
|
+
- **Sizing:** NEVER use arbitrary brackets like `max-w-[170px]`, `w-[300px]`, `p-[1px]`. Use Tailwind v4 scale (`max-w-44`, `w-75`, `p-px`, `size-4` / `size-3.5` for icons).
|
|
94
98
|
- **Shadows:** Use `shadow-2xs`, `shadow-xs`, `shadow-sm`, `shadow-md`, `shadow-lg`.
|
|
95
99
|
- **Viewport:** Use `min-h-dvh` / `h-dvh` instead of `min-h-screen` / `h-screen`.
|
|
96
100
|
- **Opacity:** Use integer percentage (`bg-primary/50`) NOT decimal (`bg-primary/0.5`).
|
|
@@ -108,7 +112,7 @@ src/
|
|
|
108
112
|
| **VueUse** (`useColorMode`, `useLocalStorage`, `useDebounceFn`, etc.) | ✅ **AUTOMATIC** | Use directly: `const mode = useColorMode()` |
|
|
109
113
|
| **Pinia** (`defineStore`, `storeToRefs`) | ✅ **AUTOMATIC** | Use directly: `defineStore(...)` |
|
|
110
114
|
| **All UI Components** (`Button`, `Card`, `Dialog`, `Input`, `InputGroup`, `Table`, `Tabs`, etc.) | ✅ **AUTOMATIC** | Use directly in template: `<Card>`, `<Button>`, `<InputGroup>` |
|
|
111
|
-
| **Shared Components** (`PageHeader`, `EmptyState`, `AppLogo`) | ✅ **AUTOMATIC** | Use directly: `<PageHeader>`, `<EmptyState>` |
|
|
115
|
+
| **Shared Components** (`PageHeader`, `EmptyState`, `AppLogo`, `BrandIcon`) | ✅ **AUTOMATIC** | Use directly: `<PageHeader>`, `<EmptyState>`, `<BrandIcon>` |
|
|
112
116
|
| **Custom Composables** (`useFormatter`, `useThemeConfig`) | ✅ **AUTOMATIC** | Use directly: `const fmt = useFormatter()` |
|
|
113
117
|
| **Lucide Icons** (`Plus`, `Search`, `Trash2`, etc.) | ⚠️ **MANUAL IMPORT** | `import { Plus, Search } from '@lucide/vue'` |
|
|
114
118
|
| **Toast Notifications** (`toast`) | ⚠️ **MANUAL IMPORT** | `import { toast } from '@/components/ui/sonner'` |
|
|
@@ -129,7 +133,7 @@ Always use `<PageHeader>` at the top of every view — never build a custom head
|
|
|
129
133
|
>
|
|
130
134
|
<template #actions>
|
|
131
135
|
<Button size="sm" class="gap-1.5" @click="isDialogOpen = true">
|
|
132
|
-
<Plus class="
|
|
136
|
+
<Plus class="size-3.5" />
|
|
133
137
|
Add Product
|
|
134
138
|
</Button>
|
|
135
139
|
</template>
|
|
@@ -161,7 +165,7 @@ Never write manual `absolute` positioning for input icons:
|
|
|
161
165
|
<!-- Search icon input -->
|
|
162
166
|
<InputGroup>
|
|
163
167
|
<InputIcon side="left">
|
|
164
|
-
<Search class="
|
|
168
|
+
<Search class="size-3.5" />
|
|
165
169
|
</InputIcon>
|
|
166
170
|
<Input v-model="searchQuery" placeholder="Search..." class="pl-8 h-8 text-xs" />
|
|
167
171
|
</InputGroup>
|
|
@@ -186,13 +190,13 @@ Never write manual `absolute` positioning for input icons:
|
|
|
186
190
|
<CardContent class="p-5 space-y-2">
|
|
187
191
|
<div class="flex items-center justify-between">
|
|
188
192
|
<span class="text-xs font-medium text-muted-foreground">{{ stat.title }}</span>
|
|
189
|
-
<component :is="stat.icon" class="
|
|
193
|
+
<component :is="stat.icon" class="size-4 text-primary" />
|
|
190
194
|
</div>
|
|
191
195
|
<div class="text-2xl font-bold tracking-tight">{{ stat.value }}</div>
|
|
192
196
|
<p class="text-xs text-muted-foreground flex items-center gap-1">
|
|
193
197
|
<span class="font-semibold inline-flex items-center gap-0.5"
|
|
194
198
|
:class="stat.positive ? 'text-emerald-500' : 'text-rose-500'">
|
|
195
|
-
<component :is="stat.positive ? ArrowUpRight : ArrowDownRight" class="
|
|
199
|
+
<component :is="stat.positive ? ArrowUpRight : ArrowDownRight" class="size-3.5" />
|
|
196
200
|
{{ stat.change }}
|
|
197
201
|
</span>
|
|
198
202
|
<span>{{ stat.changeLabel }}</span>
|
package/template/AGENTS.md
CHANGED
|
@@ -2,21 +2,95 @@
|
|
|
2
2
|
|
|
3
3
|
> This document defines the strict architectural standards and rules for AI coding assistants (Antigravity, Cursor, Claude Code, GitHub Copilot, Roo Code, Windsurf) working on this **Nala** application.
|
|
4
4
|
|
|
5
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
6
|
+
|
|
7
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
8
|
+
|
|
9
|
+
## 1. Think Before Coding
|
|
10
|
+
|
|
11
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
12
|
+
|
|
13
|
+
Before implementing:
|
|
14
|
+
|
|
15
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
16
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
17
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
18
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
19
|
+
|
|
20
|
+
## 2. Simplicity First
|
|
21
|
+
|
|
22
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
23
|
+
|
|
24
|
+
- No features beyond what was asked.
|
|
25
|
+
- No abstractions for single-use code.
|
|
26
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
27
|
+
- No error handling for impossible scenarios.
|
|
28
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
29
|
+
|
|
30
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
31
|
+
|
|
32
|
+
## 3. Surgical Changes
|
|
33
|
+
|
|
34
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
35
|
+
|
|
36
|
+
When editing existing code:
|
|
37
|
+
|
|
38
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
39
|
+
- Don't refactor things that aren't broken.
|
|
40
|
+
- Match existing style, even if you'd do it differently.
|
|
41
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
42
|
+
|
|
43
|
+
When your changes create orphans:
|
|
44
|
+
|
|
45
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
46
|
+
- Don't remove pre-existing dead code unless asked.
|
|
47
|
+
|
|
48
|
+
The test: Every changed line should trace directly to the user's request.
|
|
49
|
+
|
|
50
|
+
## 4. Goal-Driven Execution
|
|
51
|
+
|
|
52
|
+
**Define success criteria. Loop until verified.**
|
|
53
|
+
|
|
54
|
+
Transform tasks into verifiable goals:
|
|
55
|
+
|
|
56
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
57
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
58
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
59
|
+
|
|
60
|
+
For multi-step tasks, state a brief plan:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
1. [Step] → verify: [check]
|
|
64
|
+
2. [Step] → verify: [check]
|
|
65
|
+
3. [Step] → verify: [check]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
73
|
+
|
|
5
74
|
---
|
|
6
75
|
|
|
7
76
|
## 🛑 Strict Rules (MUST FOLLOW)
|
|
8
77
|
|
|
9
|
-
1. **
|
|
10
|
-
2. **
|
|
11
|
-
3. **
|
|
12
|
-
4. **
|
|
78
|
+
1. **Direct & Fluff-Free Responses (Token Efficiency):** Do not use conversational filler, pleasantries, apologies, or verbose preambles. Deliver direct, concise, and technically focused answers and code diffs to conserve tokens.
|
|
79
|
+
2. **Surgical & Focused Edits:** Only modify files directly related to the developer's explicit request. Do not arbitrarily refactor untouched files.
|
|
80
|
+
3. **Strict Composition API:** ALWAYS use `<script setup lang="ts">`. NEVER use the Options API.
|
|
81
|
+
4. **Strict TypeScript Hygiene:** NEVER use `any`. Always define explicit TypeScript interfaces for props, emits, and API payloads.
|
|
82
|
+
5. **English Standard:** All user-facing UI text, form labels, error messages, toast notifications, and in-code comments (JSDoc/inline notes) MUST be written in **English**.
|
|
83
|
+
6. **Auto-Import Awareness:** Do NOT manually import Vue reactivity (`ref`, `computed`, `watch`, `onMounted`), Vue Router (`useRouter`, `useRoute`), Pinia (`defineStore`), or UI Primitives (`Button`, `Card`, `Dialog`, etc.) — they are auto-imported. Only explicitly import Lucide icons, `toast` (`@/components/ui/sonner`), `apiClient`, and `zod`.
|
|
84
|
+
7. **Semantic Color & Token System:** NEVER use arbitrary palette classes like `text-gray-500` or `bg-blue-600`. ALWAYS use semantic tokens: `bg-background`, `bg-card`, `bg-primary`, `text-foreground`, `text-muted-foreground`, `border-border`.
|
|
85
|
+
8. **Tailwind CSS v4 Compliance:**
|
|
13
86
|
- **Gradients:** ALWAYS use `bg-linear-to-r`, `bg-linear-to-b`, `bg-linear-to-tr` (NEVER use legacy v3 `bg-gradient-to-*`).
|
|
14
|
-
- **Sizing Scale:** NEVER write arbitrary bracket sizing like `max-w-[170px]`, `w-[300px]`, or `p-[1px]`. ALWAYS use Tailwind v4 scale (`max-w-44`, `max-w-28`, `w-75`, `max-h-75`, `p-px`).
|
|
87
|
+
- **Sizing Scale:** NEVER write arbitrary bracket sizing like `max-w-[170px]`, `w-[300px]`, or `p-[1px]`. ALWAYS use Tailwind v4 scale (`max-w-44`, `max-w-28`, `w-75`, `max-h-75`, `p-px`, `size-4` / `size-5` for icons).
|
|
15
88
|
- **Shadows:** Use `shadow-2xs`, `shadow-xs`, `shadow-sm`, `shadow-md`, `shadow-lg`.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
89
|
+
9. **No Scoped Styles:** Use Tailwind CSS utility classes instead of `<style scoped>`.
|
|
90
|
+
10. **Package Installation:** NEVER install new npm packages autonomously. Always ask the developer for confirmation before running `pnpm add` or `npm install`.
|
|
91
|
+
11. **Dialog Accessibility:** Every `DialogContent` MUST include `DialogTitle` and `DialogDescription` (use `sr-only` if visually hidden) to comply with Reka UI ARIA standards.
|
|
92
|
+
12. **No Automatic Builds / Tests:** Do not run `pnpm build`, `npm run build`, `vitest`, or `pnpm test` autonomously after code generation unless explicitly instructed.
|
|
93
|
+
13. **No Unauthorized Git Operations:** NEVER run `git add`, `git commit`, or `git push` autonomously. Git commands are strictly executed only upon explicit user instruction.
|
|
20
94
|
|
|
21
95
|
---
|
|
22
96
|
|
|
@@ -31,6 +105,7 @@ The following modules are auto-imported via `unplugin-auto-import` and `unplugin
|
|
|
31
105
|
| VueUse (`useColorMode`, `useLocalStorage`, etc.) | ✅ Yes | Use directly: `const mode = useColorMode()` |
|
|
32
106
|
| Pinia (`defineStore`, `storeToRefs`) | ✅ Yes | Use directly: `defineStore(...)` |
|
|
33
107
|
| UI Components (`Button`, `Card`, `Dialog`, `Input`, `Table`, etc.) | ✅ Yes | Use directly in template: `<Button>`, `<Card>` |
|
|
108
|
+
| Shared Components (`PageHeader`, `EmptyState`, `AppLogo`, `BrandIcon`) | ✅ Yes | Use directly in template: `<PageHeader>`, `<BrandIcon name="google" />` |
|
|
34
109
|
| Lucide Icons (`Plus`, `Search`, `Trash2`, etc.) | ⚠️ **No** | `import { Plus, Search } from '@lucide/vue'` |
|
|
35
110
|
| Toast Notifications (`toast`) | ⚠️ **No** | `import { toast } from '@/components/ui/sonner'` |
|
|
36
111
|
| API Client (`apiClient`) | ⚠️ **No** | `import { apiClient } from '@/lib/axios'` |
|
|
@@ -40,10 +115,35 @@ The following modules are auto-imported via `unplugin-auto-import` and `unplugin
|
|
|
40
115
|
|
|
41
116
|
## 📦 UI Primitives Catalog (`src/components/ui/`)
|
|
42
117
|
|
|
43
|
-
All
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
118
|
+
All 46 primitive components in `src/components/ui/` are globally registered and ready to use:
|
|
119
|
+
- `Accordion`, `Alert`, `AlertDialog`, `Avatar`, `Badge`, `Breadcrumb`, `Button`, `Calendar`
|
|
120
|
+
- `Card`, `Chart`, `Checkbox`, `Collapsible`, `Command`, `ContextMenu`, `DatePicker`, `Dialog`
|
|
121
|
+
- `DropdownMenu`, `Editor` (`RichTextEditor`), `Form` (`FormField`, `FormItem`, `FormLabel`, `FormControl`, `FormMessage`)
|
|
122
|
+
- `HoverCard`, `Input`, `Kbd`, `Label`, `LoadingBar`, `Pagination`, `PinInput`, `Popover`, `Progress`
|
|
123
|
+
- `RadioGroup`, `ScrollArea`, `Select`, `Separator`, `Sheet`, `Sidebar`, `Skeleton`, `Slider`
|
|
124
|
+
- `Sonner` (`toast`), `Stepper`, `Switch`, `Table`, `Tabs`, `Textarea`, `Timeline`, `Toggle`, `ToggleGroup`, `Tooltip`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 🚀 Standard Development Workflow (New Features & Scaffolding)
|
|
129
|
+
|
|
130
|
+
When building new features or views in this application:
|
|
131
|
+
|
|
132
|
+
1. **New Views & Pages:**
|
|
133
|
+
- Create new views under `src/views/<feature>/<Feature>View.vue`.
|
|
134
|
+
- Use `src/views/_starter/BlankView.vue` as the canonical starting point.
|
|
135
|
+
- Always start pages with `<PageHeader title="..." description="..." />`.
|
|
136
|
+
- Use `<EmptyState />` inside table or card bodies when data is empty.
|
|
137
|
+
2. **Routing Integration:**
|
|
138
|
+
- Register routes in `src/router/index.ts` under the appropriate layout:
|
|
139
|
+
- Authenticated dashboard views ➔ child of `AdminLayout` (`/`).
|
|
140
|
+
- Public / auth views ➔ child of `AuthLayout` or `AuthSplitLayout` (`/auth/*`).
|
|
141
|
+
3. **Navigation Links:**
|
|
142
|
+
- Add menu items into `src/components/layout/AppSidebar.vue` inside the relevant navigation section.
|
|
143
|
+
4. **Service & State Management:**
|
|
144
|
+
- Place typed API methods in `src/services/<feature>.service.ts` using `apiClient` (`@/lib/axios`).
|
|
145
|
+
- Create Pinia Setup Stores in `src/stores/<feature>.ts` (`defineStore('name', () => { ... })`).
|
|
146
|
+
|
|
147
|
+
---
|
|
48
148
|
|
|
49
149
|
For deep blueprints on adding new features and services, see [`.agents/skills/nala-project/SKILL.md`](./.agents/skills/nala-project/SKILL.md).
|
package/template/CLAUDE.md
CHANGED
|
@@ -1,27 +1,97 @@
|
|
|
1
1
|
# CLAUDE.md — Nala Application AI Guardrails
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
4
|
+
|
|
5
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
6
|
+
|
|
7
|
+
## 1. Think Before Coding
|
|
8
|
+
|
|
9
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
10
|
+
|
|
11
|
+
Before implementing:
|
|
12
|
+
|
|
13
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
14
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
15
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
16
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
17
|
+
|
|
18
|
+
## 2. Simplicity First
|
|
19
|
+
|
|
20
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
21
|
+
|
|
22
|
+
- No features beyond what was asked.
|
|
23
|
+
- No abstractions for single-use code.
|
|
24
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
25
|
+
- No error handling for impossible scenarios.
|
|
26
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
27
|
+
|
|
28
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
29
|
+
|
|
30
|
+
## 3. Surgical Changes
|
|
31
|
+
|
|
32
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
33
|
+
|
|
34
|
+
When editing existing code:
|
|
35
|
+
|
|
36
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
37
|
+
- Don't refactor things that aren't broken.
|
|
38
|
+
- Match existing style, even if you'd do it differently.
|
|
39
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
40
|
+
|
|
41
|
+
When your changes create orphans:
|
|
42
|
+
|
|
43
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
44
|
+
- Don't remove pre-existing dead code unless asked.
|
|
45
|
+
|
|
46
|
+
The test: Every changed line should trace directly to the user's request.
|
|
47
|
+
|
|
48
|
+
## 4. Goal-Driven Execution
|
|
49
|
+
|
|
50
|
+
**Define success criteria. Loop until verified.**
|
|
51
|
+
|
|
52
|
+
Transform tasks into verifiable goals:
|
|
53
|
+
|
|
54
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
55
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
56
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
57
|
+
|
|
58
|
+
For multi-step tasks, state a brief plan:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
1. [Step] → verify: [check]
|
|
62
|
+
2. [Step] → verify: [check]
|
|
63
|
+
3. [Step] → verify: [check]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
4
71
|
|
|
5
72
|
---
|
|
6
73
|
|
|
7
74
|
## 🛑 Strict Rules (Enforced on Every Invocation)
|
|
8
75
|
|
|
9
|
-
1. **
|
|
10
|
-
2. **
|
|
11
|
-
3. **No
|
|
12
|
-
4. **
|
|
13
|
-
5. **
|
|
14
|
-
6. **
|
|
15
|
-
|
|
16
|
-
|
|
76
|
+
1. **Direct & Fluff-Free Responses (Token Efficiency):** Never use conversational filler, pleasantries, apologies, or verbose preambles. Deliver concise, direct, and actionable technical deliverables to conserve tokens.
|
|
77
|
+
2. **Surgical & Focused Edits:** Only modify files directly related to the user's explicit request. Do not arbitrarily refactor untouched files.
|
|
78
|
+
3. **No Automatic Build / Tests:** NEVER run `pnpm build`, `npm run build`, `vitest`, or `pnpm test` autonomously.
|
|
79
|
+
4. **No Unauthorized Git Operations:** NEVER run `git add`, `git commit`, or `git push` autonomously.
|
|
80
|
+
5. **English Standard (UI & Code Comments):** All UI strings, form labels, validation/error messages, toasts, and in-code comments MUST be in **English**.
|
|
81
|
+
6. **Strict Vue 3 & TypeScript Hygiene:** Always use Composition API `<script setup lang="ts">`. Never use Options API or `any`. Define strict TypeScript interfaces for all props, emits, and API payloads.
|
|
82
|
+
7. **Auto-Import Awareness:** Do NOT manually import Vue reactivity (`ref`, `computed`, `watch`, `onMounted`), Vue Router (`useRouter`, `useRoute`), Pinia (`defineStore`), or UI Primitives (`Button`, `Card`, `Dialog`, etc.) — they are auto-imported. Only explicitly import Lucide icons, `toast` (`@/components/ui/sonner`), `apiClient`, and `zod`.
|
|
83
|
+
8. **Semantic Color & Token System:** NEVER use arbitrary palette classes like `text-gray-500` or `bg-blue-600`. ALWAYS use semantic tokens: `bg-background`, `bg-card`, `bg-primary`, `text-foreground`, `text-muted-foreground`, `border-border`.
|
|
84
|
+
9. **Tailwind CSS v4 Standard:**
|
|
85
|
+
- **Gradients:** ALWAYS use `bg-linear-to-r`, `bg-linear-to-b`, `bg-linear-to-tr` (NEVER `bg-gradient-to-*`).
|
|
86
|
+
- **Sizing Scale:** NEVER write arbitrary bracket sizes (`w-[300px]`, `p-[1px]`). Use v4 tokens (`max-w-44`, `w-75`, `p-px`, `size-4` / `size-5` for icons).
|
|
17
87
|
- **Shadows:** Use `shadow-2xs`, `shadow-xs`, `shadow-sm`, `shadow-md`, `shadow-lg`.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
88
|
+
- **No Scoped Styles:** Use Tailwind CSS utility classes instead of `<style scoped>`.
|
|
89
|
+
10. **Package Installation Confirmation:** NEVER install npm packages autonomously without prior user confirmation in chat.
|
|
90
|
+
11. **Dialog / Modal Accessibility Standard:** Every `DialogContent` MUST include `DialogTitle` and `DialogDescription` (use `sr-only` if visually hidden) to comply with Reka UI ARIA standards.
|
|
21
91
|
|
|
22
92
|
---
|
|
23
93
|
|
|
24
94
|
## 📚 Deep Technical Blueprints & Component Catalog
|
|
25
95
|
|
|
26
|
-
For the complete 45 Reka UI Primitives, Shared Components (`PageHeader`, `EmptyState`, `AppLogo`), Auto-Import Matrix, Axios Service Layer, Pinia Store patterns, and end-to-end CRUD scaffolding blueprints, refer to the **`nala-project` skill** located at:
|
|
96
|
+
For the complete 45+ Reka UI Primitives, Shared Components (`PageHeader`, `EmptyState`, `AppLogo`), Auto-Import Matrix, Axios Service Layer, Pinia Store patterns, and end-to-end CRUD scaffolding blueprints, refer to the **`nala-project` skill** located at:
|
|
27
97
|
👉 [`.agents/skills/nala-project/SKILL.md`](.agents/skills/nala-project/SKILL.md)
|
package/template/GEMINI.md
CHANGED
|
@@ -1,27 +1,97 @@
|
|
|
1
1
|
# GEMINI.md — Nala Application AI Guardrails
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
4
|
+
|
|
5
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
6
|
+
|
|
7
|
+
## 1. Think Before Coding
|
|
8
|
+
|
|
9
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
10
|
+
|
|
11
|
+
Before implementing:
|
|
12
|
+
|
|
13
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
14
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
15
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
16
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
17
|
+
|
|
18
|
+
## 2. Simplicity First
|
|
19
|
+
|
|
20
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
21
|
+
|
|
22
|
+
- No features beyond what was asked.
|
|
23
|
+
- No abstractions for single-use code.
|
|
24
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
25
|
+
- No error handling for impossible scenarios.
|
|
26
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
27
|
+
|
|
28
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
29
|
+
|
|
30
|
+
## 3. Surgical Changes
|
|
31
|
+
|
|
32
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
33
|
+
|
|
34
|
+
When editing existing code:
|
|
35
|
+
|
|
36
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
37
|
+
- Don't refactor things that aren't broken.
|
|
38
|
+
- Match existing style, even if you'd do it differently.
|
|
39
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
40
|
+
|
|
41
|
+
When your changes create orphans:
|
|
42
|
+
|
|
43
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
44
|
+
- Don't remove pre-existing dead code unless asked.
|
|
45
|
+
|
|
46
|
+
The test: Every changed line should trace directly to the user's request.
|
|
47
|
+
|
|
48
|
+
## 4. Goal-Driven Execution
|
|
49
|
+
|
|
50
|
+
**Define success criteria. Loop until verified.**
|
|
51
|
+
|
|
52
|
+
Transform tasks into verifiable goals:
|
|
53
|
+
|
|
54
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
55
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
56
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
57
|
+
|
|
58
|
+
For multi-step tasks, state a brief plan:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
1. [Step] → verify: [check]
|
|
62
|
+
2. [Step] → verify: [check]
|
|
63
|
+
3. [Step] → verify: [check]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
4
71
|
|
|
5
72
|
---
|
|
6
73
|
|
|
7
74
|
## 🛑 Strict Rules (Enforced on Every Invocation)
|
|
8
75
|
|
|
9
|
-
1. **
|
|
10
|
-
2. **
|
|
11
|
-
3. **No
|
|
12
|
-
4. **
|
|
13
|
-
5. **
|
|
14
|
-
6. **
|
|
15
|
-
|
|
16
|
-
|
|
76
|
+
1. **Direct & Fluff-Free Responses (Token Efficiency):** Never use conversational filler, pleasantries, apologies, or verbose preambles. Deliver concise, direct, and actionable technical deliverables to conserve tokens.
|
|
77
|
+
2. **Surgical & Focused Edits:** Only modify files directly related to the user's explicit request. Do not arbitrarily refactor untouched files.
|
|
78
|
+
3. **No Automatic Build / Tests:** NEVER run `pnpm build`, `npm run build`, `vitest`, or `pnpm test` autonomously.
|
|
79
|
+
4. **No Unauthorized Git Operations:** NEVER run `git add`, `git commit`, or `git push` autonomously.
|
|
80
|
+
5. **English Standard (UI & Code Comments):** All UI strings, form labels, validation/error messages, toasts, and in-code comments MUST be in **English**.
|
|
81
|
+
6. **Strict Vue 3 & TypeScript Hygiene:** Always use Composition API `<script setup lang="ts">`. Never use Options API or `any`. Define strict TypeScript interfaces for all props, emits, and API payloads.
|
|
82
|
+
7. **Auto-Import Awareness:** Do NOT manually import Vue reactivity (`ref`, `computed`, `watch`, `onMounted`), Vue Router (`useRouter`, `useRoute`), Pinia (`defineStore`), or UI Primitives (`Button`, `Card`, `Dialog`, etc.) — they are auto-imported. Only explicitly import Lucide icons, `toast` (`@/components/ui/sonner`), `apiClient`, and `zod`.
|
|
83
|
+
8. **Semantic Color & Token System:** NEVER use arbitrary palette classes like `text-gray-500` or `bg-blue-600`. ALWAYS use semantic tokens: `bg-background`, `bg-card`, `bg-primary`, `text-foreground`, `text-muted-foreground`, `border-border`.
|
|
84
|
+
9. **Tailwind CSS v4 Standard:**
|
|
85
|
+
- **Gradients:** ALWAYS use `bg-linear-to-r`, `bg-linear-to-b`, `bg-linear-to-tr` (NEVER `bg-gradient-to-*`).
|
|
86
|
+
- **Sizing Scale:** NEVER write arbitrary bracket sizes (`w-[300px]`, `p-[1px]`). Use v4 tokens (`max-w-44`, `w-75`, `p-px`, `size-4` / `size-5` for icons).
|
|
17
87
|
- **Shadows:** Use `shadow-2xs`, `shadow-xs`, `shadow-sm`, `shadow-md`, `shadow-lg`.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
88
|
+
- **No Scoped Styles:** Use Tailwind CSS utility classes instead of `<style scoped>`.
|
|
89
|
+
10. **Package Installation Confirmation:** NEVER install npm packages autonomously without prior user confirmation in chat.
|
|
90
|
+
11. **Dialog / Modal Accessibility Standard:** Every `DialogContent` MUST include `DialogTitle` and `DialogDescription` (use `sr-only` if visually hidden) to comply with Reka UI ARIA standards.
|
|
21
91
|
|
|
22
92
|
---
|
|
23
93
|
|
|
24
94
|
## 📚 Deep Technical Blueprints & Component Catalog
|
|
25
95
|
|
|
26
|
-
For the complete 45 Reka UI Primitives, Shared Components (`PageHeader`, `EmptyState`, `AppLogo`), Auto-Import Matrix, Axios Service Layer, Pinia Store patterns, and end-to-end CRUD scaffolding blueprints, refer to the **`nala-project` skill** located at:
|
|
96
|
+
For the complete 45+ Reka UI Primitives, Shared Components (`PageHeader`, `EmptyState`, `AppLogo`), Auto-Import Matrix, Axios Service Layer, Pinia Store patterns, and end-to-end CRUD scaffolding blueprints, refer to the **`nala-project` skill** located at:
|
|
27
97
|
👉 [`.agents/skills/nala-project/SKILL.md`](.agents/skills/nala-project/SKILL.md)
|