home / skills / next-friday / nextfriday-skills / nextfriday-imports
This skill enforces absolute import usage, type-only imports, and centralized date utilities to improve code consistency and maintainability.
npx playbooks add skill next-friday/nextfriday-skills --skill nextfriday-importsReview the files below or copy the command above to add this skill to your agents.
---
name: nextfriday-imports
description: Next Friday import rules for absolute paths, type imports, and date utilities. Use when adding import statements or working with modules.
user-invocable: false
---
# Next Friday Imports
Rules for import statements and module resolution.
## Absolute Imports
Disallow relative imports with `../`. Use absolute imports instead.
```typescript
// Bad:
import { Button } from "../../../components/Button";
import { formatDate } from "../../utils/format";
// Good:
import { Button } from "@/components/Button";
import { formatDate } from "@/utils/format";
import { validate } from "./validate"; // sibling import OK
```
## Type Imports
Use `import type` for type-only imports.
```typescript
// Bad:
import { ReactNode, FC } from "react";
import { User, Item } from "@/types";
// Good:
import type { ReactNode, FC } from "react";
import type { User, Item } from "@/types";
```
## Date Utilities
Use centralized date utilities (e.g., dayjs) instead of native Date.
```typescript
// Bad:
const now = new Date();
const timestamp = Date.now();
// Good:
import dayjs from "dayjs";
const now = dayjs();
const timestamp = dayjs().valueOf();
```
## Quick Reference
| Rule | Pattern |
| ---- | ------- |
| No `../` imports | Use absolute paths or `@/` alias |
| Type imports | `import type { X }` for types |
| Date handling | Use dayjs, not native Date |
This skill enforces Next Friday import conventions for absolute paths, type-only imports, and centralized date utilities. It helps maintain consistent module resolution, clear type imports, and reliable date handling across a codebase. Use it to reduce fragile relative paths, ensure correct TypeScript type imports, and standardize on a date library.
The skill inspects import statements and usage patterns to detect relative imports that traverse up the directory tree, type imports that are not declared with the import type form, and direct uses of native Date APIs. It recommends replacing ../ paths with the configured absolute alias (e.g., @/), converting type-only imports to import type, and switching native Date constructions and Date.now calls to a centralized date utility like dayjs. It flags violations and provides actionable replacements.
Why use absolute imports instead of ../ relative paths?
Absolute imports reduce path fragility when files move or are deeply nested, making refactors safer and imports easier to read.
When should I still use relative imports?
Use relative imports for sibling or same-directory modules where an absolute path adds noise; avoid relative imports that traverse up with ../.