Skip to content
Skills Library
Programming · Review & audit

backend-module-standards

/backend-module-standards

Enforce this repository's TypeScript backend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing backend code under `server/`, including routes, services, modules, repositories, shared backend code, and backend tests. Do not apply these rules to frontend code or non-backend scaffolding.

Licence
AGPL-3.0
Last repository change
27.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Enforce this repository's TypeScript backend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing backend code under `server/`, including routes, services, modules, repositories, shared backend code, and backend tests. Do not apply these rules to frontend code or non-backend scaffolding.

Original author description

Enforce this repository's TypeScript backend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing backend code under `server/`, including routes, services, modules, repositories, shared backend code, and backend tests. Do not apply these rules to frontend code or non-backend scaffolding.

How it works

  1. Inspect before editing
  2. Organize backend modules
  3. Place types, interfaces, and utilities
  4. Design exports deliberately
  5. Keep routes thin
  6. Test within the module
  7. Verify the result
Original SKILL.md headings · 61 lines, 625 words
SKILL.md preview
---
name: backend-module-standards
description: Enforce this repository's TypeScript backend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing backend code under `server/`, including routes, services, modules, repositories, shared backend code, and backend tests. Do not apply these rules to frontend code or non-backend scaffolding.
---

# Backend Module Standards

Apply these rules after the repository's basic scaffolding is in place. Limit them to backend code under `server/`. Preserve the requested task scope: make touched and newly generated backend code compliant without performing an unrelated repository-wide migration.

## Inspect before editing

1. Identify the owning feature module and its existing barrel, services, routes, and tests.
2. Search for existing shared types, interfaces, and utilities before adding any definition.
3. Search for every consumer before changing a module's public exports.

## Organize backend modules

- Place each feature in `server/modules/<feature>/`.
- Use TypeScript for every file inside `server/modules/`. Do not add JavaScript backend module files.
- When touched JavaScript utilities belong to the work, migrate them to TypeScript. Place a one-use utility in its sole component; place a utility used in at least two locations in `server/shared/utils.ts`.
- Give every feature module an `index.ts` barrel that exposes only its required public API.
- Import another feature module only through that module's `index.ts`. Never deep-import another module's routes, services, repositories, adapters, or internal files.
- Treat `server/shared/` as the shared module. Keep shared definitions in `server/shared/types.ts`, `server/shared/interfaces.ts`, and `server/shared/utils.ts`, and expose only required cross-module members through its barrel.
- Do not create module-local `types.ts`, `interfaces.ts`, or `utils.ts` files.
- Keep module-private implementation details unexported.

## Place types, interfaces, and utilities

- Use `type` by default. Use `interface` only for a contract that a class is intended to implement.
- Use `export type` for type exports and `import type` for type-only imports.
- Define a type, interface, or utility directly in its component file when it is used in only that location.
- Move a type or interface used in two or more locations to `server/shared/types.ts` or `server/shared/interfaces.ts` as appropriate.
- Move a utility used in two or more locations to `server/shared/utils.ts`.
- Do not duplicate an existing shared definition to avoid importing it.
- Give every shared type, interface, and utility a detailed doc comment explaining its behavior, valid usage, and important constraints.
- Keep related shared definitions adjacent. Introduce each group with `//----------------- DESCRIPTION OF GROUP ------------` and separate unrelated groups with `// ---------------------------`.

## Design exports deliberately

- Export a function or variable at its declaration, such as `export function loadSession()`. Do not collect ordinary exports at the end of an implementation file.
- The preceding rule does not apply to `index.ts` barrel exports.
- For every exported component, add a brief comment at its definition naming the consuming module or modules and explaining why they use it. Update the comment when consumers change.
- Do not export speculative helpers, implementation details, or symbols that have no cross-file consumer.
- Use clear, specific names for functions and variables. Add a concise comment anywhere intent, ordering, invariants, or edge cases could be confusing.

## Keep routes thin

- Parse and validate transport input in the route, convert it to the service's expected typed input, call one or more services, and translate the result to the response.
- Keep business logic, persistence, filesystem work, subprocess execution, and orchestration out of routes.
- Allow a service to call other services. Access another module's services through that module's public barrel contract.

## Test within the module

- Put feature tests in `server/modules/<feature>/tests/`.
- Add or update unit tests for changed service behavior and route parsing.

## Verify the result

Before finishing:

1. Confirm all cross-module imports use `index.ts` barrels and all public exports are necessary and documented.
2. Confirm shared definitions follow the one-use versus multiple-use placement rule and grouping-comment format.
3. Confirm routes only parse, call services, and format responses.
4. Run the narrow relevant tests, then `npm run build`, `npm run typecheck`, and `npm run lint` when the task scope and environment permit.
Files in this package (2)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named backend-module-standards.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version ed29f6bad48e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100frontend-module-standards
    Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and…
  • 100frontend-module-standards
    Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and…
  • 100backend-dev-guidelines
    Backend development guidelines for Node.js/Express/TypeScript applications. Layered architecture (Routes → Controllers → Services → Repositories), error handling, validation, middleware patterns, database access, and testing. Use when creating routes, endpoints, APIs,…
  • 100backend-architecture-principles
    Language-agnostic backend architecture and code-quality rules. Use when designing services, structuring a backend codebase, writing business logic, handling errors, configuration, logging, background jobs, or reviewing backend code for maintainability.
  • 95backend-dev-guidelines
    Comprehensive backend development guide for Node.js/Express/TypeScript microservices. Use when creating routes, controllers, services, repositories, middleware, or working with Express APIs, Prisma database access, Sentry error tracking, Zod validation, unifiedConfig, dependency…
  • 90ring:planning-backend-refactor
    Planning a backend refactor: audits an existing Go or TypeScript backend against Ring/Lerian standards and produces a prioritized task list (findings.md + tasks.md) ready for ring:running-dev-cycle. Plans only — no edits. Use when an existing backend service needs to meet…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.