Can The battle master maneuver Precision Attack be used after his enemy casts the shield spell as a reaction to the battle master's initial die roll? This happened during a game. It didn't occur to me till after that it might not be possible.
You can add it after the roll, but not after someone else uses a reaction to respond to the result of the roll (i.e., because the roll indicated a hit and that result was declared):
You can use this maneuver before or after making the attack roll, but before any effects of the attack are applied.
The attack's success causing someone else to choose to expend a spell slot and their reaction is definitely an “effect of the attack” being applied.
It sounds though like this might have happened when another player simply saw your die roll, rather than after a final roll result was declared.
If your opponent is casting shield because they directly observed your die roll and didn't wait for you to declare the final result, that's a bit messy but it's entirely possible to untangle it, and fairly to everyone involved: say you weren't done, apply the superiority die, and then the opponent can choose to (or not) react with shield.
Of course, if they react with shield after you've declared that your final roll is a specific number and it hits, then you've committed yourself and that kind of “rolling back” the action declarations and resolutions would likely only happen if everyone was feeling generous.
Yes since shield already involves time travel
Shield is a profoundly strange spell that involves changing your AC after you have confirmed you were hit then going back and checking again. Since this is already traveling back I see no problem with the fighter activating Precision Attack since its text about "...before or after making the attack roll..." implies the fighter is supposed to be able to make a judgement call about activating it based on their opinion of the enemy AC.
The part about "...before any effects of the attack are applied." make this slightly suspect but I don't think it's a big problem. In my mind simple hitting with an attack isn't, "an effect of the attack", it's just... an attack. Shield works based on it but that doesn't make it an effect anymore than Bless working based on, "...a target makes an attack roll...", would make the roll itself an effect.
Ideally there would be some line in PHB clarifying what exactly counts as an effect of an attack but 5e really isn't that kind of game. In the end I think this is going to be DM discretion and I've outlined why I think it should work.
Update: Jeremy Crawford says yes you can
In this tweet Jeremy Crawford says, "Precision Attack can follow the shield spell, as long as the attack's damage and whatnot haven't been applied.". For those who take his twitter as RAW this should remove all doubt.