Backend
Skill hilmifawwazsaad/ExpressJS-ts-Boilerplate/.agents/backend
Generate production-grade Express.js + TypeScript code with Layered Architecture. Routes, handlers, services, repositories, middlewares, validations, utils — no UI.From its SKILL.md
npx -y skills add hilmifawwazsaad/ExpressJS-ts-Boilerplate --skill backendAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.1 KB, 647 tokens by cl100k_base, as published. Nobody here has run it
Pre-Code Checklist
- Which layer? Map need to exactly one row in the Architecture table
- Call direction:
routes → handlers → services → repositories— no skipping, no reversing - Error to throw? Use typed class from
utils/errors.ts, never rawnew Error()
Architecture
| Layer | File | Constraint |
|---|---|---|
| Path + HTTP method | routes/[name].route.ts | Attach middleware + handler only — no logic |
| Auth, rate limiting | middlewares/[name].middleware.ts | Always call next() or next(err) |
| Body / params / query validation | validations/[name].validation.ts | Zod schema · export z.infer as named type |
| Request → response | handlers/[name].handler.ts | < 20 lines · try/catch/next(err) · no DB |
| Business logic | services/[name].service.ts | No req/res · throw on not-found, never return null |
| DB queries | repositories/[name].repository.ts | Only layer allowed to touch DB |
| Entity interfaces and enums | models/[name].model.ts | Domain types only |
| Env vars, DB connection | config/env.ts · config/database.ts | All process.env here only |
| Helpers, errors, response format | utils/ | Domain-agnostic — no layer imports |
| Express + shared type augmentation | types/express.d.ts | req.user augmentation here only |
TypeScript
strict: trueenforced intsconfig.jsonunknownnotany— ifanyis necessary, add an inline comment- Unused params: prefix with
_—_req,_res,_next - Types from Zod only:
type T = z.infer<typeof schema>— never write duplicate interfaces - All
src/imports via@/alias — never relative../../
Response & Errors
sendSuccess(res, data) · sendCreated(res, data, msg) from utils/response.ts. For errors: next(err).
Errors from utils/errors.ts only — never throw new Error():
NotFoundError · UnauthorizedError · ForbiddenError · ConflictError · ValidationError
Never Do
- Logic in
routes/· DB inhandlers/·req/resinservices/ process.envoutsideconfig/env.ts- Return
nullfor missing data — throwNotFoundError anywithout inline comment · manual types duplicating a Zod schema- Expose raw
err.messageor stack trace to client - Log secrets, tokens, or passwords
- Import libraries not in
package.json
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.