Skip to content
mentoor

Topic 3 of 4 · 4 min read

Commands for recurring team workflows

Goal: Design a set of team commands for a recurring workflow and define the output each must produce.

Build team commands around the handoffs that repeat, and define the output each one must produce, so the next person or the next step can rely on it. A command is most useful when its result feeds something else: a reviewer, a release page, a teammate starting tomorrow.

Check yourself · 1 of 3

Which is the best way to choose commands for a team?

Choose one answer

Why it matters

Teams lose time at handoffs. One person's PR description has no test notes, another's release note is three paragraphs of internal jargon, a handoff message says "continued work on auth" and nothing else. A command that always produces the same sections removes that variation without a meeting about it.

How to design the set

  1. List what repeats weekly. Look at your last month of pull requests, tickets and chat. Four to six jobs usually cover most of it.
  2. Name by job, not by tool. /review, /fix-issue, /release-note, /handoff are clear. /ai-helper2 is not.
  3. Write the output first. For each command, decide the exact sections, then write the prompt that produces them.
  4. Pass the identifier as the argument. /fix-issue 482 takes an issue number; the command reads the issue, finds the code and proposes a fix.
  5. Set the stopping point. A fix-issue command can stop at a plan, a patch or a ready pull request. Choose deliberately, because each step adds risk.
  6. Keep them in git. Review a command change like any code change, and let people improve it.

A starter set

  • /review [focus]: read-only. Returns a verdict, findings with file and line, missing tests.
  • /fix-issue <number>: reads the issue, writes a failing test, then the smallest fix. Stops before committing.
  • /release-note <version>: reads merged pull requests since the last tag and writes user-facing lines in the team's format.
  • /handoff: summarises the branch state: done, not done, how to run it, open questions.

Before and after

Before: each engineer writes handoffs by hand. Monday's message reads "finished most of the export feature". The next person spends an hour working out what "most" means.

After: /handoff always returns four headings. The next person sees "Done: CSV export, tested. Not done: Excel export, no tests. Run: pnpm dev, open /reports. Open question: should empty reports download?"

What goes wrong

  • Commands that overreach. A fix-issue command that also merges and deploys turns a helper into a risk.
  • Output nobody reads. A release note command that writes five paragraphs per change gets ignored. Set a limit per item.
  • Drift. The code conventions change and the command still describes the old ones. Give each command an owner and revisit it.

Examples

A handoff command's output contract

The /handoff command ends with: "Return four headings: Done, Not done, How to run it, Open questions. Each at most five bullets. Quote file paths. Do not guess; write 'unknown' when unsure."

Where fix-issue should stop

A team starts /fix-issue at the plan stage (reads the issue, lists files to change, writes a failing test). After a month of reviewed results, they extend it to a patch. It never commits; a person does that.

Key points

  • Pick the handoffs that repeat, such as review, fix-issue, release notes and handoff summaries.
  • Define the exact output sections before writing the prompt, so the next step can rely on them.
  • Pass the issue number, version or branch as the argument instead of retyping context.
  • Decide where each command stops: plan, patch or pull request, and keep side effects out of the early ones.
  • Store commands in the repository and review changes to them like code.

Common mistakes

  • Making commands do the whole pipeline, including merge and deploy, from the first version.
  • Leaving the output format open, so each person gets a different result.
  • Writing a command per person's habit instead of per team workflow.
  • Never revisiting commands after the codebase conventions change.

Check yourself · 2 of 3

A /release-note command returns long free-form paragraphs. What is the best fix?

Choose one answer

Check yourself · 3 of 3

Why should a first version of /fix-issue stop before committing?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic