plugins/perl-development/skills/perl-lint/SKILL.md
This skill should be used when the user asks to lint Perl code, run perlcritic, check Perl style, format Perl code, run perltidy, or mentions Perl Critic policies, code formatting, or style checking.
npx skillsauth add jamie-bitflight/claude_skills perl-lintInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run Perl::Critic analysis and perltidy formatting with automatic tool detection.
First, verify tools are available:
# Check perlcritic
command -v perlcritic >/dev/null && echo "perlcritic available" || echo "Install: cpanm Perl::Critic"
# Check perltidy
command -v perltidy >/dev/null && echo "perltidy available" || echo "Install: cpanm Perl::Tidy"
# Default analysis (severity 5 - gentle)
perlcritic script.pl
# All severities (1 = strictest)
perlcritic --severity 1 script.pl
# Specific severity level
perlcritic --severity 3 script.pl
# With verbose explanations
perlcritic --verbose 11 script.pl
# Single policy
perlcritic --single-policy RequireUseStrict script.pl
# Exclude policies
perlcritic --exclude RequireUseWarnings script.pl
| Level | Name | Description | | ----- | ------ | ----------------------------- | | 5 | Gentle | Obvious, unambiguous issues | | 4 | Stern | Usually bad practices | | 3 | Harsh | Controversial but recommended | | 2 | Cruel | Pickier about style | | 1 | Brutal | Maximum strictness |
| Policy | Severity | Issue |
| --------------------------- | -------- | -------------------------- |
| RequireUseStrict | 5 | Missing use strict |
| RequireUseWarnings | 4 | Missing use warnings |
| ProhibitBarewordFileHandles | 5 | Using bareword filehandles |
| ProhibitTwoArgOpen | 5 | Two-argument open() |
| ProhibitStringyEval | 5 | Using eval with string |
| RequireTidyCode | 1 | Code not formatted |
Create .perlcriticrc in project root:
# .perlcriticrc
severity = 3
verbose = 8
theme = core
# Exclude specific policies
[-Documentation::RequirePodSections]
[-InputOutput::RequireBriefOpen]
# Configure specific policy
[CodeLayout::RequireTidyCode]
perltidyrc = .perltidyrc
[Variables::ProhibitPackageVars]
packages = Data::Dumper File::Find
[TestingAndDebugging::ProhibitNoStrict]
allow = refs
| Level | Output Format | | ----- | ------------------------ | | 1 | Line only | | 4 | Line + Column | | 8 | Line + Policy + Severity | | 10 | Full explanation | | 11 | With PBP page reference |
# Format file (creates .bak backup)
perltidy script.pl
# Format to stdout (no backup)
perltidy -st script.pl
# In-place edit (no backup)
perltidy -b -nst script.pl
# Check if tidy (exit code)
perltidy -st script.pl | diff -q - script.pl
# Basic formatting
perltidy -i=4 -ci=4 -l=100 script.pl
# Full command with common options
perltidy \
--indent-columns=4 \
--continuation-indentation=4 \
--maximum-line-length=100 \
--vertical-tightness=2 \
--paren-tightness=1 \
--brace-tightness=1 \
script.pl
Create .perltidyrc in project root:
# .perltidyrc
# Indentation
--indent-columns=4
--continuation-indentation=4
# Line length
--maximum-line-length=100
# Blank lines
--blank-lines-before-subs=1
--blank-lines-after-block-opening=0
# Spaces
--paren-tightness=1
--brace-tightness=1
--square-bracket-tightness=1
# Vertical alignment
--no-outdent-long-quotes
--no-outdent-long-comments
# Output
--backup-and-modify-in-place
--backup-file-extension=/
Code examples
Must fix immediately:
Bareword file handle opened at line 10, column 1.
Two-argument "open" used at line 15, column 5.
Fix:
# Wrong
open FILE, $filename;
# Correct
open my $fh, '<', $filename;
Should fix:
Code before strictures are enabled at line 1.
Fix:
# Add at top
use strict;
use warnings;
Consider fixing:
Regular expression without "/x" flag at line 25.
If tools are missing:
# Install both tools
cpanm Perl::Critic Perl::Tidy
# Verify installation
perlcritic --version
perltidy --version
Lint specific file:
perlcritic --severity 4 --verbose 8 path/to/file.pl
Lint all Perl files in directory:
find . -name '*.pl' -o -name '*.pm' | xargs perlcritic --severity 4
Format all files:
find . -name '*.pl' -o -name '*.pm' | xargs perltidy -b
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.