Awesome-claude-code no-framework-knowledge
Framework-less PHP knowledge base. Provides pure PHP project architecture, DDD integration, PSR-7/PSR-15 HTTP, standalone persistence, DI containers, security (JWT lcobucci/jwt, RBAC middleware, password hashing, CSRF), event system (PSR-14, league/event, domain events, async processing), queue (enqueue/enqueue, php-amqplib, workers, supervisor), infrastructure components (PSR-6/16 cache, PSR-18 HTTP client, mailer, rate limiting), testing, and antipatterns for projects without a full framework.
git clone https://github.com/dykyi-roman/awesome-claude-code
T=$(mktemp -d) && git clone --depth=1 https://github.com/dykyi-roman/awesome-claude-code "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/no-framework-knowledge" ~/.claude/skills/dykyi-roman-awesome-claude-code-no-framework-knowledge && rm -rf "$T"
skills/no-framework-knowledge/SKILL.mdNo-Framework PHP Knowledge Base
Quick reference for building framework-free PHP applications using PSR standards, standalone Composer packages, and Clean Architecture. Covers everything needed to run a production-grade project without Symfony, Laravel, or any full-stack framework.
Core Principles
PSR Compliance
| PSR | Purpose | Recommended Package |
|---|---|---|
| PSR-4 | Autoloading | Composer autoloader |
| PSR-7 | HTTP Messages | or |
| PSR-11 | Container Interface | or |
| PSR-15 | HTTP Handlers & Middleware | or custom pipeline |
| PSR-17 | HTTP Factories | (includes factories) |
| PSR-3 | Logging | |
| PSR-6/PSR-16 | Caching | (standalone) |
Key Advantages
- Maximum domain freedom — Domain layer is pure PHP by default
- Composable packages — pick exactly the libraries you need
- Full control — bootstrap, middleware, error handling are explicit
- Lightweight — no hidden magic, no auto-wiring unless configured
Architecture Stack
public/index.php (Front Controller) → Middleware Pipeline (PSR-15) → Presentation (Actions) → Application (Use Cases) → Domain (Entities/VOs) → Infrastructure (Repos/Adapters) ← Composer + PSR-4 Autoloading
Quick Checklists
DDD-Compatible Pure PHP Project
-
in every filedeclare(strict_types=1) - PSR-4 autoloading via Composer
- Domain layer has zero external
statements (no Doctrine, no framework)use - Repository interfaces in Domain, implementations in Infrastructure
- DI container configured explicitly (PHP-DI or League)
- PSR-7 request/response, PSR-15 middleware pipeline
- Front controller in
public/index.php - Environment config via
+.envvlucas/phpdotenv - Error handling middleware with custom exception hierarchy
- Security via JWT middleware (lcobucci/jwt) + RBAC; Domain uses Specifications for authorization
- Queue job handlers delegate to Application UseCases; Domain dispatches events, not jobs
- Infrastructure components (Cache, HTTP Client, Mailer) accessed via domain port interfaces
- Domain EventDispatcherInterface port; Infrastructure provides PSR-14 or InMemory adapter
Clean Architecture Checks
- No
oruse Illuminate\\
in Domain or Application layersuse Symfony\\ - No HTTP concepts in Application layer
- All external services accessed through port interfaces
- Compiled DI container in production
- Database migrations managed by standalone tool
Common Violations Quick Reference
| Violation | Where to Look | Severity |
|---|---|---|
Missing | Any PHP file | Critical |
/ instead of autoloading | Entry points, legacy files | Critical |
Global state (, , ) | Presentation layer | Critical |
| Framework dependency in Domain | | Critical |
| Custom ORM instead of using Doctrine/Cycle | | Warning |
No PSR-7 — raw / calls | , controllers | Warning |
| Service Locator in Application layer | | Warning |
Missing DI container — manual chains | Bootstrap files | Warning |
No middleware pipeline — logic in | | Info |
| JWT/session logic in Domain | | Critical |
| Queue library in Domain | or in Domain | Critical |
| Cache/HTTP Client in Domain | or in Domain | Critical |
| Missing queue resilience | Workers without retry/error handling | Warning |
PHP 8.4 No-Framework Patterns
PSR-15 Middleware
declare(strict_types=1); namespace Infrastructure\Http\Middleware; use Psr\Http\Message\{ResponseInterface, ServerRequestInterface}; use Psr\Http\Server\{MiddlewareInterface, RequestHandlerInterface}; final readonly class CorsMiddleware implements MiddlewareInterface { public function __construct(private string $allowedOrigin = '*') {} public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { return $handler->handle($request) ->withHeader('Access-Control-Allow-Origin', $this->allowedOrigin) ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE'); } }
Application Service (Use Case)
declare(strict_types=1); namespace Application\Order\UseCase; final readonly class PlaceOrderUseCase { public function __construct( private OrderRepositoryInterface $orders, private EventDispatcherInterface $events, ) {} public function execute(PlaceOrderCommand $command): OrderId { $order = Order::create($command->customerId, $command->lines); $this->orders->save($order); foreach ($order->releaseEvents() as $event) { $this->events->dispatch($event); } return $order->id(); } }
Front Controller
declare(strict_types=1); require dirname(__DIR__) . '/vendor/autoload.php'; Dotenv\Dotenv::createImmutable(dirname(__DIR__))->load(); $container = require dirname(__DIR__) . '/config/container.php'; $container->get(App::class)->run();
References
For detailed information, load these reference files:
— Project structure, PSR-4 autoloading, bootstrap patternsreferences/architecture.md
— Pure Domain layer, Value Objects, Entities, Domain Eventsreferences/ddd-integration.md
— PSR-7/PSR-15 HTTP, routing, middleware pipelinereferences/routing-http.md
— Doctrine/Cycle standalone, PDO repositories, migrationsreferences/persistence.md
— PHP-DI, League Container, PSR-11, compiled containersreferences/dependency-injection.md
— PHPUnit standalone, mocking, HTTP testing, database testingreferences/testing.md
— Common no-framework mistakes with detection patternsreferences/antipatterns.md
— JWT authentication (lcobucci/jwt), RBAC middleware, password hashing, CSRF, security headersreferences/security.md
— PSR-14, league/event, custom dispatcher, domain events, async event processingreferences/event-system.md
— enqueue/enqueue, php-amqplib, workers, job dispatcher, supervisorreferences/queue.md
— Cache PSR-6/16, HTTP Client PSR-18, Mailer, Rate Limitingreferences/infrastructure-components.md