Get the FREE Ultimate OpenClaw Setup Guide →

tidy

npx machina-cli add skill HartBrook/lookagain/tidy --openclaw
Files (1)
SKILL.md
1.8 KB

Tidy Old Review Runs

You are cleaning up old review results from .lookagain/.

Parse arguments

The user may pass key=value pairs after the command name. The raw argument string is:

$ARGUMENTS

If the argument string is empty or blank, the user provided no overrides — use all defaults. Parse key=value pairs from the string. For any key not provided, use the default.

KeyDefaultDescription
keep1Keep runs from the last N days
allfalseRemove all runs including today's (true or false)

Process

  1. Use Glob to list all directories under .lookagain/ matching the pattern .lookagain/????-??-??T??-??-??/.

  2. If no run directories exist, tell the user there's nothing to tidy and stop.

  3. Determine which runs to remove:

    • If the resolved all value is true, remove ALL run directories.
    • Otherwise, calculate the cutoff date by subtracting the resolved keep value (in days) from today's date. Remove only run directories whose date portion (the YYYY-MM-DD prefix of the directory name) is strictly before the cutoff date.
  4. Before deleting, validate each directory name matches the exact pattern YYYY-MM-DDTHH-MM-SS (all digits in the right positions). Skip any directory that doesn't match.

  5. For each validated run directory to remove, use Bash to delete it: rm -rf .lookagain/<run-id>

  6. Report what was done:

## Tidy Complete

Removed N run(s): <list of run-ids removed>
Kept M run(s): <list of run-ids kept>

If nothing was removed, say so:

## Nothing to Tidy

All N run(s) are within the keep window.

Source

git clone https://github.com/HartBrook/lookagain/blob/main/src/skills/tidy/SKILL.mdView on GitHub

Overview

Removes outdated lookagain review runs from .lookagain/ while preserving today’s results by default. It respects key=value overrides (keep and all) to determine which runs to delete and validates directory names before deletion to prevent accidental loss.

How This Skill Works

Parses optional key=value arguments after the command and uses Glob to list directories under .lookagain/ matching the pattern YYYY-MM-DDTHH-MM-SS. It validates each directory name against the exact pattern and, if all=true, deletes every run; otherwise it computes a cutoff date (today minus keep days) and removes only those with dates before the cutoff. Deletions are performed with rm -rf, and a final report lists removed and kept run IDs.

When to Use It

  • Purge older lookagain runs while preserving today’s results.
  • Keep a rolling window by setting keep to N days (default 1).
  • Delete all runs, including today, with all=true.
  • Ensure only properly named directories are deleted by relying on the exact YYYY-MM-DDTHH-MM-SS pattern.
  • Gracefully handle missing or empty .lookagain by reporting Nothing to Tidy.

Quick Start

  1. Step 1: Run tidy with defaults (tidy) to see what will be kept.
  2. Step 2: Optionally adjust the window (e.g., tidy keep=7) or delete all (tidy all=true).
  3. Step 3: Review the final report (## Tidy Complete or ## Nothing to Tidy) to confirm what was removed and kept.

Best Practices

  • Validate that there are matching run directories before deleting.
  • Rely on the validation step to skip nonmatching folders.
  • Be aware of the defaults: keep=1 and all=false.
  • Review the final Tidy Complete report to confirm what was removed and kept.
  • Use a safe test environment if uncertain about deletions.

Example Use Cases

  • tidy keeps only today (default keep=1) and deletes older runs.
  • tidy keep=7 removes runs older than 7 days, keeping the last 7 days.
  • tidy all=true deletes all lookagain runs, including today.
  • tidy keep=0 keeps only today’s results by deleting any earlier runs.
  • If the .lookagain folder contains stray or nonmatching directories, tidy skips them and deletes only validated ones.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers