Get the FREE Ultimate OpenClaw Setup Guide →

clean-project

npx machina-cli add skill yu-iskw/coding-agent-fabric/clean-project --openclaw
Files (1)
SKILL.md
1.6 KB

Clean Project (Hard Reset)

This skill provides a destructive but thorough way to repair a "broken" development environment by removing all cached artifacts and re-initializing from scratch.

When to Use

  • pnpm install fails repeatedly with checksum or resolution errors.
  • trunk reports internal errors that persist after trunk install.
  • "Ghost" errors occur (failures that don't match the current code).

Workflow

  1. Clean Dependencies:

    • Recursively delete node_modules: find . -name "node_modules" -type d -prune -exec rm -rf '{}' +.
    • Remove global lockfile: rm pnpm-lock.yaml.
  2. Clean Tooling Cache:

    • Clear Trunk cache: trunk clean.
    • Prune pnpm store: pnpm store prune.
  3. Re-initialize Environment:

    • Invoke the setup-dev-env skill to reinstall everything.
  4. Verify Health:

Safety Note

This process is destructive to the local environment but safe for the repository. It will require a full download of all dependencies, which may take several minutes depending on network speed.

Resources

Source

git clone https://github.com/yu-iskw/coding-agent-fabric/blob/main/.claude/skills/clean-project/SKILL.mdView on GitHub

Overview

Clean Project performs a destructive but thorough hard reset of your development setup by removing cached artifacts and re-initializing from scratch. It targets corrupted dependencies, out-of-sync lockfiles, and inconsistent tooling (Trunk/pnpm) to return you to a clean baseline.

How This Skill Works

The skill deletes local artifacts in four phases: 1) remove node_modules and the pnpm-lock.yaml to reset dependencies, 2) clear the Trunk cache and prune the pnpm store, 3) re-initialize the environment by invoking setup-dev-env, and 4) verify health with the verifier subagent to ensure everything is clean.

When to Use It

  • pnpm install fails with checksum or resolution errors
  • Trunk reports internal errors after a trunk install
  • "Ghost" errors that don’t match the current code
  • Lockfiles are out of sync after merges or branch switches
  • Environment tools (Trunk/pnpm) are in an inconsistent state

Quick Start

  1. Step 1: Clean dependencies by deleting node_modules and removing pnpm-lock.yaml
  2. Step 2: Clean tooling cache by running trunk clean and pnpm store prune
  3. Step 3: Re-initialize and verify by running setup-dev-env then verifier

Best Practices

  • Be aware this is a destructive local reset and may require re-downloading all dependencies
  • Only run when you have network access and time for a full reinstall
  • Run setup-dev-env to re-install dependencies and tooling
  • Verify health with the verifier after re-initialization
  • Consider committing stable state before performing the reset

Example Use Cases

  • pnpm install fails with checksum errors; run clean-project, then setup-dev-env to restore a clean state
  • Trunk still throws internal errors after a trunk install; use clean-project to reset tooling caches
  • "Ghost" errors observed in local dev that don’t reflect code changes; perform a hard reset
  • Merged branches with conflicting lockfiles; clean-project to resynchronize dependencies
  • Trunk/pnpm tooling out of sync causing intermittent failures; reset and reinitialize

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers