Skip to content
Back to skills

2720 Clean Ad5b09b1

ASecurity

Remove old sprint directories with safety checks and archiving options

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationbashgitapibackenddocumentation

Works with

  • api

Security analysis

A93/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2720-clean_ad5b09b1 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2720 Clean Ad5b09b1?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2720 Clean Ad5b09b1
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2720-clean-ad5b09b1/badge)](https://www.skillsdirectory.com/skills/tools-only-2720-clean-ad5b09b1)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: clean
description: Remove old sprint directories with safety checks and archiving options
argument-hint: "[--all | --keep-latest | --keep N]"
---

# Clean Sprints Command

You are cleaning up old sprint directories.

## IMPORTANT WARNING

**Sprint directories contain valuable artifacts:**
- Specification files (api-contract.md, backend-specs.md, etc.)
- Implementation reports from agents
- Status summaries
- Test reports

**The user is responsible for:**
- Creating checkpoints (git commits) before cleanup
- Backing up important sprint data
- Deciding which sprints to keep

## Workflow

### Step 1: List Existing Sprints

```bash
ls -la .claude/sprint/
```

Show the user:
- Sprint directories found
- Last modified dates
- Size of each directory

### Step 2: Confirm Action

Ask the user which sprints to clean:

**Options:**
1. **Clean all** - Remove all sprint directories
2. **Keep latest** - Remove all except the most recent sprint
3. **Keep N latest** - Remove all except the N most recent sprints
4. **Select specific** - Let user specify which to remove
5. **Cancel** - Do nothing

### Step 3: Safety Check

Before deletion, verify:

```bash
# Check for uncommitted changes
git status --porcelain .claude/sprint/
```

If there are uncommitted changes, WARN the user:

```
WARNING: You have uncommitted changes in sprint directories.

Uncommitted files:
[list files]

Recommendation: Commit your changes before cleaning.

git add .claude/
git commit -m "Checkpoint before cleanup"

Continue anyway? (y/N)
```

### Step 4: Execute Cleanup

Based on user choice:

**Clean all:**
```bash
rm -rf .claude/sprint/*/
```

**Keep latest:**
```bash
LATEST=$(ls -d .claude/sprint/*/ | sort -V | tail -1)
find .claude/sprint/ -mindepth 1 -maxdepth 1 -type d ! -path "$LATEST" -exec rm -rf {} +
```

**Keep N latest:**
```bash
ls -d .claude/sprint/*/ | sort -V | head -n -[N] | xargs rm -rf
```

**Select specific:**
```bash
rm -rf .claude/sprint/[selected]/
```

### Step 5: Report

After cleanup:

```
Cleanup complete.

Removed:
- .claude/sprint/1/
- .claude/sprint/2/
- ...

Remaining:
- .claude/sprint/[N]/

Tip: Create a checkpoint now:
git add -A && git commit -m "Cleanup old iterations"
```

## Quick Mode

For quick cleanup without prompts:

`/sprint:clean --all` - Remove all sprints
`/sprint:clean --keep-latest` - Keep only the latest
`/sprint:clean --keep 3` - Keep the 3 most recent

## Archive Option

Instead of deleting, offer to archive:

```bash
# Archive sprints before deletion
tar -czf .claude/sprint-archive-$(date +%Y%m%d).tar.gz .claude/sprint/
```

Then proceed with deletion.

## User Responsibility Notice

Always remind the user:

```
REMINDER: You are responsible for checkpointing your work.

Before cleaning, consider:
1. git add .claude/ && git commit -m "Checkpoint"
2. Push to remote if you want off-machine backup
3. Keep sprint specs if you might need to reference them

Sprint artifacts are valuable documentation of:
- Architectural decisions
- API contracts
- Implementation reports
- Test results
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.