SuperAPI AI Directory

swift_context

Coding & development

View repository

Updated 10-16 05:58

About this skill

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:

  1. Missing cache: No corresponding .bin file exists in ~/.swiftzilla/cache
  2. Stale index: Project files are newer than the cached index
  3. Unexpected results: After a refactor, query returns irrelevant results

Gotchas

  • The index is encrypted and cached in ~/.swiftzilla/cache — if you switch projects, the old cache may still be used. Always sync with the correct --path after switching projects.
  • query returns 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

  1. Sync: Run sync if the index is missing or stale
  2. Query: Use query to find relevant code locations and understand implementation details
  3. Impact: Use impact before making changes to understand what else will be affected