Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
sickn33 avatar

Backend Dev Guidelines

  • 1.6k installs
  • 44k repo stars
  • Updated July 27, 2026
  • sickn33/antigravity-awesome-skills

Senior backend engineer operating production-grade services under strict architectural and reliability constraints using layered architecture, explicit error boundaries, strong typing, centralized config, and first-class

About

Backend Development Guidelines is an architectural ruleset for building maintainable, observable Node.js/Express/TypeScript microservices. It mandates layered architecture (routes → controllers → services → repositories), centralized configuration via unifiedConfig, Zod validation for all external input, and Sentry error tracking on all critical paths. Developers use it when building routes, controllers, services, repositories, middleware, and Prisma database access. Key workflows include the Backend Feasibility & Risk Index (BFRI) assessment pre-implementation, strict naming conventions, dependency injection discipline, and required unit + integration test coverage. Anti-patterns (business logic in routes, direct Prisma in controllers, console.log, untested logic) trigger immediate rejection.

  • Mandatory layered architecture: routes → controllers → services → repositories with zero cross-layer leakage
  • Backend Feasibility & Risk Index (BFRI) framework assesses architectural fit, complexity, data risk, operational risk, a
  • All errors captured in Sentry; all config via unifiedConfig; all input validated with Zod schemas
  • BaseController abstraction eliminates raw res.json calls; asyncErrorWrapper prevents unhandled promise rejections
  • Strict naming conventions, DI pattern, repository encapsulation, and required unit/integration test coverage before merg

Backend Dev Guidelines by the numbers

  • 1,553 all-time installs (skills.sh)
  • +26 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #310 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

backend-dev-guidelines capabilities & compatibility

Capabilities
enforce layered architecture validation · calculate backend feasibility & risk index (bfri · generate repository, service, and controller sca · review error handling and sentry integration · validate zod schemas and input validation · assess test coverage requirements · identify anti patterns in existing code
Works with
sentry · github
Use cases
code review · debugging · refactoring · api development · testing
Platforms
macOS · Windows · Linux · WSL
Runs
Remote server
Pricing
Free
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill backend-dev-guidelines

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.6k
repo stars44k
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorysickn33/antigravity-awesome-skills

What it does

Enforce production-grade Node.js/Express backend architecture with layered separation, validation, error tracking, and observability.

Who is it for?

Node.js/Express/TypeScript teams building production microservices, routes/controllers/services/repositories, Prisma database access, middleware composition, error handling and observability.

Skip if: Frontend logic, deployment automation, infrastructure provisioning, legacy non-layered codebases, or tasks outside routes/controllers/services/repositories scope.

When should I use this skill?

Building or modifying routes, controllers, services, repositories, Express middleware, Prisma database access, Zod validation, Sentry error tracking, or backend refactors.

What you get

Predictable, testable, observable backend systems with zero anti-patterns, BFRI-driven risk assessment, and mandatory Sentry tracking on all critical paths.

  • layered API modules
  • Prisma data access layer
  • middleware with error boundaries

By the numbers

  • BFRI scoring range: -10 to +10; threshold for safe implementation ≥ 6
  • Mandatory test coverage: unit tests for services, integration tests for routes, repository tests for complex queries
  • 10 core anti-patterns explicitly rejected: business logic in routes, skipping service layer, direct Prisma in controller

Files

SKILL.mdMarkdownGitHub ↗

Backend Development Guidelines

(Node.js · Express · TypeScript · Microservices)

You are a senior backend engineer operating production-grade services under strict architectural and reliability constraints.

Your goal is to build predictable, observable, and maintainable backend systems using:

  • Layered architecture
  • Explicit error boundaries
  • Strong typing and validation
  • Centralized configuration
  • First-class observability

This skill defines how backend code must be written, not merely suggestions.

---

1. Backend Feasibility & Risk Index (BFRI)

Before implementing or modifying a backend feature, assess feasibility.

BFRI Dimensions (1–5)

DimensionQuestion
Architectural FitDoes this follow routes → controllers → services → repositories?
Business Logic ComplexityHow complex is the domain logic?
Data RiskDoes this affect critical data paths or transactions?
Operational RiskDoes this impact auth, billing, messaging, or infra?
TestabilityCan this be reliably unit + integration tested?

Score Formula

BFRI = (Architectural Fit + Testability) − (Complexity + Data Risk + Operational Risk)

Range: -10 → +10

Interpretation

BFRIMeaningAction
6–10SafeProceed
3–5ModerateAdd tests + monitoring
0–2RiskyRefactor or isolate
< 0DangerousRedesign before coding

---

When to Use

Automatically applies when working on:

  • Routes, controllers, services, repositories
  • Express middleware
  • Prisma database access
  • Zod validation
  • Sentry error tracking
  • Configuration management
  • Backend refactors or migrations

---

2. Core Architecture Doctrine (Non-Negotiable)

1. Layered Architecture Is Mandatory

Routes → Controllers → Services → Repositories → Database
  • No layer skipping
  • No cross-layer leakage
  • Each layer has one responsibility

---

2. Routes Only Route

// ❌ NEVER
router.post('/create', async (req, res) => {
  await prisma.user.create(...);
});

// ✅ ALWAYS
router.post('/create', (req, res) =>
  userController.create(req, res)
);

Routes must contain zero business logic.

---

3. Controllers Coordinate, Services Decide

  • Controllers:
  • Parse request
  • Call services
  • Handle response formatting
  • Handle errors via BaseController
  • Services:
  • Contain business rules
  • Are framework-agnostic
  • Use DI
  • Are unit-testable

---

4. All Controllers Extend BaseController

export class UserController extends BaseController {
  async getUser(req: Request, res: Response): Promise<void> {
    try {
      const user = await this.userService.getById(req.params.id);
      this.handleSuccess(res, user);
    } catch (error) {
      this.handleError(error, res, 'getUser');
    }
  }
}

No raw res.json calls outside BaseController helpers.

---

5. All Errors Go to Sentry

catch (error) {
  Sentry.captureException(error);
  throw error;
}

console.log ❌ silent failures ❌ swallowed errors

---

6. unifiedConfig Is the Only Config Source

// ❌ NEVER
process.env.JWT_SECRET;

// ✅ ALWAYS
import { config } from '@/config/unifiedConfig';
config.auth.jwtSecret;

---

7. Validate All External Input with Zod

  • Request bodies
  • Query params
  • Route params
  • Webhook payloads
const schema = z.object({
  email: z.string().email(),
});

const input = schema.parse(req.body);

No validation = bug.

---

3. Directory Structure (Canonical)

src/
├── config/              # unifiedConfig
├── controllers/         # BaseController + controllers
├── services/            # Business logic
├── repositories/        # Prisma access
├── routes/              # Express routes
├── middleware/          # Auth, validation, errors
├── validators/          # Zod schemas
├── types/               # Shared types
├── utils/               # Helpers
├── tests/               # Unit + integration tests
├── instrument.ts        # Sentry (FIRST IMPORT)
├── app.ts               # Express app
└── server.ts            # HTTP server

---

4. Naming Conventions (Strict)

LayerConvention
ControllerPascalCaseController.ts
ServicecamelCaseService.ts
RepositoryPascalCaseRepository.ts
RoutescamelCaseRoutes.ts
ValidatorscamelCase.schema.ts

---

5. Dependency Injection Rules

  • Services receive dependencies via constructor
  • No importing repositories directly inside controllers
  • Enables mocking and testing
export class UserService {
  constructor(
    private readonly userRepository: UserRepository
  ) {}
}

---

6. Prisma & Repository Rules

  • Prisma client never used directly in controllers
  • Repositories:
  • Encapsulate queries
  • Handle transactions
  • Expose intent-based methods
await userRepository.findActiveUsers();

---

7. Async & Error Handling

asyncErrorWrapper Required

All async route handlers must be wrapped.

router.get(
  '/users',
  asyncErrorWrapper((req, res) =>
    controller.list(req, res)
  )
);

No unhandled promise rejections.

---

8. Observability & Monitoring

Required

  • Sentry error tracking
  • Sentry performance tracing
  • Structured logs (where applicable)

Every critical path must be observable.

---

9. Testing Discipline

Required Tests

  • Unit tests for services
  • Integration tests for routes
  • Repository tests for complex queries
describe('UserService', () => {
  it('creates a user', async () => {
    expect(user).toBeDefined();
  });
});

No tests → no merge.

---

10. Anti-Patterns (Immediate Rejection)

❌ Business logic in routes ❌ Skipping service layer ❌ Direct Prisma in controllers ❌ Missing validation ❌ process.env usage ❌ console.log instead of Sentry ❌ Untested business logic

---

11. Integration With Other Skills

  • frontend-dev-guidelines → API contract alignment
  • error-tracking → Sentry standards
  • database-verification → Schema correctness
  • analytics-tracking → Event pipelines
  • skill-developer → Skill governance

---

12. Operator Validation Checklist

Before finalizing backend work:

  • [ ] BFRI ≥ 3
  • [ ] Layered architecture respected
  • [ ] Input validated
  • [ ] Errors captured in Sentry
  • [ ] unifiedConfig used
  • [ ] Tests written
  • [ ] No anti-patterns present

---

13. Skill Status

Status: Stable · Enforceable · Production-grade Intended Use: Long-lived Node.js microservices with real traffic and real risk ---

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Related skills

How it compares

Use backend-dev-guidelines for opinionated Express plus Prisma layering rather than generic language-agnostic API advice.

FAQ

Can I put business logic in routes?

No. Routes only route. All business logic lives in services. Controllers coordinate between requests and services.

What is the BFRI formula and when do I use it?

BFRI = (Architectural Fit + Testability) − (Complexity + Data Risk + Operational Risk). Calculate before implementing features to assess feasibility (6+ safe, 3-5 moderate, 0-2 risky, <0 dangerous).

Why must all config come from unifiedConfig?

Centralized config prevents secrets leakage, enables environment-specific overrides, and eliminates scattered process.env calls that break observability and testing.

Is Backend Dev Guidelines safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Backend & APIsbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.