Command Palette

Search for a command to run...

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

source-command-fix

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

Auto-fix all detected issues (short alias for comprehensive fixing)

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

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

source-command-fix

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

Command Template

Fix Command - Universal Auto-Fixer

One-command solution to automatically fix all common code issues including formatting, linting, type errors, and more.

Usage

/fix [scope]

Scopes

  • (default) - Fix everything
  • format - Formatting only (Prettier)
  • lint - Linting issues (ESLint)
  • types - TypeScript errors
  • imports - Import organization
  • styles - Tailwind class ordering
  • build - Build-related errors
  • all - Everything (same as default)

Examples

# Fix everything
/fix

# Formatting only
/fix format

# ESLint issues only
/fix lint

# TypeScript errors
/fix types

# Multiple scopes
/fix format lint imports

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

Fix Process

Phase 1: Detection

Scan for all issues across the codebase

Phase 2: Auto-Fix

Apply fixes in order:

  1. Prettier - Code formatting
  2. ESLint - Linting with --fix
  3. TypeScript - Pattern-based fixes
  4. Imports - Organization and unused removal
  5. Tailwind - Class ordering
  6. Build - Known build error patterns

Phase 3: Verification

Ensure fixes don't break anything

What Gets Fixed

1. Formatting (Prettier)

// Before
const obj = { a: 1, b: 2, c: 3 }
function fn(x, y) {
  return x + y
}

// After
const obj = { a: 1, b: 2, c: 3 }
function fn(x, y) {
  return x + y
}

2. ESLint Issues

  • Unused variables removed
  • Missing semicolons added
  • Prefer const over let
  • No console.log in production
  • Consistent quotes
  • Array/object spacing

3. TypeScript Errors

// Before
const user = data // Type 'any'
setName(user?.name) // Type 'string | undefined'

// After
const user = data as User
setName(user?.name ?? "")

4. Import Organization

// Before
import React, { useState } from "react"
// After
import React, { useState } from "react"

import { Button, Button } from "@/components/ui/button"

import type { User, User } from "./types"

5. Tailwind Classes

<!-- Before -->
<div className="p-4 flex bg-white mt-2 justify-center items-center">
  <!-- After -->
  <div className="mt-2 flex items-center justify-center bg-white p-4"></div>
</div>

6. Build Errors

  • Dictionary property errors
  • Prisma field type mismatches
  • Enum completeness issues
  • Missing required fields

Pattern-Based Fixes

Dictionary Properties (173+ patterns)

// Before
dictionary.common.unknownKey

// After
dictionary.common.knownKey ?? "Fallback"

Prisma Field Types (13+ patterns)

// Before
connect: studentId // Wrong: scalar on connect

// After
connect: {
  id: studentId
} // Correct: object

Enum Completeness (2+ patterns)

// Before
const config = {
  ADMIN: "admin",
  USER: "user",
  // Missing roles
}

// After
const config: Record<UserRole, string> = {
  ADMIN: "admin",
  USER: "user",
  TEACHER: "teacher",
  // All roles included
}

Progress Display

═══════════════════════════════════════
🔧 AUTO-FIX IN PROGRESS
═══════════════════════════════════════
Scanning for issues...

Found:
- 47 formatting issues
- 12 ESLint violations
- 8 TypeScript errors
- 3 import issues
- 15 Tailwind class order issues

Fixing...
✅ Formatted 47 files
✅ Fixed 12 ESLint issues
✅ Resolved 8 TypeScript errors
✅ Organized 3 imports
✅ Reordered 15 Tailwind classes

═══════════════════════════════════════
✨ All issues fixed successfully!
═══════════════════════════════════════

Configuration

.prettierrc

{
  "semi": false,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "es5"
}

.eslintrc

{
  "extends": ["next", "prettier"],
  "rules": {
    "no-console": "warn",
    "no-unused-vars": "error",
    "prefer-const": "error"
  }
}

Tailwind Config

// prettier-plugin-tailwindcss
module.exports = {
  plugins: ["prettier-plugin-tailwindcss"],
}

Error Recovery

If fixes cause issues:

Partial Rollback

git diff  # Review changes
git checkout -- file.ts  # Revert specific file

Full Rollback

git stash  # Save but remove changes
git stash drop  # Discard if not needed

Implementation

// Orchestrates multiple fix operations
async function fix(scope: string[]) {
  const issues = await detectIssues(scope)

  if (issues.total === 0) {
    console.log("✨ No issues found!")
    return
  }

  // Apply fixes in order
  if (scope.includes("format")) {
    await runPrettier()
  }

  if (scope.includes("lint")) {
    await runESLintFix()
  }

  if (scope.includes("types")) {
    await fixTypeScriptErrors()
  }

  if (scope.includes("imports")) {
    await organizeImports()
  }

  if (scope.includes("styles")) {
    await orderTailwindClasses()
  }

  if (scope.includes("build")) {
    await fixBuildErrors()
  }
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Auto-fix all detected issues (short alias for comprehensive fixing)

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

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

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

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

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

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