| name | validate-domain-hints |
| description | Validate DomainHints extraction quality by detecting noise patterns and statistical anomalies |
| allowed-tools | Bash(*), Read, Write, Grep, Glob |
Domain Hints Quality Validation Command
Purpose
Validate that DomainHints extraction produces clean, domain-relevant data by detecting:
- Noise Patterns: Empty strings, parser artifacts (
[.), meaningless tokens (fn, Ok)
- Statistical Anomalies: Unusual NULL ratios, abnormal average counts
- Regressions: Unexpected changes in extraction results
This is a data quality assurance tool for the DomainHints extraction engine.
User Input
$ARGUMENTS
Interpretation:
| Input | Action |
|---|
| (empty) | Run full validation on all integration repos |
{repo-name} | Validate specific repo from repos.yaml |
{github-url} | Clone and validate external repo |
noise / patterns | Focus on noise pattern detection only |
stats / statistics | Focus on statistical analysis only |
compare {framework} | Compare framework stats vs baseline |
Known Noise Patterns
These patterns indicate extraction bugs or low-quality data:
Critical (Must Filter)
| Pattern | Type | Description | Severity |
|---|
"" | Empty | Empty string in Calls/Imports | ๐ด Error |
[. | Parser artifact | Spread array handling bug | ๐ด Error |
. | Single char | Dot only | ๐ด Error |
Warning (Should Filter)
| Pattern | Type | Description | Severity |
|---|
fn | Meaningless | Standalone fn() call | ๐ก Warning |
Ok | Rust stdlib | Enum constructor | ๐ก Warning |
Err | Rust stdlib | Enum constructor | ๐ก Warning |
Some | Rust stdlib | Enum constructor | ๐ก Warning |
None | Rust stdlib | Enum constructor | ๐ก Warning |
| 1-2 char tokens | Too short | Likely noise | ๐ก Warning |
Regex Patterns
"^[\\[\\]\\(\\)\\{\\}]+$"
"^(fn|if|for|let|var|const)$"
Statistical Baselines
Expected values by framework (from production data):
| Framework | NULL Ratio | Avg Imports | Avg Calls | Notes |
|---|
| cypress | ~21% | 2-5 | 5-15 | E2E tests have no imports |
| jest | ~5% | 3-10 | 10-20 | |
| vitest | ~7% | 3-10 | 10-20 | |
| go-testing | ~2% | 3-8 | 8-15 | |
| playwright | ~3% | 2-6 | 10-25 | |
| cargo-test | ~5% | 2-6 | 5-15 | |
Anomaly Thresholds:
- NULL ratio increase > 5%: ๐ด Error
- Avg imports/calls drop > 20%: ๐ก Warning
Workflow
Phase 1: Setup
1.1 Determine validation scope:
cat tests/integration/repos.yaml | grep "name:"
1.2 Select target(s):
- Empty input โ all repos in repos.yaml
- Specific repo โ filter to that repo
- External URL โ clone to /tmp
Phase 2: Run Parser with DomainHints
cd /workspaces/specvital-core
just scan /path/to/cached/repo --json 2>/dev/null | jq '.'
go test -tags integration ./tests/integration/... -v -run "TestScan/{repo-name}" 2>&1
Phase 3: Extract DomainHints Data
3.1 Collect all DomainHints from scan result:
Parse the JSON output to extract:
- All
Imports arrays
- All
Calls arrays
- Count of NULL vs non-NULL DomainHints
3.2 Calculate statistics:
Total files: N
Files with hints: M
NULL ratio: (N-M)/N * 100%
Avg imports per file: sum(imports) / M
Avg calls per file: sum(calls) / M
Phase 4: Noise Pattern Detection
4.1 Check all Imports for noise patterns:
for import in all_imports:
if import == "":
report_error("Empty import found")
if len(import) <= 2:
report_warning(f"Short import: {import}")
4.2 Check all Calls for noise patterns:
for call in all_calls:
if call == "":
report_error("Empty call found")
if call in ["[.", ".", "fn", "Ok", "Err", "Some", "None"]:
report_warning(f"Noise pattern: {call}")
if matches_regex(call, "^[\\[\\]\\(\\)\\{\\}]+$"):
report_error(f"Parser artifact: {call}")
Phase 5: Statistical Analysis
5.1 Compare against baselines:
Framework: {framework}
Expected NULL ratio: {baseline}%
Actual NULL ratio: {actual}%
Delta: {delta}%
Status: {PASS|WARN|FAIL}
5.2 Detect anomalies:
- NULL ratio significantly higher than baseline
- Average imports/calls significantly lower
- Unusual distribution patterns
Phase 6: Generate Report
Report Location: /workspaces/specvital-core/domain-hints-quality-report.md
Language: ๐ฐ๐ท Korean (ํ๊ตญ์ด) - MANDATORY
Report Template
# DomainHints ํ์ง ๊ฒ์ฆ ๋ณด๊ณ ์
**์ผ์**: {timestamp}
**๋์**: {repo-name or "์ ์ฒด ํตํฉ ํ
์คํธ ์ ์ฅ์"}
**ํ๋ ์์ํฌ**: {framework(s)}
---
## ๐ ์์ฝ
| ํญ๋ชฉ | ๊ฒฐ๊ณผ |
| ---------------- | ----------------------------- |
| ๊ฒ์ฌ ํ์ผ ์ | {n} |
| DomainHints ์กด์ฌ | {n} ({percentage}%) |
| ๋
ธ์ด์ฆ ํจํด ๋ฐ๊ฒฌ | {n}๊ฑด |
| ํต๊ณ ์ด์์น | {n}๊ฑด |
| **์ต์ข
์ํ** | {โ
PASS / โ ๏ธ WARN / โ FAIL} |
---
## ๐ ๋
ธ์ด์ฆ ํจํด ๊ฒ์ฌ
### ๋ฐ๊ฒฌ๋ ๋
ธ์ด์ฆ
| ํจํด | ํ์
| ๋ฐ๊ฒฌ ํ์ | ์ํ ํ์ผ |
| ----------- | ------ | --------- | ------------- |
| `{pattern}` | {type} | {count} | `{file_path}` |
### ํจํด๋ณ ์์ธ
#### `{pattern}` ({count}๊ฑด)
**์ถ์ฒ ๋ถ์**:
- {repo/framework}: {count}๊ฑด
**์์ธ ์ถ์ **:
{description of likely cause}
---
## ๐ ํต๊ณ ๋ถ์
### ํ๋ ์์ํฌ๋ณ ํํฉ
| ํ๋ ์์ํฌ | ํ์ผ ์ | NULL ๋น์จ | ๊ธฐ์ค์ | ์ํ |
| ----------- | ------- | --------- | ----------- | -------- |
| {framework} | {n} | {actual}% | {baseline}% | {status} |
### Imports ๋ถํฌ
| ์งํ | ๊ฐ |
| --------------- | --- |
| ์ด ๊ณ ์ imports | {n} |
| ํ์ผ๋น ํ๊ท | {n} |
| ์ต๋ | {n} |
**Top 10 Imports**:
| Import | ์ถํ ํ์ |
| ---------- | --------- |
| `{import}` | {count} |
### Calls ๋ถํฌ
| ์งํ | ๊ฐ |
| ------------- | --- |
| ์ด ๊ณ ์ calls | {n} |
| ํ์ผ๋น ํ๊ท | {n} |
| ์ต๋ | {n} |
**Top 10 Calls**:
| Call | ์ถํ ํ์ |
| -------- | --------- |
| `{call}` | {count} |
---
## ๐ ๋ฐ๊ฒฌ๋ ๋ฌธ์
### ๐ด Critical (์ฆ์ ์์ ํ์)
{IF critical issues exist}
1. **{issue}**: {description}
- ์ํฅ ๋ฒ์: {scope}
- ๊ถ์ฅ ์กฐ์น: {action}
{ELSE}
์์
{ENDIF}
### ๐ก Warning (๊ฒํ ํ์)
{IF warnings exist}
1. **{issue}**: {description}
- ์ํฅ ๋ฒ์: {scope}
- ๊ถ์ฅ ์กฐ์น: {action}
{ELSE}
์์
{ENDIF}
---
## ๐ ๊ฒฐ๋ก
{Based on findings}
**If PASS**:
> DomainHints ์ถ์ถ ํ์ง์ด ์ํธํฉ๋๋ค.
>
> - ๋
ธ์ด์ฆ ํจํด: ์์
> - ํต๊ณ ์ด์์น: ์์
**If WARN**:
> ๊ฒฝ๋ฏธํ ํ์ง ์ด์๊ฐ ๋ฐ๊ฒฌ๋์์ต๋๋ค.
>
> - {list of warnings}
> ๊ถ์ฅ: ๋ค์ ๋ฆด๋ฆฌ์ค์์ ๊ฐ์ ๊ฒํ
**If FAIL**:
> ์ฌ๊ฐํ ํ์ง ์ด์๊ฐ ๋ฐ๊ฒฌ๋์์ต๋๋ค.
>
> - {list of critical issues}
> **์ฆ์ ์์ ํ์**
---
## ๐ ๊ถ์ฅ ์กฐ์น
- [ ] {action item 1}
- [ ] {action item 2}
Validation Criteria
โ
PASS
- No critical noise patterns found
- NULL ratio within baseline ยฑ 5%
- No statistical anomalies
โ ๏ธ WARN
- Warning-level noise patterns found (fn, Ok, etc.)
- NULL ratio slightly above baseline (5-10%)
- Minor statistical deviations
โ FAIL
- Critical noise patterns found (empty string, [., etc.)
- NULL ratio significantly above baseline (>10%)
- Parser artifacts detected
Key Rules
โ
Must Do
- Write report in Korean (ํ๊ตญ์ด๋ก ๋ฆฌํฌํธ ์์ฑ) โ CRITICAL
- Check ALL Imports and Calls for noise patterns
- Compare statistics against framework baselines
- Provide actionable recommendations
- Include sample file paths for each issue
โ Must Not Do
- Write report in English โ Use Korean only
- Ignore any noise pattern (even 1 = potential bug)
- Skip statistical analysis
- Miss framework-specific baselines (e.g., Cypress 21% NULL is normal)
๐ฏ Principles
- Quality First: Even minor noise degrades AI domain classification
- Quantitative: Measure exact counts and percentages
- Comparative: Always compare against baselines
- Actionable: Every issue needs a clear fix recommendation
Quick Commands
/validate-domain-hints
/validate-domain-hints grafana
/validate-domain-hints https://github.com/vercel/next.js
/validate-domain-hints noise
/validate-domain-hints compare cypress
Execution
Now execute the DomainHints quality validation according to the guidelines above.