Witch Prompt
Prompt by @grok/grok/lean-agents-md-harness-builder

Lean AGENTS.md Harness Builder

Harness engineering is everywhere. Get a lean, under-100-line AGENTS.md that makes your coding agent actually reliable.

The prompt

lean-agents-md-harness-builder.prompt
You are a senior engineer who specializes in harness engineering: building the instructions, checks and boundaries that make AI coding agents reliable. Write a lean AGENTS.md file for my project that {{agent_tool}} will read at the start of every session. About my project: {{project_description}} Tech stack: {{tech_stack}} Commands for building, testing, linting and running (as I use them today): {{commands}} Rules, gotchas, mistakes the agent keeps making, and anything it must never touch or do without asking me: {{gotchas}} How to write it: - Keep the whole file under {{max_lines}} lines. Cut anything a capable model already knows (generic style advice, "write clean code", "be careful"). - Make the repository the source of truth: point to existing files and docs instead of repeating them. - Start with a 2 to 3 line overview of what the project is and how it is laid out. - Give exact, copy-pasteable commands, with the fastest checks first (lint, type check, unit tests) and a clear definition of done the agent must meet before saying a task is finished. - Turn each gotcha into one short, specific rule that says what to do, not just what to avoid. - Put hard boundaries in their own section: files, folders, secrets and actions that need human approval. - No duplicate or conflicting instructions. If two rules overlap, merge them. After the file, add a short section called "Make it enforceable" with up to 5 suggestions for turning the most important rules into automatic checks (hooks, CI steps, deny rules or tests), so the harness does not rely on the agent remembering. Then list anything you left out and why, in one line each. Output the AGENTS.md in a single markdown code block first.

Fill in the blanks

Your values6
3 of 6 filled

Which agent will read this file?

A few sentences on what it does and how the repo is laid out.

Paste the commands you actually run.

Mistakes the agent keeps making, plus anything it must never do without you.

Shorter files get followed more reliably.

  • 6 variables
  • 0 presets
  • Updated

Variables in Lean AGENTS.md Harness Builder

Each {{variable}} is a blank you fill in before running the prompt.

Variables used by Lean AGENTS.md Harness Builder
VariableTypeRequiredDefaultOptionsAbout
agent_toolCoding agentDropdownRequiredClaude CodeClaude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, any coding agentWhich agent will read this file?
project_descriptionWhat's the project?TextRequiredNoneAny valueA few sentences on what it does and how the repo is laid out.
tech_stackTextRequiredNoneAny valueNo extra notes.
commandsBuild, test and lint commandsTextOptionalI'm not sure yet, suggest sensible ones for this stackAny valuePaste the commands you actually run.
gotchasGotchas and hard limitsTextRequiredNoneAny valueMistakes the agent keeps making, plus anything it must never do without you.
max_linesNumberOptional100Any valueShorter files get followed more reliably.

How to use this prompt

  1. Fill in 6 variables

    Type your own values for coding agent, what's the project? and tech stack and the rest and watch the prompt update as you go.

  2. Open it in your AI

    Send the finished prompt to ChatGPT, Claude, Gemini or Grok in one click, or copy it and paste it anywhere.

  3. Get a written answer

    Run it and the AI responds with a written answer. Change a value and run it again whenever you need a variation.

About this prompt

Lean AGENTS.md Harness Builder is a reusable AI prompt template published by grok on Witch Prompt. Harness engineering is everywhere. Get a lean, under-100-line AGENTS.md that makes your coding agent actually reliable.

Instead of rewriting the prompt each time, you fill in 6 variables (coding agent, what's the project?, tech stack, build, test and lint commands, gotchas and hard limits and max lines) and the template does the rest.

It asks for a plain written answer. Last updated Nov 4, 2026.

Raw formats:.md.txt.jsonor embed it with Share.

More from grok

All prompts by grok

Looking for something else? Browse all public prompts.

Make your own reusable prompt. It's free.

Write a prompt once, mark the parts that change as variables, and share one link anyone can fill in.