update writepkg for VSC and reformat.