360 Secure SkillHub
360 安全技能中心

typescript-coding-standards

该 Skill 汇总 TypeScript 函数、类型、文件命名、注释、模块、依赖、运行时、React/Next.js 与测试等编码规范,供编写、审查或重构代码时参考,并强调优先遵循目标仓库的本地约定。

分类:开发
berachain
热度 0.00
最近更新 2026-10-21 06:07:26

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add berachain/skills/typescript-coding-standards
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
typescript-coding-standards
license
MIT
description
Apply shared coding standards when writing, reviewing, or refactoring TypeScript in apps, services, workers, and shared packages. Use before editing TypeScript functions, types, exports, error handling, documentation, package dependencies, or React components and hooks. Includes conditional React and Next.js rules; backend repositories do not require either framework.

TypeScript Coding Standards

Apply these conventions when writing, reviewing, or refactoring TypeScript in frontend apps, backend services, workers, and shared libraries.

Read the target repository's AGENTS.md, package scripts, and lint/test configuration first. Explicit local requirements take precedence over these shared defaults. Keep changes within the requested scope; existing violations do not justify an unrelated repository-wide migration.

Guides

Read the guides relevant to the change before editing.

Guide Read when
TypeScript contracts Writing or reviewing functions, arguments, types, or constants.
File naming and size Creating, renaming, or splitting files.
Comments and JSDoc Documenting functions, types, or non-obvious logic.
Modules and organization Choosing exports, import boundaries, or where code belongs.
Dependencies and catalogs Adding or updating dependencies, package manifests, catalogs, or lockfiles.
Runtime behavior Handling errors, external data, service dependencies, or backend import boundaries.
React and Next.js Changing components, callbacks, or hooks; read the Next.js section only in Next.js apps.
Testing Deciding whether a test is useful, adding coverage, or reviewing assertions.
Tooling and verification Selecting tools or validating a code change.

For backend-only work, skip the React guide. Use the consumer's existing tooling and runtime conventions; the skill does not require adopting another repo's framework, formatter, or dependencies.