Sourcekit lsp workflow
Skill gaelic-ghost/socket/plugins/swift-lang/skills/sourcekit-lsp-workflow
Configure or diagnose SourceKit-LSP across SwiftPM, compilation databases, and build servers. Use for completion, navigation, refactoring, diagnostics, semantic tokens, indexing, generated files, or editor-client failures.From its SKILL.md
npx -y skills add gaelic-ghost/socket --skill sourcekit-lsp-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.7 KB, 688 tokens by cl100k_base, as published. Nobody here has run it
SourceKit-LSP Workflow
Treat SourceKit-LSP as an editor protocol server whose semantic quality depends on matching toolchain, build settings, modules, generated files, and index state.
Workflow
- Identify the client, workspace root, requested LSP feature, project model, and whether the failure is startup, build-settings, semantic, index, protocol, or client presentation.
- Resolve the intended server and compiler together:
- inspect Swiftly's selected location,
sourcekit-lsp, and Swift version - inspect
xcode-select,xcrun --find sourcekit-lsp, andxcrun swiftc --version - use Swiftly for Swift.org toolchains and cross-platform SwiftPM work
- use Xcode's server for Apple SDK and Xcode-selected toolchain behavior
- inspect Swiftly's selected location,
- Confirm workspace integration:
- native SwiftPM workspace
compile_commands.jsonorcompile_flags.txt- Build Server Protocol provider
- fallback settings only for intentionally unmanaged files
- Confirm the client completed
initialize, opened the document before document requests, preserved the process environment, and framed JSON-RPC messages correctly. - Check build settings, generated files, module preparation, last successful build, index-store production, index freshness, and background-indexing policy.
- Reproduce with logging or the built-in
diagnosebundle before clearing caches or changing configuration. Read references/sourcekit-lsp-diagnostics.md for the ordered diagnosis path. - Treat
.sourcekit-lsp/config.jsonas version-sensitive. Verify options against the selected server before adding or changing them. - Report server, compiler, project model, failing request, logs, build/index state, correction, and remaining client-specific behavior.
Toolchain Contract
- Keep SourceKit-LSP,
sourcekitd, compiler, SDK, plugins, and built modules from one coherent toolchain selection. - Record both Swiftly and Xcode resolution on macOS even when they currently report the same Swift version.
- When Swiftly selects
xcode, confirm which Xcode is selected rather than treating the proxy as an independent toolchain. - Do not hard-code an Xcode application or toolchain path; resolve it through the configured selection.
- Do not change the global toolchain merely to test a hypothesis without explicit user intent.
Boundaries
- Use
swift-semantic-indexing-workflowfor direct SourceKit or IndexStoreDB application integrations that do not need LSP. - Use
swift-compiler-inspection-workflowfor compiler phases and emitted artifacts. - Hand Xcode-hosted coding-agent setup to
xcode-coding-intelligence-workflowand Xcode build execution toxcode-build-run-workflow.
Guardrails
- Do not blame the editor before checking server logs, build settings, generated files, and index freshness.
- Do not expect cross-module results from modules that have not been prepared or indexed.
- Do not run SourceKit-LSP inside a restricted application sandbox unless the host deliberately provides the required developer-tool access.
- Do not assume one stdout read equals one LSP packet; buffer and parse by protocol framing.
- Do not expose mirrored LSP traffic or diagnostic bundles without checking them for source and environment data.
What ships with it: 2 files
2.8 KB alongside SKILL.md
agents/
- openai.yaml275 B