Command Palette

Search for a command to run...

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

import-style

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

Rules for ordering, grouping, and styling import statements in klex. Use when writing, modifying, or reviewing any import declaration.

stagewise-ioот stagewise-io★ 44 звезды на GitHub

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

Import Style

Apply to every TypeScript file in klex. No exceptions.

Order

  1. Side-effect imports — first, visibly isolated (one blank line after).
  2. Node built-ins — node:crypto, node:path, etc.
  3. External packages — ai, hono, zod. Excludes @stagewise/** workspace packages.
  4. Workspace packages — @stagewise/logger, @stagewise/config.
  5. Internal aliases — @/config, @/model-provider, @/session/types.
  6. Relative modules — ./server, ./utils/types.

One blank line between groups. Sort module paths alphabetically within each group.

import './instrumentation';

import { randomUUID } from 'node:crypto';

import { type ServerType, serve } from '@hono/node-server';

import type { ModuleLogger, RootLogger } from '@stagewise/logger';

import type { Config } from '@/config';
import { createChatSession } from '@/session/chat';

import { createAdminApp } from './server';

Style

  • One import declaration per source module. Biome merges duplicates automatically.
  • import type for entirely type-only modules: import type { Config } from '@/config'.
  • Inline type for mixed value/type imports: import { type ServerType, serve } from '@hono/node-server'.
  • Never use a value import for a symbol used only as a type. Use import type or inline type.
  • Never manually align imports with spaces. Let the formatter handle spacing.

barrel imports

  • Cross-module: import through the barrel — @/config, @/model-provider.
  • Intra-module: import internal dependencies directly — ./server, ./utils/types. Never import through your own module's barrel.
  • No import comments or subsection labels. Blank lines between groups communicate structure.

tooling — enforced by Biome

Biome config in biome.jsonc enforces all rules above automatically:

  • useImportType rule (level error, style auto) — forces import type for type-only modules, inline type for mixed imports.
  • organizeImports assist action — enforces group ordering, blank line separators, alphabetical sorting, and duplicate merging. Groups configured: bare → Node/Bun → external (excl @stagewise/**) → @stagewise/** → :ALIAS: → :PATH:.
  • sortBareImports: true — side-effect imports are sorted. If side-effect order matters at runtime, keep filenames sortable or manage that section manually.

Run pnpm check:fix (→ biome check . --write) to auto-fix. CI runs biome ci . to verify without rewriting.

Do not add a global { "type": true } group. That would create a separate type-import section instead of keeping imports grouped by dependency layer.

Полный SKILL.md на GitHub

Установить import-style в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл import-style?

Rules for ordering, grouping, and styling import statements in klex. Use when writing, modifying, or reviewing any import declaration.

Как установить скилл import-style?

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

Скилл import-style запускает скрипты?

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

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

Сравнить import-style с