proagents 1.6.12 → 1.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.proagents/.cursorrules +16 -2
  2. package/.proagents/.learning/global/common-patterns.template.json +60 -0
  3. package/.proagents/.learning/global/user-preferences.template.json +78 -0
  4. package/.proagents/.windsurfrules +16 -2
  5. package/.proagents/AGENTS.md +55 -0
  6. package/.proagents/AI_INSTRUCTIONS.md +1252 -53
  7. package/.proagents/ANTIGRAVITY.md +16 -2
  8. package/.proagents/BOLT.md +16 -2
  9. package/.proagents/CHATGPT.md +16 -2
  10. package/.proagents/CLAUDE.md +16 -2
  11. package/.proagents/GEMINI.md +16 -2
  12. package/.proagents/GROQ.md +16 -2
  13. package/.proagents/KIRO.md +16 -2
  14. package/.proagents/LOVABLE.md +16 -2
  15. package/.proagents/PROAGENTS.md +52 -26
  16. package/.proagents/REPLIT.md +16 -2
  17. package/.proagents/active-features/_index.template.json +75 -0
  18. package/.proagents/changelog/_recent.template.md +51 -0
  19. package/.proagents/docs/command-details.md +985 -82
  20. package/.proagents/worklog/_context.md +31 -1
  21. package/.proagents/worklog/_context.template.md +82 -0
  22. package/.proagents/worklog/ai-stats.json +19 -0
  23. package/.proagents/worklog/ai-stats.template.json +54 -0
  24. package/README.md +85 -1
  25. package/bin/proagents.js +132 -1
  26. package/lib/commands/ai.js +103 -11
  27. package/lib/commands/changelog.js +389 -0
  28. package/lib/commands/completion.js +413 -0
  29. package/lib/commands/config.js +248 -0
  30. package/lib/commands/doctor.js +222 -25
  31. package/lib/commands/help.js +22 -2
  32. package/lib/commands/init.js +171 -2
  33. package/lib/commands/open.js +188 -0
  34. package/lib/commands/release.js +1007 -0
  35. package/lib/commands/restore.js +150 -0
  36. package/lib/commands/stats.js +320 -0
  37. package/lib/commands/uninstall.js +98 -4
  38. package/lib/commands/upgrade.js +102 -10
  39. package/lib/commands/version.js +140 -0
  40. package/package.json +1 -1
@@ -2,6 +2,49 @@
2
2
 
3
3
  This project uses ProAgents - an AI-agnostic development workflow framework.
4
4
 
5
+ ---
6
+
7
+ ## ⚠️ MANDATORY: Auto-Sync on EVERY pa: Command
8
+
9
+ **BEFORE executing ANY `pa:` command, AI MUST run these steps FIRST:**
10
+
11
+ ```bash
12
+ # STEP 1: Load context (REQUIRED - do this FIRST)
13
+ cat .proagents/worklog/_context.md 2>/dev/null
14
+ cat .proagents/changelog/_recent.md 2>/dev/null | head -30
15
+ tail -10 .proagents/activity.log 2>/dev/null
16
+ ```
17
+
18
+ **This applies to ALL commands including:**
19
+ - `pa:fix "bug"` - Load context FIRST, then fix
20
+ - `pa:feature "name"` - Load context FIRST, then start feature
21
+ - `pa:test` - Load context FIRST, then run tests
22
+ - `pa:doc` - Load context FIRST, then generate docs
23
+ - **EVERY pa: command** - Load context FIRST
24
+
25
+ **AFTER executing ANY `pa:` command that changes files, AI MUST:**
26
+
27
+ ```bash
28
+ # Update worklogs and changelogs
29
+ # 1. Prepend to .proagents/changelog/_recent.md
30
+ # 2. Update .proagents/worklog/_context.md
31
+ # 3. Update .proagents/changelog/modules/[module].md
32
+ # 4. Log to .proagents/activity.log
33
+ ```
34
+
35
+ **Example flow for `pa:fix "login bug"`:**
36
+ ```
37
+ 1. AI reads _context.md, _recent.md, activity.log ← AUTO-SYNC FIRST
38
+ 2. AI analyzes and fixes the bug ← DO THE WORK
39
+ 3. AI updates _recent.md with fix details ← LOG THE CHANGE
40
+ 4. AI updates _context.md with current state ← UPDATE CONTEXT
41
+ 5. AI logs to activity.log ← LOG ACTIVITY
42
+ ```
43
+
44
+ **Note:** When updating `_recent.md` or `_context.md`, first read the corresponding `*.template.md` file to use the latest format. See "Using Template Reference Files" section below.
45
+
46
+ ---
47
+
5
48
  ## CRITICAL PRINCIPLE: ALWAYS DO, NEVER JUST TELL
6
49
 
7
50
  **ProAgents automates development. The AI must EXECUTE actions, not give instructions for users to follow.**
@@ -31,24 +74,24 @@ This project uses ProAgents - an AI-agnostic development workflow framework.
31
74
 
32
75
  **Multiple AI tools may work on this project simultaneously. They do NOT share context.**
33
76
 
34
- ### AUTOMATIC Context Loading (No Manual pa:sync Needed)
77
+ ### AUTOMATIC Context Loading (EVERY pa: Command)
35
78
 
36
- **On FIRST pa: command of session, AI AUTOMATICALLY does:**
79
+ **On EVERY `pa:` command, AI MUST FIRST load context:**
37
80
 
38
81
  ```bash
39
- # 1. Load context (replaces manual pa:sync)
82
+ # MANDATORY FIRST STEP - Run before ANY pa: command
40
83
  cat .proagents/worklog/_context.md 2>/dev/null
41
84
  cat .proagents/changelog/_recent.md 2>/dev/null | head -30
42
85
  tail -10 .proagents/activity.log 2>/dev/null
43
86
 
44
- # 2. Check for conflicts
87
+ # Also check for conflicts
45
88
  cat .proagents/.active-files 2>/dev/null
46
-
47
- # 3. Validate previous logging
48
- git diff --name-only HEAD~3 2>/dev/null | wc -l
49
89
  ```
50
90
 
51
- **User does NOT need to type pa:sync - it happens automatically.**
91
+ **This is NOT optional. This is NOT just for "first command".**
92
+ **EVERY pa: command = Load context FIRST, then execute.**
93
+
94
+ **User does NOT need to type pa:sync - AI does it automatically on EVERY pa: command.**
52
95
 
53
96
  ### Before ANY `pa:` command:
54
97
 
@@ -114,6 +157,37 @@ AI immediately updates these files (no user prompt needed):
114
157
  4. .proagents/changelog/modules/X.md ← Based on file path
115
158
  ```
116
159
 
160
+ ### Using Template Reference Files
161
+
162
+ **IMPORTANT:** Template files (`*.template.md`, `*.template.json`) provide the latest format for user data files.
163
+
164
+ | User Data File (EDIT THIS) | Template Reference (READ ONLY) |
165
+ |----------------------------|-------------------------------|
166
+ | `changelog/_recent.md` | `changelog/_recent.template.md` |
167
+ | `worklog/_context.md` | `worklog/_context.template.md` |
168
+ | `worklog/ai-stats.json` | `worklog/ai-stats.template.json` |
169
+ | `active-features/_index.json` | `active-features/_index.template.json` |
170
+ | `.learning/global/user-preferences.json` | `.learning/global/user-preferences.template.json` |
171
+ | `.learning/global/common-patterns.json` | `.learning/global/common-patterns.template.json` |
172
+
173
+ **How to use:**
174
+ 1. **Read the template FIRST** before creating/updating user data files
175
+ 2. **Apply the template format** to user data (structure, fields, sections)
176
+ 3. **NEVER modify template files** - they are READ ONLY (updated by framework)
177
+
178
+ **Why templates exist:**
179
+ - Templates get updated when ProAgents upgrades (new fields, better structure)
180
+ - User data files are preserved during upgrades (your content stays safe)
181
+ - AI always has access to the latest format by reading templates
182
+
183
+ **Common mistake to avoid:**
184
+ ```
185
+ WRONG: Edit _recent.template.md directly
186
+ RIGHT: Read _recent.template.md, then edit _recent.md using that format
187
+ ```
188
+
189
+ ---
190
+
117
191
  ### Auto-Log Format for _recent.md:
118
192
 
119
193
  After editing `src/auth/login.ts`, AI prepends to `_recent.md`:
@@ -189,6 +263,81 @@ When removing or correcting previous changes, also log:
189
263
 
190
264
  ---
191
265
 
266
+ ## Smart Context Features (AUTO)
267
+
268
+ ### 1. Quick Summary (Top of _context.md)
269
+
270
+ After EVERY change, AI regenerates Quick Summary (max 5 lines):
271
+
272
+ ```
273
+ ## Quick Summary
274
+ Last: Claude fixed login bug #123 (2 hrs ago)
275
+ Active: user-auth feature (70%)
276
+ Pending: 2 tasks
277
+ Tests: ✓ Passing
278
+ ```
279
+
280
+ ### 2. Context Changed Alert
281
+
282
+ On first pa: command, check if another AI worked:
283
+
284
+ ```bash
285
+ # AI compares last session vs _recent.md
286
+ LAST_AI=$(grep "Last AI:" .proagents/worklog/_context.md | cut -d: -f2)
287
+ RECENT_AI=$(head -20 .proagents/changelog/_recent.md | grep "AI:" | head -1)
288
+ ```
289
+
290
+ If different AI made changes, show:
291
+ ```
292
+ ⚠️ CONTEXT CHANGED
293
+ Gemini made 3 changes 1 hour ago:
294
+ - Fixed API endpoint
295
+ - Updated auth flow
296
+ Review before continuing? [Y/n]
297
+ ```
298
+
299
+ ### 3. Test Status Auto-Update
300
+
301
+ After ANY test command, update _context.md:
302
+
303
+ ```
304
+ ## Test Status
305
+ Status: ✓ 45 passing | ✗ 2 failing
306
+ Last Run: 2024-03-11 15:30
307
+ Failing: auth.test.ts (line 45)
308
+ ```
309
+
310
+ ### 4. Feature Progress Auto-Calculate
311
+
312
+ ```
313
+ ## Feature Progress
314
+ Feature: user-auth
315
+ Progress: ████████░░ 80%
316
+ Completed: 8/10 tasks
317
+ ```
318
+
319
+ Calculate: (completed tasks / total tasks) × 100
320
+
321
+ ### 5. Auto-Archive Old Logs (7+ days)
322
+
323
+ ```bash
324
+ mkdir -p .proagents/worklog/archive
325
+ # Move files older than 7 days
326
+ find .proagents/worklog -maxdepth 1 -name "2*.md" -mtime +7 -exec mv {} .proagents/worklog/archive/ \;
327
+ ```
328
+
329
+ ### 6. AI Performance Stats
330
+
331
+ Update `worklog/ai-stats.json` after each session:
332
+
333
+ ```json
334
+ {
335
+ "Claude": { "sessions": 15, "tasks": 45, "reverts": 2 }
336
+ }
337
+ ```
338
+
339
+ ---
340
+
192
341
  ## Cross-AI Session Tracking (AUTOMATIC)
193
342
 
194
343
  **All session tracking is AUTOMATIC. User does NOT need to run these commands manually.**
@@ -201,6 +350,10 @@ When removing or correcting previous changes, also log:
201
350
  | Log changes | After each edit | **None** - Auto |
202
351
  | Update _context.md | After each edit | **None** - Auto |
203
352
  | Check conflicts | Before editing files | **None** - Auto |
353
+ | Update Quick Summary | After each edit | **None** - Auto |
354
+ | Context changed alert | First pa: command | **None** - Auto |
355
+ | Update test status | After tests | **None** - Auto |
356
+ | Update AI stats | After session | **None** - Auto |
204
357
 
205
358
  ### On First pa: Command (Auto-Sync):
206
359
 
@@ -402,11 +555,14 @@ Auto-detect issue numbers from user input and include in changelog:
402
555
  ### Collaboration
403
556
  | Command | Action |
404
557
  |---------|--------|
405
- | `pa:activity` | Show AI activity log |
558
+ | `pa:activity` | **Show ALL AI platforms activity** (not just yours!) |
406
559
  | `pa:lock` | Show lock status |
407
560
  | `pa:handoff` | Create handoff notes |
408
561
  | `pa:feedback "text"` | Log feedback for AI learning |
409
562
  | `pa:decision "title"` | Log architectural decision |
563
+ | `pa:learn "pattern"` | Teach AI a pattern → `.learning/patterns.json` |
564
+ | `pa:forget "pattern"` | Remove learned pattern |
565
+ | `pa:learning` | Show learning report (patterns, corrections, stats) |
410
566
 
411
567
  ### Cross-AI Continuity (CRITICAL)
412
568
  | Command | Action |
@@ -436,7 +592,7 @@ Auto-detect issue numbers from user input and include in changelog:
436
592
  |---------|--------|
437
593
  | `pa:history` | Show command history (read activity.log) |
438
594
  | `pa:progress` | Show feature progress |
439
- | `pa:activity` | Show recent AI activity |
595
+ | `pa:activity` | **Show ALL AI platforms activity** (cross-AI visibility) |
440
596
 
441
597
  ---
442
598
 
@@ -471,34 +627,189 @@ When user types a `pa:` command:
471
627
 
472
628
  ---
473
629
 
630
+ ## pa:help Execution
631
+
632
+ **Show comprehensive help with examples and categories.**
633
+
634
+ **Command variations:**
635
+ ```
636
+ pa:help # Full help with examples
637
+ pa:help <command> # Detailed help for specific command
638
+ pa:help --quick # Quick reference only
639
+ pa:help --examples # Show more examples
640
+ ```
641
+
642
+ **Output format:**
643
+ ```
644
+ ProAgents Help
645
+ ══════════════════════════════════════════════════════════
646
+
647
+ 🚀 Quick Start Examples
648
+ ───────────────────────
649
+ pa:feature "user authentication" Start a new feature
650
+ pa:fix "login button not working" Quick bug fix
651
+ pa:status Check current progress
652
+ pa:resume Continue where you left off
653
+
654
+ 📋 Common Workflows
655
+ ───────────────────
656
+ Feature Development:
657
+ pa:feature → pa:analyze → pa:design → pa:implement → pa:test → pa:deploy
658
+
659
+ Bug Fix (fast track):
660
+ pa:fix "description" → auto-analyze → fix → test → done
661
+
662
+ Returning to Work:
663
+ pa:sync → pa:resume → continue working
664
+
665
+ 📂 Commands by Category
666
+ ───────────────────────
667
+
668
+ Core Commands:
669
+ pa:feature "name" Start new feature with full workflow
670
+ pa:fix "bug" Quick bug fix mode
671
+ pa:status Show current progress (enhanced)
672
+ pa:help Show this help
673
+
674
+ Workflow Phases:
675
+ pa:analyze Deep codebase analysis
676
+ pa:requirements Gather requirements
677
+ pa:design UI/Architecture design
678
+ pa:plan Create implementation plan
679
+ pa:implement Execute implementation
680
+ pa:test Create and run tests
681
+ pa:review Code review workflow
682
+ pa:doc Generate documentation
683
+ pa:deploy Deployment preparation
684
+
685
+ Progress & History:
686
+ pa:progress Visual progress (all features)
687
+ pa:status Detailed status (current feature)
688
+ pa:activity All AI activity with filters
689
+ pa:history Command history with stats
690
+
691
+ Cross-AI Collaboration:
692
+ pa:sync Load context + visual diff
693
+ pa:resume Quick resume with next action
694
+ pa:handoff Create handoff notes
695
+ pa:conflict-check Check for conflicts
696
+
697
+ Learning & Tracking:
698
+ pa:feedback "text" Log feedback for AI learning
699
+ pa:decision "title" Log architectural decision
700
+ pa:error "desc" Log error and solution
701
+ pa:learn "pattern" Teach AI a pattern
702
+ pa:forget "pattern" Remove learned pattern
703
+ pa:learning Show learning report
704
+
705
+ 💡 Tips
706
+ ───────
707
+ • Use aliases: pa:f (feature), pa:s (status), pa:h (help)
708
+ • AI auto-syncs on every command - no manual sync needed
709
+ • Changes are auto-logged to changelog
710
+
711
+ Type "pa:help <command>" for detailed help on a specific command.
712
+ Example: pa:help feature
713
+ ```
714
+
715
+ **For specific command help (pa:help feature):**
716
+ ```
717
+ pa:feature - Start New Feature
718
+ ══════════════════════════════════════════════════════════
719
+
720
+ Usage:
721
+ pa:feature "feature name"
722
+ pa:feature "user authentication"
723
+
724
+ What it does:
725
+ 1. Creates feature folder in .proagents/active-features/
726
+ 2. Analyzes codebase for relevant files
727
+ 3. Guides through full workflow phases
728
+ 4. Tracks progress and tasks
729
+
730
+ Workflow phases:
731
+ Analysis → Requirements → Design → Planning →
732
+ Implementation → Testing → Review → Documentation → Deployment
733
+
734
+ Options:
735
+ pa:feature "name" --fast Skip optional phases
736
+ pa:feature "name" --no-tests Skip test generation
737
+
738
+ Related commands:
739
+ pa:feature-list List all features
740
+ pa:feature-complete Mark feature as complete
741
+ pa:status Check feature status
742
+ ```
743
+
744
+ ---
745
+
474
746
  ## pa:history Execution
475
747
 
476
748
  **AI MUST read and display the actual log file content.**
477
749
 
750
+ **Command variations:**
751
+ ```
752
+ pa:history # All recent history (default)
753
+ pa:history --today # Today's commands only
754
+ pa:history --ai Claude # Filter by AI platform
755
+ pa:history --command pa:fix # Filter by command type
756
+ pa:history --search "auth" # Search in descriptions
757
+ pa:history --stats # Show command statistics
758
+ ```
759
+
760
+ **Steps:**
478
761
  1. Read `./.proagents/activity.log`
479
- 2. Filter out header lines (lines starting with #)
480
- 3. Display entries (most recent first)
762
+ 2. Filter based on options (if provided)
763
+ 3. Display entries with grouping and icons
481
764
  4. NEVER say "no commands yet" without reading the file
482
765
 
483
766
  ```bash
484
767
  # AI runs this:
485
- grep -v "^#" .proagents/activity.log | grep -v "^$" | grep -v "Activity Log Start" | tail -30
768
+ grep -v "^#" .proagents/activity.log | grep -v "^$" | grep -v "Activity Log Start" | tail -50
486
769
  ```
487
770
 
488
- If no entries found after filtering, show:
771
+ **Enhanced output format:**
489
772
  ```
490
- No pa: commands logged yet.
491
- Run some commands, then try pa:history again.
773
+ Command History
774
+ ══════════════════════════════════════════════════════════
775
+
776
+ Today (12 commands)
777
+ ───────────────────
778
+ [16:00] [Gemini] ✅ pa:test - 12 tests passed
779
+ [15:30] [Cursor] 🐛 pa:fix - Fixed login validation
780
+ [15:15] [Claude] 🔍 pa:analyze - Analyzed 45 files
781
+ [15:10] [Claude] ✨ pa:feature - Started "user-auth"
782
+
783
+ Yesterday (8 commands)
784
+ ──────────────────────
785
+ [18:00] [ChatGPT] 📝 pa:doc - Updated README
786
+ [16:30] [Claude] 🔨 pa:implement - Created UserService
787
+
788
+ ──────────────────────────────────────────────────────────
789
+ Stats: 20 commands | 4 AIs | Most used: pa:implement (6)
492
790
  ```
493
791
 
494
- **Output format:**
792
+ **With --stats option:**
495
793
  ```
496
- Command History
497
- ═══════════════
498
- [2024-03-06 16:00] [Gemini] pa:logs - Captured 50 entries
499
- [2024-03-06 15:30] [Cursor] pa:test - 12 tests passed
500
- [2024-03-06 15:15] [Claude] pa:analyze - Analyzed 45 files
501
- [2024-03-06 15:10] [Claude] pa:feature - Started "user-auth"
794
+ Command Statistics
795
+ ══════════════════════════════════════════════════════════
796
+
797
+ By Command:
798
+ pa:implement ████████████████ 12
799
+ pa:fix ████████ 6
800
+ pa:test ██████ 4
801
+ pa:analyze ████ 3
802
+
803
+ By AI Platform:
804
+ Claude ████████████████ 14
805
+ Cursor ████████ 7
806
+ Gemini ████ 3
807
+ ChatGPT ██ 1
808
+
809
+ By Day:
810
+ Today ████████████████ 12
811
+ Yesterday ████████ 8
812
+ Earlier ████ 5
502
813
  ```
503
814
 
504
815
  ---
@@ -509,25 +820,50 @@ Command History
509
820
 
510
821
  1. Read `./.proagents/active-features/_index.json`
511
822
  2. Read each feature's `status.json`
512
- 3. Calculate and display progress
823
+ 3. Read `./.proagents/activity.log` for last AI info
824
+ 4. Calculate progress and display enhanced output
513
825
 
514
826
  ```bash
515
827
  # AI runs this:
516
828
  cat .proagents/active-features/_index.json
517
829
  cat .proagents/active-features/feature-*/status.json
830
+ cat .proagents/activity.log | tail -50
518
831
  ```
519
832
 
520
- **Output format:**
833
+ **Output format (enhanced):**
834
+ ```
835
+ Feature Progress
836
+ ════════════════════════════════════════════════════════════
837
+
838
+ user-auth ████████████████░░░░ 80% (8/10 tasks) 3d Claude
839
+ └─ Analysis ✓ → Requirements ✓ → Design ✓ → Implementation ✓ → Testing ● → Review ○
840
+
841
+ dashboard ████████░░░░░░░░░░░░ 40% (4/10 tasks) 5d Cursor
842
+ └─ Analysis ✓ → Requirements ✓ → Design ● → Implementation ○ → Testing ○ → Review ○
843
+
844
+ notifications ██░░░░░░░░░░░░░░░░░░ 10% (1/10 tasks) 1d ChatGPT
845
+ └─ Analysis ● → Requirements ○ → Design ○ → Implementation ○ → Testing ○ → Review ○
846
+
847
+ ────────────────────────────────────────────────────────────
848
+ Summary: 3 active | 5 completed | Avg: 4.2 days/feature
849
+ ```
850
+
851
+ **Legend:**
852
+ - `✓` = Phase completed
853
+ - `●` = Current phase (in progress)
854
+ - `○` = Phase not started
855
+ - `(8/10 tasks)` = Completed tasks / Total tasks
856
+ - `3d` = Days since feature started
857
+ - `Claude` = Last AI that worked on this feature
858
+
859
+ **If no features exist:**
521
860
  ```
522
861
  Feature Progress
523
- ════════════════
524
- user-auth [████████░░] 80%
525
- Phase: testing
526
- Last: Ran 12 unit tests
862
+ ════════════════════════════════════════════════════════════
527
863
 
528
- dashboard [████░░░░░░] 40%
529
- Phase: implementation
530
- Last: Created 3 components
864
+ No active features.
865
+
866
+ Start one with: pa:feature "feature name"
531
867
  ```
532
868
 
533
869
  ---
@@ -536,28 +872,888 @@ dashboard [████░░░░░░] 40%
536
872
 
537
873
  **IMPORTANT:** Show REAL data only, never example data.
538
874
 
875
+ **Steps:**
539
876
  1. Read `./.proagents/active-features/_index.json`
540
- 2. If empty:
541
- ```
542
- Project Status
543
- ══════════════
544
- No features tracked.
545
-
546
- Start with:
547
- pa:feature "name"
548
- → pa:fix "bug"
549
- ```
550
- 3. If has features:
551
- ```
552
- Project Status
553
- ══════════════
554
-
555
- Active: [count]
556
- • [name] - [phase] ([progress]%)
557
-
558
- Paused: [count]
559
- Completed: [count]
560
- ```
877
+ 2. Read current feature's `status.json`
878
+ 3. Run: `git status` and `git log --oneline -5`
879
+ 4. Read `./.proagents/activity.log | tail -20`
880
+ 5. Display enhanced status
881
+
882
+ **If no features:**
883
+ ```
884
+ Project Status
885
+ ══════════════════════════════════════════════════════════
886
+
887
+ No active features.
888
+
889
+ Start with:
890
+ → pa:feature "feature name"
891
+ → pa:fix "bug description"
892
+ ```
893
+
894
+ **If has features (enhanced output):**
895
+ ```
896
+ Project Status
897
+ ══════════════════════════════════════════════════════════
898
+
899
+ Feature: user-auth Branch: feature/user-auth
900
+ Phase: Implementation (4/6) Started: 3d ago
901
+ Progress: ████████████░░░░░░░░ 60% Time: ~4.5h
902
+
903
+ Tasks: 3/5 completed
904
+ ✓ Create auth service
905
+ ✓ Add login endpoint
906
+ ✓ Add register endpoint
907
+ → Implement JWT tokens (in progress)
908
+ ○ Add password reset
909
+
910
+ Files: 8 modified (+245, -32) Tests: 12 ✓ | 2 ✗ | 80% cov
911
+ Contributors: Claude (60%), Cursor (40%)
912
+
913
+ ──────────────────────────────────────────────────────────
914
+ Next: Complete JWT token implementation
915
+ ```
916
+
917
+ **Status indicators:**
918
+ - `✓` = Task completed
919
+ - `→` = In progress
920
+ - `○` = Not started
921
+ - `⚠️ BLOCKED:` = Show if blockers exist
922
+
923
+ **Summary line (for multiple features):**
924
+ ```
925
+ ──────────────────────────────────────────────────────────
926
+ Summary: 2 active | 1 paused | 5 completed
927
+ ```
928
+
929
+ ---
930
+
931
+ ## pa:activity Execution
932
+
933
+ **CRITICAL: Show ALL AI platforms, not just your own!**
934
+
935
+ The purpose of `pa:activity` is cross-AI visibility. Users need to see what ALL AIs have done.
936
+
937
+ **Command variations:**
938
+ ```
939
+ pa:activity # All recent activity (default)
940
+ pa:activity --today # Today's activity only
941
+ pa:activity --ai Claude # Filter by AI platform
942
+ pa:activity --command pa:fix # Filter by command type
943
+ pa:activity --files # Show files changed per action
944
+ ```
945
+
946
+ **Steps:**
947
+ 1. Run: `cat .proagents/activity.log | tail -50`
948
+ 2. Display ALL entries (Claude, Cursor, ChatGPT, Gemini, Copilot, etc.)
949
+ 3. Group by time period (Today, Yesterday, Earlier)
950
+ 4. Add action icons based on command type
951
+ 5. Show summary with action count per platform
952
+
953
+ **Action icons:**
954
+ | Command | Icon | Description |
955
+ |---------|------|-------------|
956
+ | `pa:feature` | ✨ | New feature |
957
+ | `pa:fix` | 🐛 | Bug fix |
958
+ | `pa:test` | ✅ | Testing |
959
+ | `pa:doc` | 📝 | Documentation |
960
+ | `pa:implement` | 🔨 | Implementation |
961
+ | `pa:analyze` | 🔍 | Analysis |
962
+ | `pa:design` | 🎨 | Design |
963
+ | `pa:review` | 👀 | Code review |
964
+ | `pa:deploy` | 🚀 | Deployment |
965
+
966
+ **Output format (enhanced):**
967
+ ```
968
+ Recent Activity (All AI Platforms)
969
+ ══════════════════════════════════════════════════════════
970
+
971
+ Today (5 actions)
972
+ ─────────────────
973
+ [16:00] [Claude] ✨ pa:feature - Started user-auth
974
+ └─ 2 files: feature.json, status.json
975
+ [15:30] [Cursor] 🐛 pa:fix - Fixed login validation bug
976
+ └─ 1 file: auth.service.ts (+12, -3)
977
+ [15:00] [Gemini] ✅ pa:test - 12 tests passed, 2 failing
978
+ [14:30] [Claude] 🔨 pa:implement - Created UserService
979
+ └─ 3 files: user.service.ts, user.controller.ts, user.module.ts
980
+ [14:00] [ChatGPT] 🔍 pa:analyze - Analyzed auth module
981
+
982
+ Yesterday (8 actions)
983
+ ─────────────────────
984
+ [18:00] [Claude] 🎨 pa:design - Created component diagram
985
+ [16:30] [Cursor] 📝 pa:doc - Updated API documentation
986
+ ...
987
+
988
+ ──────────────────────────────────────────────────────────
989
+ Summary: 13 actions | 4 AIs active | Last 48h
990
+ Claude: 5 | Cursor: 4 | Gemini: 2 | ChatGPT: 2
991
+ ```
992
+
993
+ **IMPORTANT:**
994
+ - Show ALL platforms in the log, not just yours
995
+ - This enables cross-AI collaboration
996
+ - Users switch between AIs and need full visibility
997
+ - Group by time for better readability
998
+ - Show files changed when available (from changelog)
999
+
1000
+ ---
1001
+
1002
+ ## pa:deploy Execution
1003
+
1004
+ **Show interactive deployment checklist with real-time status.**
1005
+
1006
+ **Command variations:**
1007
+ ```
1008
+ pa:deploy # Full deployment workflow
1009
+ pa:deploy-check # Pre-deployment checklist only
1010
+ pa:deploy-staging # Deploy to staging
1011
+ pa:deploy-prod # Deploy to production
1012
+ ```
1013
+
1014
+ **Steps:**
1015
+ 1. Read `./.proagents/prompts/08-deployment.md`
1016
+ 2. Run pre-deployment checks (tests, lint, build)
1017
+ 3. Display interactive checklist with real-time status
1018
+ 4. Guide through deployment steps
1019
+ 5. Show post-deployment verification
1020
+
1021
+ **Output format (enhanced checklist):**
1022
+ ```
1023
+ Deployment Checklist
1024
+ ═══════════════════════════════════════════════════════════
1025
+
1026
+ 📋 Pre-Deployment
1027
+ ─────────────────
1028
+ ✓ All tests passing 12/12 tests
1029
+ ✓ No linting errors 0 errors
1030
+ ✓ Build successful 2.3s
1031
+ ✓ No console.log statements cleaned
1032
+ ○ Version bumped pending
1033
+ ○ Changelog updated pending
1034
+
1035
+ 🔒 Security
1036
+ ───────────
1037
+ ✓ No hardcoded secrets scanned
1038
+ ✓ Dependencies audited 0 vulnerabilities
1039
+ ○ Security review approved awaiting
1040
+
1041
+ 📦 Build & Assets
1042
+ ─────────────────
1043
+ ✓ Bundle size acceptable 245kb (limit: 300kb)
1044
+ ✓ Assets optimized images compressed
1045
+ ○ Source maps generated pending
1046
+
1047
+ 📝 Documentation
1048
+ ────────────────
1049
+ ✓ README updated current
1050
+ ○ API docs updated pending
1051
+ ○ Release notes prepared pending
1052
+
1053
+ 🚀 Ready to Deploy?
1054
+ ───────────────────
1055
+ Status: 8/14 checks passed
1056
+
1057
+ Blockers:
1058
+ ⚠️ Version not bumped - run: npm version patch
1059
+ ⚠️ Changelog needs update - run: pa:changelog
1060
+ ⚠️ Security review pending
1061
+
1062
+ Run "pa:deploy --fix" to auto-fix resolvable issues.
1063
+ ```
1064
+
1065
+ **During deployment:**
1066
+ ```
1067
+ Deploying to Staging
1068
+ ═══════════════════════════════════════════════════════════
1069
+
1070
+ [1/5] Building application... ✓ Complete (2.3s)
1071
+ [2/5] Running migrations... ✓ Complete (0.5s)
1072
+ [3/5] Deploying to staging... ● In progress...
1073
+ [4/5] Running smoke tests... ○ Pending
1074
+ [5/5] Verifying health checks... ○ Pending
1075
+
1076
+ Progress: ██████████░░░░░░░░░░ 50%
1077
+ ```
1078
+
1079
+ **Post-deployment verification:**
1080
+ ```
1081
+ Post-Deployment Verification
1082
+ ═══════════════════════════════════════════════════════════
1083
+
1084
+ 🏥 Health Checks
1085
+ ────────────────
1086
+ ✓ API responding 200 OK (45ms)
1087
+ ✓ Database connected healthy
1088
+ ✓ Cache working redis OK
1089
+ ✓ External services all reachable
1090
+
1091
+ 📊 Metrics (last 5 min)
1092
+ ───────────────────────
1093
+ Error rate: 0.1% (baseline: 0.2%) ✓ OK
1094
+ Response time: 120ms (baseline: 150ms) ✓ OK
1095
+ Requests/sec: 450 (baseline: 400) ✓ OK
1096
+
1097
+ 🔍 Smoke Tests
1098
+ ──────────────
1099
+ ✓ Homepage loads 200ms
1100
+ ✓ Login works passed
1101
+ ✓ API endpoints responding 12/12 OK
1102
+ ✓ Critical flows working all passed
1103
+
1104
+ ══════════════════════════════════════════════════════════
1105
+ ✅ Deployment Successful!
1106
+
1107
+ Next steps:
1108
+ • Monitor metrics for 30 min
1109
+ • Check error logs: pa:logs --errors
1110
+ • If issues, rollback: pa:rollback
1111
+ ```
1112
+
1113
+ **Rollback available:**
1114
+ ```
1115
+ ⚠️ Issues Detected - Rollback Available
1116
+ ═══════════════════════════════════════════════════════════
1117
+
1118
+ Problem: Error rate increased to 5% (threshold: 2%)
1119
+
1120
+ Options:
1121
+ [1] Rollback to previous version (v1.2.3)
1122
+ [2] Investigate and fix forward
1123
+ [3] Disable feature flag only
1124
+
1125
+ Rollback command: pa:rollback --to v1.2.3
1126
+ ```
1127
+
1128
+ **Legend:**
1129
+ - `✓` = Check passed
1130
+ - `●` = In progress
1131
+ - `○` = Pending
1132
+ - `✗` = Failed
1133
+ - `⚠️` = Warning/Blocker
1134
+
1135
+ ---
1136
+
1137
+ ## pa:test Execution
1138
+
1139
+ **Run tests with enhanced coverage visualization.**
1140
+
1141
+ **Command variations:**
1142
+ ```
1143
+ pa:test # Run all tests with coverage
1144
+ pa:test-unit # Unit tests only
1145
+ pa:test-e2e # E2E tests only
1146
+ pa:test-watch # Watch mode
1147
+ pa:test "file" # Test specific file
1148
+ ```
1149
+
1150
+ **Steps:**
1151
+ 1. Read `./.proagents/prompts/06-testing.md`
1152
+ 2. Detect test framework (Jest, Vitest, Mocha, etc.)
1153
+ 3. Run tests with coverage
1154
+ 4. Display enhanced results with visualization
1155
+ 5. Update `.proagents/worklog/_context.md` with test status
1156
+
1157
+ **Output format (enhanced):**
1158
+ ```
1159
+ Test Results
1160
+ ═══════════════════════════════════════════════════════════
1161
+
1162
+ Summary: 45 passed | 2 failed | 3 skipped 2.3s
1163
+
1164
+ Coverage
1165
+ ────────
1166
+ Overall: ████████████████░░░░ 78% (target: 80%)
1167
+
1168
+ By Module:
1169
+ src/auth/ ████████████████████ 95% ✓
1170
+ src/api/ ████████████████░░░░ 80% ✓
1171
+ src/services/ ██████████████░░░░░░ 72% ⚠️
1172
+ src/utils/ ██████████░░░░░░░░░░ 52% ✗ below target
1173
+
1174
+ Failing Tests
1175
+ ─────────────
1176
+ ✗ auth.test.ts:45
1177
+ └─ login validation: expected true, got false
1178
+
1179
+ ✗ api.test.ts:102
1180
+ └─ user endpoint: timeout after 5000ms
1181
+
1182
+ Slow Tests (>1s)
1183
+ ────────────────
1184
+ ⚠️ e2e/checkout.test.ts 3.2s
1185
+ ⚠️ integration/api.test.ts 1.8s
1186
+
1187
+ ═══════════════════════════════════════════════════════════
1188
+ Next: Fix failing tests or run "pa:test --update-snapshots"
1189
+ ```
1190
+
1191
+ **If all tests pass:**
1192
+ ```
1193
+ Test Results
1194
+ ═══════════════════════════════════════════════════════════
1195
+
1196
+ ✅ All 47 tests passed! 1.8s
1197
+
1198
+ Coverage: ████████████████░░░░ 82% (target: 80%) ✓
1199
+
1200
+ ═══════════════════════════════════════════════════════════
1201
+ Ready for: pa:review or pa:deploy
1202
+ ```
1203
+
1204
+ ---
1205
+
1206
+ ## pa:qa Execution
1207
+
1208
+ **Show quality dashboard with all metrics.**
1209
+
1210
+ **Command variations:**
1211
+ ```
1212
+ pa:qa # Full quality dashboard
1213
+ pa:qa-security # Security audit only
1214
+ pa:qa-performance # Performance check only
1215
+ pa:qa-lint # Lint check only
1216
+ ```
1217
+
1218
+ **Steps:**
1219
+ 1. Run linter (ESLint, etc.)
1220
+ 2. Run security scan (npm audit, etc.)
1221
+ 3. Check test coverage
1222
+ 4. Analyze bundle size
1223
+ 5. Check documentation coverage
1224
+ 6. Display unified dashboard
1225
+
1226
+ **Output format (quality dashboard):**
1227
+ ```
1228
+ Code Quality Dashboard
1229
+ ═══════════════════════════════════════════════════════════
1230
+
1231
+ Overall Score: ████████████████░░░░ 85% (Good)
1232
+
1233
+ 🔒 Security
1234
+ ───────────
1235
+ Status: ✓ No vulnerabilities
1236
+ Dependencies: 142 packages scanned
1237
+ Secrets: ✓ No hardcoded secrets found
1238
+ Last audit: 2 hours ago
1239
+
1240
+ 📏 Linting
1241
+ ──────────
1242
+ Errors: 0 ✓
1243
+ Warnings: 3 ⚠️
1244
+ └─ unused variable (2), missing return type (1)
1245
+ Auto-fixable: 2
1246
+
1247
+ 🧪 Test Coverage
1248
+ ────────────────
1249
+ Coverage: ████████████████░░░░ 78%
1250
+ Target: 80%
1251
+ Status: ⚠️ 2% below target
1252
+ Untested: src/utils/helpers.ts, src/api/legacy.ts
1253
+
1254
+ 📦 Bundle Size
1255
+ ──────────────
1256
+ Current: 245kb
1257
+ Limit: 300kb
1258
+ Status: ✓ Within limit
1259
+ Largest: react-dom (42kb), lodash (24kb)
1260
+
1261
+ 📝 Documentation
1262
+ ────────────────
1263
+ Documented: ████████████░░░░░░░░ 60%
1264
+ Missing: 15 functions, 3 components
1265
+ README: ✓ Up to date
1266
+
1267
+ 🔄 Code Complexity
1268
+ ──────────────────
1269
+ Average: 8.2 (Good)
1270
+ High (>15): 2 functions
1271
+ └─ processPayment() = 18, validateForm() = 16
1272
+
1273
+ ═══════════════════════════════════════════════════════════
1274
+ Issues: 3 warnings | Suggestions: Run "pa:qa --fix" for auto-fixes
1275
+ ```
1276
+
1277
+ ---
1278
+
1279
+ ## pa:review Execution
1280
+
1281
+ **Show code review checklist for current changes.**
1282
+
1283
+ **Command variations:**
1284
+ ```
1285
+ pa:review # Review current changes
1286
+ pa:review --staged # Review staged files only
1287
+ pa:review --pr # PR review mode
1288
+ ```
1289
+
1290
+ **Steps:**
1291
+ 1. Read `./.proagents/prompts/06.5-code-review.md`
1292
+ 2. Get list of changed files (git diff)
1293
+ 3. Analyze code for common issues
1294
+ 4. Display interactive checklist
1295
+ 5. Highlight issues that need attention
1296
+
1297
+ **Output format (review checklist):**
1298
+ ```
1299
+ Code Review Checklist
1300
+ ═══════════════════════════════════════════════════════════
1301
+
1302
+ Files Changed: 8 (+342, -89)
1303
+ ──────────────────────────────
1304
+
1305
+ 📋 Code Quality
1306
+ ───────────────
1307
+ ✓ No console.log statements cleaned
1308
+ ✓ No debugger statements cleaned
1309
+ ✓ No commented-out code cleaned
1310
+ ✓ No TODO without issue number checked
1311
+ ⚠️ Complex function detected see below
1312
+
1313
+ 🔒 Security
1314
+ ───────────
1315
+ ✓ No hardcoded credentials scanned
1316
+ ✓ Input validation present checked
1317
+ ✓ No SQL injection risks analyzed
1318
+ ○ Auth checks on new endpoints needs review
1319
+
1320
+ 🧪 Testing
1321
+ ──────────
1322
+ ✓ Tests added for new functions 4 new tests
1323
+ ⚠️ Test coverage decreased -3% (78% → 75%)
1324
+ ○ Edge cases covered needs review
1325
+
1326
+ 📝 Documentation
1327
+ ────────────────
1328
+ ✓ JSDoc on public functions present
1329
+ ○ README update needed new feature
1330
+ ○ API docs update needed new endpoint
1331
+
1332
+ 🎨 Style & Conventions
1333
+ ──────────────────────
1334
+ ✓ Follows naming conventions checked
1335
+ ✓ Consistent formatting prettier OK
1336
+ ✓ Import order correct sorted
1337
+
1338
+ ⚠️ Attention Required
1339
+ ─────────────────────
1340
+ src/services/payment.ts:45
1341
+ └─ Cyclomatic complexity: 18 (max: 15)
1342
+ └─ Consider breaking into smaller functions
1343
+
1344
+ src/api/users.ts:102
1345
+ └─ Missing error handling for async call
1346
+
1347
+ ═══════════════════════════════════════════════════════════
1348
+ Status: 12/16 checks passed | 2 warnings | 2 need review
1349
+
1350
+ Ready to commit? Address warnings first or run "pa:review --approve"
1351
+ ```
1352
+
1353
+ ---
1354
+
1355
+ ## pa:fix Execution
1356
+
1357
+ **Fix bugs with before/after diff and affected tests.**
1358
+
1359
+ **Steps:**
1360
+ 1. Read `./.proagents/workflow-modes/entry-modes.md`
1361
+ 2. Load context and recent changes
1362
+ 3. Analyze the bug description
1363
+ 4. Find and fix the issue
1364
+ 5. Show before/after diff
1365
+ 6. Identify affected tests
1366
+ 7. Run affected tests
1367
+ 8. Update changelogs
1368
+
1369
+ **Output format (bug fix summary):**
1370
+ ```
1371
+ Bug Fix Summary
1372
+ ═══════════════════════════════════════════════════════════
1373
+
1374
+ 🐛 Issue: Login validation not checking email format
1375
+
1376
+ 📁 File: src/auth/login.ts
1377
+
1378
+ 📝 Changes
1379
+ ──────────
1380
+ Line 45:
1381
+ Before: if (email) {
1382
+ After: if (email && email.includes('@')) {
1383
+
1384
+ Line 52:
1385
+ Before: return { success: true }
1386
+ After: return { success: true, validated: true }
1387
+
1388
+ Diff: +3 lines, -1 line
1389
+
1390
+ 🧪 Affected Tests
1391
+ ─────────────────
1392
+ → auth.test.ts (3 tests affected)
1393
+ → validation.test.ts (2 tests affected)
1394
+
1395
+ Running affected tests...
1396
+ ✓ auth.test.ts 5/5 passed
1397
+ ✓ validation.test.ts 4/4 passed
1398
+
1399
+ 📋 Related
1400
+ ──────────
1401
+ Issue: #123 (if detected from description)
1402
+ Similar fixes: login.ts (2 weeks ago)
1403
+
1404
+ ═══════════════════════════════════════════════════════════
1405
+ ✅ Fix applied and verified!
1406
+
1407
+ Changelog updated: .proagents/changelog/_recent.md
1408
+ Next: pa:test (full suite) or pa:commit
1409
+ ```
1410
+
1411
+ **If fix causes test failures:**
1412
+ ```
1413
+ Bug Fix Summary
1414
+ ═══════════════════════════════════════════════════════════
1415
+
1416
+ 🐛 Issue: Login validation not checking email format
1417
+
1418
+ 📁 File: src/auth/login.ts
1419
+ ...
1420
+
1421
+ 🧪 Affected Tests
1422
+ ─────────────────
1423
+ ✗ auth.test.ts 3/5 passed, 2 failed
1424
+ └─ test "allows empty email" now fails (expected behavior?)
1425
+ └─ test "validates email" now fails (needs update)
1426
+
1427
+ ⚠️ Fix applied but tests failing!
1428
+
1429
+ Options:
1430
+ [1] Update tests to match new behavior
1431
+ [2] Revert fix and investigate
1432
+ [3] Keep fix, mark tests as TODO
1433
+
1434
+ Run "pa:fix --update-tests" to auto-update test expectations
1435
+ ```
1436
+
1437
+ ---
1438
+
1439
+ ## pa:standup Execution
1440
+
1441
+ **Generate daily standup summary automatically.**
1442
+
1443
+ **Command variations:**
1444
+ ```
1445
+ pa:standup # Today's standup
1446
+ pa:standup --yesterday # What was done yesterday
1447
+ pa:standup --week # Weekly summary
1448
+ pa:standup --team # All AI activity (team view)
1449
+ ```
1450
+
1451
+ **Steps:**
1452
+ 1. Read `.proagents/activity.log` for recent activity
1453
+ 2. Read `.proagents/changelog/_recent.md` for changes
1454
+ 3. Read current feature status from `active-features/`
1455
+ 4. Identify blockers from context
1456
+ 5. Generate formatted standup
1457
+
1458
+ **Output format:**
1459
+ ```
1460
+ Daily Standup - March 13, 2026
1461
+ ═══════════════════════════════════════════════════════════
1462
+
1463
+ 👤 Your Session (Claude)
1464
+ ────────────────────────
1465
+
1466
+ ✅ Yesterday / Last Session:
1467
+ • Completed JWT token implementation
1468
+ • Fixed 2 login validation bugs (#123, #124)
1469
+ • Added 8 unit tests for auth module
1470
+ • Updated API documentation
1471
+
1472
+ 📋 Today / Current:
1473
+ • Password reset feature (in progress - 40%)
1474
+ └─ Next: Email template integration
1475
+ • API rate limiting implementation
1476
+ • Review PR #45 (user dashboard)
1477
+
1478
+ 🚧 Blockers:
1479
+ • None currently
1480
+
1481
+ 📊 Stats:
1482
+ Files changed: 12 | Tests: +8 | Coverage: 78% → 82%
1483
+
1484
+ ──────────────────────────────────────────────────────────
1485
+
1486
+ 👥 Team Activity (All AIs) - Last 24h
1487
+ ─────────────────────────────────────
1488
+ Claude: 5 tasks │ auth module, API docs
1489
+ Cursor: 3 tasks │ UI components, styling
1490
+ Gemini: 2 tasks │ database optimization
1491
+
1492
+ ═══════════════════════════════════════════════════════════
1493
+ Active Features: user-auth (80%), dashboard (40%)
1494
+ ```
1495
+
1496
+ **Weekly summary (pa:standup --week):**
1497
+ ```
1498
+ Weekly Summary - Week of March 10, 2026
1499
+ ═══════════════════════════════════════════════════════════
1500
+
1501
+ 📈 Progress
1502
+ ───────────
1503
+ Features completed: 2
1504
+ Features in progress: 3
1505
+ Bugs fixed: 8
1506
+ Tests added: 24
1507
+
1508
+ 📊 By AI Platform
1509
+ ─────────────────
1510
+ Claude ████████████████░░░░ 45% (18 tasks)
1511
+ Cursor ████████████░░░░░░░░ 32% (13 tasks)
1512
+ Gemini ████████░░░░░░░░░░░░ 23% (9 tasks)
1513
+
1514
+ ✅ Completed
1515
+ ────────────
1516
+ • User authentication feature
1517
+ • Dashboard redesign
1518
+ • 8 bug fixes
1519
+
1520
+ 🚀 Shipped
1521
+ ──────────
1522
+ • v1.2.0 deployed to production (March 12)
1523
+
1524
+ 📋 Next Week
1525
+ ────────────
1526
+ • Password reset feature
1527
+ • Payment integration
1528
+ • Performance optimization
1529
+
1530
+ ═══════════════════════════════════════════════════════════
1531
+ Total: 40 tasks | 156 files changed | Coverage: 75% → 82%
1532
+ ```
1533
+
1534
+ ---
1535
+
1536
+ ## Self-Learning System
1537
+
1538
+ **ProAgents learns from user interactions. AI MUST read and write learning data.**
1539
+
1540
+ ### Learning Data Location
1541
+
1542
+ ```
1543
+ .proagents/.learning/
1544
+ ├── global/ # Cross-project preferences
1545
+ │ ├── user-preferences.json # Checkpoint & workflow preferences
1546
+ │ └── common-patterns.json # Common code patterns
1547
+
1548
+ └── projects/ # Per-project learnings
1549
+ └── {project-id}/
1550
+ ├── patterns.json # Project-specific code patterns
1551
+ ├── corrections.json # User corrections to AI output
1552
+ ├── metrics.json # Performance metrics
1553
+ └── feedback.json # User feedback
1554
+ ```
1555
+
1556
+ ### On Session Start - Load Learning Data
1557
+
1558
+ **AI MUST read learning data at start of session:**
1559
+
1560
+ ```bash
1561
+ # Load user preferences
1562
+ cat .proagents/.learning/global/user-preferences.json 2>/dev/null
1563
+
1564
+ # Load project patterns
1565
+ cat .proagents/.learning/projects/*/patterns.json 2>/dev/null
1566
+
1567
+ # Load past corrections (DON'T REPEAT THESE MISTAKES!)
1568
+ cat .proagents/.learning/projects/*/corrections.json 2>/dev/null
1569
+ ```
1570
+
1571
+ ### Apply Learned Patterns
1572
+
1573
+ **Before generating code, check learned patterns:**
1574
+
1575
+ ```json
1576
+ // From user-preferences.json
1577
+ {
1578
+ "code_preferences": {
1579
+ "naming_style": { "components": "PascalCase" },
1580
+ "patterns": { "state_management": "zustand" }
1581
+ }
1582
+ }
1583
+ ```
1584
+
1585
+ **AI should say:**
1586
+ ```
1587
+ "I see this project uses PascalCase for components and Zustand for state.
1588
+ I'll follow those patterns."
1589
+ ```
1590
+
1591
+ ### When to Write Learning Data
1592
+
1593
+ **1. User Corrects AI Output**
1594
+
1595
+ When user modifies AI-generated code, log to `corrections.json`:
1596
+
1597
+ ```json
1598
+ {
1599
+ "corrections": [
1600
+ {
1601
+ "timestamp": "2024-03-13T10:30:00Z",
1602
+ "ai": "Claude",
1603
+ "type": "naming",
1604
+ "original": "getData",
1605
+ "corrected": "fetchUserData",
1606
+ "context": "User prefers descriptive function names",
1607
+ "occurrences": 1
1608
+ }
1609
+ ]
1610
+ }
1611
+ ```
1612
+
1613
+ **2. User Skips/Reviews Checkpoints**
1614
+
1615
+ Track checkpoint preferences in `user-preferences.json`:
1616
+
1617
+ ```json
1618
+ {
1619
+ "checkpoint_preferences": {
1620
+ "usually_skips": ["after_requirements"],
1621
+ "always_reviews": ["before_deployment"]
1622
+ }
1623
+ }
1624
+ ```
1625
+
1626
+ **3. User Provides Explicit Feedback**
1627
+
1628
+ When user says "that's wrong" or corrects approach, log to `feedback.json`:
1629
+
1630
+ ```json
1631
+ {
1632
+ "feedback": [
1633
+ {
1634
+ "timestamp": "2024-03-13T10:30:00Z",
1635
+ "type": "correction",
1636
+ "context": "API call pattern",
1637
+ "feedback": "Always use try-catch for API calls",
1638
+ "applied": true
1639
+ }
1640
+ ]
1641
+ }
1642
+ ```
1643
+
1644
+ ### pa:learn Command
1645
+
1646
+ **User can explicitly teach AI a pattern:**
1647
+
1648
+ ```
1649
+ pa:learn "Always use async/await instead of .then()"
1650
+ pa:learn "Components go in src/components/, not src/ui/"
1651
+ pa:learn "Use date-fns, not moment.js"
1652
+ ```
1653
+
1654
+ **AI logs to patterns.json:**
1655
+ ```json
1656
+ {
1657
+ "learned_patterns": [
1658
+ {
1659
+ "timestamp": "2024-03-13T10:30:00Z",
1660
+ "pattern": "Always use async/await instead of .then()",
1661
+ "source": "explicit",
1662
+ "confidence": 1.0
1663
+ }
1664
+ ]
1665
+ }
1666
+ ```
1667
+
1668
+ ### pa:forget Command
1669
+
1670
+ **User can remove a learned pattern:**
1671
+
1672
+ ```
1673
+ pa:forget "Use moment.js for dates"
1674
+ ```
1675
+
1676
+ **AI removes from patterns.json and confirms.**
1677
+
1678
+ ### Auto-Apply Rules
1679
+
1680
+ | Correction Count | Action |
1681
+ |------------------|--------|
1682
+ | 1-2 times | Remember but don't auto-apply |
1683
+ | 3-4 times | Warn: "Should I always do this?" |
1684
+ | 5+ times | Auto-apply without asking |
1685
+
1686
+ ### Example: Learning in Action
1687
+
1688
+ **Session 1:**
1689
+ ```
1690
+ User: Fix the login function
1691
+ AI: [generates code with getData()]
1692
+ User: [changes getData() to fetchUserData()]
1693
+ AI: [logs correction to corrections.json]
1694
+ ```
1695
+
1696
+ **Session 2 (same or different AI):**
1697
+ ```
1698
+ AI: [reads corrections.json]
1699
+ AI: "I see you prefer descriptive names like fetchUserData.
1700
+ I'll use that pattern."
1701
+ AI: [generates code with fetchUserData()]
1702
+ ```
1703
+
1704
+ ### Learning Report (pa:learning)
1705
+
1706
+ ```
1707
+ pa:learning
1708
+ ```
1709
+
1710
+ **Output:**
1711
+ ```
1712
+ Learning Report
1713
+ ═══════════════════════════════════════════════════════════
1714
+
1715
+ 📊 Summary
1716
+ ──────────
1717
+ Patterns learned: 12
1718
+ Corrections logged: 8
1719
+ Auto-apply rules: 3
1720
+
1721
+ 🎯 Top Patterns
1722
+ ───────────────
1723
+ • Naming: Use descriptive function names (5 corrections)
1724
+ • State: Use Zustand for state management
1725
+ • API: Always use try-catch for API calls
1726
+ • Testing: Use describe/it pattern for tests
1727
+
1728
+ ⚠️ Recent Corrections
1729
+ ─────────────────────
1730
+ • getData → fetchUserData (3 times)
1731
+ • Component → src/components/ not src/ui/
1732
+
1733
+ ✅ Auto-Apply Rules (5+ corrections)
1734
+ ────────────────────────────────────
1735
+ • Use PascalCase for components
1736
+ • Use camelCase for functions
1737
+ • Add error handling to API calls
1738
+
1739
+ ═══════════════════════════════════════════════════════════
1740
+ ```
1741
+
1742
+ ### CRITICAL: Don't Repeat Mistakes
1743
+
1744
+ **Before generating code, AI MUST check:**
1745
+
1746
+ 1. `corrections.json` - Don't make same mistakes
1747
+ 2. `feedback.json` - Follow user feedback
1748
+ 3. `patterns.json` - Use learned patterns
1749
+
1750
+ **Example check:**
1751
+ ```bash
1752
+ # Check if similar code was corrected before
1753
+ grep -i "getData" .proagents/.learning/projects/*/corrections.json
1754
+ ```
1755
+
1756
+ If found, apply the correction pattern automatically.
561
1757
 
562
1758
  ---
563
1759
 
@@ -586,6 +1782,9 @@ Or ask user: "Should I read the detailed docs for [topic]?"
586
1782
  | `watchlist.yaml` | Files requiring confirmation |
587
1783
  | `proagents.config.yaml` | Project config |
588
1784
  | `active-features/_index.json` | Feature status |
1785
+ | `.learning/global/user-preferences.json` | User workflow preferences |
1786
+ | `.learning/projects/*/patterns.json` | Learned code patterns |
1787
+ | `.learning/projects/*/corrections.json` | Past corrections (DON'T REPEAT!) |
589
1788
 
590
1789
  ---
591
1790