clean-project
npx machina-cli add skill yu-iskw/coding-agent-fabric/clean-project --openclawClean 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 installfails repeatedly with checksum or resolution errors.trunkreports internal errors that persist aftertrunk install.- "Ghost" errors occur (failures that don't match the current code).
Workflow
-
Clean Dependencies:
- Recursively delete
node_modules:find . -name "node_modules" -type d -prune -exec rm -rf '{}' +. - Remove global lockfile:
rm pnpm-lock.yaml.
- Recursively delete
-
Clean Tooling Cache:
- Clear Trunk cache:
trunk clean. - Prune pnpm store:
pnpm store prune.
- Clear Trunk cache:
-
Re-initialize Environment:
- Invoke the
setup-dev-envskill to reinstall everything.
- Invoke the
-
Verify Health:
- Invoke the
verifiersubagent (../../agents/verifier.md) to ensure the project is back to a clean, working state.
- Invoke the
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
- pnpm Commands for Node.js: Common pnpm maintenance commands.
- Trunk CLI Reference: Commands for managing Trunk artifacts.
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
- Step 1: Clean dependencies by deleting node_modules and removing pnpm-lock.yaml
- Step 2: Clean tooling cache by running trunk clean and pnpm store prune
- 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