Swift Context: Local Semantic Intelligence
Use this skill to map your project's code structure through semantic indexing.
Commands
sync
Rebuilds the encrypted semantic index. Run when files have changed significantly.
scripts/swift_context sync --path <PROJECT_ROOT>
query
Semantic search across the indexed codebase.
scripts/swift_context query "<NATURAL_LANGUAGE_QUERY>"
impact
Analyzes the blast radius of a planned change.
scripts/swift_context impact "<INTENTION_OR_COMPONENT_NAME>"
When to Sync
Run sync in these cases:
- Missing cache: No corresponding
.binfile exists in~/.swiftzilla/cache - Stale index: Project files are newer than the cached index
- Unexpected results: After a refactor,
queryreturns irrelevant results
Gotchas
- The index is encrypted and cached in
~/.swiftzilla/cache— if you switch projects, the old cache may still be used. Alwayssyncwith the correct--pathafter switching projects. queryreturns semantic matches, not exact text matches. If you need exact string search, use standard grep/find tools instead.- After major refactors, always re-sync before running
impact— stale indexes produce incorrect dependency maps.
Workflow
- Sync: Run
syncif the index is missing or stale - Query: Use
queryto find relevant code locations and understand implementation details - Impact: Use
impactbefore making changes to understand what else will be affected