react-node-practices

A set of security, architecture, code-quality, and style rules for React and Node.js applications. The examples include protecting secrets, validating user input, and avoiding sensitive data in logs.

In plain words
What is it for?
Use it when writing or reviewing React and Node.js code, especially around environment variables, input validation, database queries, and logging.
Why use it?
It helps prevent common security mistakes and keeps application code easier to maintain.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sumulige/sumulige-claude/react-node-practices
Any agent
npx skills add sumulige/sumulige-claude --skill react-node-practices
Clone the repo
git clone --depth 1 https://github.com/sumulige/sumulige-claude

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02514
Opus 5 $0.00000 $0.01257
Sonnet 5 $0.00000 $0.00503
Haiku 4.5 $0.00000 $0.00251

Measured 2d ago against content hash e25c57b949c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-node-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/_archived/react-node-practices/SKILL.md · 410 lines

How it starts

The opening of the file, as written. The whole thing — 410 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React & Node.js Best Practices

AI Agent 编写正确代码的知识包 - 灵感来自 Supabase Agent Skills

规则分类(按优先级)

优先级 类别 说明
🔴 Critical 安全 & 性能 必须遵守,违反将阻止提交
🟠 High 架构 & 模式 应该遵守,影响可维护性
🟡 Medium 代码质量 建议遵守,提升代码质量
🟢 Low 风格偏好 可选遵守,团队约定

🔴 Critical: 安全规则

SEC-001: 环境变量处理

// ❌ 错误:硬编码密钥
const apiKey = "sk-proj-xxxxx"
const dbUrl = "postgres://user:pass@localhost/db"

// ✅ 正确:环境变量
const apiKey = process.env.API_KEY
if (!apiKey) throw new Error('API_KEY not configured')

// ✅ 正确:使用 zod 验证环境变量
import { z } from 'zod'
const envSchema = z.object({
  API_KEY: z.string().min(1),
  DATABASE_URL: z.string().url(),
})
const env = envSchema.parse(process.env)

SEC-002: 用户输入验证

// ❌ 错误:信任用户输入
app.post('/user', (req, res) => {
  db.query(`SELECT * FROM users WHERE id = ${req.body.id}`)
})

// ✅ 正确:参数化查询 + 验证
import { z } from 'zod'
const userIdSchema = z.string().uuid()

app.post('/user', (req, res) => {
  const id = userIdSchema.parse(req.body.id)
  db.query('SELECT * FROM users WHERE id = $1', [id])
})

SEC-003: 敏感数据不入日志

// ❌ 错误:记录敏感信息
console.log('User login:', { email, password, token })
logger.info('Payment:', { cardNumber, cvv })

// ✅ 正确:脱敏处理
console.log('User login:', { email, password: '[REDACTED]' })
logger.info('Payment:', { cardLast4: card.slice(-4) })

SEC-004: XSS 防护

// ❌ 错误:直接渲染用户内容
<div dangerouslySetInnerHTML={{ __html: userContent }} />

// ✅ 正确:使用 DOMPurify 或避免 dangerouslySetInnerHTML
import DOMPurify from 'dompurify'
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(userContent) }} />

// ✅ 更好:直接渲染文本
<div>{userContent}</div>

🔴 Critical: 性能规则

PERF-001: 避免 useEffect 瀑布

// ❌ 错误:串行请求
useEffect(() => {
  fetchUser().then(user => {
    fetchPosts(user.id).then(posts => {
      fetchComments(posts[0].id)
    })
  })
}, [])

// ✅ 正确:并行请求
useEffect(() => {
  Promise.all([
    fetchUser(),
    fetchPosts(),
    fetchComments()
  ]).then(([user, posts, comments]) => {
    // 处理数据
  })
}, [])

// ✅ 更好:使用 React Query / SWR
const { data: user } = useQuery('user', fetchUser)
const { data: posts } = useQuery(['posts', user?.id], () => fetchPosts(user.id), {
  enabled: !!user
})

Read the full file on GitHub · 410 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 410 lines · 0 tokens per session scan A e25c57b949c6

Subscribe to this mod's changes

react-node-practices is a skill published in the GitHub repository sumulige/sumulige-claude (2 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,514 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

codex-build

Orchestrate Codex to BUILD code in the background while this Claude Code session (typically Opus) plans and reviews — never babysitting. The session composes the implementation plan, kicks the dev-review runner detached via a background Bash task with --preset codex-build, ENDS ITS TURN, and is woken on exit to run a…

alanshurafa/co-evolution · 181 tokens

co-evolution

General-purpose co-evolution for questions, ideas, drafts, plans, specs, arguments, and markdown documents. Composes or bounces content between agents using [CONTESTED]/[CLARIFY] markers until it converges. Triggers on "co-evolution", "co-evolve", "co evolve", "bounce", "bounce document", "agent bouncer", "refine with…

alanshurafa/co-evolution · 118 tokens

recursive-task-optimizer

Build, configure, run, inspect, or troubleshoot agent-agnostic recursive improvement loops for a repository or artifact. Use when a task should be attempted repeatedly by Claude Code, Codex CLI, Hermes, or another CLI agent; when candidates must inherit mutable task instructions, a self-improving meta-procedure, and…

laruss/recursive-task-optimizer · 101 tokens

dev-review

Code-focused plan-bounce-execute workflow between Claude Code (Opus) and Codex CLI. Use when the user wants repo files changed, a bug fixed, a feature implemented, or a code plan verified before execution. One AI composes a plan, it bounces between agents with [CONTESTED]/[CLARIFY] markers until refined, then the…

alanshurafa/co-evolution · 176 tokens

frontend-best-practices

Use this skill when creating or modifying React frontend components. It defines UI/UX, styling, and architecture standards.

ApexIQ/skillsmith · 29 tokens

stitch

Google Stitch design platform skill bundle. Covers design system extraction, prompt enhancement, iterative site building, React component conversion, Remotion walkthrough videos, and shadcn/ui component integration. Activate when user mentions Stitch, design-to-code, DESIGN.md, shadcn/ui, or iterative site generation.

JStaRFilms/deprecated-Takomi_Code · 62 tokens