Awesome Goal Prompts — Coding Agent Rescue Contracts
When Claude Code, Codex, Cursor, or another coding agent starts making broad edits, paste a contract that says exactly what to inspect, what not to touch, how to verify, and when to stop.
This repo keeps 300+ runnable /goal contracts for engineering work. Start with the provenance-backed rescue prompts below; use seed patterns only when you need a raw shape to adapt.
Search the full catalog: https://majiayu000.github.io/awesome-goal-prompts/
A good goal is not a wish. It is a runnable contract: one goal, enough context to inspect, hard constraints, verifiable completion, and stop rules for uncertainty or risk. This repo turns that contract shape into a catalog you can search, inspect, adapt, and copy.
The public catalog starts with 159 source-backed examples drawn from official docs, public GitHub threads, tutorials, forum posts, and tool READMEs. The other 200 reusable seed patterns are kept in Seed Patterns so they do not dilute provenance-backed examples.

Try It In 60 Seconds
- Open the searchable catalog at https://majiayu000.github.io/awesome-goal-prompts/, or pick any contract straight from this README.
- Copy the full
/goalcontract text — the whole block, includingGOAL,CONTEXT,CONSTRAINTS,DONE WHEN,VERIFY,OUTPUT, andSTOP RULES. - Paste it to your coding agent (Claude Code, Codex, or Cursor) and let it run.
First example — Auth Tests And Lint Clean: use it when your auth tests and lint are both red and "fix auth" keeps inviting API churn.
Expected outcome: the agent keeps working until the auth tests pass and lint is clean, then stops only after pasting the passing command output as evidence. If it cannot reach that state, the stop rules tell it to report instead of editing further.
Contribute A Goal In 5 Minutes
- Find a thin category or missing rescue pattern in the catalog browser or catalog health report.
- Draft the contract with skills/make-goal/ and its catalog contribution reference.
- Add the entry through CONTRIBUTING.md: edit
data/source/entries.toml, keep public provenance for source-backed examples, regenerate, and run the validation commands.
Why This Exists
Most prompt lists stop at catchy instructions. This catalog is for the moment after an agent starts drifting: the task is real, the repo has constraints, and "try harder" is not enough. Each contract gives the agent a narrow job, required context, explicit boundaries, proof, and stop rules.
- Source-backed where possible: external examples keep a public URL, source type, evidence phrase, and generated evidence summary.
- Runnable by design: every prompt includes
GOAL,CONTEXT,CONSTRAINTS,DONE WHEN,VERIFY,OUTPUT, andSTOP RULES. - Search quality is tested: representative user queries must retrieve the expected contract in CI.
- Seed patterns are separated: reusable patterns stay available, but the main catalog leads with source-backed contracts.
Start With Ten Rescue Prompts
These are the front door. Each one is source-backed, tied to a common coding-agent failure mode, and links to the full copyable prompt.
| If the agent is failing at... | Copy this contract | Before | After |
|---|---|---|---|
| Auth tests and lint are both red | Auth Tests And Lint Clean | "Fix auth" invites API churn. | Auth behavior is preserved; tests and lint prove the fix. |
| CI has mixed test, lint, and typecheck failures | CI Pipeline Green | The agent chases one log line at a time. | Local and remote CI evidence define done. |
| A migration needs proof, not vibes | Dev Database Migration Proof | The agent edits schema without rollback evidence. | Dev DB application and schema comparison are required. |
| A PR may have security bugs | Security PR Review | Review comments stay generic. | File-level auth, injection, XSS, and secret risks are called out. |
| Checkout crashes from a stack trace | Checkout Crash Regression Fix | The agent patches the symptom. | Reproduction, root cause, fix, and regression test are all required. |
| Users see an empty billing state | Billing Empty State Root Cause | The agent rewrites pricing or webhooks. | The investigation is scoped to the empty-state cause. |
| A visual migration must not drift | Visual Migration With Playwright | "Looks close" becomes the acceptance test. | Playwright checks preserve screen output. |
| Agent runs need traceability | Agent Trace Observability | Tool calls and handoffs disappear in logs. | One representative run produces trace spans. |
npm audit is red |
NPM Audit Clean Remediation | The agent upgrades packages blindly. | Audit and tests must both pass without public API breakage. |
| A plan may still have holes | Review Plan Until No Gaps | The agent accepts the first plausible plan. | A fresh review must find no remaining gaps. |
The provenance-backed library stays below as the primary reference catalog.
Contents
- Try It In 60 Seconds
- Contribute A Goal In 5 Minutes
- Why This Exists
- Start With Ten Rescue Prompts
- Source-Backed Catalog
- How To Write A Good Goal
- Catalog Health
- Growth Playbook
- Templates
- Quality Bar
- Sources And Caveats
- Contributing
Source-Backed Catalog
The source-backed index lives in prompts/source-backed-goals.md, and the searchable UI defaults to source-backed examples in the GitHub Pages catalog.
Reusable patterns that are not backed by public sources live in Seed Patterns.
workflow
- Verifiable End-State Contract - Complete one goal only when a verifiable end state is met.
- Four Files Walkthrough - Create four note files across turns and verify each contains its number.
- Meta Goal Prompt Generator - Ask the agent to inspect the session, repo, history, and docs before writing the actual
/goalprompt. - AGENTS.md Goal Workflow - Use AGENTS.md rules together with
/goalso long-running work keeps repo-specific constraints. - Plan-Then-Goal Execution - Use plan mode to define the work, then start a new goal session to implement the plan completely.
- Measurable Goal Structure - Write goals with a clear target, proof requirement, and explicit limits.
- Interview-Driven Goal Prompt Generator - Use a meta prompt to interview the user with clarifying questions until 'done' can be expressed in specific, measurable, verifiable terms, then output a high-quality structured /goal prompt.
- Non-Interactive Goal Creation - Create and confirm an active goal during non-interactive Codex execution before continuing.
- Prep A Goal Workspace - Prepare a goal workspace with board, notes, receipts, and an exact
/goalcommand. - Long Goal With Constraints - Use a longer goal template with repo path, constraints, plan pointer, and execution order.
- User-Facing Coherence Closure - Finish a coherence pass so CLI help, docs, JSON/plain output, colors, prompts, flags, and next-action grammar stay aligned.
- Three Questions Goal Framework - Write higher quality goals by explicitly answering three core questions: what needs to be done, how success will be measured, and what is off-limits.
- Explicit Stop Rules for Goal Loops - Prevent infinite loops, cost overruns, and unsafe behavior in autonomous /goal executions by defining clear, explicit stop conditions and escalation rules.
- Dual-Model Evaluator Loop for Goals - Run long /goal sessions reliably and cost-effectively by using a strong worker model for execution paired with a cheap fast evaluator model (typically Haiku) that periodically judges progress against the goal criteria and decides whether to continue or stop.
- CLAUDE.md + Goal Workflow - Combine a persistent project-level CLAUDE.md (or AGENTS.md) file containing rules, standards, and context with /goal commands so long-running autonomous agent work stays aligned with repository-specific constraints and learned lessons.
- Goal Ledger for Long-Running Runs - Maintain a live, browser-viewable HTML progress ledger during extended /goal executions to provide visibility, persistent memory, decision logging, and self-reflection, reducing drift in long autonomous sessions.
- Artifact-Backed Phase Runner - Run a long-horizon task from one short /goal by storing the roadmap, state, protocol, and phase specs on disk, then auditing final deliverables against the original plan.
- Well-Scoped Agent Issue - Turn a backlog item into a coding-agent-ready issue with a clear problem statement, acceptance criteria, file directions, and test expectations.
- Research And Plan Before PR - Have an agent research the repository, create an implementation plan, and iterate on a branch before deciding whether to open a pull request.
- Goalcraft Six-Field Contract Spine - Write any /goal as a compact, evidence-first, thread-scoped completion contract with explicit outcome, verification surface, constraints, boundaries, iteration policy, and blocked stop conditions instead of vague effort descriptions.
- Strong Verifiable Goal Contract After Alignment Interview - After a structured alignment interview, produce a binding /goal contract with explicit success evidence, hard constraints, file boundaries, iteration strategy, and blocking/escape handling so a Ralph-loop or native /goal agent can run autonomously until evidence-based completion.
- Codex Acceptance-Criteria Stop - Put explicit acceptance and stopping criteria directly in the agent task so it stops when the condition is met instead of running open-ended.
- Oracle Definition Of Done - Define an oracle — the concrete checks (tests, edge cases, benchmarks, static checks) that decide success — before running the agent task.
- Goal Finish Line Built From Evidence - Write the /goal finish line as an outcome plus success criteria built from evidence, not vibes, so the agent knows when it is truly done.
migration
- Visual Migration With Playwright - Migrate a project while preserving screen output and checking it with Playwright.
- Feature Port With CI Green - Port a feature from another repo, include tests, and get CI green.
- Vue 2 To Vue 3 Visual And Unit Gate - Migrate listed Vue screens and stop only when visual and unit tests pass.
- Finish Migration Keep Tests Green - Use
/goalto complete a migration while keeping the relevant tests green. - Module API Migration - Migrate a module to a new API while keeping call sites compiling and tests passing.
- Moment To Day.js Migration - Replace Moment.js with Day.js while preserving date output across edge cases.
- React 19 Migration - Migrate a project to React 19 and continue until the build passes.
- Pydantic V1 To V2 Migration - Migrate a project from Pydantic v1 to v2 while preserving API behavior.
- Code Migration Checkpoints - Inventory legacy assumptions, map them to a target stack, and execute the migration through validated checkpoints.
prototype
- PLAN.md Milestone Prototype - Implement a PLAN.md-driven prototype with tests at each milestone and browser verification.
- Canvas Puzzle PLAN.md Prototype - Implement PLAN.md milestones for a canvas puzzle prototype and prove e2e passes.
- Rift Salvage Game Goal - Build a 2D combat game prototype with assets, combat, boss logic, and browser verification.
prompt-optimization
- Eval-Driven Prompt Optimization - Optimize prompts against an eval suite until the target score or pass rate is reached.
- Router Prompt Eval Score - Improve a router prompt against an eval directory until the result score reaches a target.
- RAG Chat Flywheel - Iterate on code, tests, and metrics to improve a document-chat RAG system.
- Difficult Task Eval Loop - Run a difficult task as an eval-driven improvement loop with one focused change, rerun scores, and direct artifact inspection each iteration.
- Fitness Function Dual-Score Improvement Loop - For goals without natural scalar metric (docs quality, code health, consistency), construct an explicit runnable fitness function plus dual-score (outcome + instrument quality guard) and drive an improvement loop with iterations.jsonl ledger until converge criteria.
testing
- Auth Tests And Lint Clean - Keep working until auth tests pass and the lint step is clean.
- Ruff Clean Source Tree - Fix every lint error in src and prove ruff passes.
- TypeScript ESLint Coverage Gate - Resolve TypeScript errors, pass tests, clear ESLint warnings, and keep coverage above a threshold.
- Fix Hermes CLI Tests - Fix failing Hermes CLI tests until the project test script passes.
- Add Authentication Tests - Create unit tests for an authentication module in a Jules session.
- Add UserService Unit Tests - Add unit tests for UserService and raise target coverage to the documented threshold.
- Parallel Test Coverage Recovery - Find low-coverage modules and open separate test-improvement PRs for each module.
- Single Vitest Case Fix - Fix a quiz application until one named Vitest case passes.
- Full Quiz Test Recovery - Repair the quiz app until the full Vitest suite exits cleanly.
- Auth Coverage Lift - Raise authentication code coverage from the documented baseline to the documented target within a scoped edit boundary.
- Auth Test Repair Boundary - Fix failing auth tests while preserving the documented file boundary.
- Coverage Autoresearch Loop - Iterate on tests until coverage reaches the documented target.
- Test And TypeScript Clean - Keep working until tests exit cleanly and TypeScript errors are gone.
- Go Race Cleanup - Eliminate data races detected by the Go race detector.
- Tests And Lint Completion - Run a
/goalloop until all tests pass and lint is clean. - Tests Pass And PR Ready - Keep Claude Code working until tests pass and the PR is ready for review.
- Flaky Auth Tests Goal - Use a Claude goal plugin example to find and fix flaky authentication tests.
- Improve Benchmark Coverage - Use
/goalto improve benchmark coverage and persist the command in history. - Batch Fix Bugs - Use a Claude Code goal to fix a numbered batch of bugs without looping on missing skills.
- GOAP Coverage Target Plan - Raise test coverage with an explicit test pyramid across unit, integration, and end-to-end coverage targets.
- Playwright Test Instructions - Create path-specific Playwright instructions that enforce stable locators, isolated tests, explicit assertions, cross-browser coverage, and CI behavior.
- Voice E2E Goal Contract - Run a long-horizon Codex goal against a TypeScript voice system using a reading list, working rules, concrete done-when criteria, and anti-pattern fences.
docs
- Weekly Changelog Coverage - Ensure CHANGELOG.md includes an entry for every PR merged this week.
- Contributor README Rewrite - Rewrite README installation, run, test, and architecture guidance for new contributors.
- Public API Docs Coverage - Add JSDoc and examples for public functions while keeping documentation links valid.
- Payment Retry Logic Diagram - Explain payment retry behavior as a browsable HTML page with a diagram for developer or support review.
- Implementation Notes Decision Ledger - Keep live implementation notes and the final run decisions document aligned around decisions, deviations, tradeoffs, and open questions.
- Repository Agent Instructions - Add repository-level agent instructions that document project structure, build/test/validate commands, coding standards, and documentation expectations.
- Documentation Matches Code - Update stale API or function documentation so parameters, behavior, examples, thrown errors, and links match the current implementation.
investigation
- Session Drift Report - Investigate session ID drift during mid-run compression and write a report.
- Billing Empty State Root Cause - Find why active subscriptions show an empty state without changing pricing or webhook code.
- Checkout Crash Regression Fix - Reproduce a checkout crash from a stack trace, identify the root cause, fix it, and add a regression test.
- Build Log Failure Diagnosis - Use a provided build log to explain why the build fails and identify the smallest verified fix path.
cli
- EXIF Rename CLI - Build a small CLI that renames photos by EXIF date and test it on a photos folder.
- Agent-Friendly CLI And Skill - Create a composable CLI and companion skill so future agent tasks can search, read, download, or draft against a recurring source safely.
refactor
- Auth Dependency Injection Refactor - Refactor auth code to dependency injection while preserving tests, coverage, and public API.
- Split Oversized File - Split an oversized source file into focused modules while preserving behavior.
- Centralize Cross-Cutting Logging - Centralize scattered logging, validation, security, or error-handling behavior without changing the core business behavior of the services.
- Structured-Prompt-Driven Refactor - Keep the spec or prompt and the code in sync during a refactor; when reality diverges, fix the prompt or spec first, then update the code.
- Refactor Until Stop Conditions Met - Let the agent iterate on a refactor continually until one of several predefined stop conditions is met, resolving blockers so each run works longer.
security-ops
- NPM Audit Clean Remediation - Patch npm audit vulnerabilities without breaking tests or public APIs.
- Dependency Audit Triage Boundaries - Triage dependency audit results with explicit boundaries: audits only find known advisories, so verify before trusting a package and never commit secrets.
performance
- Lighthouse And Core Web Vitals Gate - Improve Lighthouse and Core Web Vitals to explicit thresholds without regressions.
- Bundle Size Reduction - Iteratively reduce bundle size below the documented threshold.
- Benchmark Optimization - Optimize performance against a benchmark command until the goal is reached.
- Order Service Performance Review - Inspect service code for N+1 queries, missing indexes, inefficient loops, missing caches, and unnecessary fetching.
- Node Memory Leak Fix - Investigate a growing-memory Node.js process, isolate the leak source, fix it, and add monitoring for recurrence.
- GOAP API Latency Reduction - Reduce API latency by profiling current performance, optimizing database queries, adding caching, and improving code paths.
- Checkout P95 Latency Goal - Reduce checkout p95 latency below a numeric target while keeping the correctness suite green and logging each experiment.
greenfield-build
- Build Design Tool From Scratch - Run a long-horizon Codex task to build a design tool with milestone verification.
product
- Design Doc Acceptance Complete - Implement a design document until every acceptance criterion is satisfied.
- Feature Flag System - Implement boolean, percentage, and user-based feature flags with service logic, API middleware, a React hook, docs, and tests.
- OKR Development From Vague Priorities - Turn vague strategic priorities into measurable OKRs with objectives, key results, alignment, scoring, guardrails, and a communication summary.
backlog
- Clear Labeled Issue Backlog - Work through a labeled issue queue until no matching issues remain.
- Clear Trading App Backlog - Generate a roadmap backlog for a trading app and then clear it with goals.
- Ship Backlog Features - Implement the feature list from BACKLOG.md until CI is green.
data-analytics
- Analyze Product Usage Patterns - Analyze product usage patterns between tab view and agent panels.
- Copilot Usage Metrics Reconciliation - Reconcile Copilot dashboard, API, and export metrics before reporting agent adoption or pull-request impact trends.
frontend
- Fix Freezing Chart Tooltips - Debug and fix chart tooltips that freeze on hover.
- Improve Common Error Messages - Use a cloud coding agent to implement user-friendly messages for common errors.
- Visual Feedback With Test Guard - Add correct and wrong answer visual feedback while keeping tests green.
- Theme Toggle Persistence - Add a dark and light theme toggle that persists across refreshes.
- Button Console Error Fix - Use browser automation to click a button, inspect console errors, fix the issue, and prove it.
- Next.js Chat History Sidebar - Replace a Next.js sidebar with chat history, then test, fix build issues, and push.
research
- Read-Only Font Match - Research font matches in read-only mode and produce a report without purchasing or downloading assets.
- Public Benchmark Table - Collect distinct public benchmarks and build a date-sorted comparison table.
- Review Sentiment JSON Agent - Fetch reviews with browser automation, classify sentiment, and write structured JSON output.
- Clinical Research AI Safety Boundary - Review clinical research AI work with evidence-first boundaries so agents do not invent medical sources, expose private data, or turn research notes into patient-specific advice.
- Cited Architecture Research Report - Produce a saved, cited Markdown architecture report after inspecting the local codebase, relevant repositories, and web sources.
- Evidence-Backed Research Reproduction - Reproduce a paper or research result as far as local materials allow while separating confirmed findings, approximate reconstructions, blocked claims, and remaining uncertainty.
maintenance
- Repo Maintenance Audit - Find dead code, unused dependencies, and stale files, then produce a PR-ready justification list.
- Clean Worktree File Budget - Keep the worktree clean and enforce a source file size budget.
devops-ci
- CI Pipeline Green - Repair CI test, lint, typecheck, and security scan failures until checks pass.
- Bounded Autopilot CI Repair - Run a bounded autonomous CI repair after plan acceptance, with explicit continuation limits, permissions, validation commands, and blocker reporting.
goal-maintenance
- Goal Escape Hatch - Add an explicit incomplete state for impossible subtasks so a goal loop can stop safely.
- [Goal-Forge Done-When Loop](https://github.com/majiayu000/awesome-goal-prompts/blob/main/prompts/source-backed-goals.md#x-goal-forge-done-wh
No comments yet
Be the first to share your take.