Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计通过

secure-node-typescriptsecure node TypeScript 命令行

Agent Skill

secure-node-typescript 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

917

周安装

39

GitHub Stars

1

下载量

321
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:secure-node-typescript(secure node TypeScript 命令行)
来源仓库:https://github.com/joacod/skills
仓库路径:skills/secure-node-typescript
安装命令:
npx skills add https://github.com/joacod/skills --skill secure-node-typescript
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/joacod/skills --skill secure-node-typescript

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在需要围绕仓库状态、代码变更或协作事项进行整理时使用。
  • 可结合来源仓库和原始 README 核验具体用法,支持主流 Agent 宿主。
  • 安装命令:npx skills add https://github.com/joacod/skills --skill secure-node-typescript。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。

SKILL.md

Secure Node.js TypeScript

Overview

Write secure-by-default Node.js and TypeScript applications that neutralize common server-side threats. This skill provides security guidelines organized by domain, with inline patterns for the most critical controls.

All guidelines are mapped to OWASP Top 10:2025 categories for compliance tracking and audit purposes. See references/security-index.md for the complete OWASP mapping.

Security Tiers

Apply guidelines based on the code context:

TierWhen to ApplyKey Focus Areas
AlwaysAll Node.js/TS codeStrict TypeScript, input validation, no hardcoded secrets, safe error handling
API/HTTPWeb endpoints, middlewareHeaders (helmet), rate limiting, CORS, body limits, Content-Type validation
AuthAuthentication featuresPassword hashing (argon2), JWT validation, secure cookies, RBAC
DataExternal data processingSQL injection, XSS sanitization, prototype pollution, schema validation
RuntimeDynamic code, processesNo eval, safe child_process, path traversal prevention

Quick Patterns

The 10 most critical security controls. Apply these by default.

1. Enable Strict TypeScript

// tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noUncheckedIndexedAccess": true
  }
}

2. Validate All Inputs with Zod

// DO: Schema validation at entry points
import { z } from 'zod'

const UserSchema = z.object({
  email: z.string().email(),
  age: z.number().int().min(0).max(150),
})

// In route handler
const result = UserSchema.safeParse(req.body)
if (!result.success) {
  return res.status(400).json({ error: 'Invalid input' })
}
const user = result.data // Type-safe validated data

3. Use Parameterized Queries

// DON'T: String concatenation (SQL injection)
const query = `SELECT * FROM users WHERE id = ${userId}`

// DO: Parameterized queries
const result = await db.query('SELECT * FROM users WHERE id = $1', [userId])

4. Hash Passwords with Argon2

import argon2 from 'argon2'

// Hash password
const hash = await argon2.hash(password, { type: argon2.argon2id })

// Verify password
const valid = await argon2.verify(hash, password)

5. Set Security Headers with Helmet

import helmet from 'helmet'
import express from 'express'

const app = express()
app.use(helmet()) // Sets HSTS, CSP, X-Frame-Options, etc.
app.disable('x-powered-by')

6. Limit Request Body Size

// DO: Enforce strict body limits
app.use(express.json({ limit: '1kb' })) // Adjust based on expected payload

// DON'T: Unlimited body parsing (DoS risk)
app.use(express.json())

7. Sanitize File Paths

import path from 'node:path'

// DO: Resolve and validate paths
const ALLOWED_DIR = '/app/uploads'
const safePath = path.resolve(ALLOWED_DIR, userInput)

if (!safePath.startsWith(ALLOWED_DIR)) {
  throw new Error('Path traversal attempt blocked')
}

8. Never Expose Stack Traces

// DO: Generic error response to clients
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
  console.error(err) // Log full error internally
  res.status(500).json({ error: 'Internal server error' }) // Generic to client
})

// DON'T: Expose error details
res.status(500).json({ error: err.message, stack: err.stack })

9. Use Environment Variables for Secrets

// DO: Load secrets from environment
import 'dotenv/config'

const dbPassword = process.env.DB_PASSWORD
if (!dbPassword) throw new Error('DB_PASSWORD required')

// DON'T: Hardcoded secrets
const dbPassword = 'secret123' // Never do this

10. Import with node: Protocol

// DO: Explicit Node.js built-in imports (prevents typosquatting)
import { createServer } from 'node:http'
import { readFile } from 'node:fs/promises'
import path from 'node:path'

// DON'T: Implicit imports
import { createServer } from 'http' // Could resolve to malicious package

Reference Loading Guide

Load reference files based on the task at hand:

TaskLoad Reference
Project setup, tsconfig, type safetyreferences/typescript-safety.md
Form validation, user input, API paramsreferences/input-validation.md
Login, sessions, JWT, passwords, RBACreferences/authentication.md
Headers, CORS, rate limiting, CSPreferences/http-security.md
eval, child_process, prototype pollutionreferences/runtime-safety.md
File uploads, path handling, regexreferences/filesystem-paths.md
npm audit, lockfiles, supply chainreferences/dependencies.md
Error handling, logging, monitoringreferences/error-logging.md
Linters, CI/CD, threat modelingreferences/operational.md
Full guideline lookupreferences/security-index.md

Audit Script

Validate a project's tsconfig.json for security-relevant settings:

python3 scripts/audit-tsconfig.py /path/to/project

The script checks for:

  • strict: true enabled
  • noImplicitAny enabled
  • strictNullChecks enabled
  • noUncheckedIndexedAccess enabled
  • Other security-relevant compiler options

Assets

Template configurations available in assets/:

  • tsconfig.secure.json - Strict TypeScript configuration template
  • eslint-security.config.js - ESLint security plugin configuration

Copy and adapt these to your project as a starting point.

Resources

  • Security index: references/security-index.md
  • TypeScript safety: references/typescript-safety.md
  • Input validation: references/input-validation.md
  • Authentication: references/authentication.md
  • HTTP security: references/http-security.md
  • Runtime safety: references/runtime-safety.md
  • Filesystem paths: references/filesystem-paths.md
  • Dependencies: references/dependencies.md
  • Error logging: references/error-logging.md
  • Operational: references/operational.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.45%
按下载量换算95

OpenCode

25.81%
按下载量换算83

Cursor

16.19%
按下载量换算52

mcpjam

13.37%
按下载量换算43

crush

7.56%
按下载量换算24

cline

3.29%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills