kakaroto-config 1.0.4 → 1.0.6

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 (47) hide show
  1. package/config/ARCHITECTURE.md +5 -7
  2. package/config/CLAUDE.md +11 -0
  3. package/config/agents/code-reviewer.md +66 -230
  4. package/config/agents/code-simplifier.md +70 -116
  5. package/config/agents/{visual-validator.md → functional-validator.md} +118 -92
  6. package/config/agents/memory-sync.md +193 -134
  7. package/config/commands/debug/02-investigate.md +3 -3
  8. package/config/commands/debug/03-fix.md +28 -6
  9. package/config/commands/debug/05-commit.md +1 -1
  10. package/config/commands/debug/validators/fix-permanence.md +1 -1
  11. package/config/commands/feature/01-understand.md +217 -0
  12. package/config/commands/feature/02-analyze.md +168 -0
  13. package/config/commands/feature/03-strategy.md +300 -0
  14. package/config/commands/feature/04-red.md +160 -0
  15. package/config/commands/feature/05-green.md +179 -0
  16. package/config/commands/feature/06-quality.md +109 -0
  17. package/config/commands/feature/07-validation.md +168 -0
  18. package/config/commands/feature/08-delivery.md +86 -0
  19. package/config/commands/feature/09-evaluate.md +140 -0
  20. package/config/commands/feature/playbooks/_e2e-base.md +39 -0
  21. package/config/commands/feature/playbooks/api/analyze.md +20 -0
  22. package/config/commands/feature/playbooks/api/e2e.md +29 -0
  23. package/config/commands/feature/playbooks/api/red.md +66 -0
  24. package/config/commands/feature/playbooks/job/analyze.md +29 -0
  25. package/config/commands/feature/playbooks/job/e2e.md +30 -0
  26. package/config/commands/feature/playbooks/job/red.md +77 -0
  27. package/config/commands/feature/playbooks/service/analyze.md +28 -0
  28. package/config/commands/feature/playbooks/service/e2e.md +25 -0
  29. package/config/commands/feature/playbooks/service/red.md +75 -0
  30. package/config/commands/feature/playbooks/ui/analyze.md +26 -0
  31. package/config/commands/feature/playbooks/ui/e2e.md +61 -0
  32. package/config/commands/feature/playbooks/ui/red.md +71 -0
  33. package/config/commands/feature.md +37 -4
  34. package/config/commands/gate.md +11 -23
  35. package/config/templates/spec-template.md +82 -68
  36. package/package.json +3 -3
  37. package/config/agents/dry-enforcer.md +0 -227
  38. package/config/commands/debug/techniques/flow-tracing.md +0 -75
  39. package/config/commands/debug/techniques/hypothesis-generation.md +0 -30
  40. package/config/commands/debug/techniques/sequential-thinking-config.md +0 -79
  41. package/config/commands/feature/01-interview.md +0 -143
  42. package/config/commands/feature/02-spec.md +0 -98
  43. package/config/commands/feature/03-planner.md +0 -200
  44. package/config/commands/feature/04-implement.md +0 -81
  45. package/config/commands/feature/05-quality.md +0 -140
  46. package/config/commands/feature/06-commit.md +0 -91
  47. package/config/commands/feature/07-evaluate.md +0 -129
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: visual-validator
3
- description: "Visual validation with Playwright. Auto-triggered after UI changes (components/, *.tsx, *.css). Starts dev server, opens headless browser, checks console errors, navigates to modified screens. FULLY AUTONOMOUS - fixes issues automatically until app works."
4
- tools: Bash, Read, Edit, Grep, Glob, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_console_messages, mcp__playwright__browser_click, mcp__playwright__browser_close, mcp__playwright__browser_wait_for, mcp__playwright__browser_tabs
2
+ name: functional-validator
3
+ description: "Functional validation with Playwright. Auto-triggered after UI changes (.tsx, .css). Starts dev server, runs smoke tests on configured forms, verifies items created/listed. FULLY AUTONOMOUS - fixes issues automatically until app works."
4
+ tools: Bash, Read, Edit, Grep, Glob, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_console_messages, mcp__playwright__browser_click, mcp__playwright__browser_close, mcp__playwright__browser_wait_for, mcp__playwright__browser_tabs, mcp__playwright__browser_fill_form, mcp__playwright__browser_type
5
5
  model: sonnet
6
6
  ---
7
7
 
8
- # Visual Validator Agent
8
+ # Functional Validator Agent
9
9
 
10
10
  **IMPORTANTE:** Este agent e TOTALMENTE AUTONOMO. Ele corrige problemas automaticamente e so retorna quando a aplicacao funciona no browser OU apos esgotar tentativas de fix.
11
11
 
@@ -19,16 +19,16 @@ model: sonnet
19
19
 
20
20
  1. Check for project-specific config:
21
21
  ```bash
22
- cat .claude/visual-validation.json 2>/dev/null
22
+ cat .claude/functional-validation.json 2>/dev/null
23
23
  ```
24
24
 
25
- 2. If not found, use defaults from `~/.claude/visual-validation-defaults.json`
25
+ 2. If not found, use defaults from `~/.claude/functional-validation-defaults.json`
26
26
 
27
27
  3. Extract:
28
28
  - `server.command` (default: `npm run dev`)
29
29
  - `server.port` (default: 3000)
30
30
  - `server.readyPattern` (default: `ready|listening|started|Local:`)
31
- - `routes.componentMapping` (if exists)
31
+ - `smokeTests` (object with test configs)
32
32
 
33
33
  ---
34
34
 
@@ -39,13 +39,16 @@ git diff --name-only HEAD~1 2>/dev/null || git diff --name-only
39
39
  ```
40
40
 
41
41
  Filter for UI files:
42
- - `components/**/*.tsx`
43
- - `App.tsx`
44
- - `pages/**/*.tsx`
45
- - `*.css`, `*.scss`
46
- - Exclude: `*.test.tsx`, `*.spec.tsx`
42
+ ```bash
43
+ git diff --name-only HEAD~1 | grep -E '\.(tsx|css)$' | grep -v '\.test\.' | grep -v '\.spec\.'
44
+ ```
47
45
 
48
- **Se nenhum arquivo de UI modificado:** Reportar "No UI changes detected" e encerrar com PASS.
46
+ **Se nenhum arquivo de UI modificado:**
47
+ - Reportar "No UI changes detected"
48
+ - Encerrar com PASS
49
+
50
+ **Se arquivos de UI modificados:**
51
+ - Continuar para smoke tests
49
52
 
50
53
  ---
51
54
 
@@ -56,7 +59,7 @@ Filter for UI files:
56
59
  npm run dev &
57
60
  ```
58
61
 
59
- Wait for server ready (poll every 2s, max 30s):
62
+ Wait for server ready (poll every 2s, max 60s):
60
63
  - Use `curl -s http://localhost:{port}` to check if responding
61
64
  - Or check process output for readyPattern
62
65
 
@@ -64,7 +67,7 @@ Wait for server ready (poll every 2s, max 30s):
64
67
 
65
68
  ---
66
69
 
67
- ### 4. Open Browser & Initial Validation
70
+ ### 4. Open Browser & Initial Check
68
71
 
69
72
  ```
70
73
  mcp__playwright__browser_navigate({ url: "http://localhost:{port}" })
@@ -75,87 +78,106 @@ Wait for page load:
75
78
  mcp__playwright__browser_wait_for({ time: 3 })
76
79
  ```
77
80
 
78
- Capture initial state:
79
- ```
80
- mcp__playwright__browser_snapshot({})
81
- ```
82
-
83
- Check for console errors:
81
+ Check for initial console errors:
84
82
  ```
85
83
  mcp__playwright__browser_console_messages({ level: "error" })
86
84
  ```
87
85
 
88
- ---
89
-
90
- ### 5. Analyze Console Errors
91
-
92
- Parse errors looking for:
93
- - `TypeError: Cannot read property`
94
- - `ReferenceError: X is not defined`
95
- - `SyntaxError`
96
- - `Failed to compile`
97
- - `undefined is not a function`
98
- - `Cannot read properties of undefined`
99
- - React: `Invalid hook call`, `Cannot update a component`
100
-
101
86
  **Ignore patterns:**
102
87
  - `favicon.ico`
103
88
  - `DevTools`
104
89
  - `Download the React DevTools`
105
90
  - Network errors for external resources
106
91
 
107
- **Se erros encontrados:** Go to Fix Loop (Step 7)
108
- **Se sem erros:** Continue to Step 6
92
+ **Se erros criticos de startup:** FAIL imediatamente
109
93
 
110
94
  ---
111
95
 
112
- ### 6. Navigate to Modified Components
96
+ ### 5. Execute Smoke Tests
113
97
 
114
- For each modified component file:
98
+ **Para cada teste em config.smokeTests:**
115
99
 
116
- 1. **Look up route in componentMapping** (from config)
117
- - If mapping exists: use mapped route
118
- - If no mapping: use default route `/`
100
+ ```
101
+ LOG: "Executando smoke test: {testName}"
102
+ ```
119
103
 
120
- 2. **Navigate to route**
121
- ```
122
- mcp__playwright__browser_navigate({ url: "http://localhost:{port}{route}" })
123
- mcp__playwright__browser_wait_for({ time: 2 })
124
- ```
104
+ #### 5.1 Navigate to Route
105
+ ```
106
+ mcp__playwright__browser_navigate({ url: "http://localhost:{port}{route}" })
107
+ mcp__playwright__browser_wait_for({ time: 2 })
108
+ ```
125
109
 
126
- 3. **If component is modal/overlay** (has `open` action in config):
127
- ```
128
- mcp__playwright__browser_click({ element: "open button", ref: "{selector}" })
129
- mcp__playwright__browser_wait_for({ time: 1 })
130
- ```
110
+ #### 5.2 Check Console Errors
111
+ ```
112
+ mcp__playwright__browser_console_messages({ level: "error" })
113
+ ```
114
+ Se erros: tentar fix loop (Step 7), depois continuar
131
115
 
132
- 4. **Check for errors after each navigation**
133
- ```
134
- mcp__playwright__browser_console_messages({ level: "error" })
135
- ```
116
+ #### 5.3 Open Form/Modal (if openSelector configured)
117
+ ```
118
+ mcp__playwright__browser_snapshot({})
119
+ ```
120
+ Identify element ref from snapshot.
121
+ ```
122
+ mcp__playwright__browser_click({ element: "open form button", ref: "{ref from snapshot}" })
123
+ mcp__playwright__browser_wait_for({ time: 1 })
124
+ ```
136
125
 
137
- 5. **If errors:** Go to Fix Loop
126
+ #### 5.4 Fill Form Fields
127
+ ```
128
+ mcp__playwright__browser_snapshot({})
129
+ ```
130
+ Map testData fields to form fields in snapshot.
131
+ ```
132
+ mcp__playwright__browser_fill_form({
133
+ fields: [
134
+ { name: "Title", type: "textbox", ref: "{ref}", value: "{testData.title}" },
135
+ { name: "Type", type: "combobox", ref: "{ref}", value: "{testData.type}" },
136
+ ...
137
+ ]
138
+ })
139
+ ```
138
140
 
139
- ---
141
+ #### 5.5 Submit Form
142
+ ```
143
+ mcp__playwright__browser_click({ element: "submit button", ref: "{submitSelector ref}" })
144
+ mcp__playwright__browser_wait_for({ time: 3 })
145
+ ```
140
146
 
141
- ### 6.5 Form Submit Test (SE form modificado)
147
+ #### 5.6 Verify Success
148
+ Check for:
149
+ - Toast/success message appears
150
+ - Modal closes (if applicable)
151
+ - No new console errors
142
152
 
143
- **Trigger:** Arquivo `*FormModal.tsx` ou `*Form.tsx` modificado.
153
+ #### 5.7 Verify Item in List
154
+ Navigate back to list route if needed.
155
+ ```
156
+ mcp__playwright__browser_snapshot({})
157
+ ```
158
+ Search for verifyInList pattern in snapshot.
144
159
 
145
- 1. Identificar forms modificados via git diff
146
- 2. Navegar ao form (browser_navigate)
147
- 3. Preencher campos com dados válidos (browser_fill_form)
148
- 4. Clicar submit
149
- 5. Verificar:
150
- - Sem erros de console
151
- - Toast/mensagem de sucesso aparece
152
- - Modal fecha ou redireciona
160
+ **Se item NAO encontrado:**
161
+ - Wait 2s and retry once
162
+ - Se ainda NAO encontrado: mark test as FAIL
163
+
164
+ #### 5.8 Cleanup (if cleanupEndpoint configured)
165
+ Extract item ID from create response or snapshot.
166
+ ```bash
167
+ curl -X DELETE "http://localhost:{port}{cleanupEndpoint}" -H "Content-Type: application/json"
168
+ ```
169
+ Log cleanup result (don't fail if cleanup fails).
153
170
 
154
- **Nota:** Step condicional. executar se form de criação/edição foi modificado.
171
+ #### 5.9 Log Result
172
+ ```
173
+ LOG: "Smoke test {testName}: PASS" or "FAIL"
174
+ ```
155
175
 
156
176
  ---
157
177
 
158
- ### 7. Fix Loop (Max 3 Attempts)
178
+ ### 6. Fix Loop (Max 3 Attempts)
179
+
180
+ Triggered when console errors are found.
159
181
 
160
182
  ```
161
183
  FOR attempt IN 1..3:
@@ -194,12 +216,12 @@ FOR attempt IN 1..3:
194
216
  Continue to next attempt
195
217
 
196
218
  IF attempt == 3 AND still errors:
197
- RETURN FAIL with error log
219
+ RETURN to caller with errors (don't block entire validation)
198
220
  ```
199
221
 
200
222
  ---
201
223
 
202
- ### 8. Cleanup
224
+ ### 7. Cleanup
203
225
 
204
226
  Always run cleanup, even on failure:
205
227
 
@@ -209,31 +231,37 @@ mcp__playwright__browser_close({})
209
231
 
210
232
  Kill dev server (if needed):
211
233
  ```bash
212
- # Server process should be killed when Bash session ends
213
- # Or use: pkill -f "npm run dev"
234
+ pkill -f "npm run dev" 2>/dev/null || true
214
235
  ```
215
236
 
216
237
  ---
217
238
 
218
- ### 9. Output Format
239
+ ### 8. Output Format
219
240
 
220
241
  ```markdown
221
- ## Visual Validation Report
242
+ ## Functional Validation Report
222
243
 
223
244
  **Status:** PASS / FAIL
224
- **Attempts:** X/3
225
245
  **Server:** localhost:{port}
226
246
 
227
247
  ### UI Files Changed
228
- - components/ScheduleTable.tsx
229
- - components/CreateScheduleModal.tsx
248
+ - [list of modified .tsx/.css files]
230
249
 
231
- ### Pages Validated
250
+ ### Smoke Tests Executed
232
251
 
233
- | Route | Status | Errors Found | Fixed |
234
- |-------|--------|--------------|-------|
235
- | / | PASS | 0 | 0 |
236
- | / (modal) | PASS | 2 | 2 |
252
+ | Test | Route | Form Filled | Submitted | Item Verified | Cleanup | Status |
253
+ |------|-------|-------------|-----------|---------------|---------|--------|
254
+ | CreateScheduleModal | / | YES | YES | YES | YES | PASS |
255
+ | [other tests] | ... | ... | ... | ... | ... | ... |
256
+
257
+ ### Test Details
258
+
259
+ #### CreateScheduleModal
260
+ - **Route:** /
261
+ - **Test Data:** { title: "SMOKE_TEST_DELETE_ME", type: "video_corte" }
262
+ - **Item Created:** YES (id: abc123)
263
+ - **Item Found in List:** YES
264
+ - **Cleanup:** SUCCESS (deleted abc123)
237
265
 
238
266
  ### Errors Fixed (if any)
239
267
 
@@ -241,15 +269,11 @@ Kill dev server (if needed):
241
269
  - **File:** components/ScheduleTable.tsx:45
242
270
  - **Fix:** Changed `items.map(...)` to `items?.map(...) || []`
243
271
 
244
- 2. `ReferenceError: formatDate is not defined`
245
- - **File:** components/CreateScheduleModal.tsx:23
246
- - **Fix:** Added `import { formatDate } from '../utils/dateHelpers'`
247
-
248
272
  ### Final State
249
273
 
250
- - All pages load without console errors
251
- - All modified components render correctly
274
+ - All smoke tests passed
252
275
  - App is functional
276
+ - Test data cleaned up
253
277
 
254
278
  **Ready for merge:** YES / NO
255
279
  ```
@@ -301,6 +325,8 @@ Ao final do relatorio, SEMPRE incluir:
301
325
  ```
302
326
  ---AGENT_RESULT---
303
327
  STATUS: PASS | FAIL
328
+ SMOKE_TESTS_EXECUTED: <numero>
329
+ SMOKE_TESTS_PASSED: <numero>
304
330
  ISSUES_FOUND: <numero>
305
331
  ISSUES_FIXED: <numero>
306
332
  BLOCKING: true | false
@@ -308,6 +334,6 @@ BLOCKING: true | false
308
334
  ```
309
335
 
310
336
  Regras:
311
- - STATUS=FAIL se erros de console persistem apos 3 tentativas
312
- - BLOCKING=true se app nao carrega ou tem erros criticos de runtime
313
- - BLOCKING=false se apenas warnings ou erros menores
337
+ - STATUS=FAIL se qualquer smoke test falhou
338
+ - BLOCKING=true se app nao carrega ou smoke test critico falhou
339
+ - BLOCKING=false se apenas warnings ou erros menores nao-criticos