claude-code-workflow 6.3.22 → 6.3.24
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/agents/issue-plan-agent.md +10 -5
- package/.claude/commands/issue/plan.md +1 -1
- package/.claude/skills/review-code/SKILL.md +170 -0
- package/.claude/skills/review-code/phases/actions/action-collect-context.md +139 -0
- package/.claude/skills/review-code/phases/actions/action-complete.md +115 -0
- package/.claude/skills/review-code/phases/actions/action-deep-review.md +302 -0
- package/.claude/skills/review-code/phases/actions/action-generate-report.md +263 -0
- package/.claude/skills/review-code/phases/actions/action-quick-scan.md +164 -0
- package/.claude/skills/review-code/phases/orchestrator.md +251 -0
- package/.claude/skills/review-code/phases/state-manager.md +752 -0
- package/.claude/skills/review-code/phases/state-schema.md +174 -0
- package/.claude/skills/review-code/specs/issue-classification.md +228 -0
- package/.claude/skills/review-code/specs/quality-standards.md +214 -0
- package/.claude/skills/review-code/specs/review-dimensions.md +337 -0
- package/.claude/skills/review-code/specs/rules/architecture-rules.json +63 -0
- package/.claude/skills/review-code/specs/rules/correctness-rules.json +60 -0
- package/.claude/skills/review-code/specs/rules/index.md +140 -0
- package/.claude/skills/review-code/specs/rules/performance-rules.json +59 -0
- package/.claude/skills/review-code/specs/rules/readability-rules.json +60 -0
- package/.claude/skills/review-code/specs/rules/security-rules.json +58 -0
- package/.claude/skills/review-code/specs/rules/testing-rules.json +59 -0
- package/.claude/skills/review-code/templates/issue-template.md +186 -0
- package/.claude/skills/review-code/templates/review-report.md +173 -0
- package/.claude/skills/skill-generator/SKILL.md +56 -17
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +10 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +9 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +84 -5
- package/.claude/workflows/cli-templates/schemas/solution-schema.json +3 -3
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +8 -0
- package/package.json +1 -1
- package/.claude/skills/code-reviewer/README.md +0 -340
- package/.claude/skills/code-reviewer/SKILL.md +0 -308
- package/.claude/skills/code-reviewer/phases/01-code-discovery.md +0 -246
- package/.claude/skills/code-reviewer/phases/02-security-analysis.md +0 -442
- package/.claude/skills/code-reviewer/phases/03-best-practices-review.md +0 -36
- package/.claude/skills/code-reviewer/phases/04-report-generation.md +0 -278
- package/.claude/skills/code-reviewer/specs/best-practices-requirements.md +0 -346
- package/.claude/skills/code-reviewer/specs/quality-standards.md +0 -252
- package/.claude/skills/code-reviewer/specs/security-requirements.md +0 -243
- package/.claude/skills/code-reviewer/templates/best-practice-finding.md +0 -234
- package/.claude/skills/code-reviewer/templates/report-template.md +0 -316
- package/.claude/skills/code-reviewer/templates/security-finding.md +0 -161
|
@@ -36,6 +36,16 @@ allowed-tools: {{allowed_tools}}
|
|
|
36
36
|
|
|
37
37
|
{{design_principles}}
|
|
38
38
|
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
|
42
|
+
|
|
43
|
+
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。未阅读规范直接执行将导致输出不符合质量标准。
|
|
44
|
+
|
|
45
|
+
{{mandatory_prerequisites}}
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
39
49
|
## Execution Flow
|
|
40
50
|
|
|
41
51
|
{{execution_flow}}
|
|
@@ -71,9 +81,10 @@ Bash(\`mkdir -p "\${workDir}"\`);
|
|
|
71
81
|
| `{{description}}` | string | config.description |
|
|
72
82
|
| `{{triggers}}` | string | config.triggers.join(", ") |
|
|
73
83
|
| `{{allowed_tools}}` | string | config.allowed_tools.join(", ") |
|
|
74
|
-
| `{{architecture_diagram}}` | string | 根据 execution_mode 生成 |
|
|
84
|
+
| `{{architecture_diagram}}` | string | 根据 execution_mode 生成 (包含 Phase 0) |
|
|
75
85
|
| `{{design_principles}}` | string | 根据 execution_mode 生成 |
|
|
76
|
-
| `{{
|
|
86
|
+
| `{{mandatory_prerequisites}}` | string | 强制前置阅读文档列表 (specs + templates) |
|
|
87
|
+
| `{{execution_flow}}` | string | 根据 phases/actions 生成 (Phase 0 在最前) |
|
|
77
88
|
| `{{output_location}}` | string | config.output.location |
|
|
78
89
|
| `{{additional_dirs}}` | string | 根据 execution_mode 生成 |
|
|
79
90
|
| `{{output_structure}}` | string | 根据配置生成 |
|
|
@@ -84,21 +95,48 @@ Bash(\`mkdir -p "\${workDir}"\`);
|
|
|
84
95
|
```javascript
|
|
85
96
|
function generateSkillMd(config) {
|
|
86
97
|
const template = Read('templates/skill-md.md');
|
|
87
|
-
|
|
98
|
+
|
|
88
99
|
return template
|
|
89
100
|
.replace(/\{\{skill_name\}\}/g, config.skill_name)
|
|
90
101
|
.replace(/\{\{display_name\}\}/g, config.display_name)
|
|
91
102
|
.replace(/\{\{description\}\}/g, config.description)
|
|
92
103
|
.replace(/\{\{triggers\}\}/g, config.triggers.map(t => `"${t}"`).join(", "))
|
|
93
104
|
.replace(/\{\{allowed_tools\}\}/g, config.allowed_tools.join(", "))
|
|
94
|
-
.replace(/\{\{architecture_diagram\}\}/g, generateArchitecture(config))
|
|
105
|
+
.replace(/\{\{architecture_diagram\}\}/g, generateArchitecture(config)) // 包含 Phase 0
|
|
95
106
|
.replace(/\{\{design_principles\}\}/g, generatePrinciples(config))
|
|
96
|
-
.replace(/\{\{
|
|
107
|
+
.replace(/\{\{mandatory_prerequisites\}\}/g, generatePrerequisites(config)) // 强制前置条件
|
|
108
|
+
.replace(/\{\{execution_flow\}\}/g, generateFlow(config)) // Phase 0 在最前
|
|
97
109
|
.replace(/\{\{output_location\}\}/g, config.output.location)
|
|
98
110
|
.replace(/\{\{additional_dirs\}\}/g, generateAdditionalDirs(config))
|
|
99
111
|
.replace(/\{\{output_structure\}\}/g, generateOutputStructure(config))
|
|
100
112
|
.replace(/\{\{reference_table\}\}/g, generateReferenceTable(config));
|
|
101
113
|
}
|
|
114
|
+
|
|
115
|
+
// 生成强制前置条件表格
|
|
116
|
+
function generatePrerequisites(config) {
|
|
117
|
+
const specs = config.specs || [];
|
|
118
|
+
const templates = config.templates || [];
|
|
119
|
+
|
|
120
|
+
let result = '### 规范文档 (必读)\n\n';
|
|
121
|
+
result += '| Document | Purpose | Priority |\n';
|
|
122
|
+
result += '|----------|---------|----------|\n';
|
|
123
|
+
|
|
124
|
+
specs.forEach((spec, index) => {
|
|
125
|
+
const priority = index === 0 ? '**P0 - 最高**' : 'P1';
|
|
126
|
+
result += `| [${spec.path}](${spec.path}) | ${spec.purpose} | ${priority} |\n`;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
if (templates.length > 0) {
|
|
130
|
+
result += '\n### 模板文件 (生成前必读)\n\n';
|
|
131
|
+
result += '| Document | Purpose |\n';
|
|
132
|
+
result += '|----------|---------|\n';
|
|
133
|
+
templates.forEach(tmpl => {
|
|
134
|
+
result += `| [${tmpl.path}](${tmpl.path}) | ${tmpl.purpose} |\n`;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
102
140
|
```
|
|
103
141
|
|
|
104
142
|
## Sequential 模式示例
|
|
@@ -118,6 +156,9 @@ Generate API documentation from source code.
|
|
|
118
156
|
|
|
119
157
|
\`\`\`
|
|
120
158
|
┌─────────────────────────────────────────────────────────────────┐
|
|
159
|
+
│ ⚠️ Phase 0: Specification → 阅读并理解设计规范 (强制前置) │
|
|
160
|
+
│ Study │
|
|
161
|
+
│ ↓ │
|
|
121
162
|
│ Phase 1: Scanning → endpoints.json │
|
|
122
163
|
│ ↓ │
|
|
123
164
|
│ Phase 2: Parsing → schemas.json │
|
|
@@ -125,6 +166,22 @@ Generate API documentation from source code.
|
|
|
125
166
|
│ Phase 3: Generation → api-docs.md │
|
|
126
167
|
└─────────────────────────────────────────────────────────────────┘
|
|
127
168
|
\`\`\`
|
|
169
|
+
|
|
170
|
+
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
|
171
|
+
|
|
172
|
+
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。
|
|
173
|
+
|
|
174
|
+
### 规范文档 (必读)
|
|
175
|
+
|
|
176
|
+
| Document | Purpose | Priority |
|
|
177
|
+
|----------|---------|----------|
|
|
178
|
+
| [specs/api-standards.md](specs/api-standards.md) | API 文档标准规范 | **P0 - 最高** |
|
|
179
|
+
|
|
180
|
+
### 模板文件 (生成前必读)
|
|
181
|
+
|
|
182
|
+
| Document | Purpose |
|
|
183
|
+
|----------|---------|
|
|
184
|
+
| [templates/endpoint-doc.md](templates/endpoint-doc.md) | 端点文档模板 |
|
|
128
185
|
```
|
|
129
186
|
|
|
130
187
|
## Autonomous 模式示例
|
|
@@ -144,6 +201,10 @@ Interactive task management with CRUD operations.
|
|
|
144
201
|
|
|
145
202
|
\`\`\`
|
|
146
203
|
┌─────────────────────────────────────────────────────────────────┐
|
|
204
|
+
│ ⚠️ Phase 0: Specification Study (强制前置) │
|
|
205
|
+
└───────────────┬─────────────────────────────────────────────────┘
|
|
206
|
+
↓
|
|
207
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
147
208
|
│ Orchestrator (状态驱动决策) │
|
|
148
209
|
└───────────────┬─────────────────────────────────────────────────┘
|
|
149
210
|
│
|
|
@@ -153,4 +214,22 @@ Interactive task management with CRUD operations.
|
|
|
153
214
|
│ List │ │Create │ │ Edit │ │Delete │
|
|
154
215
|
└───────┘ └───────┘ └───────┘ └───────┘
|
|
155
216
|
\`\`\`
|
|
217
|
+
|
|
218
|
+
## ⚠️ Mandatory Prerequisites (强制前置条件)
|
|
219
|
+
|
|
220
|
+
> **⛔ 禁止跳过**: 在执行任何操作之前,**必须**完整阅读以下文档。
|
|
221
|
+
|
|
222
|
+
### 规范文档 (必读)
|
|
223
|
+
|
|
224
|
+
| Document | Purpose | Priority |
|
|
225
|
+
|----------|---------|----------|
|
|
226
|
+
| [specs/task-schema.md](specs/task-schema.md) | 任务数据结构规范 | **P0 - 最高** |
|
|
227
|
+
| [specs/action-catalog.md](specs/action-catalog.md) | 动作目录 | P1 |
|
|
228
|
+
|
|
229
|
+
### 模板文件 (生成前必读)
|
|
230
|
+
|
|
231
|
+
| Document | Purpose |
|
|
232
|
+
|----------|---------|
|
|
233
|
+
| [templates/orchestrator-base.md](templates/orchestrator-base.md) | 编排器模板 |
|
|
234
|
+
| [templates/action-base.md](templates/action-base.md) | 动作模板 |
|
|
156
235
|
```
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"properties": {
|
|
8
8
|
"id": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "Unique solution identifier: SOL-{issue-id}-{
|
|
11
|
-
"pattern": "^SOL-.+-[
|
|
12
|
-
"examples": ["SOL-GH-123-
|
|
10
|
+
"description": "Unique solution identifier: SOL-{issue-id}-{4-char-uid} where uid is 4 alphanumeric chars",
|
|
11
|
+
"pattern": "^SOL-.+-[a-z0-9]{4}$",
|
|
12
|
+
"examples": ["SOL-GH-123-a7x9", "SOL-ISS-20251229-001-b2k4"]
|
|
13
13
|
},
|
|
14
14
|
"description": {
|
|
15
15
|
"type": "string",
|
|
@@ -338,6 +338,14 @@ function renderIssueCard(issue) {
|
|
|
338
338
|
${t('issues.boundSolution') || 'Bound'}
|
|
339
339
|
</span>
|
|
340
340
|
` : ''}
|
|
341
|
+
${issue.github_url ? `
|
|
342
|
+
<a href="${issue.github_url}" target="_blank" rel="noopener noreferrer"
|
|
343
|
+
class="flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors"
|
|
344
|
+
onclick="event.stopPropagation()" title="View on GitHub">
|
|
345
|
+
<i data-lucide="github" class="w-3.5 h-3.5"></i>
|
|
346
|
+
${issue.github_number ? `#${issue.github_number}` : 'GitHub'}
|
|
347
|
+
</a>
|
|
348
|
+
` : ''}
|
|
341
349
|
</div>
|
|
342
350
|
</div>
|
|
343
351
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-workflow",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.24",
|
|
4
4
|
"description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "ccw/src/index.js",
|
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
# Code Reviewer Skill
|
|
2
|
-
|
|
3
|
-
A comprehensive code review skill for identifying security vulnerabilities and best practices violations.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The **code-reviewer** skill provides automated code review capabilities covering:
|
|
8
|
-
- **Security Analysis**: OWASP Top 10, CWE Top 25, language-specific vulnerabilities
|
|
9
|
-
- **Code Quality**: Naming conventions, complexity, duplication, dead code
|
|
10
|
-
- **Performance**: N+1 queries, inefficient algorithms, memory leaks
|
|
11
|
-
- **Maintainability**: Documentation, test coverage, dependency health
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
|
-
### Basic Usage
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Review entire codebase
|
|
19
|
-
/code-reviewer
|
|
20
|
-
|
|
21
|
-
# Review specific directory
|
|
22
|
-
/code-reviewer --scope src/auth
|
|
23
|
-
|
|
24
|
-
# Focus on security only
|
|
25
|
-
/code-reviewer --focus security
|
|
26
|
-
|
|
27
|
-
# Focus on best practices only
|
|
28
|
-
/code-reviewer --focus best-practices
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Advanced Options
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Review with custom severity threshold
|
|
35
|
-
/code-reviewer --severity critical,high
|
|
36
|
-
|
|
37
|
-
# Review specific file types
|
|
38
|
-
/code-reviewer --languages typescript,python
|
|
39
|
-
|
|
40
|
-
# Generate detailed report
|
|
41
|
-
/code-reviewer --report-level detailed
|
|
42
|
-
|
|
43
|
-
# Resume from previous session
|
|
44
|
-
/code-reviewer --resume
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
|
|
49
|
-
### Security Analysis
|
|
50
|
-
|
|
51
|
-
✅ **OWASP Top 10 2021 Coverage**
|
|
52
|
-
- Injection vulnerabilities (SQL, Command, XSS)
|
|
53
|
-
- Authentication & authorization flaws
|
|
54
|
-
- Sensitive data exposure
|
|
55
|
-
- Security misconfiguration
|
|
56
|
-
- And more...
|
|
57
|
-
|
|
58
|
-
✅ **CWE Top 25 Coverage**
|
|
59
|
-
- Cross-site scripting (CWE-79)
|
|
60
|
-
- SQL injection (CWE-89)
|
|
61
|
-
- Command injection (CWE-78)
|
|
62
|
-
- Input validation (CWE-20)
|
|
63
|
-
- And more...
|
|
64
|
-
|
|
65
|
-
✅ **Language-Specific Checks**
|
|
66
|
-
- JavaScript/TypeScript: prototype pollution, eval usage
|
|
67
|
-
- Python: pickle vulnerabilities, command injection
|
|
68
|
-
- Java: deserialization, XXE
|
|
69
|
-
- Go: race conditions, memory leaks
|
|
70
|
-
|
|
71
|
-
### Best Practices Review
|
|
72
|
-
|
|
73
|
-
✅ **Code Quality**
|
|
74
|
-
- Naming convention compliance
|
|
75
|
-
- Cyclomatic complexity analysis
|
|
76
|
-
- Code duplication detection
|
|
77
|
-
- Dead code identification
|
|
78
|
-
|
|
79
|
-
✅ **Performance**
|
|
80
|
-
- N+1 query detection
|
|
81
|
-
- Inefficient algorithm patterns
|
|
82
|
-
- Memory leak detection
|
|
83
|
-
- Resource cleanup verification
|
|
84
|
-
|
|
85
|
-
✅ **Maintainability**
|
|
86
|
-
- Documentation coverage
|
|
87
|
-
- Test coverage analysis
|
|
88
|
-
- Dependency health check
|
|
89
|
-
- Error handling review
|
|
90
|
-
|
|
91
|
-
## Output
|
|
92
|
-
|
|
93
|
-
The skill generates comprehensive reports in `.code-review/` directory:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
.code-review/
|
|
97
|
-
├── inventory.json # File inventory with metadata
|
|
98
|
-
├── security-findings.json # Security vulnerabilities
|
|
99
|
-
├── best-practices-findings.json # Best practices violations
|
|
100
|
-
├── summary.json # Summary statistics
|
|
101
|
-
├── REPORT.md # Comprehensive markdown report
|
|
102
|
-
└── FIX-CHECKLIST.md # Actionable fix checklist
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Report Contents
|
|
106
|
-
|
|
107
|
-
**REPORT.md** includes:
|
|
108
|
-
- Executive summary with risk assessment
|
|
109
|
-
- Quality scores (Security, Code Quality, Performance, Maintainability)
|
|
110
|
-
- Detailed findings organized by severity
|
|
111
|
-
- Code examples with fix recommendations
|
|
112
|
-
- Action plan prioritized by urgency
|
|
113
|
-
- Compliance status (PCI DSS, HIPAA, GDPR, SOC 2)
|
|
114
|
-
|
|
115
|
-
**FIX-CHECKLIST.md** provides:
|
|
116
|
-
- Checklist format for tracking fixes
|
|
117
|
-
- Organized by severity (Critical → Low)
|
|
118
|
-
- Effort estimates for each issue
|
|
119
|
-
- Priority assignments
|
|
120
|
-
|
|
121
|
-
## Configuration
|
|
122
|
-
|
|
123
|
-
Create `.code-reviewer.json` in project root:
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"scope": {
|
|
128
|
-
"include": ["src/**/*", "lib/**/*"],
|
|
129
|
-
"exclude": ["**/*.test.ts", "**/*.spec.ts", "**/node_modules/**"]
|
|
130
|
-
},
|
|
131
|
-
"security": {
|
|
132
|
-
"enabled": true,
|
|
133
|
-
"checks": ["owasp-top-10", "cwe-top-25"],
|
|
134
|
-
"severity_threshold": "medium"
|
|
135
|
-
},
|
|
136
|
-
"best_practices": {
|
|
137
|
-
"enabled": true,
|
|
138
|
-
"code_quality": true,
|
|
139
|
-
"performance": true,
|
|
140
|
-
"maintainability": true
|
|
141
|
-
},
|
|
142
|
-
"reporting": {
|
|
143
|
-
"format": "markdown",
|
|
144
|
-
"output_path": ".code-review/",
|
|
145
|
-
"include_snippets": true,
|
|
146
|
-
"include_fixes": true
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Workflow
|
|
152
|
-
|
|
153
|
-
### Phase 1: Code Discovery
|
|
154
|
-
- Discover and categorize code files
|
|
155
|
-
- Extract metadata (LOC, complexity, framework)
|
|
156
|
-
- Prioritize files (Critical, High, Medium, Low)
|
|
157
|
-
|
|
158
|
-
### Phase 2: Security Analysis
|
|
159
|
-
- Scan for OWASP Top 10 vulnerabilities
|
|
160
|
-
- Check CWE Top 25 weaknesses
|
|
161
|
-
- Apply language-specific security patterns
|
|
162
|
-
- Generate security findings
|
|
163
|
-
|
|
164
|
-
### Phase 3: Best Practices Review
|
|
165
|
-
- Analyze code quality issues
|
|
166
|
-
- Detect performance problems
|
|
167
|
-
- Assess maintainability concerns
|
|
168
|
-
- Generate best practices findings
|
|
169
|
-
|
|
170
|
-
### Phase 4: Report Generation
|
|
171
|
-
- Consolidate all findings
|
|
172
|
-
- Calculate quality scores
|
|
173
|
-
- Generate comprehensive reports
|
|
174
|
-
- Create actionable checklists
|
|
175
|
-
|
|
176
|
-
## Integration
|
|
177
|
-
|
|
178
|
-
### Pre-commit Hook
|
|
179
|
-
|
|
180
|
-
Block commits with critical/high issues:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
#!/bin/bash
|
|
184
|
-
# .git/hooks/pre-commit
|
|
185
|
-
|
|
186
|
-
staged_files=$(git diff --cached --name-only --diff-filter=ACMR)
|
|
187
|
-
ccw run code-reviewer --scope "$staged_files" --severity critical,high
|
|
188
|
-
|
|
189
|
-
if [ $? -ne 0 ]; then
|
|
190
|
-
echo "❌ Code review found critical/high issues. Commit aborted."
|
|
191
|
-
exit 1
|
|
192
|
-
fi
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### CI/CD Integration
|
|
196
|
-
|
|
197
|
-
```yaml
|
|
198
|
-
# .github/workflows/code-review.yml
|
|
199
|
-
name: Code Review
|
|
200
|
-
on: [pull_request]
|
|
201
|
-
|
|
202
|
-
jobs:
|
|
203
|
-
review:
|
|
204
|
-
runs-on: ubuntu-latest
|
|
205
|
-
steps:
|
|
206
|
-
- uses: actions/checkout@v3
|
|
207
|
-
- name: Run Code Review
|
|
208
|
-
run: |
|
|
209
|
-
ccw run code-reviewer --report-level detailed
|
|
210
|
-
ccw report upload .code-review/report.md
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## Examples
|
|
214
|
-
|
|
215
|
-
### Example 1: Security-Focused Review
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
# Review authentication module for security issues
|
|
219
|
-
/code-reviewer --scope src/auth --focus security --severity critical,high
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**Output**: Security findings with OWASP/CWE mappings and fix recommendations
|
|
223
|
-
|
|
224
|
-
### Example 2: Performance Review
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Review API endpoints for performance issues
|
|
228
|
-
/code-reviewer --scope src/api --focus best-practices --check performance
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Output**: N+1 queries, inefficient algorithms, memory leak detections
|
|
232
|
-
|
|
233
|
-
### Example 3: Full Project Audit
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
# Comprehensive review of entire codebase
|
|
237
|
-
/code-reviewer --report-level detailed --output .code-review/audit-2024-01.md
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Output**: Complete audit with all findings, scores, and action plan
|
|
241
|
-
|
|
242
|
-
## Compliance Support
|
|
243
|
-
|
|
244
|
-
The skill maps findings to compliance requirements:
|
|
245
|
-
|
|
246
|
-
- **PCI DSS**: Requirement 6.5 (Common coding vulnerabilities)
|
|
247
|
-
- **HIPAA**: Technical safeguards and access controls
|
|
248
|
-
- **GDPR**: Article 32 (Security of processing)
|
|
249
|
-
- **SOC 2**: Security controls and monitoring
|
|
250
|
-
|
|
251
|
-
## Architecture
|
|
252
|
-
|
|
253
|
-
### Execution Mode
|
|
254
|
-
**Sequential** - Fixed phase order for systematic review:
|
|
255
|
-
1. Code Discovery → 2. Security Analysis → 3. Best Practices → 4. Report Generation
|
|
256
|
-
|
|
257
|
-
### Tools Used
|
|
258
|
-
- `mcp__ace-tool__search_context` - Semantic code search
|
|
259
|
-
- `mcp__ccw-tools__smart_search` - Pattern matching
|
|
260
|
-
- `Read` - File content access
|
|
261
|
-
- `Write` - Report generation
|
|
262
|
-
|
|
263
|
-
## Quality Standards
|
|
264
|
-
|
|
265
|
-
### Scoring System
|
|
266
|
-
|
|
267
|
-
```
|
|
268
|
-
Overall Score = (
|
|
269
|
-
Security Score × 0.4 +
|
|
270
|
-
Code Quality Score × 0.25 +
|
|
271
|
-
Performance Score × 0.2 +
|
|
272
|
-
Maintainability Score × 0.15
|
|
273
|
-
)
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Score Ranges
|
|
277
|
-
- **A (90-100)**: Excellent - Production ready
|
|
278
|
-
- **B (80-89)**: Good - Minor improvements needed
|
|
279
|
-
- **C (70-79)**: Acceptable - Some issues to address
|
|
280
|
-
- **D (60-69)**: Poor - Significant improvements required
|
|
281
|
-
- **F (0-59)**: Failing - Major issues, not production ready
|
|
282
|
-
|
|
283
|
-
## Troubleshooting
|
|
284
|
-
|
|
285
|
-
### Large Codebase
|
|
286
|
-
|
|
287
|
-
If review takes too long:
|
|
288
|
-
```bash
|
|
289
|
-
# Review in batches
|
|
290
|
-
/code-reviewer --scope src/module-1
|
|
291
|
-
/code-reviewer --scope src/module-2 --resume
|
|
292
|
-
|
|
293
|
-
# Or use parallel execution
|
|
294
|
-
/code-reviewer --parallel 4
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### False Positives
|
|
298
|
-
|
|
299
|
-
Configure suppressions in `.code-reviewer.json`:
|
|
300
|
-
```json
|
|
301
|
-
{
|
|
302
|
-
"suppressions": {
|
|
303
|
-
"security": {
|
|
304
|
-
"sql-injection": {
|
|
305
|
-
"paths": ["src/legacy/**/*"],
|
|
306
|
-
"reason": "Legacy code, scheduled for refactor"
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
## File Structure
|
|
314
|
-
|
|
315
|
-
```
|
|
316
|
-
.claude/skills/code-reviewer/
|
|
317
|
-
├── SKILL.md # Main skill documentation
|
|
318
|
-
├── README.md # This file
|
|
319
|
-
├── phases/
|
|
320
|
-
│ ├── 01-code-discovery.md
|
|
321
|
-
│ ├── 02-security-analysis.md
|
|
322
|
-
│ ├── 03-best-practices-review.md
|
|
323
|
-
│ └── 04-report-generation.md
|
|
324
|
-
├── specs/
|
|
325
|
-
│ ├── security-requirements.md
|
|
326
|
-
│ ├── best-practices-requirements.md
|
|
327
|
-
│ └── quality-standards.md
|
|
328
|
-
└── templates/
|
|
329
|
-
├── security-finding.md
|
|
330
|
-
├── best-practice-finding.md
|
|
331
|
-
└── report-template.md
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
## Version
|
|
335
|
-
|
|
336
|
-
**v1.0.0** - Initial release
|
|
337
|
-
|
|
338
|
-
## License
|
|
339
|
-
|
|
340
|
-
MIT License
|