smithery/valec3

backend-architecture-mvc

MVC pattern in CodeIgniter, separation of concerns.

Installation

$ npx skills add smithery/valec3 --skill backend-architecture-mvc

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,609 B
  • docs SUMMARY.md 83 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend Architecture MVC

When to use this skill

  • Organizing CodeIgniter applications
  • Separating concerns properly
  • Building maintainable apps

Workflow

  • Controllers handle HTTP requests
  • Models handle data logic
  • Views handle presentation
  • Keep controllers thin
  • Business logic in services

Instructions

Controller (Thin)

<?php

namespace App\Controllers;

use App\Services\UserService;

class UserController extends BaseController
{
    public function __construct(
        private readonly UserService $service
    ) {}

    public function index()
    {
        $users = $this->service->getAllUsers();
        return view('users/index', ['users' => $users]);
    }

    public function store()
    {
        $user = $this->service->createUser($this->request->getPost());
        return $this->respond($user);
    }
}

Model (Data Access)

<?php

namespace App\Models;

use CodeIgniter\Model;

class UserModel extends Model
{
    protected $table = 'users';
    protected $allowedFields = ['name', 'email'];
    protected $returnType = 'App\Entities\User';
}

Service (Business Logic)

<?php

namespace App\Services;

class UserService
{
    public function __construct(
        private UserModel $model
    ) {}

    public function getAllUsers()
    {
        return $this->model->findAll();
    }
}

Resources

  • Controllers: thin, route to services
  • Models: database operations only
  • Services: business logic