.codex/skills/gwt-search/SKILL.md
Mandatory preflight before gwt-discussion, gwt-register-issue, and gwt-fix-issue. Use proactively before creating any SPEC or Issue owner or before reusing an existing one. Searches SPEC Issues, GitHub Issues, and project files via ChromaDB. Triggers: 'search', 'find related', 'check duplicates'.
npx skillsauth add akiojin/gwt gwt-searchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
gwt maintains ChromaDB vector search indexes for three scopes (Phase 8 layout):
| Scope | Content | Lifecycle |
|-------|---------|-----------|
| SPECs | GitHub Issue cache (~/.gwt/cache/issues/) | Populated by gwt issue spec pull or TUI startup sync |
| Issues | GitHub Issues (all states) | TUI startup async refresh (TTL 15 min) + runner auto-build on first search |
| Files | Project implementation files (excludes skill assets, SPEC trees, snapshots) | Watcher (TUI) + runner auto-build on first search |
All vector data is stored under ~/.gwt/index/<repo-hash>/.... Issues are repo-scoped and shared across worktrees; SPECs and Files are worktree-scoped under worktrees/<worktree-hash>/. The legacy $WORKTREE/.gwt/index/ location is no longer used and is deleted automatically by the TUI on startup.
When invoked outside the gwt TUI, the runner falls back to a synchronous mtime+size diff per call: results are always correct, just slower than the TUI watcher path.
gwt-search "query" # search all three scopes
gwt-search --specs "query" # SPECs only
gwt-search --issues "query" # GitHub Issues only
gwt-search --files "query" # implementation files only
| Flag | Scope | Action flag |
|------|-------|------------|
| (none) | All three | Run all three searches |
| --specs | SPECs only | search-specs |
| --issues | Issues only | search-issues |
| --files | Files only | search-files |
When the gwt TUI launches an agent pane, the following env vars are exported automatically:
GWT_PROJECT_ROOT — absolute path of the active worktreeGWT_REPO_HASH — SHA256[:16] of the normalized origin URLGWT_WORKTREE_HASH — SHA256[:16] of the canonicalized worktree absolute pathIf you launch outside the TUI, recompute them:
GWT_PROJECT_ROOT="$(pwd)"
GWT_REPO_HASH=$(git remote get-url origin 2>/dev/null \
| sed -E 's#^git@([^:]+):#https://\1/#; s#\.git$##; s#^https?://##' \
| tr 'A-Z' 'a-z' | tr -d '\n' | sha256sum | cut -c1-16)
GWT_WORKTREE_HASH=$(printf '%s' "$(cd "$GWT_PROJECT_ROOT" && pwd -P)" | sha256sum | cut -c1-16)
PYTHON=~/.gwt/runtime/chroma-venv/bin/python3
RUNNER=~/.gwt/runtime/chroma_index_runner.py
On Windows, use ~/.gwt/runtime/chroma-venv/Scripts/python.exe.
$PYTHON $RUNNER \
--action search-specs \
--repo-hash "$GWT_REPO_HASH" \
--worktree-hash "$GWT_WORKTREE_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--query "your search query" \
--n-results 10
$PYTHON $RUNNER \
--action search-issues \
--repo-hash "$GWT_REPO_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--query "your search query" \
--n-results 10
$PYTHON $RUNNER \
--action search-files \
--repo-hash "$GWT_REPO_HASH" \
--worktree-hash "$GWT_WORKTREE_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--query "your search query" \
--n-results 10
search-files is implementation-focused: it excludes embedded skill assets (.claude/, .codex/), local/archived SPEC trees, local task logs, and snapshot files so code search is not dominated by docs noise.
$PYTHON $RUNNER \
--action search-files-docs \
--repo-hash "$GWT_REPO_HASH" \
--worktree-hash "$GWT_WORKTREE_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--query "your search query" \
--n-results 10
Run all four search commands above and merge results by scope.
When the target index does not exist, the runner builds it inline (full mode) and then performs the search. Progress is emitted as NDJSON on stderr:
{"phase":"indexing","scope":"files","done":0,"total":0}
{"phase":"complete","scope":"files","total":850}
Pass --no-auto-build to disable this behavior; in that case the runner returns:
{"ok": false, "error_code": "INDEX_MISSING", "error": "index not found at ..."}
These are run automatically by the TUI watcher (or by the runner's auto-build fallback). Run manually only when forcing a full rebuild.
$PYTHON $RUNNER \
--action index-specs \
--repo-hash "$GWT_REPO_HASH" \
--worktree-hash "$GWT_WORKTREE_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--mode full
$PYTHON $RUNNER \
--action index-issues \
--repo-hash "$GWT_REPO_HASH" \
--project-root "$GWT_PROJECT_ROOT"
Pass --respect-ttl to skip if the previous refresh is younger than 15 minutes.
$PYTHON $RUNNER \
--action index-files \
--repo-hash "$GWT_REPO_HASH" \
--worktree-hash "$GWT_WORKTREE_HASH" \
--project-root "$GWT_PROJECT_ROOT" \
--mode full \
--scope files
For the docs collection, repeat with --scope files-docs.
{"ok": true, "specResults": [
{"spec_id": "10", "title": "Project workspace", "status": "in-progress", "phase": "Implementation", "dir_name": "SPEC-10", "distance": 0.08}
]}
{"ok": true, "issueResults": [
{"number": 42, "title": "Add vector search for Issues", "url": "https://github.com/...", "state": "open", "labels": ["enhancement"], "distance": 0.08}
]}
{"ok": true, "results": [
{"path": "src/git/issue.rs", "description": "GitHub Issue commands", "distance": 0.12}
]}
intfloat/multilingual-e5-base (multilingual; handles Japanese)This skill is a mandatory preflight step before:
gwt-discussiongwt-register-issuegwt-fix-issueRun at least 2-3 semantic queries derived from the request before creating any new SPEC or Issue.
Use 2-3 queries with different angles for thorough coverage:
project index issue search specchroma persisted db recovery project indexLLM should use search before spec creationTUI ナビゲーション キーバインドworktree management branch isolationtools
Create distinctive, production-grade terminal user interfaces. Use when building TUI components with ratatui, CLI output styling, or xterm.js terminal rendering. Triggers: 'design TUI', 'terminal UI', 'TUIデザイン', 'ターミナルUI', 'ratatui widget'
testing
Semantic search over SPEC Issues (GitHub Issue cache at ~/.gwt/cache/issues/) using vector embeddings. Use when searching for existing specs, finding related specs, checking for duplicate specs, or determining which spec owns a scope. Mandatory preflight before gwt-discussion when the work may need a SPEC owner. Use when user says 'search specs', 'find related specs', 'check for duplicate specs', or asks which spec owns a scope.
business
Use when the user wants to register new work from a bug report, idea, or task description and an existing GitHub Issue number is not already known.
data-ai
Semantic search over project source files using vector embeddings. Use when the user asks to search project files, find related implementation files, or locate source files for a feature, bug, or concept.