When I came to the office one late autumn morning in 2005, I have been shocked to find out that - without any warning signs whatsoever - I hd been fired. That day I have learned the importance of communication. Their criticism was justified but the thing is, nobody bothered to tell me anything during my 11 months in the company. I received exactly 0 feedback about my behaviour or work. The company ended up at court with its client - which both explains why they were stressed and was also caused by bad communication. So communication - even, or especially under stress - is really important. It must be open, transparent, and broad.
The funny thing is that I still do the things they fired me for.
One criticism was that I wasn't coming on time to the office. I never slacked, I always worked my hours (if not more), but indeed I made my hours more flexible then they were. Nobody ever complained about my late arrivals so I concluded it was OK (lack of communication on my part). Having flexible working hours so that I don't need to stress about every minute and can adjust to the current circumstances (while still respecting the shared core hours as much as possible) is still very important to me.
The other main criticism was that I sometimes spent time producing utility libraries instead of working on the tasks assigned to me. I realise now I will never be the guy who can focus 100% on producing features (aside of short periods of crisis). It is crucial for me to have some 10 - 20% "play time" when I can work on things that are important for me such as tooling, utility libraries, code improvements. Thus, at my current company, I have created a Slack bot to ease the testing of our app, a metrics and monitoring solution for the app, spent a day performance testing our data server to find out its baseline behaviour and bottlenecks (discovering that we can downscale our production setup and save money), spent another day experimenting with different charting tools to find a good fit for my current and future needs, and contributed documentation improvements to Node.js and Clojure and fixes to TravisCI and various libraries. Admittedly, I should get better at communicating and aligning my interests with team's (and do a better job of getting them on board). And it is important to ensure that my contribution to the shared efforts does not suffer.