Logo: Check Consistency

Check Consistency

Communautéit
dykyi-roman
check-consistency

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

Iwwersiicht

Editeurdykyi-roman
Repositoryawesome-claude-code
Skill-Nummcheck-consistency
Stären
98
Forks
25
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    dykyi-roman huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Check Consistency an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-consistency
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Check Consistency an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Check Consistency automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Check Consistency net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Heefeg gestallte Froen

Wat mécht de KI-Skill Check Consistency?

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

Firwat Check Consistency op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Check Consistency besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Check Consistency an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-consistency an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Check Consistency benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Check Consistency benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Check Consistency domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Check Consistency gratis?

Jo. dykyi-roman huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇