cc-dev-template 0.1.79 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/done.md +1 -1
- package/src/skills/setup-lsp/SKILL.md +15 -0
- package/src/skills/setup-lsp/references/lsp-registry.md +148 -0
- package/src/skills/setup-lsp/references/step-1-scan.md +28 -0
- package/src/skills/setup-lsp/references/step-2-install-configure.md +85 -0
- package/src/skills/setup-lsp/references/step-3-verify.md +43 -0
- package/src/skills/setup-lsp/references/step-4-reflect.md +22 -0
package/package.json
CHANGED
package/src/commands/done.md
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-lsp
|
|
3
|
+
description: Set up LSP language servers for the current project. Use when the user says "setup LSP", "configure LSP", "enable LSP", "install language servers", or "add code intelligence". Use "verify" argument after restart to confirm LSP is working.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[verify]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Setup LSP
|
|
9
|
+
|
|
10
|
+
Configure LSP (Language Server Protocol) for the current project so Claude Code uses precise code intelligence instead of grep-based search.
|
|
11
|
+
|
|
12
|
+
| Argument | Action |
|
|
13
|
+
|----------|--------|
|
|
14
|
+
| No argument | Read `references/step-1-scan.md` |
|
|
15
|
+
| `verify` | Read `references/step-3-verify.md` |
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# LSP Registry
|
|
2
|
+
|
|
3
|
+
## Language Detection
|
|
4
|
+
|
|
5
|
+
Detect languages by file extensions AND project config files. Config files are more reliable — a `go.mod` is definitive proof of Go usage; a stray `.go` file might not be.
|
|
6
|
+
|
|
7
|
+
| Config File | Language |
|
|
8
|
+
|-------------|----------|
|
|
9
|
+
| `package.json`, `tsconfig.json`, `jsconfig.json` | TypeScript/JavaScript |
|
|
10
|
+
| `pyproject.toml`, `setup.py`, `setup.cfg`, `requirements.txt`, `Pipfile` | Python |
|
|
11
|
+
| `go.mod` | Go |
|
|
12
|
+
| `Cargo.toml` | Rust |
|
|
13
|
+
| `pom.xml`, `build.gradle`, `build.gradle.kts` | Java |
|
|
14
|
+
| `*.csproj`, `*.sln` | C# |
|
|
15
|
+
| `composer.json` | PHP |
|
|
16
|
+
| `Package.swift` | Swift |
|
|
17
|
+
| `build.gradle.kts` with `kotlin` | Kotlin |
|
|
18
|
+
| `CMakeLists.txt`, `Makefile` with `.c`/`.cpp` | C/C++ |
|
|
19
|
+
|
|
20
|
+
| Extension | Language |
|
|
21
|
+
|-----------|----------|
|
|
22
|
+
| `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, `.cts`, `.mjs`, `.cjs` | TypeScript/JavaScript |
|
|
23
|
+
| `.py`, `.pyi` | Python |
|
|
24
|
+
| `.go` | Go |
|
|
25
|
+
| `.rs` | Rust |
|
|
26
|
+
| `.java` | Java |
|
|
27
|
+
| `.cs` | C# |
|
|
28
|
+
| `.php` | PHP |
|
|
29
|
+
| `.swift` | Swift |
|
|
30
|
+
| `.kt`, `.kts` | Kotlin |
|
|
31
|
+
| `.c`, `.h`, `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hxx` | C/C++ |
|
|
32
|
+
| `.lua` | Lua |
|
|
33
|
+
|
|
34
|
+
## Language Server Details
|
|
35
|
+
|
|
36
|
+
Each entry: plugin name, binary command, install command, and verification command.
|
|
37
|
+
|
|
38
|
+
| Language | Plugin | Binary | Install | Verify |
|
|
39
|
+
|----------|--------|--------|---------|--------|
|
|
40
|
+
| TypeScript/JS | `typescript-lsp` | `typescript-language-server` | `npm i -g typescript-language-server typescript` | `which typescript-language-server` |
|
|
41
|
+
| Python | `pyright-lsp` | `pyright-langserver` | `npm i -g pyright` | `which pyright-langserver` |
|
|
42
|
+
| Go | `gopls-lsp` | `gopls` | `go install golang.org/x/tools/gopls@latest` | `which gopls` |
|
|
43
|
+
| Rust | `rust-analyzer-lsp` | `rust-analyzer` | `rustup component add rust-analyzer` | `which rust-analyzer` |
|
|
44
|
+
| Java | `jdtls-lsp` | `jdtls` | `brew install jdtls` | `which jdtls` |
|
|
45
|
+
| C/C++ | `clangd-lsp` | `clangd` | `brew install llvm` | `which clangd` |
|
|
46
|
+
| C# | `csharp-lsp` | `csharp-ls` | `dotnet tool install -g csharp-ls` | `which csharp-ls` |
|
|
47
|
+
| PHP | `php-lsp` | `intelephense` | `npm i -g intelephense` | `which intelephense` |
|
|
48
|
+
| Kotlin | `kotlin-lsp` | `kotlin-lsp` | Install from GitHub releases | `which kotlin-lsp` |
|
|
49
|
+
| Swift | `swift-lsp` | `sourcekit-lsp` | Included with Xcode | `which sourcekit-lsp` |
|
|
50
|
+
| Lua | `lua-lsp` | `lua-language-server` | Install from GitHub releases | `which lua-language-server` |
|
|
51
|
+
|
|
52
|
+
## Plugin Naming Convention
|
|
53
|
+
|
|
54
|
+
Plugins are referenced as `{plugin-name}@{marketplace}`. The official marketplace is `claude-plugins-official`.
|
|
55
|
+
|
|
56
|
+
Example: `typescript-lsp@claude-plugins-official`
|
|
57
|
+
|
|
58
|
+
## Known Issue: Official Marketplace Plugin Cache Bug
|
|
59
|
+
|
|
60
|
+
As of early 2026, there is a known bug (GitHub #15148) where plugins installed from `claude-plugins-official` cache only a `README.md` — missing the `.lsp.json` server configuration. This can cause `"No LSP server available for file type"` errors.
|
|
61
|
+
|
|
62
|
+
**Primary workaround:** Use the `Piebald-AI/claude-code-lsps` community marketplace, which properly structures plugins with `.lsp.json` files and supports additional languages (Ruby, PowerShell, HTML/CSS, Vue, etc.).
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
claude plugin marketplace add Piebald-AI/claude-code-lsps
|
|
66
|
+
claude plugin install {plugin-name}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Fallback workaround:** Manually create `.lsp.json` in the cached plugin directory. The `.lsp.json` format:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"language-id": {
|
|
74
|
+
"command": "language-server-binary",
|
|
75
|
+
"args": ["--stdio"],
|
|
76
|
+
"extensionToLanguage": {
|
|
77
|
+
".ext": "language-id"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Example for TypeScript (`~/.claude/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0/.lsp.json`):
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"typescript": {
|
|
88
|
+
"command": "typescript-language-server",
|
|
89
|
+
"args": ["--stdio"],
|
|
90
|
+
"extensionToLanguage": {
|
|
91
|
+
".ts": "typescript",
|
|
92
|
+
".tsx": "typescriptreact",
|
|
93
|
+
".js": "javascript",
|
|
94
|
+
".jsx": "javascriptreact",
|
|
95
|
+
".mts": "typescript",
|
|
96
|
+
".cts": "typescript",
|
|
97
|
+
".mjs": "javascript",
|
|
98
|
+
".cjs": "javascript"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Example for Python (`~/.claude/plugins/cache/claude-plugins-official/pyright-lsp/1.0.0/.lsp.json`):
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"python": {
|
|
109
|
+
"command": "pyright-langserver",
|
|
110
|
+
"args": ["--stdio"],
|
|
111
|
+
"extensionToLanguage": {
|
|
112
|
+
".py": "python",
|
|
113
|
+
".pyi": "python"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Example for Go (`~/.claude/plugins/cache/claude-plugins-official/gopls-lsp/1.0.0/.lsp.json`):
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"go": {
|
|
124
|
+
"command": "gopls",
|
|
125
|
+
"args": [],
|
|
126
|
+
"extensionToLanguage": {
|
|
127
|
+
".go": "go"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## LSP Operations
|
|
134
|
+
|
|
135
|
+
Claude Code's LSP tool provides these operations. All use the same `LSP` tool — the operation is chosen based on what the agent needs.
|
|
136
|
+
|
|
137
|
+
| Operation | What It Does | Use When |
|
|
138
|
+
|-----------|-------------|----------|
|
|
139
|
+
| `workspaceSymbol` | Search for a symbol across the entire project | Finding where something is defined |
|
|
140
|
+
| `goToDefinition` | Jump to the exact definition of a symbol | Navigating to source code |
|
|
141
|
+
| `goToImplementation` | Find concrete implementations of interfaces | Understanding polymorphism |
|
|
142
|
+
| `findReferences` | Find every usage of a symbol | Impact analysis before refactoring |
|
|
143
|
+
| `hover` | Get type signature and docs for a symbol | Understanding types without reading files |
|
|
144
|
+
| `documentSymbol` | List all symbols in a file | Getting an overview of a file's structure |
|
|
145
|
+
| `incomingCalls` | Trace what calls a function | Understanding callers |
|
|
146
|
+
| `outgoingCalls` | Trace what a function calls | Understanding dependencies |
|
|
147
|
+
|
|
148
|
+
Not every language server supports every operation. If an operation returns no results, it may be unsupported for that language — fall back to Grep.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Step 1: Scan the Codebase
|
|
2
|
+
|
|
3
|
+
Determine which languages are used in this project and which LSP servers to install.
|
|
4
|
+
|
|
5
|
+
## Detect Languages
|
|
6
|
+
|
|
7
|
+
Read `references/lsp-registry.md` for the detection tables.
|
|
8
|
+
|
|
9
|
+
1. Use Glob to check for config files first (they are definitive): `go.mod`, `Cargo.toml`, `package.json`, `tsconfig.json`, `pyproject.toml`, `setup.py`, `requirements.txt`, `pom.xml`, `build.gradle`, `*.csproj`, `*.sln`, `composer.json`, `Package.swift`, `CMakeLists.txt`
|
|
10
|
+
2. Then check file extensions as a secondary signal: `.py`, `.ts`, `.go`, `.rs`, `.java`, `.cs`, `.php`, `.swift`, `.kt`, `.c`, `.cpp`, `.lua`
|
|
11
|
+
3. Check existing LSP configuration — read `.claude/settings.json` if it exists to see what's already configured
|
|
12
|
+
|
|
13
|
+
## Check Prerequisites
|
|
14
|
+
|
|
15
|
+
Run `claude --version` to verify Claude Code version is 2.0.74 or later.
|
|
16
|
+
|
|
17
|
+
## Present Findings
|
|
18
|
+
|
|
19
|
+
Show the user:
|
|
20
|
+
- Which languages were detected and how (config file vs extension)
|
|
21
|
+
- Which LSP servers are recommended for each language
|
|
22
|
+
- Which language server binaries are already installed (check with `which`)
|
|
23
|
+
- Which Claude Code plugins are already installed (check `~/.claude/plugins/installed_plugins.json` if it exists)
|
|
24
|
+
- Any languages detected but not supported by available LSP plugins
|
|
25
|
+
|
|
26
|
+
Ask the user to confirm which LSPs to install. They may want to skip some languages.
|
|
27
|
+
|
|
28
|
+
Read `references/step-2-install-configure.md`.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Step 2: Install and Configure
|
|
2
|
+
|
|
3
|
+
Read `references/lsp-registry.md` for install commands, plugin names, and known issues.
|
|
4
|
+
|
|
5
|
+
## Install Language Server Binaries
|
|
6
|
+
|
|
7
|
+
For each confirmed language, check if the binary is already installed (`which <binary>`). Install only what's missing using the install commands from the registry.
|
|
8
|
+
|
|
9
|
+
Verify each installation succeeded by running the verify command from the registry.
|
|
10
|
+
|
|
11
|
+
## Install and Enable Claude Code Plugins
|
|
12
|
+
|
|
13
|
+
For each language, install the Claude Code plugin:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
claude plugin install <plugin-name>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If this fails with "Plugin not found in any marketplace", update the marketplace catalog first:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
claude plugin marketplace update claude-plugins-official
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If plugins still fail or produce errors about missing LSP server configuration, follow the workaround in `references/lsp-registry.md` under "Known Issue: Official Marketplace Plugin Cache Bug" — try the Piebald-AI community marketplace, or manually create `.lsp.json` files using the examples in the registry.
|
|
26
|
+
|
|
27
|
+
## Configure Project-Level Settings
|
|
28
|
+
|
|
29
|
+
Create or update `.claude/settings.json` in the project root (NOT `~/.claude/settings.json`).
|
|
30
|
+
|
|
31
|
+
Merge these settings, preserving any existing configuration:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"env": {
|
|
36
|
+
"ENABLE_LSP_TOOL": "1"
|
|
37
|
+
},
|
|
38
|
+
"enabledPlugins": {
|
|
39
|
+
"<plugin-name>@<marketplace>": true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Add an `enabledPlugins` entry for each installed plugin. Use the correct marketplace name (either `claude-plugins-official` or `Piebald-AI/claude-code-lsps`).
|
|
45
|
+
|
|
46
|
+
## Update CLAUDE.md
|
|
47
|
+
|
|
48
|
+
Read the project's root `CLAUDE.md`. Append the following section if no LSP instructions exist yet. If LSP instructions already exist, update them to match this format.
|
|
49
|
+
|
|
50
|
+
Tailor the snippet to the languages actually installed — list the language servers that were set up:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Code Intelligence (LSP)
|
|
54
|
+
|
|
55
|
+
This project has LSP language servers configured for: [list languages].
|
|
56
|
+
|
|
57
|
+
Prefer LSP over Grep/Read for code navigation — LSP returns exact, structural results instantly:
|
|
58
|
+
|
|
59
|
+
| Task | LSP Operation |
|
|
60
|
+
|------|--------------|
|
|
61
|
+
| Find where a symbol is defined | `workspaceSymbol` or `goToDefinition` |
|
|
62
|
+
| Find all usages of a symbol | `findReferences` |
|
|
63
|
+
| Get type info without reading the file | `hover` |
|
|
64
|
+
| List all symbols in a file | `documentSymbol` |
|
|
65
|
+
| Find implementations of an interface | `goToImplementation` |
|
|
66
|
+
| Trace callers/callees of a function | `incomingCalls` / `outgoingCalls` |
|
|
67
|
+
|
|
68
|
+
Use Grep only for text/pattern searches (comments, strings, config values, regex patterns).
|
|
69
|
+
|
|
70
|
+
After writing or editing code, check LSP diagnostics and fix type errors before proceeding.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Tell the User to Restart
|
|
74
|
+
|
|
75
|
+
LSP servers initialize at startup. The plugins just installed require a full restart of Claude Code to take effect.
|
|
76
|
+
|
|
77
|
+
Tell the user:
|
|
78
|
+
|
|
79
|
+
1. Exit Claude Code
|
|
80
|
+
2. Restart Claude Code in this project directory
|
|
81
|
+
3. Run `/setup-lsp verify` to confirm LSP is working
|
|
82
|
+
|
|
83
|
+
**IMPORTANT: You are not done. You MUST read and complete the next step. The workflow is incomplete without it.**
|
|
84
|
+
|
|
85
|
+
Read `references/step-4-reflect.md` now.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Step 3: Verify LSP
|
|
2
|
+
|
|
3
|
+
This step runs after the user restarts Claude Code and invokes `/setup-lsp verify`.
|
|
4
|
+
|
|
5
|
+
## Check LSP is Available
|
|
6
|
+
|
|
7
|
+
1. Read `.claude/settings.json` to confirm `ENABLE_LSP_TOOL` and `enabledPlugins` are set
|
|
8
|
+
2. Try a `workspaceSymbol` search for a common symbol in the project (pick any function or class name visible in the codebase)
|
|
9
|
+
|
|
10
|
+
If `workspaceSymbol` returns results, LSP is working.
|
|
11
|
+
|
|
12
|
+
## Test Operations
|
|
13
|
+
|
|
14
|
+
Run a quick smoke test — try 3-4 different LSP operations against real symbols in the codebase:
|
|
15
|
+
|
|
16
|
+
- `workspaceSymbol` — search for a known class or function name
|
|
17
|
+
- `documentSymbol` — list symbols in a file that clearly has functions/classes
|
|
18
|
+
- `hover` — get type info on a symbol
|
|
19
|
+
- `findReferences` — find usages of a commonly-used function
|
|
20
|
+
|
|
21
|
+
Report which operations succeeded and which returned no results. Some operations may not be supported by all language servers — that's expected.
|
|
22
|
+
|
|
23
|
+
## If LSP is Not Working
|
|
24
|
+
|
|
25
|
+
Check these in order:
|
|
26
|
+
|
|
27
|
+
1. **"LSP tool not available"** — `ENABLE_LSP_TOOL` is not set. Verify `.claude/settings.json` has it under `env`
|
|
28
|
+
2. **"No server available for file type"** — the plugin is installed but its `.lsp.json` config is missing (known bug). Read `references/lsp-registry.md` under "Known Issue" for the manual `.lsp.json` fix
|
|
29
|
+
3. **Plugin is disabled** — run `claude plugin list` to check status. Run `claude plugin enable <name>` if disabled
|
|
30
|
+
4. **Binary not in PATH** — verify with `which <binary>`. The language server must be in PATH when Claude Code starts
|
|
31
|
+
|
|
32
|
+
After fixing, the user needs to restart Claude Code again and re-run `/setup-lsp verify`.
|
|
33
|
+
|
|
34
|
+
## Report Results
|
|
35
|
+
|
|
36
|
+
Tell the user:
|
|
37
|
+
- Which LSP servers are active
|
|
38
|
+
- Which operations were tested and their results
|
|
39
|
+
- Any operations that didn't work (with explanation)
|
|
40
|
+
|
|
41
|
+
**IMPORTANT: You are not done. You MUST read and complete the next step. The workflow is incomplete without it.**
|
|
42
|
+
|
|
43
|
+
Read `references/step-4-reflect.md` now.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Step 4: Reflect
|
|
2
|
+
|
|
3
|
+
**IMPORTANT: This step is mandatory. The setup-lsp workflow is not complete until this step is finished. Do not skip this.**
|
|
4
|
+
|
|
5
|
+
## Assess
|
|
6
|
+
|
|
7
|
+
- Were any install commands wrong, outdated, or platform-specific in a way the registry didn't account for?
|
|
8
|
+
- Did any plugin installations fail? What was the cause and fix?
|
|
9
|
+
- Did the official marketplace plugin cache bug occur? Was the workaround effective?
|
|
10
|
+
- Were there languages detected that had no available LSP plugin?
|
|
11
|
+
- Did the CLAUDE.md snippet accurately reflect the operations that actually worked?
|
|
12
|
+
- Was any step confusing, missing information, or in the wrong order?
|
|
13
|
+
|
|
14
|
+
## Act
|
|
15
|
+
|
|
16
|
+
If any instructions were wrong, incomplete, or misleading — identify the specific file, read it, and apply the fix.
|
|
17
|
+
|
|
18
|
+
Apply the tribal knowledge test: only add information that a fresh Claude instance would not already know. Standard tool usage (npm install, which, etc.) does not need documenting. Workarounds for bugs, non-obvious configuration details, and platform-specific gotchas do.
|
|
19
|
+
|
|
20
|
+
## Report
|
|
21
|
+
|
|
22
|
+
Tell the user what you changed and why, or confirm that no updates were needed.
|