Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

solid-knowledge扎实的知识

Agent Skill

solid-knowledge 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

264

周安装

11

GitHub Stars

66

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:solid-knowledge(扎实的知识)
来源仓库:https://github.com/dykyi-roman/awesome-claude-code
仓库路径:skills/solid-knowledge
安装命令:
npx skills add https://github.com/dykyi-roman/awesome-claude-code --skill solid-knowledge
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dykyi-roman/awesome-claude-code --skill solid-knowledge

简介

solid-knowledge 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

SOLID Principles Knowledge Base

Overview

SOLID is a set of five design principles for writing maintainable, extensible software.

PrincipleNameCore Idea
SSingle ResponsibilityOne class = one reason to change
OOpen/ClosedOpen for extension, closed for modification
LLiskov SubstitutionSubtypes must be substitutable for base types
IInterface SegregationMany specific interfaces > one general
DDependency InversionDepend on abstractions, not concretions

Quick Detection Patterns

SRP Violations

# God classes (>500 lines)
find . -name "*.php" -exec wc -l {} \; | awk '$1 > 500 {print}'

# Classes with "And" in name
grep -rn "class.*And[A-Z]" --include="*.php"

# Classes with >7 dependencies
grep -rn "public function __construct" --include="*.php" -A 20 | grep -E "private|readonly" | wc -l

# Multiple responsibility indicators
grep -rn "class.*Manager\|class.*Handler\|class.*Processor" --include="*.php"

Signs of SRP Violation:

  • Class has >500 lines
  • Class has >7 dependencies
  • Class name contains "And", "Or", "Manager", "Handler"
  • Multiple unrelated public methods
  • Changes for multiple business reasons

OCP Violations

# Switch on type
grep -rn "switch.*instanceof\|switch.*::class" --include="*.php"

# Type checking conditionals
grep -rn "if.*instanceof\|elseif.*instanceof" --include="*.php"

# Hardcoded type maps
grep -rn "\[.*::class.*=>" --include="*.php"

Signs of OCP Violation:

  • Switch statements on object types
  • instanceof chains in conditionals
  • Adding new types requires modifying existing code
  • Hardcoded type-to-behavior mappings

LSP Violations

# Exception in overridden methods
grep -rn "throw.*NotImplemented\|throw.*NotSupported" --include="*.php"

# Empty overrides
grep -rn "public function.*\{[\s]*\}" --include="*.php"

# Type checks in child classes
grep -rn "if.*parent::" --include="*.php"

Signs of LSP Violation:

  • Child class throws NotImplementedException
  • Child class has empty method overrides
  • Parent type check in child class
  • Preconditions strengthened in subtype
  • Postconditions weakened in subtype

ISP Violations

# Large interfaces (>5 methods)
grep -rn "interface\s" --include="*.php" -A 30 | grep -c "public function"

# Empty interface implementations
grep -rn "// TODO\|// not implemented\|// unused" --include="*.php"

Signs of ISP Violation:

  • Interface has >5 methods
  • Classes implement interfaces partially
  • Unused methods return null/throw
  • Interface name too generic ("Service", "Manager")

DIP Violations

# Direct instantiation in constructors
grep -rn "new\s\+[A-Z]" --include="*.php" | grep -v "Exception\|DateTime\|stdClass"

# Static method calls
grep -rn "::[a-z].*(" --include="*.php" | grep -v "self::\|static::\|parent::"

# Concrete class type hints (not interfaces)
grep -rn "function.*([A-Z][a-z]*[A-Z]" --include="*.php"

Signs of DIP Violation:

  • new ConcreteClass() inside methods
  • Static calls to concrete classes
  • Type hints to concrete classes (not interfaces)
  • No constructor injection

PHP 8.4 Patterns

SRP Compliant

<?php

declare(strict_types=1);

// BAD: Multiple responsibilities
final class UserService
{
    public function register(UserData $data): User { /* ... */ }
    public function sendEmail(User $user): void { /* ... */ }
    public function generateReport(User $user): Report { /* ... */ }
}

// GOOD: Single responsibility each
final readonly class RegisterUserHandler
{
    public function __construct(
        private UserRepository $users,
        private EventDispatcher $events,
    ) {}

    public function __invoke(RegisterUserCommand $command): UserId
    {
        $user = User::register($command->email, $command->password);
        $this->users->save($user);
        $this->events->dispatch($user->releaseEvents());

        return $user->id;
    }
}

OCP Compliant

<?php

declare(strict_types=1);

// BAD: Modification required for new types
final class PaymentProcessor
{
    public function process(Payment $payment): void
    {
        match ($payment->type) {
            'card' => $this->processCard($payment),
            'paypal' => $this->processPaypal($payment),
            // Must modify for new payment types
        };
    }
}

// GOOD: Extension without modification
interface PaymentGateway
{
    public function supports(Payment $payment): bool;
    public function process(Payment $payment): PaymentResult;
}

final readonly class PaymentProcessor
{
    /** @param iterable<PaymentGateway> $gateways */
    public function __construct(
        private iterable $gateways,
    ) {}

    public function process(Payment $payment): PaymentResult
    {
        foreach ($this->gateways as $gateway) {
            if ($gateway->supports($payment)) {
                return $gateway->process($payment);
            }
        }
        throw new UnsupportedPaymentException($payment->type);
    }
}

LSP Compliant

<?php

declare(strict_types=1);

// BAD: Violates substitutability
abstract class Bird
{
    abstract public function fly(): void;
}

final class Penguin extends Bird
{
    public function fly(): void
    {
        throw new CannotFlyException(); // LSP violation!
    }
}

// GOOD: Proper abstraction hierarchy
interface Bird
{
    public function move(): void;
}

interface FlyingBird extends Bird
{
    public function fly(): void;
}

final readonly class Penguin implements Bird
{
    public function move(): void
    {
        $this->swim();
    }

    private function swim(): void { /* ... */ }
}

final readonly class Eagle implements FlyingBird
{
    public function move(): void
    {
        $this->fly();
    }

    public function fly(): void { /* ... */ }
}

ISP Compliant

<?php

declare(strict_types=1);

// BAD: Fat interface
interface UserRepository
{
    public function find(UserId $id): ?User;
    public function findByEmail(Email $email): ?User;
    public function save(User $user): void;
    public function delete(User $user): void;
    public function findAll(): array;
    public function count(): int;
    public function export(): string;
    public function import(string $data): void;
}

// GOOD: Segregated interfaces
interface UserReader
{
    public function find(UserId $id): ?User;
    public function findByEmail(Email $email): ?User;
}

interface UserWriter
{
    public function save(User $user): void;
    public function delete(User $user): void;
}

interface UserExporter
{
    public function export(): string;
    public function import(string $data): void;
}

// Compose as needed
interface UserRepository extends UserReader, UserWriter {}

DIP Compliant

<?php

declare(strict_types=1);

// BAD: Depends on concretions
final class OrderService
{
    public function process(Order $order): void
    {
        $mailer = new SmtpMailer();           // Concrete dependency
        $logger = Logger::getInstance();       // Static dependency
        $validator = new OrderValidator();     // Hidden dependency

        // ...
    }
}

// GOOD: Depends on abstractions
final readonly class OrderService
{
    public function __construct(
        private OrderRepository $orders,
        private Mailer $mailer,
        private LoggerInterface $logger,
        private OrderValidator $validator,
    ) {}

    public function process(Order $order): void
    {
        $this->validator->validate($order);
        $this->orders->save($order);
        $this->mailer->send(new OrderConfirmation($order));
        $this->logger->info('Order processed', ['id' => $order->id->value]);
    }
}

SOLID & DDD Integration

SOLIDDDD Application
SRPAggregates have single consistency boundary
OCPDomain Events enable extension without modification
LSPValue Objects are substitutable (same type = same behavior)
ISPRepository interfaces segregated (Reader/Writer)
DIPDomain depends on Repository interfaces, not implementations

SOLID & Clean Architecture

LayerSOLID Focus
DomainSRP (Entities), LSP (Value Objects), ISP (Repository interfaces)
ApplicationSRP (Use Cases), DIP (Port interfaces)
InfrastructureOCP (Adapters), DIP (Implements ports)
PresentationSRP (Controllers), ISP (API contracts)

Severity Levels

LevelDescriptionExample
CRITICALFundamental violation affecting entire systemGod class, no DI
WARNINGLocalized violation, should be fixedinstanceof chains
INFOMinor issue, consider refactoringInterface with 6 methods

References

See detailed documentation in references/:

  • srp-patterns.md - Single Responsibility patterns
  • ocp-patterns.md - Open/Closed patterns
  • lsp-patterns.md - Liskov Substitution patterns
  • isp-patterns.md - Interface Segregation patterns
  • dip-patterns.md - Dependency Inversion patterns
  • antipatterns.md - Common SOLID violations

See assets/report-template.md for audit report format.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.07%
按下载量换算32

Claude

30.95%
按下载量换算27

Cursor

21.23%
按下载量换算19

Gemini CLI

9.1%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills