home / skills / sounder25 / google-antigravity-skills-library / 02_project_rename

02_project_rename skill

/02_project_rename

This skill safely renames a .NET solution, projects, and namespaces, with planned and recovery modes to prevent data loss.

npx playbooks add skill sounder25/google-antigravity-skills-library --skill 02_project_rename

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
2.0 KB
---
name: Project-Wide Rename
description: Safely renames a .NET project (solution, projects, namespaces, directories) from one name to another. Supports Planned (clean) and Recovery (dirty) modes.
version: 1.0.0
author: Antigravity Skills Library
created: 2026-01-15
leverage_score: 5/5
---

# SKILL-002: Project-Wide Rename

## Overview

Renaming a complex .NET solution is error-prone. This skill automates the process of renaming files, directories, text content, and git configuration, with safety mechanisms to prevent data loss.

## Trigger Phrases

- `rename project <old> <new>`
- `safe rename <old> to <new>`
- `fix pending rename`

## Inputs

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `--old-name` | string | Yes | - | Original project name (e.g., "Scrutor") |
| `--new-name` | string | Yes | - | New project name (e.g., "ELR") |
| `--mode` | string | No | `auto` | `planned`, `recovery`, or `auto` |
| `--dry-run` | switch | No | False | Preview changes (mandatory if dirty) |

## Modes

1. **Planned Mode**: Requires a clean git status. Best for starting a rename operation from scratch.
2. **Recovery Mode**: Allows dirty git status. Best for finishing a partial rename or cleaning up a manual attempt.

## Outputs

1. **Console Output**: Progress log of renamed files and updated content.
2. **Report**: `RENAME_SUMMARY.md` with list of changes.
3. **Git Branch**: `rename-<old>-to-<new>` containing the changes.

## Preconditions

1. Git repository root.
2. .NET SDK installed (for build verification).
3. Permissions to modify all files.

## Safety/QA Checks

1. **Exclusions**: Ignores `bin`, `obj`, `.git`, `node_modules`.
2. **Build Check**: optional verification build after rename.
3. **Rollback**: Ability to `git reset --hard` if something goes wrong.

## Implementation

See `rename_project.ps1`.

## Integration

```powershell
# Example
.\skills\02_project_rename\rename_project.ps1 -OldName "Scrutor" -NewName "ELR" -DryRun
```

Overview

This skill safely renames a .NET solution and its projects by updating filenames, directories, project files, namespaces, and git metadata. It offers Planned (clean) and Recovery (dirty) modes and generates a change report and a dedicated git branch for review. The tool includes dry-run previews, build verification, and rollback options to prevent data loss.

How this skill works

The script scans the repository excluding build and VCS artifacts, finds occurrences of the old name in filenames, directory names, project/solution files, and source code, and applies deterministic replacements. It creates a branch named rename-<old>-to-<new>, logs each change to the console, writes RENAME_SUMMARY.md, and optionally runs a .NET build to verify integrity. Planned mode enforces a clean git state; Recovery mode permits changes on a dirty working tree but requires a dry-run for safety.

When to use it

  • You need to rename a solution, project, or root namespace across a repository.
  • You want a repeatable, auditable rename with a branch and summary report.
  • A prior manual rename left the repo in a partial or inconsistent state (use Recovery mode).
  • You want to inspect changes first with a dry run before committing.
  • You must maintain build verification after renaming to catch breakages.

Best practices

  • Run the script from the git repository root and ensure .NET SDK is installed.
  • Start with a dry run to review all planned edits before committing.
  • Use Planned mode on a clean git working tree for the safest operation.
  • If work is in progress, use Recovery mode with the dry-run flag to avoid data loss.
  • Review RENAME_SUMMARY.md and test a full build on the rename branch before merging.

Example use cases

  • Rename an entire solution from Scrutor to ELR and update all namespaces and project files.
  • Finish and clean up a partially applied manual rename that left inconsistent references.
  • Create a rename branch for a planned rebranding and produce an audit-friendly summary for reviewers.
  • Perform a dry-run to preview every filename and text replacement before approving changes.

FAQ

What if the repository is not clean?

Use Recovery mode to allow changes on a dirty tree, but run with --dry-run first and review the summary before committing.

Will it change binaries or build artifacts?

No. The tool excludes bin, obj, .git, and node_modules directories and only updates source files, project metadata, directories, and git config where appropriate.