From 6855d94828a035e224cb4474e452894d672081d8 Mon Sep 17 00:00:00 2001 From: Christian Gunderman Date: Wed, 4 Feb 2026 12:12:03 -0800 Subject: [PATCH] Prompting. --- packages/core/src/prompts/snippets.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts index 38ba82624e..8d3a17a6ef 100644 --- a/packages/core/src/prompts/snippets.ts +++ b/packages/core/src/prompts/snippets.ts @@ -135,6 +135,12 @@ export function renderCoreMandates(options?: CoreMandatesOptions): string { return ` # Core Mandates +- **Context Efficiency:** + - Avoid wasting context window by scoping your searches to just the information needed to definitively answer the question. You can always search iteratively or search again with a larger scope if needed. + - You can use max_matches_per_file when searching broadly to limit the impact of each matching file. + - If you know you need a small number of results to complete your task, you can use total_max_matches to limit the response size. + - If you know that you need to find a match and need some surrounding context, you can request it with context, before, or after parameters. Take care to limit the total response size via one of the other parameters. + - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first. - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like 'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it. - **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.