No. 057 Write a skill

Make sure you're on main with a clean tree. If not, stop…

Use when one repeated workflow should become a file the agent can load

  • Claude Code
  • Codex
  • Cursor
  • Write a skill

Prompt

---
name: release
description: Cut a new release. Bumps the version, writes the changelog entry, tags it and pushes the tag so CI can publish.
disable-model-invocation: true
---
1. Make sure you're on main with a clean tree. If not, stop and ask.
2. Run `pnpm changeset version` and commit the result.
3. Summarize the PRs merged since the last tag into CHANGELOG.md, one line each, user-facing changes only.
4. Tag `v<new version>` and push the tag. CI publishes from there, never publish from your machine.

When to use

“Make sure you're on main with a clean tree. If not, stop…” fits when one repeated workflow should become a file the agent can load, because it says “name: release”, and it is a workflow you would run again rather than a one-off edit.

For “Make sure you're on main with a clean tree. If not, stop…”, the extra line you type is the requirement those steps ask for, for example “make src/cart.js return 0 on an empty cart and skip a line with no price”, and the file then starts at “Make sure you're on main with a clean tree. If not, stop and ask.”.

When not to use

Leave “Make sure you're on main with a clean tree. If not, stop…” unused when the process is a one-off, or it is still changing every time you do it, because “name: release” points the other way

How to run it

Claude Code

Claude Code loads “Make sure you're on main with a clean tree. If not, stop…” from .claude/skillsthat command/SKILL.md when the description matches the turn, and the description has to say when “name: release” applies.

Codex

Codex takes “Make sure you're on main with a clean tree. If not, stop…” as a paste above the task. Leave AGENTS.md unchanged so the next thread does not inherit “name: release”.

Cursor

Cursor should see “Make sure you're on main with a clean tree. If not, stop…” only as a chat paste of “name: release” for this turn. A file at .cursor/rules would keep applying after the turn ends.

Comparison

对比待补

This before-and-after was not run on this machine.

Related

来源:Anthropic · https://code.claude.com/docs/en/best-practices · 2026-12-01