# cleanup-vibes

cleanup-vibes turns a vibecoded repo into something deployable: pulls hardcoded keys into .env, sorts files into folders, writes the README.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 1357 repo stars
- Author: qdhenry
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/dev/cleanup-vibes.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/cleanup-vibes

## What it does

The command reads the project root first. A `package.json`, `pyproject.toml` or `requirements.txt` tells it whether this is TypeScript, Python, or a split stack with a Python backend next to a TS frontend. Framework detection follows, so a Next.js tree gets a different target layout than Express.

Secret hunting runs as three sub-agents in parallel through the Task tool. One greps for keys and tokens, one for baked-in API base URLs, webhooks and database connection strings, one for ports, environment-specific values and feature flags. Hits go into a sectioned `.env`, a matching `.env.example` with placeholders appears beside it, and source files get `process.env` or `os.environ.get` instead of literals.

Matching is pattern-based: `sk-`, `Bearer`, `postgres://` and similar prefixes. A key with no recognisable shape survives the pass, so read the diff afterwards. Scattered files move into `src/`, `components/`, `lib/` and the rest, and import paths are rewritten to match.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/cleanup-vibes.md` — Call it with /cleanup-vibes. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/cleanup-vibes.md` — Call it with /prompts:cleanup-vibes. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/cleanup-vibes.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/cleanup-vibes.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/dev/cleanup-vibes.md

## When to use it
- pull hardcoded API keys and tokens out of source files
- generate a `.env.example` other people can copy
- sort a flat pile of files into a project-type layout
- fix import paths after files move
- write a README covering env vars and dev commands

## Example prompts
- Run `/cleanup-vibes` on this repo and show me what moved.
- Use `/cleanup-vibes` to lift the hardcoded keys into `.env`, then list every variable it created.
- Run `/cleanup-vibes`, then rewrite the README so it matches the new folder layout.

## Similar
- [varlock](https://affpapa.org/en/nevibecode/skills/varlock.md) — skill · 1000 installs
- [env-secrets-manager](https://affpapa.org/en/nevibecode/skills/env-secrets-manager.md) — skill · 667 installs
- [environment-setup](https://affpapa.org/en/nevibecode/skills/environment-setup.md) — skill · 354 installs
- [env-file-protection](https://affpapa.org/en/nevibecode/hooks/env-file-protection.md) — hook · 279 installs
- [hunt-info-disclosure](https://affpapa.org/en/nevibecode/skills/hunt-info-disclosure.md) — skill · ★ 1298 repo stars
- [dotsecenv](https://affpapa.org/en/nevibecode/plugins/dotsecenv.md) — plugin · ★ 5 repo stars

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
