本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md5.2 KB
  • references/code-examples.md751 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Perl Linting and Formatting

Run Perl::Critic analysis and perltidy formatting with automatic tool detection.

Workflow

  1. Check if perlcritic/perltidy are installed
  2. Run analysis on specified files
  3. Report findings with severity levels
  4. 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

LevelNameDescription
5GentleObvious, unambiguous issues
4SternUsually bad practices
3HarshControversial but recommended
2CruelPickier about style
1BrutalMaximum strictness

Common Policies

PolicySeverityIssue
RequireUseStrict5Missing use strict
RequireUseWarnings4Missing use warnings
ProhibitBarewordFileHandles5Using bareword filehandles
ProhibitTwoArgOpen5Two-argument open()
ProhibitStringyEval5Using eval with string
RequireTidyCode1Code 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

LevelOutput Format
1Line only
4Line + Column
8Line + Policy + Severity
10Full explanation
11With 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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Jamie-BitFlight のスキルをすべて見る

このスキルの問題を報告する