blib/lib/SignalWire/Agents/Skills/Builtin/ClaudeSkills.pm

filter: Statementstmt 90.6% 29 / 32 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 91.6% 11 / 12 Podpod 0.0% 0 / 4 totaltotal 84.3% 43 / 51 CC 2 SCAR 2.3
CC
2
Cov
91%
register_tools
2.2
__ANON__
2.0
BEGIN
1.0
CRAP 1.3
« blib/lib/SignalWire/Agents/REST/Namespaces/Project.pm ↑ Summary blib/lib/SignalWire/Agents/REST/Namespaces/Chat.pm »
1 package SignalWire::Agents::Skills::Builtin::ClaudeSkills;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 extends 'SignalWire::Agents::Skills::SkillBase';
6  
7 3 ▶use SignalWire::Agents::Skills::SkillRegistry;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 SignalWire::Agents::Skills::SkillRegistry->register_skill('claude_skills', __PACKAGE__);
9  
10 6 ▶has '+skill_name' => (default => sub { 'claude_skills' });
Subroutine __ANON__: called CC=1 SCAR=0.0
11 6 ▶has '+skill_description' => (default => sub { 'Load Claude SKILL.md files as agent tools' });
Subroutine __ANON__: called CC=1 SCAR=0.0
12 6 ▶has '+supports_multiple_instances' => (default => sub { 1 });
Subroutine __ANON__: called CC=1 SCAR=0.0
13  
14 4 ▶sub setup { 1 }
Subroutine setup: called CC=1 SCAR=0.0
Pod undocumented
15  
16 3 ▶sub register_tools {
Subroutine register_tools: called CC=2 SCAR=7.9
Pod undocumented
17 3 my ($self) = @_;
18 3 ▶ my $prefix = $self->params->{tool_prefix} // 'claude_';
Condition100%2/2
$self->params->{"tool_prefix"} // "claude_"
l!l
12
MC/DC100%1/1
$self->params->{"tool_prefix"} // "claude_"
$self->params->{"tool_prefix"}
Truth table100%2/2
A
A= $self->params->{"tool_prefix"}
Aresult
11
00
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 0 ▶ handler => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 0 my ($args, $raw) = @_;
33 0 require SignalWire::Agents::SWAIG::FunctionResult;
34 0 return SignalWire::Agents::SWAIG::FunctionResult->new(
35 response => "Claude skill invoked with: $args->{arguments}"
36 );
37 },
38 3 );
39 }
40  
41 1 ▶sub get_hints {
Subroutine get_hints: called CC=1 SCAR=0.0
Pod undocumented
42 1 my ($self) = @_;
43 1 return ['claude', 'skill'];
44 }
45  
46 1 ▶sub get_parameter_schema {
Subroutine get_parameter_schema: called CC=1 SCAR=0.0
Pod undocumented
47 return {
48 1 %{ SignalWire::Agents::Skills::SkillBase->get_parameter_schema },
49 skills_path => { type => 'string', required => 1 },
50 tool_prefix => { type => 'string', default => 'claude_' },
51 };
52 }
53  
54 3 1;
« blib/lib/SignalWire/Agents/REST/Namespaces/Project.pm ↑ Summary blib/lib/SignalWire/Agents/REST/Namespaces/Chat.pm »