fix: statusline crash handling, color validation, git staging rules
Fixed three critical bugs and documented findings: 1. hooks/gsd-statusline.js - Added error handling for file system operations - Wrapped fs.readdirSync and fs.statSync in try-catch - Prevents crashes from permission errors or race conditions 2. bin/install.js - Added hex color validation - Validates hex color format (#RGB or #RRGGBB) - Prevents invalid colors from being written to config 3. commands/gsd/execute-phase.md - Fixed git staging violation - Replaced 'git add -u' with individual file staging - Maintains consistency with documented git commit rules Documentation: - BUG_REPORT.md - Comprehensive review findings (8 bugs total) - FIXES_APPLIED.md - Details of fixes applied and testing recommendations Known issues remaining: - JSON config parsing uses fragile grep/sed (requires jq or refactor) - Documented workarounds and recommendations for future fixes https://claude.ai/code/session_01RAgU8GfJ2dwtBSmJDGzpWA Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -500,8 +500,12 @@ function convertClaudeToOpencodeFrontmatter(content) {
|
||||
if (hexColor) {
|
||||
newLines.push(`color: "${hexColor}"`);
|
||||
} else if (colorValue.startsWith('#')) {
|
||||
// Already hex, keep as is
|
||||
newLines.push(line);
|
||||
// Validate hex color format (#RGB or #RRGGBB)
|
||||
if (/^#[0-9a-f]{3}$|^#[0-9a-f]{6}$/i.test(colorValue)) {
|
||||
// Already hex and valid, keep as is
|
||||
newLines.push(line);
|
||||
}
|
||||
// Skip invalid hex colors
|
||||
}
|
||||
// Skip unknown color names
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user