import-organizer

📁 dexploarer/claudius-skills 📅 3 days ago
2
总安装量
2
周安装量
#67828
全站排名
安装命令
npx skills add https://github.com/dexploarer/claudius-skills --skill import-organizer

Agent 安装分布

opencode 2
gemini-cli 2
claude-code 2
github-copilot 2
codex 2
kimi-cli 2

Skill 文档

Import Organizer

Automatically organize and sort import statements in JavaScript, TypeScript, Python, and other languages.

When to Activate

  • “organize imports in this file”
  • “sort the imports”
  • “clean up import statements”
  • “fix import order”

Process

  1. Read the file to see current imports
  2. Identify import groups:
    • External/third-party imports
    • Internal/local imports
    • Type imports (TypeScript)
    • Side-effect imports
  3. Sort within groups alphabetically
  4. Remove duplicates if any
  5. Apply language-specific conventions:
    • JavaScript/TypeScript: External, then internal
    • Python: Standard library, third-party, local
  6. Preserve comments attached to imports
  7. Update the file with organized imports

Language-Specific Rules

JavaScript/TypeScript

// External packages first
import React from 'react'
import { useState } from 'react'
import axios from 'axios'

// Internal imports
import { Button } from './components/Button'
import { utils } from './utils'

// Type imports (TypeScript)
import type { User } from './types'

// Side-effect imports last
import './styles.css'

Python

# Standard library
import os
import sys
from datetime import datetime

# Third-party
import requests
from django.db import models

# Local
from .models import User
from .utils import helper

Best Practices

  • Group by source (external vs internal)
  • Sort alphabetically within groups
  • Separate groups with blank lines
  • Remove unused imports (warn user)
  • Preserve special comments
  • Follow language conventions