ai-devx 1.0.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/LICENSE +21 -0
- package/README.md +325 -0
- package/bin/cli.js +65 -0
- package/package.json +63 -0
- package/src/commands/init.js +86 -0
- package/src/commands/status.js +60 -0
- package/src/commands/update.js +77 -0
- package/src/config.js +72 -0
- package/src/utils/fileSystem.js +64 -0
- package/src/utils/logger.js +18 -0
- package/templates/.agent/.gitignore +6 -0
- package/templates/.agent/agents/backend-specialist.md +147 -0
- package/templates/.agent/agents/database-architect.md +164 -0
- package/templates/.agent/agents/debugger.md +128 -0
- package/templates/.agent/agents/devops-engineer.md +185 -0
- package/templates/.agent/agents/frontend-specialist.md +122 -0
- package/templates/.agent/agents/orchestrator.md +137 -0
- package/templates/.agent/agents/project-planner.md +127 -0
- package/templates/.agent/agents/security-auditor.md +122 -0
- package/templates/.agent/agents/test-engineer.md +176 -0
- package/templates/.agent/scripts/checklist.js +260 -0
- package/templates/.agent/scripts/security_scan.js +251 -0
- package/templates/.agent/skills/api-patterns/SKILL.md +236 -0
- package/templates/.agent/skills/database-design/SKILL.md +303 -0
- package/templates/.agent/skills/docker-expert/SKILL.md +286 -0
- package/templates/.agent/skills/react-best-practices/SKILL.md +246 -0
- package/templates/.agent/skills/testing-patterns/SKILL.md +262 -0
- package/templates/.agent/workflows/create.md +131 -0
- package/templates/.agent/workflows/debug.md +138 -0
- package/templates/.agent/workflows/deploy.md +163 -0
- package/templates/.agent/workflows/plan.md +153 -0
- package/templates/.agent/workflows/security.md +181 -0
- package/templates/.agent/workflows/test.md +165 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
command: /plan
|
|
3
|
+
description: Create comprehensive task breakdown and implementation plan
|
|
4
|
+
agent: project-planner
|
|
5
|
+
skills:
|
|
6
|
+
- brainstorming
|
|
7
|
+
- plan-writing
|
|
8
|
+
- architecture
|
|
9
|
+
- estimation
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /plan Workflow
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Break down complex requirements into actionable tasks with estimates, dependencies, and milestones.
|
|
16
|
+
|
|
17
|
+
## Trigger
|
|
18
|
+
User types: `/plan <description>`
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
### Step 1: Requirements Clarification
|
|
23
|
+
Ask 3-5 strategic questions:
|
|
24
|
+
1. What is the core problem you're solving?
|
|
25
|
+
2. Who are the users and what do they need?
|
|
26
|
+
3. What does success look like?
|
|
27
|
+
4. What are the constraints (time, budget, tech)?
|
|
28
|
+
5. Are there any dependencies or blockers?
|
|
29
|
+
|
|
30
|
+
### Step 2: Analysis
|
|
31
|
+
- Parse user request
|
|
32
|
+
- Identify ambiguous requirements
|
|
33
|
+
- Determine scope and complexity
|
|
34
|
+
- Identify technical constraints
|
|
35
|
+
|
|
36
|
+
### Step 3: Task Decomposition
|
|
37
|
+
Break down into:
|
|
38
|
+
- High-level objectives
|
|
39
|
+
- Technical tasks
|
|
40
|
+
- Dependencies between tasks
|
|
41
|
+
- Risks and mitigations
|
|
42
|
+
|
|
43
|
+
### Step 4: Estimation
|
|
44
|
+
Categorize tasks:
|
|
45
|
+
- **Quick wins**: < 2 hours
|
|
46
|
+
- **Small**: 2-4 hours
|
|
47
|
+
- **Medium**: 4-8 hours
|
|
48
|
+
- **Large**: 1-2 days
|
|
49
|
+
- **Epic**: 3-5 days (break down further)
|
|
50
|
+
|
|
51
|
+
Apply uncertainty multipliers:
|
|
52
|
+
- Well-understood: 1.0x
|
|
53
|
+
- Some uncertainty: 1.5x
|
|
54
|
+
- High uncertainty: 2.0x
|
|
55
|
+
- Research needed: 3.0x
|
|
56
|
+
|
|
57
|
+
### Step 5: Output Format
|
|
58
|
+
|
|
59
|
+
Generate structured markdown plan:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
## Plan: [Feature Name]
|
|
63
|
+
|
|
64
|
+
### Overview
|
|
65
|
+
[High-level description of what will be built]
|
|
66
|
+
|
|
67
|
+
### Goals
|
|
68
|
+
- [Goal 1]
|
|
69
|
+
- [Goal 2]
|
|
70
|
+
- [Goal 3]
|
|
71
|
+
|
|
72
|
+
### Technical Architecture
|
|
73
|
+
[Architecture decisions and tech stack]
|
|
74
|
+
|
|
75
|
+
### Tasks
|
|
76
|
+
|
|
77
|
+
#### Phase 1: Foundation
|
|
78
|
+
| ID | Task | Estimate | Dependencies | Priority |
|
|
79
|
+
|----|------|----------|--------------|----------|
|
|
80
|
+
| T1 | [Task description] | 2h | None | P0 |
|
|
81
|
+
| T2 | [Task description] | 4h | T1 | P0 |
|
|
82
|
+
|
|
83
|
+
#### Phase 2: Implementation
|
|
84
|
+
| ID | Task | Estimate | Dependencies | Priority |
|
|
85
|
+
|----|------|----------|--------------|----------|
|
|
86
|
+
| T3 | [Task description] | 8h | T2 | P1 |
|
|
87
|
+
|
|
88
|
+
### Milestones
|
|
89
|
+
1. **Milestone 1** - [Date]: [Description]
|
|
90
|
+
2. **Milestone 2** - [Date]: [Description]
|
|
91
|
+
3. **Milestone 3** - [Date]: [Description]
|
|
92
|
+
|
|
93
|
+
### Risks
|
|
94
|
+
| Risk | Probability | Impact | Mitigation |
|
|
95
|
+
|------|-------------|--------|------------|
|
|
96
|
+
| [Risk 1] | High/Med/Low | High/Med/Low | [Strategy] |
|
|
97
|
+
|
|
98
|
+
### Resources Needed
|
|
99
|
+
- [Role 1]: [Number needed]
|
|
100
|
+
- [Role 2]: [Number needed]
|
|
101
|
+
|
|
102
|
+
### Definition of Done
|
|
103
|
+
- [ ] All P0 tasks complete
|
|
104
|
+
- [ ] Code reviewed
|
|
105
|
+
- [ ] Tests passing
|
|
106
|
+
- [ ] Documentation updated
|
|
107
|
+
- [ ] Deployed to staging
|
|
108
|
+
|
|
109
|
+
### Next Steps
|
|
110
|
+
1. [Action item 1]
|
|
111
|
+
2. [Action item 2]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Example Usage
|
|
115
|
+
|
|
116
|
+
**User**: `/plan Build a user authentication system with JWT`
|
|
117
|
+
|
|
118
|
+
**Response**:
|
|
119
|
+
```
|
|
120
|
+
⚡ Executing /plan
|
|
121
|
+
|
|
122
|
+
## Plan: User Authentication System with JWT
|
|
123
|
+
|
|
124
|
+
### Overview
|
|
125
|
+
Implement secure user authentication using JWT tokens with login, signup, and protected routes.
|
|
126
|
+
|
|
127
|
+
### Tasks
|
|
128
|
+
|
|
129
|
+
#### Phase 1: Backend (2 days)
|
|
130
|
+
| ID | Task | Estimate | Dependencies |
|
|
131
|
+
|----|------|----------|--------------|
|
|
132
|
+
| T1 | Design user schema | 2h | None |
|
|
133
|
+
| T2 | Implement password hashing | 2h | T1 |
|
|
134
|
+
| T3 | Create signup endpoint | 4h | T2 |
|
|
135
|
+
| T4 | Create login endpoint | 4h | T2 |
|
|
136
|
+
| T5 | Implement JWT middleware | 4h | T4 |
|
|
137
|
+
|
|
138
|
+
#### Phase 2: Frontend (1.5 days)
|
|
139
|
+
| ID | Task | Estimate | Dependencies |
|
|
140
|
+
|----|------|----------|--------------|
|
|
141
|
+
| T6 | Create login form | 4h | None |
|
|
142
|
+
| T7 | Create signup form | 4h | None |
|
|
143
|
+
| T8 | Implement auth context | 4h | T6, T7 |
|
|
144
|
+
|
|
145
|
+
Total: 3.5 days
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Success Criteria
|
|
149
|
+
- Clear task breakdown with estimates
|
|
150
|
+
- Identified dependencies
|
|
151
|
+
- Risk assessment
|
|
152
|
+
- Realistic timeline
|
|
153
|
+
- Actionable next steps
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
command: /security
|
|
3
|
+
description: Security audit, vulnerability scanning, and security fixes
|
|
4
|
+
agent: security-auditor
|
|
5
|
+
skills:
|
|
6
|
+
- vulnerability-scanner
|
|
7
|
+
- security-best-practices
|
|
8
|
+
- authentication-patterns
|
|
9
|
+
mode: strict
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /security Workflow
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Perform security audits, scan for vulnerabilities, and implement security fixes.
|
|
16
|
+
|
|
17
|
+
## Trigger
|
|
18
|
+
User types: `/security` or `/security audit`
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
### Step 1: Code Scan
|
|
23
|
+
Check for:
|
|
24
|
+
- Hardcoded secrets
|
|
25
|
+
- SQL injection vulnerabilities
|
|
26
|
+
- XSS vulnerabilities
|
|
27
|
+
- Insecure dependencies
|
|
28
|
+
- Weak authentication
|
|
29
|
+
- Missing authorization
|
|
30
|
+
|
|
31
|
+
### Step 2: Dependency Scan
|
|
32
|
+
Check for:
|
|
33
|
+
- Known vulnerabilities in dependencies
|
|
34
|
+
- Outdated packages
|
|
35
|
+
- License compliance
|
|
36
|
+
|
|
37
|
+
### Step 3: Configuration Review
|
|
38
|
+
Check:
|
|
39
|
+
- Environment variables
|
|
40
|
+
- Security headers
|
|
41
|
+
- CORS settings
|
|
42
|
+
- SSL/TLS configuration
|
|
43
|
+
- Authentication settings
|
|
44
|
+
|
|
45
|
+
### Step 4: Vulnerability Assessment
|
|
46
|
+
Classify findings:
|
|
47
|
+
- **Critical**: Immediate action required
|
|
48
|
+
- **High**: Fix within 24 hours
|
|
49
|
+
- **Medium**: Fix within 1 week
|
|
50
|
+
- **Low**: Fix when convenient
|
|
51
|
+
- **Info**: Best practices
|
|
52
|
+
|
|
53
|
+
### Step 5: Remediation
|
|
54
|
+
Provide fixes for each vulnerability:
|
|
55
|
+
- Code examples
|
|
56
|
+
- Configuration changes
|
|
57
|
+
- Dependency updates
|
|
58
|
+
|
|
59
|
+
### Step 6: Validation
|
|
60
|
+
Verify fixes:
|
|
61
|
+
- Re-run security scans
|
|
62
|
+
- Test application functionality
|
|
63
|
+
- Check for regressions
|
|
64
|
+
|
|
65
|
+
## Response Format
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
⚡ Executing /security
|
|
69
|
+
|
|
70
|
+
🤖 Applying @security-auditor...
|
|
71
|
+
|
|
72
|
+
## Security Audit Results
|
|
73
|
+
|
|
74
|
+
### Summary
|
|
75
|
+
🔴 Critical: 1
|
|
76
|
+
🟠 High: 2
|
|
77
|
+
🟡 Medium: 3
|
|
78
|
+
🟢 Low: 5
|
|
79
|
+
|
|
80
|
+
### Critical Issues
|
|
81
|
+
|
|
82
|
+
#### 1. Hardcoded API Key
|
|
83
|
+
**Location**: `src/config.ts:15`
|
|
84
|
+
**Severity**: 🔴 Critical
|
|
85
|
+
|
|
86
|
+
**Issue**:
|
|
87
|
+
```typescript
|
|
88
|
+
const API_KEY = "sk-1234567890abcdef";
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Fix**:
|
|
92
|
+
```typescript
|
|
93
|
+
const API_KEY = process.env.API_KEY;
|
|
94
|
+
if (!API_KEY) {
|
|
95
|
+
throw new Error('API_KEY environment variable required');
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### 2. SQL Injection Risk
|
|
100
|
+
**Location**: `src/routes/users.ts:23`
|
|
101
|
+
**Severity**: 🔴 Critical
|
|
102
|
+
|
|
103
|
+
**Issue**:
|
|
104
|
+
```typescript
|
|
105
|
+
const query = `SELECT * FROM users WHERE id = ${userId}`;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Fix**:
|
|
109
|
+
```typescript
|
|
110
|
+
const query = 'SELECT * FROM users WHERE id = $1';
|
|
111
|
+
const result = await db.query(query, [userId]);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Dependency Vulnerabilities
|
|
115
|
+
|
|
116
|
+
| Package | Version | CVE | Severity | Fix |
|
|
117
|
+
|---------|---------|-----|----------|-----|
|
|
118
|
+
| lodash | 4.17.15 | CVE-2021-23337 | High | Upgrade to 4.17.21 |
|
|
119
|
+
| express | 4.17.1 | CVE-2022-24999 | Medium | Upgrade to 4.18.2 |
|
|
120
|
+
|
|
121
|
+
### Recommendations
|
|
122
|
+
- Enable Dependabot
|
|
123
|
+
- Set up security alerts
|
|
124
|
+
- Regular dependency updates
|
|
125
|
+
- Security training for team
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Security Checklist
|
|
129
|
+
|
|
130
|
+
### Code Security
|
|
131
|
+
- [ ] No hardcoded secrets
|
|
132
|
+
- [ ] Input validation on all endpoints
|
|
133
|
+
- [ ] Output encoding
|
|
134
|
+
- [ ] Parameterized queries
|
|
135
|
+
- [ ] CSRF protection
|
|
136
|
+
- [ ] XSS prevention
|
|
137
|
+
|
|
138
|
+
### Authentication
|
|
139
|
+
- [ ] Strong password policy
|
|
140
|
+
- [ ] Rate limiting on auth endpoints
|
|
141
|
+
- [ ] Session timeout
|
|
142
|
+
- [ ] Secure session storage
|
|
143
|
+
- [ ] MFA available
|
|
144
|
+
|
|
145
|
+
### Authorization
|
|
146
|
+
- [ ] RBAC implemented
|
|
147
|
+
- [ ] Resource-level checks
|
|
148
|
+
- [ ] No privilege escalation
|
|
149
|
+
|
|
150
|
+
### Infrastructure
|
|
151
|
+
- [ ] HTTPS enforced
|
|
152
|
+
- [ ] Security headers set
|
|
153
|
+
- [ ] CORS configured
|
|
154
|
+
- [ ] Secrets management
|
|
155
|
+
- [ ] Logging enabled
|
|
156
|
+
|
|
157
|
+
## Commands
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Scan dependencies
|
|
161
|
+
npm audit
|
|
162
|
+
|
|
163
|
+
# Fix vulnerabilities
|
|
164
|
+
npm audit fix
|
|
165
|
+
|
|
166
|
+
# Security headers check
|
|
167
|
+
npx helmet
|
|
168
|
+
|
|
169
|
+
# Secrets scanning
|
|
170
|
+
git-secrets --scan
|
|
171
|
+
|
|
172
|
+
# SAST scanning
|
|
173
|
+
sonar-scanner
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Success Criteria
|
|
177
|
+
- No critical vulnerabilities
|
|
178
|
+
- No high vulnerabilities
|
|
179
|
+
- All medium vulnerabilities planned
|
|
180
|
+
- Dependencies up to date
|
|
181
|
+
- Security headers configured
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
command: /test
|
|
3
|
+
description: Generate and run tests for code coverage and quality assurance
|
|
4
|
+
agent: test-engineer
|
|
5
|
+
skills:
|
|
6
|
+
- testing-patterns
|
|
7
|
+
- webapp-testing
|
|
8
|
+
- tdd-workflow
|
|
9
|
+
mode: thorough
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /test Workflow
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Generate comprehensive tests, run test suites, and improve code coverage.
|
|
16
|
+
|
|
17
|
+
## Trigger
|
|
18
|
+
User types: `/test <target>` or `/test all`
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
### Step 1: Test Discovery
|
|
23
|
+
Identify what needs testing:
|
|
24
|
+
- Untested files/functions
|
|
25
|
+
- Critical business logic
|
|
26
|
+
- API endpoints
|
|
27
|
+
- UI components
|
|
28
|
+
- Edge cases
|
|
29
|
+
|
|
30
|
+
### Step 2: Test Generation
|
|
31
|
+
|
|
32
|
+
**Unit Tests:**
|
|
33
|
+
```typescript
|
|
34
|
+
- Test happy paths
|
|
35
|
+
- Test error cases
|
|
36
|
+
- Test edge cases
|
|
37
|
+
- Test boundary conditions
|
|
38
|
+
- Mock external dependencies
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Integration Tests:**
|
|
42
|
+
```typescript
|
|
43
|
+
- Test API endpoints
|
|
44
|
+
- Test database interactions
|
|
45
|
+
- Test service integrations
|
|
46
|
+
- Test authentication flows
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**E2E Tests:**
|
|
50
|
+
```typescript
|
|
51
|
+
- Test critical user flows
|
|
52
|
+
- Test form submissions
|
|
53
|
+
- Test navigation
|
|
54
|
+
- Test error handling
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 3: Test Implementation
|
|
58
|
+
Follow AAA pattern:
|
|
59
|
+
```typescript
|
|
60
|
+
describe('functionName', () => {
|
|
61
|
+
it('should [expected behavior] when [condition]', () => {
|
|
62
|
+
// Arrange
|
|
63
|
+
const input = ...;
|
|
64
|
+
|
|
65
|
+
// Act
|
|
66
|
+
const result = functionName(input);
|
|
67
|
+
|
|
68
|
+
// Assert
|
|
69
|
+
expect(result).toBe(expected);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 4: Test Execution
|
|
75
|
+
Run tests and report:
|
|
76
|
+
- Total tests
|
|
77
|
+
- Passed/Failed
|
|
78
|
+
- Coverage percentage
|
|
79
|
+
- Duration
|
|
80
|
+
|
|
81
|
+
### Step 5: Coverage Analysis
|
|
82
|
+
Check coverage gaps:
|
|
83
|
+
- Branches not covered
|
|
84
|
+
- Functions not tested
|
|
85
|
+
- Lines not executed
|
|
86
|
+
- Prioritize critical code
|
|
87
|
+
|
|
88
|
+
### Step 6: Coverage Improvement
|
|
89
|
+
Add tests for uncovered code:
|
|
90
|
+
- Edge cases
|
|
91
|
+
- Error paths
|
|
92
|
+
- Complex logic
|
|
93
|
+
|
|
94
|
+
## Response Format
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
⚡ Executing /test
|
|
98
|
+
|
|
99
|
+
🤖 Applying @test-engineer...
|
|
100
|
+
|
|
101
|
+
## Test Generation
|
|
102
|
+
|
|
103
|
+
### Files to Test
|
|
104
|
+
- [file1]: [reason]
|
|
105
|
+
- [file2]: [reason]
|
|
106
|
+
|
|
107
|
+
### Generated Tests
|
|
108
|
+
|
|
109
|
+
#### Unit Tests
|
|
110
|
+
```typescript
|
|
111
|
+
[Code]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Integration Tests
|
|
115
|
+
```typescript
|
|
116
|
+
[Code]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Test Results
|
|
120
|
+
|
|
121
|
+
### Summary
|
|
122
|
+
- Total: 50 tests
|
|
123
|
+
- Passed: 48 ✅
|
|
124
|
+
- Failed: 2 ❌
|
|
125
|
+
- Skipped: 0
|
|
126
|
+
|
|
127
|
+
### Coverage
|
|
128
|
+
| Metric | Before | After | Target |
|
|
129
|
+
|--------|--------|-------|--------|
|
|
130
|
+
| Statements | 60% | 85% | 80% ✅ |
|
|
131
|
+
| Branches | 50% | 75% | 80% ⚠️ |
|
|
132
|
+
| Functions | 70% | 90% | 80% ✅ |
|
|
133
|
+
| Lines | 65% | 85% | 80% ✅ |
|
|
134
|
+
|
|
135
|
+
### Failed Tests
|
|
136
|
+
1. [Test name]: [Error]
|
|
137
|
+
- Fix: [Solution]
|
|
138
|
+
|
|
139
|
+
## Recommendations
|
|
140
|
+
- [Recommendation 1]
|
|
141
|
+
- [Recommendation 2]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Commands
|
|
145
|
+
|
|
146
|
+
**Test specific file:**
|
|
147
|
+
`/test UserService.ts`
|
|
148
|
+
|
|
149
|
+
**Test all:**
|
|
150
|
+
`/test all`
|
|
151
|
+
|
|
152
|
+
**Test specific type:**
|
|
153
|
+
`/test --unit`
|
|
154
|
+
`/test --integration`
|
|
155
|
+
`/test --e2e`
|
|
156
|
+
|
|
157
|
+
**Coverage report:**
|
|
158
|
+
`/test --coverage`
|
|
159
|
+
|
|
160
|
+
## Success Criteria
|
|
161
|
+
- New tests generated
|
|
162
|
+
- Coverage improved
|
|
163
|
+
- Critical paths tested
|
|
164
|
+
- All tests passing
|
|
165
|
+
- Edge cases covered
|