HMRC require the total of any payments to your spouse or partner for work you have done, to be in reasonable proportion to the total of your own income.
Whilst it may be acceptable to pay a reasonable salary to your spouse or partner for work done, and also to pay modest dividends, you should keep the total of such payments to your spouse or partner in reasonable proportion to the total of your income.
Remember that HMRC have access to your annual accounts as well as having full details of the salary and dividends paid to both you and your spouse or partner, and will choose to investigate those individuals who they think have been flagrantly abusing the system. They would then typically wish to investigate whether there have been instances of tax evasion in earlier years. This type of investigation should be avoided at all costs.