When working on nftables syntax highlighters, I have 230 tokens, 2,500 state, and 50,000+ state transitions.
Some firm guidelines given to AI agents are:
1. Fully-deterministic LL(1) full syntax tree.
2. No use of Vim 'syntax keyword' statement
3. Use long group names in snake_case whose naming starts with 'nft_' prefix (avoids collision with other Vim namespaces)
4. For parts of the group names, use only nftables/src/parser_bison.y semantic action and token names as-is.
5. For each traversal down the syntax tree, append that non-terminal node name from parser_bison.y to its group names before using it.
With those 5 "simple" user-requested requirements, all AI agents drift away from at least each of the rules at seemingly random interval.
At the moment, it is dubiois to even trust the bit-length of each packet field.
Never mind their inability to construct a simple Vimscript.
I use AI agents mainly as documentation.
On the bright side, they are getting good at breaking down 'rule', 'chain_block stmt', and 'map_stmt_expr' (that '.' period we see at chaining header expressions together; just use the quoted words and paste in one of your nft rule statements.