File Coverage

blib/lib/SignalWire/Agents/Skills/Builtin/ClaudeSkills.pm
Criterion Covered Total %
statement 20 23 86.9
branch n/a
condition 2 2 100.0
subroutine 8 9 88.8
pod 0 4 0.0
total 30 38 78.9


line stmt bran cond sub pod time code
1             package SignalWire::Agents::Skills::Builtin::ClaudeSkills;
2 3     3   20 use strict;
  3         6  
  3         115  
3 3     3   13 use warnings;
  3         5  
  3         253  
4 3     3   16 use Moo;
  3         4  
  3         21  
5             extends 'SignalWire::Agents::Skills::SkillBase';
6              
7 3     3   1205 use SignalWire::Agents::Skills::SkillRegistry;
  3         9  
  3         1340  
8             SignalWire::Agents::Skills::SkillRegistry->register_skill('claude_skills', __PACKAGE__);
9              
10             has '+skill_name' => (default => sub { 'claude_skills' });
11             has '+skill_description' => (default => sub { 'Load Claude SKILL.md files as agent tools' });
12             has '+supports_multiple_instances' => (default => sub { 1 });
13              
14 4     4 0 2377 sub setup { 1 }
15              
16             sub register_tools {
17 3     3 0 588 my ($self) = @_;
18 3   100     21 my $prefix = $self->params->{tool_prefix} // 'claude_';
19             # In the Perl port, we register a stub tool that represents the skill.
20             # Full file-discovery would require YAML parsing (not available in minimal installs).
21             $self->define_tool(
22             name => "${prefix}skill",
23             description => "Claude skill tool (stub)",
24             parameters => {
25             type => 'object',
26             properties => {
27             arguments => { type => 'string', description => 'Arguments to pass' },
28             },
29             required => ['arguments'],
30             },
31             handler => sub {
32 0     0   0 my ($args, $raw) = @_;
33 0         0 require SignalWire::Agents::SWAIG::FunctionResult;
34 0         0 return SignalWire::Agents::SWAIG::FunctionResult->new(
35             response => "Claude skill invoked with: $args->{arguments}"
36             );
37             },
38 3         47 );
39             }
40              
41             sub get_hints {
42 1     1 0 5 my ($self) = @_;
43 1         3 return ['claude', 'skill'];
44             }
45              
46             sub get_parameter_schema {
47             return {
48 1     1 0 2413 %{ SignalWire::Agents::Skills::SkillBase->get_parameter_schema },
  1         4  
49             skills_path => { type => 'string', required => 1 },
50             tool_prefix => { type => 'string', default => 'claude_' },
51             };
52             }
53              
54             1;