Chalk Labs
Need help deploying backend-router?
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.
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-router
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.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
backend-router- Description
- None
- License
- MIT
- Instructions
- 112 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 Router (Express.js)
## Overview
This skill defines the convention for declaring Express.js routers using an Object-Oriented approach.
## Trigger
When creating or updating route definitions for a backend feature.
## Do's
- **Use Classes**: Define routes inside a class (e.g., `FeatureRoutes`).
- **Encapsulate Router**: Expose a `public router: Router` property initialized in the constructor with `Router()`.
- **Instantiate Dependencies**: Initialize the respective `Controller` and any specific `Middleware` inside the constructor.
- **`initRoutes()` Method**: Bind all routes in a dedicated `initRoutes()` method called from the constructor.
- **Middleware Execution Order**: ALWAYS place `validateSchema` as the FIRST middleware in the route chain, BEFORE `isAuthenticatedUser`, `isConfirmed`, or any role checks. This ensures the payload and headers (like the authorization token) are structurally valid before running auth queries.
- **Controller Binding**: Pass the controller method reference directly (e.g., `this.controller.methodName`). Ensure the controller constructor binds its methods (`this.methodName = this.methodName.bind(this)`).
## Don'ts
- **Don't use inline `.bind()` in the router**: Never do `this.controller.create.bind(this.controller)` inside the router definition. The router should look extremely clean (see Example Structure). Method binding MUST happen inside the Controller's constructor.
- **Don't use functional routers**: Avoid top-level `const router = Router(); export default router;`. Stick to the Class structure.
- **Don't define inline route handlers**: Do not put business or response logic directly in the `.post()` or `.get()` callback. Always delegate to the Controller.
- **Don't mix schema logic in the router**: Validation schemas must be imported from the respective `*.schema.ts` file.
## Example Structure
- Always validate input data first with validateSchema() to prevent the passage of malformed or malicious data.
- If necessary, then use the authentication and/or user role middleware; the authentication middleware should come first, followed by the user role.
- Finally goes the controller to manage only the busines logic
```typescript
import { Router } from "express";
import { FeatureController } from "./feature.controller";
import { validateSchema } from "../common/middleware/validateSchema";
import { AuthMiddleware } from "../common/middleware/AuthMiddleware";
import { CreateFeatureSchema } from "./feature.schema";
export class FeatureRoutes {
public router: Router;
private controller: FeatureController;
private authMiddleware: AuthMiddleware;
constructor() {
this.router = Router();
this.controller = new FeatureController();
this.authMiddleware = new AuthMiddleware();
this.initRoutes();
}
initRoutes() {
this.router.post(
"/",
validateSchema(CreateFeatureSchema),
this.controller.create,
);
this.router.get(
"/",
validateSchema(CreateFeatureSchema),
this.authMiddleware.isAuthenticatedUser,
this.authMiddleware.isConfirmed,
this.controller.getAll,
);
}
}
```
## Don't do
- don't
```typescript
import { Router } from "express";
import { FeatureController } from "./feature.controller";
import { validateSchema } from "../common/middleware/validateSchema";
import { AuthMiddleware } from "../common/middleware/AuthMiddleware";
import { CreateFeatureSchema } from "./feature.schema";
export class FeatureRoutes {
public router: Router;
private controller: FeatureController;
private authMiddleware: AuthMiddleware;
constructor() {
this.router = Router();
this.controller = new FeatureController();
this.authMiddleware = new AuthMiddleware();
this.initRoutes();
}
// don't use validateSchema before enyting, Alwais validale schema goes first
initRoutes() {
this.router.post(
"/",
this.controller.create,
validateSchema(CreateFeatureSchema),
);
// don't use, Allwais goes auth middlewares after validate schema
this.router.get(
"/",
validateSchema(CreateFeatureSchema),
this.controller.getAll,
this.authMiddleware.isAuthenticatedUser,
this.authMiddleware.isConfirmed,
);
}
}
```From davidleonmayor/proyecto-grado-unimayor, MIT.
More from davidleonmayor/proyecto-grado-unimayor
- 0.516score
backend-context
davidleonmayor
Backend architecture, patterns and conventions for the Express.js 5 API.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
ui-ux-designer
davidleonmayor
Create interface designs, wireframes, and design systems.
SkillCFreshness: C★ 3Claude Code +9 - 0.451score
frontend-context
davidleonmayor
Frontend architecture, patterns and conventions for the Next.js 15 app.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
skill-commit
davidleonmayor
Creates professional git commits following conventional-commits format.
SkillDFreshness: D★ 3Claude Code +9 - 0.437score
express-mocks-testing
gentleman-programming
Unit testing pattern for Express 5 controllers using node-mocks-http and @prisma/client mocks.
SkillCFreshness: C★ 3Claude Code +9 - 0.274score
backend-schema
davidleonmayor
No description from the publisher yet.
SkillCFreshness: C★ 3Claude Code +9 - 0.274score
backend-controller
davidleonmayor
No description from the publisher yet.
SkillCFreshness: C★ 3Claude Code +9 - 0.274score
backend-service
davidleonmayor
No description from the publisher yet.
SkillCFreshness: C★ 3Claude Code +9 - 0.248score
project-info
davidleonmayor
General monorepo structure and component overview.
SkillDFreshness: D★ 3Claude Code +9 - 0.248score
skill-sync
prowler-cloud
Synchronizes skill metadata to AGENTS.md Auto-invoke sections.
SkillDFreshness: D★ 3Claude Code +9
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
- Source
- GitHubgithub-graphql
More from davidleonmayor
- 0.516score
backend-context
davidleonmayor
Backend architecture, patterns and conventions for the Express.js 5 API.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
ui-ux-designer
davidleonmayor
Create interface designs, wireframes, and design systems.
SkillCFreshness: C★ 3Claude Code +9 - 0.451score
frontend-context
davidleonmayor
Frontend architecture, patterns and conventions for the Next.js 15 app.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
skill-commit
davidleonmayor
Creates professional git commits following conventional-commits format.
SkillDFreshness: D★ 3Claude Code +9
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-router 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.
Cite this page
backend-router skill. Agent Mart. https://agentmart.dev/skills/davidleonmayor-backend-router (last updated 2026-10-24)