typescript-import-style
Merge-friendly import formatting (one-per-line, alphabetical). Auto-loads when writing TypeScript/JavaScript imports to minimize merge conflicts in parallel development. Enforces consistent grouping and sorting.
What this skill does
# TypeScript Import Style Guidelines (Merge Conflict Reduction)
Import formatting and ordering rules to minimize merge conflicts when multiple developers or parallel agents modify the same file.
## CRITICAL: One Import Per Line
When importing multiple items from a module, put EACH import on its own line:
```typescript
// CORRECT - merge-friendly (each on separate line)
import {
alpha,
beta,
gamma,
} from 'some-module';
// WRONG - causes merge conflicts
import { alpha, beta, gamma } from 'some-module';
```
This is enforced by Prettier with `printWidth: 80`. With one-per-line, Git can merge imports from parallel changes without conflicts.
## Import Order (Top to Bottom)
1. **Node.js built-ins** (e.g., `import fs from 'fs'`, `import path from 'path'`)
2. **External packages** (e.g., `import React from 'react'`, `import express from 'express'`)
3. **Internal aliases** (e.g., `import { util } from '@/utils'`)
4. **Parent directory imports** (e.g., `import { Parent } from '../Parent'`)
5. **Sibling imports** (e.g., `import { Sibling } from './Sibling'`)
6. **Index imports** (e.g., `import { thing } from './index'`)
7. **Type-only imports** (e.g., `import type { MyType } from './types'`)
## Within Each Group
- Sort imports alphabetically by module path (case-insensitive)
- Sort named imports alphabetically within braces
- Sort export statements alphabetically
## Spacing
- Add one blank line between import groups
- No blank lines within a group
## Complete Example
```typescript
// Node.js built-ins
import fs from 'fs';
import path from 'path';
// External packages
import express from 'express';
import React from 'react';
// Internal aliases
import { config } from '@/config';
import { logger } from '@/utils';
// Parent imports
import { BaseService } from '../BaseService';
// Sibling imports (one per line when multiple)
import {
helperA,
helperB,
helperC,
} from './helpers';
import { utils } from './utils';
// Type imports (one per line when multiple)
import type { Config } from '@/types';
import type {
Request,
Response,
} from 'express';
```
## Named Exports
Sort named exports alphabetically, one per line when multiple:
```typescript
// CORRECT
export {
alpha,
beta,
gamma,
};
// WRONG
export { gamma, alpha, beta };
```
## Why This Matters
Sorted, one-per-line imports reduce merge conflicts because:
- New imports are inserted at predictable positions (alphabetically)
- Parallel tasks adding imports to the same file won't conflict
- Git can auto-merge changes on different lines
- Consistent structure makes diffs cleaner and reviews easier
## Tooling (Auto-enforced)
These rules are enforced by:
- **eslint-plugin-simple-import-sort**: Sorts imports/exports alphabetically
- **Prettier with `printWidth: 80`**: Forces line wrapping for multiple imports
Run `eslint --fix && prettier --write` before committing.
## ESLint Configuration
```javascript
// .eslintrc.js or eslint.config.js
module.exports = {
plugins: ['simple-import-sort'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
};
```
## Prettier Configuration
```json
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all"
}
```
## Re-export Patterns
When re-exporting from index files, follow the same one-per-line rule:
```typescript
// CORRECT
export {
ComponentA,
ComponentB,
ComponentC,
} from './components';
export type {
TypeA,
TypeB,
} from './types';
// WRONG
export { ComponentA, ComponentB, ComponentC } from './components';
```
## Dynamic Imports
Dynamic imports follow the same alphabetical ordering when multiple exist:
```typescript
// Alphabetical order by module path
const moduleA = await import('./moduleA');
const moduleB = await import('./moduleB');
const utils = await import('./utils');
```
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.