myaidev-method 0.2.23 → 0.2.24-2
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/.claude-plugin/plugin.json +251 -0
- package/PLUGIN_ARCHITECTURE.md +276 -0
- package/README.md +204 -0
- package/USER_GUIDE.md +436 -9
- package/bin/cli.js +370 -38
- package/dist/server/.tsbuildinfo +1 -1
- package/extension.json +174 -0
- package/hooks/hooks.json +221 -0
- package/marketplace.json +179 -0
- package/package.json +24 -7
- package/skills/content-verifier/SKILL.md +178 -0
- package/skills/content-writer/SKILL.md +151 -0
- package/skills/coolify-deployer/SKILL.md +207 -0
- package/skills/openstack-manager/SKILL.md +213 -0
- package/skills/security-auditor/SKILL.md +180 -0
- package/skills/security-tester/SKILL.md +171 -0
- package/skills/sparc-architect/SKILL.md +146 -0
- package/skills/sparc-coder/SKILL.md +136 -0
- package/skills/sparc-documenter/SKILL.md +195 -0
- package/skills/sparc-reviewer/SKILL.md +179 -0
- package/skills/sparc-tester/SKILL.md +156 -0
- package/skills/visual-generator/SKILL.md +147 -0
- package/skills/wordpress-publisher/SKILL.md +150 -0
- package/src/config/workflows.js +28 -44
- package/src/lib/ascii-banner.js +214 -0
- package/src/lib/config-manager.js +470 -0
- package/src/lib/content-coordinator.js +2562 -0
- package/src/lib/content-generator.js +427 -0
- package/src/lib/html-conversion-utils.js +843 -0
- package/src/lib/installation-detector.js +266 -0
- package/src/lib/seo-optimizer.js +515 -0
- package/src/lib/visual-config-utils.js +1 -1
- package/src/lib/visual-generation-utils.js +34 -14
- package/src/lib/wordpress-client.js +633 -0
- package/src/lib/workflow-installer.js +3 -3
- package/src/scripts/generate-visual-cli.js +39 -10
- package/src/scripts/html-conversion-cli.js +526 -0
- package/src/scripts/init/configure.js +436 -0
- package/src/scripts/init/install.js +460 -0
- package/src/scripts/ping.js +0 -1
- package/src/scripts/utils/file-utils.js +404 -0
- package/src/scripts/utils/logger.js +300 -0
- package/src/scripts/utils/write-content.js +293 -0
- package/src/templates/claude/agents/content-production-coordinator.md +689 -15
- package/src/templates/claude/agents/visual-content-generator.md +129 -4
- package/src/templates/claude/commands/myai-content-enrichment.md +227 -0
- package/src/templates/claude/commands/myai-content-writer.md +48 -37
- package/src/templates/claude/commands/myai-convert-html.md +186 -0
- package/src/templates/claude/commands/myai-coordinate-content.md +347 -11
- package/src/templates/diagrams/architecture.d2 +52 -0
- package/src/templates/diagrams/flowchart.d2 +42 -0
- package/src/templates/diagrams/sequence.d2 +47 -0
- package/src/templates/docs/content-creation-guide.md +164 -0
- package/src/templates/docs/deployment-guide.md +336 -0
- package/src/templates/docs/visual-generation-guide.md +248 -0
- package/src/templates/docs/wordpress-publishing-guide.md +208 -0
- package/src/templates/infographics/comparison-table.html +347 -0
- package/src/templates/infographics/data-chart.html +268 -0
- package/src/templates/infographics/process-flow.html +365 -0
- /package/src/scripts/{wordpress-health-check.js → wordpress/wordpress-health-check.js} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sparc-coder
|
|
3
|
+
description: SPARC Pseudocode/Architecture phase - Implementation and coding
|
|
4
|
+
argument-hint: [spec-file] [--implement]
|
|
5
|
+
allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, Task]
|
|
6
|
+
user-invocable: true
|
|
7
|
+
category: development
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
platforms: [claude-code, gemini-cli, codex-cli]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SPARC Coder Skill
|
|
13
|
+
|
|
14
|
+
The Pseudocode and Architecture implementation phases of the SPARC methodology. Transform specifications into working code following established patterns.
|
|
15
|
+
|
|
16
|
+
## SPARC Methodology
|
|
17
|
+
|
|
18
|
+
**S**pecification → **P**seudocode → **A**rchitecture → **R**efinement → **C**ompletion
|
|
19
|
+
|
|
20
|
+
This skill handles the **Pseudocode (P)** and **Architecture (A)** phases, transforming designs into implementation.
|
|
21
|
+
|
|
22
|
+
## Capabilities
|
|
23
|
+
|
|
24
|
+
- Implement features from specifications
|
|
25
|
+
- Follow existing codebase patterns and conventions
|
|
26
|
+
- Generate clean, well-documented code
|
|
27
|
+
- Create necessary tests alongside implementation
|
|
28
|
+
- Handle error cases and edge conditions
|
|
29
|
+
- Integrate with existing systems
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
1. **Specification Review**
|
|
34
|
+
- Read and understand the technical specification
|
|
35
|
+
- Identify implementation requirements
|
|
36
|
+
- Map components to files/modules
|
|
37
|
+
|
|
38
|
+
2. **Pseudocode Planning**
|
|
39
|
+
- Create pseudocode for complex logic
|
|
40
|
+
- Plan function signatures and interfaces
|
|
41
|
+
- Identify shared utilities needed
|
|
42
|
+
|
|
43
|
+
3. **Implementation**
|
|
44
|
+
- Write code following project conventions
|
|
45
|
+
- Implement in logical, testable chunks
|
|
46
|
+
- Add appropriate comments and documentation
|
|
47
|
+
- Handle errors gracefully
|
|
48
|
+
|
|
49
|
+
4. **Self-Review**
|
|
50
|
+
- Check against specification
|
|
51
|
+
- Verify edge cases handled
|
|
52
|
+
- Ensure code is readable and maintainable
|
|
53
|
+
|
|
54
|
+
## Coding Standards
|
|
55
|
+
|
|
56
|
+
### General Principles
|
|
57
|
+
- Follow existing codebase conventions
|
|
58
|
+
- Prefer composition over inheritance
|
|
59
|
+
- Write self-documenting code
|
|
60
|
+
- Keep functions small and focused
|
|
61
|
+
- Handle errors at appropriate levels
|
|
62
|
+
|
|
63
|
+
### Documentation
|
|
64
|
+
- Add JSDoc/docstrings for public APIs
|
|
65
|
+
- Explain "why" not "what" in comments
|
|
66
|
+
- Document non-obvious decisions
|
|
67
|
+
|
|
68
|
+
### Error Handling
|
|
69
|
+
```javascript
|
|
70
|
+
// Good: Specific error handling
|
|
71
|
+
try {
|
|
72
|
+
await saveUser(user);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
if (error instanceof ValidationError) {
|
|
75
|
+
return { success: false, errors: error.details };
|
|
76
|
+
}
|
|
77
|
+
throw error; // Re-throw unexpected errors
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Parameters
|
|
82
|
+
|
|
83
|
+
| Parameter | Description | Default |
|
|
84
|
+
|-----------|-------------|---------|
|
|
85
|
+
| `spec-file` | Path to specification file | Required |
|
|
86
|
+
| `--implement` | Start implementation immediately | false |
|
|
87
|
+
| `--module` | Target module/directory | auto-detect |
|
|
88
|
+
| `--tests` | Generate tests alongside code | true |
|
|
89
|
+
| `--dry-run` | Show plan without writing code | false |
|
|
90
|
+
|
|
91
|
+
## Example Usage
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Implement from specification
|
|
95
|
+
/myaidev-method:coder "./specs/auth-feature.md" --implement
|
|
96
|
+
|
|
97
|
+
# Preview implementation plan
|
|
98
|
+
/myaidev-method:coder "./specs/payment-integration.md" --dry-run
|
|
99
|
+
|
|
100
|
+
# Implement specific module
|
|
101
|
+
/myaidev-method:coder "./specs/api-endpoints.md" --module=src/api
|
|
102
|
+
|
|
103
|
+
# Legacy command
|
|
104
|
+
/myai-dev-code "./specs/user-management.md"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Integration
|
|
108
|
+
|
|
109
|
+
- Receives input from `/myaidev-method:architect`
|
|
110
|
+
- Output reviewed by `/myaidev-method:reviewer`
|
|
111
|
+
- Tests validated by `/myaidev-method:tester`
|
|
112
|
+
- Part of `/myaidev-method:sparc` full workflow
|
|
113
|
+
|
|
114
|
+
## Output Structure
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
src/
|
|
118
|
+
├── [feature]/
|
|
119
|
+
│ ├── index.ts # Public API
|
|
120
|
+
│ ├── [component].ts # Implementation
|
|
121
|
+
│ ├── types.ts # TypeScript types
|
|
122
|
+
│ └── utils.ts # Utilities
|
|
123
|
+
tests/
|
|
124
|
+
└── [feature]/
|
|
125
|
+
├── [component].test.ts
|
|
126
|
+
└── integration.test.ts
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Best Practices
|
|
130
|
+
|
|
131
|
+
1. **Read Before Write**: Always understand existing patterns first
|
|
132
|
+
2. **Small Commits**: Make incremental, focused changes
|
|
133
|
+
3. **Test Coverage**: Write tests for new functionality
|
|
134
|
+
4. **Clean as You Go**: Don't leave TODO comments in committed code
|
|
135
|
+
5. **Error Messages**: Make errors helpful for debugging
|
|
136
|
+
6. **Security**: Never commit secrets or sensitive data
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sparc-documenter
|
|
3
|
+
description: SPARC Completion phase - Documentation generation and maintenance
|
|
4
|
+
argument-hint: [path] [--type=api]
|
|
5
|
+
allowed-tools: [Read, Write, Edit, Glob, Grep, Task]
|
|
6
|
+
user-invocable: true
|
|
7
|
+
category: development
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
platforms: [claude-code, gemini-cli, codex-cli]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SPARC Documenter Skill
|
|
13
|
+
|
|
14
|
+
The Completion phase of the SPARC methodology focused on documentation. Generate comprehensive documentation for code, APIs, and features.
|
|
15
|
+
|
|
16
|
+
## SPARC Methodology
|
|
17
|
+
|
|
18
|
+
**S**pecification → **P**seudocode → **A**rchitecture → **R**efinement → **C**ompletion
|
|
19
|
+
|
|
20
|
+
This skill handles the **Completion (C)** phase, ensuring proper documentation.
|
|
21
|
+
|
|
22
|
+
## Capabilities
|
|
23
|
+
|
|
24
|
+
- Generate API documentation
|
|
25
|
+
- Create README files
|
|
26
|
+
- Document code with JSDoc/docstrings
|
|
27
|
+
- Generate architecture documentation
|
|
28
|
+
- Create user guides and tutorials
|
|
29
|
+
- Update changelog entries
|
|
30
|
+
- Generate TypeScript declarations
|
|
31
|
+
|
|
32
|
+
## Documentation Types
|
|
33
|
+
|
|
34
|
+
| Type | Output | Use Case |
|
|
35
|
+
|------|--------|----------|
|
|
36
|
+
| `api` | API reference | HTTP endpoints, SDK methods |
|
|
37
|
+
| `code` | JSDoc/docstrings | Functions, classes, modules |
|
|
38
|
+
| `readme` | README.md | Project overview |
|
|
39
|
+
| `architecture` | Architecture docs | System design |
|
|
40
|
+
| `guide` | User guide | How-to documentation |
|
|
41
|
+
| `changelog` | CHANGELOG.md | Version history |
|
|
42
|
+
| `types` | TypeScript .d.ts | Type definitions |
|
|
43
|
+
|
|
44
|
+
## Process
|
|
45
|
+
|
|
46
|
+
1. **Code Analysis**
|
|
47
|
+
- Parse source files
|
|
48
|
+
- Extract function signatures
|
|
49
|
+
- Identify public APIs
|
|
50
|
+
- Understand code purpose
|
|
51
|
+
|
|
52
|
+
2. **Documentation Generation**
|
|
53
|
+
- Generate appropriate doc format
|
|
54
|
+
- Add usage examples
|
|
55
|
+
- Include parameter descriptions
|
|
56
|
+
- Document return values and errors
|
|
57
|
+
|
|
58
|
+
3. **Quality Check**
|
|
59
|
+
- Verify completeness
|
|
60
|
+
- Check for accuracy
|
|
61
|
+
- Ensure consistency
|
|
62
|
+
|
|
63
|
+
4. **Integration**
|
|
64
|
+
- Update existing docs
|
|
65
|
+
- Add to documentation site
|
|
66
|
+
- Update README links
|
|
67
|
+
|
|
68
|
+
## API Documentation Template
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
# API Reference
|
|
72
|
+
|
|
73
|
+
## Overview
|
|
74
|
+
[Brief description of the API]
|
|
75
|
+
|
|
76
|
+
## Authentication
|
|
77
|
+
[Auth requirements and examples]
|
|
78
|
+
|
|
79
|
+
## Endpoints
|
|
80
|
+
|
|
81
|
+
### `POST /api/resource`
|
|
82
|
+
Create a new resource.
|
|
83
|
+
|
|
84
|
+
**Request Body:**
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "string",
|
|
88
|
+
"value": "number"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Response:**
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"id": "string",
|
|
96
|
+
"name": "string",
|
|
97
|
+
"createdAt": "ISO8601"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Errors:**
|
|
102
|
+
| Code | Description |
|
|
103
|
+
|------|-------------|
|
|
104
|
+
| 400 | Invalid request body |
|
|
105
|
+
| 401 | Unauthorized |
|
|
106
|
+
| 409 | Resource already exists |
|
|
107
|
+
|
|
108
|
+
**Example:**
|
|
109
|
+
```bash
|
|
110
|
+
curl -X POST https://api.example.com/resource \
|
|
111
|
+
-H "Authorization: Bearer TOKEN" \
|
|
112
|
+
-d '{"name": "test"}'
|
|
113
|
+
```
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## JSDoc Template
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
/**
|
|
120
|
+
* Process user data and return formatted result.
|
|
121
|
+
*
|
|
122
|
+
* @param {Object} user - The user object to process
|
|
123
|
+
* @param {string} user.id - Unique user identifier
|
|
124
|
+
* @param {string} user.name - User's display name
|
|
125
|
+
* @param {Object} [options] - Optional processing options
|
|
126
|
+
* @param {boolean} [options.includeMetadata=false] - Include metadata
|
|
127
|
+
* @returns {Promise<ProcessedUser>} Processed user data
|
|
128
|
+
* @throws {ValidationError} If user data is invalid
|
|
129
|
+
* @example
|
|
130
|
+
* const processed = await processUser({ id: '123', name: 'John' });
|
|
131
|
+
*/
|
|
132
|
+
async function processUser(user, options = {}) {
|
|
133
|
+
// Implementation
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Parameters
|
|
138
|
+
|
|
139
|
+
| Parameter | Description | Default |
|
|
140
|
+
|-----------|-------------|---------|
|
|
141
|
+
| `path` | File or directory to document | Required |
|
|
142
|
+
| `--type` | Documentation type | api |
|
|
143
|
+
| `--output` | Output directory | ./docs |
|
|
144
|
+
| `--format` | markdown, html, json | markdown |
|
|
145
|
+
| `--update` | Update existing docs | false |
|
|
146
|
+
|
|
147
|
+
## Example Usage
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Generate API documentation
|
|
151
|
+
/myaidev-method:documenter ./src/api --type=api
|
|
152
|
+
|
|
153
|
+
# Add JSDoc to code
|
|
154
|
+
/myaidev-method:documenter ./src/utils --type=code
|
|
155
|
+
|
|
156
|
+
# Generate README
|
|
157
|
+
/myaidev-method:documenter ./ --type=readme
|
|
158
|
+
|
|
159
|
+
# Update changelog
|
|
160
|
+
/myaidev-method:documenter --type=changelog --update
|
|
161
|
+
|
|
162
|
+
# Legacy command
|
|
163
|
+
/myai-dev-docs ./src
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Integration
|
|
167
|
+
|
|
168
|
+
- Documents code from `/myaidev-method:coder`
|
|
169
|
+
- Uses review insights from `/myaidev-method:reviewer`
|
|
170
|
+
- Final phase of `/myaidev-method:sparc` workflow
|
|
171
|
+
|
|
172
|
+
## Output Structure
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
docs/
|
|
176
|
+
├── README.md # Project overview
|
|
177
|
+
├── API.md # API reference
|
|
178
|
+
├── ARCHITECTURE.md # System design
|
|
179
|
+
├── CHANGELOG.md # Version history
|
|
180
|
+
├── guides/
|
|
181
|
+
│ ├── getting-started.md
|
|
182
|
+
│ └── advanced-usage.md
|
|
183
|
+
└── api/
|
|
184
|
+
├── endpoints.md
|
|
185
|
+
└── types.md
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Best Practices
|
|
189
|
+
|
|
190
|
+
1. **Write for the Reader**: Consider who will read the docs
|
|
191
|
+
2. **Include Examples**: Code examples clarify usage
|
|
192
|
+
3. **Keep Updated**: Stale docs are worse than none
|
|
193
|
+
4. **Be Concise**: Brevity is valuable
|
|
194
|
+
5. **Link Related Content**: Help readers navigate
|
|
195
|
+
6. **Version Docs**: Match docs to code versions
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sparc-reviewer
|
|
3
|
+
description: SPARC Refinement phase - Code review and quality assessment
|
|
4
|
+
argument-hint: [path] [--focus=security]
|
|
5
|
+
allowed-tools: [Read, Glob, Grep, Task, WebSearch]
|
|
6
|
+
user-invocable: true
|
|
7
|
+
category: development
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
platforms: [claude-code, gemini-cli, codex-cli]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SPARC Reviewer Skill
|
|
13
|
+
|
|
14
|
+
The Refinement phase of the SPARC methodology focused on code review. Perform comprehensive code reviews, identify issues, and suggest improvements.
|
|
15
|
+
|
|
16
|
+
## SPARC Methodology
|
|
17
|
+
|
|
18
|
+
**S**pecification → **P**seudocode → **A**rchitecture → **R**efinement → **C**ompletion
|
|
19
|
+
|
|
20
|
+
This skill handles the **Refinement (R)** phase, ensuring code quality through review.
|
|
21
|
+
|
|
22
|
+
## Capabilities
|
|
23
|
+
|
|
24
|
+
- Code quality assessment
|
|
25
|
+
- Security vulnerability detection
|
|
26
|
+
- Performance issue identification
|
|
27
|
+
- Best practice verification
|
|
28
|
+
- Style and convention checking
|
|
29
|
+
- Documentation completeness review
|
|
30
|
+
- Dependency audit
|
|
31
|
+
|
|
32
|
+
## Review Categories
|
|
33
|
+
|
|
34
|
+
| Category | Focus Areas |
|
|
35
|
+
|----------|-------------|
|
|
36
|
+
| **Quality** | Readability, maintainability, complexity |
|
|
37
|
+
| **Security** | Vulnerabilities, input validation, secrets |
|
|
38
|
+
| **Performance** | Efficiency, memory usage, async patterns |
|
|
39
|
+
| **Architecture** | Design patterns, SOLID principles, coupling |
|
|
40
|
+
| **Testing** | Coverage, test quality, edge cases |
|
|
41
|
+
| **Documentation** | Comments, README, API docs |
|
|
42
|
+
|
|
43
|
+
## Process
|
|
44
|
+
|
|
45
|
+
1. **Code Analysis**
|
|
46
|
+
- Read and understand the code
|
|
47
|
+
- Identify the purpose and context
|
|
48
|
+
- Note patterns and anti-patterns
|
|
49
|
+
|
|
50
|
+
2. **Issue Detection**
|
|
51
|
+
- Check for bugs and logic errors
|
|
52
|
+
- Identify security vulnerabilities
|
|
53
|
+
- Find performance bottlenecks
|
|
54
|
+
- Note code smells
|
|
55
|
+
|
|
56
|
+
3. **Improvement Suggestions**
|
|
57
|
+
- Recommend refactoring opportunities
|
|
58
|
+
- Suggest better patterns
|
|
59
|
+
- Propose documentation additions
|
|
60
|
+
|
|
61
|
+
4. **Report Generation**
|
|
62
|
+
- Categorize findings by severity
|
|
63
|
+
- Provide actionable recommendations
|
|
64
|
+
- Highlight positive aspects
|
|
65
|
+
|
|
66
|
+
## Review Output Format
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
# Code Review: [File/Feature Name]
|
|
70
|
+
|
|
71
|
+
## Summary
|
|
72
|
+
- **Files Reviewed**: X
|
|
73
|
+
- **Critical Issues**: X
|
|
74
|
+
- **Warnings**: X
|
|
75
|
+
- **Suggestions**: X
|
|
76
|
+
- **Overall Score**: X/10
|
|
77
|
+
|
|
78
|
+
## Critical Issues 🔴
|
|
79
|
+
### [Issue Title]
|
|
80
|
+
- **Location**: `file.ts:123`
|
|
81
|
+
- **Description**: [What's wrong]
|
|
82
|
+
- **Impact**: [Why it matters]
|
|
83
|
+
- **Suggestion**: [How to fix]
|
|
84
|
+
|
|
85
|
+
## Warnings 🟡
|
|
86
|
+
### [Warning Title]
|
|
87
|
+
- **Location**: `file.ts:45`
|
|
88
|
+
- **Description**: [The concern]
|
|
89
|
+
- **Suggestion**: [Improvement]
|
|
90
|
+
|
|
91
|
+
## Suggestions 🟢
|
|
92
|
+
### [Suggestion Title]
|
|
93
|
+
- **Description**: [What could be better]
|
|
94
|
+
- **Benefit**: [Why it helps]
|
|
95
|
+
|
|
96
|
+
## Positive Highlights ✨
|
|
97
|
+
- [Good practice observed]
|
|
98
|
+
- [Well-written code example]
|
|
99
|
+
|
|
100
|
+
## Recommendations
|
|
101
|
+
1. [Priority action 1]
|
|
102
|
+
2. [Priority action 2]
|
|
103
|
+
3. [Priority action 3]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Severity Levels
|
|
107
|
+
|
|
108
|
+
| Level | Icon | Criteria |
|
|
109
|
+
|-------|------|----------|
|
|
110
|
+
| Critical | 🔴 | Security vulnerabilities, data loss, crashes |
|
|
111
|
+
| Warning | 🟡 | Bugs, performance issues, bad practices |
|
|
112
|
+
| Suggestion | 🟢 | Improvements, refactoring, style |
|
|
113
|
+
| Info | 🔵 | Notes, alternatives, best practices |
|
|
114
|
+
|
|
115
|
+
## Parameters
|
|
116
|
+
|
|
117
|
+
| Parameter | Description | Default |
|
|
118
|
+
|-----------|-------------|---------|
|
|
119
|
+
| `path` | File or directory to review | Required |
|
|
120
|
+
| `--focus` | security, performance, quality, all | all |
|
|
121
|
+
| `--severity` | Filter by minimum severity | suggestion |
|
|
122
|
+
| `--output` | Output format: markdown, json | markdown |
|
|
123
|
+
| `--pr` | Review as PR (GitHub integration) | false |
|
|
124
|
+
|
|
125
|
+
## Example Usage
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Full code review
|
|
129
|
+
/myaidev-method:reviewer ./src/auth
|
|
130
|
+
|
|
131
|
+
# Security-focused review
|
|
132
|
+
/myaidev-method:reviewer ./src/api --focus=security
|
|
133
|
+
|
|
134
|
+
# Performance review
|
|
135
|
+
/myaidev-method:reviewer ./src/utils --focus=performance
|
|
136
|
+
|
|
137
|
+
# Review a specific file
|
|
138
|
+
/myaidev-method:reviewer ./src/auth/login.ts
|
|
139
|
+
|
|
140
|
+
# Legacy command
|
|
141
|
+
/myai-dev-review ./src
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Integration
|
|
145
|
+
|
|
146
|
+
- Reviews code from `/myaidev-method:coder`
|
|
147
|
+
- Validates test coverage from `/myaidev-method:tester`
|
|
148
|
+
- Part of `/myaidev-method:sparc` full workflow
|
|
149
|
+
|
|
150
|
+
## Common Issues Detected
|
|
151
|
+
|
|
152
|
+
### Security
|
|
153
|
+
- Hardcoded secrets
|
|
154
|
+
- SQL injection vulnerabilities
|
|
155
|
+
- XSS vulnerabilities
|
|
156
|
+
- Insecure dependencies
|
|
157
|
+
- Missing input validation
|
|
158
|
+
|
|
159
|
+
### Performance
|
|
160
|
+
- N+1 queries
|
|
161
|
+
- Unnecessary re-renders
|
|
162
|
+
- Memory leaks
|
|
163
|
+
- Inefficient algorithms
|
|
164
|
+
- Missing caching
|
|
165
|
+
|
|
166
|
+
### Quality
|
|
167
|
+
- Complex functions (high cyclomatic complexity)
|
|
168
|
+
- Duplicate code
|
|
169
|
+
- Inconsistent naming
|
|
170
|
+
- Missing error handling
|
|
171
|
+
- Poor separation of concerns
|
|
172
|
+
|
|
173
|
+
## Best Practices
|
|
174
|
+
|
|
175
|
+
1. **Be Constructive**: Focus on improvement, not criticism
|
|
176
|
+
2. **Explain Why**: Context helps more than just "fix this"
|
|
177
|
+
3. **Prioritize**: Focus on impactful issues first
|
|
178
|
+
4. **Acknowledge Good Code**: Positive feedback matters
|
|
179
|
+
5. **Be Specific**: Vague feedback is unhelpful
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sparc-tester
|
|
3
|
+
description: SPARC Refinement phase - Testing and quality assurance
|
|
4
|
+
argument-hint: [path] [--coverage] [--type=unit]
|
|
5
|
+
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task]
|
|
6
|
+
user-invocable: true
|
|
7
|
+
category: development
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
platforms: [claude-code, gemini-cli, codex-cli]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SPARC Tester Skill
|
|
13
|
+
|
|
14
|
+
The Refinement phase of the SPARC methodology focused on testing. Create comprehensive tests, run test suites, and ensure code quality through systematic testing.
|
|
15
|
+
|
|
16
|
+
## SPARC Methodology
|
|
17
|
+
|
|
18
|
+
**S**pecification → **P**seudocode → **A**rchitecture → **R**efinement → **C**ompletion
|
|
19
|
+
|
|
20
|
+
This skill handles the **Refinement (R)** phase, ensuring code quality through testing.
|
|
21
|
+
|
|
22
|
+
## Capabilities
|
|
23
|
+
|
|
24
|
+
- Generate unit tests for components
|
|
25
|
+
- Create integration tests for workflows
|
|
26
|
+
- Run existing test suites
|
|
27
|
+
- Analyze code coverage
|
|
28
|
+
- Identify untested code paths
|
|
29
|
+
- Generate test fixtures and mocks
|
|
30
|
+
- Validate against specifications
|
|
31
|
+
|
|
32
|
+
## Test Types
|
|
33
|
+
|
|
34
|
+
| Type | Scope | Tools |
|
|
35
|
+
|------|-------|-------|
|
|
36
|
+
| Unit | Single function/component | Jest, Vitest, Mocha |
|
|
37
|
+
| Integration | Multiple components | Jest, Playwright |
|
|
38
|
+
| E2E | Full user flow | Playwright, Cypress |
|
|
39
|
+
| API | HTTP endpoints | Supertest, REST Client |
|
|
40
|
+
| Performance | Load/stress | Artillery, k6 |
|
|
41
|
+
|
|
42
|
+
## Process
|
|
43
|
+
|
|
44
|
+
1. **Analysis**
|
|
45
|
+
- Identify testable units
|
|
46
|
+
- Map code paths to test cases
|
|
47
|
+
- Check existing coverage
|
|
48
|
+
|
|
49
|
+
2. **Test Generation**
|
|
50
|
+
- Write test cases for happy paths
|
|
51
|
+
- Add edge case tests
|
|
52
|
+
- Create error scenario tests
|
|
53
|
+
- Generate fixtures/mocks
|
|
54
|
+
|
|
55
|
+
3. **Execution**
|
|
56
|
+
- Run test suites
|
|
57
|
+
- Collect coverage data
|
|
58
|
+
- Report failures
|
|
59
|
+
|
|
60
|
+
4. **Validation**
|
|
61
|
+
- Verify against specifications
|
|
62
|
+
- Check coverage thresholds
|
|
63
|
+
- Document test gaps
|
|
64
|
+
|
|
65
|
+
## Test Template
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
69
|
+
import { functionUnderTest } from './module';
|
|
70
|
+
|
|
71
|
+
describe('functionUnderTest', () => {
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
// Setup
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe('happy path', () => {
|
|
77
|
+
it('should handle valid input correctly', () => {
|
|
78
|
+
const result = functionUnderTest(validInput);
|
|
79
|
+
expect(result).toEqual(expectedOutput);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe('edge cases', () => {
|
|
84
|
+
it('should handle empty input', () => {
|
|
85
|
+
expect(() => functionUnderTest('')).toThrow();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should handle boundary values', () => {
|
|
89
|
+
// Test boundary conditions
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('error handling', () => {
|
|
94
|
+
it('should throw on invalid input', () => {
|
|
95
|
+
expect(() => functionUnderTest(null)).toThrow(TypeError);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Parameters
|
|
102
|
+
|
|
103
|
+
| Parameter | Description | Default |
|
|
104
|
+
|-----------|-------------|---------|
|
|
105
|
+
| `path` | File or directory to test | ./src |
|
|
106
|
+
| `--type` | unit, integration, e2e, all | unit |
|
|
107
|
+
| `--coverage` | Generate coverage report | false |
|
|
108
|
+
| `--watch` | Run in watch mode | false |
|
|
109
|
+
| `--update-snapshots` | Update snapshot tests | false |
|
|
110
|
+
| `--generate` | Generate missing tests | false |
|
|
111
|
+
|
|
112
|
+
## Example Usage
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Run all tests
|
|
116
|
+
/myaidev-method:tester --type=all
|
|
117
|
+
|
|
118
|
+
# Generate tests for a module
|
|
119
|
+
/myaidev-method:tester ./src/auth --generate
|
|
120
|
+
|
|
121
|
+
# Run with coverage
|
|
122
|
+
/myaidev-method:tester ./src --coverage
|
|
123
|
+
|
|
124
|
+
# Integration tests only
|
|
125
|
+
/myaidev-method:tester --type=integration
|
|
126
|
+
|
|
127
|
+
# Legacy command
|
|
128
|
+
/myai-dev-test ./src/api
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Coverage Thresholds
|
|
132
|
+
|
|
133
|
+
Default thresholds for quality gates:
|
|
134
|
+
|
|
135
|
+
| Metric | Minimum |
|
|
136
|
+
|--------|---------|
|
|
137
|
+
| Statements | 80% |
|
|
138
|
+
| Branches | 75% |
|
|
139
|
+
| Functions | 80% |
|
|
140
|
+
| Lines | 80% |
|
|
141
|
+
|
|
142
|
+
## Integration
|
|
143
|
+
|
|
144
|
+
- Tests code from `/myaidev-method:coder`
|
|
145
|
+
- Results feed into `/myaidev-method:reviewer`
|
|
146
|
+
- Part of `/myaidev-method:sparc` full workflow
|
|
147
|
+
|
|
148
|
+
## Best Practices
|
|
149
|
+
|
|
150
|
+
1. **Test Behavior, Not Implementation**: Focus on what code does, not how
|
|
151
|
+
2. **One Assertion Per Test**: Keep tests focused and clear
|
|
152
|
+
3. **Arrange-Act-Assert**: Structure tests consistently
|
|
153
|
+
4. **Descriptive Names**: Test names should describe expected behavior
|
|
154
|
+
5. **Isolated Tests**: Tests shouldn't depend on each other
|
|
155
|
+
6. **Fast Tests**: Unit tests should run in milliseconds
|
|
156
|
+
7. **Realistic Fixtures**: Use production-like test data
|