#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename qw(basename);
use File::Spec;
use FindBin qw($Bin);

my $command = basename($0);
my $core = File::Spec->catfile( $Bin, '_dashboard-core' );
exec { $^X } $^X, $core, $command, @ARGV;
die "Unable to exec $core for $command: $!";

__END__

=pod

=head1 NAME

skill - private built-in command wrapper for Developer Dashboard

=head1 SYNOPSIS

  dashboard skill ...

=head1 DESCRIPTION

This private helper is staged under F<~/.developer-dashboard/cli/dd/> so the
public C<dashboard> entrypoint can stay a thin switchboard.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes C<dashboard skill>, the command that runs one installed skill command inside its isolated skill runtime. It is the CLI front end for the skill dispatcher.

=head1 WHY IT EXISTS

It exists because skill command execution is built into the dashboard, but the wrapper should stay thin while the dispatcher owns hook order, environment isolation, and command invocation.

=head1 WHEN TO USE

Use this file when changing the C<dashboard skill> CLI contract or the handoff into the skill dispatcher.

=head1 HOW TO USE

Users run C<dashboard skill E<lt>repo-nameE<gt> E<lt>commandE<gt> [args...]>. The staged helper forwards that request into the private runtime, which loads the skill dispatcher and executes the selected command.

=head1 WHAT USES IT

It is used by installed dashboard skills, by skill integration tests, and by contributors verifying that isolated skill commands still receive the expected environment.

=head1 EXAMPLES

Example 1:

  dashboard skill example-skill

Run the public built-in command path that stages or re-enters this helper.

Example 2:

  ~/.developer-dashboard/cli/dd/skill --help

Inspect the staged helper directly after C<dashboard init> or helper extraction has populated the home runtime.

Example 3:

  prove -lv t/05-cli-smoke.t t/30-dashboard-loader.t

Rerun the focused staged-helper and thin-loader tests after changing helper dispatch behavior.

Example 4:

  prove -lr t

Verify that the helper still behaves correctly inside the complete repository suite.


=for comment FULL-POD-DOC END

=cut
