一键导入
backend-development
Node.js and Express backend development with API design, Turbonomic integration, security best practices, and performance optimization
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Node.js and Express backend development with API design, Turbonomic integration, security best practices, and performance optimization
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill to learn hot to use the IBM Cloud CLI (`ibmcloud`) commands, flags, command patterns, or troubleshooting guidance. Covers core CLI workflows: install/verify/update, login with SSO or API keys, select account/region/resource group targets, inspect and configure CLI output, manage plug-ins (e.g. `vpc-infrastructure` / `ibmcloud is ...` for VPC infrastructure.).
Build voice-enabled agents in watsonx Orchestrate using the ADK. This guide covers initial setup, key concepts for building your first voice agent.
Reusable skills for the Turbonomic Resource Dashboard project. Each skill is a specialized workflow that Bob can activate to help with specific development tasks.
Deploy and manage HashiCorp Vault using Ansible automation with proper configuration, permissions, and security setup.
Plan and run evaluations, red-teaming, and runtime observability for watsonx Orchestrate (WXO) agents across Developer Edition and SaaS. Use when validating WXO agents pre-deploy, authoring benchmark JSON DAGs, interpreting Journey Success / Tool Call Recall / Agent Routing F1 / RAG Faithfulness, diagnosing agent failures, running adversarial red-teaming (Instruction Override, Jailbreaking, Crescendo Attack), searching runtime traces, exporting traces via the Python SDK, wiring Langfuse for cost & latency analysis, or registering model pricing in Langfuse. Interview-first; emits bash commands for the user to run in their IDE terminal.
Evaluate GenAI applications — RAG pipelines, LLM/chatbot outputs, and AI agents with tool-calling — before deployment using IBM watsonx.governance metrics. Use when scoring RAG faithfulness / answer relevance / context relevance / retrieval precision, screening LLM outputs for HAP / PII / social bias / jailbreak / prompt safety risk, evaluating agentic tool-call accuracy / parameter accuracy / relevance / syntactic validity, authoring custom LLM-as-judge metrics (criteria_judge or prompt_template styles) for domain-specific concerns, preparing eval datasets in the watsonx-gov SDK format, interpreting results against pass/fail thresholds, or producing prioritized [CRITICAL]/[WARNING]/[INFO] recommendations. Partners install `ibm-watsonx-gov[metrics,agentic,tools,llmaj]` directly and call the SDK in-process; no MCP server, no hosted dependency.
| name | backend-development |
| description | Node.js and Express backend development with API design, Turbonomic integration, security best practices, and performance optimization |
Use this skill when developing backend APIs, integrating external services, implementing middleware, optimizing server performance, or working with the Turbonomic API.
const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
const app = express();
// Middleware
app.use(helmet());
app.use(cors());
app.use(express.json());
// Routes
app.use('/api/turbonomic', require('./routes/turbonomic'));
// Error handler
app.use((err, req, res, next) => {
console.error(err.stack);
res.status(err.status || 500).json({
error: err.message || 'Internal server error'
});
});
const PORT = process.env.PORT || 4000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
const express = require('express');
const router = express.Router();
const { body, validationResult } = require('express-validator');
router.post('/actions',
// Validation
body('turboHost').isURL(),
body('turboUsername').notEmpty(),
body('turboPassword').notEmpty(),
// Handler
async (req, res, next) => {
try {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() });
}
const { turboHost, turboUsername, turboPassword } = req.body;
const actions = await turbonomicService.getActions(
turboHost,
turboUsername,
turboPassword
);
res.json(actions);
} catch (error) {
next(error);
}
}
);
module.exports = router;
const axios = require('axios');
class TurbonomicService {
async getActions(host, username, password) {
const auth = Buffer.from(`${username}:${password}`).toString('base64');
const response = await axios.post(
`${host}/api/v3/actions`,
{
actionStateList: ['PENDING_ACCEPT', 'RECOMMENDED']
},
{
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json'
},
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
}
);
return response.data;
}
}
module.exports = new TurbonomicService();
// Custom error class
class ApiError extends Error {
constructor(message, status = 500) {
super(message);
this.status = status;
this.name = 'ApiError';
}
}
// Async error wrapper
const asyncHandler = (fn) => (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
// Usage
router.get('/data', asyncHandler(async (req, res) => {
const data = await fetchData();
if (!data) {
throw new ApiError('Data not found', 404);
}
res.json(data);
}));
const { body, param, query, validationResult } = require('express-validator');
const validateRequest = (req, res, next) => {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() });
}
next();
};
router.post('/endpoint',
body('email').isEmail(),
body('age').isInt({ min: 0 }),
validateRequest,
handler
);
const NodeCache = require('node-cache');
const cache = new NodeCache({ stdTTL: 300 }); // 5 minutes
const cacheMiddleware = (duration) => (req, res, next) => {
const key = req.originalUrl;
const cached = cache.get(key);
if (cached) {
return res.json(cached);
}
res.originalJson = res.json;
res.json = (data) => {
cache.set(key, data, duration);
res.originalJson(data);
};
next();
};
backend/src/
├── config/ # Configuration files
├── middleware/ # Custom middleware
├── routes/ # Route definitions
├── services/ # Business logic
├── utils/ # Helper functions
├── __tests__/ # Test files
└── server.js # Entry point
// Use dotenv for configuration
require('dotenv').config();
const config = {
port: process.env.PORT || 4000,
nodeEnv: process.env.NODE_ENV || 'development',
corsOrigin: process.env.CORS_ORIGIN || '*'
};
const sanitize = require('sanitize-html');
const sanitizeInput = (input) => {
return sanitize(input, {
allowedTags: [],
allowedAttributes: {}
});
};
const rateLimit = require('express-rate-limit');
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // limit each IP to 100 requests per windowMs
message: 'Too many requests from this IP'
});
app.use('/api/', limiter);
Refer to the following files in this skill folder for detailed guidance:
api-design.md - RESTful API design patternsturbonomic-integration.md - Turbonomic API integration detailssecurity.md - Security best practices and implementationperformance.md - Performance optimization strategiestesting.md - Backend testing patternseval() or execute user inputAlways implement health check endpoints:
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
timestamp: new Date().toISOString(),
uptime: process.uptime()
});
});
app.get('/ready', async (req, res) => {
// Check dependencies
const checks = await Promise.all([
checkDatabase(),
checkExternalAPI()
]);
const ready = checks.every(check => check.ok);
res.status(ready ? 200 : 503).json({
ready,
checks
});
});