agentleFS
UlyssesLeoLeeUlyssesLeoLee/MAGOS/skills/git-cleanup/SKILL.md

git-cleanup

Skill1 starsChanged 8 days agoApache-2.0View on GitHub

预览清理(仅限用户显式调用;--apply 才删除);/git-cleanup [--apply] [--help].

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default: Preview cleanup candidates only.

    line 22
  2. Very specific:

    Do not use commands/*.md for this adapter.

    line 52
  3. Very specific:

    If ../../SKILL.md or ../../references/commands.md cannot be read, name the missing path, report that the MAGOS installation is incomplete, …

    line 54

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “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

GitCleanup

Command adapter for the canonical /GitCleanup command of the MAGOS (Multi-Agent Git Orchestrator) package. Use it only when the user explicitly invokes /git-cleanup in Hermes or $git-cleanup in Codex.

Usage

  • Hermes: /git-cleanup [--apply] [--lang <language>] [--help]
  • Codex: $git-cleanup [--apply] [--lang <language>] [--help]
  • --apply: Recheck each safe local candidate, then apply cleanup only where every safety condition still holds. It does not permit deleting remote branches.
  • --lang <language>: Language of the reply, as a name or code (for example English, ja); Chinese when absent. Command names, options, branch names, paths, SHAs, and status codes stay untranslated.
  • --help: Show this inline usage and argument description, then stop without inspecting or changing the repository.
  • Default: Preview cleanup candidates only; no deletion.

Examples: /git-cleanup, $git-cleanup --apply, $git-cleanup --lang English, $git-cleanup --help.

Arguments

  • Codex: the arguments are the text that follows $git-cleanup in the user's message.
  • Plugin installs prefix the name with the plugin name: /magos:git-cleanup in Hermes, $magos:git-cleanup in Codex; Claude Code hides this adapter and offers the command /magos:GitCleanup instead. The arguments follow the name the same way.
  • Hermes: the arguments are the instruction Hermes appends after the skill content, introduced by "The user has provided the following instruction alongside the skill invocation:" (single command) or User instruction: (stacked commands). An empty instruction means no arguments.

If --help is present, even with other arguments, answer from the inline Usage section above and stop before any tool call, file read, or repository inspection. For an unknown option, explain the error, show this help, and stop. Read the shared files below only for a normal invocation.

Explicit invocation only

A semantic match or automatic skill selection is not authorization to write. Claude Code keeps the model from invoking this adapter through disable-model-invocation: true in its frontmatter, and Codex disables implicit selection for it through agents/openai.yaml; Hermes has no per-skill switch, so this rule applies there by instruction. An explicit invocation is the user's /git-cleanup command (Hermes renders it as "The user has invoked the "git-cleanup" skill" followed by the arguments) or $git-cleanup in Codex. With a plugin install, the user's /magos:git-cleanup (Hermes) or $magos:git-cleanup (Codex) is the same explicit invocation; Claude Code hides this adapter, and there the user's /magos:GitCleanup command is the explicit invocation. If this adapter was selected without such an invocation, preview at most and delete nothing.

Shared files

This adapter belongs to the MAGOS package. The shared files are in the package root, two directories above this skill's directory:

  1. ../../SKILL.md: shared orchestration rules and safety invariants.
  2. ../../references/commands.md section 5. GitCleanup: command contract, cleanup classes, and apply constraints.
  3. ../../references/reconnaissance.md and ../../references/decision-matrix.md: inspection steps and cleanup criteria.

Locate them as follows:

  • Codex: resolve the paths relative to the directory that contains this SKILL.md.
  • Hermes: take the absolute path from the [Skill directory: ...] line (when the skill was loaded with skill_view instead of a slash command, from the skill_dir field it returns), go up two directories, and read the files with the file or terminal tool. The skill viewer rejects paths that contain ... Alternatively, load the skill multi-agent-git-orchestrator (magos:git-orchestrator under a Hermes plugin install) and view its files under references/.
  • Other hosts: resolve the paths relative to this file.

Do not use commands/*.md for this adapter. Those files are Claude Code slash-command wrappers with Claude-specific loading steps.

If ../../SKILL.md or ../../references/commands.md cannot be read, name the missing path, report that the MAGOS installation is incomplete, and do not delete anything; a read-only preview is still allowed.

Execution

Execute the canonical /GitCleanup command only when the user explicitly invoked this command skill. Preview candidates by default; delete only when the explicit command includes --apply and every safety condition still passes. Never run a repository-wide git worktree prune; never remove the invoking worktree or a worktree that is dirty, in progress, or holds ignored files; never delete main or the integration target. Never delete remote branches unless explicitly asked. Reply in the language selected by --lang (Chinese when absent); never translate commands, options, branch names, paths, SHAs, or status codes. Remove --lang and its value from the arguments before parsing the rest.

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.