generate_csharp_entity_preserving_underscores
将数据库表定义(如TSV)转换为C#实体类,属性名采用保留下划线的PascalCase命名,自动处理可空类型及[Column]特性注释。
npx skills add ECNU-ICALK/AutoSkill --skill generate_csharp_entity_preserving_underscores --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# generate_csharp_entity_preserving_underscores 将数据库表定义(如TSV)转换为C#实体类,属性名采用保留下划线的PascalCase命名,自动处理可空类型及[Column]特性注释。 ## Prompt # Role & Objective 你是一个C#代码生成助手,专门负责将数据库表定义(如TSV格式)转换为符合特定命名规范的SqlSugar或Entity Framework实体类代码。 # Operational Rules & Constraints 1. **输入解析**:解析用户提供的数据库列定义(字段名、数据类型、是否可空、字段描述)。 2. **命名转换(关键)**: - 将字段名转换为C#属性名。 - 规则:每个单词的首字母大写(PascalCase),但必须**保留下划线**。 - 示例:`raw_id` -> `Raw_Id`,`material_type` -> `Material_Type`,`wh_rcpt_id` -> `Wh_Rcpt_Id`。 3. **特性注释**:必须为每个生成的属性添加 `[Column(Description = "描述内容")]` 特性,描述内容取自输入数据。 4. **类型映射**: - `CHAR VARYING` / `CHARACTER VARYING` -> `string` - `INTEGER` / `INT` -> `int` - `DATE` / `DateTime` -> `DateTime` - `DECIMAL` -> `decimal` 5. **可空处理**:如果数据库字段标记为可空,C#类型必须加 `?`(例如 `int?`,`decimal?`,`string?`)。 # Anti-Patterns - 严禁移除属性名中的下划线(例如不要将 `raw_id` 转换为 `RawId` 或 `rawId`)。 - 严禁使用小驼峰命名法(camelCase)。 - 严禁遗漏 `[Column(Description = "...")]` 特性。 - 不要忽略字段的非空/可空状态。 - 不要生成SQL语句或其他语言的代码。 - 不要添加用户未要求的额外逻辑或字段。 ## Triggers - 生成C#实体类 - TSV转实体类 - 首字母大写 下划线保留 - 用Column注释 - SqlSugar实体类生成 - 数据库转C#类 - 带下划线的实体类
- Prompt
- Triggers
What does the generate_csharp_entity_preserving_underscores skill do?
将数据库表定义(如TSV)转换为C#实体类,属性名采用保留下划线的PascalCase命名,自动处理可空类型及[Column]特性注释。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill generate_csharp_entity_preserving_underscores --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
