oh-my-claude-sisyphus 3.4.0 → 3.4.1

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.
Files changed (104) hide show
  1. package/README.md +71 -5
  2. package/commands/cancel-ecomode.md +71 -0
  3. package/commands/cancel.md +75 -0
  4. package/commands/pipeline.md +231 -0
  5. package/commands/planner.md +174 -0
  6. package/commands/swarm.md +280 -0
  7. package/dist/analytics/cost-estimator.d.ts +14 -0
  8. package/dist/analytics/cost-estimator.d.ts.map +1 -0
  9. package/dist/analytics/cost-estimator.js +70 -0
  10. package/dist/analytics/cost-estimator.js.map +1 -0
  11. package/dist/analytics/export.d.ts +7 -0
  12. package/dist/analytics/export.d.ts.map +1 -0
  13. package/dist/analytics/export.js +93 -0
  14. package/dist/analytics/export.js.map +1 -0
  15. package/dist/analytics/index.d.ts +14 -0
  16. package/dist/analytics/index.d.ts.map +1 -0
  17. package/dist/analytics/index.js +14 -0
  18. package/dist/analytics/index.js.map +1 -0
  19. package/dist/analytics/metrics-collector.d.ts +30 -0
  20. package/dist/analytics/metrics-collector.d.ts.map +1 -0
  21. package/dist/analytics/metrics-collector.js +96 -0
  22. package/dist/analytics/metrics-collector.js.map +1 -0
  23. package/dist/analytics/query-engine.d.ts +32 -0
  24. package/dist/analytics/query-engine.d.ts.map +1 -0
  25. package/dist/analytics/query-engine.js +151 -0
  26. package/dist/analytics/query-engine.js.map +1 -0
  27. package/dist/analytics/session-manager.d.ts +26 -0
  28. package/dist/analytics/session-manager.d.ts.map +1 -0
  29. package/dist/analytics/session-manager.js +201 -0
  30. package/dist/analytics/session-manager.js.map +1 -0
  31. package/dist/analytics/session-types.d.ts +37 -0
  32. package/dist/analytics/session-types.d.ts.map +1 -0
  33. package/dist/analytics/session-types.js +2 -0
  34. package/dist/analytics/session-types.js.map +1 -0
  35. package/dist/analytics/token-tracker.d.ts +24 -0
  36. package/dist/analytics/token-tracker.d.ts.map +1 -0
  37. package/dist/analytics/token-tracker.js +161 -0
  38. package/dist/analytics/token-tracker.js.map +1 -0
  39. package/dist/analytics/types.d.ts +37 -0
  40. package/dist/analytics/types.d.ts.map +1 -0
  41. package/dist/analytics/types.js +21 -0
  42. package/dist/analytics/types.js.map +1 -0
  43. package/dist/cli/analytics.d.ts +3 -0
  44. package/dist/cli/analytics.d.ts.map +1 -0
  45. package/dist/cli/analytics.js +74 -0
  46. package/dist/cli/analytics.js.map +1 -0
  47. package/dist/cli/commands/agents.d.ts +5 -0
  48. package/dist/cli/commands/agents.d.ts.map +1 -0
  49. package/dist/cli/commands/agents.js +29 -0
  50. package/dist/cli/commands/agents.js.map +1 -0
  51. package/dist/cli/commands/cleanup.d.ts +4 -0
  52. package/dist/cli/commands/cleanup.d.ts.map +1 -0
  53. package/dist/cli/commands/cleanup.js +17 -0
  54. package/dist/cli/commands/cleanup.js.map +1 -0
  55. package/dist/cli/commands/cost.d.ts +4 -0
  56. package/dist/cli/commands/cost.d.ts.map +1 -0
  57. package/dist/cli/commands/cost.js +53 -0
  58. package/dist/cli/commands/cost.js.map +1 -0
  59. package/dist/cli/commands/export.d.ts +5 -0
  60. package/dist/cli/commands/export.d.ts.map +1 -0
  61. package/dist/cli/commands/export.js +30 -0
  62. package/dist/cli/commands/export.js.map +1 -0
  63. package/dist/cli/commands/sessions.d.ts +5 -0
  64. package/dist/cli/commands/sessions.d.ts.map +1 -0
  65. package/dist/cli/commands/sessions.js +37 -0
  66. package/dist/cli/commands/sessions.js.map +1 -0
  67. package/dist/cli/commands/stats.d.ts +4 -0
  68. package/dist/cli/commands/stats.d.ts.map +1 -0
  69. package/dist/cli/commands/stats.js +43 -0
  70. package/dist/cli/commands/stats.js.map +1 -0
  71. package/dist/cli/utils/formatting.d.ts +22 -0
  72. package/dist/cli/utils/formatting.d.ts.map +1 -0
  73. package/dist/cli/utils/formatting.js +70 -0
  74. package/dist/cli/utils/formatting.js.map +1 -0
  75. package/dist/hud/analytics-display.d.ts +28 -0
  76. package/dist/hud/analytics-display.d.ts.map +1 -0
  77. package/dist/hud/analytics-display.js +105 -0
  78. package/dist/hud/analytics-display.js.map +1 -0
  79. package/dist/hud/background-cleanup.d.ts +28 -0
  80. package/dist/hud/background-cleanup.d.ts.map +1 -0
  81. package/dist/hud/background-cleanup.js +92 -0
  82. package/dist/hud/background-cleanup.js.map +1 -0
  83. package/dist/hud/index.js +4 -2
  84. package/dist/hud/index.js.map +1 -1
  85. package/dist/hud/render.d.ts +1 -1
  86. package/dist/hud/render.d.ts.map +1 -1
  87. package/dist/hud/render.js +32 -1
  88. package/dist/hud/render.js.map +1 -1
  89. package/dist/hud/state.d.ts +5 -0
  90. package/dist/hud/state.d.ts.map +1 -1
  91. package/dist/hud/state.js +13 -0
  92. package/dist/hud/state.js.map +1 -1
  93. package/dist/hud/types.d.ts +11 -1
  94. package/dist/hud/types.d.ts.map +1 -1
  95. package/dist/hud/types.js +19 -0
  96. package/dist/hud/types.js.map +1 -1
  97. package/docs/FULL-README.md +130 -16
  98. package/docs/MIGRATION.md +222 -1
  99. package/docs/SYNC-SYSTEM.md +528 -0
  100. package/package.json +8 -2
  101. package/scripts/sync-metadata.ts +363 -0
  102. package/skills/build-fix/SKILL.md +123 -0
  103. package/skills/code-review/SKILL.md +179 -0
  104. package/skills/security-review/SKILL.md +254 -0
@@ -0,0 +1,363 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Metadata Sync System
4
+ *
5
+ * Synchronizes version and metadata from package.json to all documentation files.
6
+ * Prevents version drift and ensures consistency across the project.
7
+ *
8
+ * Usage:
9
+ * npm run sync-metadata # Sync all files
10
+ * npm run sync-metadata -- --dry-run # Preview changes
11
+ * npm run sync-metadata -- --verify # Check if files are in sync
12
+ */
13
+
14
+ import { readFileSync, writeFileSync, existsSync, readdirSync } from 'fs';
15
+ import { join, resolve } from 'path';
16
+ import { fileURLToPath } from 'url';
17
+ import { dirname } from 'path';
18
+
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = dirname(__filename);
21
+
22
+ // Color utilities for terminal output
23
+ const colors = {
24
+ reset: '\x1b[0m',
25
+ bright: '\x1b[1m',
26
+ green: '\x1b[32m',
27
+ yellow: '\x1b[33m',
28
+ blue: '\x1b[34m',
29
+ red: '\x1b[31m',
30
+ cyan: '\x1b[36m',
31
+ };
32
+
33
+ function color(text: string, colorCode: string): string {
34
+ return `${colorCode}${text}${colors.reset}`;
35
+ }
36
+
37
+ // Metadata interface
38
+ interface Metadata {
39
+ version: string;
40
+ description: string;
41
+ keywords: string[];
42
+ repository: string;
43
+ homepage: string;
44
+ npmPackage: string;
45
+ }
46
+
47
+ // File sync configuration
48
+ interface FileSync {
49
+ path: string;
50
+ replacements: Array<{
51
+ pattern: RegExp;
52
+ replacement: (metadata: Metadata) => string;
53
+ description: string;
54
+ }>;
55
+ }
56
+
57
+ // Load metadata from package.json
58
+ function loadMetadata(): Metadata {
59
+ const projectRoot = resolve(__dirname, '..');
60
+ const packageJsonPath = join(projectRoot, 'package.json');
61
+
62
+ if (!existsSync(packageJsonPath)) {
63
+ throw new Error(`package.json not found at ${packageJsonPath}`);
64
+ }
65
+
66
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
67
+
68
+ return {
69
+ version: packageJson.version,
70
+ description: packageJson.description || '',
71
+ keywords: packageJson.keywords || [],
72
+ repository: packageJson.repository?.url?.replace(/^git\+/, '').replace(/\.git$/, '') || '',
73
+ homepage: packageJson.homepage || '',
74
+ npmPackage: packageJson.name || 'oh-my-claude-sisyphus',
75
+ };
76
+ }
77
+
78
+ // Get count of agents from agents directory
79
+ function getAgentCount(): number {
80
+ const projectRoot = resolve(__dirname, '..');
81
+ const agentsDir = join(projectRoot, 'agents');
82
+
83
+ if (!existsSync(agentsDir)) {
84
+ return 0;
85
+ }
86
+
87
+ const files = readdirSync(agentsDir);
88
+ return files.filter((f: string) => f.endsWith('.md')).length;
89
+ }
90
+
91
+ // Get count of skills from skills directory (directories, not files)
92
+ function getSkillCount(): number {
93
+ const projectRoot = resolve(__dirname, '..');
94
+ const skillsDir = join(projectRoot, 'skills');
95
+
96
+ if (!existsSync(skillsDir)) {
97
+ return 0;
98
+ }
99
+
100
+ const entries = readdirSync(skillsDir, { withFileTypes: true });
101
+ return entries.filter((entry) => entry.isDirectory()).length;
102
+ }
103
+
104
+ // Define file sync configurations
105
+ function getFileSyncConfigs(): FileSync[] {
106
+ const agentCount = getAgentCount();
107
+ const skillCount = getSkillCount();
108
+
109
+ return [
110
+ {
111
+ path: 'README.md',
112
+ replacements: [
113
+ {
114
+ pattern: /\[!\[npm version\]\(https:\/\/img\.shields\.io\/npm\/v\/[^)]+\)/g,
115
+ replacement: (m) => `[![npm version](https://img.shields.io/npm/v/${m.npmPackage}?color=cb3837)`,
116
+ description: 'npm version badge',
117
+ },
118
+ {
119
+ pattern: /\[!\[npm downloads\]\(https:\/\/img\.shields\.io\/npm\/dm\/[^)]+\)/g,
120
+ replacement: (m) => `[![npm downloads](https://img.shields.io/npm/dm/${m.npmPackage}?color=blue)`,
121
+ description: 'npm downloads badge',
122
+ },
123
+ ],
124
+ },
125
+ {
126
+ path: 'docs/FULL-README.md',
127
+ replacements: [
128
+ {
129
+ pattern: /\[!\[Version\]\(https:\/\/img\.shields\.io\/badge\/version-[^-]+-[^)]+\)/g,
130
+ replacement: (m) => `[![Version](https://img.shields.io/badge/version-${m.version}-ff6b6b)`,
131
+ description: 'Version badge',
132
+ },
133
+ {
134
+ pattern: /\[!\[npm version\]\(https:\/\/img\.shields\.io\/npm\/v\/[^?]+[^)]*\)/g,
135
+ replacement: (m) => `[![npm version](https://img.shields.io/npm/v/${m.npmPackage}?color=cb3837)`,
136
+ description: 'npm version badge',
137
+ },
138
+ {
139
+ pattern: /## NEW in \d+\.\d+\.\d+:/g,
140
+ replacement: (m) => `## NEW in ${m.version}:`,
141
+ description: 'Version header',
142
+ },
143
+ {
144
+ pattern: /## ⚡ NEW in \d+\.\d+:/g,
145
+ replacement: (m) => {
146
+ const [major, minor] = m.version.split('.');
147
+ return `## ⚡ NEW in ${major}.${minor}:`;
148
+ },
149
+ description: 'Major.minor version header',
150
+ },
151
+ ],
152
+ },
153
+ {
154
+ path: '.github/CLAUDE.md',
155
+ replacements: [
156
+ {
157
+ pattern: /\*\*\d+ specialized agents\*\*/g,
158
+ replacement: () => `**${agentCount} specialized agents**`,
159
+ description: 'Agent count',
160
+ },
161
+ {
162
+ pattern: /\*\*\d+ slash commands\*\*/g,
163
+ replacement: () => `**${skillCount} slash commands**`,
164
+ description: 'Slash command count',
165
+ },
166
+ ],
167
+ },
168
+ {
169
+ path: 'docs/ARCHITECTURE.md',
170
+ replacements: [
171
+ {
172
+ pattern: /version \d+\.\d+\.\d+/gi,
173
+ replacement: (m) => `version ${m.version}`,
174
+ description: 'Architecture version references',
175
+ },
176
+ ],
177
+ },
178
+ {
179
+ path: 'CHANGELOG.md',
180
+ replacements: [
181
+ // CHANGELOG is manually maintained, only verify latest version exists
182
+ {
183
+ pattern: /^## \[\d+\.\d+\.\d+\]/m,
184
+ replacement: (m) => `## [${m.version}]`,
185
+ description: 'Latest version header (verify only)',
186
+ },
187
+ ],
188
+ },
189
+ ];
190
+ }
191
+
192
+ // Sync a single file
193
+ function syncFile(
194
+ config: FileSync,
195
+ metadata: Metadata,
196
+ dryRun: boolean,
197
+ projectRoot: string
198
+ ): { changed: boolean; changes: string[] } {
199
+ const filePath = join(projectRoot, config.path);
200
+
201
+ if (!existsSync(filePath)) {
202
+ console.log(color(`⚠ File not found: ${config.path}`, colors.yellow));
203
+ return { changed: false, changes: [] };
204
+ }
205
+
206
+ let content = readFileSync(filePath, 'utf-8');
207
+ const originalContent = content;
208
+ const changes: string[] = [];
209
+
210
+ for (const replacement of config.replacements) {
211
+ const matches = content.match(replacement.pattern);
212
+ if (matches) {
213
+ const newContent = content.replace(
214
+ replacement.pattern,
215
+ replacement.replacement(metadata)
216
+ );
217
+
218
+ if (newContent !== content) {
219
+ changes.push(replacement.description);
220
+ content = newContent;
221
+ }
222
+ }
223
+ }
224
+
225
+ const changed = content !== originalContent;
226
+
227
+ if (changed && !dryRun) {
228
+ writeFileSync(filePath, content, 'utf-8');
229
+ }
230
+
231
+ return { changed, changes };
232
+ }
233
+
234
+ // Verify all files are in sync
235
+ function verifySync(metadata: Metadata, projectRoot: string): boolean {
236
+ console.log(color('\n🔍 Verifying metadata sync...', colors.cyan));
237
+
238
+ const configs = getFileSyncConfigs();
239
+ let allInSync = true;
240
+
241
+ for (const config of configs) {
242
+ const result = syncFile(config, metadata, true, projectRoot);
243
+
244
+ if (result.changed) {
245
+ allInSync = false;
246
+ console.log(color(`✗ ${config.path}`, colors.red));
247
+ result.changes.forEach(change => {
248
+ console.log(color(` - ${change} needs update`, colors.yellow));
249
+ });
250
+ } else {
251
+ console.log(color(`✓ ${config.path}`, colors.green));
252
+ }
253
+ }
254
+
255
+ return allInSync;
256
+ }
257
+
258
+ // Main sync operation
259
+ function syncAll(dryRun: boolean): void {
260
+ const projectRoot = resolve(__dirname, '..');
261
+ const metadata = loadMetadata();
262
+
263
+ console.log(color('\n📦 Metadata Sync System', colors.bright));
264
+ console.log(color('========================\n', colors.bright));
265
+ console.log(`Version: ${color(metadata.version, colors.green)}`);
266
+ console.log(`Package: ${color(metadata.npmPackage, colors.cyan)}`);
267
+ console.log(`Agents: ${color(String(getAgentCount()), colors.blue)}`);
268
+ console.log(`Skills: ${color(String(getSkillCount()), colors.blue)}`);
269
+
270
+ if (dryRun) {
271
+ console.log(color('\n🔍 DRY RUN MODE - No files will be modified\n', colors.yellow));
272
+ }
273
+
274
+ const configs = getFileSyncConfigs();
275
+ let totalChanges = 0;
276
+
277
+ for (const config of configs) {
278
+ const result = syncFile(config, metadata, dryRun, projectRoot);
279
+
280
+ if (result.changed) {
281
+ totalChanges++;
282
+ const status = dryRun ? '📝' : '✓';
283
+ console.log(color(`\n${status} ${config.path}`, colors.cyan));
284
+ result.changes.forEach(change => {
285
+ console.log(color(` - ${change}`, colors.blue));
286
+ });
287
+ }
288
+ }
289
+
290
+ if (totalChanges === 0) {
291
+ console.log(color('\n✅ All files are already in sync!', colors.green));
292
+ } else if (dryRun) {
293
+ console.log(color(`\n📊 ${totalChanges} file(s) would be updated`, colors.yellow));
294
+ console.log(color('Run without --dry-run to apply changes', colors.cyan));
295
+ } else {
296
+ console.log(color(`\n✅ Successfully synced ${totalChanges} file(s)!`, colors.green));
297
+ }
298
+ }
299
+
300
+ // CLI
301
+ function main(): void {
302
+ const args = process.argv.slice(2);
303
+ const dryRun = args.includes('--dry-run');
304
+ const verify = args.includes('--verify');
305
+ const help = args.includes('--help') || args.includes('-h');
306
+
307
+ if (help) {
308
+ console.log(`
309
+ ${color('Metadata Sync System', colors.bright)}
310
+
311
+ ${color('Usage:', colors.cyan)}
312
+ npm run sync-metadata Sync all files
313
+ npm run sync-metadata -- --dry-run Preview changes without writing
314
+ npm run sync-metadata -- --verify Check if files are in sync
315
+
316
+ ${color('Description:', colors.cyan)}
317
+ Synchronizes version and metadata from package.json to documentation files.
318
+ Prevents version drift and ensures consistency across the project.
319
+
320
+ ${color('Files Synced:', colors.cyan)}
321
+ - README.md (npm badges)
322
+ - docs/FULL-README.md (version badges and headers)
323
+ - .github/CLAUDE.md (agent/skill counts)
324
+ - docs/ARCHITECTURE.md (version references)
325
+ - CHANGELOG.md (version header verification)
326
+
327
+ ${color('Examples:', colors.cyan)}
328
+ npm run sync-metadata # Apply all updates
329
+ npm run sync-metadata -- --dry-run # See what would change
330
+ npm run sync-metadata -- --verify # CI/CD verification
331
+ `);
332
+ return;
333
+ }
334
+
335
+ try {
336
+ if (verify) {
337
+ const projectRoot = resolve(__dirname, '..');
338
+ const metadata = loadMetadata();
339
+ const inSync = verifySync(metadata, projectRoot);
340
+
341
+ if (!inSync) {
342
+ console.log(color('\n❌ Files are out of sync!', colors.red));
343
+ console.log(color('Run: npm run sync-metadata', colors.cyan));
344
+ process.exit(1);
345
+ } else {
346
+ console.log(color('\n✅ All files are in sync!', colors.green));
347
+ }
348
+ } else {
349
+ syncAll(dryRun);
350
+ }
351
+ } catch (error) {
352
+ console.error(color('\n❌ Error:', colors.red), error instanceof Error ? error.message : error);
353
+ process.exit(1);
354
+ }
355
+ }
356
+
357
+ // Run if called directly
358
+ if (import.meta.url === `file://${process.argv[1]}`) {
359
+ main();
360
+ }
361
+
362
+ // Export for testing
363
+ export { loadMetadata, syncFile, verifySync, getAgentCount, getSkillCount };
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: build-fix
3
+ description: Fix build and TypeScript errors with minimal changes
4
+ ---
5
+
6
+ # Build Fix Skill
7
+
8
+ Fix build and TypeScript errors quickly with minimal code changes. Get the build green without refactoring.
9
+
10
+ ## When to Use
11
+
12
+ This skill activates when:
13
+ - User says "fix the build", "build is broken"
14
+ - TypeScript compilation fails
15
+ - `npm run build` or `tsc` reports errors
16
+ - User requests "minimal fixes" for errors
17
+
18
+ ## What It Does
19
+
20
+ Delegates to the `build-fixer` agent (Sonnet model) to:
21
+
22
+ 1. **Collect Errors**
23
+ - Run `npx tsc --noEmit` to get all TypeScript errors
24
+ - Or run `npm run build` to get build failures
25
+ - Categorize errors by type and severity
26
+
27
+ 2. **Fix Strategically**
28
+ - Add type annotations where missing
29
+ - Add null checks where needed
30
+ - Fix import/export statements
31
+ - Resolve module resolution issues
32
+ - Fix linter errors blocking build
33
+
34
+ 3. **Minimal Diff Strategy**
35
+ - NO refactoring of unrelated code
36
+ - NO architectural changes
37
+ - NO performance optimizations
38
+ - ONLY what's needed to make build pass
39
+
40
+ 4. **Verify**
41
+ - Run `npx tsc --noEmit` after each fix
42
+ - Ensure no new errors introduced
43
+ - Stop when build passes
44
+
45
+ ## Agent Delegation
46
+
47
+ ```
48
+ Task(
49
+ subagent_type="oh-my-claudecode:build-fixer",
50
+ model="sonnet",
51
+ prompt="BUILD FIX TASK
52
+
53
+ Fix all build and TypeScript errors with minimal changes.
54
+
55
+ Requirements:
56
+ - Run tsc/build to collect errors
57
+ - Fix errors one at a time
58
+ - Verify each fix doesn't introduce new errors
59
+ - NO refactoring, NO architectural changes
60
+ - Stop when build passes
61
+
62
+ Output: Build error resolution report with:
63
+ - List of errors fixed
64
+ - Lines changed per fix
65
+ - Final build status"
66
+ )
67
+ ```
68
+
69
+ ## Stop Conditions
70
+
71
+ The build-fixer agent stops when:
72
+ - `npx tsc --noEmit` exits with code 0
73
+ - `npm run build` completes successfully
74
+ - No new errors introduced
75
+
76
+ ## Output Format
77
+
78
+ ```
79
+ BUILD FIX REPORT
80
+ ================
81
+
82
+ Errors Fixed: 12
83
+ Files Modified: 8
84
+ Lines Changed: 47
85
+
86
+ Fixes Applied:
87
+ 1. src/utils/validation.ts:15 - Added return type annotation
88
+ 2. src/components/Header.tsx:42 - Added null check for props.user
89
+ 3. src/api/client.ts:89 - Fixed import path for axios
90
+ ...
91
+
92
+ Final Build Status: ✓ PASSING
93
+ Verification: npx tsc --noEmit (exit code 0)
94
+ ```
95
+
96
+ ## Best Practices
97
+
98
+ - **One fix at a time** - Easier to verify and debug
99
+ - **Minimal changes** - Don't refactor while fixing
100
+ - **Document why** - Comment non-obvious fixes
101
+ - **Test after** - Ensure tests still pass
102
+
103
+ ## Use with Other Skills
104
+
105
+ Combine with other skills for comprehensive fixing:
106
+
107
+ **With Ultrawork:**
108
+ ```
109
+ /ultrawork fix all build errors
110
+ ```
111
+ Spawns multiple build-fixer agents in parallel for different files.
112
+
113
+ **With Ralph:**
114
+ ```
115
+ /ralph fix the build
116
+ ```
117
+ Keeps trying until build passes, even if it takes multiple iterations.
118
+
119
+ **With Pipeline:**
120
+ ```
121
+ /pipeline debug "build is failing"
122
+ ```
123
+ Uses: explore → architect → build-fixer workflow.
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: code-review
3
+ description: Run a comprehensive code review
4
+ ---
5
+
6
+ # Code Review Skill
7
+
8
+ Conduct a thorough code review for quality, security, and maintainability with severity-rated feedback.
9
+
10
+ ## When to Use
11
+
12
+ This skill activates when:
13
+ - User requests "review this code", "code review"
14
+ - Before merging a pull request
15
+ - After implementing a major feature
16
+ - User wants quality assessment
17
+
18
+ ## What It Does
19
+
20
+ Delegates to the `code-reviewer` agent (Opus model) for deep analysis:
21
+
22
+ 1. **Identify Changes**
23
+ - Run `git diff` to find changed files
24
+ - Determine scope of review (specific files or entire PR)
25
+
26
+ 2. **Review Categories**
27
+ - **Security** - Hardcoded secrets, injection risks, XSS, CSRF
28
+ - **Code Quality** - Function size, complexity, nesting depth
29
+ - **Performance** - Algorithm efficiency, N+1 queries, caching
30
+ - **Best Practices** - Naming, documentation, error handling
31
+ - **Maintainability** - Duplication, coupling, testability
32
+
33
+ 3. **Severity Rating**
34
+ - **CRITICAL** - Security vulnerability (must fix before merge)
35
+ - **HIGH** - Bug or major code smell (should fix before merge)
36
+ - **MEDIUM** - Minor issue (fix when possible)
37
+ - **LOW** - Style/suggestion (consider fixing)
38
+
39
+ 4. **Specific Recommendations**
40
+ - File:line locations for each issue
41
+ - Concrete fix suggestions
42
+ - Code examples where applicable
43
+
44
+ ## Agent Delegation
45
+
46
+ ```
47
+ Task(
48
+ subagent_type="oh-my-claudecode:code-reviewer",
49
+ model="opus",
50
+ prompt="CODE REVIEW TASK
51
+
52
+ Review code changes for quality, security, and maintainability.
53
+
54
+ Scope: [git diff or specific files]
55
+
56
+ Review Checklist:
57
+ - Security vulnerabilities (OWASP Top 10)
58
+ - Code quality (complexity, duplication)
59
+ - Performance issues (N+1, inefficient algorithms)
60
+ - Best practices (naming, documentation, error handling)
61
+ - Maintainability (coupling, testability)
62
+
63
+ Output: Code review report with:
64
+ - Files reviewed count
65
+ - Issues by severity (CRITICAL, HIGH, MEDIUM, LOW)
66
+ - Specific file:line locations
67
+ - Fix recommendations
68
+ - Approval recommendation (APPROVE / REQUEST CHANGES / COMMENT)"
69
+ )
70
+ ```
71
+
72
+ ## Output Format
73
+
74
+ ```
75
+ CODE REVIEW REPORT
76
+ ==================
77
+
78
+ Files Reviewed: 8
79
+ Total Issues: 15
80
+
81
+ CRITICAL (0)
82
+ -----------
83
+ (none)
84
+
85
+ HIGH (3)
86
+ --------
87
+ 1. src/api/auth.ts:42
88
+ Issue: User input not sanitized before SQL query
89
+ Risk: SQL injection vulnerability
90
+ Fix: Use parameterized queries or ORM
91
+
92
+ 2. src/components/UserProfile.tsx:89
93
+ Issue: Password displayed in plain text in logs
94
+ Risk: Credential exposure
95
+ Fix: Remove password from log statements
96
+
97
+ 3. src/utils/validation.ts:15
98
+ Issue: Email regex allows invalid formats
99
+ Risk: Accepts malformed emails
100
+ Fix: Use proven email validation library
101
+
102
+ MEDIUM (7)
103
+ ----------
104
+ ...
105
+
106
+ LOW (5)
107
+ -------
108
+ ...
109
+
110
+ RECOMMENDATION: REQUEST CHANGES
111
+
112
+ Critical security issues must be addressed before merge.
113
+ ```
114
+
115
+ ## Review Checklist
116
+
117
+ The code-reviewer agent checks:
118
+
119
+ ### Security
120
+ - [ ] No hardcoded secrets (API keys, passwords, tokens)
121
+ - [ ] All user inputs sanitized
122
+ - [ ] SQL/NoSQL injection prevention
123
+ - [ ] XSS prevention (escaped outputs)
124
+ - [ ] CSRF protection on state-changing operations
125
+ - [ ] Authentication/authorization properly enforced
126
+
127
+ ### Code Quality
128
+ - [ ] Functions < 50 lines (guideline)
129
+ - [ ] Cyclomatic complexity < 10
130
+ - [ ] No deeply nested code (> 4 levels)
131
+ - [ ] No duplicate logic (DRY principle)
132
+ - [ ] Clear, descriptive naming
133
+
134
+ ### Performance
135
+ - [ ] No N+1 query patterns
136
+ - [ ] Appropriate caching where applicable
137
+ - [ ] Efficient algorithms (avoid O(n²) when O(n) possible)
138
+ - [ ] No unnecessary re-renders (React/Vue)
139
+
140
+ ### Best Practices
141
+ - [ ] Error handling present and appropriate
142
+ - [ ] Logging at appropriate levels
143
+ - [ ] Documentation for public APIs
144
+ - [ ] Tests for critical paths
145
+ - [ ] No commented-out code
146
+
147
+ ## Approval Criteria
148
+
149
+ **APPROVE** - No CRITICAL or HIGH issues, minor improvements only
150
+ **REQUEST CHANGES** - CRITICAL or HIGH issues present
151
+ **COMMENT** - Only LOW/MEDIUM issues, no blocking concerns
152
+
153
+ ## Use with Other Skills
154
+
155
+ **With Pipeline:**
156
+ ```
157
+ /pipeline review "implement user authentication"
158
+ ```
159
+ Includes code review as part of implementation workflow.
160
+
161
+ **With Ralph:**
162
+ ```
163
+ /ralph code-review then fix all issues
164
+ ```
165
+ Review code, get feedback, fix until approved.
166
+
167
+ **With Ultrawork:**
168
+ ```
169
+ /ultrawork review all files in src/
170
+ ```
171
+ Parallel code review across multiple files.
172
+
173
+ ## Best Practices
174
+
175
+ - **Review early** - Catch issues before they compound
176
+ - **Review often** - Small, frequent reviews better than huge ones
177
+ - **Address CRITICAL/HIGH first** - Fix security and bugs immediately
178
+ - **Consider context** - Some "issues" may be intentional trade-offs
179
+ - **Learn from reviews** - Use feedback to improve coding practices