From fc4c5aaa7aa34786d53a0849ceaba2818f55887a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 4 Oct 2025 10:57:59 +0200 Subject: [PATCH] chore: refine github copilot instructions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/copilot-instructions.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 72a5623..1494adc 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,8 +9,11 @@ These instructions guide GitHub Copilot to generate changes consistent with this ## Core principles +- **Design patterns**: prefer established patterns (e.g., factory, singleton, strategy) for code organization and extensibility. +- **Algorithmic**: prefer algorithms or heuristics minimizing time and space complexity. +- **DRY**: avoid duplication of logic, data, and naming. Factor out commonalities. - **Single source of truth**: maintain a canonical defaults map for configuration tunables. Derive all user-facing options automatically. -- **Naming coherence**: prefer semantically accurate names across code, documentation, and outputs. Avoid synonyms that create ambiguity. +- **Naming coherence**: prefer semantically accurate names across code, documentation, directories, and outputs. Avoid synonyms that create ambiguity. - **English-only**: code, tests, logs, comments, and documentation must be in English. - **Small, verifiable changes**: prefer minimal diffs that keep public behavior stable unless explicitly requested. - **Tests-first mindset**: add or update minimal tests before refactoring or feature changes. @@ -25,7 +28,7 @@ These instructions guide GitHub Copilot to generate changes consistent with this ## Statistical conventions - **Hypothesis testing**: use a single test statistic (e.g., t-test) when possible. -- **Divergence metrics**: document direction explicitly (e.g., KL(A||B) vs KL(B||A)); normalize distributions; add epsilon to avoid numerical issues. +- **Divergence metrics**: document direction explicitly (e.g., KL(A||B) vs KL(B||A)); normalize distributions; add numerical stability measures. - **Distance vs divergence**: distinguish clearly; use consistent terminology. - **Effect sizes**: report alongside test statistics and p-values; use standard formulas; document directional interpretation. - **Distribution comparisons**: use multiple complementary metrics (parametric and non-parametric). @@ -51,7 +54,8 @@ These instructions guide GitHub Copilot to generate changes consistent with this ## Implementation guidance for Copilot - **Before coding**: - - Locate and analyze relevant existing code. + - Locate and analyze thoroughly relevant existing code. + - Identify code architecture and design patterns. - Identify canonical defaults and naming patterns. - **When adding a tunable**: - Add to defaults with safe value. -- 2.43.0