perl-patterns

Validate Perl code against Moose patterns and standards.

11|1|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill perl-patterns-mindcockpit-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perl-patterns
Source: https://github.com/mindcockpit-ai/cognitive-core/tree/main/skills/cellular/templates/perl-project
Command: npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill perl-patterns-mindcockpit-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many Perl projects lack consistent Moose usage, leading to brittle code, missing immutability, and poor error handling.

Core Features & Use Cases

  • Standard Enforcement: Checks for required Moose macros such as namespace::autoclean and make_immutable.
  • Error Handling: Verifies use of Try::Tiny instead of eval.
  • Logging & Dependency Injection: Ensures a logger is declared and dependencies are injected via constructors. Use case: Run the skill on a codebase to automatically flag modules that deviate from the defined patterns.

Quick Start

Instruct the perl-patterns skill to audit the file lib/MyModule.pm for Moose compliance.

Frequently Asked Questions about perl-patterns

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

FAQPage Schema
How do I enforce Moose patterns and standards in Perl code?

To enforce Moose patterns in Perl, validate modules against required macros like namespace::autoclean and make_immutable, while checking for proper attribute builders, Try::Tiny error handling, and declared loggers.

What is the standard way to handle errors in Perl Moose modules?

The standard way to handle errors in Perl Moose modules is by using Try::Tiny instead of eval. This ensures consistent error handling and prevents brittle code across the project's architecture.

How do I check if a Perl Moose module has make_immutable applied?

To check if a Perl Moose module has make_immutable applied, audit the file or directory against defined Moose standards. This validation flags missing immutability constructs and ensures clean, optimized code.

Does static analysis for Perl check dependency injection and logging setup?

Static analysis for Perl validates dependency injection by checking if dependencies are injected via constructors, and verifies logging by ensuring a logger is properly declared within the Moose modules.

Why should I use namespace::autoclean in Perl Moose projects?

You should use namespace::autoclean in Perl Moose projects to remove imported symbols and prevent namespace pollution. Validating its presence ensures modules maintain clean imports and adhere to code-quality standards.