
In particular, figuring out how to group words in pinyin is hard! So I wanted to write a reference for myself too. The goal of all these rules is to make it easier to read. There are other systems to romanize Chinese, but as MDZS / the Untamed are from mainland China, pinyin is the official way. This was written with an eye to common use cases in fic with untranslatable words or concepts. Also, like, do whatever you want, this is if you want to do it ~properly~.
Names: I'll use Wei Wuxian as an example. That was the proper way. Camel case (Wei WuXian) and separating the words (Wei Wu Xian) are incorrect.
Names with prefixes: The prefix is separated and capitalized. (Exception: historical figures like Kongzi (Confucius) are written together.) Therefore, it is properly written A Yuan. I know it looks weird. Sorry.
Names with titles: The titles following the name are separated and uncapitalized. Wei qianbei, Lan xiansheng. I know it looks even weirder. Sorry.
Place names: The distinguishing and the general "what this is" part are separated and both are capitalized. Jinlin Tai is correct because "Jinlin" is the distinguishing name for it and "Tai" means tower.
Proper nouns: In general, capitalization follows the same "proper nouns are capitalized" concept as English. Since Chenqing would be a proper noun in English, we capitalize it.
Grouping: Modern Chinese is polysyllabic, despite popular misconception. Therefore, you space pinyin based on words with a single meaning. There can be ambiguity here! Older brother (gege), martial older sister (shijie) are written in a group and uncapitalized. Words with more than four syllables are separated if possible.
If the group results in ambiguity, an apostrophe is used to separate the syllables (second syllable starts with a, o, or e). E.g. pingan could be pin+gan or ping+an, so you'd write ping'an to disambiguate. This is also why the city of Xi'an is written with an apostrophe -- otherwise it could be the single syllable xian.
ETA: Prefixes for non-names: These get grouped with the word they modify. Therefore, ajie is technically correct.
Hopefully that was helpful! It gets a lot more complicated, but this covers most of the common cases I've seen in fic.
ETA2: An update to point out that this is the "official" PRC Pinyin rules, and people may/may not follow them IRL and of course there are different rules in other countries! And I personally wouldn't necessarily follow all the rules (A Yuan could be ambiguous in English for example), but it's nice to break rules on purpose instead of accidentally.