By the end of this lesson you will turn a long prompt you keep retyping into a one-word command, /phone-check, that runs the same good check every time.
You need: Claude Code or OpenCode (Codex users: read along, your version comes in lesson 2), a project folder such as your Daily Routine app, and one prompt from your prompts.md · Time: 8 minutes
In Rules file and prompt library you started a
prompts.mdfile with prompts that worked. That was step one. Now look at how you use it:- Every time you finish a screen, you copy the "check it on a phone" prompt and paste it.
- Every Friday you paste the "write the weekly client report" prompt.
- Before every deploy you paste the "review everything before I go live" prompt.
Copy and paste works, but it has three problems. You forget to paste it on a busy day. You paste an old version you improved somewhere else. And each paste fills the chat with a long block of text.
Why?A good prompt is only useful if it runs every time it should. The tools can now store your prompt and start it with one short word, so the good version is always the one that runs.
Coding agents give you five ways to reuse good work. Think of them as a ladder. Each rung does more for you, and each rung is also a bit more to set up:
- Prompt: you paste the text yourself.
- Command: the prompt lives in a file; you type
/phone-checkto start it. - Skill: a folder with instructions and helper files. The agent can load it by itself when your request matches its description.
- Subagent: a separate helper with its own clean memory and only the tools you allow, for example a reviewer that can read but not edit.
- Hook: a command the tool runs automatically at a fixed moment, such as after every file edit. The agent cannot skip it.
Each rung saves more effort. Stop at the lowest rung that does the job. Match them Match each job with the lowest rung that does it well
Tap an item on the left, then its meaning on the right.
Why?Climb only as high as the job needs. A hook for something you do once a month is wasted effort, and a plain prompt for something that must never be forgotten is a risk.
A command is a Markdown file (a plain text file ending in
.md). The top part between the two---lines is called frontmatter: a few settings inkey: valueform. Everything below it is the prompt.Here is the full file.
$ARGUMENTSis a placeholder: the tool replaces it with whatever you type after the command name.markdown--- description: Check a page of my app the way a customer sees it on a phone --- Check $ARGUMENTS the way a customer would see it on a phone. 1. If you can open a browser, open the page at 375px wide and look at it. If you cannot, read the HTML and CSS and tell me what will break at 375px. 2. Look for: text that is cut off or smaller than 14px, buttons smaller than a fingertip (under 44px tall), anything that scrolls sideways, images wider than the screen, forms that are hard to fill. 3. Do not change any code yet. Reply with a numbered list: what is wrong, where, and a one-line fix for each. End with "Phone check: PASS" or "Phone check: FAIL".Where the file goes depends on your tool. The file name becomes the command name:
Tool Save the file as You type Claude Code .claude/commands/phone-check.mdin your project/phone-check index.htmlOpenCode .opencode/commands/phone-check.mdin your project/phone-check index.htmlCodex Codex's old "custom prompts" are deprecated; OpenAI says to use skills instead see lesson 2 Folders that start with a dot, like
.claude, are hidden by default on Mac and Linux. Your agent can create them for you:Prompt · copy it into your AI agentCreate a reusable command called phone-check in this project. Save it as [.claude/commands/phone-check.md]. Add frontmatter with a one-line description. The body should check the page I name in $ARGUMENTS the way a customer sees it on a 375px phone: cut-off or tiny text, buttons too small to tap, sideways scrolling, images that overflow, forms that are hard to fill. No code changes. Reply with a numbered list of problems with a one-line fix each, and end with "Phone check: PASS" or "Phone check: FAIL". Show me the file before you save it.
NoteClaude Code has merged commands into skills. A file in
.claude/commands/still works and is the quickest start. In lesson 2 you will meet the skill folder, which Claude Code's docs recommend for new work because it can hold extra files.Why?The file is now the single home of your best phone-check prompt. You improve it in one place, and every future check uses the better version.
Start your agent in the project folder and type
/. A list of commands opens; your new one is in it. Type the name and the page you want checked:Here
$ARGUMENTSbecameindex.html. Next time, type/phone-check settings.htmland the same check runs on another page.TipBoth tools also have numbered placeholders for single words, but they count differently (Claude Code starts at
$0, OpenCode at$1). Stick to$ARGUMENTSand your command file works in both.Why?A placeholder turns one command into a tool you can point at any page, client or file, without touching the file.
The first version of your command will miss things. Maybe it never checks the Hindi labels that wrap badly, or it forgets the dark theme. Don't fix that in the chat with "also check X"; that fix disappears when the chat ends. Fix the command file instead, so every future run includes it. This is the same "twice" rule you used for your rules file: when a command misses the same thing twice, add one line to it.
Prompt · copy it into your AI agentYour phone check missed [that the Hindi button labels wrap onto two lines]. Add one short line to .claude/commands/phone-check.md so future checks look for this. Show me the line you added.
Do it now Do it now
Why?The chat forgets; the file remembers. A command that gets one line better each week becomes the best checklist you own.
- Copy and paste breaks on busy days; a saved command runs the good version every time.
- The reuse ladder: Prompt · Command · Skill · Subagent · Hook. Use the lowest rung that does the job.
- A command is a Markdown file:
descriptionin the frontmatter, the prompt below,$ARGUMENTSfor the part that changes. - Claude Code:
.claude/commands/; OpenCode:.opencode/commands/; Codex: use skills. - Next: Your first skill: the weekly client report, where the agent picks the right instructions by itself.
Create a free account to save your progress and open every lesson. Create free account