check-naming

Analyze naming convention issues in PHP code. Detect non-descriptive names, abbreviations, inconsistent casing, and misleading names.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "check-naming" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-561e5757bd25bf2a6090ddea41ce01b28d70a3483a1f8a415bb83d4f8cdfe914. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Analyze naming convention issues in PHP code. Detect non-descriptive names, abbreviations, inconsistent casing, and misleading names.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
Analyzes PHP code for naming convention issues. Detects non-descriptive names, abbreviations, inconsistent casing, misleading names.
Inputs and outputs
```markdown
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: check-naming
description: Analyzes PHP code for naming convention issues. Detects non-descriptive names, abbreviations, inconsistent casing, misleading names.

Naming Convention Check

Analyze PHP code for naming quality and consistency.

Detection Patterns

1. Non-Descriptive Names

// BAD: Single letter variables (except loop counters)
$x = $user->getAge();
$d = new DateTime();
$r = $repository->find($id);

// GOOD: Descriptive names
$userAge = $user->getAge();
$currentDate = new DateTime();
$foundUser = $repository->find($id);

// BAD: Generic names
$data = $service->process();
$result = $handler->handle();
$temp = $this->calculate();

// GOOD: Specific names
$orderSummary = $service->generateSummary();
$validationResult = $handler->validate();
$discountAmount = $this->calculateDiscount();

2. Abbreviations and Acronyms

// BAD: Unclear abbreviations
$usrMgr = new UserManager();
$prodRepo = new ProductRepository();
$txnSvc = new TransactionService();

// GOOD: Full words
$userManager = new UserManager();
$productRepository = new ProductRepository();
$transactionService = new TransactionService();

// ACCEPTABLE: Common acronyms
$userId = $user->getId();  // ID is universally understood
$htmlContent = $this->render();  // HTML is common
$apiResponse = $client->get();  // API is common

3. Inconsistent Casing

// BAD: Mixed casing styles
$user_name = 'John';  // snake_case
$userAge = 25;        // camelCase
$UserEmail = 'x@y';   // PascalCase

// GOOD: Consistent camelCase for variables
$userName = 'John';
$userAge = 25;
$userEmail = 'x@y';

// Constants should be UPPER_SNAKE_CASE
const MAX_RETRIES = 3;
const DEFAULT_TIMEOUT = 30;

4. Misleading Names

// BAD: Name doesn't match behavior
function getUser(): void  // "get" implies return value
{
    $this->user = $this->repository->find($id);
}

// BAD: Boolean without is/has/can prefix
$active = $user->active;  // Unclear if boolean

// GOOD: Clear boolean naming
$isActive = $user->isActive();
$hasOrders = $user->hasOrders();
$canEdit = $user->canEditProfile();

// BAD: Negated boolean names
$isNotValid = false;  // Double negative confusion
$isInactive = true;

// GOOD: Positive boolean names
$isValid = true;
$isActive = false;

5. Class Naming

// BAD: Generic class names
class Manager {}      // Manager of what?
class Processor {}    // Processes what?
class Handler {}      // Handles what?
class Helper {}       // Helps with what?

// GOOD: Specific class names
class OrderManager {}
class PaymentProcessor {}
class WebhookHandler {}
class DateTimeHelper {}

// BAD: Missing suffix for pattern
class User implements RepositoryInterface {}

// GOOD: Pattern-indicating suffix
class UserRepository implements RepositoryInterface {}
class OrderFactory {}
class PaymentService {}

6. Method Naming

// BAD: Vague method names
function process() {}
function handle() {}
function execute() {}
function run() {}

// GOOD: Action-specific names
function processPayment() {}
function handleWebhook() {}
function executeQuery() {}
function runMigrations() {}

// BAD: Doesn't describe what it returns
function user(): User {}

// GOOD: Describes intent
function findUserById(int $id): User {}
function getCurrentUser(): User {}
function createGuestUser(): User {}

7. Parameter Naming

// BAD: Type as name
function process(array $array, string $string): void {}

// GOOD: Descriptive parameter names
function processOrder(array $orderItems, string $currency): void {}

// BAD: Numbered parameters
function calculate(int $value1, int $value2): int {}

// GOOD: Meaningful parameter names
function calculateDiscount(int $originalPrice, int $discountPercent): int {}

8. Constant Naming

// BAD: Lowercase or camelCase constants
const maxRetries = 3;
const defaultTimeout = 30;

// GOOD: UPPER_SNAKE_CASE
const MAX_RETRIES = 3;
const DEFAULT_TIMEOUT = 30;
const API_VERSION = 'v1';

// BAD: Non-descriptive
const VALUE = 100;
const LIMIT = 50;

// GOOD: Contextual
const PAGINATION_LIMIT = 50;
const MAX_UPLOAD_SIZE_MB = 100;

Grep Patterns

# Single letter variables
Grep: "\\\$[a-z]\s*=" --glob "**/*.php"

# Common abbreviations
Grep: "\\\$(mgr|svc|repo|impl|util)\w*\s*=" -i --glob "**/*.php"

# Generic class names
Grep: "class\s+(Manager|Processor|Handler|Helper)\s" --glob "**/*.php"

# Boolean without prefix
Grep: "private\s+(bool|\?bool)\s+\\\$[^is|has|can|should|was|will]" --glob "**/*.php"

Naming Conventions Summary

Element Convention Example
Variables camelCase $userName
Constants UPPER_SNAKE_CASE MAX_RETRIES
Functions camelCase getUserById()
Classes PascalCase UserService
Interfaces PascalCase + Interface UserRepositoryInterface
Traits PascalCase + Trait TimestampableTrait

Severity Classification

Pattern Severity
Misleading names 🟠 Major
Single letter (non-loop) 🟡 Minor
Inconsistent casing 🟡 Minor
Abbreviations 🟢 Suggestion

Output Format

### Naming Issue: [Description]

**Severity:** 🟠/🟡/🟢
**Location:** `file.php:line`

**Issue:**
[Description of the naming problem]

**Current:**
```php
$x = $service->getData();

Suggested:

$orderData = $service->getOrderData();

Rationale: Descriptive names reduce cognitive load and improve maintainability.

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供 PHP 命名规范检测能力,覆盖变量、类、方法、常量等命名问题
  • 具有明确的技术实用价值,适用于开发者日常代码质量检查
Trigger Precision92/100

Highlights

  • description 明确描述功能为分析 PHP 代码命名规范问题
  • 涵盖非描述性名称、缩写、大小写不一致、误导性名称等具体场景,触发词精准且边界清晰
Structure and Standards95/100

Highlights

  • 文档结构完整,包含检测模式、grep 模式、命名规范总结、严重性分类和输出格式
  • 步骤清晰,有具体示例,frontmatter 完整,单文件未超限
Execution Reliability88/100

Highlights

  • 提供具体的 grep 模式用于检测命名问题,工具来源明确(grep),参数正确
  • 覆盖主要异常场景,输出格式规范,具备良好执行可靠性
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.