Greg Daniels, a veteran writer for Saturday Night Live, is the main writer of The Office. Mindy Kaling also wrote a lot of episodes of the show. In addition to that, Steve Carell wrote two episodes.