Agent Skills
› walkthru-earth/geocoding-playground
› test-autocomplete
test-autocomplete
GitHub用于验证智能自动补全引擎,通过读取测试场景和源码追踪输入分类、解析及排序逻辑,检查已知问题回归情况。
Trigger Scenarios
test autocomplete
verify search works
check the parser
test address parsing
run autocomplete tests
Install
npx skills add walkthru-earth/geocoding-playground --skill test-autocomplete -g -y
SKILL.md
Frontmatter
{
"name": "test-autocomplete",
"description": "Tests the smart autocomplete engine against known test scenarios from the study docs. Use this skill when the user asks to 'test autocomplete', 'verify search works', 'check the parser', 'test address parsing', 'run autocomplete tests', or wants to validate that a specific country's input classification and ranking works correctly. Also use after making changes to autocomplete.ts, address-parser.ts, or search.ts. Do NOT use for data investigation (use investigate-data instead) or UI testing.\n",
"allowed-tools": "Read, Grep, Glob"
}
Autocomplete Testing Skill
Validate the smart autocomplete engine against documented test scenarios.
Workflow
-
Read the test scenarios from
_study/AUTOCOMPLETE.md(Test Scenarios section). -
Read the relevant source files:
packages/core/src/autocomplete.ts- classifyInput(), suggest(), rankSuggestions()packages/core/src/address-parser.ts- getParser(), POSTCODE_RE, NUMBER_FIRSTpackages/core/src/search.ts- suggestionScore(), SearchCache
-
Trace the flow for the user's test case:
- What does
classifyInput(input, cc)return? (street/postcode/mixed/ready) - What parser does
getParser(cc)return? - What does
parseAddress(input)extract? (street, number, postcode, unit) - What SQL would
buildStreetSQL()orbuildPostcodeSQL()generate? - How would
rankSuggestions()order the results with the given city? - City search now uses
searchCities()JS array search (not DuckDB SQL). It does prefix match with contains fallback + similarity ranking preNormalize()can be used to pre-compute normalized names at prefetch time for faster search
- What does
-
Check for regressions against the 3 known issues:
- Issue 1: Duplicate cities (GROUP BY region, city dedup)
- Issue 2: City boost in ORDER BY (list_has_any tile overlap)
- Issue 3: Word match > prefix match (suggestionScore tiers)
-
Report whether the code correctly handles the test case, with the exact classification, SQL, and ranking that would be produced.
Key Constants to Check
NUMBER_FIRSTset in address-parser.ts must match pipeline SQL (addresses.sql line 143)POSTCODE_REpatterns per countrysuggestionScoretiers: 100=exact, 80=word, 60=prefix, 40=substring, 0-30=Jaccard
Version History
- d16cf53 Current 2026-07-25 07:10


