Agent skill

Refactor Command To Commandlineresult

by ruby-git in ruby-git/ruby-git

Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers.

MITAuto-check passedDevelopment

Install Refactor Command To Commandlineresult

skills CLI
$ npx skills add ruby-git/ruby-git --skill refactor-command-to-commandlineresult -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ruby-git/ruby-git refactor-command-to-commandlineresult --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ruby-git/ruby-git.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/refactor-command-to-commandlineresult .claude/skills/refactor-command-to-commandlineresult && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refactor-command-to-commandlineresult
GitHub stars
1.8k
Token cost
~1.3k tokens
SKILL.md length
470 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers.

  • Works in 5 steps: Move parsing/transforming logic out of… → Replace legacy ARGS constant + custom… → Remove custom #call body and add #… → …
  • Tasks that involve Refactoring
  • SKILL.md covers Contents, How to use this skill, Prerequisites and Related skills, plus 6 more sections
  • Calls bundle and git

What it does

Refactor Command To Commandlineresult is an agent skill from ruby-git/ruby-git. Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers. Use during architectural redesign refactoring.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring and Git workflow. It works with Git. The repository describes itself as: Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary. The licence is MIT.

When your agent uses it

  • Tasks that involve Refactoring
  • Tasks that involve Git workflow

Example prompts

  • “Use the refactor-command-to-commandlineresult skill to migrate a command class that still performs parsing or custom execution logic to return raw…”
  • “/refactor-command-to-commandlineresult”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Move parsing/transforming logic out of command class into caller/facade/parser.
  2. Replace legacy ARGS constant + custom initialize with arguments do +
  3. Remove custom #call body and add # @!method call(*, **) YARD directive.
  4. If command requires non-default success exits, add allow_exit_status with
  5. Update callers to consume Git::CommandLine::Result and parse result.stdout where

What it can do on your machine

Read from SKILL.md and the folder at commit f3bf20f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bundle
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor Command To Commandlineresult loads about 1.3k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 470 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ruby-git/ruby-git at commit f3bf20f, republished under its MIT licence (© ruby-git). 470 words, ~1,260 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-command-to-commandlineresult/SKILL.md (or your agent's skills folder).
name
refactor-command-to-commandlineresult
description
Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers. Use during architectural redesign refactoring.

Refactor Command to CommandLineResult

Migrate a command that still performs parsing or custom execution logic to the Git::Commands::Base pattern, so command classes return raw Git::CommandLine::Result and parsing moves to facade/parser layers.

Contents

How to use this skill

Attach this file to your Copilot Chat context, then invoke it with the command class or source file to migrate. Examples:

text
Using the Refactor Command to CommandLineResult skill, migrate
Git::Commands::Stash::Pop to the Base pattern.
text
Refactor Command to CommandLineResult: lib/git/commands/branch/delete.rb

The invocation needs the command class name or file path of the command to refactor.

Prerequisites

Before starting, you MUST load the following skill(s) in their entirety:

  • YARD Documentation — authoritative source for YARD formatting rules and writing standards;

Target end state

ruby
class SomeCommand < Git::Commands::Base
  arguments do
    ...
  end

  # optional for non-zero successful exits
  # rationale comment
  # allow_exit_status 0..1

  # @!method call(*, **)
  #
  #   @overload call(**options)
  #
  #     Execute the git ... command.
  #
  #     @return [Git::CommandLine::Result]
end

Refactor steps

  1. Move parsing/transforming logic out of command class into caller/facade/parser.
  2. Replace legacy ARGS constant + custom initialize with arguments do + inheritance from Base.
  3. Remove custom #call body and add # @!method call(*, **) YARD directive.
  4. If command requires non-default success exits, add allow_exit_status with rationale comment.
  5. Update callers to consume Git::CommandLine::Result and parse result.stdout where needed.

What to remove from command classes

  • parser invocations
  • output transformation logic
  • literal entries for policy/output-control flags (e.g. literal '--no-edit', literal '--verbose', literal '--no-progress', literal '--no-color') — command classes are neutral, faithful representations of the git CLI; convert to flag_option / value_option so the facade can pass the policy value. See "Command-layer neutrality" in CONTRIBUTING.md.
  • manual raise_on_failure / manual exit-code checks (unless temporarily needed in an unmigrated class)
  • duplicated bind/execute logic
Show full SKILL.md (176 more words)Show less

What to update in tests

  • unit specs should assert CLI args and Git::CommandLine::Result behavior
  • remove parsed-object assertions from command unit specs
  • move parsing expectations to parser/facade tests
  • include raise_on_failure: false in mocked command expectations

YARD updates

  • update @return to Git::CommandLine::Result
  • keep command-specific @overload docs nested under # @!method call(*, **) directive
  • ensure @raise wording reflects allowed range behavior
  • tag short descriptions must not end with punctuation (no trailing period, comma, or colon)
  • multi-paragraph tag descriptions must have a blank comment line (#) between the short description and each continuation paragraph

Migration process and internal compatibility

See Command Implementation for the canonical phased rollout checklist and internal compatibility contract. In summary:

  • always work on a feature branch — never commit or push directly to main; create a branch before starting (git checkout -b <feature-branch-name>) and open a pull request when the slice is ready
  • perform refactor in phased slices (pilot/family)
  • keep each slice independently revertible
  • do not mix unrelated behavior changes with refactor-only changes
  • pass slice gates: bundle exec rspec, bundle exec rake test, bundle exec rubocop, bundle exec rake yard

© ruby-git, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/refactor-command-to-commandlineresult of ruby-git/ruby-git.

Open the folder on GitHubat commit f3bf20f

Compare with similar skills

Refactor Command To Commandlineresult next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refactor Command To Commandlineresult compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Command To Commandlineresult this skillruby-git/ruby-git1.8k—~1.3kAutomated safety check: PassMIT
Merge Masterkeybase/client9.3k—~1.3kAutomated safety check: PassBSD-3-Clause
Docs Update from DiffQwenLM/qwen-code28k—~1.1kAutomated safety check: PassApache-2.0
Nemo Rl Auto ResearchNVIDIA/skills3.5k—~2.3kAutomated safety check: PassApache-2.0
Change Boottikalk/adlc-team-skills141—~1.8kAutomated safety check: PassMIT
Semantic Szz Analyzermajiayu000/claude-skill-registry6661 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Merge Master

    keybase/client

    A skill your agent uses when periodically merging upstream master commits into a long-running refactor branch where code has moved, been renamed, or restructured — guiding careful per-commit…

    9.3k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Docs Update from Diff

    QwenLM/qwen-code

    Reads local git changes and updates only the matching docs pages, so documentation stays in sync with uncommitted or recent code changes.

    28k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Autonomous NeMo-RL research agent workflow for directed hypothesis testing and open-ended discovery.

    3.5k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Change Boot

    tikalk/adlc-team-skills

    A skill your agent uses when past-change rationale matters (refactoring unfamiliar code, revert or hotfix analysis, issue-linked commit archaeology, session authors git changes with human-authored…

    141 GitHub stars~1.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Semantic Szz Analyzer

    majiayu000/claude-skill-registry

    Identify bug-introducing commits using semantic analysis that extends traditional SZZ algorithm.

    666 GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed

More from ruby-git/ruby-git

All 30 skills in this repo
  • Addresses unresolved pull request review threads and suppressed (low-confidence) Copilot review comments on the current branch, folds each fix into the…

    1.8k GitHub stars~657 tokensUpdated 5 days ago
    Auto-check passed
  • Breaking Change Analysis

    ruby-git/ruby-git

    Assesses what an API change would break before it is made, finds every usage, documents the impact and plans a deprecation or migration path.

    1.8k GitHub stars~1.7k tokensUpdated 5 days ago
    Auto-check passed
  • Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally.

    1.8k GitHub stars~1.9k tokensUpdated 5 days ago
    Auto-check passed
  • Scaffolds and reviews `Git::Commands::*` classes in the ruby-git library, with unit tests, integration tests and YARD docs, using the Base command architecture.

    1.8k GitHub stars~3k tokensUpdated 5 days ago
    Auto-check passed
  • Gem Dependency Management

    ruby-git/ruby-git

    Workflow for updating gem dependencies and fixing CVEs in the ruby-git project: assess with bundle outdated and audit, edit the gemspec, test, then commit with conventional messages.

    1.8k GitHub stars~806 tokensUpdated 5 days ago
    Auto-check passed
  • Migrates a direct command call in Ruby Git's Git::Lib to a Git::Commands class, as part of a Strangler Fig redesign, with a plan, legacy tests and a pull request.

    1.8k GitHub stars~4.4k tokensUpdated 5 days ago
    Auto-check passed

Works with

Categories

Questions about Refactor Command To Commandlineresult

What does Refactor Command To Commandlineresult do?

Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers. Refactor Command To Commandlineresult is an agent skill from ruby-git/ruby-git. Migrates a command class that still performs parsing or custom execution logic to return raw Git::CommandLine::Result, moving parsing to facade/parser layers.

When should I use Refactor Command To Commandlineresult?

Refactor Command To Commandlineresult fits situations like: tasks that involve Refactoring; tasks that involve Git workflow.

How do I install Refactor Command To Commandlineresult in Claude Code?

Run `npx skills add ruby-git/ruby-git --skill refactor-command-to-commandlineresult -a claude-code`. Or copy the skill folder (.github/skills/refactor-command-to-commandlineresult in ruby-git/ruby-git) into .claude/skills/refactor-command-to-commandlineresult in your project. Claude Code loads it when a task matches its description.

How do I install Refactor Command To Commandlineresult in Codex?

Run `npx skills add ruby-git/ruby-git --skill refactor-command-to-commandlineresult -a codex`. Or copy the skill folder (.github/skills/refactor-command-to-commandlineresult in ruby-git/ruby-git) into .agents/skills/refactor-command-to-commandlineresult in your project. Codex loads it when a task matches its description.

Can I use Refactor Command To Commandlineresult in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ruby-git/ruby-git --skill refactor-command-to-commandlineresult -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor-command-to-commandlineresult, .gemini/skills/refactor-command-to-commandlineresult, .github/skills/refactor-command-to-commandlineresult and .opencode/skills/refactor-command-to-commandlineresult in your project.

What does Refactor Command To Commandlineresult need to run?

Going by SKILL.md and its folder, Refactor Command To Commandlineresult needs the command-line tools its instructions call (bundle and git).

Does Refactor Command To Commandlineresult access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Refactor Command To Commandlineresult safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Refactor Command To Commandlineresult use?

Refactor Command To Commandlineresult is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactor Command To Commandlineresult use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor Command To Commandlineresult?

Skills that share tags, products or a category with Refactor Command To Commandlineresult: Merge Master (keybase/client, 9.3k stars), Docs Update from Diff (QwenLM/qwen-code, 28k stars), Nemo Rl Auto Research (NVIDIA/skills, 3.5k stars) and Change Boot (tikalk/adlc-team-skills, 141 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Command To Commandlineresult?

ruby-git (a GitHub organization) maintains it in ruby-git/ruby-git, which has 1,799 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 2, 2026.

Source: ruby-git/ruby-git on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.