Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(quality): cover remaining context false positives

Narendran Raghavan30c04beb5f4f
diff --git a/src/skillevaluator/validators/quality_score.py b/src/skillevaluator/validators/quality_score.py
index 2e7efa04..f7285426 100644
--- a/src/skillevaluator/validators/quality_score.py
+++ b/src/skillevaluator/validators/quality_score.py
@@ -61,15 +61,21 @@ _NEGATED_MCP_RES = (
r"(?:\w+\s+){0,3}mcp\b",
re.IGNORECASE,
),
+ re.compile(
+ r"\b(?:(?:is|are|was|were)\s+not|(?:isn't|aren't|wasn't|weren't))\s+"
+ r"(?:(?:currently|actively)\s+){0,2}"
+ r"(?:using|requiring|depending\s+on|relying\s+on)\s+(?:an?\s+|the\s+)?mcp\b",
+ re.IGNORECASE,
+ ),
re.compile(r"\bwithout\s+(?:an?\s+)?mcp\b", re.IGNORECASE),
re.compile(r"\b(?:no|not\s+(?:an?\s+)?)mcp\b", re.IGNORECASE),
re.compile(
- r"\bmcp\b\s+(?:"
+ r"\bmcp\b(?:\s+(?:use|usage|support|integration|access|capability|server))?\s+(?:"
r"(?:(?:is|are|was|were)\s+not|(?:isn't|aren't|wasn't|weren't))|"
r"(?:(?:should|must|shall|can|could|would)\s+not|"
r"(?:shouldn't|mustn't|shan't|can't|couldn't|wouldn't))\s+be"
r")\s+"
- r"(?:used|required|needed|enabled|supported|involved)\b",
+ r"(?:used|required|needed|enabled|supported|involved|necessary|available)\b",
re.IGNORECASE,
),
re.compile(
@@ -98,12 +104,11 @@ _MARKDOWN_H2_RE = re.compile(r"^##[ \t]+(.+?)[ \t]*\r?$", re.MULTILINE)
_MCP_SUPPORT_HEADINGS = frozenset({"troubleshooting", "common issues", "faq"})
_MCP_SUPPORT_SUBJECT_RE = re.compile(r"\b(?:connections?|sessions?|api\s+keys?)\b", re.IGNORECASE)
_TIME_REFERENCE_RE = re.compile(
- r"\b(?:before|after|as of|until)\s+(?:the\s+year\s+)?(?:19\d{2}|2\d{3})\b",
+ r"\b(?:before|after|as of|until)\s+(?P<explicit_year>the\s+year\s+)?(?:19\d{2}|2\d{3})\b",
re.IGNORECASE,
)
_NON_TEMPORAL_COUNT_RE = re.compile(
- r"^\s+(?:iterations?|tokens?|bytes?|kilobytes?|megabytes?|gigabytes?|"
- r"milliseconds?|seconds?|minutes?|hours?|rows?|items?|attempts?|samples?|steps?|calls?)\b",
+ r"^\s+(?:[A-Za-z][A-Za-z0-9_-]*s|bytes?|people|children|data\s+points?)\b",
re.IGNORECASE,
)
_EXCLUSIVITY_RE = re.compile(
@@ -377,7 +382,7 @@ def _has_exclusive_replacement(content: str) -> bool:
def _has_time_reference(content: str) -> bool:
for match in _TIME_REFERENCE_RE.finditer(content):
- if not _NON_TEMPORAL_COUNT_RE.match(content[match.end() : match.end() + 32]):
+ if match.group("explicit_year") or not _NON_TEMPORAL_COUNT_RE.match(content[match.end() : match.end() + 32]):
return True
return False
diff --git a/tests/validators/test_quality_score.py b/tests/validators/test_quality_score.py
index 00dc34e8..cc9708ee 100644
--- a/tests/validators/test_quality_score.py
+++ b/tests/validators/test_quality_score.py
@@ -571,6 +571,20 @@ class TestQualityScoreKeywordBoundaries:
assert "MCP skill lacks connection/error guidance" not in messages
+ @pytest.mark.parametrize(
+ "statement",
+ [
+ "This skill is not using MCP.",
+ "This workflow isn't currently relying on MCP.",
+ "MCP usage is not supported.",
+ "MCP access isn't available.",
+ ],
+ )
+ def test_copular_negated_mcp_mention_does_not_classify_mcp_skill(self, tmp_path: Path, statement: str):
+ messages = _finding_messages(_write_issue_skill(tmp_path, extra_body=f"\n{statement}\n"))
+
+ assert "MCP skill lacks connection/error guidance" not in messages
+
@pytest.mark.parametrize(
"statement",
[
@@ -772,10 +786,17 @@ class TestQualityScoreKeywordBoundaries:
assert "MCP skill lacks connection/error guidance" in messages
- def test_iteration_count_is_not_time_sensitive_information(self, tmp_path: Path):
- messages = _finding_messages(
- _write_issue_skill(tmp_path, extra_body="\nUnrolling stops after 2048 iterations.\n")
- )
+ @pytest.mark.parametrize(
+ "statement",
+ [
+ "Unrolling stops after 2048 iterations.",
+ "Stop after 2048 files.",
+ "Retry after 2025 requests.",
+ "Fail after 2000 data points.",
+ ],
+ )
+ def test_four_digit_count_is_not_time_sensitive_information(self, tmp_path: Path, statement: str):
+ messages = _finding_messages(_write_issue_skill(tmp_path, extra_body=f"\n{statement}\n"))
assert "Time-sensitive information detected" not in messages
@@ -786,6 +807,13 @@ class TestQualityScoreKeywordBoundaries:
assert "Time-sensitive information detected" in messages
+ def test_explicit_year_reference_with_following_plural_remains_time_sensitive(self, tmp_path: Path):
+ messages = _finding_messages(
+ _write_issue_skill(tmp_path, extra_body="\nAfter the year 2025, releases use this compatibility path.\n")
+ )
+
+ assert "Time-sensitive information detected" in messages
+
def test_future_year_reference_remains_time_sensitive(self, tmp_path: Path):
messages = _finding_messages(
_write_issue_skill(tmp_path, extra_body="\nUse this compatibility path after 2101.\n")