Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

typescript-code-reviewTypeScript 代码审查

Agent Skill

typescript-code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,223

周安装

52

GitHub Stars

7,487

下载量

428
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/anyproto/anytype-ts --skill typescript-code-review

简介

typescript-code-review 用于查找、检索和筛选相关信息。

  • 它适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装命令:npx skills add https://github.com/anyproto/anytype-ts --skill typescript-code-review
  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境

SKILL.md

TypeScript Code Review Skill

Perform thorough, professional code reviews for TypeScript code with focus on type safety, best practices, performance, security, and maintainability.

Review Process

When reviewing TypeScript code, follow this structured approach:

1. Initial Assessment

  • Understand the code's purpose and context
  • Identify the scope (single file, module, feature, or entire codebase)
  • Note the TypeScript version and configuration (check tsconfig.json)
  • Review any relevant documentation or comments

2. Core Review Categories

Type Safety

  • Strict mode compliance: Verify strict: true in tsconfig.json and adherence
  • Type annotations: Check for proper type annotations, avoid implicit any
  • Type narrowing: Ensure proper use of type guards and narrowing
  • Generic types: Review generic usage for flexibility without sacrificing safety
  • Union and intersection types: Verify correct usage and handling
  • Type assertions: Flag unnecessary or dangerous type assertions (the as keyword and non-null assertion operator)
  • Null/undefined handling: Check for proper optional chaining (?.) and nullish coalescing (??)
  • Return types: Ensure all functions have explicit return types
  • Discriminated unions: Verify proper exhaustiveness checking

Code Quality & Best Practices

  • Naming conventions: Check for clear, descriptive names (camelCase for variables/functions, PascalCase for types/classes)
  • Function length: Flag functions longer than ~50 lines or with high complexity
  • Single responsibility: Ensure functions and classes have one clear purpose
  • DRY principle: Identify duplicate code that should be extracted
  • Magic numbers/strings: Flag hardcoded values that should be constants
  • Error handling: Review try-catch usage, error types, and error messages
  • Async/await: Check for proper async handling, avoid mixing callbacks/promises
  • Immutability: Prefer const over let, check for array/object mutations
  • Enums vs unions: Recommend const enums or union types over regular enums when appropriate

Modern TypeScript Features

  • Optional chaining: Suggest using ?. for nested property access
  • Nullish coalescing: Recommend ?? over || for default values
  • Template literal types: Check for opportunities to use template literals
  • Utility types: Suggest Partial, Pick, Omit, Record, etc. where appropriate
  • Const assertions: Recommend as const for literal types
  • Type predicates: Use for custom type guards
  • satisfies operator: Use instead of type assertions when validating types

Performance

  • Unnecessary re-renders: In React/frameworks, check for memo usage, dependency arrays
  • Large bundle imports: Flag entire library imports when tree-shaking is possible
  • Inefficient algorithms: Identify O(n²) or worse when better options exist
  • Memory leaks: Check for cleanup in event listeners, subscriptions, timers
  • Lazy loading: Suggest dynamic imports for large modules
  • Type calculation cost: Flag extremely complex type calculations that slow compilation

Security

  • Input validation: Ensure user input is validated and sanitized
  • XSS vulnerabilities: Check for unsafe HTML rendering or eval usage
  • Sensitive data: Flag hardcoded secrets, tokens, or passwords
  • Dependency vulnerabilities: Recommend running npm audit or checking dependencies
  • Type safety as security: Ensure types prevent security issues (e.g., SQL injection through tagged templates)

Testing & Maintainability

  • Test coverage: Note missing tests for critical paths
  • Type-only imports: Use import type for type-only imports
  • Circular dependencies: Flag circular imports
  • Barrel exports: Check for performance issues with index files
  • Documentation: Verify JSDoc comments for public APIs
  • Deprecation notices: Ensure deprecated code is properly marked

3. Output Structure

Organize the review with clear sections:

## Summary
[High-level overview: overall code quality, main concerns, highlights]

## Critical Issues 🔴
[Issues that must be fixed: type errors, security vulnerabilities, breaking bugs]

## Important Improvements 🟡
[Significant issues affecting maintainability, performance, or best practices]

## Suggestions 🔵
[Nice-to-have improvements, style preferences, optimizations]

## Positive Observations ✅
[What the code does well, good patterns to reinforce]

## Detailed Findings

### [Category 1: e.g., Type Safety]
**File**: `path/to/file.ts:line_number`
- **Issue**: [Description]
- **Current code**:

[code snippet]


- **Recommended**: `[improved code]`
- **Reasoning**: [Why this matters]

[Repeat for each finding]

4. Code Review Guidelines

Tone and Style:

  • Be constructive and specific, not vague or critical
  • Explain the "why" behind recommendations
  • Provide code examples for suggested changes
  • Acknowledge good practices when present
  • Use severity indicators (🔴 critical, 🟡 important, 🔵 suggestion)

Prioritization:

  1. Critical: Security issues, type errors, runtime bugs
  2. Important: Performance problems, maintainability issues, anti-patterns
  3. Suggestions: Style improvements, modern syntax, optimizations

Context Awareness:

  • Consider the project's maturity (prototype vs production)
  • Respect existing patterns if consistent across codebase
  • Note tradeoffs (e.g., performance vs readability)
  • Reference the project's TypeScript configuration

5. Reference Files

For detailed guidance on specific topics, consult the reference files:

  • references/type-safety-checklist.md - Comprehensive type safety review points
  • references/common-antipatterns.md - TypeScript anti-patterns to avoid
  • references/security-checklist.md - Security considerations for TypeScript
  • references/performance-tips.md - Performance optimization strategies

Search references using Grep when encountering specific issues. For example:

  • Type guard issues: grep "type guard" in references/type-safety-checklist.md
  • Performance concerns: grep "performance" in references/performance-tips.md

6. TypeScript Configuration Review

When reviewing tsconfig.json, check for:

Recommended strict settings:

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "exactOptionalPropertyTypes": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true
  }
}

7. Framework-Specific Considerations

React + TypeScript:

  • Component prop types with interfaces
  • Proper typing for hooks (useState, useEffect, useCallback, etc.)
  • Event handler types (e.g., React.MouseEvent<HTMLButtonElement>)
  • Ref types (useRef<HTMLDivElement>(null))
  • Children typing (React.ReactNode vs React.ReactElement)

Node.js + TypeScript:

  • Proper types for Express/Fastify handlers
  • Async error handling in middleware
  • Environment variable typing
  • Database query result typing

Testing:

  • Type-safe mocks and stubs
  • Proper typing for test utilities (Jest, Vitest, etc.)
  • Type assertions in tests

8. Automated Checks to Recommend

Suggest running these tools if not already in use:

  • TypeScript compiler: tsc --noEmit for type checking
  • ESLint: With @typescript-eslint/parser and recommended rules
  • Prettier: For consistent formatting
  • ts-prune: Find unused exports
  • depcheck: Find unused dependencies
  • madge: Detect circular dependencies

9. Review Workflow

  1. Scan for critical issues first: Type errors, security issues, obvious bugs
  2. Review architecture: File structure, module boundaries, separation of concerns
  3. Deep dive into logic: Algorithm correctness, edge cases, error handling
  4. Check types thoroughly: Accuracy, safety, appropriate use of TypeScript features
  5. Performance review: Identify bottlenecks, unnecessary work, optimization opportunities
  6. Style and consistency: Naming, formatting, pattern adherence
  7. Testing and docs: Coverage, clarity, maintainability

10. Example Interaction

User: "Review this TypeScript file for issues"

Response Flow:

  1. Read the file(s) provided
  2. Check for any tsconfig.json in the project
  3. Perform systematic review across all categories
  4. Structure findings with severity levels
  5. Provide specific, actionable recommendations with code examples
  6. Highlight positive practices
  7. Suggest next steps (run specific tools, add tests, refactor specific areas)

Best Practices

  • Be thorough but practical: Focus on issues that matter
  • Provide context: Explain why something is an issue and what problems it could cause
  • Show, don't just tell: Include code examples for recommendations
  • Consider the audience: Adjust detail level based on the team's TypeScript experience
  • Stay current: Reference modern TypeScript features (4.9+, 5.0+)
  • Balance: Don't let perfect be the enemy of good—acknowledge tradeoffs

When to Use This Skill

Activate this skill when the user:

  • Explicitly asks for a code review of TypeScript code
  • Requests feedback on TypeScript implementation
  • Asks to check code for issues, bugs, or improvements
  • Wants to ensure TypeScript best practices are followed
  • Needs help improving code quality or type safety
  • Requests a security or performance audit of TypeScript code

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.76%
按下载量换算157

Claude

32.28%
按下载量换算138

Cursor

19.15%
按下载量换算82

Gemini CLI

9.2%
按下载量换算39

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills