From here come the rules most people know by name. Treat every one of them as advice from someone experienced, because that is what it is.
Single responsibility
Also called SRP
The rule that a module should have one reason to change. "Reason" is the word people miss: Robert Martin means one group of people whose requests cause the change, which isn't the same as doing one task.
Read as "do one thing", this rule can justify endless splitting. Read Martin's way, it tells an agent where a line belongs: between things that different people will ask to change.
Say it to your agent
“Invoice.ts changes when finance changes a tax rule and when support changes email wording. Split it so each of those requests touches one file: src/tax.ts and src/invoice-email.ts.”