Skip to content

Add clean-vm agent skill#40

Merged
axeldelafosse merged 4 commits intomainfrom
codex/clean-vm-skill
Mar 25, 2026
Merged

Add clean-vm agent skill#40
axeldelafosse merged 4 commits intomainfrom
codex/clean-vm-skill

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

@axeldelafosse axeldelafosse commented Mar 25, 2026

Summary

  • add a new local clean-vm skill under .agents/skills
  • document a safety-first cleanup workflow for stale loop runs, dev servers, browser windows, and worktrees
  • add UI metadata and require explicit invocation because the skill is destructive

Verification

  • bun run check
  • self review
  • Claude review: PASS

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new agent skill designed to systematically and safely clean up local development virtual machines. The primary goal is to address common issues like orphaned processes, stale development servers, and unused git worktrees that can accumulate over time, ensuring a cleaner and more efficient development environment without disrupting active work. The skill is designed with a strong emphasis on safety and requires explicit user command to prevent unintended data loss or interruption.

Highlights

  • New Agent Skill: A new local agent skill named clean-vm has been added to safely manage and clean development environments.
  • Safety-First Workflow: A detailed, safety-first cleanup workflow is documented for handling stale loop runs, development servers, browser windows, and git worktrees.
  • Explicit Invocation: UI metadata has been added for the skill, and it requires explicit invocation due to its destructive potential, preventing accidental use.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new clean-vm skill, providing comprehensive guidelines and safety rules for cleaning up stale local development environments. This includes identifying and removing inactive loop runs, agent processes, Next.js/Storybook servers, browser windows, and git worktrees. Feedback from the review suggests improving the find command's maxdepth for better efficiency and refining a grep pattern to prevent false positives when identifying processes.

Comment thread .agents/skills/clean-vm/SKILL.md Outdated
```bash
tmux ls 2>/dev/null
tmux list-panes -a -F '#{session_name} #{pane_dead} #{pane_current_command} #{pane_current_path}' 2>/dev/null
find ~/.loop/runs -maxdepth 5 -name manifest.json 2>/dev/null
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The -maxdepth for find seems too large. Based on the project structure in src/loop/run-state.ts, manifests are located at ~/.loop/runs/<repoId>/<runId>/manifest.json. When searching from ~/.loop/runs, the manifest files are at depth 3 relative to the starting directory. A maxdepth of 3 would be more precise and efficient.

Suggested change
find ~/.loop/runs -maxdepth 5 -name manifest.json 2>/dev/null
find ~/.loop/runs -maxdepth 3 -name manifest.json 2>/dev/null

Comment thread .agents/skills/clean-vm/SKILL.md Outdated
Inspect listening processes and map them back to a cwd before killing them.

```bash
lsof -nP -iTCP -sTCP:LISTEN | grep -E 'node|next|storybook'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The grep pattern node is a bit broad and could match other command names containing "node" (e.g., anode). Using the -w flag with grep would make the match more specific to the node command itself, reducing potential false positives during the detection phase.

Suggested change
lsof -nP -iTCP -sTCP:LISTEN | grep -E 'node|next|storybook'
lsof -nP -iTCP -sTCP:LISTEN | grep -w -E 'node|next|storybook'

@axeldelafosse axeldelafosse marked this pull request as ready for review March 25, 2026 22:36
@axeldelafosse axeldelafosse merged commit 94c2f48 into main Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant