test-autocomplete

GitHub

用于验证智能自动补全引擎,通过读取测试场景和源码追踪输入分类、解析及排序逻辑,检查已知问题回归情况。

.claude/skills/test-autocomplete/SKILL.md walkthru-earth/geocoding-playground

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
More Options

Non-standard path

npx skills add https://github.com/walkthru-earth/geocoding-playground/tree/main/.claude/skills/test-autocomplete -g -y

Use without installing

npx skills use walkthru-earth/geocoding-playground@test-autocomplete

指定 Agent (Claude Code)

npx skills add walkthru-earth/geocoding-playground --skill test-autocomplete -a claude-code -g -y

安装 repo 全部 skill

npx skills add walkthru-earth/geocoding-playground --all -g -y

预览 repo 内 skill

npx skills add walkthru-earth/geocoding-playground --list

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

  1. Read the test scenarios from _study/AUTOCOMPLETE.md (Test Scenarios section).

  2. Read the relevant source files:

    • packages/core/src/autocomplete.ts - classifyInput(), suggest(), rankSuggestions()
    • packages/core/src/address-parser.ts - getParser(), POSTCODE_RE, NUMBER_FIRST
    • packages/core/src/search.ts - suggestionScore(), SearchCache
  3. 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() or buildPostcodeSQL() 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
  4. 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)
  5. 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_FIRST set in address-parser.ts must match pipeline SQL (addresses.sql line 143)
  • POSTCODE_RE patterns per country
  • suggestionScore tiers: 100=exact, 80=word, 60=prefix, 40=substring, 0-30=Jaccard

Version History

  • d16cf53 Current 2026-07-25 07:10

Same Skill Collection

.claude/skills/investigate-data/SKILL.md

Metadata

Files
0
Version
d16cf53
Hash
36a70e9d
Indexed
2026-07-25 07:10

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-26 23:06
浙ICP备14020137号-1 $Carte des visiteurs$