I see many experienced developers finding flaws in the existing architecture and also refactoring them to make it much better. I don't think I have yet gained the ability to identify loop holes in complex projects. However, I am able to fix issues if someone else calls them out pretty quickly.
How can I improve on this? What are some good resources to develop this skill?
One straightforward way to build that muscle of problem identification is to talk to people. You can literally ask your teammates, "What problems do you see?" or "What concerns do you have?" and senior+ people on the team will typically have a long list of things in their backlog. You can use that as a starting point to dig deeper into the issue and propose and implement the proper fix.
The other approach is to look for patterns that emerge after talking to many people. If you notice that many people on the team mention that writing tests take too long, perhaps you can experiment with something that can speed up that process. This is what I did with the internal tool I built at Meta.
Both of the above methods focus on explicit forms of collecting feedback through conversation. However, another method is implicit, to simply observe people's behavior. This can reveal information that people don't think to tell you (or don't want to tell you). Here are some good starting points:
These all give you data from which you can identify problems. Fundamental to all this is building strong relationships with the team. Learn about that in this masterclass.
Lead with curiosity. Honing the skill of identifying shortcomings in systems comes from experience. It's not necessarily about going and analyzing every system your team owns.
Instead, start by doing. Write code. Attend design reviews. Look for areas where you are struggling or have questions.
The mindset of a Senior Engineer isn't necessarily about finding flaws. It's about thinking systemically.
If you start with the problem first (team, business or customer) it's easier to identify the technical fix/solution. You have a Northstar to guide your decisions.