Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

source-command-fix-build

БесплатноБез исполняемых скриптовНе проверен

Migrated source command `fix-build`

databaytот databayt★ 19 звёзд на GitHub

Об этом скилле

source-command-fix-build

Use this skill when the user asks to run the migrated source command fix-build.

Command Template

Fix Build Command

Command: /fix-build Purpose: Automated error fixing with intelligent pattern recognition and verification


Description

Automatically detects and fixes common build errors that cause TypeScript compilation failures. Applies safe, tested fixes with backup and rollback capabilities. Verifies all fixes with TypeScript compilation before finalizing.

Fixes:

  • Dictionary property errors (173+ patterns) - 100% auto-fixable
  • Prisma field type errors (13+ patterns) - 100% auto-fixable
  • Enum completeness issues (2+ patterns) - 100% auto-fixable
  • Missing required fields - 100% auto-fixable
  • Invalid includes - 100% auto-fixable

Does NOT Fix:

  • Logic errors
  • Runtime errors
  • Complex refactoring
  • Business logic issues

Success Rate: 95%+ for pattern-based errors


Usage

# Fix all auto-fixable errors
/fix-build

# Fix specific error type
/fix-build dictionary
/fix-build prisma
/fix-build enum

# Fix specific file
/fix-build src/components/school-dashboard/finance/expenses/actions.ts

# Fix with confirmation (interactive)
/fix-build --confirm

# Dry run (show what would be fixed)
/fix-build --dry-run

# Fix and commit
/fix-build --commit

# Skip backup creation
/fix-build --no-backup

Fix Strategies

1. Dictionary Property Fixes

Pattern: Invalid property access on dictionary

// Before
<h3>{d?.stats?.totalBudget || 'Total Budget'}</h3>

// After (auto-fixed)
<h3>{'Total Budget'}</h3>

Strategy:

  1. Detect pattern: d?.<invalid_property>.*
  2. Extract fallback value
  3. Replace entire expression with fallback
  4. Preserve formatting and indentation

Safe: Yes - Preserves intended UI text, removes type error

2. Prisma Field Type Fixes

Pattern 1: Connect on ID field

// Before
submittedBy: {
  connect: {
    id: userId
  }
}

// After (auto-fixed)
submittedById: userId

Pattern 2: Invalid include

// Before
include: {
  category: true,
  submittedBy: { select: { id: true, name: true } }
}

// After (auto-fixed)
include: {
  category: true
  // Removed: submittedBy (not a relation)
}

Pattern 3: Missing required fields

// Before
const expense = await db.expense.create({
  data: {
    amount: 1000,
    schoolId: session.user.schoolId,
    submittedById: userId,
  },
})

// After (auto-fixed)
const expenseNumber = `EXP-${Date.now()}-${Math.random().toString(36).substring(2, 9).toUpperCase()}`

const expense = await db.expense.create({
  data: {
    amount: 1000,
    schoolId: session.user.schoolId,
    submittedById: userId,
    expenseNumber,
    submittedAt: new Date(),
  },
})

Safe: Yes - Uses correct Prisma patterns, generates unique values

3. Enum Completeness Fixes

Pattern: Missing enum values in Record

// Before
export const ExpenseStatusLabels: Record<ExpenseStatus, string> = {
  PENDING: "Pending Approval",
  APPROVED: "Approved",
  REJECTED: "Rejected",
  PAID: "Paid",
}

// After (auto-fixed)
export const ExpenseStatusLabels: Record<ExpenseStatus, string> = {
  PENDING: "Pending Approval",
  APPROVED: "Approved",
  REJECTED: "Rejected",
  PAID: "Paid",
  CANCELLED: "Cancelled", // ✅ Added
}

Strategy:

  1. Detect incomplete Record<Enum, T>
  2. Find missing enum values
  3. Generate sensible defaults (humanized enum name)
  4. Append to record with proper formatting

Safe: Yes - Adds missing values with sensible defaults


Output Format

Example 1: Dictionary Fixes

$ /fix-build dictionary

🔧 Fixing dictionary property errors...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 ANALYSIS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Scanning for dictionary errors...
Found 189 invalid property accesses in 4 files

File breakdown:
  - finance/content.tsx: 102 issues
  - budget/content.tsx: 16 issues
  - expenses/content.tsx: 29 issues
  - fees/content.tsx: 42 issues

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💾 BACKUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Creating backups...
  ✅ finance/content.tsx → .backup/2025-10-29-content.tsx.backup
  ✅ budget/content.tsx → .backup/2025-10-29-content.tsx.backup
  ✅ expenses/content.tsx → .backup/2025-10-29-content.tsx.backup
  ✅ fees/content.tsx → .backup/2025-10-29-content.tsx.backup

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 APPLYING FIXES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[████████████████████████████████] 100%

📁 finance/content.tsx
   ✅ Fixed 102 invalid property accesses
   - Removed d?.stats (16 occurrences)
   - Removed d?.blocks (72 occurrences)
   - Removed d?.workflow (14 occurrences)
   - Preserved all fallback strings

📁 budget/content.tsx
   ✅ Fixed 16 invalid property accesses
   - Removed d?.stats (16 occurrences)

📁 expen
Полный SKILL.md на GitHub

Установить source-command-fix-build в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл source-command-fix-build?

Migrated source command `fix-build`

Как установить скилл source-command-fix-build?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл source-command-fix-build запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить source-command-fix-build с