Zum Inhalt springen
Skillpedia
Allgemeines Programmieren48k · #6113

vibe-code-cleanup

Was er macht

Dieses Tool hilft dabei, Code in schnell gebauten Webanwendungen aufzuräumen und zu ordnen, indem es unnötige oder kaputte Teile entfernt, ohne das zu verändern, was bereits funktioniert. Ziel ist, den Code sicherer und leichter wartbar für den produktiven Einsatz zu machen.

Wann du ihn nutzt

  • ✓Wenn eine App funktioniert, aber Import-Fehler oder ungenutzten Code enthält.
  • ✓Bevor du eine App live schaltest oder an jemand anderen übergibst.
  • ✓Wenn du Code aufräumen musst, ohne Kernfunktionen wie Routen oder APIs zu verändern.

Link zum Skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vibe-code-cleanup/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vibe-code-cleanup/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Räume meinen Code auf, entferne ungenutzte Teile und repariere kaputte Imports.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool analysiert den Code, um kaputte Imports und ungenutzten Code zu finden. Diese Teile entfernt es vorsichtig und sorgt dafür, dass wichtige Funktionen wie Routen und APIs weiter funktionieren.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Vibe-Code Cleanup — Production Refactor Skill

A safe, incremental cleanup workflow for AI-generated / vibe-coded fullstack apps. The goal is to make the codebase production-ready without breaking anything that already works.

When to Use

  • Use when a rapidly built app works but has broken imports, duplicated logic, dead code, unclear environment variables, or fragile release hygiene.
  • Use before launch or handoff to convert exploratory code into a maintainable production baseline.
  • Use when cleanup must preserve existing behavior and avoid broad rewrites of routes, APIs, auth, data models, or integrations.

Core Philosophy

Surgery, not demolition. Remove only what is provably dead. Preserve everything else.

Never:

  • Rewrite working systems for cosmetic reasons
  • Rename routes, slugs, or API endpoints that may be indexed or cached
  • Change tool inputs/outputs, API contracts, DB schema, or auth flow
  • Delete files you haven't verified are unused
  • Make broad sweeping changes in a single commit

Always:

  • Make small, targeted, reversible changes
  • Validate after every meaningful batch of changes
  • Prefer shared helpers over copy-pasted blocks
  • Keep backward compatibility

Step 1 — Reconnaissance (read before touching)

Before changing anything, map the codebase:

# List all pages/routes
find . -type f \( -name 'page.js' -o -name 'page.jsx' -o -name 'page.ts' -o -name 'page.tsx' \)
find pages -type f \( -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' \) | rg -v '/_' | sort

# Find broken imports (TS projects)
npx tsc --noEmit 2>&1 | head -80

# Find unused exports (optional, for larger projects)
npx ts-prune 2>/dev/null | head -40

# Check for console.log / debug leftovers
grep -r "console\.log\|debugger\|TODO\|FIXME\|HACK" --include="*.{js,ts,jsx,tsx}" -l

Document what you find. Do NOT change yet.


Step 2 — Fix Broken Imports First

Broken imports cause build failures and should be fixed before anything else.

# TypeScript: list all errors
npx tsc --noEmit 2>&1

# Common patterns to fix:
# - Missing file (file was deleted or renamed)
# - Wrong relative path (../lib vs ../../lib)
# - Named export that doesn't exist

Fix rule: Fix the import reference. Do NOT delete the referenced file unless you've confirmed it's unused everywhere.


Step 3 — Identify Dead Code (verify before removing)

A file/export is safe to remove only if:

  1. No other file imports it (grep-confirmed)
  2. It's not referenced in config, sitemap, or route manifest
  3. It's not a public-facing URL (page.js, route.js)
# Check if a file is imported anywhere
grep -r "from.*my-file\|require.*my-file" --include="*.{js,ts,jsx,tsx}" .

# Check if a component is used anywhere  
grep -r "MyComponent" --include="*.{js,ts,jsx,tsx}" .

Step 4 — Consolidate Repeated Logic into Helpers

Look for repeated patterns (metadata blocks, API fetch wrappers, error handlers) that appear in 3+ places.

Good consolidation targets:

  • Page-level SEO metadata (Open Graph, Twitter cards, canonical)
  • Fetch wrappers with error handling
  • Repeated utility functions (slugify, formatDate, truncate)

Bad consolidation targets (leave alone):

  • One-off business logic
  • Route handlers with different contracts
  • Anything touching DB schema or auth

Pattern for shared metadata helper (Next.js):

// lib/socialMetadata.js
export function buildPageMetadata({ title, description, path, image }) {
  const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'https://yourdomain.com';
  const imageUrl = image?.startsWith('http') ? image : `${baseUrl}${image}`;
  
  return {
    title,
    description,
    openGraph: {
      title,
      description,
      url: `${baseUrl}${path}`,
      images: [{ url: imageUrl, width: 1200, height: 630, alt: title }],
    },
    twitter: {
      card: 'summary_large_image',
      title,
      description,
      images: [imageUrl],
    },
    alternates: {
      canonical: `${baseUrl}${path}`,
    },
  };
}

Step 5 — Environment Variable Audit

# List all env vars used in code
grep -r "process\.env\." --include="*.{js,ts,jsx,tsx}" . | grep -oP 'process\.env\.\w+' | sort -u

# Compare against .env.example or .env.local
cat .env.example 2>/dev/null || cat .env.local 2>/dev/null

Flag any env vars used in code but missing from .env.example. Never add secrets to version control.


…

Häufige Fragen

Was ist 'Dead Code'?

Dead Code ist Code, der geschrieben wurde, in der Anwendung aber nie tatsächlich verwendet wird.

Kann dieses Tool meine Website kaputt machen?

Nein, das Hauptziel ist, Schäden zu verhindern. Es entfernt nur, was mit Sicherheit nicht verwendet wird, und nimmt kleine, sichere Änderungen vor.

Kann ich das bei jeder Web-App nutzen?

Ja, besonders nützlich ist es für Web-Apps mit Technologien wie Next.js, React und Node.js, die in der Fullstack-Entwicklung häufig vorkommen.

Details

Originalbeschreibung des Autors

Safe production cleanup and hardening for vibe-coded fullstack apps (Next.js, React, Node.js, etc.). Removes dead imports, unused files, and broken references without breaking routes or APIs.

repo: sickn33/agentic-awesome-skills

Beliebtheit

GitHub-Sterne
48k
Platz im Ranking
#6113
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills