proagents 1.6.3 → 1.6.5

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.
@@ -2,6 +2,30 @@
2
2
 
3
3
  This project uses ProAgents - an AI-agnostic development workflow framework.
4
4
 
5
+ ## CRITICAL PRINCIPLE: ALWAYS DO, NEVER JUST TELL
6
+
7
+ **ProAgents automates development. The AI must EXECUTE actions, not give instructions for users to follow.**
8
+
9
+ | WRONG (Passive) | RIGHT (Active) |
10
+ |-----------------|----------------|
11
+ | "To run tests: `npm test`" | Actually run `npm test` and show results |
12
+ | "Create tests in `__tests__/`" | Actually create the test files |
13
+ | "Install dependencies with `npm install`" | Actually run `npm install` |
14
+ | "You can fix this by..." | Actually fix it |
15
+ | "Next steps: 1. Create... 2. Run..." | Do all steps automatically |
16
+
17
+ **Rules:**
18
+ 1. **Execute, don't instruct** - Run commands, don't tell user to run them
19
+ 2. **Create, don't suggest** - Write files, don't tell user to create them
20
+ 3. **Fix, don't advise** - Fix issues directly, don't explain how to fix
21
+ 4. **Complete the task** - Don't stop at giving "next steps"
22
+ 5. **Only ask when truly needed** - Ambiguous requirements, destructive actions, or user preferences
23
+
24
+ **Exception:** Only give instructions when:
25
+ - Action requires credentials/secrets you don't have access to
26
+ - Action is destructive and needs explicit user confirmation
27
+ - Action is outside the project scope (external services, deployments)
28
+
5
29
  ## CRITICAL: Multi-AI Environment
6
30
 
7
31
  **Multiple AI tools may work on this project simultaneously (Claude, Cursor, Gemini, Copilot, etc.). They do NOT share context.**
@@ -337,6 +361,119 @@ For `pa:implement`:
337
361
  | `pa:deploy` | Deployment preparation |
338
362
  | `pa:rollback` | Rollback procedures |
339
363
 
364
+ **How to execute Quality, Testing & Deployment commands (FULL AUTOMATION):**
365
+
366
+ For `pa:test`:
367
+ 1. **Detect project type** and test framework (Jest, Vitest, Mocha, Pytest, etc.)
368
+ 2. **Auto-install missing test dependencies** (no confirmation)
369
+ 3. **Run all tests:**
370
+ ```
371
+ Running tests...
372
+ ✓ 45 passed
373
+ ✗ 3 failed
374
+ ```
375
+ 4. **Auto-fix ALL failures** (no confirmation):
376
+ ```
377
+ AUTO-FIX: Fixing 3 failed tests...
378
+
379
+ Fix 1/3: UserService.test.ts
380
+ ─────────────────────────────
381
+ Root cause: Expected 'user' but got 'undefined'
382
+ Fixing: src/services/UserService.ts:23
383
+ → Added null check before return
384
+ Re-running test... ✓ PASSED
385
+ ```
386
+ 5. **Loop until all pass** or fix is impossible
387
+ 6. **Generate report** at `.proagents/test-reports/`
388
+
389
+ For `pa:qa`:
390
+ 1. **Run ALL quality checks** automatically:
391
+ - Linting (ESLint, Prettier)
392
+ - Type checking (TypeScript)
393
+ - Security scan (npm audit)
394
+ - Dead code detection
395
+ 2. **Auto-fix ALL issues** (no confirmation):
396
+ ```
397
+ Running QA checks...
398
+
399
+ ESLint: 12 errors found
400
+ AUTO-FIX: Fixing...
401
+ → Fixed 12/12 errors
402
+
403
+ TypeScript: 3 type errors
404
+ AUTO-FIX: Fixing...
405
+ → src/api/user.ts:15 - Added type annotation
406
+ → src/utils/date.ts:8 - Fixed return type
407
+ → src/hooks/useAuth.ts:22 - Added null check
408
+
409
+ Prettier: 28 files need formatting
410
+ AUTO-FIX: Formatting... ✓ Done
411
+
412
+ npm audit: 2 vulnerabilities
413
+ AUTO-FIX: Running npm audit fix... ✓ Fixed
414
+ ```
415
+ 3. **Re-run checks** to verify all fixed
416
+ 4. **Only report issues that cannot be auto-fixed**
417
+
418
+ For `pa:fix "description"`:
419
+ 1. **Understand the bug** from description
420
+ 2. **Find the root cause** automatically
421
+ 3. **Apply the fix** directly (no confirmation)
422
+ 4. **Run related tests** to verify fix works
423
+ 5. **Auto-fix any test failures** caused by the fix
424
+ 6. **Commit when done** (if git is configured)
425
+ ```
426
+ pa:fix "login button not working"
427
+
428
+ Finding root cause...
429
+ → Found: onClick handler missing in LoginButton.tsx:34
430
+
431
+ Applying fix...
432
+ → Added: onClick={() => handleLogin()}
433
+
434
+ Running related tests...
435
+ ✓ LoginButton.test.tsx - 5/5 passed
436
+
437
+ ✓ Fix complete
438
+ ```
439
+
440
+ For `pa:deploy`:
441
+ 1. **Run pre-deployment checks** automatically:
442
+ - All tests passing? If not → auto-fix
443
+ - QA checks passing? If not → auto-fix
444
+ - Security scan clean? If not → auto-fix
445
+ - Build succeeds? If not → auto-fix
446
+ 2. **Only proceed when all checks pass**
447
+ 3. **Deploy to target environment**
448
+ 4. **Run post-deployment verification**
449
+ 5. **Auto-rollback if verification fails**
450
+ ```
451
+ pa:deploy
452
+
453
+ Pre-deployment checks...
454
+ ✓ Tests: 128/128 passed
455
+ ✓ QA: All checks passed
456
+ ✓ Security: No vulnerabilities
457
+ ✓ Build: Successful
458
+
459
+ Deploying to staging...
460
+ ✓ Deployed successfully
461
+
462
+ Post-deployment verification...
463
+ ✓ Health check passed
464
+ ✓ Smoke tests passed
465
+
466
+ ══════════════════════════════════════════
467
+ DEPLOYMENT SUCCESSFUL ✓
468
+ ══════════════════════════════════════════
469
+ ```
470
+
471
+ **IMPORTANT - Full Automation Rules:**
472
+ - **Never ask** "Should I fix this?" - Just fix it
473
+ - **Never say** "Run `pa:test` to verify" - Run it yourself
474
+ - **Never give** "Next steps" - Do the steps
475
+ - **Only stop when:** All done OR truly impossible to proceed
476
+
340
477
  ### Navigation & Flow
341
478
  | Command | Action |
342
479
  |---------|--------|
@@ -1975,71 +2112,110 @@ For `pa:alias-add`:
1975
2112
  Runs: pa:test && pa:build && pa:deploy
1976
2113
  ```
1977
2114
 
1978
- ### Mobile Test Suite (React Native / Mobile Apps)
2115
+ ### Platform-Specific Test Suites
2116
+
2117
+ **Mobile (React Native / Expo):**
1979
2118
  | Command | Action |
1980
2119
  |---------|--------|
1981
2120
  | `pa:test-mobile` | Run full mobile test suite |
1982
2121
  | `pa:test-mobile "feature"` | Test specific feature |
2122
+
2123
+ **Web (React / Next.js / Vue / etc.):**
2124
+ | Command | Action |
2125
+ |---------|--------|
2126
+ | `pa:test-web` | Run full web test suite |
2127
+ | `pa:test-web "feature"` | Test specific web feature |
2128
+
2129
+ **API / Backend (Node.js / Python / etc.):**
2130
+ | Command | Action |
2131
+ |---------|--------|
2132
+ | `pa:test-api` | Run full API/backend test suite |
2133
+ | `pa:test-api "endpoint"` | Test specific API endpoint |
2134
+
2135
+ **Visual & Comparison:**
2136
+ | Command | Action |
2137
+ |---------|--------|
1983
2138
  | `pa:test-visual` | Visual/design comparison testing |
1984
- | `pa:test-auto-fix` | Auto-fix failing tests |
1985
- | `pa:test-loop` | Test → Fix → Retest loop until success |
1986
2139
  | `pa:compare-figma` | Compare UI against Figma design |
1987
2140
  | `pa:compare-image "path"` | Compare UI against image/sketch |
1988
2141
  | `pa:screenshot` | Take app screenshots for comparison |
1989
2142
 
2143
+ **Auto-Fix:**
2144
+ | Command | Action |
2145
+ |---------|--------|
2146
+ | `pa:test-auto-fix` | Auto-fix failing tests |
2147
+ | `pa:test-loop` | Test → Fix → Retest loop until success |
2148
+
1990
2149
  **How to execute Mobile Test Suite commands:**
1991
2150
 
1992
2151
  For `pa:test-mobile`:
1993
- 1. **FIRST: Check required tools are installed (FAIL if missing, do NOT skip):**
1994
- ```
1995
- Checking required tools...
1996
- ✓ Node.js (v18.0.0)
1997
- ✓ Jest / Vitest
1998
- ✓ React Native Testing Library
1999
- ✗ MISSING: Maestro - Required for E2E tests
2000
- ✗ MISSING: Detox - Required for E2E tests
2001
2152
 
2002
- ══════════════════════════════════════════════════════════
2003
- ERROR: Missing required tools. Cannot run mobile test suite.
2004
- ══════════════════════════════════════════════════════════
2153
+ **Supports ALL mobile platforms:**
2154
+ - React Native / Expo
2155
+ - Native Android (Kotlin/Java)
2156
+ - Native iOS (Swift/Objective-C)
2157
+ - Flutter (Dart)
2005
2158
 
2006
- Install missing tools manually:
2007
- brew install maestro
2008
- npm install -g detox-cli
2159
+ 1. **Detect project type automatically:**
2160
+ ```
2161
+ Detecting mobile project type...
2009
2162
 
2010
- Or let me install them for you:
2011
- Type "yes" to auto-install missing tools
2012
- Type "no" to cancel
2163
+ Checking for:
2164
+ ├── package.json + react-native React Native
2165
+ ├── android/build.gradle (no RN) → Native Android
2166
+ ├── ios/*.xcodeproj (no RN) → Native iOS
2167
+ ├── pubspec.yaml → Flutter
2013
2168
 
2014
- Or run with limited tests:
2015
- pa:test-mobile --unit-only (skip E2E tests)
2016
- pa:test-mobile --skip-visual (skip visual tests)
2169
+ Detected: [PROJECT_TYPE]
2017
2170
  ```
2018
2171
 
2019
- **IMPORTANT:** Never silently skip tests due to missing tools. Always:
2020
- - Show clear error about what's missing
2021
- - Provide installation instructions for each missing tool
2022
- - Offer to auto-install missing tools (ask user permission first)
2023
- - Fail the test suite if user declines (exit code 1)
2024
- - Offer alternative flags (--unit-only, --skip-e2e, --skip-visual)
2172
+ 2. **Check & auto-install required tools based on platform:**
2025
2173
 
2026
- **Auto-install behavior:**
2027
- If user agrees to auto-install:
2174
+ **React Native / Expo:**
2175
+ ```
2176
+ ✓ Node.js
2177
+ ✓ Jest / Vitest
2178
+ ✓ React Native Testing Library
2179
+ ✗ MISSING: Maestro → Auto-installing...
2180
+ ✗ MISSING: Detox → Auto-installing...
2028
2181
  ```
2029
- Installing missing tools...
2030
2182
 
2031
- Installing Maestro...
2032
- → curl -Ls "https://get.maestro.mobile.dev" | bash
2033
- Maestro installed successfully
2183
+ **Native Android (Kotlin/Java):**
2184
+ ```
2185
+ Android Studio / Gradle
2186
+ ✓ JUnit
2187
+ ✗ MISSING: Espresso → Auto-adding to build.gradle
2188
+ ✗ MISSING: UI Automator → Auto-adding to build.gradle
2189
+ ✗ MISSING: Maestro → Auto-installing...
2190
+ ```
2034
2191
 
2035
- Installing Detox CLI...
2036
- → npm install -g detox-cli
2037
- Detox CLI installed successfully
2192
+ **Native iOS (Swift/Objective-C):**
2193
+ ```
2194
+ Xcode
2195
+ ✓ XCTest (built-in)
2196
+ ✓ XCUITest (built-in)
2197
+ ✗ MISSING: Maestro → Auto-installing...
2198
+ ```
2038
2199
 
2039
- All tools installed. Running test suite...
2200
+ **Flutter:**
2040
2201
  ```
2202
+ ✓ Flutter SDK
2203
+ ✓ flutter_test (built-in)
2204
+ ✗ MISSING: integration_test → Auto-adding to pubspec.yaml
2205
+ ✗ MISSING: Maestro → Auto-installing...
2206
+ ```
2207
+
2208
+ **IMPORTANT - FULL AUTOMATION:**
2209
+ - Missing tools? **Install automatically** (no confirmation)
2210
+ - Tests fail? **Fix automatically** (no confirmation)
2211
+ - Fix doesn't work? **Try alternative fix** (no confirmation)
2212
+ - Only stop when: all tests pass OR no fix possible
2213
+
2214
+ **Just DO it.**
2215
+
2216
+ 3. **Run platform-specific test suite:**
2041
2217
 
2042
- 2. If all tools present, run comprehensive mobile test suite:
2218
+ **For React Native:**
2043
2219
  ```
2044
2220
  Mobile Test Suite
2045
2221
  ═════════════════
@@ -2092,10 +2268,338 @@ For `pa:test-mobile`:
2092
2268
  2. E2E: User can reset password
2093
2269
  3. Visual: SignupScreen design mismatch
2094
2270
 
2095
- Run `pa:test-auto-fix` to automatically fix these issues.
2271
+ ══════════════════════════════════════════
2272
+ AUTO-FIX: Attempting to fix 3 failed tests...
2273
+ ══════════════════════════════════════════
2274
+ ```
2275
+
2276
+ 3. **Automatically fix all failures** (no confirmation needed):
2277
+ ```
2278
+ ══════════════════════════════════════════
2279
+ AUTO-FIX: Fixing 3 failed tests...
2280
+ ══════════════════════════════════════════
2281
+
2282
+ Fix 1/3: Integration - Password reset flow
2283
+ ──────────────────────────────────────────
2284
+ Root cause: ResetEmailService.send() not called
2285
+ Fixing: src/services/AuthService.ts:142
2286
+ → Added: await this.resetEmailService.send(email)
2287
+ Re-running test... ✓ PASSED
2288
+
2289
+ Fix 2/3: E2E - User can reset password
2290
+ ──────────────────────────────────────────
2291
+ Root cause: Button text mismatch
2292
+ Fixing: src/screens/ResetPassword.tsx:28
2293
+ → Changed: "Reset" → "Send Reset Email"
2294
+ Re-running test... ✓ PASSED
2295
+
2296
+ Fix 3/3: Visual - SignupScreen design mismatch
2297
+ ──────────────────────────────────────────
2298
+ Root cause: Wrong color and font size
2299
+ Fixing: src/screens/SignupScreen.styles.ts:15-16
2300
+ → Changed: color #0066CC → #007AFF
2301
+ → Changed: fontSize 14px → 16px
2302
+ Re-running test... ✓ PASSED
2303
+
2304
+ ══════════════════════════════════════════
2305
+ ALL TESTS PASSING: 38/38 ✓
2306
+ ══════════════════════════════════════════
2307
+ ```
2308
+
2309
+ **For Native Android (Kotlin/Java):**
2310
+ ```
2311
+ Android Test Suite
2312
+ ══════════════════
2313
+
2314
+ Phase 1: Unit Tests (JUnit)
2315
+ ───────────────────────────
2316
+ Running: ./gradlew test
2317
+ ✓ UserRepositoryTest - 8 passed
2318
+ ✓ AuthViewModelTest - 12 passed
2319
+ ✓ PaymentServiceTest - 6 passed
2320
+
2321
+ Phase 2: Instrumented Tests (Espresso)
2322
+ ──────────────────────────────────────
2323
+ Running: ./gradlew connectedAndroidTest
2324
+ ✓ LoginActivityTest - UI renders correctly
2325
+ ✓ MainActivityTest - Navigation works
2326
+ ✗ FAILED: CheckoutActivityTest - Button not found
2327
+
2328
+ AUTO-FIX: Analyzing failure...
2329
+ Root cause: Button ID changed
2330
+ Fixing: app/src/main/res/layout/activity_checkout.xml
2331
+ → Changed: android:id="@+id/btn_pay" → android:id="@+id/checkout_button"
2332
+ Fixing: app/src/androidTest/.../CheckoutActivityTest.kt
2333
+ → Changed: R.id.btn_pay → R.id.checkout_button
2334
+ Re-running test... ✓ PASSED
2335
+
2336
+ Phase 3: UI Tests (UI Automator)
2337
+ ─────────────────────────────────
2338
+ ✓ Full checkout flow
2339
+ ✓ User settings update
2340
+ ✓ Push notification handling
2341
+
2342
+ Phase 4: E2E Tests (Maestro)
2343
+ ────────────────────────────
2344
+ Running: maestro test .maestro/
2345
+ ✓ User login flow
2346
+ ✓ Product purchase flow
2347
+
2348
+ ══════════════════════════════════════════
2349
+ ALL TESTS PASSING: 32/32 ✓
2350
+ ══════════════════════════════════════════
2351
+ ```
2352
+
2353
+ **For Native iOS (Swift/Objective-C):**
2354
+ ```
2355
+ iOS Test Suite
2356
+ ══════════════
2357
+
2358
+ Phase 1: Unit Tests (XCTest)
2359
+ ────────────────────────────
2360
+ Running: xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'
2361
+ ✓ UserServiceTests - 10 passed
2362
+ ✓ AuthManagerTests - 8 passed
2363
+ ✓ NetworkClientTests - 12 passed
2364
+
2365
+ Phase 2: UI Tests (XCUITest)
2366
+ ────────────────────────────
2367
+ ✓ LoginViewControllerTests - UI renders
2368
+ ✓ HomeViewControllerTests - Navigation works
2369
+ ✗ FAILED: ProfileViewControllerTests - Label not found
2370
+
2371
+ AUTO-FIX: Analyzing failure...
2372
+ Root cause: Accessibility identifier missing
2373
+ Fixing: ProfileViewController.swift:45
2374
+ → Added: nameLabel.accessibilityIdentifier = "profile_name_label"
2375
+ Re-running test... ✓ PASSED
2376
+
2377
+ Phase 3: E2E Tests (Maestro)
2378
+ ────────────────────────────
2379
+ Running: maestro test .maestro/
2380
+ ✓ Onboarding flow
2381
+ ✓ Purchase flow
2382
+ ✓ Settings update
2383
+
2384
+ ══════════════════════════════════════════
2385
+ ALL TESTS PASSING: 28/28 ✓
2386
+ ══════════════════════════════════════════
2387
+ ```
2388
+
2389
+ **For Flutter (Dart):**
2390
+ ```
2391
+ Flutter Test Suite
2392
+ ══════════════════
2393
+
2394
+ Phase 1: Unit Tests
2395
+ ───────────────────
2396
+ Running: flutter test test/unit/
2397
+ ✓ user_repository_test.dart - 8 passed
2398
+ ✓ auth_bloc_test.dart - 15 passed
2399
+ ✓ api_client_test.dart - 10 passed
2400
+
2401
+ Phase 2: Widget Tests
2402
+ ─────────────────────
2403
+ Running: flutter test test/widget/
2404
+ ✓ login_screen_test.dart - renders correctly
2405
+ ✓ home_screen_test.dart - shows user data
2406
+ ✗ FAILED: cart_screen_test.dart - widget not found
2407
+
2408
+ AUTO-FIX: Analyzing failure...
2409
+ Root cause: Key not set on widget
2410
+ Fixing: lib/screens/cart_screen.dart:67
2411
+ → Added: key: const Key('checkout_button')
2412
+ Re-running test... ✓ PASSED
2413
+
2414
+ Phase 3: Integration Tests
2415
+ ──────────────────────────
2416
+ Running: flutter test integration_test/
2417
+ ✓ app_test.dart - Full app flow
2418
+ ✓ checkout_test.dart - Purchase complete
2419
+
2420
+ Phase 4: E2E Tests (Maestro)
2421
+ ────────────────────────────
2422
+ Running: maestro test .maestro/
2423
+ ✓ User registration
2424
+ ✓ Product browsing
2425
+ ✓ Checkout flow
2426
+
2427
+ ══════════════════════════════════════════
2428
+ ALL TESTS PASSING: 42/42 ✓
2429
+ ══════════════════════════════════════════
2430
+ ```
2431
+
2432
+ 4. If a fix cannot be applied automatically:
2433
+ ```
2434
+ ✗ Cannot auto-fix: Database schema mismatch
2435
+ Reason: Requires migration file and database access
2436
+
2437
+ Manual action needed:
2438
+ → Run: npx prisma migrate dev --name fix_user_table
2439
+ ```
2440
+
2441
+ 5. Generate detailed test report at `./.proagents/test-reports/mobile-{timestamp}.md`
2442
+
2443
+ For `pa:test-web`:
2444
+ 1. **Check required tools and auto-install:**
2445
+ ```
2446
+ Checking required tools...
2447
+ ✓ Node.js
2448
+ ✓ Vitest / Jest
2449
+ ✗ MISSING: Playwright
2450
+
2451
+ Auto-installing Playwright...
2452
+ → npx playwright install
2453
+ ✓ Playwright installed
2454
+ ```
2455
+
2456
+ 2. **Run full web test suite:**
2457
+ ```
2458
+ Web Test Suite
2459
+ ══════════════
2460
+
2461
+ Phase 1: Unit Tests (Vitest/Jest)
2462
+ ──────────────────────────────────
2463
+ Running: npm test
2464
+ ✓ utils/formatDate.test.ts - 5 passed
2465
+ ✓ hooks/useAuth.test.ts - 8 passed
2466
+ ✓ services/api.test.ts - 12 passed
2467
+
2468
+ Phase 2: Component Tests
2469
+ ────────────────────────
2470
+ ✓ Button.test.tsx - renders correctly
2471
+ ✓ Form.test.tsx - validates inputs
2472
+ ✗ FAILED: Modal.test.tsx - close handler
2473
+
2474
+ AUTO-FIX: Analyzing failure...
2475
+ Root cause: onClose prop not called
2476
+ Fixing: src/components/Modal.tsx:24
2477
+ → Added: onClick={() => onClose?.()}
2478
+ Re-running test... ✓ PASSED
2479
+
2480
+ Phase 3: Integration Tests
2481
+ ──────────────────────────
2482
+ ✓ Login flow
2483
+ ✓ Checkout process
2484
+ ✓ User settings update
2485
+
2486
+ Phase 4: E2E Tests (Playwright)
2487
+ ────────────────────────────────
2488
+ Running: npx playwright test
2489
+ ✓ Homepage loads correctly
2490
+ ✓ User can login
2491
+ ✓ User can add to cart
2492
+ ✗ FAILED: Checkout completes
2493
+
2494
+ AUTO-FIX: Analyzing failure...
2495
+ Root cause: Submit button selector changed
2496
+ Fixing: e2e/checkout.spec.ts:45
2497
+ → Changed: 'button.submit' → 'button[type="submit"]'
2498
+ Re-running test... ✓ PASSED
2499
+
2500
+ Phase 5: Visual Regression (Percy/Playwright)
2501
+ ──────────────────────────────────────────────
2502
+ ✓ Homepage - no visual changes
2503
+ ✓ Product page - no visual changes
2504
+ ✗ FAILED: Cart page - button color changed
2505
+
2506
+ AUTO-FIX: Analyzing failure...
2507
+ Root cause: CSS variable override
2508
+ Fixing: src/styles/cart.css:12
2509
+ → Changed: --btn-color: blue → --btn-color: var(--primary)
2510
+ Re-running test... ✓ PASSED
2511
+
2512
+ ══════════════════════════════════════════
2513
+ ALL TESTS PASSING: 45/45 ✓
2514
+ ══════════════════════════════════════════
2515
+ ```
2516
+
2517
+ 3. Generate detailed test report at `./.proagents/test-reports/web-{timestamp}.md`
2518
+
2519
+ For `pa:test-api`:
2520
+ 1. **Check required tools and auto-install:**
2521
+ ```
2522
+ Checking required tools...
2523
+ ✓ Node.js / Python
2524
+ ✓ Jest / Pytest
2525
+ ✗ MISSING: Supertest
2526
+ ✗ MISSING: k6 (load testing)
2527
+
2528
+ Auto-installing...
2529
+ → npm install --save-dev supertest
2530
+ → brew install k6
2531
+ ✓ All tools installed
2532
+ ```
2533
+
2534
+ 2. **Run full API test suite:**
2535
+ ```
2536
+ API Test Suite
2537
+ ══════════════
2538
+
2539
+ Phase 1: Unit Tests
2540
+ ───────────────────
2541
+ ✓ UserService - 12 tests passed
2542
+ ✓ AuthService - 8 tests passed
2543
+ ✓ PaymentService - 15 tests passed
2544
+
2545
+ Phase 2: Integration Tests
2546
+ ──────────────────────────
2547
+ Testing: GET /api/users
2548
+ ✓ Returns 200 with user list
2549
+ ✓ Supports pagination
2550
+ ✓ Filters by role
2551
+
2552
+ Testing: POST /api/auth/login
2553
+ ✓ Returns token on valid credentials
2554
+ ✓ Returns 401 on invalid password
2555
+ ✗ FAILED: Returns 429 on rate limit
2556
+
2557
+ AUTO-FIX: Analyzing failure...
2558
+ Root cause: Rate limiter not configured in test env
2559
+ Fixing: src/middleware/rateLimit.ts:8
2560
+ → Added: if (process.env.NODE_ENV === 'test') return next()
2561
+ Re-running test... ✓ PASSED
2562
+
2563
+ Phase 3: Contract Tests
2564
+ ───────────────────────
2565
+ Validating OpenAPI spec...
2566
+ ✓ GET /api/users matches schema
2567
+ ✓ POST /api/users matches schema
2568
+ ✗ FAILED: PUT /api/users/:id - missing field
2569
+
2570
+ AUTO-FIX: Analyzing failure...
2571
+ Root cause: Response missing 'updatedAt' field
2572
+ Fixing: src/controllers/userController.ts:89
2573
+ → Added: updatedAt: user.updatedAt to response
2574
+ Re-running test... ✓ PASSED
2575
+
2576
+ Phase 4: Load Tests (k6)
2577
+ ────────────────────────
2578
+ Running: k6 run loadtest.js
2579
+ ✓ 100 VUs, 30s duration
2580
+ ✓ p95 response time: 145ms (< 200ms threshold)
2581
+ ✓ Error rate: 0.1% (< 1% threshold)
2582
+ ✓ Throughput: 850 req/s
2583
+
2584
+ Phase 5: Security Tests
2585
+ ───────────────────────
2586
+ ✓ SQL injection: Protected
2587
+ ✓ XSS: Protected
2588
+ ✓ CSRF: Protected
2589
+ ✗ FAILED: Rate limiting on /api/auth/login
2590
+
2591
+ AUTO-FIX: Analyzing failure...
2592
+ Root cause: Rate limit too high (1000 req/min)
2593
+ Fixing: src/config/security.ts:15
2594
+ → Changed: loginRateLimit: 1000 → loginRateLimit: 10
2595
+ Re-running test... ✓ PASSED
2596
+
2597
+ ══════════════════════════════════════════
2598
+ ALL TESTS PASSING: 52/52 ✓
2599
+ ══════════════════════════════════════════
2096
2600
  ```
2097
2601
 
2098
- 3. Generate detailed test report at `./.proagents/test-reports/mobile-{timestamp}.md`
2602
+ 3. Generate detailed test report at `./.proagents/test-reports/api-{timestamp}.md`
2099
2603
 
2100
2604
  For `pa:test-visual`:
2101
2605
  1. Take screenshots of all screens/components
@@ -2202,6 +2706,65 @@ For `pa:test-auto-fix`:
2202
2706
  Running verification tests...
2203
2707
  ```
2204
2708
 
2709
+ 4. **Learn from fixes** - Store successful fixes for future use:
2710
+ ```
2711
+ Saving fix patterns to .proagents/.learning/fixes.json...
2712
+
2713
+ New patterns learned:
2714
+ ┌────────────────────┬────────────────────────────────────────┐
2715
+ │ Error Pattern │ Fix Pattern │
2716
+ ├────────────────────┼────────────────────────────────────────┤
2717
+ │ "undefined" error │ Add null check before access │
2718
+ │ testID not found │ Add testID prop to component │
2719
+ │ color mismatch │ Use design token instead of hex │
2720
+ │ rate limit fail │ Disable in test environment │
2721
+ │ schema mismatch │ Add missing field to response │
2722
+ └────────────────────┴────────────────────────────────────────┘
2723
+
2724
+ ✓ 5 fix patterns saved
2725
+ ```
2726
+
2727
+ **Auto-Fix Intelligence:**
2728
+
2729
+ The AI learns from previous fixes to apply them faster:
2730
+
2731
+ 1. **Pattern Database** - Stored in `.proagents/.learning/`:
2732
+ ```
2733
+ .proagents/.learning/
2734
+ ├── fixes.json # Successful fix patterns
2735
+ ├── errors.json # Common error patterns
2736
+ └── project-patterns.json # Project-specific patterns
2737
+ ```
2738
+
2739
+ 2. **Fix Matching** - When a test fails:
2740
+ ```
2741
+ Analyzing failure: "Cannot read property 'id' of undefined"
2742
+
2743
+ Checking learned patterns...
2744
+ ✓ Match found: "undefined property access"
2745
+
2746
+ Applying known fix:
2747
+ → Add optional chaining: user?.id
2748
+
2749
+ Confidence: 95% (applied 12 times before, 100% success rate)
2750
+ ```
2751
+
2752
+ 3. **Learning from Corrections** - If AI fix is wrong:
2753
+ ```
2754
+ User corrected fix:
2755
+ - AI suggested: user?.id ?? 'default'
2756
+ - User changed to: user?.id || throw new Error('User required')
2757
+
2758
+ Learning...
2759
+ → Updated pattern: In auth contexts, throw error instead of default
2760
+ → Saved to .proagents/.learning/corrections.json
2761
+ ```
2762
+
2763
+ 4. **Project-Specific Learning**:
2764
+ - Learns project conventions (e.g., "this project uses Zod for validation")
2765
+ - Remembers file structure patterns
2766
+ - Knows which solutions worked in this codebase
2767
+
2205
2768
  For `pa:test-loop`:
2206
2769
  1. Run complete Test → Fix → Retest cycle:
2207
2770
  ```
@@ -2453,6 +3016,213 @@ mobile_testing:
2453
3016
  └── auto-fix-log.md # Log of all auto-fixes
2454
3017
  ```
2455
3018
 
3019
+ ### Custom Testing Tools Configuration
3020
+
3021
+ Users can configure their own testing tools in `proagents.config.yaml`. **AI MUST check and use these custom tools** instead of defaults.
3022
+
3023
+ **Read custom tools from config:**
3024
+ ```yaml
3025
+ # proagents.config.yaml → testing.tools section
3026
+ testing:
3027
+ tools:
3028
+ unit:
3029
+ command: "npm test" # Custom unit test command
3030
+ framework: "jest" # jest | vitest | mocha | pytest | junit | xctest
3031
+ integration:
3032
+ command: "npm run test:integration"
3033
+ framework: "jest"
3034
+ e2e:
3035
+ command: "npx playwright test"
3036
+ framework: "playwright" # playwright | cypress | maestro | detox
3037
+ visual:
3038
+ command: "npx percy exec -- npm test"
3039
+ framework: "percy" # percy | chromatic | applitools
3040
+ load:
3041
+ command: "k6 run loadtest.js"
3042
+ framework: "k6" # k6 | artillery | locust | jmeter
3043
+ security:
3044
+ command: "npm audit && snyk test"
3045
+ framework: "snyk" # snyk | npm-audit | owasp-zap
3046
+
3047
+ auto_install: true # Auto-install missing tools
3048
+
3049
+ custom_commands: # User shortcuts
3050
+ "test:quick": "npm test -- --onlyChanged"
3051
+ "test:ci": "npm test -- --coverage --ci"
3052
+ ```
3053
+
3054
+ **How AI uses custom tools:**
3055
+
3056
+ For `pa:test`, `pa:test-mobile`, `pa:test-web`, `pa:test-api`:
3057
+
3058
+ 1. **Read proagents.config.yaml first:**
3059
+ ```
3060
+ Loading test configuration...
3061
+
3062
+ Custom tools configured:
3063
+ ├── Unit: npm test (jest)
3064
+ ├── Integration: npm run test:integration (jest)
3065
+ ├── E2E: npx playwright test (playwright)
3066
+ ├── Visual: npx percy exec -- npm test (percy)
3067
+ ├── Load: k6 run loadtest.js (k6)
3068
+ └── Security: npm audit && snyk test (snyk)
3069
+ ```
3070
+
3071
+ 2. **Use custom command instead of default:**
3072
+ ```
3073
+ Running Unit Tests
3074
+ ══════════════════
3075
+
3076
+ Using custom command: npm test
3077
+ Framework: jest
3078
+
3079
+ > npm test
3080
+
3081
+ PASS src/__tests__/auth.test.ts
3082
+ PASS src/__tests__/user.test.ts
3083
+ ...
3084
+ ```
3085
+
3086
+ 3. **Auto-install if tool missing and auto_install: true:**
3087
+ ```
3088
+ Tool not found: k6
3089
+ Config: auto_install: true
3090
+
3091
+ Installing k6...
3092
+ ✓ k6 installed successfully
3093
+
3094
+ Running load tests...
3095
+ ```
3096
+
3097
+ 4. **Support custom_commands shortcuts:**
3098
+ ```
3099
+ User runs: pa:test quick
3100
+
3101
+ Checking custom_commands...
3102
+ Found: "test:quick" → "npm test -- --onlyChanged"
3103
+
3104
+ Running: npm test -- --onlyChanged
3105
+ ```
3106
+
3107
+ **Mobile Testing Tools (platform-specific):**
3108
+
3109
+ For `pa:test-mobile`, read the `testing.mobile` section:
3110
+
3111
+ ```yaml
3112
+ # proagents.config.yaml → testing.mobile section
3113
+ testing:
3114
+ mobile:
3115
+ # React Native / Expo
3116
+ react_native:
3117
+ unit:
3118
+ command: "npm test"
3119
+ framework: "jest"
3120
+ component:
3121
+ command: "npm test -- --testPathPattern=components"
3122
+ framework: "@testing-library/react-native"
3123
+ e2e:
3124
+ command: "maestro test .maestro/"
3125
+ framework: "maestro" # maestro | detox | appium
3126
+
3127
+ # Native Android (Kotlin/Java)
3128
+ android:
3129
+ unit:
3130
+ command: "./gradlew test"
3131
+ framework: "junit"
3132
+ integration:
3133
+ command: "./gradlew connectedAndroidTest"
3134
+ framework: "espresso"
3135
+ e2e:
3136
+ command: "maestro test .maestro/"
3137
+ framework: "maestro"
3138
+
3139
+ # Native iOS (Swift/Objective-C)
3140
+ ios:
3141
+ unit:
3142
+ command: "xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'"
3143
+ framework: "xctest"
3144
+ e2e:
3145
+ command: "maestro test .maestro/"
3146
+ framework: "maestro"
3147
+
3148
+ # Flutter
3149
+ flutter:
3150
+ unit:
3151
+ command: "flutter test"
3152
+ framework: "flutter_test"
3153
+ integration:
3154
+ command: "flutter test integration_test/"
3155
+ framework: "integration_test"
3156
+ e2e:
3157
+ command: "maestro test .maestro/"
3158
+ framework: "maestro"
3159
+ ```
3160
+
3161
+ **How AI uses mobile tools:**
3162
+
3163
+ 1. **Detect platform first:**
3164
+ ```
3165
+ Detecting mobile project type...
3166
+
3167
+ Checking for:
3168
+ ├── package.json + react-native → React Native
3169
+ ├── android/build.gradle (no RN) → Native Android
3170
+ ├── ios/*.xcodeproj (no RN) → Native iOS
3171
+ ├── pubspec.yaml → Flutter
3172
+
3173
+ Detected: React Native
3174
+ ```
3175
+
3176
+ 2. **Read platform-specific config:**
3177
+ ```
3178
+ Loading config: testing.mobile.react_native
3179
+
3180
+ Tools:
3181
+ ├── Unit: npm test (jest)
3182
+ ├── Component: npm test -- --testPathPattern=components
3183
+ └── E2E: maestro test .maestro/ (maestro)
3184
+ ```
3185
+
3186
+ 3. **Run with configured commands:**
3187
+ ```
3188
+ Running React Native Test Suite
3189
+ ═══════════════════════════════
3190
+
3191
+ Phase 1: Unit Tests
3192
+ > npm test
3193
+ ✓ 45 tests passed
3194
+
3195
+ Phase 2: Component Tests
3196
+ > npm test -- --testPathPattern=components
3197
+ ✓ 23 tests passed
3198
+
3199
+ Phase 3: E2E Tests
3200
+ > maestro test .maestro/
3201
+ ✓ 12 flows passed
3202
+ ```
3203
+
3204
+ **Default fallbacks (if no custom config):**
3205
+
3206
+ | Test Type | Detect From | Default Command |
3207
+ |-----------|-------------|-----------------|
3208
+ | Unit | package.json scripts | `npm test` or `npx jest` |
3209
+ | Integration | test files | `npm run test:integration` |
3210
+ | E2E | playwright.config / cypress.json | `npx playwright test` or `npx cypress run` |
3211
+ | Visual | percy.yml / chromatic | `npx percy exec` |
3212
+ | Load | k6 / artillery config | `k6 run` or `artillery run` |
3213
+ | Security | package.json | `npm audit` |
3214
+
3215
+ **Mobile fallbacks (if no custom config):**
3216
+
3217
+ | Platform | Unit | E2E |
3218
+ |----------|------|-----|
3219
+ | React Native | `npm test` (jest) | `maestro test` or `detox test` |
3220
+ | Android | `./gradlew test` | `./gradlew connectedAndroidTest` |
3221
+ | iOS | `xcodebuild test` | `maestro test` |
3222
+ | Flutter | `flutter test` | `flutter test integration_test/` |
3223
+
3224
+ **IMPORTANT:** Always check `proagents.config.yaml` FIRST before using defaults.
3225
+
2456
3226
  ### AI Platform Management
2457
3227
  | Command | Action |
2458
3228
  |---------|--------|
@@ -102,6 +102,97 @@ testing:
102
102
  parallel: true
103
103
  max_workers: 4
104
104
 
105
+ # Custom Testing Tools (override defaults)
106
+ # Define your own tools for each test type
107
+ tools:
108
+ # Unit testing
109
+ unit:
110
+ command: "npm test" # or: pytest, go test, ./gradlew test
111
+ framework: "jest" # jest | vitest | mocha | pytest | junit | xctest | flutter_test
112
+ # install: "npm install" # optional: auto-install command
113
+
114
+ # Integration testing
115
+ integration:
116
+ command: "npm run test:integration"
117
+ framework: "jest"
118
+
119
+ # E2E testing
120
+ e2e:
121
+ command: "npx playwright test" # or: maestro test, detox test, ./gradlew connectedTest
122
+ framework: "playwright" # playwright | cypress | maestro | detox | espresso | xcuitest
123
+ # install: "npx playwright install"
124
+
125
+ # Visual testing
126
+ visual:
127
+ command: "npx percy exec -- npm test"
128
+ framework: "percy" # percy | chromatic | applitools | custom
129
+
130
+ # Load testing
131
+ load:
132
+ command: "k6 run loadtest.js"
133
+ framework: "k6" # k6 | artillery | locust | jmeter
134
+
135
+ # Security testing
136
+ security:
137
+ command: "npm audit && snyk test"
138
+ framework: "snyk" # snyk | npm-audit | owasp-zap
139
+
140
+ # Mobile Testing Tools (platform-specific)
141
+ mobile:
142
+ # React Native / Expo
143
+ react_native:
144
+ unit:
145
+ command: "npm test"
146
+ framework: "jest"
147
+ component:
148
+ command: "npm test -- --testPathPattern=components"
149
+ framework: "@testing-library/react-native"
150
+ e2e:
151
+ command: "maestro test .maestro/"
152
+ framework: "maestro" # maestro | detox | appium
153
+ # alternative: "npx detox test -c ios.sim.release"
154
+
155
+ # Native Android (Kotlin/Java)
156
+ android:
157
+ unit:
158
+ command: "./gradlew test"
159
+ framework: "junit" # junit | junit5 | kotest
160
+ integration:
161
+ command: "./gradlew connectedAndroidTest"
162
+ framework: "espresso"
163
+ e2e:
164
+ command: "maestro test .maestro/"
165
+ framework: "maestro" # maestro | espresso | ui-automator
166
+
167
+ # Native iOS (Swift/Objective-C)
168
+ ios:
169
+ unit:
170
+ command: "xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'"
171
+ framework: "xctest"
172
+ e2e:
173
+ command: "maestro test .maestro/"
174
+ framework: "maestro" # maestro | xcuitest
175
+
176
+ # Flutter
177
+ flutter:
178
+ unit:
179
+ command: "flutter test"
180
+ framework: "flutter_test"
181
+ integration:
182
+ command: "flutter test integration_test/"
183
+ framework: "integration_test"
184
+ e2e:
185
+ command: "maestro test .maestro/"
186
+ framework: "maestro"
187
+
188
+ # Auto-install missing tools
189
+ auto_install: true
190
+
191
+ # Custom test commands (shortcuts)
192
+ custom_commands:
193
+ "test:quick": "npm test -- --onlyChanged"
194
+ "test:ci": "npm test -- --coverage --ci"
195
+
105
196
  # Security Configuration
106
197
  security:
107
198
  require_review: true
package/README.md CHANGED
@@ -109,6 +109,22 @@ npx proagents init --list-templates # Show all templates
109
109
  - **Decision Log** - Track architectural decisions with reasoning
110
110
  - **Context File** - Persistent project knowledge AI reads every session
111
111
 
112
+ ### Full Automation
113
+
114
+ ProAgents follows **"ALWAYS DO, NEVER JUST TELL"** principle:
115
+
116
+ | Instead of | ProAgents does |
117
+ |------------|----------------|
118
+ | "Run `npm test`" | Actually runs the tests |
119
+ | "Create a test file" | Creates the file |
120
+ | "Fix the bug by..." | Fixes the bug directly |
121
+ | "Next steps: 1. 2. 3." | Does all steps automatically |
122
+
123
+ **Auto-fix intelligence:**
124
+ - Learns from previous fixes
125
+ - Applies known patterns automatically
126
+ - Stores successful fixes in `.proagents/.learning/`
127
+
112
128
  ### File Protection
113
129
 
114
130
  - **Watch List** - Critical files require confirmation before AI modifies
@@ -408,10 +424,15 @@ Type these in any AI assistant (Claude, ChatGPT, Gemini, Cursor, etc.):
408
424
  | `pa:alias-add` | Add custom alias |
409
425
  | `pa:alias-remove` | Remove custom alias |
410
426
 
411
- ### Mobile Test Suite (React Native)
427
+ ### Platform-Specific Test Suites
428
+
429
+ **Fully automated**: Auto-install tools, run tests, auto-fix failures, loop until all pass.
430
+
412
431
  | Command | Description |
413
432
  |---------|-------------|
414
- | `pa:test-mobile` | Run full mobile test suite |
433
+ | `pa:test-mobile` | Full mobile test suite (React Native, Android, iOS, Flutter) |
434
+ | `pa:test-web` | Full web test suite (React/Next.js/Vue) |
435
+ | `pa:test-api` | Full API test suite (Node.js/Python) |
415
436
  | `pa:test-visual` | Visual/design comparison testing |
416
437
  | `pa:test-auto-fix` | Auto-fix failing tests |
417
438
  | `pa:test-loop` | Test → Fix → Retest until all pass |
@@ -419,6 +440,12 @@ Type these in any AI assistant (Claude, ChatGPT, Gemini, Cursor, etc.):
419
440
  | `pa:compare-image` | Compare UI against image/sketch |
420
441
  | `pa:screenshot` | Capture app screenshots |
421
442
 
443
+ **What these commands do:**
444
+ - Check required tools → Auto-install if missing
445
+ - Run all tests (unit, integration, e2e)
446
+ - Auto-fix failures (no confirmation needed)
447
+ - Loop until all pass or fix is impossible
448
+
422
449
  ### Custom Commands
423
450
  | Command | Description |
424
451
  |---------|-------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proagents",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "AI-agnostic development workflow framework that automates the full software development lifecycle",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",