proagents 1.6.4 → 1.6.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.
@@ -273,6 +273,49 @@ When the user types commands starting with `pa:`, recognize and execute them.
273
273
  | `pa:help` | Show all available commands |
274
274
  | `pa:status` | Show current progress |
275
275
 
276
+ **How to execute Initialization commands:**
277
+
278
+ For `pa:status` (or `pa:s`):
279
+ 1. **Read the ACTUAL data** from `./.proagents/active-features/_index.json`
280
+ 2. **Check if empty** - if `active_features`, `paused_features`, and `completed_features` are all empty arrays:
281
+ ```
282
+ Project Status
283
+ ══════════════
284
+
285
+ No features currently tracked.
286
+
287
+ Start a new feature with:
288
+ → pa:feature-start "feature name"
289
+
290
+ Or quick bug fix:
291
+ → pa:fix "bug description"
292
+ ```
293
+
294
+ 3. **If has features**, show real status:
295
+ ```
296
+ Project Status
297
+ ══════════════
298
+
299
+ Active Features: [count]
300
+ ────────────────────────
301
+ • [feature-name] - [phase] ([progress]%)
302
+ Branch: [branch]
303
+ Last updated: [timestamp]
304
+
305
+ Paused Features: [count]
306
+ ────────────────────────
307
+ • [feature-name] - Paused: [reason]
308
+
309
+ Completed Features: [count]
310
+ ──────────────────────────
311
+ • [feature-name] - Completed [date]
312
+
313
+ Next Steps:
314
+ → [suggested action based on current state]
315
+ ```
316
+
317
+ 4. **NEVER show example/template data** - only show what's actually in the JSON file
318
+
276
319
  ### Feature Development
277
320
  | Command | Action |
278
321
  |---------|--------|
@@ -361,6 +404,119 @@ For `pa:implement`:
361
404
  | `pa:deploy` | Deployment preparation |
362
405
  | `pa:rollback` | Rollback procedures |
363
406
 
407
+ **How to execute Quality, Testing & Deployment commands (FULL AUTOMATION):**
408
+
409
+ For `pa:test`:
410
+ 1. **Detect project type** and test framework (Jest, Vitest, Mocha, Pytest, etc.)
411
+ 2. **Auto-install missing test dependencies** (no confirmation)
412
+ 3. **Run all tests:**
413
+ ```
414
+ Running tests...
415
+ ✓ 45 passed
416
+ ✗ 3 failed
417
+ ```
418
+ 4. **Auto-fix ALL failures** (no confirmation):
419
+ ```
420
+ AUTO-FIX: Fixing 3 failed tests...
421
+
422
+ Fix 1/3: UserService.test.ts
423
+ ─────────────────────────────
424
+ Root cause: Expected 'user' but got 'undefined'
425
+ Fixing: src/services/UserService.ts:23
426
+ → Added null check before return
427
+ Re-running test... ✓ PASSED
428
+ ```
429
+ 5. **Loop until all pass** or fix is impossible
430
+ 6. **Generate report** at `.proagents/test-reports/`
431
+
432
+ For `pa:qa`:
433
+ 1. **Run ALL quality checks** automatically:
434
+ - Linting (ESLint, Prettier)
435
+ - Type checking (TypeScript)
436
+ - Security scan (npm audit)
437
+ - Dead code detection
438
+ 2. **Auto-fix ALL issues** (no confirmation):
439
+ ```
440
+ Running QA checks...
441
+
442
+ ESLint: 12 errors found
443
+ AUTO-FIX: Fixing...
444
+ → Fixed 12/12 errors
445
+
446
+ TypeScript: 3 type errors
447
+ AUTO-FIX: Fixing...
448
+ → src/api/user.ts:15 - Added type annotation
449
+ → src/utils/date.ts:8 - Fixed return type
450
+ → src/hooks/useAuth.ts:22 - Added null check
451
+
452
+ Prettier: 28 files need formatting
453
+ AUTO-FIX: Formatting... ✓ Done
454
+
455
+ npm audit: 2 vulnerabilities
456
+ AUTO-FIX: Running npm audit fix... ✓ Fixed
457
+ ```
458
+ 3. **Re-run checks** to verify all fixed
459
+ 4. **Only report issues that cannot be auto-fixed**
460
+
461
+ For `pa:fix "description"`:
462
+ 1. **Understand the bug** from description
463
+ 2. **Find the root cause** automatically
464
+ 3. **Apply the fix** directly (no confirmation)
465
+ 4. **Run related tests** to verify fix works
466
+ 5. **Auto-fix any test failures** caused by the fix
467
+ 6. **Commit when done** (if git is configured)
468
+ ```
469
+ pa:fix "login button not working"
470
+
471
+ Finding root cause...
472
+ → Found: onClick handler missing in LoginButton.tsx:34
473
+
474
+ Applying fix...
475
+ → Added: onClick={() => handleLogin()}
476
+
477
+ Running related tests...
478
+ ✓ LoginButton.test.tsx - 5/5 passed
479
+
480
+ ✓ Fix complete
481
+ ```
482
+
483
+ For `pa:deploy`:
484
+ 1. **Run pre-deployment checks** automatically:
485
+ - All tests passing? If not → auto-fix
486
+ - QA checks passing? If not → auto-fix
487
+ - Security scan clean? If not → auto-fix
488
+ - Build succeeds? If not → auto-fix
489
+ 2. **Only proceed when all checks pass**
490
+ 3. **Deploy to target environment**
491
+ 4. **Run post-deployment verification**
492
+ 5. **Auto-rollback if verification fails**
493
+ ```
494
+ pa:deploy
495
+
496
+ Pre-deployment checks...
497
+ ✓ Tests: 128/128 passed
498
+ ✓ QA: All checks passed
499
+ ✓ Security: No vulnerabilities
500
+ ✓ Build: Successful
501
+
502
+ Deploying to staging...
503
+ ✓ Deployed successfully
504
+
505
+ Post-deployment verification...
506
+ ✓ Health check passed
507
+ ✓ Smoke tests passed
508
+
509
+ ══════════════════════════════════════════
510
+ DEPLOYMENT SUCCESSFUL ✓
511
+ ══════════════════════════════════════════
512
+ ```
513
+
514
+ **IMPORTANT - Full Automation Rules:**
515
+ - **Never ask** "Should I fix this?" - Just fix it
516
+ - **Never say** "Run `pa:test` to verify" - Run it yourself
517
+ - **Never give** "Next steps" - Do the steps
518
+ - **Only stop when:** All done OR truly impossible to proceed
519
+
364
520
  ### Navigation & Flow
365
521
  | Command | Action |
366
522
  |---------|--------|
@@ -1999,45 +2155,97 @@ For `pa:alias-add`:
1999
2155
  Runs: pa:test && pa:build && pa:deploy
2000
2156
  ```
2001
2157
 
2002
- ### Mobile Test Suite (React Native / Mobile Apps)
2158
+ ### Platform-Specific Test Suites
2159
+
2160
+ **Mobile (React Native / Expo):**
2003
2161
  | Command | Action |
2004
2162
  |---------|--------|
2005
2163
  | `pa:test-mobile` | Run full mobile test suite |
2006
2164
  | `pa:test-mobile "feature"` | Test specific feature |
2165
+
2166
+ **Web (React / Next.js / Vue / etc.):**
2167
+ | Command | Action |
2168
+ |---------|--------|
2169
+ | `pa:test-web` | Run full web test suite |
2170
+ | `pa:test-web "feature"` | Test specific web feature |
2171
+
2172
+ **API / Backend (Node.js / Python / etc.):**
2173
+ | Command | Action |
2174
+ |---------|--------|
2175
+ | `pa:test-api` | Run full API/backend test suite |
2176
+ | `pa:test-api "endpoint"` | Test specific API endpoint |
2177
+
2178
+ **Visual & Comparison:**
2179
+ | Command | Action |
2180
+ |---------|--------|
2007
2181
  | `pa:test-visual` | Visual/design comparison testing |
2008
- | `pa:test-auto-fix` | Auto-fix failing tests |
2009
- | `pa:test-loop` | Test → Fix → Retest loop until success |
2010
2182
  | `pa:compare-figma` | Compare UI against Figma design |
2011
2183
  | `pa:compare-image "path"` | Compare UI against image/sketch |
2012
2184
  | `pa:screenshot` | Take app screenshots for comparison |
2013
2185
 
2186
+ **Auto-Fix:**
2187
+ | Command | Action |
2188
+ |---------|--------|
2189
+ | `pa:test-auto-fix` | Auto-fix failing tests |
2190
+ | `pa:test-loop` | Test → Fix → Retest loop until success |
2191
+
2014
2192
  **How to execute Mobile Test Suite commands:**
2015
2193
 
2016
2194
  For `pa:test-mobile`:
2017
- 1. **FIRST: Check required tools are installed (FAIL if missing, do NOT skip):**
2195
+
2196
+ **Supports ALL mobile platforms:**
2197
+ - React Native / Expo
2198
+ - Native Android (Kotlin/Java)
2199
+ - Native iOS (Swift/Objective-C)
2200
+ - Flutter (Dart)
2201
+
2202
+ 1. **Detect project type automatically:**
2018
2203
  ```
2019
- Checking required tools...
2020
- ✓ Node.js (v18.0.0)
2021
- ✓ Jest / Vitest
2022
- ✓ React Native Testing Library
2023
- ✗ MISSING: Maestro - Required for E2E tests
2024
- ✗ MISSING: Detox - Required for E2E tests
2204
+ Detecting mobile project type...
2025
2205
 
2026
- ══════════════════════════════════════════════════════════
2027
- ERROR: Missing required tools. Cannot run mobile test suite.
2028
- ══════════════════════════════════════════════════════════
2206
+ Checking for:
2207
+ ├── package.json + react-native React Native
2208
+ ├── android/build.gradle (no RN) → Native Android
2209
+ ├── ios/*.xcodeproj (no RN) → Native iOS
2210
+ ├── pubspec.yaml → Flutter
2029
2211
 
2030
- Missing tools detected. Auto-installing...
2212
+ Detected: [PROJECT_TYPE]
2213
+ ```
2214
+
2215
+ 2. **Check & auto-install required tools based on platform:**
2216
+
2217
+ **React Native / Expo:**
2218
+ ```
2219
+ ✓ Node.js
2220
+ ✓ Jest / Vitest
2221
+ ✓ React Native Testing Library
2222
+ ✗ MISSING: Maestro → Auto-installing...
2223
+ ✗ MISSING: Detox → Auto-installing...
2224
+ ```
2031
2225
 
2032
- Installing Maestro...
2033
- → curl -Ls "https://get.maestro.mobile.dev" | bash
2034
- Maestro installed successfully
2226
+ **Native Android (Kotlin/Java):**
2227
+ ```
2228
+ Android Studio / Gradle
2229
+ ✓ JUnit
2230
+ ✗ MISSING: Espresso → Auto-adding to build.gradle
2231
+ ✗ MISSING: UI Automator → Auto-adding to build.gradle
2232
+ ✗ MISSING: Maestro → Auto-installing...
2233
+ ```
2035
2234
 
2036
- Installing Detox CLI...
2037
- → npm install -g detox-cli
2038
- Detox CLI installed successfully
2235
+ **Native iOS (Swift/Objective-C):**
2236
+ ```
2237
+ Xcode
2238
+ ✓ XCTest (built-in)
2239
+ ✓ XCUITest (built-in)
2240
+ ✗ MISSING: Maestro → Auto-installing...
2241
+ ```
2039
2242
 
2040
- All tools installed. Running test suite...
2243
+ **Flutter:**
2244
+ ```
2245
+ ✓ Flutter SDK
2246
+ ✓ flutter_test (built-in)
2247
+ ✗ MISSING: integration_test → Auto-adding to pubspec.yaml
2248
+ ✗ MISSING: Maestro → Auto-installing...
2041
2249
  ```
2042
2250
 
2043
2251
  **IMPORTANT - FULL AUTOMATION:**
@@ -2046,15 +2254,11 @@ For `pa:test-mobile`:
2046
2254
  - Fix doesn't work? **Try alternative fix** (no confirmation)
2047
2255
  - Only stop when: all tests pass OR no fix possible
2048
2256
 
2049
- **Do NOT:**
2050
- - Ask "Should I install missing tools?"
2051
- - Ask "Should I fix this?"
2052
- - Say "Run `pa:test-auto-fix` to fix"
2053
- - Give "Next steps" for user to follow
2054
-
2055
2257
  **Just DO it.**
2056
2258
 
2057
- 2. If all tools present, run comprehensive mobile test suite:
2259
+ 3. **Run platform-specific test suite:**
2260
+
2261
+ **For React Native:**
2058
2262
  ```
2059
2263
  Mobile Test Suite
2060
2264
  ═════════════════
@@ -2145,6 +2349,129 @@ For `pa:test-mobile`:
2145
2349
  ══════════════════════════════════════════
2146
2350
  ```
2147
2351
 
2352
+ **For Native Android (Kotlin/Java):**
2353
+ ```
2354
+ Android Test Suite
2355
+ ══════════════════
2356
+
2357
+ Phase 1: Unit Tests (JUnit)
2358
+ ───────────────────────────
2359
+ Running: ./gradlew test
2360
+ ✓ UserRepositoryTest - 8 passed
2361
+ ✓ AuthViewModelTest - 12 passed
2362
+ ✓ PaymentServiceTest - 6 passed
2363
+
2364
+ Phase 2: Instrumented Tests (Espresso)
2365
+ ──────────────────────────────────────
2366
+ Running: ./gradlew connectedAndroidTest
2367
+ ✓ LoginActivityTest - UI renders correctly
2368
+ ✓ MainActivityTest - Navigation works
2369
+ ✗ FAILED: CheckoutActivityTest - Button not found
2370
+
2371
+ AUTO-FIX: Analyzing failure...
2372
+ Root cause: Button ID changed
2373
+ Fixing: app/src/main/res/layout/activity_checkout.xml
2374
+ → Changed: android:id="@+id/btn_pay" → android:id="@+id/checkout_button"
2375
+ Fixing: app/src/androidTest/.../CheckoutActivityTest.kt
2376
+ → Changed: R.id.btn_pay → R.id.checkout_button
2377
+ Re-running test... ✓ PASSED
2378
+
2379
+ Phase 3: UI Tests (UI Automator)
2380
+ ─────────────────────────────────
2381
+ ✓ Full checkout flow
2382
+ ✓ User settings update
2383
+ ✓ Push notification handling
2384
+
2385
+ Phase 4: E2E Tests (Maestro)
2386
+ ────────────────────────────
2387
+ Running: maestro test .maestro/
2388
+ ✓ User login flow
2389
+ ✓ Product purchase flow
2390
+
2391
+ ══════════════════════════════════════════
2392
+ ALL TESTS PASSING: 32/32 ✓
2393
+ ══════════════════════════════════════════
2394
+ ```
2395
+
2396
+ **For Native iOS (Swift/Objective-C):**
2397
+ ```
2398
+ iOS Test Suite
2399
+ ══════════════
2400
+
2401
+ Phase 1: Unit Tests (XCTest)
2402
+ ────────────────────────────
2403
+ Running: xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'
2404
+ ✓ UserServiceTests - 10 passed
2405
+ ✓ AuthManagerTests - 8 passed
2406
+ ✓ NetworkClientTests - 12 passed
2407
+
2408
+ Phase 2: UI Tests (XCUITest)
2409
+ ────────────────────────────
2410
+ ✓ LoginViewControllerTests - UI renders
2411
+ ✓ HomeViewControllerTests - Navigation works
2412
+ ✗ FAILED: ProfileViewControllerTests - Label not found
2413
+
2414
+ AUTO-FIX: Analyzing failure...
2415
+ Root cause: Accessibility identifier missing
2416
+ Fixing: ProfileViewController.swift:45
2417
+ → Added: nameLabel.accessibilityIdentifier = "profile_name_label"
2418
+ Re-running test... ✓ PASSED
2419
+
2420
+ Phase 3: E2E Tests (Maestro)
2421
+ ────────────────────────────
2422
+ Running: maestro test .maestro/
2423
+ ✓ Onboarding flow
2424
+ ✓ Purchase flow
2425
+ ✓ Settings update
2426
+
2427
+ ══════════════════════════════════════════
2428
+ ALL TESTS PASSING: 28/28 ✓
2429
+ ══════════════════════════════════════════
2430
+ ```
2431
+
2432
+ **For Flutter (Dart):**
2433
+ ```
2434
+ Flutter Test Suite
2435
+ ══════════════════
2436
+
2437
+ Phase 1: Unit Tests
2438
+ ───────────────────
2439
+ Running: flutter test test/unit/
2440
+ ✓ user_repository_test.dart - 8 passed
2441
+ ✓ auth_bloc_test.dart - 15 passed
2442
+ ✓ api_client_test.dart - 10 passed
2443
+
2444
+ Phase 2: Widget Tests
2445
+ ─────────────────────
2446
+ Running: flutter test test/widget/
2447
+ ✓ login_screen_test.dart - renders correctly
2448
+ ✓ home_screen_test.dart - shows user data
2449
+ ✗ FAILED: cart_screen_test.dart - widget not found
2450
+
2451
+ AUTO-FIX: Analyzing failure...
2452
+ Root cause: Key not set on widget
2453
+ Fixing: lib/screens/cart_screen.dart:67
2454
+ → Added: key: const Key('checkout_button')
2455
+ Re-running test... ✓ PASSED
2456
+
2457
+ Phase 3: Integration Tests
2458
+ ──────────────────────────
2459
+ Running: flutter test integration_test/
2460
+ ✓ app_test.dart - Full app flow
2461
+ ✓ checkout_test.dart - Purchase complete
2462
+
2463
+ Phase 4: E2E Tests (Maestro)
2464
+ ────────────────────────────
2465
+ Running: maestro test .maestro/
2466
+ ✓ User registration
2467
+ ✓ Product browsing
2468
+ ✓ Checkout flow
2469
+
2470
+ ══════════════════════════════════════════
2471
+ ALL TESTS PASSING: 42/42 ✓
2472
+ ══════════════════════════════════════════
2473
+ ```
2474
+
2148
2475
  4. If a fix cannot be applied automatically:
2149
2476
  ```
2150
2477
  ✗ Cannot auto-fix: Database schema mismatch
@@ -2156,6 +2483,167 @@ For `pa:test-mobile`:
2156
2483
 
2157
2484
  5. Generate detailed test report at `./.proagents/test-reports/mobile-{timestamp}.md`
2158
2485
 
2486
+ For `pa:test-web`:
2487
+ 1. **Check required tools and auto-install:**
2488
+ ```
2489
+ Checking required tools...
2490
+ ✓ Node.js
2491
+ ✓ Vitest / Jest
2492
+ ✗ MISSING: Playwright
2493
+
2494
+ Auto-installing Playwright...
2495
+ → npx playwright install
2496
+ ✓ Playwright installed
2497
+ ```
2498
+
2499
+ 2. **Run full web test suite:**
2500
+ ```
2501
+ Web Test Suite
2502
+ ══════════════
2503
+
2504
+ Phase 1: Unit Tests (Vitest/Jest)
2505
+ ──────────────────────────────────
2506
+ Running: npm test
2507
+ ✓ utils/formatDate.test.ts - 5 passed
2508
+ ✓ hooks/useAuth.test.ts - 8 passed
2509
+ ✓ services/api.test.ts - 12 passed
2510
+
2511
+ Phase 2: Component Tests
2512
+ ────────────────────────
2513
+ ✓ Button.test.tsx - renders correctly
2514
+ ✓ Form.test.tsx - validates inputs
2515
+ ✗ FAILED: Modal.test.tsx - close handler
2516
+
2517
+ AUTO-FIX: Analyzing failure...
2518
+ Root cause: onClose prop not called
2519
+ Fixing: src/components/Modal.tsx:24
2520
+ → Added: onClick={() => onClose?.()}
2521
+ Re-running test... ✓ PASSED
2522
+
2523
+ Phase 3: Integration Tests
2524
+ ──────────────────────────
2525
+ ✓ Login flow
2526
+ ✓ Checkout process
2527
+ ✓ User settings update
2528
+
2529
+ Phase 4: E2E Tests (Playwright)
2530
+ ────────────────────────────────
2531
+ Running: npx playwright test
2532
+ ✓ Homepage loads correctly
2533
+ ✓ User can login
2534
+ ✓ User can add to cart
2535
+ ✗ FAILED: Checkout completes
2536
+
2537
+ AUTO-FIX: Analyzing failure...
2538
+ Root cause: Submit button selector changed
2539
+ Fixing: e2e/checkout.spec.ts:45
2540
+ → Changed: 'button.submit' → 'button[type="submit"]'
2541
+ Re-running test... ✓ PASSED
2542
+
2543
+ Phase 5: Visual Regression (Percy/Playwright)
2544
+ ──────────────────────────────────────────────
2545
+ ✓ Homepage - no visual changes
2546
+ ✓ Product page - no visual changes
2547
+ ✗ FAILED: Cart page - button color changed
2548
+
2549
+ AUTO-FIX: Analyzing failure...
2550
+ Root cause: CSS variable override
2551
+ Fixing: src/styles/cart.css:12
2552
+ → Changed: --btn-color: blue → --btn-color: var(--primary)
2553
+ Re-running test... ✓ PASSED
2554
+
2555
+ ══════════════════════════════════════════
2556
+ ALL TESTS PASSING: 45/45 ✓
2557
+ ══════════════════════════════════════════
2558
+ ```
2559
+
2560
+ 3. Generate detailed test report at `./.proagents/test-reports/web-{timestamp}.md`
2561
+
2562
+ For `pa:test-api`:
2563
+ 1. **Check required tools and auto-install:**
2564
+ ```
2565
+ Checking required tools...
2566
+ ✓ Node.js / Python
2567
+ ✓ Jest / Pytest
2568
+ ✗ MISSING: Supertest
2569
+ ✗ MISSING: k6 (load testing)
2570
+
2571
+ Auto-installing...
2572
+ → npm install --save-dev supertest
2573
+ → brew install k6
2574
+ ✓ All tools installed
2575
+ ```
2576
+
2577
+ 2. **Run full API test suite:**
2578
+ ```
2579
+ API Test Suite
2580
+ ══════════════
2581
+
2582
+ Phase 1: Unit Tests
2583
+ ───────────────────
2584
+ ✓ UserService - 12 tests passed
2585
+ ✓ AuthService - 8 tests passed
2586
+ ✓ PaymentService - 15 tests passed
2587
+
2588
+ Phase 2: Integration Tests
2589
+ ──────────────────────────
2590
+ Testing: GET /api/users
2591
+ ✓ Returns 200 with user list
2592
+ ✓ Supports pagination
2593
+ ✓ Filters by role
2594
+
2595
+ Testing: POST /api/auth/login
2596
+ ✓ Returns token on valid credentials
2597
+ ✓ Returns 401 on invalid password
2598
+ ✗ FAILED: Returns 429 on rate limit
2599
+
2600
+ AUTO-FIX: Analyzing failure...
2601
+ Root cause: Rate limiter not configured in test env
2602
+ Fixing: src/middleware/rateLimit.ts:8
2603
+ → Added: if (process.env.NODE_ENV === 'test') return next()
2604
+ Re-running test... ✓ PASSED
2605
+
2606
+ Phase 3: Contract Tests
2607
+ ───────────────────────
2608
+ Validating OpenAPI spec...
2609
+ ✓ GET /api/users matches schema
2610
+ ✓ POST /api/users matches schema
2611
+ ✗ FAILED: PUT /api/users/:id - missing field
2612
+
2613
+ AUTO-FIX: Analyzing failure...
2614
+ Root cause: Response missing 'updatedAt' field
2615
+ Fixing: src/controllers/userController.ts:89
2616
+ → Added: updatedAt: user.updatedAt to response
2617
+ Re-running test... ✓ PASSED
2618
+
2619
+ Phase 4: Load Tests (k6)
2620
+ ────────────────────────
2621
+ Running: k6 run loadtest.js
2622
+ ✓ 100 VUs, 30s duration
2623
+ ✓ p95 response time: 145ms (< 200ms threshold)
2624
+ ✓ Error rate: 0.1% (< 1% threshold)
2625
+ ✓ Throughput: 850 req/s
2626
+
2627
+ Phase 5: Security Tests
2628
+ ───────────────────────
2629
+ ✓ SQL injection: Protected
2630
+ ✓ XSS: Protected
2631
+ ✓ CSRF: Protected
2632
+ ✗ FAILED: Rate limiting on /api/auth/login
2633
+
2634
+ AUTO-FIX: Analyzing failure...
2635
+ Root cause: Rate limit too high (1000 req/min)
2636
+ Fixing: src/config/security.ts:15
2637
+ → Changed: loginRateLimit: 1000 → loginRateLimit: 10
2638
+ Re-running test... ✓ PASSED
2639
+
2640
+ ══════════════════════════════════════════
2641
+ ALL TESTS PASSING: 52/52 ✓
2642
+ ══════════════════════════════════════════
2643
+ ```
2644
+
2645
+ 3. Generate detailed test report at `./.proagents/test-reports/api-{timestamp}.md`
2646
+
2159
2647
  For `pa:test-visual`:
2160
2648
  1. Take screenshots of all screens/components
2161
2649
  2. Compare against design references:
@@ -2261,6 +2749,65 @@ For `pa:test-auto-fix`:
2261
2749
  Running verification tests...
2262
2750
  ```
2263
2751
 
2752
+ 4. **Learn from fixes** - Store successful fixes for future use:
2753
+ ```
2754
+ Saving fix patterns to .proagents/.learning/fixes.json...
2755
+
2756
+ New patterns learned:
2757
+ ┌────────────────────┬────────────────────────────────────────┐
2758
+ │ Error Pattern │ Fix Pattern │
2759
+ ├────────────────────┼────────────────────────────────────────┤
2760
+ │ "undefined" error │ Add null check before access │
2761
+ │ testID not found │ Add testID prop to component │
2762
+ │ color mismatch │ Use design token instead of hex │
2763
+ │ rate limit fail │ Disable in test environment │
2764
+ │ schema mismatch │ Add missing field to response │
2765
+ └────────────────────┴────────────────────────────────────────┘
2766
+
2767
+ ✓ 5 fix patterns saved
2768
+ ```
2769
+
2770
+ **Auto-Fix Intelligence:**
2771
+
2772
+ The AI learns from previous fixes to apply them faster:
2773
+
2774
+ 1. **Pattern Database** - Stored in `.proagents/.learning/`:
2775
+ ```
2776
+ .proagents/.learning/
2777
+ ├── fixes.json # Successful fix patterns
2778
+ ├── errors.json # Common error patterns
2779
+ └── project-patterns.json # Project-specific patterns
2780
+ ```
2781
+
2782
+ 2. **Fix Matching** - When a test fails:
2783
+ ```
2784
+ Analyzing failure: "Cannot read property 'id' of undefined"
2785
+
2786
+ Checking learned patterns...
2787
+ ✓ Match found: "undefined property access"
2788
+
2789
+ Applying known fix:
2790
+ → Add optional chaining: user?.id
2791
+
2792
+ Confidence: 95% (applied 12 times before, 100% success rate)
2793
+ ```
2794
+
2795
+ 3. **Learning from Corrections** - If AI fix is wrong:
2796
+ ```
2797
+ User corrected fix:
2798
+ - AI suggested: user?.id ?? 'default'
2799
+ - User changed to: user?.id || throw new Error('User required')
2800
+
2801
+ Learning...
2802
+ → Updated pattern: In auth contexts, throw error instead of default
2803
+ → Saved to .proagents/.learning/corrections.json
2804
+ ```
2805
+
2806
+ 4. **Project-Specific Learning**:
2807
+ - Learns project conventions (e.g., "this project uses Zod for validation")
2808
+ - Remembers file structure patterns
2809
+ - Knows which solutions worked in this codebase
2810
+
2264
2811
  For `pa:test-loop`:
2265
2812
  1. Run complete Test → Fix → Retest cycle:
2266
2813
  ```
@@ -2512,6 +3059,213 @@ mobile_testing:
2512
3059
  └── auto-fix-log.md # Log of all auto-fixes
2513
3060
  ```
2514
3061
 
3062
+ ### Custom Testing Tools Configuration
3063
+
3064
+ Users can configure their own testing tools in `proagents.config.yaml`. **AI MUST check and use these custom tools** instead of defaults.
3065
+
3066
+ **Read custom tools from config:**
3067
+ ```yaml
3068
+ # proagents.config.yaml → testing.tools section
3069
+ testing:
3070
+ tools:
3071
+ unit:
3072
+ command: "npm test" # Custom unit test command
3073
+ framework: "jest" # jest | vitest | mocha | pytest | junit | xctest
3074
+ integration:
3075
+ command: "npm run test:integration"
3076
+ framework: "jest"
3077
+ e2e:
3078
+ command: "npx playwright test"
3079
+ framework: "playwright" # playwright | cypress | maestro | detox
3080
+ visual:
3081
+ command: "npx percy exec -- npm test"
3082
+ framework: "percy" # percy | chromatic | applitools
3083
+ load:
3084
+ command: "k6 run loadtest.js"
3085
+ framework: "k6" # k6 | artillery | locust | jmeter
3086
+ security:
3087
+ command: "npm audit && snyk test"
3088
+ framework: "snyk" # snyk | npm-audit | owasp-zap
3089
+
3090
+ auto_install: true # Auto-install missing tools
3091
+
3092
+ custom_commands: # User shortcuts
3093
+ "test:quick": "npm test -- --onlyChanged"
3094
+ "test:ci": "npm test -- --coverage --ci"
3095
+ ```
3096
+
3097
+ **How AI uses custom tools:**
3098
+
3099
+ For `pa:test`, `pa:test-mobile`, `pa:test-web`, `pa:test-api`:
3100
+
3101
+ 1. **Read proagents.config.yaml first:**
3102
+ ```
3103
+ Loading test configuration...
3104
+
3105
+ Custom tools configured:
3106
+ ├── Unit: npm test (jest)
3107
+ ├── Integration: npm run test:integration (jest)
3108
+ ├── E2E: npx playwright test (playwright)
3109
+ ├── Visual: npx percy exec -- npm test (percy)
3110
+ ├── Load: k6 run loadtest.js (k6)
3111
+ └── Security: npm audit && snyk test (snyk)
3112
+ ```
3113
+
3114
+ 2. **Use custom command instead of default:**
3115
+ ```
3116
+ Running Unit Tests
3117
+ ══════════════════
3118
+
3119
+ Using custom command: npm test
3120
+ Framework: jest
3121
+
3122
+ > npm test
3123
+
3124
+ PASS src/__tests__/auth.test.ts
3125
+ PASS src/__tests__/user.test.ts
3126
+ ...
3127
+ ```
3128
+
3129
+ 3. **Auto-install if tool missing and auto_install: true:**
3130
+ ```
3131
+ Tool not found: k6
3132
+ Config: auto_install: true
3133
+
3134
+ Installing k6...
3135
+ ✓ k6 installed successfully
3136
+
3137
+ Running load tests...
3138
+ ```
3139
+
3140
+ 4. **Support custom_commands shortcuts:**
3141
+ ```
3142
+ User runs: pa:test quick
3143
+
3144
+ Checking custom_commands...
3145
+ Found: "test:quick" → "npm test -- --onlyChanged"
3146
+
3147
+ Running: npm test -- --onlyChanged
3148
+ ```
3149
+
3150
+ **Mobile Testing Tools (platform-specific):**
3151
+
3152
+ For `pa:test-mobile`, read the `testing.mobile` section:
3153
+
3154
+ ```yaml
3155
+ # proagents.config.yaml → testing.mobile section
3156
+ testing:
3157
+ mobile:
3158
+ # React Native / Expo
3159
+ react_native:
3160
+ unit:
3161
+ command: "npm test"
3162
+ framework: "jest"
3163
+ component:
3164
+ command: "npm test -- --testPathPattern=components"
3165
+ framework: "@testing-library/react-native"
3166
+ e2e:
3167
+ command: "maestro test .maestro/"
3168
+ framework: "maestro" # maestro | detox | appium
3169
+
3170
+ # Native Android (Kotlin/Java)
3171
+ android:
3172
+ unit:
3173
+ command: "./gradlew test"
3174
+ framework: "junit"
3175
+ integration:
3176
+ command: "./gradlew connectedAndroidTest"
3177
+ framework: "espresso"
3178
+ e2e:
3179
+ command: "maestro test .maestro/"
3180
+ framework: "maestro"
3181
+
3182
+ # Native iOS (Swift/Objective-C)
3183
+ ios:
3184
+ unit:
3185
+ command: "xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'"
3186
+ framework: "xctest"
3187
+ e2e:
3188
+ command: "maestro test .maestro/"
3189
+ framework: "maestro"
3190
+
3191
+ # Flutter
3192
+ flutter:
3193
+ unit:
3194
+ command: "flutter test"
3195
+ framework: "flutter_test"
3196
+ integration:
3197
+ command: "flutter test integration_test/"
3198
+ framework: "integration_test"
3199
+ e2e:
3200
+ command: "maestro test .maestro/"
3201
+ framework: "maestro"
3202
+ ```
3203
+
3204
+ **How AI uses mobile tools:**
3205
+
3206
+ 1. **Detect platform first:**
3207
+ ```
3208
+ Detecting mobile project type...
3209
+
3210
+ Checking for:
3211
+ ├── package.json + react-native → React Native
3212
+ ├── android/build.gradle (no RN) → Native Android
3213
+ ├── ios/*.xcodeproj (no RN) → Native iOS
3214
+ ├── pubspec.yaml → Flutter
3215
+
3216
+ Detected: React Native
3217
+ ```
3218
+
3219
+ 2. **Read platform-specific config:**
3220
+ ```
3221
+ Loading config: testing.mobile.react_native
3222
+
3223
+ Tools:
3224
+ ├── Unit: npm test (jest)
3225
+ ├── Component: npm test -- --testPathPattern=components
3226
+ └── E2E: maestro test .maestro/ (maestro)
3227
+ ```
3228
+
3229
+ 3. **Run with configured commands:**
3230
+ ```
3231
+ Running React Native Test Suite
3232
+ ═══════════════════════════════
3233
+
3234
+ Phase 1: Unit Tests
3235
+ > npm test
3236
+ ✓ 45 tests passed
3237
+
3238
+ Phase 2: Component Tests
3239
+ > npm test -- --testPathPattern=components
3240
+ ✓ 23 tests passed
3241
+
3242
+ Phase 3: E2E Tests
3243
+ > maestro test .maestro/
3244
+ ✓ 12 flows passed
3245
+ ```
3246
+
3247
+ **Default fallbacks (if no custom config):**
3248
+
3249
+ | Test Type | Detect From | Default Command |
3250
+ |-----------|-------------|-----------------|
3251
+ | Unit | package.json scripts | `npm test` or `npx jest` |
3252
+ | Integration | test files | `npm run test:integration` |
3253
+ | E2E | playwright.config / cypress.json | `npx playwright test` or `npx cypress run` |
3254
+ | Visual | percy.yml / chromatic | `npx percy exec` |
3255
+ | Load | k6 / artillery config | `k6 run` or `artillery run` |
3256
+ | Security | package.json | `npm audit` |
3257
+
3258
+ **Mobile fallbacks (if no custom config):**
3259
+
3260
+ | Platform | Unit | E2E |
3261
+ |----------|------|-----|
3262
+ | React Native | `npm test` (jest) | `maestro test` or `detox test` |
3263
+ | Android | `./gradlew test` | `./gradlew connectedAndroidTest` |
3264
+ | iOS | `xcodebuild test` | `maestro test` |
3265
+ | Flutter | `flutter test` | `flutter test integration_test/` |
3266
+
3267
+ **IMPORTANT:** Always check `proagents.config.yaml` FIRST before using defaults.
3268
+
2515
3269
  ### AI Platform Management
2516
3270
  | Command | Action |
2517
3271
  |---------|--------|