crud-http-ruleset

Validate PowerX HTTP handlers for CRUD, tenant, and DTO conventions.

357|65|Updated Jul 29, 2022
One-click install
npx skills add https://github.com/ArtisanCloud/PowerX --skill crud-http-ruleset
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: crud-http-ruleset
Source: https://github.com/ArtisanCloud/PowerX/tree/main/.codex/skills/crud/http-ruleset
Command: npx skills add https://github.com/ArtisanCloud/PowerX --skill crud-http-ruleset

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces consistent, transport-layer-only HTTP CRUD behavior across the PowerX codebase so handlers remain thin, multi-tenant aware, and semantically equivalent to service and gRPC layers, reducing bugs and architectural drift.

Core Features & Use Cases

  • Ruleset Enforcement: A comprehensive ruleset that validates route registration, handler signatures, and route prefixes to guarantee consistent API surface.
  • Safety & Separation of Concerns: Ensures handlers do not perform DB or external IO, mandates tenant context injection, and centralizes audit and RBAC to the Service layer.
  • Response & Pagination Conventions: Validates use of unified DTOs for errors, success envelopes, and pagination to make HTTP semantics equivalent to gRPC responses.
  • Use Case: Run these checks during code review or CI to automatically detect handlers that violate multi-tenancy, routing, or DTO conventions before they reach production.

Quick Start

Run the ruleset checks against internal/transport/http, fix any handler violations to align routes, tenant handling, DTO usage, and remove DB/IO from handlers.

Frequently Asked Questions about crud-http-ruleset

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent HTTP CRUD conventions for Go API handlers?▼

To enforce HTTP CRUD conventions for Go API handlers, apply a ruleset that validates handler signatures, route prefixes under /api/v1/admin, and DTO usage. This guarantees a consistent API surface and detects architectural drift before production.

How do I prevent direct database access inside HTTP handlers?▼

To prevent direct database access inside HTTP handlers, use a ruleset that forbids DB or external IO operations in the transport layer. This mandates handlers remain thin and centralizes audit, RBAC, and IO in the Service layer.

How do I standardize error and pagination responses for multi-tenant APIs?▼

To standardize error and pagination responses for multi-tenant APIs, validate the use of unified DTOs for success envelopes, errors, and pagination. This ensures HTTP semantics remain equivalent to gRPC responses across your codebase.

Can I validate tenant context injection in my Go HTTP handlers?▼

Yes, you can validate tenant context injection in Go HTTP handlers. The ruleset mandates tenant context enforcement for handlers, ensuring they are multi-tenant aware and semantically equivalent to service and gRPC layers.

What's the best way to check route registration prefixes for admin endpoints?▼

The best way to check route registration prefixes for admin endpoints is to run ruleset checks against files under internal/transport/http and validate that routes are registered under the /api/v1/admin prefix to guarantee a consistent API surface.

Why should HTTP handlers remain thin and avoid external IO in multi-tenant architectures?▼

HTTP handlers should remain thin and avoid external IO in multi-tenant architectures to maintain separation of concerns. Centralizing audit, RBAC, and database operations in the Service layer reduces bugs and prevents architectural drift.