A “2-frame” is punishing your opponent with an attack as soon as they grab the ledge because characters don’t get invincibility frames until 2 frames after they grab the ledge. You may be thinking “Wow, I’m going to train this to my amiibo and they will be unstoppable!”, but it’s easier said than done. Attacks have unique startup and end lag, so unless you have the world’s fastest reaction time, you’ll need some practice.
Unfortunately, some amiibo simply aren’t hardcoded to 2-frame, and some don’t even have moves to 2-frame with. In addition, even when amiibo are trained at TAS levels of 2-frame perfection, it takes a long time to teach and they still won’t use it in more than half of their available opportunities. Despite this setback, it’s still a useful skill.
Ledge-hanging causes unusual and spammy behavior in amiibo that have been taught to 2-frame. For example, my Wolf amiibo sometimes spams Down-angled Forward Tilt at ledge even though it will never hit me.
How to Train 2-Framing
The weird thing about training amiibo to 2-frame is that you don’t even have to learn 2-framing for it to work properly.
If you just use the move you want them to 2-frame with near the ledge, it still helps them learn. Walking unlocks a few subroutines that give amiibo more access to their moves, and you may want to walk to get better results. Actually 2-framing the amiibo works better, but less seasoned players have a chance as well: use the move you want them to 2-frame with at the ledge, and only that move. Rinse and repeat for about 30 stocks and your amiibo should be 2-framing much more consistently.
You could wait at ledge for your invincibility frames to run out and wait for them to hit you with the desired 2-framing attack, but that may also make them start using different attacks at ledge if they hit you with anything different.
Why It Works
When a player uses a move, the amiibo uses that move more often and since amiibo have frame-perfect reaction time, you can teach them to 2-frame. You can abuse that and teach your amiibo things that not even players should be able to do and steal stocks very early at given chances if you teach it right.