Check Consistency logo

Check Consistency

Community
dykyi-roman
check-consistency

Analyzes PHP code for consistency issues. Detects mixed coding styles, inconsistent patterns, API inconsistencies, naming convention violations.

Overview

Publisherdykyi-roman
Repositoryawesome-claude-code
Skill namecheck-consistency
Stars
98
Forks
25
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dykyi-roman on GitHub. Read the source before you install it.

Installation

Install the Check Consistency AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git /tmp/awesome-claude-code
mkdir -p .claude/skills
cp -r /tmp/awesome-claude-code/skills/check-consistency .claude/skills/check-consistency
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Check Consistency in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Check Consistency on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Check Consistency is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Consistency Check

Analyze PHP code for consistency across the codebase.

Detection Patterns

1. Mixed Coding Styles

php
// INCONSISTENT: Different styles in same file/project
class UserService
{
    // camelCase method
    public function getUser() {}

    // snake_case method (inconsistent)
    public function get_orders() {}
}

// INCONSISTENT: Different array syntax
$items = array(1, 2, 3);  // Long syntax
$config = [4, 5, 6];       // Short syntax

// CONSISTENT: Choose one style
$items = [1, 2, 3];
$config = [4, 5, 6];

2. Inconsistent Return Patterns

php
// INCONSISTENT: Mixed return types for similar operations
public function findUser(int $id): ?User
{
    return $this->repository->find($id); // Returns null if not found
}

public function findOrder(int $id): Order
{
    $order = $this->repository->find($id);
    if (!$order) {
        throw new NotFoundException(); // Throws if not found
    }
    return $order;
}

// CONSISTENT: Same pattern for similar operations
public function findUser(int $id): ?User {}
public function findOrder(int $id): ?Order {}

// Or all throwing:
public function getUser(int $id): User {}    // @throws
public function getOrder(int $id): Order {}  // @throws

3. Inconsistent Error Handling

php
// INCONSISTENT: Different error handling strategies
class PaymentService
{
    public function charge(): bool
    {
        try {
            // ...
            return true;
        } catch (Exception $e) {
            return false; // Returns boolean
        }
    }

    public function refund(): void
    {
        // ...
        if ($error) {
            throw new RefundException(); // Throws exception
        }
    }
}

// CONSISTENT: Same strategy
class PaymentService
{
    public function charge(): PaymentResult {}  // Throws on error
    public function refund(): RefundResult {}   // Throws on error
}

4. API Inconsistencies

php
// INCONSISTENT: Different parameter order
public function createUser(string $email, string $name): User {}
public function createProduct(string $name, string $sku): Product {}
// One is (email, name), other is (name, sku)

// INCONSISTENT: Different collection handling
public function getUsers(): array {}        // Returns array
public function getOrders(): Collection {}  // Returns Collection
public function getProducts(): iterable {}  // Returns iterable

// CONSISTENT: Same patterns
public function getUsers(): array {}
public function getOrders(): array {}
public function getProducts(): array {}

5. Inconsistent Naming Conventions

php
// INCONSISTENT: Mixed naming for similar concepts
class Order
{
    private $customerId;      // camelCase
    private $shipping_address; // snake_case (inconsistent)
}

// INCONSISTENT: Different prefixes for similar things
interface UserRepository {}
interface IOrderRepository {}  // I prefix
interface ProductRepoInterface {} // Different suffix

// CONSISTENT: Same pattern
interface UserRepositoryInterface {}
interface OrderRepositoryInterface {}
interface ProductRepositoryInterface {}

6. Inconsistent Constructor Patterns

php
// INCONSISTENT: Mix of property promotion and explicit
class UserService
{
    private OrderRepository $orderRepo;

    public function __construct(
        private UserRepository $userRepo,  // Promoted
        OrderRepository $orderRepo         // Not promoted
    ) {
        $this->orderRepo = $orderRepo;
    }
}

// CONSISTENT: All promoted
class UserService
{
    public function __construct(
        private UserRepository $userRepo,
        private OrderRepository $orderRepo,
    ) {}
}

7. Inconsistent Dependency Injection

php
// INCONSISTENT: Mix of injection styles
class OrderService
{
    private $cache;

    public function __construct(
        private UserRepository $userRepo,  // Constructor injection
    ) {}

    public function setCache(CacheInterface $cache): void  // Setter injection
    {
        $this->cache = $cache;
    }

    public function process(): void
    {
        $logger = Container::get(LoggerInterface::class);  // Service locator
    }
}

// CONSISTENT: All constructor injection
class OrderService
{
    public function __construct(
        private UserRepository $userRepo,
        private CacheInterface $cache,
        private LoggerInterface $logger,
    ) {}
}

8. Inconsistent Null Handling

php
// INCONSISTENT: Different null patterns
public function getUser(): ?User {}            // Nullable return
public function getOrder(): Order|null {}      // Union type null
public function findProduct(): false|Product {} // False for not found

// CONSISTENT: Choose one pattern
public function getUser(): ?User {}
public function getOrder(): ?Order {}
public function findProduct(): ?Product {}

9. Inconsistent Date/Time Handling

php
// INCONSISTENT: Different date types
public function setCreatedAt(DateTime $date): void {}
public function setUpdatedAt(DateTimeImmutable $date): void {}
public function setDeletedAt(string $date): void {}

// CONSISTENT: Same type
public function setCreatedAt(DateTimeImmutable $date): void {}
public function setUpdatedAt(DateTimeImmutable $date): void {}
public function setDeletedAt(DateTimeImmutable $date): void {}

10. Inconsistent Response Patterns

php
// INCONSISTENT: Different response structures
// Endpoint 1
{"data": {"user": {...}}}

// Endpoint 2
{"user": {...}}

// Endpoint 3
{"result": {"data": {...}}}

// CONSISTENT: Same envelope
{"data": {...}, "meta": {...}}

Grep Patterns

bash
# Mixed array syntax
Grep: "array\s*\(" --glob "**/*.php"
Grep: "\[.*\]" --glob "**/*.php"

# Interface naming
Grep: "interface\s+\w+" --glob "**/*.php"

# Return type patterns
Grep: ":\s*\?\w+|:\s*\w+\|null|:\s*false\|\w+" --glob "**/*.php"

# Constructor patterns
Grep: "public function __construct" --glob "**/*.php"

Severity Classification

PatternSeverity
API inconsistency🟠 Major
Error handling mismatch🟠 Major
Naming convention mix🟡 Minor
Code style differences🟡 Minor
Formatting variations🟢 Suggestion

Best Practices

Create Team Standards

markdown
## Our Conventions

1. Always use short array syntax `[]`
2. Use nullable return types `?Type` not `Type|null`
3. All repositories extend `AbstractRepository`
4. All interfaces end with `Interface`
5. Use constructor property promotion
6. Prefer DateTimeImmutable over DateTime

Use Static Analysis

bash
# PHP-CS-Fixer for consistent formatting
php-cs-fixer fix --rules=@PSR12

# PHPStan for type consistency
phpstan analyze src/

Output Format

markdown
### Consistency Issue: [Description]

**Severity:** 🟠/🟡/🟢
**Location:** Multiple files

**Issue:**
Inconsistent [pattern type] found across codebase.

**Found Variations:**
1. `UserRepository` - no Interface suffix
2. `IOrderRepository` - I prefix
3. `ProductRepositoryInterface` - Interface suffix

**Recommended Standard:**
```php
interface UserRepositoryInterface {}
interface OrderRepositoryInterface {}
interface ProductRepositoryInterface {}

Files to Update:

  • src/User/UserRepository.php
  • src/Order/IOrderRepository.php

Frequently asked questions

What does the Check Consistency AI skill do?

Analyzes PHP code for consistency issues. Detects mixed coding styles, inconsistent patterns, API inconsistencies, naming convention violations.

Why use Check Consistency on TypingMind?

Because you install it once and use it with any model. Check Consistency is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Check Consistency in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-consistency. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Check Consistency?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Check Consistency?

As many as you like. As long as a model supports skills, you can use Check Consistency with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Check Consistency AI skill free?

Yes. It is published on GitHub by dykyi-roman under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇