oh-my-ag 1.2.0

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.
Files changed (77) hide show
  1. package/.agent/skills/_shared/api-contracts/README.md +56 -0
  2. package/.agent/skills/_shared/api-contracts/template.md +88 -0
  3. package/.agent/skills/_shared/clarification-protocol.md +217 -0
  4. package/.agent/skills/_shared/common-checklist.md +31 -0
  5. package/.agent/skills/_shared/context-budget.md +118 -0
  6. package/.agent/skills/_shared/context-loading.md +105 -0
  7. package/.agent/skills/_shared/difficulty-guide.md +55 -0
  8. package/.agent/skills/_shared/lessons-learned.md +113 -0
  9. package/.agent/skills/_shared/memory-protocol.md +79 -0
  10. package/.agent/skills/_shared/reasoning-templates.md +161 -0
  11. package/.agent/skills/_shared/skill-routing.md +80 -0
  12. package/.agent/skills/_shared/verify.sh +252 -0
  13. package/.agent/skills/backend-agent/SKILL.md +47 -0
  14. package/.agent/skills/backend-agent/resources/api-template.py +326 -0
  15. package/.agent/skills/backend-agent/resources/checklist.md +36 -0
  16. package/.agent/skills/backend-agent/resources/error-playbook.md +98 -0
  17. package/.agent/skills/backend-agent/resources/examples.md +85 -0
  18. package/.agent/skills/backend-agent/resources/execution-protocol.md +45 -0
  19. package/.agent/skills/backend-agent/resources/snippets.md +197 -0
  20. package/.agent/skills/backend-agent/resources/tech-stack.md +39 -0
  21. package/.agent/skills/commit/SKILL.md +121 -0
  22. package/.agent/skills/commit/config/commit-config.yaml +55 -0
  23. package/.agent/skills/commit/resources/conventional-commits.md +166 -0
  24. package/.agent/skills/debug-agent/SKILL.md +51 -0
  25. package/.agent/skills/debug-agent/resources/bug-report-template.md +332 -0
  26. package/.agent/skills/debug-agent/resources/checklist.md +30 -0
  27. package/.agent/skills/debug-agent/resources/common-patterns.md +734 -0
  28. package/.agent/skills/debug-agent/resources/debugging-checklist.md +362 -0
  29. package/.agent/skills/debug-agent/resources/error-playbook.md +94 -0
  30. package/.agent/skills/debug-agent/resources/examples.md +87 -0
  31. package/.agent/skills/debug-agent/resources/execution-protocol.md +51 -0
  32. package/.agent/skills/frontend-agent/SKILL.md +48 -0
  33. package/.agent/skills/frontend-agent/resources/checklist.md +38 -0
  34. package/.agent/skills/frontend-agent/resources/component-template.tsx +92 -0
  35. package/.agent/skills/frontend-agent/resources/error-playbook.md +108 -0
  36. package/.agent/skills/frontend-agent/resources/examples.md +77 -0
  37. package/.agent/skills/frontend-agent/resources/execution-protocol.md +49 -0
  38. package/.agent/skills/frontend-agent/resources/snippets.md +205 -0
  39. package/.agent/skills/frontend-agent/resources/tailwind-rules.md +343 -0
  40. package/.agent/skills/frontend-agent/resources/tech-stack.md +36 -0
  41. package/.agent/skills/mobile-agent/SKILL.md +46 -0
  42. package/.agent/skills/mobile-agent/resources/checklist.md +35 -0
  43. package/.agent/skills/mobile-agent/resources/error-playbook.md +106 -0
  44. package/.agent/skills/mobile-agent/resources/examples.md +79 -0
  45. package/.agent/skills/mobile-agent/resources/execution-protocol.md +49 -0
  46. package/.agent/skills/mobile-agent/resources/screen-template.dart +298 -0
  47. package/.agent/skills/mobile-agent/resources/snippets.md +235 -0
  48. package/.agent/skills/mobile-agent/resources/tech-stack.md +45 -0
  49. package/.agent/skills/orchestrator/SKILL.md +99 -0
  50. package/.agent/skills/orchestrator/config/cli-config.yaml +78 -0
  51. package/.agent/skills/orchestrator/resources/memory-schema.md +212 -0
  52. package/.agent/skills/orchestrator/resources/subagent-prompt-template.md +153 -0
  53. package/.agent/skills/orchestrator/scripts/parallel-run.sh +330 -0
  54. package/.agent/skills/orchestrator/scripts/spawn-agent.sh +263 -0
  55. package/.agent/skills/orchestrator/templates/backend-task.md +18 -0
  56. package/.agent/skills/orchestrator/templates/debug-task.md +16 -0
  57. package/.agent/skills/orchestrator/templates/frontend-task.md +17 -0
  58. package/.agent/skills/orchestrator/templates/mobile-task.md +17 -0
  59. package/.agent/skills/orchestrator/templates/qa-task.md +16 -0
  60. package/.agent/skills/orchestrator/templates/tasks-example.yaml +15 -0
  61. package/.agent/skills/pm-agent/SKILL.md +47 -0
  62. package/.agent/skills/pm-agent/resources/error-playbook.md +75 -0
  63. package/.agent/skills/pm-agent/resources/examples.md +121 -0
  64. package/.agent/skills/pm-agent/resources/execution-protocol.md +46 -0
  65. package/.agent/skills/pm-agent/resources/task-template.json +57 -0
  66. package/.agent/skills/qa-agent/SKILL.md +43 -0
  67. package/.agent/skills/qa-agent/resources/checklist.md +294 -0
  68. package/.agent/skills/qa-agent/resources/error-playbook.md +95 -0
  69. package/.agent/skills/qa-agent/resources/examples.md +100 -0
  70. package/.agent/skills/qa-agent/resources/execution-protocol.md +50 -0
  71. package/.agent/skills/qa-agent/resources/self-check.md +27 -0
  72. package/.agent/skills/workflow-guide/SKILL.md +57 -0
  73. package/.agent/skills/workflow-guide/resources/examples.md +68 -0
  74. package/README.ko.md +459 -0
  75. package/README.md +563 -0
  76. package/bin/cli.js +205 -0
  77. package/package.json +75 -0
@@ -0,0 +1,362 @@
1
+ # Debugging Checklist
2
+
3
+ Use this checklist when investigating bugs to ensure thorough analysis.
4
+
5
+ ## πŸ“‹ Initial Information Gathering
6
+
7
+ - [ ] **Bug description** - What is the expected vs actual behavior?
8
+ - [ ] **Error messages** - Exact error text, stack trace, error codes
9
+ - [ ] **Reproduction steps** - Clear, numbered steps to trigger the bug
10
+ - [ ] **Frequency** - Every time, intermittent, specific conditions?
11
+ - [ ] **Environment** - Browser/OS/version, mobile device, server environment
12
+ - [ ] **User impact** - How many users affected? Severity?
13
+ - [ ] **Recent changes** - New deploy? Code changes? Configuration updates?
14
+ - [ ] **Screenshots/videos** - Visual evidence of the bug
15
+
16
+ ## πŸ” Frontend Debugging
17
+
18
+ ### JavaScript/TypeScript Errors
19
+
20
+ - [ ] Check browser console (F12) for errors
21
+ - [ ] Review stack trace - which file and line?
22
+ - [ ] Identify error type (TypeError, ReferenceError, etc.)
23
+ - [ ] Check for null/undefined values
24
+ - [ ] Verify variable types (especially after API calls)
25
+ - [ ] Look for typos in property names
26
+
27
+ ### React Component Issues
28
+
29
+ - [ ] **State problems**
30
+ - [ ] State not updating? (need setState/useState)
31
+ - [ ] Stale state in closures? (use refs or functional updates)
32
+ - [ ] State out of sync with props?
33
+
34
+ - [ ] **Effect problems**
35
+ - [ ] Missing dependencies in useEffect?
36
+ - [ ] Effect running too many times?
37
+ - [ ] Cleanup function needed?
38
+ - [ ] Memory leak from uncancelled requests?
39
+
40
+ - [ ] **Rendering issues**
41
+ - [ ] Conditional rendering logic correct?
42
+ - [ ] Keys on list items unique and stable?
43
+ - [ ] Unnecessary re-renders? (use React DevTools Profiler)
44
+
45
+ ### UI/UX Issues
46
+
47
+ - [ ] CSS not applying? (check specificity, typos)
48
+ - [ ] Layout broken? (check responsive breakpoints)
49
+ - [ ] Accessibility issues? (keyboard nav, screen reader)
50
+ - [ ] Dark mode broken?
51
+ - [ ] Mobile-specific issues?
52
+
53
+ ### API Integration
54
+
55
+ - [ ] **Network tab investigation**
56
+ - [ ] Request sent? (check Headers tab)
57
+ - [ ] Correct endpoint URL?
58
+ - [ ] Proper HTTP method (GET, POST, etc.)?
59
+ - [ ] Headers included (Authorization, Content-Type)?
60
+ - [ ] Request body formatted correctly?
61
+ - [ ] Response status code (200, 401, 404, 500)?
62
+ - [ ] Response data structure matches expected?
63
+
64
+ - [ ] **Error handling**
65
+ - [ ] Try/catch around API calls?
66
+ - [ ] Error state displayed to user?
67
+ - [ ] Timeout handling?
68
+ - [ ] Network failure handling?
69
+
70
+ - [ ] **Loading states**
71
+ - [ ] Loading spinner shown?
72
+ - [ ] Disabled buttons during load?
73
+ - [ ] Optimistic updates causing issues?
74
+
75
+ ## πŸ–₯️ Backend Debugging
76
+
77
+ ### Python/FastAPI Errors
78
+
79
+ - [ ] **Stack trace analysis**
80
+ - [ ] Read error message carefully
81
+ - [ ] Identify the failing file and line
82
+ - [ ] Understand the error type (ValueError, KeyError, etc.)
83
+ - [ ] Check for None values
84
+ - [ ] Verify data types
85
+
86
+ - [ ] **Database issues**
87
+ - [ ] Query syntax correct?
88
+ - [ ] N+1 query problem?
89
+ - [ ] Missing JOIN?
90
+ - [ ] Indexes present on filtered columns?
91
+ - [ ] Connection pool exhausted?
92
+ - [ ] Transaction isolation issues?
93
+
94
+ - [ ] **Authentication/Authorization**
95
+ - [ ] Token validation working?
96
+ - [ ] Token expired?
97
+ - [ ] Permissions checked correctly?
98
+ - [ ] User session valid?
99
+ - [ ] CORS configured properly?
100
+
101
+ ### API Endpoint Issues
102
+
103
+ - [ ] **Request validation**
104
+ - [ ] Pydantic schema matches request?
105
+ - [ ] Required fields present?
106
+ - [ ] Field types correct?
107
+ - [ ] Value ranges validated?
108
+
109
+ - [ ] **Response formatting**
110
+ - [ ] Correct status code?
111
+ - [ ] Response schema matches contract?
112
+ - [ ] Error responses formatted properly?
113
+ - [ ] Pagination working?
114
+
115
+ - [ ] **Performance**
116
+ - [ ] Response time acceptable (<200ms)?
117
+ - [ ] Query optimization needed?
118
+ - [ ] Caching implemented?
119
+ - [ ] Rate limiting working?
120
+
121
+ ### Server Issues
122
+
123
+ - [ ] **Logs examination**
124
+ - [ ] Check application logs
125
+ - [ ] Check error logs
126
+ - [ ] Check access logs
127
+ - [ ] Timestamps correlate with bug reports?
128
+
129
+ - [ ] **Environment**
130
+ - [ ] Environment variables set?
131
+ - [ ] Configuration correct for environment (dev/prod)?
132
+ - [ ] External services reachable?
133
+ - [ ] Database migrations applied?
134
+
135
+ ## πŸ“± Mobile Debugging
136
+
137
+ ### Platform-Specific Issues
138
+
139
+ - [ ] **iOS vs Android differences**
140
+ - [ ] Test on both platforms
141
+ - [ ] Check platform-specific code (Platform.OS)
142
+ - [ ] Review native module integration
143
+ - [ ] Verify permissions (camera, location, etc.)
144
+
145
+ - [ ] **Device-specific**
146
+ - [ ] Test on actual device (not just emulator)
147
+ - [ ] Check different screen sizes
148
+ - [ ] Test different OS versions
149
+ - [ ] Memory constraints on older devices?
150
+
151
+ ### Flutter-Specific
152
+
153
+ - [ ] **Widget tree issues**
154
+ - [ ] State management correct? (Riverpod/Bloc)
155
+ - [ ] Build method pure?
156
+ - [ ] Keys used properly?
157
+ - [ ] Dispose called for controllers?
158
+
159
+ - [ ] **Platform channels**
160
+ - [ ] Native code errors?
161
+ - [ ] Method channel names correct?
162
+ - [ ] Data serialization working?
163
+
164
+ ### Mobile Performance
165
+
166
+ - [ ] Memory leaks? (listeners not disposed)
167
+ - [ ] Excessive rebuilds?
168
+ - [ ] Large images not optimized?
169
+ - [ ] Too many simultaneous network requests?
170
+
171
+ ## πŸ” Security Bugs
172
+
173
+ - [ ] **Authentication bypassed?**
174
+ - [ ] Token validation on all protected routes?
175
+ - [ ] Token expiry checked?
176
+ - [ ] Refresh token flow secure?
177
+
178
+ - [ ] **Authorization broken?**
179
+ - [ ] User can access others' data?
180
+ - [ ] Admin functions accessible to regular users?
181
+ - [ ] Horizontal privilege escalation possible?
182
+
183
+ - [ ] **Injection vulnerabilities**
184
+ - [ ] SQL injection? (use parameterized queries)
185
+ - [ ] XSS? (sanitize user input)
186
+ - [ ] Command injection?
187
+ - [ ] Path traversal?
188
+
189
+ - [ ] **Data exposure**
190
+ - [ ] Sensitive data in logs?
191
+ - [ ] Passwords in plain text?
192
+ - [ ] API keys exposed?
193
+ - [ ] Error messages leaking info?
194
+
195
+ ## 🐌 Performance Bugs
196
+
197
+ ### Frontend Performance
198
+
199
+ - [ ] **Lighthouse audit**
200
+ - [ ] Performance score >90?
201
+ - [ ] First Contentful Paint <1.5s?
202
+ - [ ] Largest Contentful Paint <2.5s?
203
+ - [ ] Cumulative Layout Shift <0.1?
204
+
205
+ - [ ] **Bundle analysis**
206
+ - [ ] Main bundle <500KB?
207
+ - [ ] Code splitting implemented?
208
+ - [ ] Large dependencies tree-shaken?
209
+ - [ ] Lazy loading used?
210
+
211
+ - [ ] **React performance**
212
+ - [ ] Unnecessary re-renders? (React DevTools Profiler)
213
+ - [ ] Memo/useMemo/useCallback used appropriately?
214
+ - [ ] Virtual scrolling for long lists?
215
+
216
+ ### Backend Performance
217
+
218
+ - [ ] **API latency**
219
+ - [ ] p95 response time <200ms?
220
+ - [ ] Slow queries identified?
221
+ - [ ] Indexes added?
222
+ - [ ] Caching implemented?
223
+
224
+ - [ ] **Database**
225
+ - [ ] Connection pooling configured?
226
+ - [ ] Query plan optimized? (EXPLAIN)
227
+ - [ ] N+1 queries eliminated?
228
+
229
+ ## πŸ”¬ Root Cause Analysis
230
+
231
+ - [ ] **Reproduce the bug**
232
+ - [ ] Follow exact reproduction steps
233
+ - [ ] Confirm bug exists
234
+ - [ ] Note any variations
235
+
236
+ - [ ] **Isolate the problem**
237
+ - [ ] Which component/function fails?
238
+ - [ ] What input triggers it?
239
+ - [ ] What conditions must be met?
240
+
241
+ - [ ] **Trace the data flow**
242
+ - [ ] Where does the bad data come from?
243
+ - [ ] How is it transformed?
244
+ - [ ] Where does it cause the failure?
245
+
246
+ - [ ] **Identify the root cause**
247
+ - [ ] Not just the symptom
248
+ - [ ] Why does this happen?
249
+ - [ ] What assumption was wrong?
250
+
251
+ ## βœ… Fix Verification
252
+
253
+ - [ ] **Fix applied**
254
+ - [ ] Code changed in correct file(s)
255
+ - [ ] Logic correct
256
+ - [ ] Edge cases handled
257
+ - [ ] No new bugs introduced
258
+
259
+ - [ ] **Testing**
260
+ - [ ] Regression test written
261
+ - [ ] Test passes
262
+ - [ ] Manual verification done
263
+ - [ ] Edge cases tested
264
+
265
+ - [ ] **Related areas checked**
266
+ - [ ] Similar patterns elsewhere?
267
+ - [ ] Other code depending on this?
268
+ - [ ] Breaking changes avoided?
269
+
270
+ - [ ] **Documentation**
271
+ - [ ] Bug documented in Knowledge Base
272
+ - [ ] Fix explained
273
+ - [ ] Prevention notes added
274
+
275
+ ## 🚨 When to Escalate
276
+
277
+ Escalate to other agents if:
278
+
279
+ - [ ] Bug spans multiple domains β†’ **workflow-guide**
280
+ - [ ] Requires architectural change β†’ **PM Agent**
281
+ - [ ] Need comprehensive security audit β†’ **QA Agent**
282
+ - [ ] Complex frontend refactoring needed β†’ **Frontend Agent**
283
+ - [ ] Database schema changes needed β†’ **Backend Agent**
284
+ - [ ] Platform-specific mobile issue β†’ **Mobile Agent**
285
+
286
+ ## πŸ“Š Priority Assessment
287
+
288
+ **πŸ”΄ CRITICAL** - Fix immediately:
289
+ - [ ] App crashes on launch
290
+ - [ ] Data loss or corruption
291
+ - [ ] Security vulnerability
292
+ - [ ] Payment/auth completely broken
293
+ - [ ] Affects all users
294
+
295
+ **🟠 HIGH** - Fix within 24 hours:
296
+ - [ ] Major feature broken
297
+ - [ ] Affects >50% of users
298
+ - [ ] No workaround available
299
+ - [ ] Significant revenue impact
300
+
301
+ **🟑 MEDIUM** - Fix within sprint:
302
+ - [ ] Minor feature broken
303
+ - [ ] Affects <50% of users
304
+ - [ ] Workaround exists
305
+ - [ ] Moderate inconvenience
306
+
307
+ **πŸ”΅ LOW** - Schedule for future:
308
+ - [ ] Edge case
309
+ - [ ] Cosmetic issue
310
+ - [ ] Rarely encountered
311
+ - [ ] No user impact
312
+
313
+ ## πŸ“ Documentation Template
314
+
315
+ After fixing, document in `.gemini/antigravity/brain/bugs/`:
316
+
317
+ ```markdown
318
+ # Bug: [Title]
319
+ **Date**: YYYY-MM-DD
320
+ **Severity**: CRITICAL/HIGH/MEDIUM/LOW
321
+ **Status**: FIXED
322
+
323
+ ## Problem
324
+ [What was broken]
325
+
326
+ ## Root Cause
327
+ [Why it was broken]
328
+
329
+ ## Fix
330
+ [What was changed]
331
+
332
+ ## Files Modified
333
+ - path/to/file
334
+
335
+ ## Testing
336
+ - [x] Regression test added
337
+ - [x] Manual verification
338
+ - [x] Related areas checked
339
+
340
+ ## Prevention
341
+ [How to avoid in future]
342
+ ```
343
+
344
+ ---
345
+
346
+ ## πŸ’‘ Pro Tips
347
+
348
+ 1. **Read the error message** - It usually tells you exactly what's wrong
349
+ 2. **Reproduce first** - Don't waste time fixing unconfirmed bugs
350
+ 3. **One change at a time** - Don't fix multiple things simultaneously
351
+ 4. **Test thoroughly** - Verify the fix and check for regressions
352
+ 5. **Document everything** - Future you will be grateful
353
+ 6. **Look for patterns** - One bug often reveals more
354
+
355
+ ## πŸ› οΈ Tools Reference
356
+
357
+ - **Browser DevTools**: F12 (Console, Network, React DevTools)
358
+ - **Serena MCP**: find_symbol, search_for_pattern, find_referencing_symbols
359
+ - **Antigravity Browser**: Automated testing and reproduction
360
+ - **React Profiler**: Performance analysis
361
+ - **Lighthouse**: Performance audit
362
+ - **Git bisect**: Find when bug was introduced
@@ -0,0 +1,94 @@
1
+ # Debug Agent - Error Recovery Playbook
2
+
3
+ When you encounter a failure during debugging, follow these recovery steps.
4
+ Do NOT stop or ask for help until you have exhausted the playbook.
5
+
6
+ ---
7
+
8
+ ## Cannot Reproduce the Bug
9
+
10
+ **Symptoms**: Bug described by user but you can't trigger it
11
+
12
+ 1. Re-read user's reproduction steps β€” are you following them exactly?
13
+ 2. Check environment differences: browser, OS, node/python version
14
+ 3. Check data-dependent: does it need specific DB state or test data?
15
+ 4. Check timing: is it a race condition? Try adding delays or rapid repetition
16
+ 5. **3회 μ‹œλ„ ν›„**: result에 `Status: cannot_reproduce` 기둝, 쑰건 λͺ©λ‘ λͺ…μ‹œ
17
+ - μ ˆλŒ€ "μž¬ν˜„ λΆˆκ°€"라고 λ°”λ‘œ ν¬κΈ°ν•˜μ§€ 말 것
18
+
19
+ ---
20
+
21
+ ## Fix Introduces New Failure
22
+
23
+ **Symptoms**: Original bug fixed but other tests break
24
+
25
+ 1. Read the failing tests β€” are they testing the old (buggy) behavior?
26
+ 2. If yes: update tests to reflect correct behavior
27
+ 3. If no: your fix has side effects β€” revert and try a more targeted approach
28
+ 4. `find_referencing_symbols("fixedFunction")` to check all callers
29
+ 5. Consider: is the function contract changing? If so, update all callers
30
+
31
+ ---
32
+
33
+ ## Root Cause Unclear
34
+
35
+ **Symptoms**: You see the failure but can't trace why
36
+
37
+ 1. Add logging at each step of the execution path
38
+ 2. Binary search: is the bug before or after the midpoint?
39
+ 3. `search_for_pattern("suspicious_pattern")` to find related code
40
+ 4. Check git history: `git log --oneline -20 -- path/to/file` β€” when was it last changed?
41
+ 5. Check: is it a dependency issue? Library version mismatch?
42
+ 6. **5ν„΄ μ§„μ „ μ—†μŒ**: ν˜„μž¬ 뢄석 κ²°κ³Όλ₯Ό progress에 기둝, λ‹€λ₯Έ κ°€μ„€λ‘œ μ „ν™˜
43
+
44
+ ---
45
+
46
+ ## Bug Is in Another Agent's Domain
47
+
48
+ **Symptoms**: Frontend bug caused by backend API, or vice versa
49
+
50
+ 1. Confirm: is the root cause really in the other domain?
51
+ 2. Document the cross-domain issue clearly:
52
+ - Which endpoint/component is wrong
53
+ - What the correct behavior should be
54
+ - Evidence (request/response logs, stack trace)
55
+ 3. Record in result: `cross_domain_issue: {agent: "backend", description: "..."}`
56
+ 4. **직접 μˆ˜μ •ν•˜μ§€ 말 것** β€” λ‹€λ₯Έ μ—μ΄μ „νŠΈμ˜ μ½”λ“œλ₯Ό κ±΄λ“œλ¦¬λ©΄ 좩돌 λ°œμƒ
57
+
58
+ ---
59
+
60
+ ## Performance Bug Hard to Measure
61
+
62
+ **Symptoms**: "It's slow" but no clear metric
63
+
64
+ 1. Establish baseline: measure current response time / render time
65
+ 2. Backend: enable SQL query logging, count queries, check `EXPLAIN ANALYZE`
66
+ 3. Frontend: run Lighthouse, check React DevTools Profiler
67
+ 4. Mobile: use Flutter DevTools performance tab
68
+ 5. Profile before fixing β€” never optimize without data
69
+
70
+ ---
71
+
72
+ ## Test Cannot Be Written
73
+
74
+ **Symptoms**: Bug is real but hard to test (race condition, environment-specific)
75
+
76
+ 1. Try: mock the timing / environment condition
77
+ 2. Try: integration test instead of unit test
78
+ 3. If truly untestable: document the manual reproduction steps
79
+ 4. Add a comment in code explaining why the fix is correct
80
+ 5. Note in result: `test_limitation: "reason why automated test is not feasible"`
81
+
82
+ ---
83
+
84
+ ## Rate Limit / Quota / Memory Fallback
85
+
86
+ 동일: backend-agent ν”Œλ ˆμ΄λΆμ˜ ν•΄λ‹Ή μ„Ήμ…˜ μ°Έμ‘°.
87
+
88
+ ---
89
+
90
+ ## 일반 원칙
91
+
92
+ - **3회 μ‹€νŒ¨**: 같은 μ ‘κ·Ό 3번 μ‹€νŒ¨ν•˜λ©΄ λ°˜λ“œμ‹œ λ‹€λ₯Έ 방법 μ‹œλ„
93
+ - **λ§‰νž˜**: 5ν„΄ 이상 μ§„μ „ μ—†μœΌλ©΄ ν˜„μž¬ μƒνƒœ μ €μž₯, `Status: blocked`
94
+ - **λ²”μœ„ 초과**: λ‹€λ₯Έ μ—μ΄μ „νŠΈ μ˜μ—­μ€ 기둝만, 직접 μˆ˜μ • κΈˆμ§€
@@ -0,0 +1,87 @@
1
+ # Debug Agent - Examples
2
+
3
+ ## Example 1: Null Reference Error
4
+
5
+ **Input**: "TodoList crashes with 'Cannot read property map of undefined'"
6
+
7
+ **Output**:
8
+ ```
9
+ ## Bug Analysis
10
+
11
+ **Root Cause**: TodoList renders before API data loads. `todos` is undefined
12
+ on first render, and `.map()` is called immediately.
13
+
14
+ **Why**: useEffect fetches async, but component doesn't guard against
15
+ undefined initial state.
16
+
17
+ ## Fix
18
+ - Before: `todos.map(t => <TodoItem ... />)`
19
+ - After: `todos?.map(t => <TodoItem ... />) ?? <EmptyState />`
20
+ - Also added loading spinner while fetching
21
+
22
+ ## Changes Made
23
+ 1. Added `if (isLoading) return <Spinner />`
24
+ 2. Added optional chaining on `todos?.map()`
25
+ 3. Added empty state component
26
+
27
+ ## Files Modified
28
+ - src/components/TodoList.tsx (guard + loading state)
29
+ - src/components/EmptyState.tsx (NEW)
30
+ - tests/TodoList.test.tsx (regression test)
31
+
32
+ ## Prevention
33
+ Use TanStack Query which provides `isLoading`/`data` pattern by default.
34
+ ```
35
+
36
+ ## Example 2: N+1 Query Performance Bug
37
+
38
+ **Input**: "The posts page takes 3 seconds to load with only 50 posts"
39
+
40
+ **Output**:
41
+ ```
42
+ ## Bug Analysis
43
+
44
+ **Root Cause**: N+1 query. For each post, a separate SQL query fetches
45
+ the author. 50 posts = 51 queries.
46
+
47
+ **Why**: SQLAlchemy lazy-loads relationships by default.
48
+
49
+ ## Fix
50
+ - Before: `db.query(Post).all()`
51
+ - After: `db.query(Post).options(joinedload(Post.author)).all()`
52
+
53
+ ## Changes Made
54
+ 1. Added eager loading with joinedload
55
+ 2. Load time: 3000ms -> 45ms
56
+
57
+ ## Files Modified
58
+ - app/api/posts.py (eager loading)
59
+ - tests/test_posts.py (performance assertion: < 200ms)
60
+ ```
61
+
62
+ ## Example 3: Race Condition
63
+
64
+ **Input**: "Search results show wrong data when typing fast"
65
+
66
+ **Output**:
67
+ ```
68
+ ## Bug Analysis
69
+
70
+ **Root Cause**: Race condition. Fast typing triggers multiple API calls.
71
+ Slower early requests resolve after faster recent ones, overwriting
72
+ correct results.
73
+
74
+ **Why**: No request cancellation; last-write-wins causes stale data.
75
+
76
+ ## Fix
77
+ Added AbortController to cancel previous request on new keystroke.
78
+
79
+ ## Changes Made
80
+ 1. useEffect cleanup cancels pending request
81
+ 2. Added debounce (300ms) to reduce API calls
82
+ 3. Added `cancelled` flag to ignore stale responses
83
+
84
+ ## Files Modified
85
+ - src/hooks/useSearch.ts (abort + debounce)
86
+ - tests/useSearch.test.ts (race condition test)
87
+ ```
@@ -0,0 +1,51 @@
1
+ # Debug Agent - Execution Protocol
2
+
3
+ ## Step 0: Prepare
4
+ 1. **Assess difficulty** β€” see `../_shared/difficulty-guide.md`
5
+ - **Simple**: Skip to Step 3 | **Medium**: All 4 steps | **Complex**: All steps + checkpoints
6
+ 2. **Check lessons** β€” read your domain section in `../_shared/lessons-learned.md`
7
+ 3. **Clarify requirements** β€” follow `../_shared/clarification-protocol.md`
8
+ - Check **Uncertainty Triggers**: λ³΄μ•ˆ/인증 κ΄€λ ¨ 버그, κΈ°μ‘΄ μ½”λ“œ 좩돌 κ°€λŠ₯μ„±?
9
+ - Determine level: LOW β†’ proceed | MEDIUM β†’ present options | HIGH β†’ ask immediately
10
+ 4. **Use reasoning templates** β€” for Complex bugs, use `../_shared/reasoning-templates.md` (hypothesis loop, execution trace)
11
+ 5. **Budget context** β€” follow `../_shared/context-budget.md` (use find_symbol, not read_file)
12
+
13
+ **⚠️ Intelligent Escalation**: When uncertain, escalate early. Don't blindly proceed.
14
+
15
+ Follow these steps in order (adjust depth by difficulty).
16
+
17
+ ## Step 1: Understand
18
+ - Gather: What happened? What was expected? Error messages? Steps to reproduce?
19
+ - Read relevant code using Serena:
20
+ - `find_symbol("functionName")`: Locate the failing function
21
+ - `find_referencing_symbols("Component")`: Find all callers
22
+ - `search_for_pattern("error pattern")`: Find similar issues
23
+ - Classify: logic bug, runtime error, performance issue, security flaw, or integration failure
24
+
25
+ ## Step 2: Reproduce & Diagnose
26
+ - Trace execution flow from entry point to failure
27
+ - Identify the exact line and condition that causes the bug
28
+ - Determine root cause (not just symptom):
29
+ - Null/undefined access?
30
+ - Race condition?
31
+ - Missing validation?
32
+ - Wrong assumption about data shape?
33
+ - Check `resources/common-patterns.md` for known patterns
34
+
35
+ ## Step 3: Fix & Test
36
+ - Apply minimal fix that addresses the root cause
37
+ - Write a regression test that:
38
+ - Fails without the fix
39
+ - Passes with the fix
40
+ - Covers the specific edge case
41
+ - Check for similar patterns elsewhere: `search_for_pattern("same_bug_pattern")`
42
+ - If found, fix proactively or report them
43
+
44
+ ## Step 4: Document & Verify
45
+ - Run `resources/checklist.md` items
46
+ - Save bug report to `.gemini/antigravity/brain/bugs/` using `resources/bug-report-template.md`
47
+ - Include: root cause, fix, prevention advice
48
+ - Verify no regressions in related functionality
49
+
50
+ ## On Error
51
+ See `resources/error-playbook.md` for recovery steps.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: frontend-agent
3
+ description: Frontend specialist for React, Next.js, TypeScript, and modern UI development
4
+ ---
5
+
6
+ # Frontend Agent - UI/UX Specialist
7
+
8
+ ## When to use
9
+ - Building user interfaces and components
10
+ - Client-side logic and state management
11
+ - Styling and responsive design
12
+ - Form validation and user interactions
13
+ - Integrating with backend APIs
14
+
15
+ ## When NOT to use
16
+ - Backend API implementation -> use Backend Agent
17
+ - Native mobile development -> use Mobile Agent
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
26
+
27
+ ## How to Execute
28
+ Follow `resources/execution-protocol.md` step by step.
29
+ See `resources/examples.md` for input/output examples.
30
+ Before submitting, run `resources/checklist.md`.
31
+
32
+ ## Serena Memory (CLI Mode)
33
+ See `../_shared/serena-memory-protocol.md`.
34
+
35
+ ## References
36
+ - Execution steps: `resources/execution-protocol.md`
37
+ - Code examples: `resources/examples.md`
38
+ - Code snippets: `resources/snippets.md`
39
+ - Checklist: `resources/checklist.md`
40
+ - Error recovery: `resources/error-playbook.md`
41
+ - Tech stack: `resources/tech-stack.md`
42
+ - Component template: `resources/component-template.tsx`
43
+ - Tailwind rules: `resources/tailwind-rules.md`
44
+ - Context loading: `../_shared/context-loading.md`
45
+ - Reasoning templates: `../_shared/reasoning-templates.md`
46
+ - Clarification: `../_shared/clarification-protocol.md`
47
+ - Context budget: `../_shared/context-budget.md`
48
+ - Lessons learned: `../_shared/lessons-learned.md`
@@ -0,0 +1,38 @@
1
+ # Frontend Agent - Self-Verification Checklist
2
+
3
+ Run through every item before submitting your work.
4
+
5
+ ## TypeScript
6
+ - [ ] Strict mode, no `any` types
7
+ - [ ] Explicit interfaces for all component props
8
+ - [ ] No TypeScript errors (`npx tsc --noEmit`)
9
+
10
+ ## Styling
11
+ - [ ] Tailwind CSS only (no inline styles, no CSS modules)
12
+ - [ ] Responsive at 320px, 768px, 1024px, 1440px
13
+ - [ ] Dark mode supported (if project uses it)
14
+ - [ ] No hardcoded colors (use Tailwind theme tokens)
15
+
16
+ ## Accessibility (WCAG 2.1 AA)
17
+ - [ ] Semantic HTML elements (`<nav>`, `<main>`, `<button>`)
18
+ - [ ] All images have alt text
19
+ - [ ] Color contrast >= 4.5:1 (normal text), >= 3:1 (large text)
20
+ - [ ] Keyboard navigation works for all interactive elements
21
+ - [ ] ARIA labels on non-obvious interactive elements
22
+ - [ ] Focus indicators visible
23
+
24
+ ## UX States
25
+ - [ ] Loading state (skeleton or spinner)
26
+ - [ ] Error state (user-friendly message + retry action)
27
+ - [ ] Empty state (helpful message + CTA)
28
+ - [ ] Optimistic updates where appropriate
29
+
30
+ ## Performance
31
+ - [ ] No unnecessary re-renders (check with React DevTools Profiler)
32
+ - [ ] Code splitting for route-level components
33
+ - [ ] Images optimized and lazy-loaded
34
+
35
+ ## Testing
36
+ - [ ] Unit tests for components with logic
37
+ - [ ] User interactions tested (click, type, submit)
38
+ - [ ] Async behavior tested (loading -> data -> display)