MCP HubMCP Hub
스킬 목록으로 돌아가기

setup-tailwind-typescript

pjt222
업데이트됨 2 days ago
6 조회
17
2
17
GitHub에서 보기
기타ai

정보

이 스킬은 기존 Next.js 또는 Node.js 프로젝트에 Tailwind CSS와 TypeScript를 설정합니다. 설치, PostCSS 설정, TypeScript 엄격 모드 구성, 경로 별칭, IDE 통합을 처리합니다. 프로젝트에 Tailwind/TypeScript를 추가하거나 프레임워크 업그레이드 후 재구성할 때 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/setup-tailwind-typescript

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서


name: setup-tailwind-typescript description: > Tailwind CSS und TypeScript in einem bestehenden Next.js- oder Node.js-Projekt konfigurieren. Behandelt Installation, PostCSS-Setup, TypeScript-Strenge-Einstellungen, Pfad-Aliase und IDE-Integration. Verwenden, wenn Tailwind/TypeScript zu einem vorhandenen Projekt hinzugefügt werden soll oder wenn die Konfiguration nach einem Framework-Upgrade neu eingerichtet werden muss. license: MIT locale: de source_locale: en source_commit: 6f65f316 translator: claude-opus-4-6 translation_date: 2026-03-16 allowed-tools: Read Write Edit Bash Grep Glob metadata: author: Philipp Thoss version: "1.0" domain: web-dev complexity: basic language: TypeScript tags: tailwind, typescript, nextjs, postcss, configuration

Tailwind CSS + TypeScript einrichten

Tailwind CSS und TypeScript in einem bestehenden Webprojekt konfigurieren, mit korrektem PostCSS-Setup und IDE-Integration.

Wann verwenden

  • Tailwind CSS zu einem vorhandenen Next.js- oder React-Projekt hinzufügen
  • TypeScript-Konfiguration in einem bestehenden JavaScript-Projekt einrichten
  • Beides nach einem Framework-Upgrade neu konfigurieren
  • Pfad-Aliase und IDE-Unterstützung für ein Projekt einrichten

Eingaben

  • Erforderlich: Vorhandenes Node.js-Projekt mit package.json
  • Optional: Framework (Next.js, Vite, Create React App — beeinflusst Konfigurationsdetails)
  • Optional: TypeScript-Strenge-Level (strict, empfohlen, minimal)
  • Optional: Ob Pfad-Aliase eingerichtet werden sollen (Standard: ja)

Vorgehensweise

Schritt 1: Tailwind CSS installieren

Tailwind und seine Peer-Dependencies installieren.

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Dies erstellt:

  • tailwind.config.js (oder .ts für TypeScript-Projekte)
  • postcss.config.js

Für TypeScript-Projekte den Konfigurationstyp aktualisieren:

# tailwind.config.js in tailwind.config.ts umbenennen
mv tailwind.config.js tailwind.config.ts

Erwartet: tailwind.config.ts und postcss.config.js in Projektroot erstellt.

Bei Fehler: Wenn npx tailwindcss fehlschlägt, mit npm install -D tailwindcss@latest die neueste Version sicherstellen.

Schritt 2: Tailwind konfigurieren

tailwind.config.ts bearbeiten, um alle Template-Dateien einzuschließen.

// tailwind.config.ts
import type { Config } from 'tailwindcss'

const config: Config = {
  content: [
    './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
    './src/components/**/*.{js,ts,jsx,tsx,mdx}',
    './src/app/**/*.{js,ts,jsx,tsx,mdx}',
  ],
  theme: {
    extend: {
      // Eigene Design-Tokens hier hinzufügen
      colors: {
        brand: {
          50: '#f0f9ff',
          500: '#0ea5e9',
          900: '#0c4a6e',
        },
      },
    },
  },
  plugins: [],
}

export default config

Erwartet: content-Array enthält alle Quell-Dateipfade. TypeScript erkennt Konfigurationstypen ohne Fehler.

Bei Fehler: Wenn Klassen nicht angewendet werden, überprüfen, dass content-Pfade mit der tatsächlichen Dateistruktur übereinstimmen. npx tailwindcss --content './src/**/*.tsx' --output /dev/null zum Testen verwenden.

Schritt 3: Tailwind-Direktiven zu CSS hinzufügen

Die Tailwind-Schicht-Direktiven in die globale CSS-Datei einfügen.

/* src/app/globals.css oder src/styles/globals.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Eigene Basis-Styles darunter */
@layer base {
  h1 {
    @apply text-2xl font-bold;
  }
}

@layer components {
  .btn-primary {
    @apply px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600;
  }
}

Erwartet: CSS-Datei hat alle drei @tailwind-Direktiven. Benutzerdefinierte Layer-Definitionen kompilieren ohne Fehler.

Bei Fehler: Wenn @tailwind-Direktiven nicht erkannt werden, sicherstellen, dass PostCSS korrekt konfiguriert ist und tailwindcss im plugins-Array in postcss.config.js steht.

Schritt 4: TypeScript konfigurieren

tsconfig.json mit geeigneten Strenge-Einstellungen und Pfad-Aliasen einrichten.

{
  "compilerOptions": {
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./src/*"],
      "@/components/*": ["./src/components/*"],
      "@/lib/*": ["./src/lib/*"],
      "@/types/*": ["./src/types/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

Erwartet: tsconfig.json wird von TypeScript ohne Fehler geladen. Pfad-Aliase lösen korrekt auf.

Bei Fehler: Wenn moduleResolution: "bundler" Fehler verursacht (benötigt TypeScript 5.0+), auf "node16" oder "node" zurückfallen.

Schritt 5: VS Code-Integration einrichten

.vscode/settings.json für Tailwind CSS IntelliSense und TypeScript-Unterstützung konfigurieren.

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "tailwindCSS.experimental.classRegex": [
    ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
    ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
  ],
  "typescript.tsdk": "node_modules/typescript/lib",
  "typescript.enablePromptUseWorkspaceTsdk": true
}

Empfohlene VS Code-Erweiterungen (.vscode/extensions.json):

{
  "recommendations": [
    "bradlc.vscode-tailwindcss",
    "dbaeumer.vscode-eslint",
    "esbenp.prettier-vscode",
    "ms-vscode.vscode-typescript-next"
  ]
}

Erwartet: Tailwind IntelliSense zeigt Klassen-Vervollständigung in TypeScript-Dateien. TypeScript-Fehler erscheinen inline.

Bei Fehler: Wenn IntelliSense fehlt, sicherstellen, dass die Tailwind CSS IntelliSense-Erweiterung installiert ist und tailwindCSS.experimental.classRegex korrekt konfiguriert ist.

Schritt 6: Konfiguration verifizieren

Prüfen, ob Tailwind und TypeScript korrekt zusammenarbeiten.

# TypeScript-Kompilierung ohne Ausgabe prüfen
npx tsc --noEmit

# CSS auf Tailwind-Klassen testen
echo '<div class="bg-blue-500 text-white p-4">Test</div>' > /tmp/test.html
npx tailwindcss -i ./src/app/globals.css -o /tmp/output.css --content '/tmp/test.html'
grep "bg-blue-500" /tmp/output.css

Erwartet: tsc --noEmit meldet 0 Fehler. Tailwind-Output-CSS enthält bg-blue-500-Klasse.

Bei Fehler: TypeScript-Fehler identifizieren, indem tsc --noEmit 2>&1 | head -20 ausgeführt wird. Wenn Tailwind-Klassen fehlen, Pfade im content-Array von tailwind.config.ts überprüfen.

Validierung

  • tailwind.config.ts mit korrekten content-Pfaden vorhanden
  • postcss.config.js mit Tailwind CSS-Plugin vorhanden
  • Globale CSS-Datei hat alle drei @tailwind-Direktiven
  • tsconfig.json mit strict: true und Pfad-Aliasen konfiguriert
  • tsc --noEmit meldet keine Fehler
  • Tailwind-Klassen erscheinen in kompiliertem CSS
  • VS Code IntelliSense funktioniert für Tailwind-Klassen

Haeufige Stolperfallen

  • Fehlende content-Pfade: Wenn Tailwind-Klassen nicht in der Ausgabe erscheinen, liegt es fast immer daran, dass die Dateipfade nicht mit dem content-Array übereinstimmen. Alle Dateiextensionen und Verzeichnisse explizit auflisten.
  • PostCSS-Reihenfolge: In postcss.config.js muss tailwindcss vor autoprefixer erscheinen.
  • TypeScript paths ohne baseUrl: Bei Verwendung von paths entweder baseUrl setzen oder sicherstellen, dass das Bundler-Modul-Auflösung unterstützt.
  • @tailwind-Direktiven vs Imports: @import 'tailwindcss/...' funktioniert auch, aber @tailwind base/components/utilities ist idiomatischer in Tailwind v3.
  • Klassen-Übersteuerung in @layer: Benutzerdefinierte Klassen im @layer components können von Utilities mit demselben Namen nicht überschrieben werden — Utility-Klassen haben immer höhere Spezifität.
  • TypeScript strict nach der Einführung: Das nachträgliche Aktivieren von strict: true erzeugt oft Hunderte von Fehlern. Schrittweise mit exactOptionalPropertyTypes, noUncheckedIndexedAccess usw. aktivieren.

Verwandte Skills

  • scaffold-nextjs-app — neues Next.js-Projekt mit Tailwind + TypeScript erstellen
  • deploy-to-vercel — Tailwind + TypeScript-App auf Vercel deployen

GitHub 저장소

pjt222/agent-almanac
경로: i18n/de/skills/setup-tailwind-typescript
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

llamaguard

기타

LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.

스킬 보기

cost-optimization

기타

이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.

스킬 보기

quantizing-models-bitsandbytes

기타

이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.

스킬 보기

dispatching-parallel-agents

기타

이 Claude Skill은 3개 이상의 독립적인 문제를 동시에 조사하고 해결하기 위해 다중 에이전트를 배치합니다. 공유 상태나 의존성 없이 해결 가능한 무관련 장애 시나리오에 맞게 설계되었습니다. 핵심 기능은 병렬 문제 해결로, 각 독립 문제 영역마다 하나의 에이전트를 할당하여 효율성을 극대화합니다.

스킬 보기