Skip to main content
ClaudeWave
Skill58 estrellas del repoactualizado 2d ago

reset

Removes files installed by /optimus:init and /optimus:permissions from the project. Compares each file against plugin templates and classifies as unmodified, likely generated, or user-modified. Always asks before deleting. Git-tracked files are noted as recoverable. Tests are never touched. Monorepo and multi-repo aware. Use for clean reinstall or to stop using optimus.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/oprogramadorreal/optimus-claude /tmp/reset && cp -r /tmp/reset/skills/reset ~/.claude/skills/reset
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Reset — Remove optimus-generated files

Remove files installed by `/optimus:init` and `/optimus:permissions` from the project. Does NOT uninstall the plugin itself — only removes files from the project's `.claude/` directory (and subproject docs for monorepos).

## Safety Rules

These rules are absolute and override all other instructions:

- **NEVER** touch test files, test directories, or test configuration — even if created by `/optimus:unit-test`
- **NEVER** touch files outside `.claude/`, subproject `CLAUDE.md`, subproject `docs/`, and workspace root `CLAUDE.md`
- **NEVER** delete `.claude/settings.json` without first extracting user-added content (use surgical removal — Step 4)
- **ALWAYS** show the categorized file list and get user confirmation before removing anything

## Workflow

### Step 1 — Detect project context

#### Multi-repo workspace detection

Read `$CLAUDE_PLUGIN_ROOT/skills/init/references/multi-repo-detection.md` and run the detection algorithm.

Determine project type:

- **Multi-repo workspace** — root has no `.git/`, 2+ child directories have `.git/` directories. Each child repo has its own `.claude/` directory. Workspace root may have a local `CLAUDE.md` (not version-controlled)
- **Monorepo** — single git repo with multiple subproject directories (e.g., `packages/`, `apps/`). Root has `.claude/`, subprojects may have their own `CLAUDE.md` and `docs/` directories
- **Single project** — standard single repo with `.claude/` directory

#### Check for optimus files

For **multi-repo workspaces**: enumerate all child repos and check each for `.claude/` directories. Also check for a workspace root `CLAUDE.md`. If no child repo has `.claude/` and no workspace root `CLAUDE.md` exists → inform the user "Nothing to reset — no optimus files found" → stop.

For **single project / monorepo**: check if `.claude/` directory exists. If not → inform the user "Nothing to reset — no optimus files found" → stop.

If `.claude/.optimus-version` does not exist, warn that the project may not have been initialized by optimus, but proceed with template comparison anyway.

#### Inventory optimus-managed files

Scan for all files that optimus skills may have created. Only list files that actually exist:

**Root `.claude/` directory:**
- `.claude/CLAUDE.md`
- `.claude/.optimus-version`
- `.claude/settings.json`
- `.claude/docs/coding-guidelines.md`
- `.claude/docs/testing.md`
- `.claude/docs/styling.md`
- `.claude/docs/architecture.md`
- `.claude/docs/skill-writing-guidelines.md`
- `.claude/agents/code-simplifier.md` *(legacy — from previous optimus versions)*
- `.claude/agents/test-guardian.md` *(legacy — from previous optimus versions)*
- `.claude/hooks/format-python.py`
- `.claude/hooks/format-node.js`
- `.claude/hooks/format-rust.sh`
- `.claude/hooks/format-go.sh`
- `.claude/hooks/format-csharp.sh`
- `.claude/hooks/format-java.sh`
- `.claude/hooks/format-cpp.sh`
- `.claude/hooks/format-dart.sh`
- `.claude/hooks/restrict-paths.sh`

**Monorepo subprojects** (scan for these patterns):
- `<subproject>/CLAUDE.md` — subproject overview files
- `<subproject>/docs/testing.md` — subproject testing docs
- `<subproject>/docs/styling.md` — subproject styling docs
- `<subproject>/docs/architecture.md` — subproject architecture docs

**Multi-repo workspace root:**
- `CLAUDE.md` at workspace root (local-only file)

### Step 2 — Classify each file

For each file found in Step 1, determine two things:
1. **Origin classification** — was it generated by optimus, and has it been modified?
2. **Git tracking** — is it tracked by git? (recoverable via `git checkout` if deleted)

Check git tracking by running `git ls-files --error-unmatch <file>` for each file. Note: in multi-repo workspaces, run this from the correct repo directory.

#### Classification by comparison strategy

**Verbatim templates (exact content match):**

For these files, read both the project file and the corresponding template from the plugin. If content is identical → classify as `UNMODIFIED`. If different → classify as `MODIFIED`.

| Project file | Template source |
|---|---|
| `.claude/agents/code-simplifier.md` | `$CLAUDE_PLUGIN_ROOT/agents/code-simplifier.md` *(legacy — agents now live at plugin level)* |
| `.claude/agents/test-guardian.md` | `$CLAUDE_PLUGIN_ROOT/agents/test-guardian.md` *(legacy — agents now live at plugin level)* |
| `.claude/hooks/format-python.py` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-python.py` |
| `.claude/hooks/format-node.js` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-node.js` |
| `.claude/hooks/format-rust.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-rust.sh` |
| `.claude/hooks/format-go.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-go.sh` |
| `.claude/hooks/format-csharp.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-csharp.sh` |
| `.claude/hooks/format-java.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-java.sh` |
| `.claude/hooks/format-cpp.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-cpp.sh` |
| `.claude/hooks/format-dart.sh` | `$CLAUDE_PLUGIN_ROOT/skills/init/templates/hooks/format-dart.sh` |
| `.claude/hooks/restrict-paths.sh` | `$CLAUDE_PLUGIN_ROOT/skills/permissions/templates/hooks/restrict-paths.sh` |

**Near-exact template (coding-guidelines.md):**

The template body (everything after line 1) is verbatim — only line 1 has `[PROJECT NAME]` substituted by init. Compare the project file's content from line 2 onward against the template's content from line 2 onward. If identical → `UNMODIFIED`. If different → `MODIFIED`.

Template: `$CLAUDE_PLUGIN_ROOT/skills/init/templates/docs/coding-guidelines.md`

**Generated docs (heuristic — content filled in by init):**

These files have ALL content filled in by init from project analysis — no template comparison is possible. Use heuristic fingerprinting:

| Project file | Template fingerprint (line 1 HTML comment) | Template section headings |
|
code-simplifierSubagent

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.

test-guardianSubagent

Monitors test coverage gaps when testable code is added or modified. Does not write tests — only flags what needs testing.

brainstormSkill

>-

branchSkill

Creates and switches to a new, conventionally named branch — derives the name from an inline description, conversation context, or local git diffs. Preserves all local changes. Never commits or pushes. Use when you want a properly named branch for new or in-progress work.

code-review-deepSkill

Iterative auto-fix code review — runs `/optimus:code-review` in a fresh subagent context per iteration, applies fixes, runs tests, bisects failures, and continues until convergence or the iteration cap (default 8, hard cap 20). Each iteration runs in an isolated subagent so context does not accumulate. Requires a test command in .claude/CLAUDE.md. Use when single-pass review leaves issues or for thorough cleanup before a release.

code-reviewSkill

Reviews local changes, PRs/MRs, or branch diffs against project coding guidelines using 5 to 7 parallel review agents (bug detection, security/logic, guideline compliance x2, code simplification, test coverage, contract quality). Use before committing, on open PRs/MRs, or to review any branch diff. HIGH SIGNAL only: real bugs, logic errors, security concerns, and guideline violations. For iterative auto-fix in a loop, use `/optimus:code-review-deep`.

commit-messageSkill

Suggests conventional commit messages by analyzing staged, unstaged, and untracked git changes — read-only, never commits. Use when a commit message suggestion is needed without actually committing.

commitSkill

Stages, commits, and optionally pushes local changes with a conventional commit message — analyzes diffs, generates the message, confirms with the user, and commits. On protected branches, offers to create a feature branch automatically. Multi-repo aware. Use when ready to commit work in one step.