Nodejs Patterns
Async control flow, error handling, module design, streams, and production hardening
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill nodejs-patternsgit clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/backend/nodejs-patterns ~/.claude/skills/nodejs-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Node.js Patterns
Production-grade Node.js backend patterns.
## Async Patterns
### Prefer Async/Await
```javascript
// Good
async function getUser(id) {
const user = await db.findUser(id);
return user;
}
// Avoid raw callbacks or.then() chains
```
### Parallel Execution
```javascript
// Sequential (slow)
const user = await fetchUser(id);
const posts = await fetchPosts(id);
// Parallel (fast)
const [user, posts] = await Promise.all([
fetchUser(id),
fetchPosts(id),
]);
```
## Error Handling
### Global Handler
```javascript
process.on('uncaughtException', (err) => {
console.error('Uncaught:', err);
// Graceful shutdown
server.close(() => process.exit(1));
});
process.on('unhandledRejection', (reason) => {
console.error('Unhandled Rejection:', reason);
});
```
### Express Error Middleware
```javascript
app.use((err, req, res, next) => {
const status = err.status || 500;
res.status(status).json({
error: err.message,
...(process.env.NODE_ENV === 'development' && { stack: err.stack }),
});
});
```
## Module Design
- Single responsibility per module
- Export a class or factory function, not plain objects
- Use dependency injection for testability
- Prefer CommonJS (require) or ESM (import), consistent throughout
## Production Hardening
- Cluster mode for multi-core
- Process manager (PM2) with auto-restart
- Health check endpoints
- Graceful shutdown (SIGTERM handler)
- Memory limit monitoring
- Structured logging (pino/winston)Details
- Skill name
nodejs-patterns- Repository
- cosmicstack-labs/mercury-agent-skills
- Path
categories/backend/nodejs-patterns/SKILL.md- License
- MIT
- Repo updated
- 25 August 2026
FAQ
What does the Nodejs Patterns skill do?
Async control flow, error handling, module design, streams, and production hardening
How do I install the Nodejs Patterns skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill nodejs-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Nodejs Patterns popular?
It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.
Related skills
Accessibility
492cosmicstack-labs/mercury-agent-skills
Achieve and maintain WCAG compliance through inclusive design practices, proper ARIA usage, and comprehensive testing methodologies.
Accessibility Testing
492cosmicstack-labs/mercury-agent-skills
WCAG 2.1/2.2 audit, axe, Lighthouse, manual testing, screen reader testing, and remediation
Agent Audit Logging
492cosmicstack-labs/mercury-agent-skills
Implement comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.
Now Reading Page
329readwiseio/readwise-skills
Generate a personal "Now Reading" webpage from your Reader library
Microservices
492cosmicstack-labs/mercury-agent-skills
Service boundaries, communication patterns, event sourcing, CQRS, and distributed tracing
Product Strategy
492cosmicstack-labs/mercury-agent-skills
A comprehensive skill for product strategy — covering frameworks, opportunity sizing, prioritization, roadmap building, OKRs, and stakeholder management. From early-stage discovery to mature product org execution.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.