Claude-skill-registry kura-perl
Store and export type constraints for Type::Tiny, Moose, Data::Checks, and more
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/kura-perl" ~/.claude/skills/majiayu000-claude-skill-registry-kura-perl && rm -rf "$T"
manifest:
skills/data/kura-perl/SKILL.mdsource content
kura - Unified Type Constraint Storage
kura provides a simple way to store and export type constraints from multiple libraries.
Core Usage
Basic Declaration
use Exporter 'import'; use Types::Common -types; use kura Name => StrLength[1, 255]; use kura Age => Int & sub { $_ >= 0 }; use kura Email => sub { /@/ }; # Code ref auto-converted
Syntax:
use kura NAME => CONSTRAINT;
Supported Constraints
- Type objects (Type::Tiny, Moose, Specio, Data::Checks)
- Code references (converted to Type::Tiny)
- Hash references with
andconstraintmessage
Practical Examples
Export Types
package MyTypes { use parent 'Exporter::Tiny'; use Types::Common -types; use kura Name => StrLength[1, 255]; use kura Email => Str & sub { /@/ }; } use MyTypes qw(Name Email); Name->check('John'); # true
Built-in Class (v5.40+)
class User { use Types::Common -types; use kura Name => StrLength[1, 255]; field $name :param :reader; ADJUST { Name->assert_valid($name); } } my $user = User->new(name => ''); # Dies: validation error
Best Practices
- Always load an exporter:
use Exporter 'import'; - Declare in order: Define child constraints before parent constraints
use kura Child => Str; use kura Parent => Dict[ name => Child ]; # Correct order - Private constraints: Prefix with
to prevent export_use kura _Private => Str; # Not exported - Package variables:
and@EXPORT_OK
are auto-populated@KURA