proagents 1.6.8 → 1.6.10
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.
- package/.proagents/AI_INSTRUCTIONS.md +216 -3291
- package/.proagents/docs/README.md +27 -0
- package/.proagents/docs/command-details.md +813 -0
- package/.proagents/docs/testing.md +241 -0
- package/.proagents/prompts/06-testing.md +172 -0
- package/.proagents/prompts/07-documentation.md +62 -0
- package/.proagents/prompts/10-debug-logs.md +1130 -0
- package/README.md +22 -0
- package/lib/commands/ai.js +148 -19
- package/lib/commands/config.js +39 -12
- package/lib/commands/init.js +94 -9
- package/package.json +1 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# ProAgents Testing Configuration
|
|
2
|
+
|
|
3
|
+
## Test Commands
|
|
4
|
+
|
|
5
|
+
| Command | Action |
|
|
6
|
+
|---------|--------|
|
|
7
|
+
| `pa:test` | Run all tests |
|
|
8
|
+
| `pa:test-unit` | Unit tests only |
|
|
9
|
+
| `pa:test-integration` | Integration tests |
|
|
10
|
+
| `pa:test-e2e` | End-to-end tests |
|
|
11
|
+
| `pa:test-coverage` | Run with coverage report |
|
|
12
|
+
| `pa:test-watch` | Watch mode |
|
|
13
|
+
| `pa:test-file "path"` | Test specific file |
|
|
14
|
+
| `pa:test-failed` | Re-run failed tests |
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
Tests are configured in `proagents.config.yaml`:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
testing:
|
|
22
|
+
coverage_targets:
|
|
23
|
+
unit: 80
|
|
24
|
+
integration: 60
|
|
25
|
+
e2e: critical_flows
|
|
26
|
+
parallel: true
|
|
27
|
+
max_workers: 4
|
|
28
|
+
|
|
29
|
+
tools:
|
|
30
|
+
unit:
|
|
31
|
+
command: "npm test"
|
|
32
|
+
framework: "jest"
|
|
33
|
+
integration:
|
|
34
|
+
command: "npm run test:integration"
|
|
35
|
+
framework: "jest"
|
|
36
|
+
e2e:
|
|
37
|
+
command: "npx playwright test"
|
|
38
|
+
framework: "playwright"
|
|
39
|
+
visual:
|
|
40
|
+
command: "npx percy exec -- npm test"
|
|
41
|
+
framework: "percy"
|
|
42
|
+
load:
|
|
43
|
+
command: "k6 run loadtest.js"
|
|
44
|
+
framework: "k6"
|
|
45
|
+
security:
|
|
46
|
+
command: "npm audit && snyk test"
|
|
47
|
+
framework: "snyk"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Mobile Testing
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
testing:
|
|
54
|
+
mobile:
|
|
55
|
+
react_native:
|
|
56
|
+
unit:
|
|
57
|
+
command: "npm test"
|
|
58
|
+
framework: "jest"
|
|
59
|
+
component:
|
|
60
|
+
command: "npm test -- --testPathPattern=components"
|
|
61
|
+
framework: "@testing-library/react-native"
|
|
62
|
+
e2e:
|
|
63
|
+
command: "maestro test .maestro/"
|
|
64
|
+
framework: "maestro"
|
|
65
|
+
|
|
66
|
+
android:
|
|
67
|
+
unit:
|
|
68
|
+
command: "./gradlew test"
|
|
69
|
+
framework: "junit"
|
|
70
|
+
integration:
|
|
71
|
+
command: "./gradlew connectedAndroidTest"
|
|
72
|
+
framework: "espresso"
|
|
73
|
+
e2e:
|
|
74
|
+
command: "maestro test .maestro/"
|
|
75
|
+
framework: "maestro"
|
|
76
|
+
|
|
77
|
+
ios:
|
|
78
|
+
unit:
|
|
79
|
+
command: "xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'"
|
|
80
|
+
framework: "xctest"
|
|
81
|
+
e2e:
|
|
82
|
+
command: "maestro test .maestro/"
|
|
83
|
+
framework: "maestro"
|
|
84
|
+
|
|
85
|
+
flutter:
|
|
86
|
+
unit:
|
|
87
|
+
command: "flutter test"
|
|
88
|
+
framework: "flutter_test"
|
|
89
|
+
integration:
|
|
90
|
+
command: "flutter test integration_test/"
|
|
91
|
+
framework: "integration_test"
|
|
92
|
+
e2e:
|
|
93
|
+
command: "maestro test .maestro/"
|
|
94
|
+
framework: "maestro"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## pa:test-mobile - Full Mobile Testing
|
|
98
|
+
|
|
99
|
+
**CRITICAL: AI must SET UP testing if not configured, not tell user to test manually!**
|
|
100
|
+
|
|
101
|
+
### When E2E Not Configured - AI Must Install:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# 1. Check if Maestro installed
|
|
105
|
+
maestro --version 2>/dev/null || {
|
|
106
|
+
echo "Installing Maestro..."
|
|
107
|
+
curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# 2. Create .maestro folder if missing
|
|
111
|
+
mkdir -p .maestro
|
|
112
|
+
|
|
113
|
+
# 3. Create sample test flow
|
|
114
|
+
cat > .maestro/login-flow.yaml << 'EOF'
|
|
115
|
+
appId: com.yourapp
|
|
116
|
+
---
|
|
117
|
+
- launchApp
|
|
118
|
+
- tapOn: "Login"
|
|
119
|
+
- inputText:
|
|
120
|
+
id: "email"
|
|
121
|
+
text: "test@example.com"
|
|
122
|
+
- inputText:
|
|
123
|
+
id: "password"
|
|
124
|
+
text: "password123"
|
|
125
|
+
- tapOn: "Submit"
|
|
126
|
+
- assertVisible: "Welcome"
|
|
127
|
+
EOF
|
|
128
|
+
|
|
129
|
+
# 4. Run tests
|
|
130
|
+
maestro test .maestro/
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### AI Workflow for pa:test-mobile:
|
|
134
|
+
|
|
135
|
+
1. **Check what's configured:**
|
|
136
|
+
```bash
|
|
137
|
+
ls .maestro/ 2>/dev/null || echo "No Maestro tests"
|
|
138
|
+
ls e2e/ 2>/dev/null || echo "No Detox tests"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
2. **If nothing configured - SET IT UP:**
|
|
142
|
+
- Install Maestro (easier) or Detox
|
|
143
|
+
- Create test flows for the feature being tested
|
|
144
|
+
- Run the tests
|
|
145
|
+
|
|
146
|
+
3. **If configured - RUN tests:**
|
|
147
|
+
```bash
|
|
148
|
+
maestro test .maestro/
|
|
149
|
+
# OR
|
|
150
|
+
npx detox test
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
4. **Report results:**
|
|
154
|
+
```
|
|
155
|
+
Mobile Test Results
|
|
156
|
+
═══════════════════
|
|
157
|
+
✓ login-flow.yaml - PASSED (3.2s)
|
|
158
|
+
✓ signup-flow.yaml - PASSED (4.1s)
|
|
159
|
+
✗ checkout-flow.yaml - FAILED
|
|
160
|
+
Error: Element "Submit" not found
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### WRONG Behavior:
|
|
164
|
+
```
|
|
165
|
+
"E2E not configured. Please test manually:
|
|
166
|
+
- Open app
|
|
167
|
+
- Click login
|
|
168
|
+
- ..."
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### CORRECT Behavior:
|
|
172
|
+
```
|
|
173
|
+
E2E not configured. Setting up Maestro...
|
|
174
|
+
|
|
175
|
+
Installing Maestro... ✓
|
|
176
|
+
Creating test flows for login feature...
|
|
177
|
+
Created: .maestro/login-flow.yaml
|
|
178
|
+
|
|
179
|
+
Running tests...
|
|
180
|
+
✓ login-flow.yaml - PASSED
|
|
181
|
+
|
|
182
|
+
All tests passed!
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## How pa:test Works
|
|
188
|
+
|
|
189
|
+
1. **Read config** from `proagents.config.yaml`
|
|
190
|
+
2. **Detect test type** from command (unit, e2e, etc.)
|
|
191
|
+
3. **If not configured - SET IT UP** (install tools, create tests)
|
|
192
|
+
4. **Run appropriate command** from config
|
|
193
|
+
5. **Parse results** based on framework
|
|
194
|
+
6. **Report summary**:
|
|
195
|
+
```
|
|
196
|
+
Test Results
|
|
197
|
+
════════════
|
|
198
|
+
✓ 45 passed
|
|
199
|
+
✗ 2 failed
|
|
200
|
+
○ 3 skipped
|
|
201
|
+
|
|
202
|
+
Coverage: 82%
|
|
203
|
+
|
|
204
|
+
Failed:
|
|
205
|
+
• src/auth/login.test.ts - Expected true, got false
|
|
206
|
+
• src/api/user.test.ts - Timeout
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Custom Test Commands
|
|
210
|
+
|
|
211
|
+
Add custom commands in config:
|
|
212
|
+
|
|
213
|
+
```yaml
|
|
214
|
+
testing:
|
|
215
|
+
custom_commands:
|
|
216
|
+
test:quick: "npm test -- --onlyChanged"
|
|
217
|
+
test:ci: "npm test -- --coverage --ci"
|
|
218
|
+
test:debug: "npm test -- --runInBand --detectOpenHandles"
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Use with: `pa:test-quick`, `pa:test-ci`, `pa:test-debug`
|
|
222
|
+
|
|
223
|
+
## Framework Detection
|
|
224
|
+
|
|
225
|
+
If no config exists, detect from:
|
|
226
|
+
|
|
227
|
+
1. `package.json` - scripts.test, devDependencies
|
|
228
|
+
2. Config files - `jest.config.js`, `vitest.config.ts`, `playwright.config.ts`
|
|
229
|
+
3. Common patterns in codebase
|
|
230
|
+
|
|
231
|
+
## Coverage Requirements
|
|
232
|
+
|
|
233
|
+
```yaml
|
|
234
|
+
testing:
|
|
235
|
+
coverage_targets:
|
|
236
|
+
unit: 80 # Minimum 80% for unit tests
|
|
237
|
+
integration: 60 # Minimum 60% for integration
|
|
238
|
+
e2e: critical_flows # Cover critical user flows
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
If coverage drops below target, warn user.
|
|
@@ -4,6 +4,57 @@ Universal prompts for comprehensive testing phase.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## CRITICAL: Auto-Install Missing Tools
|
|
8
|
+
|
|
9
|
+
**AI must NEVER say "not configured, test manually". Instead:**
|
|
10
|
+
|
|
11
|
+
1. **Check if tool exists**
|
|
12
|
+
2. **If missing → INSTALL IT**
|
|
13
|
+
3. **Create test files if needed**
|
|
14
|
+
4. **Run the tests**
|
|
15
|
+
|
|
16
|
+
### Auto-Install Commands:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Maestro (Mobile E2E)
|
|
20
|
+
maestro --version 2>/dev/null || curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
21
|
+
|
|
22
|
+
# Detox (React Native E2E)
|
|
23
|
+
npx detox --version 2>/dev/null || npm install -D detox
|
|
24
|
+
|
|
25
|
+
# Jest
|
|
26
|
+
npx jest --version 2>/dev/null || npm install -D jest
|
|
27
|
+
|
|
28
|
+
# Playwright (Web E2E)
|
|
29
|
+
npx playwright --version 2>/dev/null || npm install -D @playwright/test
|
|
30
|
+
|
|
31
|
+
# React Testing Library
|
|
32
|
+
npm list @testing-library/react 2>/dev/null || npm install -D @testing-library/react
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### WRONG Behavior:
|
|
36
|
+
```
|
|
37
|
+
"E2E tests not configured. Please test manually:
|
|
38
|
+
- Open app
|
|
39
|
+
- Click login..."
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### CORRECT Behavior:
|
|
43
|
+
```
|
|
44
|
+
E2E not configured. Installing Maestro...
|
|
45
|
+
✓ Maestro installed
|
|
46
|
+
|
|
47
|
+
Creating test flow for login feature...
|
|
48
|
+
✓ Created .maestro/login-flow.yaml
|
|
49
|
+
|
|
50
|
+
Running E2E tests...
|
|
51
|
+
✓ login-flow.yaml - PASSED (2.3s)
|
|
52
|
+
|
|
53
|
+
All E2E tests passed!
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
7
58
|
## Quick Start
|
|
8
59
|
|
|
9
60
|
```
|
|
@@ -15,6 +66,7 @@ Related commands:
|
|
|
15
66
|
- `pa:test-integration` - Run integration tests
|
|
16
67
|
- `pa:test-e2e` - Run end-to-end tests
|
|
17
68
|
- `pa:test-all` - Run all tests
|
|
69
|
+
- `pa:test-mobile` - Full mobile test suite (auto-installs tools)
|
|
18
70
|
|
|
19
71
|
---
|
|
20
72
|
|
|
@@ -320,6 +372,126 @@ Priority: Test these before any release
|
|
|
320
372
|
|
|
321
373
|
---
|
|
322
374
|
|
|
375
|
+
## Mobile E2E Testing (pa:test-mobile)
|
|
376
|
+
|
|
377
|
+
**AI MUST auto-install tools and create tests. NEVER say "test manually".**
|
|
378
|
+
|
|
379
|
+
### Step 1: Check & Install Tools
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
# AI runs these commands:
|
|
383
|
+
|
|
384
|
+
# Check Maestro
|
|
385
|
+
if ! maestro --version 2>/dev/null; then
|
|
386
|
+
echo "Installing Maestro..."
|
|
387
|
+
curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
388
|
+
export PATH="$PATH:$HOME/.maestro/bin"
|
|
389
|
+
fi
|
|
390
|
+
|
|
391
|
+
# Verify installation
|
|
392
|
+
maestro --version
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Step 2: Create Test Flows
|
|
396
|
+
|
|
397
|
+
If `.maestro/` folder doesn't exist or is empty:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
mkdir -p .maestro
|
|
401
|
+
|
|
402
|
+
# AI creates test flow based on feature being tested
|
|
403
|
+
cat > .maestro/feature-flow.yaml << 'EOF'
|
|
404
|
+
appId: com.yourapp
|
|
405
|
+
---
|
|
406
|
+
- launchApp
|
|
407
|
+
- tapOn: "Login"
|
|
408
|
+
- inputText:
|
|
409
|
+
id: "email"
|
|
410
|
+
text: "test@example.com"
|
|
411
|
+
- tapOn: "Submit"
|
|
412
|
+
- assertVisible: "Welcome"
|
|
413
|
+
EOF
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Step 3: Run Tests
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# Run all Maestro tests
|
|
420
|
+
maestro test .maestro/
|
|
421
|
+
|
|
422
|
+
# Run specific flow
|
|
423
|
+
maestro test .maestro/login-flow.yaml
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Step 4: Report Results
|
|
427
|
+
|
|
428
|
+
```
|
|
429
|
+
Mobile E2E Results
|
|
430
|
+
══════════════════
|
|
431
|
+
✓ login-flow.yaml - PASSED (3.2s)
|
|
432
|
+
✓ signup-flow.yaml - PASSED (4.5s)
|
|
433
|
+
✗ checkout-flow.yaml - FAILED
|
|
434
|
+
Error: Element "Pay Now" not found at line 12
|
|
435
|
+
|
|
436
|
+
2/3 tests passed
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Maestro Flow Examples
|
|
440
|
+
|
|
441
|
+
**Login Flow:**
|
|
442
|
+
```yaml
|
|
443
|
+
appId: com.myapp
|
|
444
|
+
---
|
|
445
|
+
- launchApp
|
|
446
|
+
- tapOn: "Log In"
|
|
447
|
+
- inputText:
|
|
448
|
+
id: "email"
|
|
449
|
+
text: "user@test.com"
|
|
450
|
+
- inputText:
|
|
451
|
+
id: "password"
|
|
452
|
+
text: "password123"
|
|
453
|
+
- tapOn: "Submit"
|
|
454
|
+
- assertVisible: "Dashboard"
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
**Form Submission:**
|
|
458
|
+
```yaml
|
|
459
|
+
appId: com.myapp
|
|
460
|
+
---
|
|
461
|
+
- launchApp
|
|
462
|
+
- tapOn: "New Form"
|
|
463
|
+
- inputText:
|
|
464
|
+
id: "title"
|
|
465
|
+
text: "Test Entry"
|
|
466
|
+
- tapOn: "Save"
|
|
467
|
+
- assertVisible: "Saved successfully"
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### If Maestro Fails, Try Detox
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
# Install Detox
|
|
474
|
+
npm install -D detox
|
|
475
|
+
npx detox init
|
|
476
|
+
|
|
477
|
+
# Create test
|
|
478
|
+
cat > e2e/login.test.js << 'EOF'
|
|
479
|
+
describe('Login', () => {
|
|
480
|
+
it('should login successfully', async () => {
|
|
481
|
+
await element(by.id('email')).typeText('test@example.com');
|
|
482
|
+
await element(by.id('password')).typeText('password');
|
|
483
|
+
await element(by.text('Login')).tap();
|
|
484
|
+
await expect(element(by.text('Welcome'))).toBeVisible();
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
EOF
|
|
488
|
+
|
|
489
|
+
# Run
|
|
490
|
+
npx detox test
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
323
495
|
## Test Data & Mocking
|
|
324
496
|
|
|
325
497
|
### Generate Test Fixtures
|
|
@@ -4,6 +4,68 @@ Universal prompts for creating comprehensive documentation.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## CRITICAL: AI Must Generate Doc Files
|
|
8
|
+
|
|
9
|
+
**AI must NEVER just show "documentation options" or templates. Instead:**
|
|
10
|
+
|
|
11
|
+
1. **Analyze** the code/module/feature
|
|
12
|
+
2. **Generate** documentation content
|
|
13
|
+
3. **CREATE** the actual doc files
|
|
14
|
+
4. **Report** what was created
|
|
15
|
+
|
|
16
|
+
### WRONG Behavior:
|
|
17
|
+
```
|
|
18
|
+
"Here are the documentation options:
|
|
19
|
+
- pa:doc-full for complete docs
|
|
20
|
+
- pa:doc-lite for quick reference
|
|
21
|
+
..."
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### CORRECT Behavior:
|
|
25
|
+
```
|
|
26
|
+
Analyzing codebase for documentation...
|
|
27
|
+
✓ Found 12 modules, 45 components, 23 utilities
|
|
28
|
+
|
|
29
|
+
Generating documentation...
|
|
30
|
+
✓ Created ./docs/README.md
|
|
31
|
+
✓ Created ./docs/api/index.md
|
|
32
|
+
✓ Created ./docs/components/Button.md
|
|
33
|
+
✓ Created ./docs/modules/auth.md
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
Documentation generated: 15 files in ./docs/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### AI Workflow for pa:doc:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. Create docs directory if missing
|
|
43
|
+
mkdir -p docs docs/api docs/modules docs/components
|
|
44
|
+
|
|
45
|
+
# 2. Analyze codebase
|
|
46
|
+
# AI reads source files and understands structure
|
|
47
|
+
|
|
48
|
+
# 3. Generate and CREATE doc files
|
|
49
|
+
# AI writes actual markdown files to ./docs/
|
|
50
|
+
|
|
51
|
+
# 4. Report summary
|
|
52
|
+
echo "Documentation generated: X files"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Command-Specific Actions:
|
|
56
|
+
|
|
57
|
+
| Command | AI Action |
|
|
58
|
+
|---------|-----------|
|
|
59
|
+
| `pa:doc` | Create full project documentation in `./docs/` |
|
|
60
|
+
| `pa:doc-module auth` | Create `./docs/modules/auth.md` |
|
|
61
|
+
| `pa:doc-file src/api.ts` | Create `./docs/api/api.md` |
|
|
62
|
+
| `pa:doc-api` | Create API docs in `./docs/api/` |
|
|
63
|
+
| `pa:doc-readme` | Update `./README.md` |
|
|
64
|
+
| `pa:changelog` | Update `./CHANGELOG.md` |
|
|
65
|
+
| `pa:release` | Create `./RELEASE_NOTES.md` |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
7
69
|
## Quick Start
|
|
8
70
|
|
|
9
71
|
```
|