nodejs-express
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js
- Permissions
-
- Read-only
- Env read
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: nodejs-express
description: Node.js + Express backend patterns. Use when building REST APIs, middleware, authentication, or…
category: engineering
runtime: Node.js
---
# nodejs-express output preview
## PART A: Task fit
- Use case: Node.js + Express backend patterns. Use when building REST APIs, middleware, authentication, or backend services with Node.js/Express/TypeScript. Use when this capability is needed..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Project Structure / App Setup / Controller Pattern (async error handling)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Node.js + Express backend patterns. Use when building REST APIs, middleware, authentication, or backend services with Node.js/Express/TypeScript. Use when this capability is needed.”.
- **02** When the source has headings, the agent prioritizes “Project Structure / App Setup / Controller Pattern (async error handling)” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, read environment variables, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, read environment variables, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, read environment variables, write/modify files.
Start with a small task and check whether the result follows “Project Structure / App Setup / Controller Pattern (async error handling)”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: nodejs-express
description: Node.js + Express backend patterns. Use when building REST APIs, middleware, authentication, or…
category: engineering
source: tomevault-io/skills-registry
---
# nodejs-express
## When to use
- Node.js + Express backend patterns. Use when building REST APIs, middleware, authentication, or backend services with…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Project Structure / App Setup / Controller Pattern (async error handling)” and keep inference separate from source facts.
- read files, read environment variables, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "nodejs-express" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Project Structure / App Setup / Controller Pattern (async error handling)
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js | read files, read environment variables, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Node.js + Express Patterns
Project Structure
src/
app.ts # Express app, middleware setup
server.ts # HTTP server, port binding
routes/ # Route definitions (auth.ts, users.ts)
controllers/ # Request handlers
services/ # Business logic
models/ # Prisma/Mongoose models
middleware/ # auth, error, validation
types/ # TypeScript interfaces
utils/ # Helpers
App Setup
// app.ts
import express from 'express'
import helmet from 'helmet'
import cors from 'cors'
import { errorHandler } from './middleware/error'
const app = express()
app.use(helmet())
app.use(cors({ origin: process.env.ALLOWED_ORIGINS?.split(','), credentials: true }))
app.use(express.json({ limit: '1mb' }))
app.use(express.urlencoded({ extended: true }))
app.use('/api/auth', authRouter)
app.use('/api/users', authenticate, usersRouter)
app.get('/health', (req, res) => res.json({ status: 'ok' }))
app.use(errorHandler) // Must be last
export default app
Controller Pattern (async error handling)
// Wrap async handlers to catch errors automatically
const asyncHandler = (fn: RequestHandler): RequestHandler =>
(req, res, next) => Promise.resolve(fn(req, res, next)).catch(next)
export const getUser = asyncHandler(async (req, res) => {
const user = await userService.findById(Number(req.params.id))
if (!user) return res.status(404).json({ error: 'User not found' })
res.json(user)
})
Auth Middleware
import jwt from 'jsonwebtoken'
export const authenticate: RequestHandler = (req, res, next) => {
const token = req.headers.authorization?.split(' ')[1]
if (!token) return res.status(401).json({ error: 'No token' })
try {
const payload = jwt.verify(token, process.env.JWT_SECRET!) as JwtPayload
req.user = payload
next()
} catch {
res.status(401).json({ error: 'Invalid token' })
}
}
Validation Middleware (Zod)
import { z } from 'zod'
const validate = (schema: z.ZodSchema) => (req: Request, res: Response, next: NextFunction) => {
const result = schema.safeParse(req.body)
if (!result.success) return res.status(400).json({ errors: result.error.flatten() })
req.body = result.data
next()
}
const CreateUserSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
name: z.string().max(100)
})
router.post('/users', validate(CreateUserSchema), createUser)
Error Handler
export const errorHandler: ErrorRequestHandler = (err, req, res, next) => {
console.error(err)
const status = err.status || 500
const message = status < 500 ? err.message : 'Internal server error'
res.status(status).json({ error: message })
}
Rules
- Use
helmet()for security headers - Use
express-rate-limiton auth endpoints - Validate ALL input with Zod (never trust req.body directly)
- Wrap all async handlers in asyncHandler (never unhandled promise rejections)
- Keep controllers thin — business logic in services
- Use
process.envfor config, validate at startup (crash fast if missing) - Return 404 for missing resources, 400 for bad input, 401/403 for auth, 500 for server errors
Source: cohen-liel/hivemind — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review