class InstallSkills extends Command

Artisan Command: Install Beartropy AI coding skills.

Auto-discovers skills from all installed beartropy/ packages using convention-based scanning (.claude/skills/bt-{pkg}- directories and docs/llms/*.md files) with optional skills.json overrides.

The component skill for each package is generated dynamically by concatenating all per-component LLM reference docs from docs/llms/.

Constants

protected AGENTS

All supported agent identifiers.

protected AGENT_CONFIG

Agent configuration map.

Properties

protected string $signature
protected string $description

Methods

int
handle()

Execute the console command.

array
discoverPackages()

Discover all beartropy packages that expose skills.

array|null
resolvePackageSkills(string $root, string $slug)

Resolve skills for a single package root.

array
getSkillContents()

Get all skill contents from all discovered packages.

string
buildComponentSkill(string $llmsDir, string|null $staticHeaderPath, string $skillName, string $packageName)

Build a component skill by concatenating LLM docs.

string
buildReadme(array $skills)

Build a dynamic README.md listing all installed skills grouped by package.

string|null
extractFrontmatterField(string $content, string $field)

Extract a field value from YAML frontmatter.

int
installForAgents(array $agents)

Install skills for the given agents.

int
installForAgent(string $agent, array $skills)

Install skills for a single agent.

int
installModular(string $agent, array $skills)

Install modular format (Claude Code): one directory per skill with SKILL.md.

int
installSingle(string $agent, array $skills)

Install single-file format (Codex, Copilot): all skills concatenated into one file.

int
installMultiFile(string $agent, array $skills)

Install multi-file format (Cursor, Windsurf): one file per skill.

int
removeForAgents(array $agents)

Remove skills for the given agents.

bool
removeForAgent(string $agent)

Remove skills for a single agent.

bool
removeModular(string $agent)

Remove modular skills (Claude Code).

bool
removeSingle(string $agent)

Remove single-file skills (Codex, Copilot).

bool
removeMultiFile(string $agent)

Remove multi-file skills (Cursor, Windsurf).

string
stripFrontmatter(string $content)

Strip YAML frontmatter from content.

array
findExistingSkills(string $targetDir)

Find existing Beartropy skill directories (bt- and legacy beartropy-).

Details

at line 86
int handle()

Execute the console command.

Return Value

int

at line 117
protected array discoverPackages()

Discover all beartropy packages that expose skills.

Always includes self (beartropy/ui from source path). Scans vendor/beartropy/* for sibling packages.

Return Value

array

at line 164
protected array|null resolvePackageSkills(string $root, string $slug)

Resolve skills for a single package root.

Checks for skills.json first for explicit overrides, then falls back to convention-based scanning of .claude/skills/bt-{slug}-* directories.

Parameters

string $root
string $slug

Return Value

array|null

at line 234
protected array getSkillContents()

Get all skill contents from all discovered packages.

Return Value

array

at line 300
protected string buildComponentSkill(string $llmsDir, string|null $staticHeaderPath, string $skillName, string $packageName)

Build a component skill by concatenating LLM docs.

Uses a static SKILL.md as the header (intent-mapping / selection guides) if available, then appends all per-component LLM reference docs.

Parameters

string $llmsDir
string|null $staticHeaderPath
string $skillName
string $packageName

Return Value

string

at line 348
protected string buildReadme(array $skills)

Build a dynamic README.md listing all installed skills grouped by package.

Parameters

array $skills

Return Value

string

at line 395
protected string|null extractFrontmatterField(string $content, string $field)

Extract a field value from YAML frontmatter.

Parameters

string $content
string $field

Return Value

string|null

at line 423
protected int installForAgents(array $agents)

Install skills for the given agents.

Parameters

array $agents

Return Value

int

at line 451
protected int installForAgent(string $agent, array $skills)

Install skills for a single agent.

Parameters

string $agent
array $skills

Return Value

int

at line 467
protected int installModular(string $agent, array $skills)

Install modular format (Claude Code): one directory per skill with SKILL.md.

Parameters

string $agent
array $skills

Return Value

int

at line 541
protected int installSingle(string $agent, array $skills)

Install single-file format (Codex, Copilot): all skills concatenated into one file.

Parameters

string $agent
array $skills

Return Value

int

at line 612
protected int installMultiFile(string $agent, array $skills)

Install multi-file format (Cursor, Windsurf): one file per skill.

Parameters

string $agent
array $skills

Return Value

int

at line 690
protected int removeForAgents(array $agents)

Remove skills for the given agents.

Parameters

array $agents

Return Value

int

at line 710
protected bool removeForAgent(string $agent)

Remove skills for a single agent.

Parameters

string $agent

Return Value

bool

at line 726
protected bool removeModular(string $agent)

Remove modular skills (Claude Code).

Scans for all bt- and legacy beartropy- directories.

Parameters

string $agent

Return Value

bool

at line 770
protected bool removeSingle(string $agent)

Remove single-file skills (Codex, Copilot).

Parameters

string $agent

Return Value

bool

at line 797
protected bool removeMultiFile(string $agent)

Remove multi-file skills (Cursor, Windsurf).

Scans for all bt- and legacy beartropy- files.

Parameters

string $agent

Return Value

bool

at line 834
protected string stripFrontmatter(string $content)

Strip YAML frontmatter from content.

Parameters

string $content

Return Value

string

at line 851
protected array findExistingSkills(string $targetDir)

Find existing Beartropy skill directories (bt- and legacy beartropy-).

Parameters

string $targetDir

Return Value

array