pagination-standard

Frontend-backend pagination standard, defining minimal parameter naming to reduce transmission characters, applicable to all system pagination scenarios.

$ Instalar

git clone https://github.com/TrueNine/claude-code-projects /tmp/claude-code-projects && cp -r /tmp/claude-code-projects/.claude/skills/page ~/.claude/skills/claude-code-projects

// tip: Run this command in your terminal to install the skill


name: pagination-standard description: Frontend-backend pagination standard, defining minimal parameter naming to reduce transmission characters, applicable to all system pagination scenarios.

Pagination Parameter Standard

Request Parameters

ParamFull NameTypeDefaultDescription
ooffsetnumber0Offset, starting from which record
ssizenumber42Page size

Response Parameters

ParamFull NameTypeDescription
ddataarrayData list
ttotalnumberTotal record count
ppagesnumberTotal page count

Usage Examples

Backend Interface

interface PageQuery {
  o?: number  // offset, default 0
  s?: number  // size, default 42
}

interface PageResult<T> {
  d: T[]      // data list
  t: number   // total count
  p: number   // total pages
}

Frontend Query Params

GET /api/users?o=0&s=42
GET /api/users?o=42&s=42   // page 2

Frontend Pagination Calculation

// page number to offset
const offset = (page - 1) * size

// offset to page number
const page = Math.floor(offset / size) + 1

// total pages
const totalPages = Math.ceil(total / size)

Design Philosophy

Single-letter minimal parameter naming reduces network transmission characters. Significantly lowers bandwidth consumption in high-frequency call scenarios.