Agent skill
perl-lint
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.
Install this agent skill to your Project
npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/perl-development/skills/perl-lint
SKILL.md
Perl Linting and Formatting
Run Perl::Critic analysis and perltidy formatting with automatic tool detection.
Workflow
- Check if perlcritic/perltidy are installed
- Run analysis on specified files
- Report findings with severity levels
- Suggest fixes or format code
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"
Perl::Critic Analysis
Running perlcritic
# 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
Severity Levels
| 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 |
Common Policies
| 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 |
Configuration File
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
Verbose Formats
| Level | Output Format |
|---|---|
| 1 | Line only |
| 4 | Line + Column |
| 8 | Line + Policy + Severity |
| 10 | Full explanation |
| 11 | With PBP page reference |
Perltidy Formatting
Basic Usage
# 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
Common Options
# 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
Configuration File
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=/
Combined Workflow
Lint and Fix
Code examples
Interpreting Results
Severity 5 (Critical)
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;
Severity 4 (Important)
Should fix:
Code before strictures are enabled at line 1.
Fix:
# Add at top
use strict;
use warnings;
Severity 3 (Recommended)
Consider fixing:
Regular expression without "/x" flag at line 25.
Installation
If tools are missing:
# Install both tools
cpanm Perl::Critic Perl::Tidy
# Verify installation
perlcritic --version
perltidy --version
Quick Commands
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ccc
This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the index', 'ccc', 'cocoindex-code'.
agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
delegate
Quick delegation template for sub-agent prompts. Use when assigning work to a sub-agent, before invoking the Agent tool, or when preparing prompts for specialized agents. Provides the WHERE-WHAT-WHY framework. For comprehensive delegation guidance, activate the agent-orchestration how-to-delegate skill.
swarm-spawning
Spawn agents and teammates in Claude Code swarms. Use when choosing between subagents vs teammates, selecting agent types (Explore, Plan, general-purpose, plugin agents), configuring spawn backends (in-process, tmux, iterm2), or setting environment variables for spawned agents.
knowledge-explorer
Manage the research/ knowledge base (KB) of tool and library research entries. Use when browsing KB topics, adding new research entries, updating existing entries with dated revisions, fetching GitHub repo metadata into a draft KB entry, or migrating old-format entries to skill-spec frontmatter. Triggers on tasks like "what do we have on X", "add this to the KB", "update the KB entry for Y", "fetch github info for owner/repo", or "migrate old entries".
design-anti-patterns
Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.
Didn't find tool you were looking for?