NAME
Developer::Dashboard::CLI::Skills - lightweight skills helper dispatch
SYNOPSIS
use Developer::Dashboard::CLI::Skills qw(run_skills_command);
run_skills_command(command => 'skills', args => \@ARGV);
DESCRIPTION
Implements the staged d2 skills helper so the public entrypoint can hand off skill management to a dedicated Perl module instead of embedding the action parsing inline.
PURPOSE
This module is the command runtime behind d2 skills and the singular d2 skill alias. It owns the CLI parsing for skill install, uninstall, enable, disable, list, and usage; renders table output by default for install summaries; supports -o json for machine-readable install payloads; and handles the internal dotted-command handoff used by d2 <repo-name>.<command>.
WHY IT EXISTS
It exists because the skill lifecycle contract grew beyond a single inline branch. Keeping that contract in one dedicated module makes it easier to evolve the CLI, preserve JSON output guarantees, keep disabled-skill semantics consistent across management commands, and route dotted skill command execution without restoring a separate singular helper.
WHEN TO USE
Use this file when changing the public d2 skills ... verbs, the JSON payloads returned by list or usage, or the human-facing table output used for quick inspection in a terminal. Remote Git installs accept -b or --branch; a fresh install tries master then main, while reinstall keeps the currently checked-out named branch unless explicitly overridden.
HOW TO USE
Call run_skills_command with the public helper name and argv array reference. The module builds a lightweight path registry, constructs a skill manager, dispatches the requested action, and prints either canonical JSON or sectioned tables depending on -o json or -o table. The default output for install, list, usage, enable, disable, and uninstall is a human-readable summary table, while -o json returns the full machine payload. The thin d2 switchboard also routes dotted skill execution through this helper with an internal action so the public execution contract stays d2 <repo-name>.<command>.
WHAT USES IT
It is used by the staged skills private helper, by dotted skill command dispatch from the public switchboard, by CLI smoke and skill lifecycle tests, and by contributors verifying how disabled skills remain installed yet drop out of runtime lookup.
EXAMPLES
d2 skills list
d2 skills list -o table
d2 skills install /absolute/path/to/example-skill
d2 skills install -b main git@github.com:user/example-skill.git
d2 skills install browser foo/bar git@github.com:user/example-skill.git
d2 skill install browser
d2 skills install --ddfile
d2 skills usage example-skill
d2 skills usage example-skill -o table
d2 skills disable example-skill
d2 skills enable example-skill