- Home
- Skills
- Bobmatnyc
- Claude Mpm Skills
- Advanced Architecture
advanced-architecture_skill
- Python
13
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bobmatnyc/claude-mpm-skills --skill advanced-architecture- metadata.json5.3 KB
- SKILL.md47.3 KB
Overview
This skill provides patterns and code for advanced WordPress architecture focused on REST API endpoints, WP-CLI command patterns, and strategies for performance and caching. It equips developers to build scalable, versioned APIs, organize complex controllers, and apply practical caching and optimization techniques for production sites.
How this skill works
The skill demonstrates registering namespaced REST routes with validation, sanitization, permission callbacks, and full CRUD handlers for a custom post type. It shows a controller-class pattern for grouping route logic, and outlines response shaping (HATEOAS links, pagination). It also surfaces performance tactics like caching query results, using WP-CLI for automation, and applying server-level and application-level caching.
When to use it
- Building custom REST APIs for headless WordPress or external clients
- Implementing secure, versioned endpoints with input validation and permissions
- Organizing complex endpoint logic using controller classes
- Optimizing query-heavy pages and API responses for high-traffic sites
- Automating repetitive tasks or maintenance with WP-CLI commands
Best practices
- Namespace and version your API to allow safe, backwards-compatible changes
- Validate and sanitize all input; use permission callbacks for auth checks
- Use controller classes for complex endpoints to keep code modular and testable
- Cache expensive queries and API responses; invalidate caches on relevant post meta or status changes
- Prefer soft delete (trash) for recoverability, allow force delete as an option
- Return consistent responses with pagination and HATEOAS links for discoverability
Example use cases
- Expose a book catalog as a paginated JSON API consumed by a mobile app
- Create custom WP-CLI commands to seed demo content or run migrations
- Implement endpoint-level caching for feeds that update infrequently
- Build an admin-only API for bulk updates with permission checks via current_user_can
- Migrate a legacy site to headless architecture while keeping WordPress as content source
FAQ
Require appropriate capability checks in permission_callback (e.g., current_user_can with edit_post) and use nonce or token-based authentication for external clients.
When should I use controller classes instead of simple callbacks?
Use controller classes when endpoints share validation, schema, or pagination logic, or when complexity makes single-file callbacks hard to maintain.