getty-perl-core

Enforces Getty house rules for Perl module loading, errors, strings, control flow, and cpanfile management.

1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/Getty/p5-alien-libssh --skill getty-perl-core-getty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: getty-perl-core
Source: https://github.com/Getty/p5-alien-libssh/tree/main/.claude/skills/getty-perl-core
Command: npx skills add https://github.com/Getty/p5-alien-libssh --skill getty-perl-core-getty

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Perl codebases accumulate inconsistent style and subtle bugs when developers rely on defaults: lazy require calls, die instead of croak, wrong JSON modules, and mis-pinned Getty-authored dependencies that break builds. This Skill loads the non-negotiable Getty house rules into context on any Perl edit so generated and reviewed code matches the house standard. ## Core Features & Use Cases - Module loading and object system rules: mandates top-level use, one object system per distribution, is => 'ro' defaults, lazy_build, namespace::autoclean, and invocant-based dispatch instead of hardcoded class names. - Errors, strings, and data conventions: enforces croak over die, concatenation over interpolation, Path::Tiny for file operations, JSON::MaybeXS with canonical encoders, and deterministic serializers. - cpanfile and Changes discipline: pins Getty-authored distributions against released CPAN versions (never the repo's next-unreleased $VERSION), and requires a {{$NEXT}} bullet in the same commit as any user-facing change. - Use Case: When editing a Getty Perl module, the Skill flags a require Foo; inside a controller action, rewrites it as a top-level use, and corrects a cpanfile pin that names an unreleased sibling version. ## Quick Start Review this Perl module edit and fix anything that violates the Getty house rules for module loading, error handling, and cpanfile pinning.

Frequently Asked Questions about getty-perl-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How should Perl modules be loaded in Getty projects?

Every dependency loads at compile time with a top-level `use Module;` statement. Using `require` to shave startup time is forbidden; it is only acceptable for true runtime plugin loading where the class name comes from config or a database at runtime.

Should I use croak or die for Perl error handling?

Use `croak`, never `die`, so errors report the caller's line rather than the module's internal line. Import it explicitly with `use Carp qw( croak );` and name the originating operation in the message.

How do I pin Getty-authored dependencies in a cpanfile?

Check `cpanm --info Module::Name` for the released CPAN version and pin that, not the repo's `$VERSION`, which is always one ahead of CPAN. Pinning the unreleased version is only correct when the change spans both repos and the dependency ships first.

What JSON module should Perl code use?

Use `JSON::MaybeXS` exclusively, never `JSON::PP`, `JSON::XS`, or `Cpanel::JSON::XS` directly. Encoders get `canonical => 1` and `convert_blessed => 1`, and booleans come from `JSON->true` and `JSON->false`.

When does a change belong in the Changes file?

Add a bullet under `{{$NEXT}}` in the same commit as any user-facing change, measured against the last CPAN release rather than the last commit. Something broken and fixed while unreleased was never visible to consumers and gets no bullet.

Why dispatch methods through $self instead of a hardcoded class name?

A literal `Some::Package->helper(...)` nails the call to that exact package so no subclass override or mock can reach it. Routing through the invocant or a named resolver method like `backend_class` lets subclasses swap behavior while existing callers keep working.