Software Engineering
-
Generate OpenAI Tool Schemas in the Playground
OpenAI's GPT-4.1 guide notes that developers can use the "Generate Anything" feature in the Prompt Playground (or a meta-prompt) to create clean initial tool definitions with clear names and parameter descriptions. …
-
Markdown and XML Hybrid Prompts for OpenAI Models
OpenAI's prompt engineering guide recommends using Markdown headers (#) and XML tags (<context>) together inside the developer message to clearly mark where identity, instructions, examples, and context begin and end. …
-
Debug Claude Prompt Failures With Section Isolation
In production release workflows, PromptLayer recommends reviewing traces by prompt section, context source, tool result, and model response to isolate why an evaluation failed. …
-
Claude API Role Alternation Errors and Fixes
When interacting with Claude via the Messages API, messages must strictly alternate between user and assistant roles, always starting with a user message, or the API will return an error. Consolidate consecutive user art
-
Pass Claude Thinking Blocks Back in Tool Loops
Across newer Claude models like Claude Fable 5.1, passing thinking blocks back unchanged across multi-step tool turns is supported to preserve reasoning continuity. …
-
Claude Agent Handoff Across Context Windows
For multi-context workflows, Anthropic notes that starting a fresh context window can be more effective than compaction because Claude excels at discovering state from the local filesystem. Use the first context window t
-
Stop Claude Agents From Ending Tasks Too Early
In long-running coding or research agents, Claude may prematurely terminate tasks due to token budget concerns. Anthropic recommends informing Claude in the system prompt that its context window will be automatically com
-
Document Non-Obvious Conventions for AI Coding Agents
Use your config file to state critical, non-obvious conventions the AI might miss from looking at a single file: named vs. default exports, standard API response shapes, migration file locations, and environment variable
-
Map a Monorepo in AGENTS.md
Provide a high-level mapping of directories in AGENTS.md—especially for monorepos—separating apps, shared packages, and infrastructure. …
-
GitHub Copilot Prompt Files in .github/prompts
Keep single-use task instructions out of persistent config files and store reusable workflows in a custom prompts/ folder inside the dot directory so you can trigger them manually in chat via @prompts/my-custom-workflow.
-
AGENTS.override.md for Local Developer Overrides
Codex CLI walks from the project root down to the current working directory checking for AGENTS.override.md alongside AGENTS.md at every level for uncommitted, machine-specific, or personal developer overrides. Never com
-
Domain Routing in Llama 4 Maverick's MoE
Technical guides note that Llama 4 Maverick uses a sparse activation system storing 400B total parameters while activating roughly 17B parameters per token. Anchor the system prompt with precise domain terminology to ali
-
Llama 3 and 3.3 Prompt Headers: Keep the Newlines
Meta's official Llama 3 documentation highlights that newlines (0x0A) are part of the prompt format, and the prompt must always end with the last user message followed by the assistant header <|startheaderid|>assistant<|
-
Gemini 3 Persistence Prompt for Tool Error Recovery
Apply the Persistence Directive in Gemini 3's system instructions: instruct the model to operate as an autonomous agent that analyzes tool errors and tries alternative approaches without yielding control back to the user
-
Using the OpenAI Responses API With gpt-6-astra
OpenAI's prompt engineering documentation illustrates invoking newer frontier models like gpt-6-astra via the client.responses.create SDK method rather than legacy completion wrappers. …
-
Split Planning and Execution: o3 Planner, GPT-4o Executor
Production reasoning guides recommend decoupling planning from execution: use o1 or o3 to devise strategic plans (and invoke them as a "Re-Planner Node" only if an executor encounters an unrecoverable runtime exception o
-
GPT-4.1 Tool Schemas: API Field vs Prompt Text
OpenAI's internal experiments on GPT-4.1 showed a 2% increase in the SWE-bench Verified pass rate when passing tool descriptions through the native API tools field rather than manually injecting schemas into the system p
-
GPT-4.1 Thinking Out Loud Prompt for Coding Tasks
Unlike o1 or o3, GPT-4.1 is not a reasoning model and does not generate a built-in internal chain of thought prior to responding. OpenAI's cookbook reports that inducing explicit step-by-step planning in the prompt to ma
-
Claude Prefill Deprecated: Migrate to Structured Outputs
In earlier Claude 3 models, engineers prefilled the assistant turn with { to force JSON output. Per Anthropic's official migration guide, starting with Claude 4.6 and preview models, prefilling assistant turns is unsuppo
-
GitHub Copilot Instructions With applyTo Frontmatter
In addition to project-wide .github/copilot-instructions.md, GitHub Copilot supports scoped instruction files in .github/instructions/.instructions.md using YAML frontmatter applyTo globs to separate frontend vs. backend
-
Windsurf Rules Character Limits: 6,000 and 12,000
Windsurf's .windsurf/rules/ directory (supporting Always On, Manual via @, or Model Decision scopes) enforces strict character limits: a maximum of 6,000 characters per individual rule file and 12,000 characters for tota
-
Migrate .cursorrules to .cursor/rules MDC Files
While Cursor supports a legacy root .cursorrules file, the recommended format is the .cursor/rules/ directory containing .mdc (Markdown+) files generated via /rules. Configure each .mdc file with one of four activation s
-
Write Build and Test Commands by Hand, Not /init
Developer guides warn against relying on generic auto-generated configs from /init (and note that Claude Code appending memory at the bottom of CLAUDE.md is often undesirable—edit CLAUDE.md directly to solve concrete cod
-
CLAUDE.md Hierarchy: The 4-Tier Merge Order
Claude Code loads and merges CLAUDE.md files in four ordered locations: (1) /.claude/CLAUDE.md (global personal instructions), (2) ./CLAUDE.md (git-shared project root), (3) subdirectory CLAUDE.md files (scoped rules for
-
Coding Agent Instruction Limit: Stay Under 150-200
DeployHQ's guide notes that frontier LLMs reliably follow only around 150–200 instructions total, and configuration files over 500 lines risk instruction drift or truncation. Exclude code formatting rules (indentation, t