Back to list
lexicalninja

import-formatter

by lexicalninja

A collection of Cursor subagents and Claude skills to help build things together

0🍴 0📅 Jan 16, 2026

SKILL.md


name: import-formatter description: Format and organize import statements in code files. Use when imports are messy, unordered, or need to follow project conventions. Automatically groups imports by type (standard library, third-party, local) and sorts them alphabetically.

Import Formatter Skill

Instructions

  1. Identify all import statements in the file
  2. Group imports into three categories:
    • Standard library imports (Python stdlib, Node.js built-ins, etc.)
    • Third-party imports (from npm, pip, etc.)
    • Local/project imports (relative or absolute project paths)
  3. Sort each group alphabetically
  4. Add blank lines between groups (standard library, third-party, local)
  5. Remove duplicate imports
  6. Consolidate imports from the same module when possible
  7. Preserve import aliases and type-only imports
  8. Follow language-specific conventions (e.g., Python PEP 8, JavaScript ES6 modules)

Examples

Input (Python):

from typing import List, Dict
import os
from myapp.models import User
import requests
from typing import Optional
from myapp.utils import helper

Output:

import os
from typing import Dict, List, Optional

import requests

from myapp.models import User
from myapp.utils import helper

Input (JavaScript/TypeScript):

import { useState } from 'react'
import './styles.css'
import axios from 'axios'
import { Component } from './Component'
import { useEffect } from 'react'

Output:

import { useEffect, useState } from 'react'

import axios from 'axios'

import { Component } from './Component'
import './styles.css'

Language-Specific Rules

Python:

  • Standard library first
  • Third-party packages second
  • Local imports last
  • Use absolute imports when possible
  • Group by package, then alphabetically

JavaScript/TypeScript:

  • External packages first (node_modules)
  • Internal modules second
  • Relative imports last
  • Side-effect imports (CSS, etc.) at the end

Score

Total Score

55/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon