Class: Rigor::CLI::SkillCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/rigor/cli/skill_command.rb

Overview

rigor skill — discover and print the SKILL.md files bundled with the rigortype gem.

Rigor ships a small set of Agent Skills under skills/ that walk an AI coding agent through onboarding (rigor-project-init), baseline reduction (rigor-baseline-reduce), and authoring a plugin (rigor-plugin-author). When Rigor is installed via mise / gem install / etc. the SKILL files live inside the gem checkout — the project being analysed has no copy, so an AI agent has no a priori way to find them.

Grammar (mirrors rigor docs): the positional slot is always a skill name; alternative outputs are flags, so a skill named list or path can never be shadowed by a verb.

  • rigor skill — list bundled skills (the default).
  • rigor skill <name> — print the SKILL.md body (header + body). This is the form AI agents call; the inline body plus the header's absolute paths let the agent act with or without a file-reading tool.
  • rigor skill --full <name>— the body AND every references/*.md inline: the complete, version-current procedure in one call. The thinned SKILL bodies point a frozen (vendored) copy at this so the reader follows the gem's current steps, not a stale local copy.
  • rigor skill --path <name>— one-line absolute path, for a Read tool.
  • rigor skill --list — table of name + absolute path.
  • rigor skill --describe — ADR-73's live entry point: a cheap project-state probe + the recommended next skill + every skill's current description. The rigor-next-steps SKILL routes off this so no version-coupled guidance is frozen into the SKILL. Also spelled describe, and surfaced top-level as rigor describe.

describe is a no-argument action, not a name-slot verb, so it stays first-class alongside --describe.

Constant Summary collapse

USAGE =
<<~USAGE
  Usage: rigor skill [<name>] [--full <name>] [--path <name>] [--list] [--describe]

  With no argument, lists the bundled skills.

    rigor skill                List bundled skills
    rigor skill <name>         Print the SKILL.md body for <name> (with a header)
    rigor skill --full <name>  Print the SKILL.md body AND its references/ inline
                               (the complete, version-current procedure in one call)
    rigor skill --path <name>  Print the absolute path of the SKILL.md file for <name>
    rigor skill --list         List bundled skills (name + absolute path)
    rigor skill --describe     Report project state + recommend the next skill to run

  Examples:
    rigor skill
    rigor skill rigor-project-init
    rigor skill --full rigor-baseline-reduce
    rigor skill --path rigor-baseline-reduce
    rigor skill --describe        (also: rigor describe)
USAGE
SKILLS_ROOT =

The bundled skills live at <gem_root>/skills/. From lib/rigor/cli/skill_command.rb that is three directories up.

File.expand_path("../../../skills", __dir__)

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Rigor::CLI::Command

Instance Method Details

#runInteger

Returns CLI exit status.

Returns:

  • (Integer)

    CLI exit status.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/rigor/cli/skill_command.rb', line 68

def run
  case @argv.first
  when nil
    run_list
  when "-h", "--help", "help"
    print_usage(@out)
    0
  when "describe", "--describe"
    @argv.shift
    run_describe
  when "--list"
    @argv.shift
    run_list
  when "--full"
    @argv.shift
    run_full(@argv.shift)
  when "--path"
    @argv.shift
    run_path(@argv.shift)
  when "--print"
    @argv.shift
    run_print(@argv.shift)
  else
    run_print(@argv.shift)
  end
end