smithery/valec3

backend-architecture-repository-pattern

Data access abstraction, repository pattern.

Installation

$ npx skills add smithery/valec3 --skill backend-architecture-repository-pattern

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,200 B
  • docs SUMMARY.md 91 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend Architecture Repository Pattern

When to use this skill

  • Abstracting data access
  • Multiple data sources
  • Testability
  • Complex queries

Workflow

  • Create repository interface
  • Implement repository
  • Inject into services
  • Abstract query logic
  • Keep repositories focused

Instructions

Interface

<?php

namespace App\Repositories;

interface UserRepositoryInterface
{
    public function find(int $id): ?User;
    public function findByEmail(string $email): ?User;
    public function save(User $user): User;
}

Implementation

<?php

namespace App\Repositories;

class UserRepository implements UserRepositoryInterface
{
    public function __construct(
        private UserModel $model
    ) {}

    public function find(int $id): ?User
    {
        return $this->model->find($id);
    }

    public function findByEmail(string $email): ?User
    {
        return $this->model->where('email', $email)->first();
    }
}

Resources

  • Abstract data access
  • Easy to mock for testing
  • Switch data sources easily