Skip to content
Agentmart
Submit a tool

backend-schema

Skill by davidleonmayor

IndexedMIT★ 3
Write a review

Chalk Labs

Need help deploying backend-schema?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/davidleonmayor-backend-schema

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The publisher has not written a description yet.

Use cases: backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
backend-schema
Description
None
License
MIT
Instructions
42 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • missing YAML frontmatter
  • name: missing
  • description: missing

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Backend Schema (Express Validator)

## Overview
This skill defines the convention for validating incoming HTTP request data using `express-validator`'s `Schema` objects.

## Trigger
When creating or updating validation schemas for backend API routes.

## Do's
- **Validate Data Strictly**: Ensure all incoming data is strictly validated before reaching the controller. Check for data types (`isString`, `isNumeric`), formats (`isEmail`, `isUUID`, `isDate`), and lengths (`isLength`). Do not let invalid data pass to the controller.
- **Validate Authorization Header**: If the route requires authentication, ALWAYS include the `authorization` header validation in the schema using regex `/^Bearer\s[\w-]+\.[\w-]+\.[\w-]+$/`.
- **Use `Schema` Object**: Always import `type { Schema } from "express-validator"` and define schemas as plain objects.
- **Export Indiviual Schemas**: Export a separate constant for each endpoint (e.g., `RegisterSchema`, `LoginSchema`).
- **Specify Location (`in`)**: Always define exactly where the field is expected using the `in` property (e.g., `in: ["body"]`, `in: ["params"]`, `in: ["query"]`, `in: ["headers"]`).
- **Explicit Error Messages**: Provide a specific `errorMessage` for every validation rule.
- **Sanitize Data**: Use built-in sanitizers like `trim: true`, `toLowerCase: true`, or `normalizeEmail: true` on relevant string inputs.
- **Custom Validators**: Use `custom: { options: (value, { req }) => ... }` for interdependent fields (like matching passwords).
- **Format Consistency**: Group validations logically: `in`, `exists`, `isString` / `isNumeric`, `isLength`, `matches`, followed by sanitizers.

## Don'ts
- **Don't use array-based chain validation**: Avoid `body('field').isString()`. Stick exclusively to the Schema object approach.
- **Don't omit the `in` property**: Omitting it forces express-validator to check all locations (body, query, params, headers), which is a security/performance risk.
- **Don't place schemas in routers or controllers**: Keep them isolated in a `*.schema.ts` file next to their respective feature.

## Example Structure
```typescript
import type { Schema } from "express-validator";

export const ExampleSchema: Schema = {
  field: {
    in: ["body"],
    exists: { errorMessage: "Field is required" },
    isString: { errorMessage: "Field must be a string" },
    isLength: {
      options: { min: 1, max: 50 },
      errorMessage: "Field must be between 1 and 50 characters",
    },
    trim: true,
  }
};
```

From davidleonmayor/proyecto-grado-unimayor, MIT.

Signals

Stars
3
Forks
0
Open issues
1
Last commit (this folder)
May 2, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from davidleonmayor

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get backend-schema running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying backend-schema?

CallGet help
Cite this page

backend-schema skill. Agent Mart. https://agentmart.dev/skills/davidleonmayor-backend-schema (last updated 2026-10-24)