agentleFS
bazel-contribbazel-contrib/rules_python/.agents/skills/conversation-done/SKILL.md

conversation-done

Skill692 starsChanged 6 days agoApache-2.0View on GitHub

Clean up files and resources that aren't part of the agent conversation (e.g. Bazel output base, Git worktree, local/remote branches)

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When agents work on tasks, several external resources outside the agent conversation directory (~/.gemini/jetski/brain/) are created:

    line 15
  2. Distinctive:

    When invoked from within the agent's worktree:

    line 42
  3. Distinctive:

    Main Repository Protection: Never removes the primary Git repository worktree.

    line 93
  4. Very specific:

    Protected Branches: Never deletes main, master, release/*, or HEAD.

    line 95
  5. Very specific:

    Upstream Remote Protection: Never deletes branches on upstream.

    line 97
  6. Very specific:

    No Expunge Rule: Never runs bazel clean --expunge.

    line 98
  7. Very specific:

    After running the cleanup script, always report to the user what resources were deleted (or would be deleted in --dry-run mode), including:

    line 103
  8. Very specific:

    If any resources were skipped, left intact via --leave-* flags, or not found, note that briefly in the summary.

    line 113

≈ “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

Conversation Done Skill

Cleans up external workspace resources created during agent workflows while preserving agent conversation data, chat history, and brain transcripts.

Overview

When agents work on tasks, several external resources outside the agent conversation directory (~/.gemini/jetski/brain/) are created:

  1. Bazel Output Base(s): Intermediate build artifacts, execroot trees, and running Bazel server and persistent worker processes (consuming tens of gigabytes of disk and substantial RAM).
  2. Git Worktree: The checked-out directory on disk.
  3. Local Git Branch: The feature branch associated with the worktree.
  4. Remote Git Branch: The feature branch pushed to the user's fork (e.g., origin).
  5. Conversation Name: Once cleanup completes without errors, the active conversation title is prefixed with "done " (without duplicating an existing "done " prefix, capped at 70 characters).

This skill safely shuts down active build processes, reclaims these external resources, and marks the conversation title as "done " without removing the conversation transcript or chat history.

Script Location

The cleanup script is located at: ./.agents/skills/conversation-done/scripts/cleanup.py

Usage

1. Clean Up Current Workspace

When invoked from within the agent's worktree:

# Preview what would be removed:
./.agents/skills/conversation-done/scripts/cleanup.py --dry-run

# Clean up resources (interactive confirmation if TTY):
./.agents/skills/conversation-done/scripts/cleanup.py

# Force cleanup non-interactively (ideal for agents/scripts):
./.agents/skills/conversation-done/scripts/cleanup.py --force

2. Clean Up by Worktree Path or Branches

# By worktree path:
./.agents/skills/conversation-done/scripts/cleanup.py \
  --worktree /path/to/worktree --force

# By branch name:
./.agents/skills/conversation-done/scripts/cleanup.py \
  --branches my-feature-branch --force

# By multiple branches:
./.agents/skills/conversation-done/scripts/cleanup.py \
  --branches branch-one branch-two --force

3. Inspect Active Resources

List all worktrees, branches, and Bazel output bases:

./.agents/skills/conversation-done/scripts/cleanup.py --list

Selective Cleanup Flags

Fine-tune what gets cleaned up using selective leave flags:

  • --leave-bazel-output-base: Leave Bazel output bases and build caches intact.
  • --leave-worktree: Leave Git worktree directory on disk.
  • --leave-branch: Keep local Git branch.
  • --leave-remote: Do not delete branch from remote fork.
  • --remote <name>: Override remote destination (default: pushRemote or origin).

Safety Guarantees

  • Main Repository Protection: Never removes the primary Git repository worktree.
  • Protected Branches: Never deletes main, master, release/*, or HEAD.
  • Upstream Remote Protection: Never deletes branches on upstream.
  • No Expunge Rule: Never runs bazel clean --expunge; shuts down servers gracefully and deletes the specific output base directory directly.

Reporting Results

After running the cleanup script, always report to the user what resources were deleted (or would be deleted in --dry-run mode), including:

  • Bazel Output Base(s): Paths and reclaimed disk space sizes.
  • Git Worktree: Removed worktree directory path.
  • Local Git Branch: Deleted local branch name.
  • Remote Git Branch: Deleted remote branch (<remote>/<branch>).
  • Conversation Name: Updated conversation title (prefixed with "done " after successful cleanup).

If any resources were skipped, left intact via --leave-* flags, or not found, note that briefly in the summary.

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.