omgkit 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin/skills/databases/mongodb/SKILL.md +60 -776
- package/plugin/skills/databases/prisma/SKILL.md +53 -744
- package/plugin/skills/databases/redis/SKILL.md +53 -860
- package/plugin/skills/devops/aws/SKILL.md +68 -672
- package/plugin/skills/devops/github-actions/SKILL.md +54 -657
- package/plugin/skills/devops/kubernetes/SKILL.md +67 -602
- package/plugin/skills/devops/performance-profiling/SKILL.md +59 -863
- package/plugin/skills/frameworks/django/SKILL.md +87 -853
- package/plugin/skills/frameworks/express/SKILL.md +95 -1301
- package/plugin/skills/frameworks/fastapi/SKILL.md +90 -1198
- package/plugin/skills/frameworks/laravel/SKILL.md +87 -1187
- package/plugin/skills/frameworks/nestjs/SKILL.md +106 -973
- package/plugin/skills/frameworks/react/SKILL.md +94 -962
- package/plugin/skills/frameworks/vue/SKILL.md +95 -1242
- package/plugin/skills/frontend/accessibility/SKILL.md +91 -1056
- package/plugin/skills/frontend/frontend-design/SKILL.md +69 -1262
- package/plugin/skills/frontend/responsive/SKILL.md +76 -799
- package/plugin/skills/frontend/shadcn-ui/SKILL.md +73 -921
- package/plugin/skills/frontend/tailwindcss/SKILL.md +60 -788
- package/plugin/skills/frontend/threejs/SKILL.md +72 -1266
- package/plugin/skills/languages/javascript/SKILL.md +106 -849
- package/plugin/skills/methodology/brainstorming/SKILL.md +70 -576
- package/plugin/skills/methodology/defense-in-depth/SKILL.md +79 -831
- package/plugin/skills/methodology/dispatching-parallel-agents/SKILL.md +81 -654
- package/plugin/skills/methodology/executing-plans/SKILL.md +86 -529
- package/plugin/skills/methodology/finishing-development-branch/SKILL.md +95 -586
- package/plugin/skills/methodology/problem-solving/SKILL.md +67 -681
- package/plugin/skills/methodology/receiving-code-review/SKILL.md +70 -533
- package/plugin/skills/methodology/requesting-code-review/SKILL.md +70 -610
- package/plugin/skills/methodology/root-cause-tracing/SKILL.md +70 -646
- package/plugin/skills/methodology/sequential-thinking/SKILL.md +70 -478
- package/plugin/skills/methodology/systematic-debugging/SKILL.md +66 -559
- package/plugin/skills/methodology/test-driven-development/SKILL.md +91 -752
- package/plugin/skills/methodology/testing-anti-patterns/SKILL.md +78 -687
- package/plugin/skills/methodology/token-optimization/SKILL.md +72 -602
- package/plugin/skills/methodology/verification-before-completion/SKILL.md +108 -529
- package/plugin/skills/methodology/writing-plans/SKILL.md +79 -566
- package/plugin/skills/omega/omega-architecture/SKILL.md +91 -752
- package/plugin/skills/omega/omega-coding/SKILL.md +161 -552
- package/plugin/skills/omega/omega-sprint/SKILL.md +132 -777
- package/plugin/skills/omega/omega-testing/SKILL.md +157 -845
- package/plugin/skills/omega/omega-thinking/SKILL.md +165 -606
- package/plugin/skills/security/better-auth/SKILL.md +46 -1034
- package/plugin/skills/security/oauth/SKILL.md +80 -934
- package/plugin/skills/security/owasp/SKILL.md +78 -862
- package/plugin/skills/testing/playwright/SKILL.md +77 -700
- package/plugin/skills/testing/pytest/SKILL.md +73 -811
- package/plugin/skills/testing/vitest/SKILL.md +60 -920
- package/plugin/skills/tools/document-processing/SKILL.md +111 -838
- package/plugin/skills/tools/image-processing/SKILL.md +126 -659
- package/plugin/skills/tools/mcp-development/SKILL.md +85 -758
- package/plugin/skills/tools/media-processing/SKILL.md +118 -735
- package/plugin/stdrules/SKILL_STANDARDS.md +490 -0
- package/plugin/skills/SKILL_STANDARDS.md +0 -743
|
@@ -1,611 +1,120 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: finishing-development-
|
|
3
|
-
description:
|
|
4
|
-
category: methodology
|
|
5
|
-
triggers:
|
|
6
|
-
- finish branch
|
|
7
|
-
- complete feature
|
|
8
|
-
- ready for merge
|
|
9
|
-
- wrap up development
|
|
10
|
-
- finalize PR
|
|
11
|
-
- branch completion
|
|
12
|
-
- pre-merge checklist
|
|
2
|
+
name: finishing-development-branches
|
|
3
|
+
description: AI agent completes development branches with comprehensive quality gates, clean git history, and thorough PR preparation. Use when wrapping up features, preparing for merge, or finalizing PRs.
|
|
13
4
|
---
|
|
14
5
|
|
|
15
|
-
# Finishing Development
|
|
6
|
+
# Finishing Development Branches
|
|
16
7
|
|
|
17
|
-
|
|
8
|
+
## Quick Start
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
- Verify code quality and test coverage
|
|
25
|
-
- Clean up technical debt and TODOs
|
|
26
|
-
- Prepare clean commit history
|
|
27
|
-
- Create comprehensive PR documentation
|
|
28
|
-
- Enable smooth code review process
|
|
29
|
-
- Reduce merge conflicts and issues
|
|
10
|
+
1. **Code Complete** - All acceptance criteria met, edge cases handled, no TODOs
|
|
11
|
+
2. **Quality Assurance** - Tests pass, coverage met, lint clean, build succeeds
|
|
12
|
+
3. **Documentation** - README, API docs, inline comments updated
|
|
13
|
+
4. **Git Hygiene** - Rebase on main, clean commit history, no conflicts
|
|
14
|
+
5. **PR Ready** - Complete description, screenshots, reviewers assigned
|
|
30
15
|
|
|
31
16
|
## Features
|
|
32
17
|
|
|
33
|
-
|
|
18
|
+
| Feature | Description | Guide |
|
|
19
|
+
|---------|-------------|-------|
|
|
20
|
+
| Code Completeness | All requirements implemented | Check acceptance criteria, edge cases, cleanup |
|
|
21
|
+
| Quality Gates | Automated validation | Tests, lint, types, security, build |
|
|
22
|
+
| TODO Scanner | Find unaddressed items | `TODO`, `FIXME`, `HACK`, `XXX` patterns |
|
|
23
|
+
| Git Preparation | Clean history for merge | Rebase, squash WIP, conventional commits |
|
|
24
|
+
| PR Generation | Comprehensive description | Summary, changes, testing, screenshots |
|
|
25
|
+
| Verification Script | Final pre-PR check | Run all gates, generate report |
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
## Development Branch Completion Checklist
|
|
27
|
+
## Common Patterns
|
|
37
28
|
|
|
38
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
39
|
-
│ BRANCH COMPLETION CHECKLIST │
|
|
40
|
-
├─────────────────────────────────────────────────────────────────────────┤
|
|
41
|
-
│ │
|
|
42
|
-
│ PHASE 1: CODE COMPLETE │
|
|
43
|
-
│ ══════════════════════ │
|
|
44
|
-
│ □ All acceptance criteria implemented │
|
|
45
|
-
│ □ Edge cases handled │
|
|
46
|
-
│ □ Error handling complete │
|
|
47
|
-
│ □ No TODO/FIXME comments left unaddressed │
|
|
48
|
-
│ □ Debug code removed │
|
|
49
|
-
│ │
|
|
50
|
-
│ PHASE 2: QUALITY ASSURANCE │
|
|
51
|
-
│ ═══════════════════════════ │
|
|
52
|
-
│ □ All tests passing │
|
|
53
|
-
│ □ New tests written for new code │
|
|
54
|
-
│ □ Test coverage meets threshold │
|
|
55
|
-
│ □ Lint/format checks passing │
|
|
56
|
-
│ □ Type checking passing │
|
|
57
|
-
│ □ Security scan passing │
|
|
58
|
-
│ │
|
|
59
|
-
│ PHASE 3: DOCUMENTATION │
|
|
60
|
-
│ ═══════════════════════ │
|
|
61
|
-
│ □ README updated if needed │
|
|
62
|
-
│ □ API documentation updated │
|
|
63
|
-
│ □ Inline comments for complex logic │
|
|
64
|
-
│ □ CHANGELOG entry if required │
|
|
65
|
-
│ │
|
|
66
|
-
│ PHASE 4: GIT HYGIENE │
|
|
67
|
-
│ ═════════════════════ │
|
|
68
|
-
│ □ Branch rebased on latest main │
|
|
69
|
-
│ □ Commit history is clean and logical │
|
|
70
|
-
│ □ Commit messages follow conventions │
|
|
71
|
-
│ □ No merge conflicts │
|
|
72
|
-
│ □ Branch pushed to remote │
|
|
73
|
-
│ │
|
|
74
|
-
│ PHASE 5: PR READY │
|
|
75
|
-
│ ══════════════════ │
|
|
76
|
-
│ □ PR description is complete │
|
|
77
|
-
│ □ Screenshots/recordings if UI changes │
|
|
78
|
-
│ □ Breaking changes documented │
|
|
79
|
-
│ □ Reviewers assigned │
|
|
80
|
-
│ □ Labels applied │
|
|
81
|
-
│ │
|
|
82
|
-
└─────────────────────────────────────────────────────────────────────────┘
|
|
83
29
|
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
category: 'Code Cleanup',
|
|
117
|
-
checks: [
|
|
118
|
-
{ name: 'No console.log statements', automated: true },
|
|
119
|
-
{ name: 'No debugger statements', automated: true },
|
|
120
|
-
{ name: 'No commented-out code', automated: true },
|
|
121
|
-
{ name: 'No hardcoded secrets', automated: true }
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
// Automated checks implementation
|
|
127
|
-
async function runCodeCleanupChecks(files: string[]): Promise<CheckResult[]> {
|
|
128
|
-
const results: CheckResult[] = [];
|
|
129
|
-
|
|
130
|
-
// Check for debug statements
|
|
131
|
-
const debugPatterns = [
|
|
132
|
-
{ pattern: /console\.(log|debug|info)\(/g, message: 'Console statement found' },
|
|
133
|
-
{ pattern: /debugger;/g, message: 'Debugger statement found' },
|
|
134
|
-
{ pattern: /\/\/.*TODO/gi, message: 'TODO comment found' },
|
|
135
|
-
{ pattern: /\/\/.*FIXME/gi, message: 'FIXME comment found' },
|
|
136
|
-
{ pattern: /\/\*[\s\S]*?\*\/|\/\/.*/g, message: 'Commented code block' }
|
|
137
|
-
];
|
|
138
|
-
|
|
139
|
-
for (const file of files) {
|
|
140
|
-
const content = await readFile(file);
|
|
141
|
-
|
|
142
|
-
for (const { pattern, message } of debugPatterns) {
|
|
143
|
-
const matches = content.match(pattern);
|
|
144
|
-
if (matches) {
|
|
145
|
-
results.push({
|
|
146
|
-
file,
|
|
147
|
-
status: 'warning',
|
|
148
|
-
message: `${message}: ${matches.length} occurrences`
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return results;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// TODO scanner
|
|
158
|
-
async function scanForTODOs(directory: string): Promise<TODO[]> {
|
|
159
|
-
const todos: TODO[] = [];
|
|
160
|
-
|
|
161
|
-
const files = await glob('**/*.{ts,tsx,js,jsx}', { cwd: directory });
|
|
162
|
-
|
|
163
|
-
for (const file of files) {
|
|
164
|
-
const content = await readFile(path.join(directory, file));
|
|
165
|
-
const lines = content.split('\n');
|
|
166
|
-
|
|
167
|
-
lines.forEach((line, index) => {
|
|
168
|
-
const todoMatch = line.match(/\/\/\s*(TODO|FIXME|HACK|XXX):?\s*(.*)/i);
|
|
169
|
-
if (todoMatch) {
|
|
170
|
-
todos.push({
|
|
171
|
-
file,
|
|
172
|
-
line: index + 1,
|
|
173
|
-
type: todoMatch[1].toUpperCase(),
|
|
174
|
-
message: todoMatch[2].trim(),
|
|
175
|
-
priority: determinePriority(todoMatch[1])
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return todos;
|
|
182
|
-
}
|
|
30
|
+
# Completion Checklist
|
|
31
|
+
PHASE 1: CODE COMPLETE
|
|
32
|
+
[ ] All acceptance criteria implemented
|
|
33
|
+
[ ] Edge cases handled
|
|
34
|
+
[ ] Error handling complete
|
|
35
|
+
[ ] No TODO/FIXME unaddressed
|
|
36
|
+
[ ] Debug code removed
|
|
37
|
+
|
|
38
|
+
PHASE 2: QUALITY ASSURANCE
|
|
39
|
+
[ ] All tests passing
|
|
40
|
+
[ ] Coverage meets threshold (80%+)
|
|
41
|
+
[ ] Lint/format passing
|
|
42
|
+
[ ] Type checking passing
|
|
43
|
+
[ ] Security scan passing
|
|
44
|
+
|
|
45
|
+
PHASE 3: DOCUMENTATION
|
|
46
|
+
[ ] README updated if needed
|
|
47
|
+
[ ] API documentation updated
|
|
48
|
+
[ ] Complex logic commented
|
|
49
|
+
|
|
50
|
+
PHASE 4: GIT HYGIENE
|
|
51
|
+
[ ] Rebased on latest main
|
|
52
|
+
[ ] Commit history clean
|
|
53
|
+
[ ] Conventional commit messages
|
|
54
|
+
[ ] No merge conflicts
|
|
55
|
+
|
|
56
|
+
PHASE 5: PR READY
|
|
57
|
+
[ ] Description complete
|
|
58
|
+
[ ] Screenshots for UI changes
|
|
59
|
+
[ ] Reviewers assigned
|
|
183
60
|
```
|
|
184
61
|
|
|
185
|
-
### 3. Quality Assurance Verification
|
|
186
|
-
|
|
187
|
-
```typescript
|
|
188
|
-
/**
|
|
189
|
-
* Run all quality assurance checks
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
interface QACheckResult {
|
|
193
|
-
category: string;
|
|
194
|
-
passed: boolean;
|
|
195
|
-
details: string;
|
|
196
|
-
fixCommand?: string;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
async function runQualityChecks(): Promise<QACheckResult[]> {
|
|
200
|
-
const results: QACheckResult[] = [];
|
|
201
|
-
|
|
202
|
-
// 1. Test execution
|
|
203
|
-
const testResult = await runCommand('npm test');
|
|
204
|
-
results.push({
|
|
205
|
-
category: 'Tests',
|
|
206
|
-
passed: testResult.exitCode === 0,
|
|
207
|
-
details: testResult.passed
|
|
208
|
-
? 'All tests passing'
|
|
209
|
-
: `${testResult.failures} test(s) failing`,
|
|
210
|
-
fixCommand: 'npm test -- --watch'
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// 2. Test coverage
|
|
214
|
-
const coverageResult = await runCommand('npm run test:coverage');
|
|
215
|
-
const coverage = parseCoverageOutput(coverageResult.stdout);
|
|
216
|
-
results.push({
|
|
217
|
-
category: 'Coverage',
|
|
218
|
-
passed: coverage.total >= 80,
|
|
219
|
-
details: `Coverage: ${coverage.total}% (threshold: 80%)`,
|
|
220
|
-
fixCommand: 'npm run test:coverage -- --verbose'
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
// 3. Linting
|
|
224
|
-
const lintResult = await runCommand('npm run lint');
|
|
225
|
-
results.push({
|
|
226
|
-
category: 'Linting',
|
|
227
|
-
passed: lintResult.exitCode === 0,
|
|
228
|
-
details: lintResult.passed
|
|
229
|
-
? 'No lint errors'
|
|
230
|
-
: `${lintResult.errors} error(s) found`,
|
|
231
|
-
fixCommand: 'npm run lint -- --fix'
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
// 4. Type checking
|
|
235
|
-
const typeResult = await runCommand('npm run type-check');
|
|
236
|
-
results.push({
|
|
237
|
-
category: 'Type Check',
|
|
238
|
-
passed: typeResult.exitCode === 0,
|
|
239
|
-
details: typeResult.passed
|
|
240
|
-
? 'No type errors'
|
|
241
|
-
: `${typeResult.errors} type error(s)`,
|
|
242
|
-
fixCommand: 'npm run type-check'
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
// 5. Build
|
|
246
|
-
const buildResult = await runCommand('npm run build');
|
|
247
|
-
results.push({
|
|
248
|
-
category: 'Build',
|
|
249
|
-
passed: buildResult.exitCode === 0,
|
|
250
|
-
details: buildResult.passed
|
|
251
|
-
? 'Build successful'
|
|
252
|
-
: 'Build failed',
|
|
253
|
-
fixCommand: 'npm run build'
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
// 6. Security scan
|
|
257
|
-
const securityResult = await runCommand('npm audit');
|
|
258
|
-
results.push({
|
|
259
|
-
category: 'Security',
|
|
260
|
-
passed: !securityResult.stdout.includes('high') &&
|
|
261
|
-
!securityResult.stdout.includes('critical'),
|
|
262
|
-
details: securityResult.passed
|
|
263
|
-
? 'No high/critical vulnerabilities'
|
|
264
|
-
: 'Security vulnerabilities found',
|
|
265
|
-
fixCommand: 'npm audit fix'
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
return results;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Generate QA report
|
|
272
|
-
function generateQAReport(results: QACheckResult[]): string {
|
|
273
|
-
const passed = results.filter(r => r.passed);
|
|
274
|
-
const failed = results.filter(r => !r.passed);
|
|
275
|
-
|
|
276
|
-
let report = `## Quality Assurance Report\n\n`;
|
|
277
|
-
|
|
278
|
-
if (failed.length === 0) {
|
|
279
|
-
report += `✅ All ${results.length} checks passed!\n\n`;
|
|
280
|
-
} else {
|
|
281
|
-
report += `❌ ${failed.length}/${results.length} checks failed\n\n`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
report += `### Results\n\n`;
|
|
285
|
-
for (const result of results) {
|
|
286
|
-
const icon = result.passed ? '✅' : '❌';
|
|
287
|
-
report += `${icon} **${result.category}**: ${result.details}\n`;
|
|
288
|
-
if (!result.passed && result.fixCommand) {
|
|
289
|
-
report += ` Fix: \`${result.fixCommand}\`\n`;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return report;
|
|
294
|
-
}
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### 4. Git Hygiene
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
/**
|
|
301
|
-
* Clean up git history and prepare for merge
|
|
302
|
-
*/
|
|
303
|
-
|
|
304
|
-
interface GitStatus {
|
|
305
|
-
branch: string;
|
|
306
|
-
ahead: number;
|
|
307
|
-
behind: number;
|
|
308
|
-
conflicts: string[];
|
|
309
|
-
uncommitted: string[];
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
async function prepareGitForMerge(): Promise<GitPrepResult> {
|
|
313
|
-
const results: string[] = [];
|
|
314
|
-
|
|
315
|
-
// 1. Fetch latest from remote
|
|
316
|
-
await runCommand('git fetch origin main');
|
|
317
|
-
results.push('Fetched latest from origin/main');
|
|
318
|
-
|
|
319
|
-
// 2. Check current branch status
|
|
320
|
-
const status = await getGitStatus();
|
|
321
|
-
|
|
322
|
-
// 3. Rebase if behind main
|
|
323
|
-
if (status.behind > 0) {
|
|
324
|
-
await runCommand('git rebase origin/main');
|
|
325
|
-
results.push(`Rebased on origin/main (was ${status.behind} commits behind)`);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// 4. Check for conflicts
|
|
329
|
-
const conflicts = await checkMergeConflicts();
|
|
330
|
-
if (conflicts.length > 0) {
|
|
331
|
-
return {
|
|
332
|
-
success: false,
|
|
333
|
-
results,
|
|
334
|
-
error: `Merge conflicts in: ${conflicts.join(', ')}`
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// 5. Push to remote
|
|
339
|
-
await runCommand(`git push origin ${status.branch} --force-with-lease`);
|
|
340
|
-
results.push('Pushed to remote');
|
|
341
|
-
|
|
342
|
-
return { success: true, results };
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// Clean commit history
|
|
346
|
-
async function cleanCommitHistory(): Promise<void> {
|
|
347
|
-
// Get commits since branching from main
|
|
348
|
-
const commits = await getCommitsSinceMain();
|
|
349
|
-
|
|
350
|
-
console.log(`\nCommit History (${commits.length} commits):`);
|
|
351
|
-
commits.forEach((c, i) => {
|
|
352
|
-
console.log(` ${i + 1}. ${c.hash.slice(0, 7)} - ${c.message}`);
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
// Check for commits that should be squashed
|
|
356
|
-
const fixupCandidates = commits.filter(c =>
|
|
357
|
-
c.message.toLowerCase().includes('fix') ||
|
|
358
|
-
c.message.toLowerCase().includes('wip') ||
|
|
359
|
-
c.message.toLowerCase().includes('temp')
|
|
360
|
-
);
|
|
361
|
-
|
|
362
|
-
if (fixupCandidates.length > 0) {
|
|
363
|
-
console.log('\n⚠️ Consider squashing these commits:');
|
|
364
|
-
fixupCandidates.forEach(c => {
|
|
365
|
-
console.log(` - ${c.hash.slice(0, 7)}: ${c.message}`);
|
|
366
|
-
});
|
|
367
|
-
console.log('\nRun: git rebase -i HEAD~' + commits.length);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Conventional commit validation
|
|
372
|
-
function validateCommitMessages(commits: Commit[]): ValidationResult[] {
|
|
373
|
-
const conventionalPattern = /^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\(.+\))?: .{1,72}/;
|
|
374
|
-
|
|
375
|
-
return commits.map(commit => ({
|
|
376
|
-
commit: commit.hash,
|
|
377
|
-
message: commit.message,
|
|
378
|
-
valid: conventionalPattern.test(commit.message),
|
|
379
|
-
suggestion: !conventionalPattern.test(commit.message)
|
|
380
|
-
? 'Use conventional commits: type(scope): message'
|
|
381
|
-
: undefined
|
|
382
|
-
}));
|
|
383
|
-
}
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
### 5. PR Preparation
|
|
387
|
-
|
|
388
|
-
```typescript
|
|
389
|
-
/**
|
|
390
|
-
* Prepare comprehensive PR documentation
|
|
391
|
-
*/
|
|
392
|
-
|
|
393
|
-
interface PRContext {
|
|
394
|
-
branch: string;
|
|
395
|
-
baseBranch: string;
|
|
396
|
-
commits: Commit[];
|
|
397
|
-
changedFiles: ChangedFile[];
|
|
398
|
-
ticket?: string;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
async function generatePRDescription(context: PRContext): Promise<string> {
|
|
402
|
-
const { commits, changedFiles, ticket } = context;
|
|
403
|
-
|
|
404
|
-
// Analyze changes
|
|
405
|
-
const changeAnalysis = analyzeChanges(changedFiles);
|
|
406
|
-
|
|
407
|
-
// Generate description
|
|
408
|
-
let description = `## Summary\n\n`;
|
|
409
|
-
|
|
410
|
-
// Link to ticket if available
|
|
411
|
-
if (ticket) {
|
|
412
|
-
description += `Closes ${ticket}\n\n`;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// What changed
|
|
416
|
-
description += `## Changes\n\n`;
|
|
417
|
-
for (const commit of commits) {
|
|
418
|
-
description += `- ${commit.message}\n`;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
// Files changed summary
|
|
422
|
-
description += `\n## Files Changed\n\n`;
|
|
423
|
-
description += `- **Added:** ${changeAnalysis.added} files\n`;
|
|
424
|
-
description += `- **Modified:** ${changeAnalysis.modified} files\n`;
|
|
425
|
-
description += `- **Deleted:** ${changeAnalysis.deleted} files\n`;
|
|
426
|
-
|
|
427
|
-
// Testing section
|
|
428
|
-
description += `\n## Testing\n\n`;
|
|
429
|
-
description += `- [x] Unit tests added/updated\n`;
|
|
430
|
-
description += `- [x] Integration tests pass\n`;
|
|
431
|
-
description += `- [ ] Manual testing completed\n`;
|
|
432
|
-
|
|
433
|
-
// Screenshots placeholder for UI changes
|
|
434
|
-
if (changeAnalysis.hasUIChanges) {
|
|
435
|
-
description += `\n## Screenshots\n\n`;
|
|
436
|
-
description += `<!-- Add screenshots of UI changes -->\n`;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
// Breaking changes
|
|
440
|
-
if (changeAnalysis.hasBreakingChanges) {
|
|
441
|
-
description += `\n## ⚠️ Breaking Changes\n\n`;
|
|
442
|
-
description += `<!-- Document any breaking changes -->\n`;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
// Checklist
|
|
446
|
-
description += `\n## Checklist\n\n`;
|
|
447
|
-
description += `- [x] Code follows style guidelines\n`;
|
|
448
|
-
description += `- [x] Self-review completed\n`;
|
|
449
|
-
description += `- [x] Tests added for new functionality\n`;
|
|
450
|
-
description += `- [x] Documentation updated\n`;
|
|
451
|
-
description += `- [x] No unresolved TODOs\n`;
|
|
452
|
-
|
|
453
|
-
return description;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// Create PR with gh CLI
|
|
457
|
-
async function createPullRequest(context: PRContext): Promise<string> {
|
|
458
|
-
const description = await generatePRDescription(context);
|
|
459
|
-
const title = generatePRTitle(context);
|
|
460
|
-
|
|
461
|
-
const result = await runCommand(`
|
|
462
|
-
gh pr create \\
|
|
463
|
-
--title "${title}" \\
|
|
464
|
-
--body "${escapeForShell(description)}" \\
|
|
465
|
-
--base ${context.baseBranch} \\
|
|
466
|
-
--head ${context.branch}
|
|
467
|
-
`);
|
|
468
|
-
|
|
469
|
-
return result.stdout.trim(); // Returns PR URL
|
|
470
|
-
}
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
### 6. Final Verification Script
|
|
474
|
-
|
|
475
|
-
```typescript
|
|
476
|
-
/**
|
|
477
|
-
* Complete verification before marking PR ready
|
|
478
|
-
*/
|
|
479
|
-
|
|
480
|
-
async function runFinalVerification(): Promise<VerificationReport> {
|
|
481
|
-
console.log('🔍 Running final verification...\n');
|
|
482
|
-
|
|
483
|
-
const report: VerificationReport = {
|
|
484
|
-
passed: true,
|
|
485
|
-
checks: []
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
// Phase 1: Code completeness
|
|
489
|
-
console.log('📝 Phase 1: Code Completeness');
|
|
490
|
-
const todos = await scanForTODOs('.');
|
|
491
|
-
report.checks.push({
|
|
492
|
-
name: 'No blocking TODOs',
|
|
493
|
-
passed: todos.filter(t => t.priority === 'high').length === 0,
|
|
494
|
-
details: todos.length > 0
|
|
495
|
-
? `${todos.length} TODOs found`
|
|
496
|
-
: 'No TODOs'
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
const debugCode = await runCodeCleanupChecks(await getChangedFiles());
|
|
500
|
-
report.checks.push({
|
|
501
|
-
name: 'No debug code',
|
|
502
|
-
passed: debugCode.filter(r => r.status === 'error').length === 0,
|
|
503
|
-
details: debugCode.length > 0
|
|
504
|
-
? 'Debug statements found'
|
|
505
|
-
: 'Clean'
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
// Phase 2: Quality
|
|
509
|
-
console.log('✅ Phase 2: Quality Assurance');
|
|
510
|
-
const qaResults = await runQualityChecks();
|
|
511
|
-
report.checks.push(...qaResults.map(r => ({
|
|
512
|
-
name: r.category,
|
|
513
|
-
passed: r.passed,
|
|
514
|
-
details: r.details
|
|
515
|
-
})));
|
|
516
|
-
|
|
517
|
-
// Phase 3: Git
|
|
518
|
-
console.log('🔀 Phase 3: Git Hygiene');
|
|
519
|
-
const gitResult = await prepareGitForMerge();
|
|
520
|
-
report.checks.push({
|
|
521
|
-
name: 'Git ready for merge',
|
|
522
|
-
passed: gitResult.success,
|
|
523
|
-
details: gitResult.error || 'Ready'
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
// Calculate overall status
|
|
527
|
-
report.passed = report.checks.every(c => c.passed);
|
|
528
|
-
|
|
529
|
-
// Print report
|
|
530
|
-
console.log('\n' + '='.repeat(50));
|
|
531
|
-
console.log('FINAL VERIFICATION REPORT');
|
|
532
|
-
console.log('='.repeat(50) + '\n');
|
|
533
|
-
|
|
534
|
-
for (const check of report.checks) {
|
|
535
|
-
const icon = check.passed ? '✅' : '❌';
|
|
536
|
-
console.log(`${icon} ${check.name}: ${check.details}`);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
console.log('\n' + '='.repeat(50));
|
|
540
|
-
if (report.passed) {
|
|
541
|
-
console.log('✅ ALL CHECKS PASSED - Ready for PR!');
|
|
542
|
-
} else {
|
|
543
|
-
console.log('❌ SOME CHECKS FAILED - Please fix before PR');
|
|
544
|
-
}
|
|
545
|
-
console.log('='.repeat(50));
|
|
546
|
-
|
|
547
|
-
return report;
|
|
548
|
-
}
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
## Use Cases
|
|
552
|
-
|
|
553
|
-
### Complete Feature Branch Workflow
|
|
554
|
-
|
|
555
62
|
```bash
|
|
556
|
-
#
|
|
557
|
-
npm run verify
|
|
558
|
-
|
|
559
|
-
# 2. Clean up commit history
|
|
560
|
-
git log --oneline main..HEAD # Review commits
|
|
561
|
-
git rebase -i main # Squash/fixup as needed
|
|
562
|
-
|
|
563
|
-
# 3. Rebase on latest main
|
|
63
|
+
# Git Preparation
|
|
564
64
|
git fetch origin main
|
|
565
65
|
git rebase origin/main
|
|
566
66
|
|
|
567
|
-
#
|
|
568
|
-
|
|
569
|
-
|
|
67
|
+
# Review commits for squashing
|
|
68
|
+
git log --oneline main..HEAD
|
|
69
|
+
# Consider squashing: fix, wip, temp commits
|
|
70
|
+
git rebase -i main
|
|
570
71
|
|
|
571
|
-
#
|
|
72
|
+
# Push with lease (safe force)
|
|
572
73
|
git push origin feature-branch --force-with-lease
|
|
573
74
|
|
|
574
|
-
#
|
|
575
|
-
|
|
75
|
+
# Quality verification
|
|
76
|
+
npm run lint && npm run typecheck && npm test && npm run build
|
|
77
|
+
```
|
|
576
78
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
79
|
+
```
|
|
80
|
+
# PR Description Template
|
|
81
|
+
## Summary
|
|
82
|
+
[2-3 sentences on what/why]
|
|
83
|
+
|
|
84
|
+
## Changes
|
|
85
|
+
- [Change 1]
|
|
86
|
+
- [Change 2]
|
|
87
|
+
|
|
88
|
+
## Testing
|
|
89
|
+
- [x] Unit tests
|
|
90
|
+
- [x] Integration tests
|
|
91
|
+
- [ ] Manual testing
|
|
92
|
+
|
|
93
|
+
## Screenshots
|
|
94
|
+
[For UI changes]
|
|
95
|
+
|
|
96
|
+
## Checklist
|
|
97
|
+
- [x] Self-review completed
|
|
98
|
+
- [x] Tests pass
|
|
99
|
+
- [x] Documentation updated
|
|
580
100
|
```
|
|
581
101
|
|
|
582
102
|
## Best Practices
|
|
583
103
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
-
|
|
598
|
-
-
|
|
599
|
-
-
|
|
600
|
-
-
|
|
601
|
-
- Don't create PRs without descriptions
|
|
602
|
-
- Don't forget to update documentation
|
|
603
|
-
- Don't leave debug statements in code
|
|
604
|
-
- Don't ignore linting warnings
|
|
605
|
-
|
|
606
|
-
## References
|
|
607
|
-
|
|
608
|
-
- [Conventional Commits](https://www.conventionalcommits.org/)
|
|
609
|
-
- [GitHub Flow](https://guides.github.com/introduction/flow/)
|
|
610
|
-
- [Git Rebase Documentation](https://git-scm.com/docs/git-rebase)
|
|
611
|
-
- [GitHub CLI Documentation](https://cli.github.com/manual/)
|
|
104
|
+
| Do | Avoid |
|
|
105
|
+
|----|-------|
|
|
106
|
+
| Run all checks locally before pushing | Pushing broken code |
|
|
107
|
+
| Rebase on latest main to avoid conflicts | Force pushing without --force-with-lease |
|
|
108
|
+
| Squash WIP commits into meaningful units | Leaving fix/wip/temp commits |
|
|
109
|
+
| Write clear conventional commit messages | Cryptic commit messages |
|
|
110
|
+
| Include screenshots for UI changes | Creating PRs without descriptions |
|
|
111
|
+
| Self-review your diff before requesting | Leaving debug statements in code |
|
|
112
|
+
| Test in clean environment if possible | Skipping tests to save time |
|
|
113
|
+
| Link to related tickets in PR | Ignoring linting warnings |
|
|
114
|
+
|
|
115
|
+
## Related Skills
|
|
116
|
+
|
|
117
|
+
- `requesting-code-reviews` - Write effective review requests
|
|
118
|
+
- `verifying-before-completion` - Quality gate checklists
|
|
119
|
+
- `writing-plans` - Plan completion criteria upfront
|
|
120
|
+
- `executing-plans` - Track progress to completion
|