/acc:create-proxyfrom acc
Generates Proxy pattern infrastructure for PHP 8.4 with lazy loading, access control, caching, and logging, including unit tests.
Ships in acc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Creates Proxy pattern infrastructure for controlling access to objects.
| Scenario | Example |
|---|---|
| Lazy initialization | Load expensive resources on first access |
| Access control | Check permissions before delegating |
| Caching | Cache results of expensive operations |
| Logging | Log calls to real subject |
Path: src/Domain/{BoundedContext}/
{Name}Interface.php — Operations contractPath: src/Infrastructure/{BoundedContext}/Proxy/
Lazy{Name}Proxy.php — Lazy initializationCaching{Name}Proxy.php — Result cachingAccessControl{Name}Proxy.php — Permission checksLogging{Name}Proxy.php — Call logging{ProxyName}Test.php — Proxy behavior verification| Component | Path |
|---|---|
| Subject Interface | src/Domain/{BoundedContext}/ |
| Real Subject | src/Domain/ or src/Infrastructure/ |
| Proxy | src/Infrastructure/{BoundedContext}/Proxy/ |
| Unit Tests | tests/Unit/Infrastructure/{BoundedContext}/Proxy/ |
| Component | Pattern | Example |
|---|---|---|
| Subject Interface | {Name}Interface | RepositoryInterface |
| Real Subject | {Name} | UserRepository |
| Proxy | {Type}{Name}Proxy | LazyUserRepositoryProxy |
| Test | {ClassName}Test | LazyUserRepositoryProxyTest |
final class {Type}{Name}Proxy implements {Name}Interface
{
private ?{Name}Interface $realSubject = null;
public function __construct(
private \Closure $factory
) {}
public function {operation}({params}): {returnType}
{
{beforeBehavior}
$result = $this->getRealSubject()->{operation}({args});
{afterBehavior}
return $result;
}
private function getRealSubject(): {Name}Interface
{
if ($this->realSubject === null) {
$this->realSubject = ($this->factory)();
}
return $this->realSubject;
}
}
// Lazy loading proxy
$repository = new LazyUserRepositoryProxy(
fn() => new UserRepository($connection)
);
// Real subject created only on first call
$user = $repository->findById($id);
| Proxy | Purpose |
|---|---|
| LazyLoadingProxy | Defer expensive object creation |
| CachingProxy | Cache method results |
| AccessControlProxy | Check permissions before execution |
| LoggingProxy | Log all method calls |
| MetricsProxy | Collect performance metrics |
| RetryProxy | Retry failed operations |
| Anti-pattern | Problem | Solution |
|---|---|---|
| Proxy != Real Subject | Behavior differs | Proxy must be transparent |
| Heavy Proxy | Too much logic | Keep proxies focused |
| Missing Interface | Can't substitute proxy | Use shared interface |
| Leaky State | Proxy state affects behavior | Keep proxies stateless when possible |
| Multiple Responsibilities | Proxy does many things | One proxy, one concern |
For complete PHP templates and examples, see:
references/templates.md — Lazy loading, caching, access control proxy templatesreferences/examples.md — Repository, service proxies with unit testsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
proxy-pattern, php-design-patterns, lazy-loading, access-control, caching, logging
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences.Other plugins' skills for the same job