From bd46f87c9def467fa38dfeb3d11b0f17e5269743 Mon Sep 17 00:00:00 2001 From: Chris Sanchez Date: Mon, 7 Sep 2026 21:46:42 -0700 Subject: [PATCH] fix: exclude Slack's reserved mention keywords from people extraction Knowledge-mode's @mention person detector was matching @here, @channel, etc. as people whenever docs describe Slack mention syntax in prose (not just code spans) -- e.g. "Use not @here" or "Always @mention people". These are Slack's own reserved keywords and can never be a real handle in any project, same class of fix already applied to JSDOC_TAGS/CSS_AT_RULES above. --- src/detectors/knowledge.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/detectors/knowledge.ts b/src/detectors/knowledge.ts index bf640e0..07a10ca 100644 --- a/src/detectors/knowledge.ts +++ b/src/detectors/knowledge.ts @@ -225,6 +225,11 @@ const CSS_AT_RULES = new Set([ "stylistic", "styleset", "colorprofile", "property", ]); +// Slack's own reserved mention keywords — never a person, in any project's docs +const SLACK_RESERVED_MENTIONS = new Set([ + "here", "channel", "everyone", "all", "group", +]); + function extractPeople(content: string): string[] { const people = new Set(); @@ -242,6 +247,7 @@ function extractPeople(content: string): string[] { if (HANDLE_BLACKLIST.has(lower)) continue; if (JSDOC_TAGS.has(lower)) continue; // @param, @deprecated, etc. if (CSS_AT_RULES.has(lower)) continue; // @keyframes, @font-face, etc. + if (SLACK_RESERVED_MENTIONS.has(lower)) continue; // @here, @channel, etc. // Skip npm scope prefixes: @pixi/layout → next char after handle is "/" const fullMatch = m[0]; // e.g. "@pixi" const afterIdx = m.index! + fullMatch.length;