proagents 1.2.0 → 1.4.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 +89 -0
- package/package.json +1 -1
- package/proagents/AI_INSTRUCTIONS.md +1064 -0
- package/proagents/PROAGENTS.md +102 -0
package/README.md
CHANGED
|
@@ -304,6 +304,95 @@ Type these in any AI assistant (Claude, ChatGPT, Gemini, Cursor, etc.):
|
|
|
304
304
|
| `pa:learn` | Teach AI a pattern |
|
|
305
305
|
| `pa:suggestions` | Show AI suggestions |
|
|
306
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
|
+
|
|
360
|
+
### Code Review & PR
|
|
361
|
+
| Command | Description |
|
|
362
|
+
|---------|-------------|
|
|
363
|
+
| `pa:review-request` | Request code review from team |
|
|
364
|
+
| `pa:review-comments` | Show PR review comments |
|
|
365
|
+
| `pa:review-approve` | Approve current PR |
|
|
366
|
+
|
|
367
|
+
### Architecture
|
|
368
|
+
| Command | Description |
|
|
369
|
+
|---------|-------------|
|
|
370
|
+
| `pa:architecture` | Show architecture overview |
|
|
371
|
+
| `pa:architecture-diagram` | Generate diagram (Mermaid) |
|
|
372
|
+
| `pa:architecture-export` | Export diagram (SVG/PNG) |
|
|
373
|
+
|
|
374
|
+
### API Testing
|
|
375
|
+
| Command | Description |
|
|
376
|
+
|---------|-------------|
|
|
377
|
+
| `pa:api-test` | Test API endpoints |
|
|
378
|
+
| `pa:curl` | Generate curl commands |
|
|
379
|
+
| `pa:postman` | Generate Postman collection |
|
|
380
|
+
|
|
381
|
+
### Health & Monitoring
|
|
382
|
+
| Command | Description |
|
|
383
|
+
|---------|-------------|
|
|
384
|
+
| `pa:health` | Project health check |
|
|
385
|
+
| `pa:monitor` | Show monitoring status |
|
|
386
|
+
| `pa:uptime` | Service uptime check |
|
|
387
|
+
|
|
388
|
+
### Quick Actions
|
|
389
|
+
| Command | Description |
|
|
390
|
+
|---------|-------------|
|
|
391
|
+
| `pa:quick` | Show quick actions menu |
|
|
392
|
+
| `pa:alias` | Manage command aliases |
|
|
393
|
+
| `pa:alias-add` | Add custom alias |
|
|
394
|
+
| `pa:alias-remove` | Remove custom alias |
|
|
395
|
+
|
|
307
396
|
### Custom Commands
|
|
308
397
|
| Command | Description |
|
|
309
398
|
|---------|-------------|
|
package/package.json
CHANGED
|
@@ -911,6 +911,1070 @@ For `pa:suggestions`:
|
|
|
911
911
|
```
|
|
912
912
|
4. Offer to apply each suggestion
|
|
913
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
|
+
|
|
1538
|
+
### Code Review & PR
|
|
1539
|
+
| Command | Action |
|
|
1540
|
+
|---------|--------|
|
|
1541
|
+
| `pa:review-request` | Request code review from team |
|
|
1542
|
+
| `pa:review-request "user"` | Request review from specific user |
|
|
1543
|
+
| `pa:review-comments` | Show PR review comments |
|
|
1544
|
+
| `pa:review-comments "pr"` | Comments for specific PR |
|
|
1545
|
+
| `pa:review-approve` | Approve current PR |
|
|
1546
|
+
| `pa:review-approve "pr"` | Approve specific PR |
|
|
1547
|
+
|
|
1548
|
+
**How to execute Code Review commands:**
|
|
1549
|
+
|
|
1550
|
+
For `pa:review-request`:
|
|
1551
|
+
1. Detect current branch and PR status
|
|
1552
|
+
2. If no PR exists, suggest creating one first
|
|
1553
|
+
3. Get team members from config or git history
|
|
1554
|
+
4. Request review:
|
|
1555
|
+
```
|
|
1556
|
+
Review Request
|
|
1557
|
+
══════════════
|
|
1558
|
+
|
|
1559
|
+
PR: #123 - Add user authentication
|
|
1560
|
+
Branch: feature/user-auth
|
|
1561
|
+
|
|
1562
|
+
Requesting review from:
|
|
1563
|
+
• @tech-lead (suggested - code owner)
|
|
1564
|
+
• @senior-dev (suggested - recent contributor)
|
|
1565
|
+
|
|
1566
|
+
Select reviewers or type username:
|
|
1567
|
+
> @tech-lead, @qa-engineer
|
|
1568
|
+
|
|
1569
|
+
✓ Review requested from 2 reviewers
|
|
1570
|
+
```
|
|
1571
|
+
|
|
1572
|
+
For `pa:review-comments`:
|
|
1573
|
+
1. Get PR comments from GitHub/GitLab
|
|
1574
|
+
2. Group by file and status:
|
|
1575
|
+
```
|
|
1576
|
+
PR Review Comments
|
|
1577
|
+
══════════════════
|
|
1578
|
+
|
|
1579
|
+
PR #123: Add user authentication
|
|
1580
|
+
Status: Changes requested (2 pending)
|
|
1581
|
+
|
|
1582
|
+
src/auth/login.ts:
|
|
1583
|
+
├─ Line 45 [PENDING] @tech-lead:
|
|
1584
|
+
│ "Consider using bcrypt instead of md5 for hashing"
|
|
1585
|
+
│
|
|
1586
|
+
└─ Line 78 [RESOLVED] @qa-engineer:
|
|
1587
|
+
"Add error handling for network failures"
|
|
1588
|
+
|
|
1589
|
+
src/api/users.ts:
|
|
1590
|
+
└─ Line 12 [PENDING] @tech-lead:
|
|
1591
|
+
"Missing input validation"
|
|
1592
|
+
|
|
1593
|
+
Actions:
|
|
1594
|
+
• Reply to comment: pa:review-reply "comment-id" "response"
|
|
1595
|
+
• Resolve comment: pa:review-resolve "comment-id"
|
|
1596
|
+
```
|
|
1597
|
+
|
|
1598
|
+
For `pa:review-approve`:
|
|
1599
|
+
1. Check all required checks pass
|
|
1600
|
+
2. Verify no pending comments
|
|
1601
|
+
3. Approve PR:
|
|
1602
|
+
```
|
|
1603
|
+
PR Approval
|
|
1604
|
+
═══════════
|
|
1605
|
+
|
|
1606
|
+
PR #123: Add user authentication
|
|
1607
|
+
|
|
1608
|
+
Checks:
|
|
1609
|
+
✓ Tests passing
|
|
1610
|
+
✓ Build successful
|
|
1611
|
+
✓ No conflicts
|
|
1612
|
+
⚠ 1 pending comment (optional)
|
|
1613
|
+
|
|
1614
|
+
Approve anyway? [y/N]
|
|
1615
|
+
|
|
1616
|
+
✓ PR approved!
|
|
1617
|
+
Ready to merge.
|
|
1618
|
+
```
|
|
1619
|
+
|
|
1620
|
+
### Architecture
|
|
1621
|
+
| Command | Action |
|
|
1622
|
+
|---------|--------|
|
|
1623
|
+
| `pa:architecture` | Show architecture overview |
|
|
1624
|
+
| `pa:architecture "module"` | Architecture for specific module |
|
|
1625
|
+
| `pa:architecture-diagram` | Generate architecture diagram |
|
|
1626
|
+
| `pa:architecture-export` | Export architecture docs |
|
|
1627
|
+
|
|
1628
|
+
**How to execute Architecture commands:**
|
|
1629
|
+
|
|
1630
|
+
For `pa:architecture`:
|
|
1631
|
+
1. Analyze project structure
|
|
1632
|
+
2. Identify architectural patterns
|
|
1633
|
+
3. Generate overview:
|
|
1634
|
+
```
|
|
1635
|
+
Architecture Overview
|
|
1636
|
+
═════════════════════
|
|
1637
|
+
|
|
1638
|
+
Project: my-app
|
|
1639
|
+
Type: Full-stack Next.js
|
|
1640
|
+
Pattern: Clean Architecture + Feature-based
|
|
1641
|
+
|
|
1642
|
+
Layers:
|
|
1643
|
+
┌─────────────────────────────────────────┐
|
|
1644
|
+
│ Presentation (app/, components/) │
|
|
1645
|
+
│ ┌───────────────────────────────────┐ │
|
|
1646
|
+
│ │ Application (services/, hooks/) │ │
|
|
1647
|
+
│ │ ┌─────────────────────────────┐ │ │
|
|
1648
|
+
│ │ │ Domain (types/, entities/) │ │ │
|
|
1649
|
+
│ │ └─────────────────────────────┘ │ │
|
|
1650
|
+
│ └───────────────────────────────────┘ │
|
|
1651
|
+
└─────────────────────────────────────────┘
|
|
1652
|
+
|
|
1653
|
+
Key Components:
|
|
1654
|
+
• API Routes: /app/api/* (15 endpoints)
|
|
1655
|
+
• Pages: /app/* (12 pages)
|
|
1656
|
+
• Components: /components/* (45 components)
|
|
1657
|
+
• Services: /services/* (8 services)
|
|
1658
|
+
|
|
1659
|
+
Dependencies:
|
|
1660
|
+
• Database: PostgreSQL via Prisma
|
|
1661
|
+
• Auth: NextAuth.js with JWT
|
|
1662
|
+
• State: Zustand + React Query
|
|
1663
|
+
• Styling: Tailwind CSS
|
|
1664
|
+
|
|
1665
|
+
Patterns Detected:
|
|
1666
|
+
• Repository Pattern (services/)
|
|
1667
|
+
• Factory Pattern (components/forms/)
|
|
1668
|
+
• Singleton (lib/prisma.ts)
|
|
1669
|
+
```
|
|
1670
|
+
|
|
1671
|
+
For `pa:architecture-diagram`:
|
|
1672
|
+
1. Generate Mermaid diagram from codebase
|
|
1673
|
+
2. Show component relationships:
|
|
1674
|
+
```mermaid
|
|
1675
|
+
graph TB
|
|
1676
|
+
subgraph Presentation
|
|
1677
|
+
Pages[Pages]
|
|
1678
|
+
Components[Components]
|
|
1679
|
+
end
|
|
1680
|
+
|
|
1681
|
+
subgraph Application
|
|
1682
|
+
Services[Services]
|
|
1683
|
+
Hooks[Hooks]
|
|
1684
|
+
end
|
|
1685
|
+
|
|
1686
|
+
subgraph Infrastructure
|
|
1687
|
+
API[API Routes]
|
|
1688
|
+
DB[(Database)]
|
|
1689
|
+
end
|
|
1690
|
+
|
|
1691
|
+
Pages --> Components
|
|
1692
|
+
Pages --> Hooks
|
|
1693
|
+
Hooks --> Services
|
|
1694
|
+
Services --> API
|
|
1695
|
+
API --> DB
|
|
1696
|
+
```
|
|
1697
|
+
3. Save to `./docs/architecture.md`
|
|
1698
|
+
|
|
1699
|
+
### API Testing
|
|
1700
|
+
| Command | Action |
|
|
1701
|
+
|---------|--------|
|
|
1702
|
+
| `pa:api-test` | Test API endpoints |
|
|
1703
|
+
| `pa:api-test "endpoint"` | Test specific endpoint |
|
|
1704
|
+
| `pa:curl` | Generate curl commands |
|
|
1705
|
+
| `pa:curl "endpoint"` | Curl for specific endpoint |
|
|
1706
|
+
| `pa:postman` | Generate Postman collection |
|
|
1707
|
+
| `pa:postman-export` | Export to Postman file |
|
|
1708
|
+
|
|
1709
|
+
**How to execute API Testing commands:**
|
|
1710
|
+
|
|
1711
|
+
For `pa:api-test`:
|
|
1712
|
+
1. Discover API endpoints from routes
|
|
1713
|
+
2. Generate and run tests:
|
|
1714
|
+
```
|
|
1715
|
+
API Test Results
|
|
1716
|
+
════════════════
|
|
1717
|
+
|
|
1718
|
+
Testing: /api/*
|
|
1719
|
+
Environment: development (localhost:3000)
|
|
1720
|
+
|
|
1721
|
+
GET /api/users
|
|
1722
|
+
├─ Status: 200 OK ✓
|
|
1723
|
+
├─ Time: 45ms
|
|
1724
|
+
└─ Response: Array[10 items]
|
|
1725
|
+
|
|
1726
|
+
POST /api/users
|
|
1727
|
+
├─ Status: 201 Created ✓
|
|
1728
|
+
├─ Time: 120ms
|
|
1729
|
+
└─ Response: { id: "123", name: "Test" }
|
|
1730
|
+
|
|
1731
|
+
GET /api/users/:id
|
|
1732
|
+
├─ Status: 200 OK ✓
|
|
1733
|
+
├─ Time: 32ms
|
|
1734
|
+
└─ Response: { id: "1", name: "John" }
|
|
1735
|
+
|
|
1736
|
+
DELETE /api/users/:id
|
|
1737
|
+
├─ Status: 401 Unauthorized ✗
|
|
1738
|
+
├─ Time: 15ms
|
|
1739
|
+
└─ Error: Missing auth token
|
|
1740
|
+
|
|
1741
|
+
Summary: 3/4 passed (75%)
|
|
1742
|
+
```
|
|
1743
|
+
|
|
1744
|
+
For `pa:curl`:
|
|
1745
|
+
1. Analyze API routes and generate curl commands:
|
|
1746
|
+
```
|
|
1747
|
+
Generated Curl Commands
|
|
1748
|
+
═══════════════════════
|
|
1749
|
+
|
|
1750
|
+
# List users
|
|
1751
|
+
curl -X GET http://localhost:3000/api/users \
|
|
1752
|
+
-H "Content-Type: application/json" \
|
|
1753
|
+
-H "Authorization: Bearer $TOKEN"
|
|
1754
|
+
|
|
1755
|
+
# Create user
|
|
1756
|
+
curl -X POST http://localhost:3000/api/users \
|
|
1757
|
+
-H "Content-Type: application/json" \
|
|
1758
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
1759
|
+
-d '{"name": "John", "email": "john@example.com"}'
|
|
1760
|
+
|
|
1761
|
+
# Get user by ID
|
|
1762
|
+
curl -X GET http://localhost:3000/api/users/123 \
|
|
1763
|
+
-H "Authorization: Bearer $TOKEN"
|
|
1764
|
+
|
|
1765
|
+
Saved to: ./docs/curl-commands.sh
|
|
1766
|
+
```
|
|
1767
|
+
|
|
1768
|
+
For `pa:postman`:
|
|
1769
|
+
1. Scan API routes and extract endpoints
|
|
1770
|
+
2. Generate Postman collection:
|
|
1771
|
+
```
|
|
1772
|
+
Postman Collection Generated
|
|
1773
|
+
════════════════════════════
|
|
1774
|
+
|
|
1775
|
+
Collection: my-app API
|
|
1776
|
+
Endpoints: 15
|
|
1777
|
+
|
|
1778
|
+
Folders:
|
|
1779
|
+
├─ Auth (3 endpoints)
|
|
1780
|
+
│ ├─ POST /api/auth/login
|
|
1781
|
+
│ ├─ POST /api/auth/register
|
|
1782
|
+
│ └─ POST /api/auth/logout
|
|
1783
|
+
├─ Users (5 endpoints)
|
|
1784
|
+
│ ├─ GET /api/users
|
|
1785
|
+
│ ├─ POST /api/users
|
|
1786
|
+
│ ├─ GET /api/users/:id
|
|
1787
|
+
│ ├─ PUT /api/users/:id
|
|
1788
|
+
│ └─ DELETE /api/users/:id
|
|
1789
|
+
└─ Posts (7 endpoints)
|
|
1790
|
+
└─ ...
|
|
1791
|
+
|
|
1792
|
+
Saved to: ./docs/postman-collection.json
|
|
1793
|
+
|
|
1794
|
+
Import: File > Import in Postman
|
|
1795
|
+
```
|
|
1796
|
+
|
|
1797
|
+
### Health & Monitoring
|
|
1798
|
+
| Command | Action |
|
|
1799
|
+
|---------|--------|
|
|
1800
|
+
| `pa:health` | Project health check |
|
|
1801
|
+
| `pa:health-full` | Comprehensive health report |
|
|
1802
|
+
| `pa:monitor` | Show monitoring status |
|
|
1803
|
+
| `pa:monitor "service"` | Monitor specific service |
|
|
1804
|
+
| `pa:uptime` | Service uptime check |
|
|
1805
|
+
|
|
1806
|
+
**How to execute Health & Monitoring commands:**
|
|
1807
|
+
|
|
1808
|
+
For `pa:health`:
|
|
1809
|
+
1. Check various project health indicators:
|
|
1810
|
+
```
|
|
1811
|
+
Project Health Check
|
|
1812
|
+
════════════════════
|
|
1813
|
+
|
|
1814
|
+
Overall: 85% Healthy ████████░░
|
|
1815
|
+
|
|
1816
|
+
Code Quality:
|
|
1817
|
+
✓ Linting: No errors
|
|
1818
|
+
✓ Type checking: No errors
|
|
1819
|
+
⚠ Test coverage: 72% (target: 80%)
|
|
1820
|
+
✓ No security vulnerabilities
|
|
1821
|
+
|
|
1822
|
+
Dependencies:
|
|
1823
|
+
✓ All dependencies installed
|
|
1824
|
+
⚠ 3 outdated packages
|
|
1825
|
+
✓ No security advisories
|
|
1826
|
+
|
|
1827
|
+
Configuration:
|
|
1828
|
+
✓ Environment variables set
|
|
1829
|
+
✓ Config files valid
|
|
1830
|
+
⚠ Missing .env.example
|
|
1831
|
+
|
|
1832
|
+
Git Status:
|
|
1833
|
+
✓ Clean working directory
|
|
1834
|
+
✓ Up to date with remote
|
|
1835
|
+
✓ No merge conflicts
|
|
1836
|
+
|
|
1837
|
+
Performance:
|
|
1838
|
+
✓ Bundle size: 245KB (limit: 500KB)
|
|
1839
|
+
✓ Build time: 12s
|
|
1840
|
+
⚠ Lighthouse score: 78 (target: 90)
|
|
1841
|
+
|
|
1842
|
+
Issues Found: 4
|
|
1843
|
+
• Test coverage below 80%
|
|
1844
|
+
• 3 outdated packages
|
|
1845
|
+
• Missing .env.example
|
|
1846
|
+
• Lighthouse score below target
|
|
1847
|
+
```
|
|
1848
|
+
|
|
1849
|
+
For `pa:monitor`:
|
|
1850
|
+
1. Check running services and status:
|
|
1851
|
+
```
|
|
1852
|
+
Service Monitor
|
|
1853
|
+
═══════════════
|
|
1854
|
+
|
|
1855
|
+
Services:
|
|
1856
|
+
┌────────────────┬──────────┬─────────┬────────────┐
|
|
1857
|
+
│ Service │ Status │ Uptime │ Health │
|
|
1858
|
+
├────────────────┼──────────┼─────────┼────────────┤
|
|
1859
|
+
│ App (Next.js) │ Running │ 2h 15m │ Healthy │
|
|
1860
|
+
│ Database │ Running │ 5d 3h │ Healthy │
|
|
1861
|
+
│ Redis Cache │ Running │ 5d 3h │ Healthy │
|
|
1862
|
+
│ Worker │ Stopped │ - │ ⚠ Down │
|
|
1863
|
+
└────────────────┴──────────┴─────────┴────────────┘
|
|
1864
|
+
|
|
1865
|
+
Recent Events:
|
|
1866
|
+
• 10:30 - App restarted (deployment)
|
|
1867
|
+
• 09:15 - Worker stopped (manual)
|
|
1868
|
+
• Yesterday - Database backup completed
|
|
1869
|
+
|
|
1870
|
+
Alerts:
|
|
1871
|
+
⚠ Worker service is not running
|
|
1872
|
+
```
|
|
1873
|
+
|
|
1874
|
+
For `pa:uptime`:
|
|
1875
|
+
1. Check endpoint availability:
|
|
1876
|
+
```
|
|
1877
|
+
Uptime Check
|
|
1878
|
+
════════════
|
|
1879
|
+
|
|
1880
|
+
Checking endpoints...
|
|
1881
|
+
|
|
1882
|
+
Production (https://myapp.com):
|
|
1883
|
+
├─ / (homepage): 200 OK (125ms) ✓
|
|
1884
|
+
├─ /api/health: 200 OK (45ms) ✓
|
|
1885
|
+
├─ /api/users: 200 OK (89ms) ✓
|
|
1886
|
+
└─ /dashboard: 200 OK (156ms) ✓
|
|
1887
|
+
|
|
1888
|
+
Staging (https://staging.myapp.com):
|
|
1889
|
+
├─ / (homepage): 200 OK (145ms) ✓
|
|
1890
|
+
└─ /api/health: 200 OK (52ms) ✓
|
|
1891
|
+
|
|
1892
|
+
All endpoints responding ✓
|
|
1893
|
+
Average response time: 102ms
|
|
1894
|
+
```
|
|
1895
|
+
|
|
1896
|
+
### Quick Actions
|
|
1897
|
+
| Command | Action |
|
|
1898
|
+
|---------|--------|
|
|
1899
|
+
| `pa:quick` | Show quick actions menu |
|
|
1900
|
+
| `pa:quick "action"` | Execute quick action |
|
|
1901
|
+
| `pa:alias` | Manage command aliases |
|
|
1902
|
+
| `pa:alias-add "name" "command"` | Add new alias |
|
|
1903
|
+
| `pa:alias-remove "name"` | Remove alias |
|
|
1904
|
+
|
|
1905
|
+
**How to execute Quick Actions commands:**
|
|
1906
|
+
|
|
1907
|
+
For `pa:quick`:
|
|
1908
|
+
1. Show context-aware quick actions:
|
|
1909
|
+
```
|
|
1910
|
+
Quick Actions
|
|
1911
|
+
═════════════
|
|
1912
|
+
|
|
1913
|
+
Based on current context (feature/user-auth):
|
|
1914
|
+
|
|
1915
|
+
Development:
|
|
1916
|
+
[1] Run tests for current feature
|
|
1917
|
+
[2] Check code coverage
|
|
1918
|
+
[3] Lint and fix
|
|
1919
|
+
|
|
1920
|
+
Git:
|
|
1921
|
+
[4] Commit all changes
|
|
1922
|
+
[5] Push to remote
|
|
1923
|
+
[6] Create PR
|
|
1924
|
+
|
|
1925
|
+
Quality:
|
|
1926
|
+
[7] Run full QA check
|
|
1927
|
+
[8] Security scan
|
|
1928
|
+
[9] Performance audit
|
|
1929
|
+
|
|
1930
|
+
Documentation:
|
|
1931
|
+
[10] Update docs for changes
|
|
1932
|
+
|
|
1933
|
+
Select action (1-10) or type command:
|
|
1934
|
+
> 6
|
|
1935
|
+
|
|
1936
|
+
Creating PR...
|
|
1937
|
+
```
|
|
1938
|
+
|
|
1939
|
+
For `pa:alias`:
|
|
1940
|
+
1. List and manage command aliases:
|
|
1941
|
+
```
|
|
1942
|
+
Command Aliases
|
|
1943
|
+
═══════════════
|
|
1944
|
+
|
|
1945
|
+
Current Aliases:
|
|
1946
|
+
┌──────────┬───────────────────────────┐
|
|
1947
|
+
│ Alias │ Command │
|
|
1948
|
+
├──────────┼───────────────────────────┤
|
|
1949
|
+
│ pa:c │ pa:commit │
|
|
1950
|
+
│ pa:pr │ pa:github-pr │
|
|
1951
|
+
│ pa:cov │ pa:coverage │
|
|
1952
|
+
│ pa:sec │ pa:security-scan │
|
|
1953
|
+
│ pa:up │ pa:deps-outdated │
|
|
1954
|
+
└──────────┴───────────────────────────┘
|
|
1955
|
+
|
|
1956
|
+
Add alias: pa:alias-add "name" "command"
|
|
1957
|
+
Remove: pa:alias-remove "name"
|
|
1958
|
+
|
|
1959
|
+
Built-in aliases cannot be modified:
|
|
1960
|
+
pa:f, pa:s, pa:h, pa:d, pa:t, pa:q, pa:a, pa:r, pa:p, pa:i
|
|
1961
|
+
```
|
|
1962
|
+
|
|
1963
|
+
For `pa:alias-add`:
|
|
1964
|
+
1. Add custom alias:
|
|
1965
|
+
```
|
|
1966
|
+
Adding Alias
|
|
1967
|
+
════════════
|
|
1968
|
+
|
|
1969
|
+
Alias: pa:ship
|
|
1970
|
+
Command: pa:test && pa:build && pa:deploy
|
|
1971
|
+
|
|
1972
|
+
✓ Alias created!
|
|
1973
|
+
|
|
1974
|
+
Usage: pa:ship
|
|
1975
|
+
Runs: pa:test && pa:build && pa:deploy
|
|
1976
|
+
```
|
|
1977
|
+
|
|
914
1978
|
### AI Platform Management
|
|
915
1979
|
| Command | Action |
|
|
916
1980
|
|---------|--------|
|
package/proagents/PROAGENTS.md
CHANGED
|
@@ -155,6 +155,108 @@ Execute these commands when user types them (prefix: `pa:`):
|
|
|
155
155
|
| `pa:forget "pattern"` | Remove learned pattern |
|
|
156
156
|
| `pa:suggestions` | Show AI suggestions |
|
|
157
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
|
+
|
|
219
|
+
## Code Review & PR
|
|
220
|
+
|
|
221
|
+
| Command | What to Do |
|
|
222
|
+
|---------|------------|
|
|
223
|
+
| `pa:review-request` | Request code review from team |
|
|
224
|
+
| `pa:review-comments` | Show PR review comments |
|
|
225
|
+
| `pa:review-approve` | Approve current PR |
|
|
226
|
+
|
|
227
|
+
## Architecture
|
|
228
|
+
|
|
229
|
+
| Command | What to Do |
|
|
230
|
+
|---------|------------|
|
|
231
|
+
| `pa:architecture` | Show architecture overview |
|
|
232
|
+
| `pa:architecture-diagram` | Generate architecture diagram (Mermaid) |
|
|
233
|
+
| `pa:architecture-export` | Export diagram (SVG/PNG) |
|
|
234
|
+
|
|
235
|
+
## API Testing
|
|
236
|
+
|
|
237
|
+
| Command | What to Do |
|
|
238
|
+
|---------|------------|
|
|
239
|
+
| `pa:api-test` | Test API endpoints |
|
|
240
|
+
| `pa:curl` | Generate curl commands for endpoints |
|
|
241
|
+
| `pa:postman` | Generate Postman collection |
|
|
242
|
+
|
|
243
|
+
## Health & Monitoring
|
|
244
|
+
|
|
245
|
+
| Command | What to Do |
|
|
246
|
+
|---------|------------|
|
|
247
|
+
| `pa:health` | Project health check |
|
|
248
|
+
| `pa:monitor` | Show monitoring status |
|
|
249
|
+
| `pa:uptime` | Service uptime check |
|
|
250
|
+
|
|
251
|
+
## Quick Actions
|
|
252
|
+
|
|
253
|
+
| Command | What to Do |
|
|
254
|
+
|---------|------------|
|
|
255
|
+
| `pa:quick` | Show quick actions menu |
|
|
256
|
+
| `pa:alias` | Manage command aliases |
|
|
257
|
+
| `pa:alias-add` | Add custom alias |
|
|
258
|
+
| `pa:alias-remove` | Remove custom alias |
|
|
259
|
+
|
|
158
260
|
## Key Files to Read
|
|
159
261
|
|
|
160
262
|
| File | Purpose |
|