Door at bottom of staircase

I have a finished basement, but the staircase down is wide open from the front foyer (townhouse). I was thinking of framing and installing an interior door (with small windows) at the bottom of the stairs so that light would still get in the basement, but I could be down there with my little one and not worry about her trying to climb the stairs. Any ideas on codes I should know about before I start? Any advice?

thought about just doing that, but also thought of the door as a sound barrier as well so that having someone in the basement working out to music won't disturb the person upstairs watching tv and vice versa.