proagents 1.1.0 → 1.3.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 +100 -0
- package/package.json +1 -1
- package/proagents/AI_INSTRUCTIONS.md +963 -0
- package/proagents/PROAGENTS.md +127 -0
- package/proagents/backups/README.md +34 -0
- package/proagents/time-tracking.json +19 -0
package/README.md
CHANGED
|
@@ -257,6 +257,106 @@ 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
|
+
|
|
307
|
+
### API & Documentation
|
|
308
|
+
| Command | Description |
|
|
309
|
+
|---------|-------------|
|
|
310
|
+
| `pa:api-docs` | Generate OpenAPI/Swagger docs |
|
|
311
|
+
| `pa:storybook` | Generate Storybook stories |
|
|
312
|
+
| `pa:readme` | Auto-generate/update README |
|
|
313
|
+
| `pa:types` | Generate TypeScript types |
|
|
314
|
+
|
|
315
|
+
### Git Advanced
|
|
316
|
+
| Command | Description |
|
|
317
|
+
|---------|-------------|
|
|
318
|
+
| `pa:branch` | Branch management |
|
|
319
|
+
| `pa:merge` | Smart merge with conflict preview |
|
|
320
|
+
| `pa:conflict` | Resolve merge conflicts with AI |
|
|
321
|
+
| `pa:changelog-gen` | Auto-generate changelog |
|
|
322
|
+
|
|
323
|
+
### Search & Code Navigation
|
|
324
|
+
| Command | Description |
|
|
325
|
+
|---------|-------------|
|
|
326
|
+
| `pa:find` | Find code patterns/usage |
|
|
327
|
+
| `pa:todo` | Find all TODOs in code |
|
|
328
|
+
| `pa:fixme` | Find FIXMEs and critical issues |
|
|
329
|
+
| `pa:unused` | Find unused code/exports |
|
|
330
|
+
|
|
331
|
+
### Code Analysis
|
|
332
|
+
| Command | Description |
|
|
333
|
+
|---------|-------------|
|
|
334
|
+
| `pa:complexity` | Cyclomatic complexity analysis |
|
|
335
|
+
| `pa:duplication` | Find duplicate code blocks |
|
|
336
|
+
| `pa:hotspots` | Find frequently changed files |
|
|
337
|
+
|
|
338
|
+
### Testing Advanced
|
|
339
|
+
| Command | Description |
|
|
340
|
+
|---------|-------------|
|
|
341
|
+
| `pa:test-e2e` | Create/run E2E tests |
|
|
342
|
+
| `pa:test-unit` | Generate unit tests |
|
|
343
|
+
| `pa:mock` | Generate mocks/stubs |
|
|
344
|
+
| `pa:snapshot` | Snapshot testing management |
|
|
345
|
+
|
|
346
|
+
### DevOps & Infrastructure
|
|
347
|
+
| Command | Description |
|
|
348
|
+
|---------|-------------|
|
|
349
|
+
| `pa:docker` | Docker commands |
|
|
350
|
+
| `pa:ci` | CI/CD pipeline management |
|
|
351
|
+
| `pa:deploy-preview` | Deploy preview environment |
|
|
352
|
+
|
|
353
|
+
### Release Management
|
|
354
|
+
| Command | Description |
|
|
355
|
+
|---------|-------------|
|
|
356
|
+
| `pa:version` | Show/bump version |
|
|
357
|
+
| `pa:tag` | Create git tag |
|
|
358
|
+
| `pa:publish` | Publish package to registry |
|
|
359
|
+
|
|
260
360
|
### Custom Commands
|
|
261
361
|
| Command | Description |
|
|
262
362
|
|---------|-------------|
|
package/package.json
CHANGED
|
@@ -572,6 +572,969 @@ 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
|
+
|
|
914
|
+
### API & Documentation Generation
|
|
915
|
+
| Command | Action |
|
|
916
|
+
|---------|--------|
|
|
917
|
+
| `pa:api-docs` | Generate OpenAPI/Swagger documentation |
|
|
918
|
+
| `pa:api-docs "path"` | Generate docs for specific API path |
|
|
919
|
+
| `pa:storybook` | Generate Storybook stories for components |
|
|
920
|
+
| `pa:storybook "component"` | Generate story for specific component |
|
|
921
|
+
| `pa:readme` | Auto-generate/update README.md |
|
|
922
|
+
| `pa:readme-section "name"` | Update specific README section |
|
|
923
|
+
| `pa:types` | Generate TypeScript types/interfaces |
|
|
924
|
+
| `pa:types "file"` | Generate types for specific file |
|
|
925
|
+
|
|
926
|
+
**How to execute API & Documentation commands:**
|
|
927
|
+
|
|
928
|
+
For `pa:api-docs`:
|
|
929
|
+
1. Detect API framework (Express, Next.js, NestJS, FastAPI, etc.)
|
|
930
|
+
2. Scan route files for endpoints
|
|
931
|
+
3. Extract:
|
|
932
|
+
- HTTP methods and paths
|
|
933
|
+
- Request/response types
|
|
934
|
+
- Query/path parameters
|
|
935
|
+
- Authentication requirements
|
|
936
|
+
4. Generate OpenAPI 3.0 spec:
|
|
937
|
+
```yaml
|
|
938
|
+
openapi: 3.0.0
|
|
939
|
+
info:
|
|
940
|
+
title: API Documentation
|
|
941
|
+
version: 1.0.0
|
|
942
|
+
paths:
|
|
943
|
+
/api/users:
|
|
944
|
+
get:
|
|
945
|
+
summary: List all users
|
|
946
|
+
responses:
|
|
947
|
+
'200':
|
|
948
|
+
description: Success
|
|
949
|
+
```
|
|
950
|
+
5. Save to `./docs/openapi.yaml` or `./swagger.json`
|
|
951
|
+
6. Optionally generate HTML documentation
|
|
952
|
+
|
|
953
|
+
For `pa:storybook`:
|
|
954
|
+
1. Find React/Vue/Angular components
|
|
955
|
+
2. Analyze component props/interfaces
|
|
956
|
+
3. Generate story file with:
|
|
957
|
+
- Default story
|
|
958
|
+
- Variant stories for different props
|
|
959
|
+
- Interactive controls
|
|
960
|
+
4. Save to `*.stories.tsx` alongside component:
|
|
961
|
+
```tsx
|
|
962
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
963
|
+
import { Button } from './Button';
|
|
964
|
+
|
|
965
|
+
const meta: Meta<typeof Button> = {
|
|
966
|
+
component: Button,
|
|
967
|
+
title: 'Components/Button',
|
|
968
|
+
};
|
|
969
|
+
export default meta;
|
|
970
|
+
|
|
971
|
+
export const Primary: StoryObj<typeof Button> = {
|
|
972
|
+
args: { variant: 'primary', children: 'Click me' },
|
|
973
|
+
};
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
For `pa:readme`:
|
|
977
|
+
1. Analyze project structure
|
|
978
|
+
2. Detect:
|
|
979
|
+
- Project type and framework
|
|
980
|
+
- Available scripts (npm scripts)
|
|
981
|
+
- Dependencies
|
|
982
|
+
- Existing documentation
|
|
983
|
+
3. Generate/update README with:
|
|
984
|
+
- Project title and description
|
|
985
|
+
- Installation instructions
|
|
986
|
+
- Usage examples
|
|
987
|
+
- Available commands
|
|
988
|
+
- Contributing guidelines
|
|
989
|
+
4. Preserve existing custom sections
|
|
990
|
+
|
|
991
|
+
For `pa:types`:
|
|
992
|
+
1. Analyze source file or API responses
|
|
993
|
+
2. Infer TypeScript types:
|
|
994
|
+
- From JavaScript usage patterns
|
|
995
|
+
- From JSON data structures
|
|
996
|
+
- From API responses
|
|
997
|
+
3. Generate interface/type definitions:
|
|
998
|
+
```typescript
|
|
999
|
+
interface User {
|
|
1000
|
+
id: string;
|
|
1001
|
+
name: string;
|
|
1002
|
+
email: string;
|
|
1003
|
+
createdAt: Date;
|
|
1004
|
+
}
|
|
1005
|
+
```
|
|
1006
|
+
4. Save to `types/` folder or alongside source
|
|
1007
|
+
|
|
1008
|
+
### Git Advanced
|
|
1009
|
+
| Command | Action |
|
|
1010
|
+
|---------|--------|
|
|
1011
|
+
| `pa:branch` | Branch management (list, info) |
|
|
1012
|
+
| `pa:branch-create "name"` | Create new branch |
|
|
1013
|
+
| `pa:branch-clean` | Clean up merged/stale branches |
|
|
1014
|
+
| `pa:merge` | Smart merge with conflict preview |
|
|
1015
|
+
| `pa:merge "branch"` | Merge specific branch |
|
|
1016
|
+
| `pa:conflict` | Resolve merge conflicts with AI |
|
|
1017
|
+
| `pa:conflict "file"` | Resolve conflicts in specific file |
|
|
1018
|
+
| `pa:changelog-gen` | Auto-generate changelog from commits |
|
|
1019
|
+
| `pa:changelog-gen "version"` | Generate for specific version |
|
|
1020
|
+
|
|
1021
|
+
**How to execute Git Advanced commands:**
|
|
1022
|
+
|
|
1023
|
+
For `pa:branch`:
|
|
1024
|
+
1. Run `git branch -a` to list all branches
|
|
1025
|
+
2. Show current branch with `git branch --show-current`
|
|
1026
|
+
3. Display branch info:
|
|
1027
|
+
```
|
|
1028
|
+
Branches
|
|
1029
|
+
════════
|
|
1030
|
+
Current: feature/user-auth
|
|
1031
|
+
|
|
1032
|
+
Local:
|
|
1033
|
+
• main (2 days ago)
|
|
1034
|
+
• develop (1 hour ago)
|
|
1035
|
+
• feature/user-auth * (current)
|
|
1036
|
+
• feature/dashboard (5 days ago, stale)
|
|
1037
|
+
|
|
1038
|
+
Remote:
|
|
1039
|
+
• origin/main
|
|
1040
|
+
• origin/develop
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
For `pa:branch-clean`:
|
|
1044
|
+
1. Find merged branches: `git branch --merged`
|
|
1045
|
+
2. Find stale branches (no commits in 30+ days)
|
|
1046
|
+
3. Show list and ask for confirmation
|
|
1047
|
+
4. Delete selected branches
|
|
1048
|
+
5. Optionally prune remote tracking branches
|
|
1049
|
+
|
|
1050
|
+
For `pa:merge`:
|
|
1051
|
+
1. Show current branch and target
|
|
1052
|
+
2. Preview changes: `git diff branch...HEAD`
|
|
1053
|
+
3. Check for conflicts: `git merge --no-commit --no-ff branch`
|
|
1054
|
+
4. If conflicts exist, list conflicting files
|
|
1055
|
+
5. If clean, proceed with merge
|
|
1056
|
+
6. Create merge commit with descriptive message
|
|
1057
|
+
|
|
1058
|
+
For `pa:conflict`:
|
|
1059
|
+
1. List conflicting files: `git diff --name-only --diff-filter=U`
|
|
1060
|
+
2. For each file:
|
|
1061
|
+
- Show conflict markers
|
|
1062
|
+
- Analyze both versions
|
|
1063
|
+
- Suggest resolution based on:
|
|
1064
|
+
- Code context
|
|
1065
|
+
- Which change is more recent
|
|
1066
|
+
- What each change accomplishes
|
|
1067
|
+
3. Apply resolution and mark as resolved
|
|
1068
|
+
4. Stage resolved files
|
|
1069
|
+
|
|
1070
|
+
For `pa:changelog-gen`:
|
|
1071
|
+
1. Get commits since last tag: `git log $(git describe --tags --abbrev=0)..HEAD`
|
|
1072
|
+
2. Parse conventional commits
|
|
1073
|
+
3. Group by type (feat, fix, docs, etc.)
|
|
1074
|
+
4. Generate changelog:
|
|
1075
|
+
```markdown
|
|
1076
|
+
## [1.2.0] - 2024-03-06
|
|
1077
|
+
|
|
1078
|
+
### Added
|
|
1079
|
+
- User authentication with JWT (#123)
|
|
1080
|
+
- Dashboard component (#125)
|
|
1081
|
+
|
|
1082
|
+
### Fixed
|
|
1083
|
+
- Login button styling (#124)
|
|
1084
|
+
|
|
1085
|
+
### Changed
|
|
1086
|
+
- Updated dependencies (#126)
|
|
1087
|
+
```
|
|
1088
|
+
5. Prepend to CHANGELOG.md
|
|
1089
|
+
|
|
1090
|
+
### Search & Code Navigation
|
|
1091
|
+
| Command | Action |
|
|
1092
|
+
|---------|--------|
|
|
1093
|
+
| `pa:find "pattern"` | Find code patterns/usage |
|
|
1094
|
+
| `pa:find-usage "symbol"` | Find all usages of symbol |
|
|
1095
|
+
| `pa:find-definition "symbol"` | Find definition of symbol |
|
|
1096
|
+
| `pa:todo` | Find and list all TODOs |
|
|
1097
|
+
| `pa:todo-add "message"` | Add TODO at current location |
|
|
1098
|
+
| `pa:fixme` | Find FIXMEs and critical issues |
|
|
1099
|
+
| `pa:unused` | Find unused code/exports |
|
|
1100
|
+
| `pa:unused-deps` | Find unused dependencies |
|
|
1101
|
+
|
|
1102
|
+
**How to execute Search commands:**
|
|
1103
|
+
|
|
1104
|
+
For `pa:find`:
|
|
1105
|
+
1. Search codebase for pattern using grep/ripgrep
|
|
1106
|
+
2. Support regex patterns
|
|
1107
|
+
3. Show results with context:
|
|
1108
|
+
```
|
|
1109
|
+
Search Results: "useAuth"
|
|
1110
|
+
═══════════════════════════
|
|
1111
|
+
|
|
1112
|
+
src/hooks/useAuth.ts:5
|
|
1113
|
+
│ export function useAuth() {
|
|
1114
|
+
|
|
1115
|
+
src/pages/Login.tsx:12
|
|
1116
|
+
│ const { login, logout } = useAuth();
|
|
1117
|
+
|
|
1118
|
+
src/components/Navbar.tsx:8
|
|
1119
|
+
│ const { user } = useAuth();
|
|
1120
|
+
|
|
1121
|
+
Found 3 matches in 3 files
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
For `pa:todo`:
|
|
1125
|
+
1. Search for TODO, FIXME, HACK, XXX comments
|
|
1126
|
+
2. Parse priority markers (TODO(high):, TODO:, etc.)
|
|
1127
|
+
3. Group by priority and file:
|
|
1128
|
+
```
|
|
1129
|
+
TODOs Found: 15
|
|
1130
|
+
═══════════════
|
|
1131
|
+
|
|
1132
|
+
High Priority:
|
|
1133
|
+
• src/auth/jwt.ts:45 - TODO(high): Add token refresh
|
|
1134
|
+
• src/api/users.ts:78 - FIXME: SQL injection risk
|
|
1135
|
+
|
|
1136
|
+
Medium Priority:
|
|
1137
|
+
• src/utils/date.ts:12 - TODO: Handle timezone
|
|
1138
|
+
|
|
1139
|
+
Low Priority:
|
|
1140
|
+
• src/components/Button.tsx:5 - TODO: Add loading state
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
For `pa:fixme`:
|
|
1144
|
+
1. Search for FIXME, BUG, HACK, XXX, SECURITY
|
|
1145
|
+
2. Prioritize by keyword severity
|
|
1146
|
+
3. Show with context and age (when added via git blame)
|
|
1147
|
+
4. Suggest fixes where possible
|
|
1148
|
+
|
|
1149
|
+
For `pa:unused`:
|
|
1150
|
+
1. Analyze exports and imports
|
|
1151
|
+
2. Find:
|
|
1152
|
+
- Exported but never imported
|
|
1153
|
+
- Defined but never used
|
|
1154
|
+
- Dead code (unreachable)
|
|
1155
|
+
3. Report with confidence level:
|
|
1156
|
+
```
|
|
1157
|
+
Unused Code Analysis
|
|
1158
|
+
═══════════════════
|
|
1159
|
+
|
|
1160
|
+
Definitely Unused:
|
|
1161
|
+
• src/utils/old-helper.ts - entire file (no imports)
|
|
1162
|
+
• src/types/legacy.ts:LegacyUser - type never used
|
|
1163
|
+
|
|
1164
|
+
Possibly Unused:
|
|
1165
|
+
• src/api/deprecated.ts:oldEndpoint - only test imports
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
For `pa:unused-deps`:
|
|
1169
|
+
1. Read package.json dependencies
|
|
1170
|
+
2. Search codebase for imports
|
|
1171
|
+
3. Find packages never imported:
|
|
1172
|
+
```
|
|
1173
|
+
Unused Dependencies
|
|
1174
|
+
═══════════════════
|
|
1175
|
+
|
|
1176
|
+
dependencies:
|
|
1177
|
+
• lodash - never imported
|
|
1178
|
+
• moment - never imported (consider date-fns)
|
|
1179
|
+
|
|
1180
|
+
devDependencies:
|
|
1181
|
+
• @types/node - used
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
### Code Analysis
|
|
1185
|
+
| Command | Action |
|
|
1186
|
+
|---------|--------|
|
|
1187
|
+
| `pa:complexity` | Cyclomatic complexity analysis |
|
|
1188
|
+
| `pa:complexity "file"` | Analyze specific file |
|
|
1189
|
+
| `pa:duplication` | Find duplicate code blocks |
|
|
1190
|
+
| `pa:duplication "threshold"` | Set minimum lines threshold |
|
|
1191
|
+
| `pa:hotspots` | Find frequently changed files |
|
|
1192
|
+
| `pa:hotspots "days"` | Analyze over specific period |
|
|
1193
|
+
|
|
1194
|
+
**How to execute Code Analysis commands:**
|
|
1195
|
+
|
|
1196
|
+
For `pa:complexity`:
|
|
1197
|
+
1. Analyze functions/methods for:
|
|
1198
|
+
- Cyclomatic complexity (if/else, switch, loops)
|
|
1199
|
+
- Cognitive complexity
|
|
1200
|
+
- Nesting depth
|
|
1201
|
+
- Parameter count
|
|
1202
|
+
2. Report high complexity areas:
|
|
1203
|
+
```
|
|
1204
|
+
Complexity Report
|
|
1205
|
+
═════════════════
|
|
1206
|
+
|
|
1207
|
+
High Complexity (>10):
|
|
1208
|
+
• src/utils/parser.ts:parseData() - complexity: 15
|
|
1209
|
+
↳ 8 if statements, 3 loops, max depth: 4
|
|
1210
|
+
↳ Suggestion: Split into smaller functions
|
|
1211
|
+
|
|
1212
|
+
• src/api/handler.ts:processRequest() - complexity: 12
|
|
1213
|
+
↳ Large switch statement (10 cases)
|
|
1214
|
+
↳ Suggestion: Use strategy pattern
|
|
1215
|
+
|
|
1216
|
+
Medium Complexity (5-10):
|
|
1217
|
+
• src/auth/validate.ts:validateUser() - complexity: 7
|
|
1218
|
+
```
|
|
1219
|
+
|
|
1220
|
+
For `pa:duplication`:
|
|
1221
|
+
1. Find duplicate code blocks (default: 6+ lines)
|
|
1222
|
+
2. Calculate similarity percentage
|
|
1223
|
+
3. Report duplicates:
|
|
1224
|
+
```
|
|
1225
|
+
Code Duplication Report
|
|
1226
|
+
═══════════════════════
|
|
1227
|
+
|
|
1228
|
+
Duplicate #1 (98% similar, 15 lines):
|
|
1229
|
+
• src/api/users.ts:45-60
|
|
1230
|
+
• src/api/posts.ts:32-47
|
|
1231
|
+
↳ Suggestion: Extract to shared utility
|
|
1232
|
+
|
|
1233
|
+
Duplicate #2 (100% identical, 8 lines):
|
|
1234
|
+
• src/components/Card.tsx:12-20
|
|
1235
|
+
• src/components/Panel.tsx:8-16
|
|
1236
|
+
↳ Suggestion: Create shared component
|
|
1237
|
+
|
|
1238
|
+
Total: 5 duplicate blocks, ~120 duplicated lines
|
|
1239
|
+
```
|
|
1240
|
+
|
|
1241
|
+
For `pa:hotspots`:
|
|
1242
|
+
1. Analyze git history for frequently changed files
|
|
1243
|
+
2. Correlate with bug fixes
|
|
1244
|
+
3. Identify risky areas:
|
|
1245
|
+
```
|
|
1246
|
+
Code Hotspots (Last 30 Days)
|
|
1247
|
+
════════════════════════════
|
|
1248
|
+
|
|
1249
|
+
Most Changed:
|
|
1250
|
+
1. src/api/auth.ts - 45 changes, 12 bug fixes
|
|
1251
|
+
↳ High churn + bugs = refactoring candidate
|
|
1252
|
+
|
|
1253
|
+
2. src/utils/helpers.ts - 32 changes, 3 bug fixes
|
|
1254
|
+
↳ Frequently modified utility
|
|
1255
|
+
|
|
1256
|
+
3. src/components/Form.tsx - 28 changes, 8 bug fixes
|
|
1257
|
+
↳ Complex component, consider splitting
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
### Testing Advanced
|
|
1261
|
+
| Command | Action |
|
|
1262
|
+
|---------|--------|
|
|
1263
|
+
| `pa:test-e2e` | Create/run E2E tests |
|
|
1264
|
+
| `pa:test-e2e "flow"` | E2E test for specific flow |
|
|
1265
|
+
| `pa:test-unit` | Generate unit tests |
|
|
1266
|
+
| `pa:test-unit "file"` | Generate tests for file |
|
|
1267
|
+
| `pa:mock` | Generate mocks/stubs |
|
|
1268
|
+
| `pa:mock "module"` | Mock specific module |
|
|
1269
|
+
| `pa:snapshot` | Snapshot testing management |
|
|
1270
|
+
| `pa:snapshot-update` | Update snapshots |
|
|
1271
|
+
|
|
1272
|
+
**How to execute Testing Advanced commands:**
|
|
1273
|
+
|
|
1274
|
+
For `pa:test-e2e`:
|
|
1275
|
+
1. Detect E2E framework (Playwright, Cypress, etc.)
|
|
1276
|
+
2. Analyze user flows in the app
|
|
1277
|
+
3. Generate E2E test:
|
|
1278
|
+
```typescript
|
|
1279
|
+
import { test, expect } from '@playwright/test';
|
|
1280
|
+
|
|
1281
|
+
test.describe('User Authentication', () => {
|
|
1282
|
+
test('should login successfully', async ({ page }) => {
|
|
1283
|
+
await page.goto('/login');
|
|
1284
|
+
await page.fill('[name="email"]', 'test@example.com');
|
|
1285
|
+
await page.fill('[name="password"]', 'password123');
|
|
1286
|
+
await page.click('button[type="submit"]');
|
|
1287
|
+
await expect(page).toHaveURL('/dashboard');
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
test('should show error for invalid credentials', async ({ page }) => {
|
|
1291
|
+
await page.goto('/login');
|
|
1292
|
+
await page.fill('[name="email"]', 'wrong@example.com');
|
|
1293
|
+
await page.fill('[name="password"]', 'wrong');
|
|
1294
|
+
await page.click('button[type="submit"]');
|
|
1295
|
+
await expect(page.locator('.error')).toBeVisible();
|
|
1296
|
+
});
|
|
1297
|
+
});
|
|
1298
|
+
```
|
|
1299
|
+
|
|
1300
|
+
For `pa:test-unit`:
|
|
1301
|
+
1. Read source file
|
|
1302
|
+
2. Identify functions/methods to test
|
|
1303
|
+
3. Generate comprehensive test file:
|
|
1304
|
+
```typescript
|
|
1305
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
1306
|
+
import { calculateTotal, formatPrice } from './pricing';
|
|
1307
|
+
|
|
1308
|
+
describe('calculateTotal', () => {
|
|
1309
|
+
it('should calculate total with tax', () => {
|
|
1310
|
+
expect(calculateTotal(100, 0.1)).toBe(110);
|
|
1311
|
+
});
|
|
1312
|
+
|
|
1313
|
+
it('should handle zero amount', () => {
|
|
1314
|
+
expect(calculateTotal(0, 0.1)).toBe(0);
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
it('should throw for negative amounts', () => {
|
|
1318
|
+
expect(() => calculateTotal(-100, 0.1)).toThrow();
|
|
1319
|
+
});
|
|
1320
|
+
});
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
For `pa:mock`:
|
|
1324
|
+
1. Analyze module dependencies
|
|
1325
|
+
2. Generate mock implementations:
|
|
1326
|
+
```typescript
|
|
1327
|
+
// mocks/api.ts
|
|
1328
|
+
import { vi } from 'vitest';
|
|
1329
|
+
|
|
1330
|
+
export const mockApi = {
|
|
1331
|
+
getUsers: vi.fn().mockResolvedValue([
|
|
1332
|
+
{ id: '1', name: 'Test User' }
|
|
1333
|
+
]),
|
|
1334
|
+
createUser: vi.fn().mockResolvedValue({ id: '2' }),
|
|
1335
|
+
deleteUser: vi.fn().mockResolvedValue(true),
|
|
1336
|
+
};
|
|
1337
|
+
|
|
1338
|
+
vi.mock('../api', () => mockApi);
|
|
1339
|
+
```
|
|
1340
|
+
3. Include type-safe mocks with TypeScript
|
|
1341
|
+
|
|
1342
|
+
For `pa:snapshot`:
|
|
1343
|
+
1. Find existing snapshots
|
|
1344
|
+
2. Show status:
|
|
1345
|
+
```
|
|
1346
|
+
Snapshot Status
|
|
1347
|
+
═══════════════
|
|
1348
|
+
|
|
1349
|
+
Total: 45 snapshots in 12 files
|
|
1350
|
+
|
|
1351
|
+
Outdated (need update):
|
|
1352
|
+
• Button.test.tsx - 3 snapshots
|
|
1353
|
+
• Card.test.tsx - 1 snapshot
|
|
1354
|
+
|
|
1355
|
+
Obsolete (no matching test):
|
|
1356
|
+
• OldComponent.test.tsx.snap - entire file
|
|
1357
|
+
|
|
1358
|
+
Commands:
|
|
1359
|
+
• pa:snapshot-update - Update outdated
|
|
1360
|
+
• pa:snapshot-clean - Remove obsolete
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
### DevOps & Infrastructure
|
|
1364
|
+
| Command | Action |
|
|
1365
|
+
|---------|--------|
|
|
1366
|
+
| `pa:docker` | Docker commands overview |
|
|
1367
|
+
| `pa:docker-build` | Build Docker image |
|
|
1368
|
+
| `pa:docker-compose` | Docker Compose operations |
|
|
1369
|
+
| `pa:ci` | CI/CD pipeline status/management |
|
|
1370
|
+
| `pa:ci-run` | Trigger CI pipeline |
|
|
1371
|
+
| `pa:deploy-preview` | Deploy to preview environment |
|
|
1372
|
+
| `pa:deploy-preview-url` | Get preview deployment URL |
|
|
1373
|
+
|
|
1374
|
+
**How to execute DevOps commands:**
|
|
1375
|
+
|
|
1376
|
+
For `pa:docker`:
|
|
1377
|
+
1. Check for Dockerfile and docker-compose.yml
|
|
1378
|
+
2. Show available commands:
|
|
1379
|
+
```
|
|
1380
|
+
Docker Status
|
|
1381
|
+
═════════════
|
|
1382
|
+
|
|
1383
|
+
Dockerfile: ✓ Found
|
|
1384
|
+
docker-compose.yml: ✓ Found
|
|
1385
|
+
|
|
1386
|
+
Services:
|
|
1387
|
+
• app - Node.js application
|
|
1388
|
+
• db - PostgreSQL
|
|
1389
|
+
• redis - Redis cache
|
|
1390
|
+
|
|
1391
|
+
Commands:
|
|
1392
|
+
• pa:docker-build - Build images
|
|
1393
|
+
• pa:docker-compose up - Start services
|
|
1394
|
+
• pa:docker-compose down - Stop services
|
|
1395
|
+
```
|
|
1396
|
+
|
|
1397
|
+
For `pa:docker-build`:
|
|
1398
|
+
1. Read Dockerfile
|
|
1399
|
+
2. Suggest optimizations if needed
|
|
1400
|
+
3. Build image with appropriate tags
|
|
1401
|
+
4. Report build status and size
|
|
1402
|
+
|
|
1403
|
+
For `pa:ci`:
|
|
1404
|
+
1. Detect CI system (GitHub Actions, GitLab CI, etc.)
|
|
1405
|
+
2. Show pipeline status:
|
|
1406
|
+
```
|
|
1407
|
+
CI/CD Status
|
|
1408
|
+
════════════
|
|
1409
|
+
|
|
1410
|
+
Platform: GitHub Actions
|
|
1411
|
+
|
|
1412
|
+
Recent Workflows:
|
|
1413
|
+
✓ Build & Test (main) - 2m ago - passed
|
|
1414
|
+
✓ Deploy Preview (PR #123) - 15m ago - passed
|
|
1415
|
+
✗ Security Scan (main) - 1h ago - failed
|
|
1416
|
+
↳ 2 vulnerabilities found
|
|
1417
|
+
|
|
1418
|
+
Current:
|
|
1419
|
+
● Build & Test (feature/auth) - running (1m 30s)
|
|
1420
|
+
```
|
|
1421
|
+
|
|
1422
|
+
For `pa:deploy-preview`:
|
|
1423
|
+
1. Detect preview deployment platform (Vercel, Netlify, etc.)
|
|
1424
|
+
2. Trigger preview deployment
|
|
1425
|
+
3. Wait for deployment URL
|
|
1426
|
+
4. Return preview URL:
|
|
1427
|
+
```
|
|
1428
|
+
Preview Deployment
|
|
1429
|
+
══════════════════
|
|
1430
|
+
|
|
1431
|
+
Branch: feature/user-auth
|
|
1432
|
+
Status: Deploying...
|
|
1433
|
+
|
|
1434
|
+
✓ Building... done (45s)
|
|
1435
|
+
✓ Deploying... done (30s)
|
|
1436
|
+
|
|
1437
|
+
Preview URL: https://my-app-user-auth-123.vercel.app
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
### Release Management
|
|
1441
|
+
| Command | Action |
|
|
1442
|
+
|---------|--------|
|
|
1443
|
+
| `pa:version` | Show current version |
|
|
1444
|
+
| `pa:version-bump "type"` | Bump version (major/minor/patch) |
|
|
1445
|
+
| `pa:tag` | Create git tag for release |
|
|
1446
|
+
| `pa:tag "version"` | Create specific version tag |
|
|
1447
|
+
| `pa:publish` | Publish package to registry |
|
|
1448
|
+
| `pa:publish-dry` | Dry run of publish |
|
|
1449
|
+
|
|
1450
|
+
**How to execute Release commands:**
|
|
1451
|
+
|
|
1452
|
+
For `pa:version`:
|
|
1453
|
+
1. Read version from package.json or equivalent
|
|
1454
|
+
2. Show version info:
|
|
1455
|
+
```
|
|
1456
|
+
Version Info
|
|
1457
|
+
════════════
|
|
1458
|
+
|
|
1459
|
+
Current: 1.2.3
|
|
1460
|
+
Last Release: 1.2.2 (2024-03-01)
|
|
1461
|
+
|
|
1462
|
+
Unreleased Changes:
|
|
1463
|
+
• 5 features
|
|
1464
|
+
• 3 bug fixes
|
|
1465
|
+
• 2 breaking changes
|
|
1466
|
+
|
|
1467
|
+
Suggested Next:
|
|
1468
|
+
• Major (2.0.0) - has breaking changes
|
|
1469
|
+
• Minor (1.3.0) - new features
|
|
1470
|
+
• Patch (1.2.4) - bug fixes only
|
|
1471
|
+
```
|
|
1472
|
+
|
|
1473
|
+
For `pa:version-bump`:
|
|
1474
|
+
1. Determine bump type (major/minor/patch)
|
|
1475
|
+
2. Update version in:
|
|
1476
|
+
- package.json
|
|
1477
|
+
- package-lock.json
|
|
1478
|
+
- Other version files
|
|
1479
|
+
3. Update CHANGELOG.md with new version
|
|
1480
|
+
4. Show changes:
|
|
1481
|
+
```
|
|
1482
|
+
Version Bump: 1.2.3 → 1.3.0
|
|
1483
|
+
═══════════════════════════
|
|
1484
|
+
|
|
1485
|
+
Updated files:
|
|
1486
|
+
• package.json
|
|
1487
|
+
• package-lock.json
|
|
1488
|
+
• CHANGELOG.md
|
|
1489
|
+
|
|
1490
|
+
Next steps:
|
|
1491
|
+
• pa:tag 1.3.0 - Create release tag
|
|
1492
|
+
• pa:publish - Publish to npm
|
|
1493
|
+
```
|
|
1494
|
+
|
|
1495
|
+
For `pa:tag`:
|
|
1496
|
+
1. Create annotated git tag
|
|
1497
|
+
2. Include release notes in tag message
|
|
1498
|
+
3. Optionally push to remote:
|
|
1499
|
+
```
|
|
1500
|
+
Created Tag: v1.3.0
|
|
1501
|
+
═══════════════════
|
|
1502
|
+
|
|
1503
|
+
Tag: v1.3.0
|
|
1504
|
+
Message: Release 1.3.0 - User Authentication
|
|
1505
|
+
|
|
1506
|
+
Included:
|
|
1507
|
+
• feat: Add user authentication
|
|
1508
|
+
• feat: Add password reset
|
|
1509
|
+
• fix: Login validation
|
|
1510
|
+
|
|
1511
|
+
Push to remote? (git push origin v1.3.0)
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1514
|
+
For `pa:publish`:
|
|
1515
|
+
1. Run pre-publish checks:
|
|
1516
|
+
- Tests pass
|
|
1517
|
+
- Build succeeds
|
|
1518
|
+
- No uncommitted changes
|
|
1519
|
+
- Version is tagged
|
|
1520
|
+
2. Show publish preview
|
|
1521
|
+
3. Publish to registry:
|
|
1522
|
+
```
|
|
1523
|
+
Publishing: mypackage@1.3.0
|
|
1524
|
+
═══════════════════════════
|
|
1525
|
+
|
|
1526
|
+
Pre-checks:
|
|
1527
|
+
✓ Tests passing
|
|
1528
|
+
✓ Build successful
|
|
1529
|
+
✓ Clean working directory
|
|
1530
|
+
✓ Version tagged (v1.3.0)
|
|
1531
|
+
|
|
1532
|
+
Publishing to npm...
|
|
1533
|
+
✓ Published successfully!
|
|
1534
|
+
|
|
1535
|
+
https://www.npmjs.com/package/mypackage
|
|
1536
|
+
```
|
|
1537
|
+
|
|
575
1538
|
### AI Platform Management
|
|
576
1539
|
| Command | Action |
|
|
577
1540
|
|---------|--------|
|
package/proagents/PROAGENTS.md
CHANGED
|
@@ -89,6 +89,133 @@ 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
|
+
|
|
158
|
+
## API & Documentation
|
|
159
|
+
|
|
160
|
+
| Command | What to Do |
|
|
161
|
+
|---------|------------|
|
|
162
|
+
| `pa:api-docs` | Generate OpenAPI/Swagger documentation |
|
|
163
|
+
| `pa:storybook` | Generate Storybook stories |
|
|
164
|
+
| `pa:readme` | Auto-generate/update README.md |
|
|
165
|
+
| `pa:types` | Generate TypeScript types/interfaces |
|
|
166
|
+
|
|
167
|
+
## Git Advanced
|
|
168
|
+
|
|
169
|
+
| Command | What to Do |
|
|
170
|
+
|---------|------------|
|
|
171
|
+
| `pa:branch` | Branch management (list, create, clean) |
|
|
172
|
+
| `pa:merge` | Smart merge with conflict preview |
|
|
173
|
+
| `pa:conflict` | Resolve merge conflicts with AI |
|
|
174
|
+
| `pa:changelog-gen` | Auto-generate changelog from commits |
|
|
175
|
+
|
|
176
|
+
## Search & Navigation
|
|
177
|
+
|
|
178
|
+
| Command | What to Do |
|
|
179
|
+
|---------|------------|
|
|
180
|
+
| `pa:find "pattern"` | Find code patterns/usage |
|
|
181
|
+
| `pa:todo` | Find and list all TODOs in code |
|
|
182
|
+
| `pa:fixme` | Find FIXMEs and critical issues |
|
|
183
|
+
| `pa:unused` | Find unused code/exports |
|
|
184
|
+
| `pa:unused-deps` | Find unused dependencies |
|
|
185
|
+
|
|
186
|
+
## Code Analysis
|
|
187
|
+
|
|
188
|
+
| Command | What to Do |
|
|
189
|
+
|---------|------------|
|
|
190
|
+
| `pa:complexity` | Cyclomatic complexity analysis |
|
|
191
|
+
| `pa:duplication` | Find duplicate code blocks |
|
|
192
|
+
| `pa:hotspots` | Find frequently changed files |
|
|
193
|
+
|
|
194
|
+
## Testing Advanced
|
|
195
|
+
|
|
196
|
+
| Command | What to Do |
|
|
197
|
+
|---------|------------|
|
|
198
|
+
| `pa:test-e2e` | Create/run E2E tests |
|
|
199
|
+
| `pa:test-unit` | Generate unit tests |
|
|
200
|
+
| `pa:mock` | Generate mocks/stubs |
|
|
201
|
+
| `pa:snapshot` | Snapshot testing management |
|
|
202
|
+
|
|
203
|
+
## DevOps & Infrastructure
|
|
204
|
+
|
|
205
|
+
| Command | What to Do |
|
|
206
|
+
|---------|------------|
|
|
207
|
+
| `pa:docker` | Docker commands (build, compose) |
|
|
208
|
+
| `pa:ci` | CI/CD pipeline status/management |
|
|
209
|
+
| `pa:deploy-preview` | Deploy to preview environment |
|
|
210
|
+
|
|
211
|
+
## Release Management
|
|
212
|
+
|
|
213
|
+
| Command | What to Do |
|
|
214
|
+
|---------|------------|
|
|
215
|
+
| `pa:version` | Show/bump version |
|
|
216
|
+
| `pa:tag` | Create git tag for release |
|
|
217
|
+
| `pa:publish` | Publish package to registry |
|
|
218
|
+
|
|
92
219
|
## Key Files to Read
|
|
93
220
|
|
|
94
221
|
| 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
|
+
}
|