proagents 1.1.0 → 1.2.0

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/README.md CHANGED
@@ -257,6 +257,53 @@ Type these in any AI assistant (Claude, ChatGPT, Gemini, Cursor, etc.):
257
257
  | `pa:deps-outdated` | Find outdated packages |
258
258
  | `pa:deps-security` | Security scan |
259
259
 
260
+ ### Code Generation
261
+ | Command | Description |
262
+ |---------|-------------|
263
+ | `pa:generate` | Show generation options |
264
+ | `pa:generate-component` | Generate component |
265
+ | `pa:generate-api` | Generate API endpoint |
266
+ | `pa:generate-test` | Generate test file |
267
+
268
+ ### Refactoring
269
+ | Command | Description |
270
+ |---------|-------------|
271
+ | `pa:refactor` | Suggest refactoring |
272
+ | `pa:rename` | Rename across codebase |
273
+ | `pa:extract` | Extract function/component |
274
+ | `pa:cleanup` | Remove dead code |
275
+
276
+ ### Time Tracking
277
+ | Command | Description |
278
+ |---------|-------------|
279
+ | `pa:time-start` | Start time tracking |
280
+ | `pa:time-stop` | Stop tracking |
281
+ | `pa:time-report` | Show time report |
282
+
283
+ ### Environment & Database
284
+ | Command | Description |
285
+ |---------|-------------|
286
+ | `pa:env-check` | Verify environment |
287
+ | `pa:secrets-scan` | Scan for secrets |
288
+ | `pa:db-migrate` | Run migrations |
289
+ | `pa:db-seed` | Seed database |
290
+
291
+ ### Accessibility & Performance
292
+ | Command | Description |
293
+ |---------|-------------|
294
+ | `pa:a11y` | Accessibility audit |
295
+ | `pa:lighthouse` | Lighthouse audit |
296
+ | `pa:perf` | Performance analysis |
297
+
298
+ ### Export & Learning
299
+ | Command | Description |
300
+ |---------|-------------|
301
+ | `pa:export` | Export config/data |
302
+ | `pa:import` | Import data |
303
+ | `pa:backup` | Backup proagents |
304
+ | `pa:learn` | Teach AI a pattern |
305
+ | `pa:suggestions` | Show AI suggestions |
306
+
260
307
  ### Custom Commands
261
308
  | Command | Description |
262
309
  |---------|-------------|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proagents",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "AI-agnostic development workflow framework that automates the full software development lifecycle",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -572,6 +572,345 @@ For `pa:deps-security`:
572
572
  3. Categorize by severity
573
573
  4. Suggest fixes
574
574
 
575
+ ### Code Generation
576
+ | Command | Action |
577
+ |---------|--------|
578
+ | `pa:generate` | Show generation options |
579
+ | `pa:generate-component "name"` | Generate React/Vue component |
580
+ | `pa:generate-api "name"` | Generate API endpoint |
581
+ | `pa:generate-test "file"` | Generate test file for module |
582
+ | `pa:generate-hook "name"` | Generate custom hook |
583
+ | `pa:generate-service "name"` | Generate service class |
584
+
585
+ **How to execute Code Generation commands:**
586
+
587
+ For `pa:generate-component`:
588
+ 1. Read project type and patterns from `./proagents/cache/patterns.json`
589
+ 2. Use template from `./proagents/scaffolding/` matching project type
590
+ 3. Apply project naming conventions
591
+ 4. Create component file with:
592
+ - Component code
593
+ - Types/interfaces
594
+ - Basic styles (if applicable)
595
+ - Test file (optional)
596
+ 5. Save to appropriate directory based on project structure
597
+
598
+ For `pa:generate-api`:
599
+ 1. Detect API framework (Express, Next.js, NestJS, etc.)
600
+ 2. Use appropriate template
601
+ 3. Generate:
602
+ - Route handler
603
+ - Input validation
604
+ - Error handling
605
+ - Types
606
+ 4. Add to routes index if applicable
607
+
608
+ For `pa:generate-test`:
609
+ 1. Read the source file
610
+ 2. Detect testing framework (Jest, Vitest, etc.)
611
+ 3. Generate test file with:
612
+ - Import statements
613
+ - Describe blocks
614
+ - Test cases for each function
615
+ - Mock setup
616
+ 4. Save alongside source or in tests/ folder
617
+
618
+ ### Refactoring
619
+ | Command | Action |
620
+ |---------|--------|
621
+ | `pa:refactor` | Analyze and suggest refactoring |
622
+ | `pa:refactor "file"` | Refactor specific file |
623
+ | `pa:rename "old" "new"` | Rename symbol across codebase |
624
+ | `pa:extract "name"` | Extract function/component |
625
+ | `pa:cleanup` | Remove dead code, unused imports |
626
+ | `pa:cleanup-imports` | Clean up imports only |
627
+
628
+ **How to execute Refactoring commands:**
629
+
630
+ For `pa:refactor`:
631
+ 1. Analyze codebase for:
632
+ - Long functions (>50 lines)
633
+ - Deep nesting (>3 levels)
634
+ - Duplicate code
635
+ - Complex conditionals
636
+ - God classes/components
637
+ 2. Prioritize by impact
638
+ 3. Suggest specific refactoring for each issue
639
+ 4. Offer to apply refactoring
640
+
641
+ For `pa:rename`:
642
+ 1. Find all occurrences of symbol
643
+ 2. Check for naming conflicts
644
+ 3. Show preview of changes
645
+ 4. Apply rename across all files
646
+ 5. Update imports/exports
647
+
648
+ For `pa:cleanup`:
649
+ 1. Find unused imports
650
+ 2. Find unused variables
651
+ 3. Find dead code (unreachable)
652
+ 4. Find unused exports
653
+ 5. Show list and offer to remove
654
+ 6. Log changes to activity.log
655
+
656
+ ### Time Tracking
657
+ | Command | Action |
658
+ |---------|--------|
659
+ | `pa:time-start` | Start time tracking |
660
+ | `pa:time-start "task"` | Start tracking specific task |
661
+ | `pa:time-stop` | Stop current time tracking |
662
+ | `pa:time-pause` | Pause time tracking |
663
+ | `pa:time-report` | Show time report |
664
+ | `pa:time-report "feature"` | Report for specific feature |
665
+
666
+ **How to execute Time Tracking commands:**
667
+
668
+ For `pa:time-start`:
669
+ 1. Create/update `./proagents/time-tracking.json`:
670
+ ```json
671
+ {
672
+ "current": {
673
+ "task": "feature-user-auth",
674
+ "started": "2024-03-06T15:00:00Z",
675
+ "status": "running"
676
+ },
677
+ "entries": []
678
+ }
679
+ ```
680
+ 2. Log to activity.log
681
+
682
+ For `pa:time-stop`:
683
+ 1. Read current tracking
684
+ 2. Calculate duration
685
+ 3. Add to entries array:
686
+ ```json
687
+ {
688
+ "task": "feature-user-auth",
689
+ "started": "2024-03-06T15:00:00Z",
690
+ "ended": "2024-03-06T17:30:00Z",
691
+ "duration_minutes": 150,
692
+ "ai": "Claude:opus-4"
693
+ }
694
+ ```
695
+ 4. Clear current tracking
696
+
697
+ For `pa:time-report`:
698
+ 1. Read all entries from time-tracking.json
699
+ 2. Group by task/feature
700
+ 3. Calculate totals
701
+ 4. Display report:
702
+ ```
703
+ Time Report
704
+ ═══════════
705
+ Feature: user-auth
706
+ Total: 5h 30m
707
+ Sessions: 3
708
+
709
+ Feature: dashboard
710
+ Total: 2h 15m
711
+ Sessions: 2
712
+ ```
713
+
714
+ ### Environment & Setup
715
+ | Command | Action |
716
+ |---------|--------|
717
+ | `pa:env-check` | Verify environment setup |
718
+ | `pa:env-setup` | Setup development environment |
719
+ | `pa:env-diff` | Compare environments |
720
+ | `pa:secrets-scan` | Scan for exposed secrets |
721
+ | `pa:secrets-check` | Verify required secrets exist |
722
+
723
+ **How to execute Environment commands:**
724
+
725
+ For `pa:env-check`:
726
+ 1. Check for required files (.env, .env.local, etc.)
727
+ 2. Verify Node/Python/etc. version matches
728
+ 3. Check for required dependencies
729
+ 4. Verify database connection (if applicable)
730
+ 5. Check for required environment variables
731
+ 6. Report status:
732
+ ```
733
+ Environment Check
734
+ ═════════════════
735
+ ✓ Node.js v18.17.0 (required: >=18)
736
+ ✓ npm v9.6.0
737
+ ✓ .env.local exists
738
+ ⚠ DATABASE_URL not set
739
+ ✗ Redis not running
740
+ ```
741
+
742
+ For `pa:secrets-scan`:
743
+ 1. Scan codebase for patterns:
744
+ - API keys (sk_, pk_, api_key, etc.)
745
+ - Passwords in code
746
+ - Private keys
747
+ - Connection strings
748
+ 2. Check .gitignore for sensitive files
749
+ 3. Report findings with file locations
750
+ 4. Suggest fixes (move to .env, etc.)
751
+
752
+ ### Database Commands
753
+ | Command | Action |
754
+ |---------|--------|
755
+ | `pa:db-migrate` | Run database migrations |
756
+ | `pa:db-migrate-create "name"` | Create new migration |
757
+ | `pa:db-seed` | Seed database with test data |
758
+ | `pa:db-reset` | Reset database |
759
+ | `pa:db-status` | Show migration status |
760
+
761
+ **How to execute Database commands:**
762
+
763
+ For `pa:db-migrate`:
764
+ 1. Detect ORM (Prisma, TypeORM, Sequelize, Drizzle, etc.)
765
+ 2. Run appropriate migrate command:
766
+ - Prisma: `npx prisma migrate dev`
767
+ - TypeORM: `npm run typeorm migration:run`
768
+ 3. Report results
769
+
770
+ For `pa:db-seed`:
771
+ 1. Find seed files (prisma/seed.ts, seeds/, etc.)
772
+ 2. Run seed command
773
+ 3. Report inserted records
774
+
775
+ For `pa:db-reset`:
776
+ 1. Warn user about data loss
777
+ 2. Require confirmation
778
+ 3. Drop and recreate database
779
+ 4. Run migrations
780
+ 5. Optionally run seeds
781
+
782
+ ### Accessibility & Performance
783
+ | Command | Action |
784
+ |---------|--------|
785
+ | `pa:a11y` | Run accessibility audit |
786
+ | `pa:a11y "url"` | Audit specific page |
787
+ | `pa:lighthouse` | Run Lighthouse audit |
788
+ | `pa:lighthouse "url"` | Audit specific URL |
789
+ | `pa:perf` | Performance analysis |
790
+ | `pa:perf-bundle` | Bundle size analysis |
791
+
792
+ **How to execute A11y & Performance commands:**
793
+
794
+ For `pa:a11y`:
795
+ 1. Check for a11y tools (axe, pa11y, etc.)
796
+ 2. Run audit on pages/components
797
+ 3. Report issues by severity:
798
+ ```
799
+ Accessibility Audit
800
+ ═══════════════════
801
+ Critical: 2
802
+ Serious: 5
803
+ Moderate: 12
804
+ Minor: 8
805
+
806
+ Top Issues:
807
+ • Missing alt text on images (5 instances)
808
+ • Low color contrast (3 instances)
809
+ • Missing form labels (2 instances)
810
+ ```
811
+ 4. Link to WCAG guidelines for each issue
812
+
813
+ For `pa:lighthouse`:
814
+ 1. Check if Lighthouse is available
815
+ 2. Run audit (provide command or use API)
816
+ 3. Parse results
817
+ 4. Display scores:
818
+ ```
819
+ Lighthouse Scores
820
+ ═════════════════
821
+ Performance: 85 ████████░░
822
+ Accessibility: 92 █████████░
823
+ Best Practices: 100 ██████████
824
+ SEO: 90 █████████░
825
+ ```
826
+
827
+ For `pa:perf`:
828
+ 1. Analyze:
829
+ - Bundle sizes
830
+ - Load times
831
+ - Render performance
832
+ - Memory usage patterns
833
+ 2. Identify bottlenecks
834
+ 3. Suggest optimizations
835
+
836
+ ### Export & Backup
837
+ | Command | Action |
838
+ |---------|--------|
839
+ | `pa:export` | Export ProAgents config and data |
840
+ | `pa:export-config` | Export only configuration |
841
+ | `pa:import` | Import from export file |
842
+ | `pa:backup` | Create full backup |
843
+ | `pa:backup-restore` | Restore from backup |
844
+
845
+ **How to execute Export & Backup commands:**
846
+
847
+ For `pa:export`:
848
+ 1. Gather all ProAgents data:
849
+ - proagents.config.yaml
850
+ - context.md
851
+ - decisions.md
852
+ - feedback.md
853
+ - active-features/
854
+ - learned patterns
855
+ 2. Create export file: `proagents-export-YYYY-MM-DD.json`
856
+ 3. Optionally encrypt sensitive data
857
+
858
+ For `pa:import`:
859
+ 1. Read export file
860
+ 2. Validate format
861
+ 3. Merge or replace existing data
862
+ 4. Report what was imported
863
+
864
+ For `pa:backup`:
865
+ 1. Create timestamped backup of entire proagents/ folder
866
+ 2. Save to `./proagents/backups/` or specified location
867
+ 3. Compress if large
868
+ 4. Maintain rolling backups (keep last N)
869
+
870
+ ### Learning & AI
871
+ | Command | Action |
872
+ |---------|--------|
873
+ | `pa:learn "pattern"` | Teach AI a new pattern |
874
+ | `pa:learn-from "file"` | Learn patterns from file |
875
+ | `pa:forget "pattern"` | Remove learned pattern |
876
+ | `pa:suggestions` | Show AI suggestions for project |
877
+ | `pa:suggestions-apply` | Apply a suggestion |
878
+
879
+ **How to execute Learning commands:**
880
+
881
+ For `pa:learn`:
882
+ 1. Parse the pattern description
883
+ 2. Add to `./proagents/.learning/`:
884
+ ```json
885
+ {
886
+ "pattern": "Always use React Query for API calls",
887
+ "type": "preference",
888
+ "added": "2024-03-06",
889
+ "added_by": "user",
890
+ "applies_to": ["api", "data-fetching"]
891
+ }
892
+ ```
893
+ 3. Confirm pattern learned
894
+
895
+ For `pa:forget`:
896
+ 1. Find matching pattern
897
+ 2. Remove from learning data
898
+ 3. Confirm removal
899
+
900
+ For `pa:suggestions`:
901
+ 1. Analyze project state
902
+ 2. Check learned patterns
903
+ 3. Generate suggestions:
904
+ ```
905
+ AI Suggestions
906
+ ══════════════
907
+ 1. [Code Quality] Consider adding error boundaries to page components
908
+ 2. [Performance] Bundle size increased 15% - review new dependencies
909
+ 3. [Testing] Test coverage dropped below 80% in src/utils/
910
+ 4. [Security] 2 dependencies have known vulnerabilities
911
+ ```
912
+ 4. Offer to apply each suggestion
913
+
575
914
  ### AI Platform Management
576
915
  | Command | Action |
577
916
  |---------|--------|
@@ -89,6 +89,72 @@ Execute these commands when user types them (prefix: `pa:`):
89
89
  | `pa:deps-outdated` | Find outdated packages |
90
90
  | `pa:deps-security` | Security scan dependencies |
91
91
 
92
+ ## Code Generation
93
+
94
+ | Command | What to Do |
95
+ |---------|------------|
96
+ | `pa:generate` | Show generation options |
97
+ | `pa:generate-component "name"` | Generate component from template |
98
+ | `pa:generate-api "name"` | Generate API endpoint |
99
+ | `pa:generate-test "file"` | Generate test file |
100
+
101
+ ## Refactoring
102
+
103
+ | Command | What to Do |
104
+ |---------|------------|
105
+ | `pa:refactor` | Suggest refactoring opportunities |
106
+ | `pa:rename "old" "new"` | Rename across codebase |
107
+ | `pa:extract "name"` | Extract function/component |
108
+ | `pa:cleanup` | Remove dead code, unused imports |
109
+
110
+ ## Time Tracking
111
+
112
+ | Command | What to Do |
113
+ |---------|------------|
114
+ | `pa:time-start` | Start tracking → `./proagents/time-tracking.json` |
115
+ | `pa:time-stop` | Stop tracking, save duration |
116
+ | `pa:time-report` | Show time report by feature |
117
+
118
+ ## Environment & Setup
119
+
120
+ | Command | What to Do |
121
+ |---------|------------|
122
+ | `pa:env-check` | Verify environment setup |
123
+ | `pa:env-setup` | Setup dev environment |
124
+ | `pa:secrets-scan` | Scan for exposed secrets |
125
+
126
+ ## Database
127
+
128
+ | Command | What to Do |
129
+ |---------|------------|
130
+ | `pa:db-migrate` | Run database migrations |
131
+ | `pa:db-seed` | Seed with test data |
132
+ | `pa:db-reset` | Reset database (caution!) |
133
+
134
+ ## Accessibility & Performance
135
+
136
+ | Command | What to Do |
137
+ |---------|------------|
138
+ | `pa:a11y` | Run accessibility audit |
139
+ | `pa:lighthouse` | Run Lighthouse audit |
140
+ | `pa:perf` | Performance analysis |
141
+
142
+ ## Export & Backup
143
+
144
+ | Command | What to Do |
145
+ |---------|------------|
146
+ | `pa:export` | Export config/data → JSON file |
147
+ | `pa:import` | Import from export file |
148
+ | `pa:backup` | Backup proagents folder |
149
+
150
+ ## Learning & AI
151
+
152
+ | Command | What to Do |
153
+ |---------|------------|
154
+ | `pa:learn "pattern"` | Teach AI a pattern |
155
+ | `pa:forget "pattern"` | Remove learned pattern |
156
+ | `pa:suggestions` | Show AI suggestions |
157
+
92
158
  ## Key Files to Read
93
159
 
94
160
  | File | Purpose |
@@ -0,0 +1,34 @@
1
+ # Backups
2
+
3
+ This folder contains ProAgents backups created with `pa:backup`.
4
+
5
+ ## Commands
6
+
7
+ - `pa:backup` - Create full backup
8
+ - `pa:backup-restore` - Restore from backup
9
+
10
+ ## Backup Format
11
+
12
+ Backups are stored as timestamped folders or compressed archives:
13
+
14
+ ```
15
+ backups/
16
+ ├── 2024-03-06-150000/
17
+ │ ├── proagents.config.yaml
18
+ │ ├── context.md
19
+ │ ├── decisions.md
20
+ │ ├── feedback.md
21
+ │ ├── active-features/
22
+ │ └── ...
23
+ └── 2024-03-05-100000.tar.gz
24
+ ```
25
+
26
+ ## Retention
27
+
28
+ By default, the last 5 backups are kept. Configure in proagents.config.yaml:
29
+
30
+ ```yaml
31
+ backup:
32
+ retention: 5
33
+ compress: true
34
+ ```
@@ -0,0 +1,19 @@
1
+ {
2
+ "current": null,
3
+ "entries": [],
4
+ "_comment": "Time tracking data managed by pa:time-start/stop commands",
5
+ "_format": {
6
+ "current": {
7
+ "task": "feature-name",
8
+ "started": "2024-03-06T15:00:00Z",
9
+ "status": "running"
10
+ },
11
+ "entry": {
12
+ "task": "feature-name",
13
+ "started": "2024-03-06T15:00:00Z",
14
+ "ended": "2024-03-06T17:30:00Z",
15
+ "duration_minutes": 150,
16
+ "ai": "Claude:opus-4"
17
+ }
18
+ }
19
+ }