You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 03_guidelines/common/ai-coding.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The static context (8-10 guideline files referenced in CLAUDE.md) typically adds
57
57
## 2.2 Task Scoping
58
58
* MUST break large tasks into small, focused requests (one file or one function per request)
59
59
* MUST specify the exact file path and function name when requesting changes to existing code
60
-
* SHOULD provide a Before/After example when explaining a pattern you want the AI to follow
60
+
* SHOULD keep code examples minimal (1-3 lines inline ❌/✅). Avoid adding large Before/After sections — benchmark data shows they cause attention dilution without improving compliance
61
61
62
62
## 2.3 Effective Prompting Patterns
63
63
***Do**: "Add auth check using the ActionResult pattern defined in server-actions.md"
@@ -159,9 +159,10 @@ After every code review where AI-generated code was corrected:
159
159
160
160
## 5.3 When AI Cannot Follow a Rule
161
161
If AI consistently fails to follow a specific guideline:
162
-
1. Add a concrete code example (Before/After) to the guideline
163
-
2. Add the rule to the project's checklist template
164
-
3. If still failing, consider adding a pre-commit hook or linter rule for automated enforcement
162
+
1. Clarify the rule wording — make it more specific and actionable
163
+
2. Add a minimal inline code example (❌/✅, 1-3 lines) if the rule is ambiguous
164
+
3. Add the rule to the project's checklist template
165
+
4. If still failing, consider adding a pre-commit hook or linter rule for automated enforcement
165
166
166
167
## 5.4 Rule Suppression (Escape Hatch)
167
168
When a specific guideline rule is not applicable to a particular module or file, suppress it explicitly rather than ignoring it silently:
## MUST: Apply Rate Limiting to Auth Server Actions
163
+
164
+
MUST apply rate limiting to ALL Server Actions that handle authentication — not just API routes. Server Actions for `register`, `login`, `requestPasswordReset`, and `resetPassword` MUST check rate limits per IP before processing:
Copy file name to clipboardExpand all lines: 03_guidelines/common/validation.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,15 @@ This document outlines how to manage **Types** and **Validation** in a unified m
6
6
# 1. Core Policy
7
7
* Build a structure where types naturally synchronize in the order **Zod → Prisma → TypeScript**.
8
8
* API schemas can be converted from **Zod → JSON Schema (for AI APIs, etc.)** for external sharing.
9
+
* MUST validate on BOTH client and server using the SAME Zod schema. Use `zodResolver` from `@hookform/resolvers/zod` for client-side form validation with react-hook-form. Never rely on server-side validation alone.
9
10
10
11
---
11
12
12
13
# 2. Business Logic Rules in Zod Schemas
13
14
14
15
Business logic rules that belong in Zod schemas (not just format validation):
15
16
16
-
***Cross-field constraints**: e.g., `endDate` must be after `startDate`, `maxPrice` >= `minPrice`
17
+
***Date range constraints**: MUST validate that future-facing dates (e.g., `dueDate`, `expiresAt`) are in the future using `.refine()`. MUST validate that `endDate` is after `startDate`
17
18
***Domain value boundaries**: e.g., quantity must be 1-999, discount percentage 0-100
18
19
***Conditional required fields**: e.g., if `paymentMethod` is "card", `cardNumber` is required
19
20
***Enumerated state transitions**: e.g., order status can only move from "pending" → "confirmed" → "shipped"
MUST create `app/not-found.tsx` with a user-friendly 404 page. Pages that call `notFound()` (e.g., task detail, team detail) will render this component.
139
+
140
+
---
141
+
142
+
# 6. Summary (Routing / Metadata / Data Fetching)
116
143
* Organize hierarchy with App Router and separate concerns at the layout level.
117
-
*Unify UX with per-page `loading.tsx`/ `error.tsx`.
144
+
*MUST place `error.tsx`in each route group and `not-found.tsx` at root.
118
145
* Public pages use SSG/ISR; user-specific data uses SSR + Server Actions + custom hooks.
119
146
* Flexibly and dynamically control SEO/OG/Twitter via the Metadata API.
120
147
* Achieve DB access that balances security and performance through Server Components.
Copy file name to clipboardExpand all lines: 03_guidelines/frameworks/nextjs/ui.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,7 @@ const buttonVariants = cva(
157
157
158
158
| Element | Required Action |
159
159
|---------|----------------|
160
-
| Icon button | aria-label or sr-only text |
160
+
| Icon button |MUST have `aria-label` describing the action (e.g., `aria-label="Delete task"`, `aria-label="Open menu"`). Every `<Button>` without visible text MUST have an aria-label.|
161
161
| Badge / Counter | Explain meaning with aria-label |
0 commit comments