Class: Rigor::CLI::SkillDescribe

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

Overview

Builds the ‘rigor skill describe` report (ADR-73): a ProjectStateProbe snapshot, a recommended next skill, and the live catalogue of bundled skills with their current frontmatter descriptions. Extracted from SkillCommand so the command stays a thin dispatcher and this — the “live brain” — owns the routing.

Constant Summary collapse

ENTRY_POINT_SKILL =

The entry-point SKILL itself — excluded from the catalogue because it is the skill being run, not a destination.

"rigor-next-steps"
CATALOG_ORDER =

Adoption-journey order for the catalogue and the order the recommendation decision tree walks. ‘rigor-ask` sits last: it is the journey-agnostic “answer a question about Rigor” companion the agent can offer at any point, never a presence-recommended step.

%w[
  rigor-project-init
  rigor-rbs-setup
  rigor-ci-setup
  rigor-baseline-reduce
  rigor-monkeypatch-resolve
  rigor-editor-setup
  rigor-mcp-setup
  rigor-protection-uplift
  rigor-plugin-tune
  rigor-plugin-author
  rigor-upgrade
  rigor-doctor
  rigor-ask
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(skills:, root: Dir.pwd) ⇒ SkillDescribe

Returns a new instance of SkillDescribe.

Parameters:

  • skills (Array<Hash>)

    discovered skills, each ‘path:`.

  • root (String) (defaults to: Dir.pwd)

    project root to probe (defaults to the cwd).



162
163
164
165
# File 'lib/rigor/cli/skill_describe.rb', line 162

def initialize(skills:, root: Dir.pwd)
  @skills = skills
  @root = root
end

Instance Method Details

#renderString

Returns the full describe report.

Returns:

  • (String)

    the full describe report.



168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/rigor/cli/skill_describe.rb', line 168

def render
  catalog = catalog_skills
  state = ProjectStateProbe.new(@root).to_h
  recommendation = recommend(state, catalog)
  [
    title,
    state_section(state),
    recommendation_section(recommendation),
    catalog_section(catalog),
    agent_prompt(recommendation)
  ].join("\n")
end