pn-php-scaffolding

pn-php-scaffolding is a skill for Cursor from perniemann/pnCore. It costs 50 tokens per session (1,434 once invoked), scanned A, original, MIT.

A starting structure for modern PHP APIs using Laravel or Slim, with common conventions for controllers, services, validation, and routes.

In plain words
What is it for?
Use it when starting a PHP API or adding a controller, route, or domain service.
Why use it?
It helps keep PHP backend code consistent and maintainable while handling dependencies, typed code, and framework conventions.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it when starting a PHP API or adding a controller, route, or domain service.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-php-scaffolding
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add perniemann/pnCore --skill pn-php-scaffolding
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pn-php-scaffolding

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-php-scaffolding/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-php-scaffolding)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-php-scaffolding"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-php-scaffolding/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pn-php-scaffolding

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-php-scaffolding"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-php-scaffolding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,434 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.01434
Opus 5 $0.00025 $0.00717
Sonnet 5 $0.00010 $0.00287
Haiku 4.5 $0.00005 $0.00143

Measured 5d ago against content hash cdf2ebebac48, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

pn-php-scaffolding scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pn-core-mcp/content/skills/backend/pn-php-scaffolding/SKILL.md · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP backend scaffolding

When to use

  • Starting a new PHP API project (Laravel API or Slim Framework).
  • Adding a new controller, route, or domain service.
  • Establishing typed, modern PHP patterns from scratch.

Laravel API scaffold

# New Laravel API project
composer create-project laravel/laravel my-api
cd my-api

# Install common packages
composer require spatie/laravel-permission   # RBAC
composer require tymon/jwt-auth              # JWT auth
composer require spatie/laravel-query-builder # filterable queries
composer require --dev squizlabs/php_codesniffer  # linting

Project structure

app/
  Http/
    Controllers/
      Api/
        V1/
          UserController.php     # Thin: validate, delegate, respond
          Controller.php
    Requests/
      CreateUserRequest.php      # Form Request validation
      UpdateUserRequest.php
    Resources/
      UserResource.php           # API resource (output shaping)
      UserCollection.php
  Services/
    UserService.php              # Business logic
  Repositories/
    UserRepository.php           # DB queries (optional layer)
  Models/
    User.php
routes/
  api.php                        # Route definitions
config/
  services.php                   # Third-party service keys (never raw env())

Controller scaffold

<?php
// app/Http/Controllers/Api/V1/UserController.php
declare(strict_types=1);

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Http\Requests\CreateUserRequest;
use App\Http\Resources\UserResource;
use App\Services\UserService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class UserController extends Controller
{
    public function __construct(private readonly UserService $userService) {}

    public function index(Request $request): JsonResponse
    {
        $users = $this->userService->list(
            page: (int) $request->query('page', 1),
            perPage: (int) $request->query('per_page', 20),
        );
        return response()->json(['data' => UserResource::collection($users)]);
    }

    public function store(CreateUserRequest $request): JsonResponse
    {
        $user = $this->userService->create($request->validated());
        return response()->json(['data' => new UserResource($user)], 201);
    }

    public function show(int $id): JsonResponse
    {
        $user = $this->userService->findOrFail($id);
        return response()->json(['data' => new UserResource($user)]);
    }
}

Read the full file on GitHub · 242 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 242 lines · 50 tokens per session scan A cdf2ebebac48

Subscribe to this mod's changes

pn-php-scaffolding is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 50 tokens to every session and 1,434 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.