Your example works if I delete the newline.
So this should work:
function add_my_rule() {
add_rewrite_tag("%args%", '([^/]*)', 'args=");
add_rewrite_rule("writer/([^/]*)','index.php?pagename=writer&args=$matches[1]','top');
}
add_action('init', 'add_my_rule');