# Automatic define lists Refactor
Generate admin lists in https://github.com/tgstation/tgstation/blob/master/code/_globalvars/traits.dm
when a new trait is added using buildscript. Same for bitfields but that's more complicated.
Some simple config in buildscript dir
```
[
{
name : "Trait define collector"
input_files: {"some_traits.dm","other_traits.dm"}
prefix:"TRAIT_"
category_tag:"Trait Category"
output_file:"traits.dm"
},
]
```
From traits spread around
```
#define TRAIT_GENERIC_TRAIT "a"
//Trait Category : /obj/item
#define TRAIT_ITEM_WHATEVER "b"
//Trait Category : /mob
#define TRAIT_THREE "three"
````
into new autogenned file traits.dm - empty version can be included by default in dme so no need to modify it directly
```
//AUTOGENERATED FILE HEADER WARNING BLAH BLAH
GLOBAL_LIST_INIT(traits_by_type, list(
/obj/item = list(
"TRAIT_ITEM_WHATEVER" = TRAIT_ITEM_WHATEVER),
/mob = list(
"TRAIT_THREE" = TRAIT_THREE),
/datum = list(
"TRAIT_GENERIC_TRAIT" = TRAIT_GENERIC_TRAIT))
```