proagents 1.6.9 → 1.6.11

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.
@@ -0,0 +1,1115 @@
1
+ # ProAgents Command Details
2
+
3
+ Detailed execution instructions for all `pa:` commands.
4
+
5
+ ---
6
+
7
+ ## CRITICAL: AI Must Execute All Commands
8
+
9
+ **NEVER tell user to do something. AI must DO it.**
10
+
11
+ ### Commands That READ Data - AI Must Run:
12
+
13
+ | Command | AI Runs This |
14
+ |---------|--------------|
15
+ | `pa:history` | `grep -v "^#" .proagents/activity.log \| tail -30` |
16
+ | `pa:progress` | `cat .proagents/active-features/_index.json` |
17
+ | `pa:activity` | `cat .proagents/activity.log \| tail -20` |
18
+ | `pa:status` | `cat .proagents/active-features/_index.json` |
19
+ | `pa:context` | `cat .proagents/context.md` |
20
+ | `pa:decisions` | `cat .proagents/decisions.md` |
21
+ | `pa:errors` | `cat .proagents/errors.md` |
22
+ | `pa:feedback` | `cat .proagents/feedback.md` |
23
+ | `pa:handoff-read` | `cat .proagents/handoff.md` |
24
+ | `pa:config` | `cat proagents.config.yaml` |
25
+ | `pa:lock` | `cat .proagents/.lock 2>/dev/null` |
26
+ | `pa:feature-list` | `cat .proagents/active-features/_index.json` |
27
+ | `pa:todo` | `grep -rn "TODO\|FIXME" src/` |
28
+ | `pa:deps` | `cat package.json \| grep dependencies -A 50` |
29
+ | `pa:deps-outdated` | `npm outdated 2>/dev/null` |
30
+
31
+ ### Commands That RUN Tools - AI Must Execute:
32
+
33
+ | Command | AI Runs This |
34
+ |---------|--------------|
35
+ | `pa:test` | `npm test` (or from config) |
36
+ | `pa:test-unit` | `npm run test:unit` |
37
+ | `pa:test-e2e` | `npm run test:e2e` |
38
+ | `pa:test-mobile` | Install Maestro if missing → Create tests → Run `maestro test` |
39
+ | `pa:lint` | `npm run lint` |
40
+ | `pa:qa` | `npm run lint && npm test` |
41
+ | `pa:coverage` | `npm run test:coverage` |
42
+ | `pa:logs` | `adb logcat -d '*:S' ReactNativeJS:V \| tail -100` |
43
+ | `pa:env-check` | `node -v && npm -v && git --version` |
44
+ | `pa:secrets-scan` | `grep -rn "password\|secret\|api_key" src/` |
45
+ | `pa:db-migrate` | `npm run db:migrate` (or from config) |
46
+
47
+ ### Commands That GENERATE Files - AI Must Create:
48
+
49
+ **AI MUST create actual files, never just show templates or options.**
50
+
51
+ | Command | AI Creates | Location |
52
+ |---------|------------|----------|
53
+ | `pa:doc` | Full documentation | `./docs/*.md` |
54
+ | `pa:doc-api` | API documentation | `./docs/api/*.md` |
55
+ | `pa:doc-module X` | Module documentation | `./docs/modules/X.md` |
56
+ | `pa:doc-file X` | File documentation | `./docs/files/X.md` |
57
+ | `pa:changelog` | Updates changelog | `./CHANGELOG.md` |
58
+ | `pa:release` | Release notes | `./RELEASE_NOTES.md` |
59
+ | `pa:readme` | Updates README | `./README.md` |
60
+ | `pa:handoff` | Handoff notes | `.proagents/handoff.md` |
61
+ | `pa:generate-component` | Component file | Based on project structure |
62
+ | `pa:generate-test` | Test file | Based on project structure |
63
+
64
+ **Example - pa:doc execution:**
65
+ ```bash
66
+ # AI creates directory structure
67
+ mkdir -p docs docs/api docs/modules docs/components
68
+
69
+ # AI analyzes code and creates doc files
70
+ # (AI writes actual content to each file)
71
+
72
+ # AI reports:
73
+ echo "Created: ./docs/README.md"
74
+ echo "Created: ./docs/api/endpoints.md"
75
+ echo "Total: 8 documentation files"
76
+ ```
77
+
78
+ ### Commands That LOG Activity - AI Must Append:
79
+
80
+ After EVERY pa: command, AI runs:
81
+ ```bash
82
+ echo "[$(date '+%Y-%m-%d %H:%M')] [AI_NAME] [COMMAND] Result" >> .proagents/activity.log
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Feature Commands
88
+
89
+ ### pa:feature "name"
90
+
91
+ Start a new feature workflow:
92
+
93
+ 1. Create feature folder: `./.proagents/active-features/feature-[name]/`
94
+ 2. Create `status.json`:
95
+ ```json
96
+ {
97
+ "name": "feature-name",
98
+ "started": "2024-03-06T15:00:00Z",
99
+ "phase": "analysis",
100
+ "progress": 0,
101
+ "branch": "feature/feature-name"
102
+ }
103
+ ```
104
+ 3. Update `_index.json` to add feature to `active_features`
105
+ 4. Create git branch if git enabled
106
+ 5. Start analysis phase
107
+
108
+ ### pa:feature-list
109
+
110
+ **AI reads and displays features:**
111
+
112
+ ```bash
113
+ # AI executes:
114
+ cat .proagents/active-features/_index.json 2>/dev/null
115
+ ls .proagents/active-features/feature-*/status.json 2>/dev/null | while read f; do cat "$f"; done
116
+ ```
117
+
118
+ Then formats:
119
+ ```
120
+ Features
121
+ ════════
122
+ Active (2):
123
+ 🔄 user-auth - implementation (60%)
124
+ 🔍 dashboard - analysis (20%)
125
+
126
+ Paused (1):
127
+ ⏸ notifications - blocked on API
128
+
129
+ Completed (3):
130
+ ✅ login-page, signup-form, forgot-password
131
+ ```
132
+
133
+ ### pa:feature-complete
134
+
135
+ 1. Move feature from `active_features` to `completed_features` in `_index.json`
136
+ 2. Update feature's `status.json` with completion timestamp
137
+ 3. Generate changelog entry
138
+ 4. Suggest PR creation if git enabled
139
+
140
+ ### pa:fix "description"
141
+
142
+ Quick bug fix mode (bypasses full workflow):
143
+
144
+ 1. Analyze the bug description
145
+ 2. Search codebase for relevant code
146
+ 3. Implement fix directly
147
+ 4. Run relevant tests
148
+ 5. Log fix in activity.log
149
+
150
+ ---
151
+
152
+ ## Workflow Phase Commands
153
+
154
+ ### pa:analyze
155
+
156
+ 1. Read `./.proagents/prompts/01-analysis.md`
157
+ 2. Scan project structure
158
+ 3. Identify:
159
+ - Framework/tech stack
160
+ - Code patterns
161
+ - Dependencies
162
+ - Architecture style
163
+ 4. Cache results in `./.proagents/cache/`
164
+ 5. Output analysis summary
165
+
166
+ ### pa:requirements
167
+
168
+ 1. Read `./.proagents/prompts/02-requirements.md`
169
+ 2. If feature specified, focus on that feature
170
+ 3. Document:
171
+ - Functional requirements
172
+ - Non-functional requirements
173
+ - Acceptance criteria
174
+ 4. Save to feature folder
175
+
176
+ ### pa:design
177
+
178
+ 1. Read `./.proagents/prompts/03-ui-design.md`
179
+ 2. Create:
180
+ - UI mockups/wireframes (if applicable)
181
+ - Component structure
182
+ - Architecture decisions
183
+ 3. Document design decisions
184
+
185
+ ### pa:plan
186
+
187
+ 1. Read `./.proagents/prompts/04-planning.md`
188
+ 2. Create implementation plan:
189
+ - Files to create/modify
190
+ - Order of implementation
191
+ - Dependencies between tasks
192
+ - Estimated complexity
193
+ 3. Save plan to feature folder
194
+
195
+ ### pa:implement
196
+
197
+ 1. Read `./.proagents/prompts/05-implementation.md`
198
+ 2. Follow the plan created in planning phase
199
+ 3. Write code following project patterns
200
+ 4. Create/update tests as you go
201
+ 5. Update progress in status.json
202
+
203
+ ### pa:test-mobile
204
+
205
+ **AI sets up and runs mobile E2E tests:**
206
+
207
+ 1. Check if Maestro/Detox installed:
208
+ ```bash
209
+ maestro --version 2>/dev/null || echo "Not installed"
210
+ ```
211
+
212
+ 2. If NOT installed - INSTALL IT:
213
+ ```bash
214
+ curl -Ls "https://get.maestro.mobile.dev" | bash
215
+ ```
216
+
217
+ 3. If no test flows exist - CREATE THEM:
218
+ ```bash
219
+ mkdir -p .maestro
220
+ # AI creates test flows based on the feature being tested
221
+ ```
222
+
223
+ 4. RUN the tests:
224
+ ```bash
225
+ maestro test .maestro/
226
+ ```
227
+
228
+ 5. Report results
229
+
230
+ **WRONG:** "E2E not configured, test manually..."
231
+ **CORRECT:** "Installing Maestro... Creating tests... Running..."
232
+
233
+ ---
234
+
235
+ ### pa:test
236
+
237
+ **AI runs tests and shows results:**
238
+
239
+ ```bash
240
+ # AI executes (check config first):
241
+ npm test 2>&1
242
+ # OR from proagents.config.yaml testing.tools.unit.command
243
+ ```
244
+
245
+ Then reports:
246
+ ```
247
+ Test Results
248
+ ════════════
249
+ ✓ 45 passed
250
+ ✗ 2 failed
251
+ ○ 3 skipped
252
+
253
+ Failed:
254
+ • src/auth/login.test.ts:23 - Expected true, got false
255
+ • src/api/user.test.ts:45 - Timeout after 5000ms
256
+ ```
257
+
258
+ **NEVER say "run npm test" - actually run it!**
259
+
260
+ ### pa:review
261
+
262
+ 1. Read `./.proagents/prompts/06.5-code-review.md`
263
+ 2. Review all changes in current feature
264
+ 3. Check:
265
+ - Code quality
266
+ - Test coverage
267
+ - Security issues
268
+ - Performance concerns
269
+ 4. Generate review report
270
+
271
+ ### pa:doc
272
+
273
+ **AI MUST create actual documentation files, not just show options.**
274
+
275
+ 1. Read `./.proagents/prompts/07-documentation.md`
276
+ 2. Analyze codebase structure
277
+ 3. **CREATE** documentation files:
278
+
279
+ ```bash
280
+ # AI runs:
281
+ mkdir -p docs docs/api docs/modules docs/components
282
+
283
+ # Then AI CREATES these files:
284
+ # - ./docs/README.md (project overview)
285
+ # - ./docs/api/*.md (API documentation)
286
+ # - ./docs/modules/*.md (module docs)
287
+ # - ./docs/components/*.md (component docs)
288
+ ```
289
+
290
+ 4. Sub-commands:
291
+ - `pa:doc-api` → Creates `./docs/api/*.md`
292
+ - `pa:doc-module auth` → Creates `./docs/modules/auth.md`
293
+ - `pa:doc-file src/api.ts` → Creates doc for that file
294
+ - `pa:doc-readme` → Updates `./README.md`
295
+ - `pa:changelog` → Updates `./CHANGELOG.md`
296
+ - `pa:release` → Creates `./RELEASE_NOTES.md`
297
+
298
+ 5. **Output:**
299
+ ```
300
+ Documentation generated:
301
+ ✓ ./docs/README.md
302
+ ✓ ./docs/api/endpoints.md
303
+ ✓ ./docs/modules/auth.md
304
+ ...
305
+ Total: 12 files created
306
+ ```
307
+
308
+ ### pa:deploy
309
+
310
+ 1. Read `./.proagents/prompts/08-deployment.md`
311
+ 2. Run pre-deployment checks
312
+ 3. Create deployment checklist
313
+ 4. Generate release notes if needed
314
+
315
+ ---
316
+
317
+ ## Documentation Commands
318
+
319
+ ### pa:release
320
+
321
+ Generate release notes:
322
+
323
+ 1. Read recent commits/changes
324
+ 2. Categorize changes (features, fixes, breaking)
325
+ 3. Generate formatted release notes
326
+ 4. Save to `./RELEASE_NOTES.md`
327
+
328
+ ### pa:changelog
329
+
330
+ **AI updates ALL changelog files for cross-AI continuity.**
331
+
332
+ 1. Update `./CHANGELOG.md` (public changelog)
333
+ 2. Prepend to `.proagents/changelog/_recent.md` (last 10 changes)
334
+ 3. Update feature changelog if working on a feature
335
+ 4. Update module changelog based on files modified
336
+
337
+ ```bash
338
+ # AI workflow:
339
+ # 1. Identify what changed
340
+ # 2. Determine feature/module from context
341
+
342
+ # 3. Update root changelog
343
+ # Edit ./CHANGELOG.md
344
+
345
+ # 4. Prepend to recent changes
346
+ # Edit .proagents/changelog/_recent.md
347
+
348
+ # 5. Update feature changelog (if applicable)
349
+ # Edit .proagents/changelog/features/[feature-name].md
350
+
351
+ # 6. Update module changelog (auto-detect from paths)
352
+ # Edit .proagents/changelog/modules/[module].md
353
+ ```
354
+
355
+ ### pa:changelog-feature [name]
356
+
357
+ View/update specific feature changelog:
358
+ ```bash
359
+ cat .proagents/changelog/features/[name].md
360
+ ```
361
+
362
+ ### pa:changelog-module [name]
363
+
364
+ View/update specific module changelog:
365
+ ```bash
366
+ cat .proagents/changelog/modules/[name].md
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Cross-AI Continuity Commands
372
+
373
+ ### pa:sync
374
+
375
+ **Run FIRST when starting work on any AI platform.**
376
+
377
+ AI reads context files to understand current state:
378
+
379
+ ```bash
380
+ # AI executes:
381
+ cat .proagents/worklog/_context.md
382
+ cat .proagents/changelog/_recent.md
383
+ ls -t .proagents/worklog/*.md | head -3 | xargs cat
384
+ cat .proagents/active-features/_index.json
385
+ tail -20 .proagents/activity.log
386
+ ```
387
+
388
+ Then reports:
389
+ ```
390
+ Project Context Loaded!
391
+
392
+ Active Work:
393
+ - Feature: user-auth (70% complete)
394
+ - Last: JWT validation added by Claude
395
+
396
+ Recent Changes:
397
+ 1. Added login validation (Claude, Mar 11)
398
+ 2. Fixed API endpoint (Gemini, Mar 10)
399
+
400
+ Pending:
401
+ - [ ] Complete email verification
402
+ - [ ] Add unit tests
403
+
404
+ Ready to continue. What would you like to work on?
405
+ ```
406
+
407
+ ### pa:session-start
408
+
409
+ Begin a new work session:
410
+
411
+ ```bash
412
+ # AI creates session log
413
+ DATE=$(date '+%Y-%m-%d')
414
+ # Creates: .proagents/worklog/YYYY-MM-DD-[ai]-001.md
415
+ ```
416
+
417
+ ### pa:session-end
418
+
419
+ Finalize session and update all tracking:
420
+
421
+ ```bash
422
+ # AI updates:
423
+ # 1. Session log with summary and next steps
424
+ # 2. .proagents/worklog/_context.md
425
+ # 3. .proagents/changelog/_recent.md
426
+ # 4. Feature/module changelogs
427
+ # 5. activity.log
428
+ ```
429
+
430
+ Output:
431
+ ```
432
+ Session Complete!
433
+ - Duration: 45 min
434
+ - Tasks: 3 completed
435
+ - Files: 5 modified
436
+
437
+ Updated:
438
+ ✓ worklog/_context.md
439
+ ✓ worklog/2024-03-11-claude-001.md
440
+ ✓ changelog/features/user-auth.md
441
+ ✓ changelog/_recent.md
442
+ ✓ activity.log
443
+
444
+ Next AI can continue from: [next steps listed]
445
+ ```
446
+
447
+ ### pa:resume
448
+
449
+ **Quick resume for returning AI - loads context and shows next action.**
450
+
451
+ ```bash
452
+ # AI executes:
453
+ cat .proagents/worklog/_context.md
454
+ cat .proagents/changelog/_recent.md
455
+ ls -t .proagents/worklog/*.md 2>/dev/null | head -2 | tail -1 | xargs cat
456
+ tail -10 .proagents/activity.log
457
+ ```
458
+
459
+ Output:
460
+ ```
461
+ Resume Context
462
+ ══════════════
463
+ Last Session: 2024-03-11 by Claude (opus-4)
464
+ Duration: 45 min
465
+
466
+ What Was Done:
467
+ - Added JWT validation
468
+ - Fixed login bug
469
+ - Updated API docs
470
+
471
+ Pending Tasks:
472
+ 1. [ ] Complete email verification
473
+ 2. [ ] Add unit tests for auth
474
+
475
+ Files Recently Modified:
476
+ - src/auth/login.ts (2 hours ago)
477
+ - src/auth/validate.ts (2 hours ago)
478
+
479
+ Suggested Next Action:
480
+ → Continue with "Complete email verification"
481
+
482
+ Ready to proceed?
483
+ ```
484
+
485
+ ### pa:conflict-check
486
+
487
+ **Check if files you're about to modify were changed by another AI.**
488
+
489
+ AI runs before editing any file:
490
+
491
+ ```bash
492
+ # Check recent changes to files
493
+ cat .proagents/changelog/_recent.md | grep -A2 "Files:"
494
+ cat .proagents/worklog/_context.md | grep -A5 "Recent Changes"
495
+ ```
496
+
497
+ Output if conflict detected:
498
+ ```
499
+ ⚠️ CONFLICT WARNING
500
+ ═══════════════════
501
+ File: src/auth/login.ts
502
+ Last modified: 2 hours ago by Gemini (1.5-pro)
503
+ Changes: Added email validation
504
+
505
+ Options:
506
+ 1. Review changes first (recommended)
507
+ 2. Proceed with caution
508
+ 3. Coordinate with previous AI's work
509
+
510
+ Your action?
511
+ ```
512
+
513
+ ### Validation Reminder
514
+
515
+ **AI checks if previous session logged changes properly.**
516
+
517
+ On `pa:sync`, AI also checks:
518
+
519
+ ```bash
520
+ # Compare git changes vs changelog entries
521
+ git diff --name-only HEAD~3 > /tmp/git_changes.txt
522
+ grep -o "src/[^ ]*" .proagents/changelog/_recent.md > /tmp/logged_changes.txt
523
+
524
+ # If git has changes not in changelog:
525
+ echo "⚠️ Warning: Some changes may not be logged"
526
+ ```
527
+
528
+ Output if missing logs:
529
+ ```
530
+ ⚠️ LOGGING VALIDATION
531
+ ═════════════════════
532
+ Git shows 5 files changed since last session.
533
+ Changelog shows 2 files logged.
534
+
535
+ Missing from changelog:
536
+ - src/utils/helpers.ts
537
+ - src/api/endpoints.ts
538
+ - tests/auth.test.ts
539
+
540
+ Previous AI may have forgotten to log. Consider adding entries.
541
+ ```
542
+
543
+ ---
544
+
545
+ ## Issue/Fix Linking
546
+
547
+ **Link changes to issue numbers in changelogs.**
548
+
549
+ Format for _recent.md:
550
+ ```markdown
551
+ ### YYYY-MM-DD - Bug Fix
552
+ **Issue:** #123
553
+ **Module:** auth
554
+ **AI:** Claude (opus-4)
555
+ **Files:** src/auth/login.ts (+5, -2)
556
+ **Summary:** Fixed null check in email validation
557
+ **Closes:** #123
558
+
559
+ ---
560
+ ```
561
+
562
+ AI auto-detects issue numbers from:
563
+ - User message: "fix issue #123" or "closes #456"
564
+ - Branch name: `fix/123-login-bug`
565
+ - Commit message: `Fixes #123`
566
+
567
+ ---
568
+
569
+ ## File-Level Lock Tracking
570
+
571
+ **Track which files each AI is actively editing.**
572
+
573
+ When AI starts editing a file:
574
+
575
+ ```bash
576
+ # Add to .proagents/.active-files
577
+ echo "src/auth/login.ts|Claude|opus-4|$(date -Iseconds)" >> .proagents/.active-files
578
+ ```
579
+
580
+ Before editing any file, AI checks:
581
+ ```bash
582
+ grep "src/auth/login.ts" .proagents/.active-files
583
+ ```
584
+
585
+ If file is locked by another AI:
586
+ ```
587
+ ⚠️ FILE IN USE
588
+ ══════════════
589
+ File: src/auth/login.ts
590
+ Locked by: Gemini (1.5-pro)
591
+ Since: 10 minutes ago
592
+
593
+ Options:
594
+ 1. Wait and retry
595
+ 2. Edit different file
596
+ 3. Force proceed (may cause conflicts)
597
+ ```
598
+
599
+ On session end, AI clears its file locks:
600
+ ```bash
601
+ grep -v "|Claude|" .proagents/.active-files > /tmp/active && mv /tmp/active .proagents/.active-files
602
+ ```
603
+
604
+ ---
605
+
606
+ ## Git Commit Integration
607
+
608
+ **Auto-populate changelog from git commits.**
609
+
610
+ ### pa:changelog --from-git
611
+
612
+ AI parses recent commits and updates changelog:
613
+
614
+ ```bash
615
+ # Get recent commits
616
+ git log --oneline --since="24 hours ago" --format="%h|%s|%an"
617
+ ```
618
+
619
+ For each commit, AI:
620
+ 1. Extracts files changed: `git show --name-only HASH`
621
+ 2. Detects module from file paths
622
+ 3. Extracts issue numbers from message
623
+ 4. Prepends to `_recent.md`
624
+
625
+ Example auto-generated entry:
626
+ ```markdown
627
+ ### 2024-03-11 - Commit abc123
628
+ **Module:** auth (auto-detected)
629
+ **Author:** Developer
630
+ **Files:** src/auth/login.ts, src/auth/validate.ts
631
+ **Summary:** Add JWT token validation
632
+ **Commit:** abc123
633
+ **Issues:** #123, #124
634
+
635
+ ---
636
+ ```
637
+
638
+ ---
639
+
640
+ ## Quality Commands
641
+
642
+ ### pa:qa
643
+
644
+ **AI runs ALL checks and reports:**
645
+
646
+ ```bash
647
+ # AI executes each:
648
+ npm run lint 2>&1
649
+ npm test 2>&1
650
+ npm run test:coverage 2>&1
651
+ npm audit 2>&1
652
+ ```
653
+
654
+ Then reports:
655
+ ```
656
+ QA Report
657
+ ═════════
658
+ Lint: ✓ No issues
659
+ Tests: ✓ 45/45 passed
660
+ Coverage: 82% (target: 80%) ✓
661
+ Security: 0 vulnerabilities ✓
662
+
663
+ Overall: PASSED
664
+ ```
665
+
666
+ **NEVER say "run these commands" - run them!**
667
+
668
+ ### pa:qa-security
669
+
670
+ Security-focused audit:
671
+
672
+ 1. Check for common vulnerabilities (OWASP)
673
+ 2. Scan dependencies for known issues
674
+ 3. Review auth/permissions code
675
+ 4. Generate security report
676
+
677
+ ### pa:lint
678
+
679
+ **AI runs linter and shows results:**
680
+
681
+ ```bash
682
+ # AI executes:
683
+ npm run lint 2>&1
684
+ # If errors, auto-fix:
685
+ npm run lint -- --fix 2>&1
686
+ ```
687
+
688
+ Then reports:
689
+ ```
690
+ Lint Results
691
+ ════════════
692
+ ✓ 120 files checked
693
+ ✗ 3 errors found
694
+ ⚠ 5 warnings
695
+
696
+ Auto-fixed: 2 errors
697
+ Remaining: 1 error in src/utils/helper.ts:45
698
+
699
+ Fixing remaining issue...
700
+ [AI edits the file to fix]
701
+ ```
702
+
703
+ **NEVER say "run npm run lint" - run it!**
704
+
705
+ ---
706
+
707
+ ## Collaboration Commands
708
+
709
+ ### pa:handoff
710
+
711
+ **AI creates handoff file:**
712
+
713
+ ```bash
714
+ # AI creates .proagents/handoff.md with content
715
+ ```
716
+
717
+ ### pa:handoff-read
718
+
719
+ **AI reads and displays handoff:**
720
+
721
+ ```bash
722
+ # AI executes:
723
+ cat .proagents/handoff.md 2>/dev/null || echo "No handoff notes"
724
+ ```
725
+
726
+ Then displays the content to continue where previous AI left off.
727
+
728
+ ### pa:handoff (write)
729
+
730
+ Create handoff notes for other AIs:
731
+
732
+ 1. Summarize current work status
733
+ 2. List completed items
734
+ 3. List in-progress items
735
+ 4. Document blockers
736
+ 5. Save to `./.proagents/handoff.md`
737
+
738
+ ### pa:feedback "description"
739
+
740
+ Log feedback for AI learning:
741
+
742
+ 1. Append to `./.proagents/feedback.md`:
743
+ ```markdown
744
+ ## [DATE] Feedback
745
+ **Type:** correction/preference/pattern
746
+ **Description:** [user's feedback]
747
+ **Action:** [what should be done differently]
748
+ ```
749
+ 2. Apply learning to current work
750
+
751
+ ### pa:decisions
752
+
753
+ **AI reads and displays all decisions:**
754
+
755
+ ```bash
756
+ # AI executes:
757
+ cat .proagents/decisions.md 2>/dev/null || echo "No decisions logged"
758
+ ```
759
+
760
+ ### pa:errors
761
+
762
+ **AI reads and displays error history:**
763
+
764
+ ```bash
765
+ # AI executes:
766
+ cat .proagents/errors.md 2>/dev/null || echo "No errors logged"
767
+ ```
768
+
769
+ ### pa:context
770
+
771
+ **AI reads project context:**
772
+
773
+ ```bash
774
+ # AI executes:
775
+ cat .proagents/context.md 2>/dev/null
776
+ ```
777
+
778
+ This should be read at START of every session!
779
+
780
+ ### pa:feedback
781
+
782
+ **AI reads feedback/corrections:**
783
+
784
+ ```bash
785
+ # AI executes:
786
+ cat .proagents/feedback.md 2>/dev/null || echo "No feedback"
787
+ ```
788
+
789
+ Learn from these to avoid repeating mistakes!
790
+
791
+ ### pa:decision "title"
792
+
793
+ Log architectural decision:
794
+
795
+ 1. Create ADR in `./.proagents/adr/`
796
+ 2. Document:
797
+ - Context
798
+ - Decision
799
+ - Consequences
800
+ 3. Reference in current feature
801
+
802
+ ### pa:activity
803
+
804
+ **AI runs and displays:**
805
+
806
+ ```bash
807
+ # AI executes:
808
+ cat .proagents/activity.log | grep -v "^#" | tail -20
809
+ ```
810
+
811
+ Then formats output:
812
+ ```
813
+ Recent Activity
814
+ ═══════════════
815
+ [2024-03-06 16:00] [Gemini] pa:test - 12 tests passed
816
+ [2024-03-06 15:45] [Claude] pa:implement - Created UserService
817
+ ```
818
+
819
+ ---
820
+
821
+ ## Configuration Commands
822
+
823
+ ### pa:config
824
+
825
+ **AI reads and displays config:**
826
+
827
+ ```bash
828
+ # AI executes:
829
+ cat proagents.config.yaml
830
+ ```
831
+
832
+ Then formats:
833
+ ```
834
+ ProAgents Configuration
835
+ ═══════════════════════
836
+ Project: my-app (nextjs)
837
+
838
+ Platforms: claude, cursor, copilot
839
+
840
+ Testing:
841
+ Framework: vitest
842
+ Coverage: 80%
843
+
844
+ Git:
845
+ Enabled: true
846
+ Branch prefix: feature/
847
+ ```
848
+
849
+ ### pa:checkpoint
850
+
851
+ Pause for user approval:
852
+
853
+ 1. Summarize completed work
854
+ 2. Show next steps
855
+ 3. Wait for user confirmation
856
+ 4. Log checkpoint in activity
857
+
858
+ ### pa:skip-checkpoint
859
+
860
+ Skip the current checkpoint and continue.
861
+
862
+ ---
863
+
864
+ ## History & Progress Commands
865
+
866
+ ### pa:history
867
+
868
+ **AI MUST read the actual activity.log file and display contents.**
869
+
870
+ 1. Run: `cat .proagents/activity.log | tail -30`
871
+ 2. Parse and format entries
872
+ 3. Display most recent first
873
+ 4. NEVER say "no commands yet" without reading the file first
874
+
875
+ **Wrong behavior:**
876
+ ```
877
+ "No commands recorded yet" ← Without reading file!
878
+ ```
879
+
880
+ **Correct behavior:**
881
+ ```
882
+ Reading .proagents/activity.log...
883
+
884
+ Command History
885
+ ═══════════════
886
+ [2024-03-06 16:00] [Gemini] pa:logs - Captured 50 entries
887
+ [2024-03-06 15:30] [Cursor] pa:test - 12 tests passed
888
+ ```
889
+
890
+ ### pa:progress
891
+
892
+ **AI MUST read feature status files and calculate progress.**
893
+
894
+ 1. Run: `cat .proagents/active-features/_index.json`
895
+ 2. Read each feature's status.json
896
+ 3. Calculate progress percentage
897
+ 4. Show visual progress bar
898
+
899
+ ### pa:activity
900
+
901
+ **AI MUST read and display activity.log:**
902
+
903
+ 1. Run: `cat .proagents/activity.log | tail -20`
904
+ 2. Show recent AI activity
905
+ 3. Highlight actions by different AI platforms
906
+
907
+ ---
908
+
909
+ ## Session Commands
910
+
911
+ ### pa:session-end
912
+
913
+ Generate session summary:
914
+
915
+ 1. List all changes made
916
+ 2. List files modified
917
+ 3. List commands executed
918
+ 4. Document any issues
919
+ 5. Save to session history
920
+
921
+ ### pa:lock
922
+
923
+ **AI reads and displays lock status:**
924
+
925
+ ```bash
926
+ # AI executes:
927
+ cat .proagents/.lock 2>/dev/null || echo "No lock file"
928
+ ```
929
+
930
+ Then reports:
931
+ ```
932
+ Lock Status
933
+ ═══════════
934
+ Locked by: Claude (opus-4)
935
+ Task: pa:feature user-auth
936
+ Started: 2024-03-06 15:00
937
+ Expires: 2024-03-06 17:00
938
+
939
+ Or if no lock:
940
+ No active lock. Safe to proceed.
941
+ ```
942
+
943
+ ### pa:lock-release
944
+
945
+ Release lock if you hold it:
946
+
947
+ 1. Verify you hold the lock
948
+ 2. Delete `./.proagents/.lock`
949
+ 3. Log release in activity
950
+
951
+ ---
952
+
953
+ ## Debug & Log Commands
954
+
955
+ **CRITICAL: AI must RUN log commands itself, never tell user to "check the logs".**
956
+
957
+ ### pa:debug
958
+
959
+ Start a debug session:
960
+
961
+ 1. Detect project platform (Web, React Native, Android, iOS)
962
+ 2. Identify the issue from user description
963
+ 3. **RUN log capture commands:**
964
+ - React Native: `adb logcat -d *:S ReactNativeJS:V | tail -200`
965
+ - Android: `adb logcat -d -s AppTag:D | tail -200`
966
+ - iOS: `xcrun simctl spawn booted log show --last 5m`
967
+ 4. **ANALYZE** the captured output
968
+ 5. **REPORT** findings and implement fix
969
+
970
+ ### pa:debug-add
971
+
972
+ Add debug logs throughout code:
973
+
974
+ 1. Detect platform (Web/RN/Android/iOS)
975
+ 2. Analyze code structure
976
+ 3. Add appropriate logging:
977
+ - Function entry/exit with params
978
+ - Variable state changes
979
+ - API calls and responses
980
+ - Error conditions
981
+ 4. Mark all logs with `// DEBUG:START` and `// DEBUG:END`
982
+ 5. Use platform-appropriate syntax:
983
+ - JS/TS: `console.log('[DEBUG]', ...)`
984
+ - Android: `Log.d("DEBUG", ...)`
985
+ - iOS: `print("[DEBUG]", ...)`
986
+
987
+ ### pa:debug-trace "function"
988
+
989
+ Add detailed tracing to specific function:
990
+
991
+ 1. Find function in codebase
992
+ 2. Add entry log with all parameters
993
+ 3. Add timing measurement
994
+ 4. Add exit log with return value
995
+ 5. Wrap in try-catch with error logging
996
+
997
+ ### pa:debug-var "variable"
998
+
999
+ Track all changes to a variable:
1000
+
1001
+ 1. Find variable declaration
1002
+ 2. Add change tracking (willSet/didSet, proxy, setter)
1003
+ 3. Log old value → new value
1004
+ 4. Include stack trace for debugging
1005
+
1006
+ ### pa:debug-api
1007
+
1008
+ Add API request/response logging:
1009
+
1010
+ 1. Find all API/fetch calls
1011
+ 2. Add request logging (method, url, body)
1012
+ 3. Add response logging (status, data, timing)
1013
+ 4. Add error logging with full details
1014
+
1015
+ ### pa:debug-state
1016
+
1017
+ Add state change logging:
1018
+
1019
+ 1. Find state management code
1020
+ 2. Add logging for state changes:
1021
+ - React: useState, useReducer, Redux, Zustand
1022
+ - Android: ViewModel, LiveData, StateFlow
1023
+ - iOS: @State, @Published, ObservableObject
1024
+ 3. Log before/after values
1025
+
1026
+ ### pa:debug-error
1027
+
1028
+ Add comprehensive error logging:
1029
+
1030
+ 1. Wrap risky code in try-catch
1031
+ 2. Add error boundaries (React)
1032
+ 3. Log error message, stack, context
1033
+ 4. Add breadcrumb trail
1034
+
1035
+ ### pa:debug-web
1036
+
1037
+ Web/browser debugging:
1038
+
1039
+ 1. Check browser console for errors
1040
+ 2. Inspect network requests
1041
+ 3. Review console.log statements
1042
+ 4. Check for debugger statements
1043
+ 5. Analyze stack traces
1044
+
1045
+ ### pa:debug-rn
1046
+
1047
+ React Native debugging:
1048
+
1049
+ 1. Check Metro bundler logs
1050
+ 2. Use Flipper or Reactotron
1051
+ 3. View device logs via ADB (Android) or Console.app (iOS)
1052
+ 4. Check `__DEV__` conditional logs
1053
+ 5. Analyze red screen errors
1054
+
1055
+ ### pa:debug-android
1056
+
1057
+ Android native debugging:
1058
+
1059
+ 1. Run `adb logcat` with appropriate filters
1060
+ 2. Filter by tag: `adb logcat -s MyApp:D`
1061
+ 3. Filter by priority: `adb logcat *:E` (errors only)
1062
+ 4. Check for crashes in Logcat
1063
+ 5. Use Android Studio Logcat panel
1064
+
1065
+ ### pa:debug-ios
1066
+
1067
+ iOS native debugging:
1068
+
1069
+ 1. Use Xcode console (Cmd+Shift+C)
1070
+ 2. Check Console.app with device selected
1071
+ 3. Filter by subsystem/category with os_log
1072
+ 4. Run `xcrun simctl spawn booted log stream`
1073
+ 5. Check crash logs in Organizer
1074
+
1075
+ ### pa:logs
1076
+
1077
+ **AI runs log commands and shows output:**
1078
+
1079
+ 1. Detect platform
1080
+ 2. Run appropriate command:
1081
+ - RN: `adb logcat -d *:S ReactNativeJS:V | tail -100`
1082
+ - Android: `adb logcat -d | tail -100`
1083
+ - iOS: `xcrun simctl spawn booted log show --last 2m`
1084
+ 3. Parse and display results
1085
+ 4. Highlight errors and warnings
1086
+
1087
+ ### pa:logs-filter "term"
1088
+
1089
+ **AI runs filtered log command:**
1090
+
1091
+ 1. Run: `adb logcat -d | grep -i "term"` (or platform equivalent)
1092
+ 2. Parse output
1093
+ 3. Show matching entries with context
1094
+ 4. Analyze patterns in matches
1095
+
1096
+ ### pa:logs-clear
1097
+
1098
+ Clear debug logs:
1099
+
1100
+ - Web: Clear browser console
1101
+ - React Native: Restart Metro bundler
1102
+ - Android: `adb logcat -c`
1103
+ - iOS: Clear in Console.app
1104
+
1105
+ ### pa:debug-clean
1106
+
1107
+ Remove debug statements before production:
1108
+
1109
+ 1. Find all debug statements:
1110
+ - `console.log`, `console.debug`, `debugger` (JS)
1111
+ - `Log.d`, `Log.v`, `System.out` (Android)
1112
+ - `print`, `debugPrint`, `NSLog` (iOS)
1113
+ 2. List found statements with file:line
1114
+ 3. Offer to remove or comment out
1115
+ 4. Verify no production-breaking changes