Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

domain-language-types领域语言类型

Agent Skill

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

总安装

216

周安装

9

GitHub Stars

2

下载量

72
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill domain-language-types

简介

domain-language-types 倡导使用业务语言命名类型,而非数据结构术语。

  • 适用于新类型定义、API 设计评审与遗留代码类型名重构。
  • 强调非程序员也能理解的命名原则,提升代码可读性。
  • 推荐 APIResponse、CustomerOrder 等业务导向类型名替代 INodeNameValueData。
  • 建议建立团队命名规范并在代码审查中强制执行。

SKILL.md

Name Types Using the Language of Your Problem Domain

Overview

Type names should communicate meaning, not structure.

A type named INodeNameValueData tells you nothing. A type named APIResponse or CustomerOrder tells you everything. Use the language of your business domain, not the language of data structures.

When to Use This Skill

  • Naming new types
  • Refactoring unclear type names
  • Reviewing code with domain experts
  • Designing public APIs

The Iron Rule

Type names should be meaningful to domain experts.
If a non-programmer can't understand it, rename it.

Remember:

  • Business terms > technical terms
  • Meaning > structure
  • Names are documentation
  • Domain experts should recognize types

Detection: Structural Names

// Bad: describes structure, not meaning
interface IEntityWithIdAndName {
  id: string;
  name: string;
}

interface IStringPairList {
  items: [string, string][];
}

interface IDataRecord {
  data: Record<string, unknown>;
}

What IS an IEntityWithIdAndName? A user? A product? A category?

Better: Domain Names

// Good: describes what it IS
interface User {
  id: string;
  name: string;
}

interface TranslationPairs {
  items: [sourcePhrase: string, targetPhrase: string][];
}

interface CustomerProfile {
  data: Record<string, unknown>;
}

Real Example: E-commerce

// Bad: generic/structural names
interface IData {
  id: string;
  props: Record<string, unknown>;
}

interface IEntity extends IData {
  type: string;
}

interface ICollection {
  items: IEntity[];
  total: number;
}

vs.

// Good: domain language
interface Product {
  sku: string;
  name: string;
  price: Money;
  inventory: number;
}

interface Order {
  orderNumber: string;
  customer: Customer;
  items: OrderItem[];
  total: Money;
}

interface ProductCatalog {
  products: Product[];
  totalCount: number;
}

Avoid These Patterns

Hungarian Notation Prefixes

// Bad: I prefix for interfaces
interface IUser { }
interface IProduct { }

// Good: just the name
interface User { }
interface Product { }

Type Suffixes

// Bad: redundant suffixes
interface UserType { }
interface ProductInterface { }
interface OrderObject { }

// Good: clean names
interface User { }
interface Product { }
interface Order { }

Generic Technical Terms

// Bad: generic
interface DataModel { }
interface EntityRecord { }
interface ItemContainer { }

// Good: specific
interface Invoice { }
interface ShippingAddress { }
interface ShoppingCart { }

Property Names Too

// Bad: technical property names
interface User {
  dataString: string;
  valueNumber: number;
  itemsArray: Product[];
}

// Good: domain property names
interface User {
  email: string;
  age: number;
  purchases: Product[];
}

Context Matters

Same structure, different domains:

// Healthcare domain
interface Patient {
  mrn: string;          // Medical Record Number
  admissionDate: Date;
  diagnosis: string[];
}

// Education domain
interface Student {
  studentId: string;
  enrollmentDate: Date;
  courses: string[];
}

The structure is similar, but the names communicate different meanings.

When Technical Names Are OK

Standard Technical Concepts

// OK: widely understood technical terms
interface HttpRequest { }
interface DatabaseConnection { }
interface CacheEntry { }

Generic Utilities

// OK: truly generic utilities
type Nullable<T> = T | null;
type AsyncResult<T> = Promise<T>;

Internal Implementation

// OK for internal implementation details
interface InternalCacheNode<T> { }
interface TreeNodeImpl<T> { }

Ubiquitous Language

From Domain-Driven Design: use "ubiquitous language" that both developers and domain experts share.

// If domain experts say "fulfillment", use that:
interface OrderFulfillment { }

// Not:
interface OrderProcessingData { }
interface IOrderExecutionEntity { }

Pressure Resistance Protocol

1. "It's a Technical Detail"

Pressure: "Users won't see this type name"

Response: Developers will. Future you will. Make it meaningful.

Action: Name it for what it represents, not how it's structured.

2. "We Have Naming Conventions"

Pressure: "Our style guide says use I prefix"

Response: Conventions should serve clarity, not hinder it.

Action: Challenge conventions that reduce clarity. IUser adds nothing.

Red Flags - STOP and Reconsider

  • Type names starting with I, T, or ending in Type/Interface/Object
  • Names that describe structure (StringArray, NumberMap)
  • Names that a domain expert wouldn't recognize
  • Multiple types that could all be called "Data"

Common Rationalizations (All Invalid)

ExcuseReality
"It matches our backend"Backend might have bad names too
"It's just internal"Internal code needs clarity too
"That's our convention"Bad conventions should change

Quick Reference

// DON'T: Structural/technical names
interface IDataEntity { }
interface StringValuePair { }
interface ItemsCollection<T> { }

// DO: Domain language names
interface Customer { }
interface PriceRange { }  // [min: Money, max: Money]
interface ProductCatalog { }

// DON'T: Redundant suffixes
interface UserType { }
interface ProductInterface { }

// DO: Clean names
interface User { }
interface Product { }

The Bottom Line

Name types for what they mean, not how they're structured.

Domain experts should be able to read your type names and understand what they represent. Invoice tells you more than IFinancialDataRecord. Use the language of your problem domain.

Reference

Based on "Effective TypeScript" by Dan Vanderkam, Item 41: Name Types Using the Language of Your Problem Domain.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

33.05%
按下载量换算24

Claude

29.36%
按下载量换算21

Cursor

19.59%
按下载量换算14

Gemini CLI

9.94%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills