agentleFS
luiseimanluiseiman/dotforge/skills/reset-project/SKILL.md

reset-project

Skill8 starsChanged 7 months agoMITView on GitHub

Restore a project's .claude/ directory to the dotforge template from scratch, with backup and rollback option.

  • Deletes or force-pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the user says "no", cancel immediately.

    line 35
  2. Very specific:

    Use detection rules from $DOTFORGE_DIR/stacks/detect.md.

    line 39
  3. Very specific:

    Create directory .claude.backup-{YYYY-MM-DD}/ in the project root

    line 44
  4. Very specific:

    If CLAUDE_ERRORS.md exists, copy it separately (it will be restored afterwards)

    line 49
  5. Distinctive:

    Verify the backup exists and has content

    line 50
  6. Very specific:

    Delete the current .claude/:

    line 54
  7. Very specific:

    Run the /bootstrap-project skill in full from scratch

    line 58
  8. Very specific:

    If CLAUDE_ERRORS.md existed, restore the original file (not the empty template)

    line 59
  9. Very specific:

    If claude purge is available (v2.1.288+.

    line 87
  10. Distinctive:

    Do NOT run it automatically.

    line 98
  11. Distinctive:

    If the user wants to restore, execute the rollback immediately.

    line 108
  12. Distinctive:

    If the user wants to delete the backup, do it.

    line 109
  13. Distinctive:

    If the user does not decide, leave the backup (it can be cleaned up manually later).

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Reset Project

Restore the current project's .claude/ directory completely to the dotforge template, from scratch.

Step 1: Confirm with the user (MANDATORY)

Show warning before proceeding:

╔══════════════════════════════════════════════════╗
║  RESET: .claude/ will be fully replaced         ║
║                                                  ║
║  The following will be lost:                     ║
║  - Customizations in settings.json               ║
║  - Custom rules                                  ║
║  - Custom hooks                                  ║
║  - Any manually created files in .claude/        ║
║                                                  ║
║  The following will be preserved:                ║
║  - settings.local.json (not touched)             ║
║  - CLAUDE.md (regenerated from template)         ║
║  - CLAUDE_ERRORS.md (preserved if it exists)     ║
║                                                  ║
║  A backup will be created at .claude.backup-YYYY-MM-DD/  ║
╚══════════════════════════════════════════════════╝

Confirm reset? (yes/no)

If the user says "no", cancel immediately. DO NOT proceed without explicit confirmation.

Step 2: Detect stacks

Use detection rules from $DOTFORGE_DIR/stacks/detect.md. Confirm detected stacks with the user.

Step 3: Create backup

  1. Create directory .claude.backup-{YYYY-MM-DD}/ in the project root
  2. Copy ALL of .claude/ to the backup:
    cp -R .claude/ .claude.backup-$(date +%Y-%m-%d)/
  3. If CLAUDE_ERRORS.md exists, copy it separately (it will be restored afterwards)
  4. Verify the backup exists and has content

Step 4: Re-run full bootstrap

  1. Delete the current .claude/:
    rm -rf .claude/
  2. Run the /bootstrap-project skill in full from scratch
  3. If CLAUDE_ERRORS.md existed, restore the original file (not the empty template)

Step 5: Show diff between backup and new

Compare backup vs new .claude/:

═══ RESET COMPLETE ═══

New files (did not exist before):
+ .claude/rules/agents.md
+ .claude/agents/researcher.md

Updated files (differences from backup):
~ .claude/settings.json — 3 new permissions in allow
~ .claude/hooks/block-destructive.sh — 2 new patterns

Deleted files (were in backup, not in template):
- .claude/rules/custom-strategy.md

Preserved files:
= CLAUDE_ERRORS.md (restored from backup)

Step 5b: Offer purge of Claude Code state (v2.1.126+)

/forge reset rebuilds .claude/ but Claude Code's own state for this project lives elsewhere — transcripts, task lists, debug logs, file-edit history, prompt history, and the project entry in ~/.claude.json. After a reset, those references now point at archived/missing files.

If claude purge is available (v2.1.288+; claude project purge on v2.1.126–v2.1.287, still accepted with a rename notice), offer to run it after the rollback decision:

# Verify availability (new name first, then the pre-v2.1.288 name)
if claude purge --help >/dev/null 2>&1; then
  echo "Run 'claude purge $PWD --dry-run' to preview, then drop --dry-run to apply."
elif claude project purge --help >/dev/null 2>&1; then
  echo "Run 'claude project purge $PWD --dry-run' to preview, then drop --dry-run to apply."
fi

Do NOT run it automatically. Show the user the dry-run command first; they decide. Skip the suggestion if the CLI version supports neither form.

Step 6: Offer rollback

Backup available at: .claude.backup-YYYY-MM-DD/
To restore: rm -rf .claude && mv .claude.backup-YYYY-MM-DD .claude
Delete backup? (yes/no — recommended: no, at least until verified)

If the user wants to restore, execute the rollback immediately. If the user wants to delete the backup, do it. If the user does not decide, leave the backup (it can be cleaned up manually later).

Installation

This skill is installed automatically if the symlink from skills/ already exists in ~/.claude/skills/. If not, create the symlink:

ln -sf $DOTFORGE_DIR/skills ~/.claude/skills

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.