agentleFS
lexicalninjalexicalninja/my-little-scrum-team/skills/import-formatter/SKILL.md

import-formatter

Skill2 starsChanged 4 months agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add blank lines between groups (standard library, third-party, local)

    line 16
  2. Distinctive:

    Follow language-specific conventions (e.g., Python PEP 8, JavaScript ES6 modules)

    line 20
  3. Distinctive:

    Use absolute imports when possible

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.