AgentSkillsCN

data-standard

在编写数据库表、实体类、SQL以及迁移文件时,自动应用公共数据标准术语词典。在数据库列名、表名以及变量名中采用标准英文缩写,并严格遵守领域规则。当您编写ORM实体、DTO、VO、SQL DDL以及模式定义时使用此功能。

SKILL.md
--- frontmatter
name: data-standard
description: >
  Automatically applies the public data standard terminology dictionary when writing
  database tables, entity classes, SQL, and migration files. Uses standard English
  abbreviations for DB column names, table names, and variable names, and complies
  with domain rules. Used when writing ORM entities, DTOs, VOs, SQL DDL, and schema definitions.

Data Standard Terminology Application Skill

When writing DB-related code, you must follow the standards below. For the detailed guide, refer to data-standard-terminology-guide.md in this directory.

Target Files

  • JPA/Hibernate entity classes (.java)
  • TypeORM/Prisma entities/schemas (.ts)
  • SQLAlchemy/Django models (.py)
  • SQL files (.sql)
  • Migration files
  • DTO/VO classes

Core Rules

1. Use standard terminology English abbreviations for column names

Search for the Korean term name in the standard terminology dictionary (data/standard_terms.json) and use the English abbreviation.

Key examples:

Korean TermEnglish Abbreviation (physical column name)Domain
고객명 (Customer Name)CSTMR_NM명V100
가입일자 (Join Date)JOIN_YMD연월일C8
등록일시 (Registration DateTime)REG_DT연월일시분초D
사업자등록번호 (Business Registration Number)BRNO사업자등록번호C10
결제금액 (Payment Amount)STLM_AMT금액N15
사용여부 (Use Status)USE_YN여부C1
상태코드 (Status Code)STTS_CD코드C3
전화번호 (Phone Number)TELNO전화번호V11
우편번호 (Postal Code)ZIP우편번호C5
도로명주소 (Road Name Address)RDNMADR주소V200
상세주소 (Detailed Address)DTL_ADDR주소V320
처리내용 (Processing Content)PRCS_CN내용V1000
변경사유 (Change Reason)CHG_RSN내용V500

2. Follow suffix patterns

SuffixMeaningExample
_YMDDate (year-month-day)REG_YMD (Registration Date)
_DTDateTimeREG_DT (Registration DateTime)
_YMYear-MonthACNT_YM (Account Year-Month)
_YRYearBSNS_YR (Business Year)
_AMTAmountSTLM_AMT (Payment Amount)
_PRCPriceSUPLY_PRC (Supply Price)
_NMNameCSTMR_NM (Customer Name)
_CDCodeSTTS_CD (Status Code)
_NONumberSEQ_NO (Sequence Number)
_CNContentPRCS_CN (Processing Content)
_CNTCountDEAL_CNT (Transaction Count)
_RTRateTAX_RT (Tax Rate)
_YNYes/NoUSE_YN (Use Status)
_SNSequenceSRT_SN (Sort Order)
_ADDRAddressDTL_ADDR (Detailed Address)

3. Table name rules

PrefixPurposeExample
TB_General tableTB_CSTMR (Customer)
TC_Code tableTC_STTS_CD (Status Code)
TH_History tableTH_CSTMR_CHG (Customer Change History)
TL_Log tableTL_LOGIN (Login Log)
TR_Relation tableTR_CSTMR_PRDT (Customer-Product Relation)

4. Data type mapping based on domain rules

Date/Time

DomainDB TypeJavaTypeScriptPython
연월일시분초DDATETIMELocalDateTimeDatedatetime
연월일C8CHAR(8)Stringstringstr
연월C6CHAR(6)Stringstringstr
연도C4CHAR(4)Stringstringstr

Amount/Number

DomainDB TypeJavaTypeScriptPython
금액N15NUMERIC(15)BigDecimalnumberDecimal
가격N10NUMERIC(10)BigDecimalnumberDecimal
수N10NUMERIC(10)Longnumberint
수N5NUMERIC(5)Integernumberint
율N5,2NUMERIC(5,2)BigDecimalnumberDecimal

String

DomainDB TypeJavaTypeScriptPython
명V100VARCHAR(100)Stringstringstr
명V200VARCHAR(200)Stringstringstr
내용V1000VARCHAR(1000)Stringstringstr
내용V4000VARCHAR(4000)Stringstringstr
주소V200VARCHAR(200)Stringstringstr

Code/Boolean

DomainDB TypeJavaTypeScriptPython
코드C1~C7CHAR(n)Stringstringstr
코드V20VARCHAR(20)Stringstringstr
여부C1CHAR(1)String"Y" | "N"str

5. Forbidden words must not be used

Words in the 금칙어목록 (forbidden word list) field of the standard word dictionary (data/standard_words.json) are prohibited. When found, replace them with the standard word from the 이음동의어목록 (synonym list).

6. How to look up terminology

When DB-related naming is needed:

  1. Search by Korean 공통표준용어명 (common standard term name) in data/standard_terms.json
  2. Use the 공통표준용어영문약어명 (common standard term English abbreviation) value as the column name
  3. Determine the data type and length from the 공통표준도메인명 (common standard domain name)
  4. If not found in the standard terms, combine individual word abbreviations from 공통표준단어영문약어명 in data/standard_words.json

7. JPA Entity Example

java
@Entity
@Table(name = "TB_CSTMR")
public class Customer {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "CSTMR_SN")
  private Long customerSn;

  @Column(name = "CSTMR_NM", length = 100, nullable = false)
  private String customerNm;

  @Column(name = "BRNO", length = 10, columnDefinition = "CHAR(10)")
  private String brno;

  @Column(name = "TELNO", length = 11)
  private String telno;

  @Column(name = "JOIN_YMD", length = 8, columnDefinition = "CHAR(8)")
  private String joinYmd;

  @Column(name = "REG_DT")
  private LocalDateTime regDt;

  @Column(name = "USE_YN", length = 1, columnDefinition = "CHAR(1) DEFAULT 'Y'")
  private String useYn;
}