I have a couple of things somewhere...
Simpleish example from a topic a while back:
creature_bee
[OBJECT:CREATURE]
[CREATURE:BIGAPIS]
[DESCRIPTION:A large, striped, social insect with a poisonous sting. It is more easily tamed than its minature brethren.]
[NAME:giant bee:giant bees:giant bee]
[CREATURE_TILE:'B'][COLOR:6:0:1]
[DIURNAL][NO_SLEEP]
[NOPAIN][NOSTUN][NOEMOTION][NOFEAR]
[LARGE_ROAMING][NATURAL][NOBONES]
[FREQUENCY:20][POPULATION_NUMBER:10:30][CLUSTER_NUMBER:4:8]
[GRASSTRAMPLE:2][LITTERSIZE:32:64]
[PREFSTRING:bright stripes]
[PREFSTRING:poisonous sting]
[HOMEOTHERM:10067][SPEED:800][SAVAGE]
[BIOME:SUBTERRANEAN_CHASM]
[UNDERGROUND_DEPTH:1:2]
[BIOME:ANY_TEMPERATE_FOREST]
[CHILD:1]
[APPLY_CREATURE_VARIATION:INSECT]
[BODY:2EYES:HEART:GUTS:BRAIN:MOUTH:2WINGS:STINGER:2ANTENNA]
[APPLY_CREATURE_VARIATION:CHITINOUS_MATS_TISSUES]
[APPLY_CREATURE_VARIATION:CONFIGURE_AS_CREATURE]
[APPLY_CREATURE_VARIATION:ADD_SINEWS]
[APPLY_CREATURE_VARIATION:ADD_BODY_FLUIDS_ICHOR_PUS]
[APPLY_CREATURE_VARIATION:ALLOW_SICKNESS]
[APPLY_CREATURE_VARIATION:ATTACK_BITE_MOUTH_SECOND]
[APPLY_CURRENT_CREATURE_VARIATION]
[USE_TISSUE_TEMPLATE:HAIR:HAIR_TEMPLATE]
[BODY_DETAIL_PLAN:BODY_HAIR_TISSUE_LAYERS_VBASE:HAIR]
[RELSIZE:BY_CATEGORY:EYE:100]
[SELECT_TISSUE_LAYER:HEART:BY_CATEGORY:HEART]
[TL_MAJOR_ARTERIES]
[CASTE:WORKER]
[CASTE_NAME:worker giant bee:worker giant bees:worker giant bee]
[POP_RATIO:300]
[USE_MATERIAL_TEMPLATE:HONEY:MILK_TEMPLATE]
[STATE_COLOR:ALL:AMBER]
[STATE_NAME:SOLID:frozen giant bee honey]
[STATE_ADJ:SOLID:frozen giant bee honey]
[STATE_NAME:LIQUID:giant bee honey]
[STATE_ADJ:LIQUID:giant bee honey]
[STATE_NAME:GAS:boiling giant bee honey]
[STATE_ADJ:GAS:boiling giant bee honey]
[PREFIX:NONE]
[MILKABLE:LOCAL_CREATURE_MAT:HONEY:20000]
[PET][PETVALUE:125]
[CASTE:DRONE]
[CASTE_NAME:drone giant bee:drone giant bees:drone giant bee]
[MALE]
[POP_RATIO:75]
[RELSIZE:BY_CATEGORY:STINGER:5]
[PET][PETVALUE:100]
[CASTE:QUEEN]
[CASTE_NAME:queen giant bee:queen giant bees:queen giant bee]
[FEMALE]
[POP_RATIO:1]
[RELSIZE:BY_CATEGORY:BODY_UPPER:750]
[RELSIZE:BY_CATEGORY:HEAD:750]
[RELSIZE:BY_CATEGORY:BODY_LOWER:1500]
[BODY_SIZE:0:0:2000][BODY_SIZE:1:0:1000000][BODY_SIZE:5:0:5000000][BODY_SIZE:10:0:7500000][BODY_SIZE:20:0:11500000]
[BODY_SIZE:40:0:17500000][BODY_SIZE:80:0:22500000][BODY_SIZE:160:0:30500000][BODY_SIZE:800:0:62500000]
[SPEED:6000]
[PETVALUE:10000]
[SELECT_CASTE:WORKER]
[SELECT_ADDITIONAL_CASTE:DRONE]
[FLIER]
[MAXAGE:4:8]
[BODY_SIZE:0:0:2000][BODY_SIZE:2:0:42500]
[TRAINABLE]
[SELECT_CASTE:WORKER]
[SELECT_ADDITIONAL_CASTE:QUEEN]
[USE_MATERIAL_TEMPLATE:POISON:CREATURE_EXTRACT_TEMPLATE]
[STATE_NAME:ALL_SOLID:frozen gaint bee venom]
[STATE_ADJ:ALL_SOLID:frozen gaint bee venom]
[STATE_NAME:LIQUID:gaint bee venom]
[STATE_ADJ:LIQUID:gaint bee venom]
[STATE_NAME:GAS:boiling gaint bee venom]
[STATE_ADJ:GAS:boiling gaint bee venom]
[PREFIX:NONE]
[ENTERS_BLOOD]
[SYNDROME]
[SYN_NAME:giant bee sting]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[SYN_IMMUNE_CREATURE:BIGAPIS:ALL]
[SYN_INJECTED]
[CE_PAIN:SEV:50:PROB:100:RESISTABLE:SIZE_DILUTES:LOCALIZED:START:50:PEAK:1000:END:2000]
[CE_SWELLING:SEV:35:PROB:100:RESISTABLE:SIZE_DILUTES:LOCALIZED:START:100:PEAK:1000:END:2000]
[ATTACK:STING:BODYPART:BY_CATEGORY:STINGER]
[ATTACK_SKILL:STANCE_STRIKE]
[ATTACK_VERB:sting:stings]
[ATTACK_CONTACT_PERC:5]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:MAIN]
[SPECIALATTACK_INJECT_EXTRACT:LOCAL_CREATURE_MAT:POISON:LIQUID:100:100]
[SELECT_CASTE:ALL]
[SET_TL_GROUP:BY_CATEGORY:ALL:HAIR]
[TL_COLOR_MODIFIER:YELLOW:1:ORANGE:1:RED:5]
[TLCM_NOUN:hair:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:ALL:CHITIN]
[TL_COLOR_MODIFIER:BLACK:1:BROWN:1]
[TLCM_NOUN:chitin:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:EYE:EYE]
[TL_COLOR_MODIFIER:BLACK:1]
[TLCM_NOUN:eyes:PLURAL]
The process is thus: I create a new creature, and declare everything that I want to be the "default" - those tags will be applied to all castes. The reason we do this before declaring the castes is so the "default" tags won't overwrite any changes we make via the castes themselves.
I then declare each caste. Any tags I add to each caste will be applied in addition to the "default" tags that were declared earlier. If I declare a tag here which has already been declared in all castes, the value of that tag will be overwritten for the currently selected caste. Example:
[CREATURE:BIGAPIS]
[BODY_SIZE:0:0:2000][BODY_SIZE:2:0:42500]
[CASTE:QUEEN]
[BODY_SIZE:0:0:2000][BODY_SIZE:1:0:1000000][BODY_SIZE:5:0:5000000][BODY_SIZE:10:0:7500000][BODY_SIZE:20:0:11500000]
[BODY_SIZE:40:0:17500000][BODY_SIZE:80:0:22500000][BODY_SIZE:160:0:30500000][BODY_SIZE:800:0:62500000]
In this example, any castes that I don't add the BODY_SIZE tag to will have the "default" value(s). I've declared the BODY_SIZE tag for the QUEEN caste specifically, and the values thereof will overwrite the "default" values for that caste only. This is the basic gist of castes.
You can use the aformentioned SELECT_CASTE tag, and the SELECT_ADDITIONAL_CASTE tag, to select a specific caste or series of castes after you've declared them. The selected caste will stay selected until you select another caste (or ALL, for all castes).
A lot of tags are at the caste level, but some are at the creature level only (and thus will automatically apply to all castes, or maybe bug out if applied to a specific caste), while a few others have caste-specific variations for reasons unknown (say, CREATURE_TILE and CASTE_TILE are the same thing, but the latter affects the selected caste(s) specifically. Same thing for NAME and CASTE_NAME). You might want to experiment to figure out which tags are which - I know that the caste-specific variations of creature-level tags (such as NAME/CASTE_NAME mentioned above) are listed on the creature tokens page on the wiki, at least.