Guides · Prompts

One prompt that works everywhere

A short template built from what the official prompting guides from xAI, OpenAI, Anthropic and Google have in common. Fill in the brackets and paste it into Grok, Codex, Claude or Gemini.

Updated Official docs checked Nov 15, 2026. Every tip links to its source.

What the official guides agree on

Four vendors, eight practices. The first five show up almost everywhere, so they make up the template.

PracticeGrok (xAI)OpenAI CodexClaudeGemini
State one clear goal✓ Yes✓ Yes✓ Yes✓ Yes
Give only the context that matters✓ Yes✓ Yes✓ Yes✓ Yes
Say what not to do✓ Yes✓ Yes✓ Yes✓ Yes
Say what “done” looks likeNot stated✓ Yes✓ YesPartly
Write standing rules once, and keep them short✓ Yes✓ Yes✓ Yes✓ Yes
Mark sections with headings or tags✓ YesNot stated✓ Yes✓ Yes
Show examplesNot statedNot stated✓ 3–5✓ Always
Ask before risky actionsNot statedPartly✓ Yes✓ Yes

“Not stated” means we did not find it in the official pages listed under Sources. It does not mean the advice is wrong for that tool.

Sources xAI: Best practices Oct 20, 2026xAI: Prompt engineering for Grok Code Fast 1 (archived copy) removed from docs.x.ai after Oct 13, 2026OpenAI Codex: Best practices undatedAnthropic: Prompting best practices undatedClaude Code: Best practices undatedClaude Code: How Claude remembers your project Nov 12, 2026Google: Prompt design strategies (Gemini API) undatedGemini CLI: GEMINI.md files Jun 18, 2026

The template, in three levels

Start with Level 1. Move up when you notice you keep typing the same rules.

Level 1

Basic: one task, one prompt

Works in any chat box: Grok, ChatGPT and Codex, Claude, Gemini.

Prompt template
GOAL: [one sentence: what should be true when you're done]
CONTEXT: [only the files, links, errors or data that matter. Name them exactly.]
CONSTRAINTS: [must and must not: stack, style, budget, what not to touch]
DONE WHEN: [a check that passes or fails: a test passes, a page loads, a list has 10 items with links]
OUTPUT: [format and length, e.g. "a bullet list, max 10 lines, each with a link"]

For anything bigger than one file, add two lines:

Add-on for bigger tasks
BEFORE YOU START: read the relevant files and tell me your plan in 3-5 bullets. Wait for my OK.
WHEN YOU FINISH: list every file you changed and the exact command you ran to check it.

Why each line is there

Filled in

Example: fix a bug
GOAL: Fix the bug where [what happens] when [steps to reproduce]. Expected: [what should happen].
CONTEXT: Error message: [paste the exact error or log]. It probably lives in [file or area, if known].
CONSTRAINTS: Smallest possible fix. Don't refactor or rename anything else.
DONE WHEN: You can explain the root cause in one paragraph, and [repro steps] now give the expected result. If tests exist, they still pass.
Example: research with sources
GOAL: Compare the monthly price and usage limits of [tool A] and [tool B] for one developer.
CONTEXT: Use only the vendors' own pricing and help pages. I code about [hours] a week.
CONSTRAINTS: No reviews or blog posts. If a number isn't on an official page, write "Not confirmed".
DONE WHEN: Every number has a link and the date you checked it.
OUTPUT: A table with one row per plan, then 3 bullets on which plan fits me.
Level 2

Intermediate: standing instructions

Write the rules once in a file the agent reads at the start of every session, and stop repeating them.

ToolWhere the rules goSource
OpenAI CodexAGENTS.md. A global one in ~/.codex/, then one per folder from the repo root down. Closer files win. Combined size is capped at 32 KiB by default.OpenAI Codex: Custom instructions with AGENTS.md undated
Claude CodeCLAUDE.md. By default Claude reads AGENTS.md only when there is no CLAUDE.md. To share one file, put the line @AGENTS.md in your CLAUDE.md.Claude Code: How Claude remembers your project Nov 12, 2026
Gemini CLIGEMINI.md. To read AGENTS.md too, list it in the context.fileName setting.Gemini CLI: GEMINI.md files Jun 18, 2026
Grok BuildAGENTS.md, AGENT.md or CLAUDE.md, plus .grok/rules/*.md.Grok Build: AGENTS.md and project rules Jul 4, 2026
Grok BotNo file. Send the rules in your first message and ask the Bot to remember them.Grok Bot: Bots Nov 13, 2026
AGENTS.md template
# Project instructions for agents

## What this project is
[2-3 sentences: what it does, who uses it, why the work matters]

## Facts you can't find by reading the code
- [deploy steps, past decisions, env variable names (never values), key paths and ports]

## Commands
- Install: `[command]`
- Run locally: `[command]`
- Test: `[command]`
- Lint: `[command]`
- Build: `[command]`
Run test and lint before you say a task is done.

## Conventions
- [rules you can check, e.g. "Use 2-space indentation", not "format nicely"]
- Package manager: [npm / pnpm / uv / cargo]. Use only this one.

## Never, or ask first
- Never commit secrets or edit .env files.
- Ask before anything that deletes files, installs packages, pushes code, costs money or touches production.

## Definition of done
- [what must be true, and how to check it]

## Output style
- [length, format, language]

Rules for the file itself

Filled in

Example: add a feature with tests
GOAL: Add [feature] so that [user-visible behavior].
CONTEXT: Similar existing code: [file]. Follow its patterns. Tests live in [folder] and run with [command].
CONSTRAINTS: No new libraries without asking. Keep the public API unchanged unless I say so.
STEPS: 1) Write a failing test that describes the feature. 2) Implement until it passes. 3) Run the full test suite.
DONE WHEN: New tests pass, the old tests still pass, and you've shown me the test output.
Level 3

Advanced: skills and scheduled runs

Save a method you trust as a skill, then run it on a schedule with clear rules for empty results and approvals.

SKILL.md template
---
name: weekly-pricing-check
description: Checks AI coding plan prices on vendor pages and lists what changed. Use when asked to refresh pricing data or on the weekly pricing routine.
---
## When to use
## Inputs and access needed
## Procedure
1. ...
## Validation
## What to return
## Requires approval
## Pitfalls
Scheduled run template
Every [weekday] at [time] [time zone], run the [skill-name] skill on [source].
Report to [where]. If nothing changed, reply exactly "Nothing to report".
If the source is unavailable or stale, report the failure. Do not use old data.
Do not [send / publish / buy / delete]. Draft it and ask me first.

Filled in

Example: plan a refactor, no code yet
GOAL: Plan a refactor of [module] to [reason: split a 2,000-line file, remove duplication, swap a library].
DO NOT EDIT CODE in this step.
DELIVER: 1) How the module works today, with callers and dependencies. 2) The target structure. 3) An ordered list of small steps where each step leaves the app working and tested. 4) Risks: what could break and how we'd notice. 5) What you're unsure about.
After I approve the plan, we'll do one step per session and run the tests after each step.

Tool by tool

What each vendor adds on top of the template, with the page it comes from.

  • State the task, the constraints and the output format directly. xAI’s reason: “Grok reasoning models reason before they answer.”

    Source xAI: Best practices Oct 20, 2026

  • If you call the API, put static content first: the system prompt, examples and reference documents. A stable start of the prompt can be cached.

    Source xAI: Best practices Oct 20, 2026

  • xAI’s old Grok Code Fast 1 prompting guide was taken down after Oct 13, 2026. Its advice still matches the rest of this page: pick the specific code to share, name file paths, avoid vague requests and iterate.

    Source xAI: Prompt engineering for Grok Code Fast 1 (archived copy) removed from docs.x.ai after Oct 13, 2026

  • In Grok Bot, the first message sets up the Bot: give it “its job, sources, and approval boundaries,” ask it to remember them, then send a real first task “with a clear finish line.”

    Source Grok Bot: Bots Nov 13, 2026

Standing rules Grok Build reads AGENTS.md and .grok/rules/. Grok Bot keeps rules in memory, not in a file.

OpenAI Codex

Codex plans
  • Include four things: Goal, Context, Constraints and Done when. OpenAI calls this “a good default.”

    Source OpenAI Codex: Best practices undated

  • A good AGENTS.md covers how to run the project, the build, test and lint commands, conventions, do-not rules and “what done means and how to verify work.”

    Source OpenAI Codex: Best practices undated

  • If you build your own agent on the API, OpenAI’s prompting guide says to let the model work through the task end to end and not to ask for status updates mid-run.

    Source OpenAI Cookbook: Codex prompting guide Feb 25, 2026

  • When a turn goes wrong, you can ask the model how to improve its own instructions, then test the change.

    Source OpenAI Cookbook: Codex prompting guide Feb 25, 2026

Standing rules AGENTS.md, global and per folder, 32 KiB combined by default.

Claude and Claude Code

Claude plansClaude Code plans

Standing rules CLAUDE.md. AGENTS.md only without a CLAUDE.md, or through an @AGENTS.md import.

Gemini and Gemini CLI

Google AI plansGemini CLI

Standing rules GEMINI.md, or AGENTS.md through the context.fileName setting.

Four habits that save the most time

  • Paste the real error text. “It doesn’t work” gives the agent nothing to go on.
  • One task per session. Start a new session when the topic changes. Long chats drift.
  • Plan first on anything bigger than one file. A wrong plan is cheaper to fix than 20 edited files.
  • Ask for proof. “Show me the test output” beats “is it done?”

Habits from our own coding sessions, not from a vendor guide.

What people report works

Posts from the last two months where people describe what worked for them. Official accounts are marked “Announced on X”.

Kirill@kirillk_web3
Reported on X
Summarizing a talk by Boris Cherny, who created Claude Code, Kirill says newer Claude models need less prompting and long instruction templates add noise. He says Cherny suggests deleting your CLAUDE.md every few months to see what the model does without it.
Asteri@Asteri_eth
Reported on X
Asteri says not to set everything up on day one. Add a rule to CLAUDE.md when Claude gets the same convention wrong twice, and keep the file short because it loads in every session.
Doug Colkitt@0xdoug
Reported on X
Doug Colkitt shares a full reusable prompt for Claude or Codex that starts: "Contribute one useful, independently reviewable result to [repo]. Start from the current main branch. Read AGENTS.md…" The goal, the starting point and the rules file all come first.
Claude Code / Codex79 likes · 36 bookmarksView on X
Neelesh@gadi_neelesh
Reported on X
Neelesh says you can run codex debug prompt-input "Fix the login bug" to print what the model actually receives, and check whether your AGENTS.md was included. We have not tested this command.
sitinDev@sitin_dev
Reported on X
sitinDev says installing a skill does not mean the agent will use it. He cites a project where a skill fired from its description alone about 60–67% of the time, while the same rule written in CLAUDE.md fired every time. Those rates are his citation, not our test.
OpenAI Developers@OpenAIDevs
Announced on X
OpenAI Developers announced optional 12-hour prompt caching in the API, so agents that reuse the same instructions and tools pay the lower cached rate even when requests are hours apart. That matches xAI’s advice to keep static content first.
Google Gemini@GeminiApp
Announced on X
Google Gemini said Gems will move into Skills, and skills replace Gems for saved instructions in the Gemini app, starting in November for personal accounts.

Posts found by our X research for Sep 16 to Nov 15, 2026. Likes and bookmarks as of Nov 15, 2026. Results are what the authors say; we did not reproduce them. Promotional and engagement-bait posts were left out.

The weekly diff

What changed in AI coding plans: prices, limits, resets. There's no email list: follow on X or subscribe to an RSS feed.

Follow @QuietlyByG on X What’s New RSSLimit & reset changes

No email form, so we don't collect any email addresses.