Index of every page on this site: llms.txt
All skills
Run it yourself

This skill should be used when the user asks to "clean up code", "remove dead code", "simplify this function", "this code is too complex", "reduce complexity", "find unused imports", "code quality sweep", or "/simplifier". Focuses on dead code, complexity reduction, and duplication removal.

  • 6 files
  • 17.5 KB
  • Updated 2 days ago
  • GitHub
Use this Skill: https://skilld.dev/gh/utkudarilmaz/claude-code-setup/simplifier

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesgo-patterns.md

≈675 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Go Simplification Patterns

Dead Code

// DEAD: Unused import
import "fmt" // Never used - Go compiler catches this

// DEAD: Unused variable (use blank identifier or remove)
result, err := doSomething()
// result never used

// DEAD: Unreachable code
func process() error {
    return nil
    log.Println("never runs") // Unreachable
}

// DEAD: Unused exported function
// Check all callers before removing - exported functions may be used by other packages
func DeprecatedHelper() {} // No callers found

Complexity

// COMPLEX: Deep nesting
func process(data *Data) error {
    if data != nil {
        if data.Valid {
            if len(data.Items) > 0 {
                // logic buried here
            }
        }
    }
    return nil
}

// SIMPLIFIED: Early returns
func process(data *Data) error {
    if data == nil || !data.Valid || len(data.Items) == 0 {
        return nil
    }
    // logic at top level
}
// COMPLEX: Repetitive error handling
func createUser(u *User) error {
    if err := validate(u); err != nil {
        return fmt.Errorf("validation failed: %w", err)
    }
    if err := save(u); err != nil {
        return fmt.Errorf("save failed: %w", err)
    }
    if err := notify(u); err != nil {
        return fmt.Errorf("notify failed: %w", err)
    }
    return nil
}

// SIMPLIFIED: Concise error wrapping
func createUser(u *User) error {
    if err := validate(u); err != nil {
        return fmt.Errorf("validation: %w", err)
    }
    if err := save(u); err != nil {
        return fmt.Errorf("save: %w", err)
    }
    if err := notify(u); err != nil {
        return fmt.Errorf("notify: %w", err)
    }
    return nil
}

Go-Specific Checks

Pattern Issue Fix
result, _ := fn() Unchecked error when err matters Handle or explicitly document why ignored
interface{} Empty interface abuse Use concrete type or type constraint
defer in loops Resource leak risk Extract to function or close explicitly
Mutex not unlocked on all paths Deadlock risk Use defer mu.Unlock() immediately after Lock
Context not propagated Cancellation doesn't cascade Pass ctx through function chain
Goroutine without cancellation Goroutine leak Use context or done channel
sync.WaitGroup misuse Race on Add/Done Call wg.Add() before goroutine launch
Naked return in long functions Readability issue Use explicit returns when function > 10 lines
String concatenation in loops Allocation overhead Use strings.Builder
init() with side effects Hidden initialization, test difficulty Use explicit initialization functions

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 7ee2637. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 days ago

README badge

README badge for utkudarilmaz/claude-code-setup/simplifier