$npx -y skills add Amplicode/spring-skills --skill amplicode-installInstalls the Amplicode IntelliJ plugin into IntelliJ IDEA (Ultimate/Community) and GigaIDE on the user's machine. Trigger explicitly when the user asks to install the Amplicode plugin into their IDE, in any language. Also trigger implicitly when another Spring Agent Toolkit skill
| 1 | # amplicode-install |
| 2 | |
| 3 | Installs the Amplicode IntelliJ plugin into all locally installed IntelliJ IDEA (Ultimate/Community) and GigaIDE installations the user picks. |
| 4 | |
| 5 | ## What this skill does |
| 6 | |
| 7 | 1. Runs a platform-specific detection script that finds installed IntelliJ-based IDEs on the machine. |
| 8 | 2. Filters down to **IDEA Ultimate (`IU`)**, **IDEA Community (`IC`)**, and **GigaIDE**. Skips everything else. |
| 9 | 3. Filters out IDEs where Amplicode is already installed. |
| 10 | 4. Asks the user which IDE(s) to install into when more than one candidate remains. |
| 11 | 5. Invokes the standard JetBrains CLI: `<ide-binary> installPlugins com.haulmont.amplicode https://amplicode.ru/marketplace`. The IDE itself picks the right version for its build, downloads the ZIP, and unpacks it into the right plugins directory. |
| 12 | 6. Tells the user to launch the IDE, open any project, and **click the "Настроить Spring Agent" button** on the Amplicode welcome screen. That button (and only that button) triggers MCP auto-config + spring-skills install. |
| 13 | |
| 14 | ## What this skill does NOT do |
| 15 | |
| 16 | - It does **not** write any MCP client config. The Amplicode plugin needs a running MCP server inside the IDE to know the port — only the plugin itself can fill in the configs of supported agents. That happens when the user clicks "Настроить Spring Agent" on the welcome screen (not automatically on IDE start). |
| 17 | - It does **not** install spring-skills or any agent-side skill packages. That is also done by the welcome-screen button. |
| 18 | - It does **not** download or extract the plugin ZIP by hand. JetBrains' `installPlugins` CLI handles fetching, version matching against the IDE build, and unpacking. |
| 19 | |
| 20 | ## Step-by-step |
| 21 | |
| 22 | ### 1. Run the detection script |
| 23 | |
| 24 | The scripts live next to this `SKILL.md` under `scripts/`. Run the right one for the user's OS and parse its stdout as a JSON array; the script already filters down to compatible IDEs (IDEA Ultimate / Community / GigaIDE), so the agent only needs these fields per element: `amplicodeInstalled`, `name`, `running`, `pid`, `hostsCurrentProcess`, `dataDirectoryName`, `exePath`, `appBundle`. |
| 25 | |
| 26 | - **macOS / Linux:** `bash scripts/detect-ides.sh` |
| 27 | - **Windows:** `pwsh scripts/detect-ides.ps1` (fallback `powershell` if `pwsh` is not available) |
| 28 | |
| 29 | If the JSON array is empty — tell the user no compatible IDE was found and stop. |
| 30 | |
| 31 | ### 2. Filter |
| 32 | |
| 33 | - Drop entries with `amplicodeInstalled: true` — never reinstall, never ask. |
| 34 | - If nothing left — tell the user Amplicode is already installed in every compatible IDE and stop. |
| 35 | |
| 36 | ### 3. Pick targets |
| 37 | |
| 38 | - **Exactly one candidate left:** install into it without asking. Tell the user which IDE you are using. |
| 39 | - **Two or more:** ask the user a multi-select question (using whichever interactive-prompt tool the client provides). Each option is one IDE (label = `name`). Do not add "all of them" as a separate option — multi-select already covers it. Recommend selecting all, but let the user decide. |
| 40 | |
| 41 | ### 3a. Handle running IDEs (auto-restart flow) |
| 42 | |
| 43 | For each picked IDE, check the `running` flag from the detection JSON. **Trust it — do not roll your own `pgrep` check; pgrep truncates long JVM command lines and gives false negatives.** If `running: true`, the JetBrains CLI will fail with "Only one instance of IDEA can be run at a time." |
| 44 | |
| 45 | **Self-host check (do this first).** For each picked IDE with `running: true`, look at `hostsCurrentProcess`. If `true`, you are running inside that IDE's terminal — sending SIGTERM to the IDE will kill you before `installPlugins` ever runs, leaving the user with a closed IDE and no plugin. **Never offer auto-restart for such IDEs.** Skip the question below for that IDE and go straight to the manual instructions described after "If the user picks the second option" — substitute the IDE's own `exePath`. Tell the user up front (in their language) why: "I'm running inside this IDE — if I close it, I die with it and the install step never runs. So you'll need to do this part yourself." |
| 46 | |
| 47 | When at least one picked IDE |