Most of the time, I'd advise against writing a skill by hand directly.
A common pattern is walking through how to do something step-by-step and then after it does what you want successfully, ask the agent "Create a new skill to capture this workflow."