Adr Knowledge logo

Adr Knowledge

Community
dykyi-roman
adr-knowledge

Action-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits.

Overview

Publisherdykyi-roman
Repositoryawesome-claude-code
Skill nameadr-knowledge
Stars
98
Forks
25
Bundled files
6
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.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Adr Knowledge 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/adr-knowledge .claude/skills/adr-knowledge
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Adr Knowledge 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 Adr Knowledge 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 Adr Knowledge 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.

ADR Knowledge Base

Quick reference for Action-Domain-Responder pattern and PHP implementation guidelines.

Core Principles

ADR Components

HTTP Request → Action (collects input)
              Domain (executes business logic)
             Responder (builds HTTP Response)
           HTTP Response

Rule: One action = one HTTP endpoint. Responder builds the COMPLETE response.

Component Responsibilities

ComponentResponsibilityContains
ActionCollects input, invokes Domain, passes to ResponderRequest parsing, DTO creation, UseCase invocation
DomainBusiness logic (same as DDD Domain/Application)Entities, Value Objects, UseCases, Services
ResponderBuilds HTTP Response (status, headers, body)Response building, template rendering, content negotiation

ADR vs MVC Comparison

AspectMVC ControllerADR Action
GranularityMultiple actionsSingle action per class
Response buildingMixed in controllerSeparate Responder class
HTTP concernsScatteredIsolated in Responder
TestabilityLower (many concerns)Higher (single responsibility)
File structureFew large filesMany focused files

Quick Checklists

Action Checklist

  • Single __invoke() method
  • No new Response() or response building
  • No business logic (if/switch on domain state)
  • Only input parsing and domain invocation
  • Returns Responder result

Responder Checklist

  • Receives domain result only
  • Builds complete HTTP Response
  • Handles content negotiation
  • Sets status codes based on result
  • No domain/business logic
  • No database/repository access

Domain Checklist

  • Same as DDD Domain/Application layers
  • No HTTP/Response concerns
  • Returns domain objects (not HTTP responses)
  • Pure business logic

Common Violations Quick Reference

ViolationWhere to LookSeverity
new Response() in Action*Action.phpCritical
->withStatus() in Action*Action.phpCritical
if ($result->isError()) in Action*Action.phpWarning
$repository-> in Responder*Responder.phpCritical
$service-> in Responder*Responder.phpCritical
Multiple public methods in Action*Action.phpWarning
Template logic in Action*Action.phpWarning

PHP 8.4 ADR Patterns

Action Pattern

php
<?php

declare(strict_types=1);

namespace Presentation\Api\User\Create;

use Application\User\UseCase\CreateUser\CreateUserUseCase;
use Application\User\UseCase\CreateUser\CreateUserInput;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

final readonly class CreateUserAction
{
    public function __construct(
        private CreateUserUseCase $useCase,
        private CreateUserResponder $responder,
    ) {
    }

    public function __invoke(ServerRequestInterface $request): ResponseInterface
    {
        $input = $this->parseInput($request);
        $result = $this->useCase->execute($input);

        return $this->responder->respond($result);
    }

    private function parseInput(ServerRequestInterface $request): CreateUserInput
    {
        $body = (array) $request->getParsedBody();

        return new CreateUserInput(
            email: $body['email'] ?? '',
            name: $body['name'] ?? '',
        );
    }
}

Responder Pattern

php
<?php

declare(strict_types=1);

namespace Presentation\Api\User\Create;

use Application\User\UseCase\CreateUser\CreateUserResult;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamFactoryInterface;

final readonly class CreateUserResponder
{
    public function __construct(
        private ResponseFactoryInterface $responseFactory,
        private StreamFactoryInterface $streamFactory,
    ) {
    }

    public function respond(CreateUserResult $result): ResponseInterface
    {
        if ($result->isFailure()) {
            return $this->error($result->error());
        }

        return $this->success($result->userId());
    }

    private function success(string $userId): ResponseInterface
    {
        return $this->json(['id' => $userId], 201);
    }

    private function error(string $message): ResponseInterface
    {
        return $this->json(['error' => $message], 400);
    }

    private function json(array $data, int $status): ResponseInterface
    {
        $body = $this->streamFactory->createStream(
            json_encode($data, JSON_THROW_ON_ERROR)
        );

        return $this->responseFactory->createResponse($status)
            ->withHeader('Content-Type', 'application/json')
            ->withBody($body);
    }
}

Detection Patterns

Action Detection

bash
# Find Action classes
Glob: **/*Action.php
Glob: **/Action/**/*.php
Grep: "implements.*ActionInterface|extends.*Action" --glob "**/*.php"

# Detect Action pattern usage
Grep: "public function __invoke.*Request" --glob "**/*Action.php"

Responder Detection

bash
# Find Responder classes
Glob: **/*Responder.php
Glob: **/Responder/**/*.php
Grep: "implements.*ResponderInterface" --glob "**/*.php"

# Detect Responder pattern usage
Grep: "public function respond" --glob "**/*Responder.php"

Violation Detection

bash
# Response building in Action (Critical)
Grep: "new Response|->withStatus|->withHeader|->withBody" --glob "**/*Action.php"

# Business logic in Action (Warning)
Grep: "if \(.*->status|switch \(|->isValid\(\)" --glob "**/*Action.php"

# Domain calls in Responder (Critical)
Grep: "Repository|Service|UseCase" --glob "**/*Responder.php"

# Multiple public methods in Action (Warning)
Grep: "public function [^_]" --glob "**/*Action.php" | wc -l

File Structure

Recommended Structure

src/
├── Presentation/
│   ├── Api/
│   │   └── {Context}/
│   │       └── {Action}/
│   │           ├── {Action}Action.php
│   │           ├── {Action}Responder.php
│   │           └── {Action}Request.php (optional DTO)
│   ├── Web/
│   │   └── {Context}/
│   │       └── {Action}/
│   │           ├── {Action}Action.php
│   │           ├── {Action}Responder.php
│   │           └── templates/ (for HTML)
│   └── Shared/
│       ├── Action/
│       │   └── ActionInterface.php
│       └── Responder/
│           └── ResponderInterface.php
├── Application/
│   └── {Context}/
│       └── UseCase/
│           └── {Action}/
│               ├── {Action}UseCase.php
│               ├── {Action}Input.php
│               └── {Action}Result.php
└── Domain/
    └── ...

Alternative Structure (Feature-Based)

src/
├── User/
│   ├── Presentation/
│   │   ├── CreateUser/
│   │   │   ├── CreateUserAction.php
│   │   │   └── CreateUserResponder.php
│   │   └── GetUser/
│   │       ├── GetUserAction.php
│   │       └── GetUserResponder.php
│   ├── Application/
│   │   └── ...
│   └── Domain/
│       └── ...

Integration with DDD

ADR fits naturally with DDD layering:

ADRDDD LayerNotes
ActionPresentationEntry point for HTTP
ResponderPresentationExit point for HTTP
DomainDomain + ApplicationBusiness logic via UseCases

PSR Integration

ADR works with PSR-7/PSR-15:

PSRUsage
PSR-7Request/Response interfaces
PSR-15Middleware for cross-cutting concerns
PSR-17Response/Stream factories in Responder

Antipatterns

1. Fat Action (Critical)

php
// BAD: Action doing too much
class CreateUserAction
{
    public function __invoke(Request $request): Response
    {
        $data = $request->getParsedBody();

        // Validation in Action
        if (empty($data['email'])) {
            return new Response(400, [], 'Email required');
        }

        // Business logic in Action
        $user = new User($data['email']);
        $this->repository->save($user);

        // Response building in Action
        return new Response(201, [], json_encode(['id' => $user->id()]));
    }
}

2. Anemic Responder (Warning)

php
// BAD: Responder not doing its job
class CreateUserResponder
{
    public function respond($data): Response
    {
        return new Response(200, [], json_encode($data));
    }
}

3. Smart Responder (Critical)

php
// BAD: Responder with business logic
class CreateUserResponder
{
    public function respond(User $user): Response
    {
        // Domain logic in Responder!
        if ($user->isAdmin()) {
            $this->notificationService->notifyAdmins();
        }

        return $this->json(['id' => $user->id()], 201);
    }
}

References

For detailed information, load these reference files:

  • references/action-patterns.md — Action class patterns and best practices
  • references/responder-patterns.md — Responder class patterns
  • references/domain-integration.md — Integration with DDD Domain layer
  • references/mvc-comparison.md — Detailed MVC vs ADR comparison
  • references/antipatterns.md — Common ADR violations with examples

Assets

  • assets/report-template.md — ADR audit report template

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Adr Knowledge AI skill do?

Action-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits.

Why use Adr Knowledge on TypingMind?

Because you install it once and use it with any model. Adr Knowledge 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 Adr Knowledge in TypingMind?

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

Which AI models can use Adr Knowledge?

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 Adr Knowledge?

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

Is the Adr Knowledge 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 👇