oh-my-ag 1.2.0 → 1.3.1

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: backend-agent
3
- description: Backend specialist for APIs, databases, authentication, and server-side logic using FastAPI, Node.js, or other frameworks
3
+ description: Backend specialist for APIs, databases, authentication using FastAPI with clean architecture (Repository/Service/Router pattern)
4
4
  ---
5
5
 
6
6
  # Backend Agent - API & Server Specialist
@@ -16,23 +16,80 @@ description: Backend specialist for APIs, databases, authentication, and server-
16
16
  - Frontend UI -> use Frontend Agent
17
17
  - Mobile-specific code -> use Mobile Agent
18
18
 
19
+ ## Core Principles
20
+
21
+ 1. **DRY (Don't Repeat Yourself)**: 비즈니스 로직은 `Service`에, 데이터 접근 로직은 `Repository`에
22
+ 2. **SOLID**:
23
+ - **Single Responsibility**: 클래스와 함수는 하나의 책임만
24
+ - **Dependency Inversion**: FastAPI의 `Depends`로 의존성 주입
25
+ 3. **KISS**: 단순하고 명확한 코드 지향
26
+
27
+ ## Architecture Pattern
28
+
29
+ ```
30
+ Router (HTTP) → Service (Business Logic) → Repository (Data Access) → Models
31
+ ```
32
+
33
+ ### Repository Layer
34
+ - **파일**: `src/[domain]/repository.py`
35
+ - **역할**: DB CRUD 및 쿼리 로직 캡슐화
36
+ - **원칙**: 비즈니스 로직 없음, SQLAlchemy 모델 반환
37
+
38
+ ### Service Layer
39
+ - **파일**: `src/[domain]/service.py`
40
+ - **역할**: 비즈니스 로직, Repository 조합, 외부 API 호출
41
+ - **원칙**: 비즈니스 결정은 오직 여기서만
42
+
43
+ ### Router Layer
44
+ - **파일**: `src/[domain]/router.py`
45
+ - **역할**: HTTP 요청 수신, 입력 검증, Service 호출, 응답 반환
46
+ - **원칙**: 비즈니스 로직 금지, DI로 Service 주입
47
+
19
48
  ## Core Rules
20
- 1. Clean architecture: router -> service -> repository -> models
21
- 2. No business logic in route handlers
22
- 3. All inputs validated with Pydantic/Zod
23
- 4. Parameterized queries only (never string interpolation)
24
- 5. JWT + bcrypt for auth; rate limit auth endpoints
25
- 6. Async/await consistently; type hints on all signatures
49
+
50
+ 1. **Clean architecture**: router service → repository → models
51
+ 2. **No business logic in route handlers**
52
+ 3. **All inputs validated with Pydantic**
53
+ 4. **Parameterized queries only** (never string interpolation)
54
+ 5. **JWT + bcrypt for auth**; rate limit auth endpoints
55
+ 6. **Async/await consistently**; type hints on all signatures
56
+ 7. **Custom exceptions** via `src/lib/exceptions.py` (not raw HTTPException)
57
+
58
+ ## Dependency Injection
59
+
60
+ ```python
61
+ # src/recipes/routers/dependencies.py
62
+ async def get_recipe_service(db: AsyncSession = Depends(get_db)) -> RecipeService:
63
+ repository = RecipeRepository(db)
64
+ return RecipeService(repository)
65
+
66
+ # src/recipes/routers/base_router.py
67
+ @router.get("/{recipe_id}")
68
+ async def get_recipe(
69
+ recipe_id: str,
70
+ service: RecipeService = Depends(get_recipe_service)
71
+ ):
72
+ return await service.get_recipe(recipe_id)
73
+ ```
74
+
75
+ ## Code Quality
76
+
77
+ - **Python 3.12+**: 엄격한 타입 힌트 (mypy)
78
+ - **Async/Await**: I/O 바운드 작업에 필수
79
+ - **Ruff**: 린팅/포맷팅 (Double Quotes, Line Length 100)
26
80
 
27
81
  ## How to Execute
82
+
28
83
  Follow `resources/execution-protocol.md` step by step.
29
84
  See `resources/examples.md` for input/output examples.
30
85
  Before submitting, run `resources/checklist.md`.
31
86
 
32
87
  ## Serena Memory (CLI Mode)
33
- See `../_shared/serena-memory-protocol.md`.
88
+
89
+ See `../_shared/memory-protocol.md`.
34
90
 
35
91
  ## References
92
+
36
93
  - Execution steps: `resources/execution-protocol.md`
37
94
  - Code examples: `resources/examples.md`
38
95
  - Code snippets: `resources/snippets.md`
@@ -45,3 +102,6 @@ See `../_shared/serena-memory-protocol.md`.
45
102
  - Clarification: `../_shared/clarification-protocol.md`
46
103
  - Context budget: `../_shared/context-budget.md`
47
104
  - Lessons learned: `../_shared/lessons-learned.md`
105
+
106
+ > [!IMPORTANT]
107
+ > 새 모듈 추가 시 반드시 `__init__.py` 포함하여 패키지 구조 유지
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: frontend-agent
3
- description: Frontend specialist for React, Next.js, TypeScript, and modern UI development
3
+ description: Frontend specialist for React, Next.js, TypeScript with FSD-lite architecture, shadcn/ui, and design system alignment
4
4
  ---
5
5
 
6
6
  # Frontend Agent - UI/UX Specialist
@@ -16,23 +16,123 @@ description: Frontend specialist for React, Next.js, TypeScript, and modern UI d
16
16
  - Backend API implementation -> use Backend Agent
17
17
  - Native mobile development -> use Mobile Agent
18
18
 
19
- ## Core Rules
20
- 1. TypeScript strict mode; explicit interfaces for all props
21
- 2. Tailwind CSS only (no inline styles, no CSS modules)
22
- 3. Semantic HTML with ARIA labels; keyboard navigation required
23
- 4. Loading, error, and empty states for every async operation
24
- 5. Responsive at 320px, 768px, 1024px, 1440px
25
- 6. shadcn/ui + Radix for component primitives
19
+ ## Core Principles
20
+
21
+ 1. **Component Reuse**: Use `shadcn/ui` components first. Extend via `cva` variants or composition. Avoid custom CSS.
22
+ 2. **Design Fidelity**: Code must map 1:1 to Design Tokens. Resolve discrepancies before implementation.
23
+ 3. **Rendering Strategy**: Default to Server Components for performance. Use Client Components only for interactivity and API integration.
24
+ 4. **Accessibility**: Semantic HTML, ARIA labels, keyboard navigation, and screen reader compatibility are mandatory.
25
+ 5. **Tool First**: Check for existing solutions and tools before coding.
26
+
27
+ ## 1. Tooling & Performance
28
+
29
+ - **Metrics**: Target First Contentful Paint (FCP) < 1s.
30
+ - **Optimization**: Use `next/dynamic` for heavy components, `next/image` for media, and parallel routes.
31
+ - **Responsive Breakpoints**: 320px, 768px, 1024px, 1440px
32
+ - **Shadcn Workflow**:
33
+ 1. Search: `shadcn_search_items_in_registries`
34
+ 2. Review: `shadcn_get_item_examples_from_registries`
35
+ 3. Install: `shadcn_get_add_command_for_items`
36
+
37
+ ## 2. Architecture (FSD-lite)
38
+
39
+ - **Root (`src/`)**: Shared logic (components, lib, types). Hoist common code here.
40
+ - **Feature (`src/features/*/`)**: Feature-specific logic. **No cross-feature imports.** Unidirectional flow only.
41
+
42
+ ### Feature Directory Structure
43
+ ```
44
+ src/features/[feature]/
45
+ ├── components/ # Feature UI components
46
+ │ └── skeleton/ # Loading skeleton components
47
+ ├── types/ # Feature-specific type definitions
48
+ └── utils/ # Feature-specific utilities & helpers
49
+ ```
50
+
51
+ ### Placement Rules
52
+ - `components/`: React components only. One component per file.
53
+ - `types/`: TypeScript interfaces and type definitions.
54
+ - `utils/`: All feature-specific logic (formatters, validators, helpers). **Requires >90% test coverage** for custom logic.
55
+
56
+ > **Note**: Feature level does NOT have `lib/` folder. Use `utils/` for all utilities. `lib/` exists only at root `src/lib/` level.
57
+
58
+ ## 3. Libraries
59
+
60
+ | Category | Library |
61
+ |----------|---------|
62
+ | Date | `luxon` |
63
+ | Styling | `TailwindCSS v4` + `shadcn/ui` |
64
+ | Hooks | `ahooks` (Pre-made hooks preferred) |
65
+ | Utils | `es-toolkit` (First choice) |
66
+ | State (URL) | `jotai-location` |
67
+ | State (Server) | `TanStack Query` |
68
+ | State (Client) | `Jotai` (Minimize use) |
69
+ | Forms | `@tanstack/react-form` + `zod` |
70
+
71
+ ## 4. Standards
72
+
73
+ - **Utilities**: Check `es-toolkit` first. If implementing custom logic, **>90% Unit Test Coverage** is MANDATORY.
74
+ - **Design Tokens**: Source of Truth is `packages/design-tokens` (OKLCH). Never hardcode colors.
75
+ - **i18n**: Source of Truth is `packages/i18n`. Never hardcode strings.
76
+
77
+ ## 5. Component Strategy
78
+
79
+ ### Server vs Client Components
80
+ - **Server Components**: Layouts, Marketing pages, SEO metadata (`generateMetadata`, `sitemap`)
81
+ - **Client Components**: Interactive features and `useQuery` hooks
82
+
83
+ ### Structure
84
+ - **One Component Per File**
85
+
86
+ ### Naming Conventions
87
+ | Type | Convention |
88
+ |------|------------|
89
+ | Files | `kebab-case.tsx` (Name MUST indicate purpose) |
90
+ | Components/Types/Interfaces | `PascalCase` |
91
+ | Functions/Vars/Hooks | `camelCase` |
92
+ | Constants | `SCREAMING_SNAKE_CASE` |
93
+
94
+ ### Imports
95
+ - Order: Standard > 3rd Party > Local
96
+ - Absolute `@/` is MANDATORY (No relative paths like `../../`)
97
+ - **MUST use `import type`** for interfaces/types
98
+
99
+ ### Skeletons
100
+ - Must be placed in `src/features/[feature]/components/skeleton/`
101
+
102
+ ## 6. UI Implementation (Shadcn/UI)
103
+
104
+ - **Usage**: Prefer strict shadcn primitives (`Card`, `Sheet`, `Typography`, `Table`) over `div` or generic classes.
105
+ - **Responsiveness**: Use `Drawer` (Mobile) vs `Dialog` (Desktop) via `useResponsive`.
106
+ - **Customization Rule**: Treat `components/ui/*` as read-only. Do not modify directly.
107
+ - **Correct**: Create a wrapper (e.g., `components/common/ProductButton.tsx`) or use `cva` composition.
108
+ - **Incorrect**: Editing `components/ui/button.tsx`.
109
+
110
+ ## 7. Designer Collaboration
111
+
112
+ - **Sync**: Map code variables to Figma layer names.
113
+ - **UX**: Ensure key actions are visible "Above the Fold".
26
114
 
27
115
  ## How to Execute
116
+
28
117
  Follow `resources/execution-protocol.md` step by step.
29
118
  See `resources/examples.md` for input/output examples.
30
119
  Before submitting, run `resources/checklist.md`.
31
120
 
32
121
  ## Serena Memory (CLI Mode)
33
- See `../_shared/serena-memory-protocol.md`.
122
+
123
+ See `../_shared/memory-protocol.md`.
124
+
125
+ ## Review Checklist
126
+
127
+ - [ ] **A11y**: Interactive elements have `aria-label`. Semantic headings (`h1`-`h6`).
128
+ - [ ] **Mobile**: Functionality verified on mobile viewports.
129
+ - [ ] **Performance**: No CLS, fast load.
130
+ - [ ] **Resilience**: Error Boundaries and Loading Skeletons implemented.
131
+ - [ ] **Tests**: Logic covered by Vitest where complex.
132
+ - [ ] **Quality**: Typecheck and Lint pass.
34
133
 
35
134
  ## References
135
+
36
136
  - Execution steps: `resources/execution-protocol.md`
37
137
  - Code examples: `resources/examples.md`
38
138
  - Code snippets: `resources/snippets.md`
@@ -46,3 +146,6 @@ See `../_shared/serena-memory-protocol.md`.
46
146
  - Clarification: `../_shared/clarification-protocol.md`
47
147
  - Context budget: `../_shared/context-budget.md`
48
148
  - Lessons learned: `../_shared/lessons-learned.md`
149
+
150
+ > [!IMPORTANT]
151
+ > Treat `components/ui/*` as read-only. Create wrappers for customization.
@@ -79,7 +79,7 @@ get_vendor_config() {
79
79
  # Get CLI for specific agent type from user-preferences.yaml
80
80
  get_agent_cli() {
81
81
  local agent_type="$1"
82
- local prefs="${SCRIPT_DIR}/../../config/user-preferences.yaml"
82
+ local prefs="${SCRIPT_DIR}/../../../config/user-preferences.yaml"
83
83
  if [[ -f "$prefs" ]]; then
84
84
  grep -A10 "^agent_cli_mapping:" "$prefs" 2>/dev/null | \
85
85
  grep "^ ${agent_type}:" | \
@@ -89,7 +89,7 @@ get_agent_cli() {
89
89
 
90
90
  # Get default CLI from user-preferences.yaml
91
91
  get_default_cli() {
92
- local prefs="${SCRIPT_DIR}/../../config/user-preferences.yaml"
92
+ local prefs="${SCRIPT_DIR}/../../../config/user-preferences.yaml"
93
93
  if [[ -f "$prefs" ]]; then
94
94
  grep "^default_cli:" "$prefs" 2>/dev/null | sed 's/^[^:]*: *//' | tr -d '"' | xargs
95
95
  fi