From 26cb3de67e67ce5397b2d7900857f4030f24a484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Francoeur?= Date: Wed, 23 Sep 2026 23:31:11 -0400 Subject: [PATCH] rule on helper functions --- .claude/skills/code-quality/SKILL.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.claude/skills/code-quality/SKILL.md b/.claude/skills/code-quality/SKILL.md index dd4f05495..369ddc265 100644 --- a/.claude/skills/code-quality/SKILL.md +++ b/.claude/skills/code-quality/SKILL.md @@ -48,15 +48,7 @@ Use if-statements only when both branches are expected paths. ## Comments -**Do:** -- Document WHY, not what -- Document functions, structs, enums, variants -- Focus on why something is necessary - -**Don't:** -- Comments that repeat code -- References to AI conversations ("This test should trigger the bug") -- Temporal markers ("added", "existing code", "Phase 1") +- Don't add code comments, except for rust `SAFETY` comments. ## Avoid Over-Engineering @@ -79,3 +71,17 @@ When code involves index inserts, deletes, or conflict resolution, double-check - Delete unused code completely - No backwards-compat hacks (renamed `_vars`, re-exports, `// removed` comments) + +## Single-use helpers + +If a helper function has no meaning outside of a single use case, move it inside the function that uses it: + +```rust +fn do_something() { + + something_specific(); + + fn something_specific() { + } +} +``` \ No newline at end of file