I often notice that people rarely remember properly the capabilities of themselves 5 years ago, much less 20. We often think we were better or worse than we actually were. Sometimes I think, oh boy am I rusty today, then I look at my old stuff and realize that I'm so far beyond that it's sad.
To me, it sounds like you are placing too high an expectation on your own cognitive ability, and not spending enough time sleeping. Any project that requires someone to do 4D chess in their heads to complete it is too complicated and no one will be able to maintain it. Start writing stuff down and making diagrams until the design is easier to understand. You are trying to build a city in your head without creating a plan.
Even a back of the napkin drawing can be enough really. Sometimes flaws become obvious when we do this. The value of older developers is they have the patience to do stuff like this, while all the young'uns go winging off on wild projects that they have to re-write in a month.
To me, it sounds like you are placing too high an expectation on your own cognitive ability, and not spending enough time sleeping. Any project that requires someone to do 4D chess in their heads to complete it is too complicated and no one will be able to maintain it. Start writing stuff down and making diagrams until the design is easier to understand. You are trying to build a city in your head without creating a plan.
Even a back of the napkin drawing can be enough really. Sometimes flaws become obvious when we do this. The value of older developers is they have the patience to do stuff like this, while all the young'uns go winging off on wild projects that they have to re-write in a month.