pw-custom-page-classes

pw-custom-page-classes is a skill for Claude Code, Codex from trk/processwire-boost. It costs 40 tokens per session (1,878 once invoked), scanned A, original, MIT.

A guide for extending ProcessWire's base Page class with custom classes for particular templates. ProcessWire is a content management system, and a template defines the structure of a page.

In plain words
What is it for?
Creating specialized, strongly typed ProcessWire Page classes for specific templates.
Why use it?
It helps represent different page types with clearly defined code instead of treating every page as the same generic object.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Creating specialized, strongly typed ProcessWire Page classes for specific templates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/trk/processwire-boost/pw-custom-page-classes
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 trk/processwire-boost --skill pw-custom-page-classes
Clone the repo
git clone --depth 1 https://github.com/trk/processwire-boost

Made for: Claude Code, Codex.

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 pw-custom-page-classes

README.md
[![agentmods](https://agentmods.dev/badge/skills/trk/processwire-boost/pw-custom-page-classes/github.svg)](https://agentmods.dev/skills/trk/processwire-boost/pw-custom-page-classes)
Your own site
<a href="https://agentmods.dev/skills/trk/processwire-boost/pw-custom-page-classes"><img src="https://agentmods.dev/badge/skills/trk/processwire-boost/pw-custom-page-classes/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 pw-custom-page-classes

Your own site · 80×15
<a href="https://agentmods.dev/skills/trk/processwire-boost/pw-custom-page-classes"><img src="https://agentmods.dev/badge/skills/trk/processwire-boost/pw-custom-page-classes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,878 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.00040 $0.01878
Opus 5.5 $0.00016 $0.00751
Sonnet 5.5 $0.00008 $0.00376
Haiku 4.5 $0.00004 $0.00188

Measured 15d ago against content hash 9ed258d8d1fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pw-custom-page-classes 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 15d 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.

resources/boost/skills/pw-custom-page-classes/SKILL.md · 186 lines

How it starts

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

ProcessWire Custom Page Classes Playbook

Custom Page Classes map ProcessWire templates to strongly-typed PHP classes in site/classes/ under namespace ProcessWire; when $config->usePageClasses = true is enabled in site/config.php.

Documentation Reference (Source of Truth)

  • Core CLI: php index.php docs get-text Page and php index.php docs methods-text Page
  • Core Markdown: wire/core/Page/API.md and wire/core/Pages/API.md

1. Naming & Directory Mapping (site/classes/)

Convert the template name to PascalCase and append Page:

  • Universal fallback -> site/classes/DefaultPage.php (class DefaultPage extends Page)
  • Template home -> site/classes/HomePage.php (class HomePage extends DefaultPage when DefaultPage.php exists in site/classes/, otherwise extends Page)
  • Template blog-post -> site/classes/BlogPostPage.php (class BlogPostPage extends DefaultPage when DefaultPage.php exists, otherwise extends Page)
  • Core specialized types -> UserPage extends User, RolePage extends Role, LanguagePage extends Language, QuotesRepeaterPage extends RepeaterPage, SeoFieldsetPage extends FieldsetPage

[!TIP] Check site/classes/DefaultPage.php (or .agents/map.json templates.*.pageClass) first: if the project defines DefaultPage, extend DefaultPage on content page classes so shared site-wide helpers and interfaces are inherited consistently.

2. Canonical Implementation Pattern

<?php

declare(strict_types=1);

namespace ProcessWire;

/**
 * Custom Page Class for the `blog-post` template.
 *
 * @property string $title
 * @property string $summary
 * @property string $body
 * @property Pageimage|null $featured_image Single image when output formatting is on (`maxFiles=1`)
 * @property Pageimages $images Multi-image collection
 * @property PageArray|CategoryPage[] $categories
 * @property-read string $authorName
 * @method string renderSummary(int $maxLength = 160)
 */
class BlogPostPage extends DefaultPage
{
	public function getFeaturedImageSafe(): ?Pageimage
	{
		$unformatted = $this->getUnformatted('featured_image');

		return $unformatted instanceof Pageimages ? $unformatted->first() : null;
	}

	public function getAuthorName(): string
	{
		$author = $this->createdUser;
		if (!$author || !$author->id) {
			return $this->_('Unknown Author');
		}

		$fullName = trim("{$author->get('first_name')} {$author->get('last_name')}");

		return $fullName !== '' ? $fullName : (string) $author->name;
	}

	/**
	 * Hookable method (prefix with ___ and document with @method in PHPDoc).
	 */
	public function ___renderSummary(int $maxLength = 160): string
	{
		$sanitizer = $this->wire()->sanitizer;
		$raw = (string) ($this->get('summary') ?: $this->get('body'));

		return $sanitizer->entities($sanitizer->truncate($raw, $maxLength));
	}

	public function get($key): mixed
	{
		if ($key === 'authorName') {
			return $this->getAuthorName();
		}

		return parent::get($key);
	}
}

Read the full file on GitHub · 186 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. 15d ago Changed · +39 lines · +3 tokens per session 9ed258d8d1fe
  2. 1mo ago Changed · -101 lines · +9 tokens per session 7f528b611ddb
  3. 1mo ago Changed · +3 lines 0b6751c9818a
  4. 3mo ago First seen · 245 lines · 28 tokens per session scan A a69dd6422dd5

Subscribe to this mod's changes

pw-custom-page-classes is a skill published in the GitHub repository trk/processwire-boost (5 stars, last pushed yesterday), licensed MIT. It adds 40 tokens to every session and 1,878 once invoked, about $0.0002 per session on Opus 5.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-08-31.

Related

pw-custom-page-classes compared with skills from other repositories

pw-custom-page-classes next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pw-custom-page-classestrk/processwire-boostSkill5yesterdayMITA40Claude Code, Codex
sandbox-stablecloudflare/skillsSkill3.6k2d agoApache-2.0A39Claude Code
sandbox-nextcloudflare/skillsSkill3.6k2d agoApache-2.0A39Claude Code
durable-objectscloudflare/skillsSkill3.6k2d agoApache-2.0A22Claude Code
cloudflarecloudflare/skillsSkill3.6k2d agoApache-2.0A103Claude Code
cloudflare-email-servicecloudflare/skillsSkill3.6k2d agoApache-2.0A21Claude Code
workers-best-practicescloudflare/skillsSkill3.6k2d agoApache-2.0A25Claude Code