with one click
new-component
交互式创建新的 ECS 组件,自动生成反射注册代码
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
交互式创建新的 ECS 组件,自动生成反射注册代码
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
构建项目(默认构建 Editor 目标)
构建并运行 Editor
在子任务/phase 完成后,把"关键决策、踩坑、技术栈舍弃与选择"沉淀到对应位置(任务 SPEC.md / 全局 MEMORY.md / docs/decisions ADR)。Use proactively when the user invokes /checkpoint, says "整理一下"、"沉淀一下"、"phase 收尾"、"做个 checkpoint"、"任务先告一段落"。
Comprehensive citation management for academic research. Search Google Scholar and PubMed for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.
Search 78 public scientific, biomedical, materials science, and economic databases via REST APIs. Covers physics/astronomy (NASA, NIST, SDSS, SIMBAD), earth/environment (USGS, NOAA, EPA), chemistry/drugs (PubChem, ChEMBL, DrugBank, FDA, KEGG, ZINC, BindingDB), materials (Materials Project, COD), biology/genomics (Reactome, UniProt, STRING, Ensembl, NCBI Gene, GEO, GTEx, PDB, AlphaFold, InterPro, BioGRID, Gene Ontology, dbSNP, gnomAD, ENCODE, Human Protein Atlas, Human Cell Atlas), disease/clinical (COSMIC, Open Targets, ClinicalTrials.gov, OMIM, ClinVar, GDC/TCGA, cBioPortal, DisGeNET, GWAS Catalog), regulatory (FDA, USPTO, SEC EDGAR), economics/finance (FRED, World Bank, US Treasury), demographics (US Census, Eurostat, WHO). Use when looking up compounds, genes, proteins, pathways, variants, clinical trials, patents, economic indicators, or any public database API query.
Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).
| name | new-component |
| description | 交互式创建新的 ECS 组件,自动生成反射注册代码 |
| disable-model-invocation | true |
| allowed-tools | Read, Edit, Grep |
| argument-hint | [ComponentName] 组件名称(PascalCase,如 WindZoneComponent) |
创建一个新的 ECS 组件,并完成反射系统注册。
向用户询问以下信息(如参数中未提供):
Component 结尾,如 WindZoneComponent)float、int、bool、glm::vec3 等)遇到不确定或缺失信息时主动向用户提问,不要猜测。
按顺序修改两处代码:
Engine/src/Scene/Components.h在文件末尾(最后一个组件之后)添加结构体定义:
struct XxxComponent
{
// 属性字段 + 默认值
};
Engine/src/Reflection/ComponentRegistry.cpp在文件末尾添加反射声明 + 注册代码(ENGINE_COMPONENT / ENGINE_PROPERTY 宏现在在 .cpp 中声明):
ENGINE_COMPONENT(XxxComponent, "显示名称");
ENGINE_PROPERTY(XxxComponent, FieldName, "标签", Vec3);
REGISTER_COMPONENT_BEGIN(XxxComponent)
REGISTER_COMPONENT_PROPERTY(XxxComponent, FieldName)
REGISTER_COMPONENT_END(XxxComponent)
如需 UI 约束(数值 Min/Max/Speed),使用带 _EX 后缀的变体:
ENGINE_PROPERTY_EX(XxxComponent, Speed, "速度", Float,
hints.Speed = 0.1f; hints.Min = 0.0f; hints.Max = 100.0f; hints.Format = "%.1f");
REGISTER_COMPONENT_BEGIN(XxxComponent)
REGISTER_COMPONENT_PROPERTY(XxxComponent, Speed)
REGISTER_COMPONENT_END(XxxComponent)
ENGINE_PROPERTY / ENGINE_PROPERTY_EX 都有对应的 REGISTER_COMPONENT_PROPERTYPropertyType 与字段 C++ 类型严格匹配ComponentRegistry.cpp 已包含 Scene/Components.h(通常已有)PropertyType 枚举值在 ENGINE_PROPERTY 中写简短形式(Float、Vec3),不是 PropertyType::Float执行 build skill 构建 Editor 目标,确认编译通过。构建成功后,编辑器的 Add Component 菜单应出现新组件。
| C++ 类型 | ENGINE_PROPERTY 写法 | 说明 |
|---|---|---|
float | Float | 标量 |
int | Int | 整数 |
bool | Bool | 布尔 |
glm::vec2 | Vec2 | 二维向量 |
glm::vec3 | Vec3 | 三维向量 |
glm::vec4 | Vec4 | 四维向量 |
glm::vec3(颜色) | Color3 | 颜色选择器 |
glm::vec4(颜色) | Color4 | 带 Alpha 颜色选择器 |
std::string | String | 字符串 |
std::string(路径) | AssetPath | 文件选择器 |
enum | Enum | 需额外定义枚举名数组 |