| name | setup |
| description | Use when setting up the lrt-rocm workspace for the first time, or when a new team member installs the plugin |
Set up the ROCm development workspace. This skill discovers the TheRock repository on the filesystem (or clones it), generates a directory map, and scaffolds the workspace structure. Optionally configures rocm-systems for monorepo workflows.
1. Check if already set up
Look for directory-map.md in the current working directory.
- If it exists and has populated paths, ask: "Workspace already configured. Re-run setup to update paths?"
- If user declines, stop.
2. Select operating system
Ask the user which OS they are developing on:
"Which operating system are you developing on?
- Linux (Ubuntu)
- Windows"
Auto-detect when possible:
uname -s 2>/dev/null
If detection succeeds, confirm with the user:
"Detected Linux. Is this correct?"
Store the result — it will be written to directory-map.md in step 6 and used by OS-specific skills like lrt-rocm:the-rock.
3. Find TheRock repository
Search for TheRock directories. Check these locations in order:
for dir in /develop /home/$USER /opt /workspace ~/src ~/projects ~/code; do
find "$dir" -maxdepth 4 -name "TheRock" -type d 2>/dev/null
done
If TheRock is found:
Report the discovered paths and ask user to confirm:
"Found TheRock at <path>. Is this the correct repository?"
If multiple are found, list them and ask which is the primary working copy.
If TheRock is NOT found:
Ask the user:
"I couldn't find a TheRock repository on this system. Would you like to:
- Clone it now (I'll need a target directory)
- Provide the path manually
- Skip for now (you can update directory-map.md later)"
If cloning:
cd <user-chosen-dir>
git clone https://github.com/ROCm/TheRock.git
Note: TheRock builds happen in-tree (within the TheRock directory). There is no need to configure a separate build directory.
4. Find rocm-systems repository (optional)
Ask the user if they also work with rocm-systems directly:
"Do you also work with the rocm-systems monorepo directly? (This is separate from TheRock — only needed if you build HIP/OCL via the rocm-systems workflow.)"
If yes, search for rocm-systems:
for dir in /develop /home/$USER /opt /workspace ~/src ~/projects ~/code; do
find "$dir" -maxdepth 4 -name "rocm-systems" -type d 2>/dev/null
done
If found, confirm the path. If not found, offer to clone, provide path manually, or skip.
If the user works with rocm-systems, also ask about build directories:
"Build directories (relative to rocm-systems root):
- CLR build:
projects/clr/build — for HIP/OCL runtime builds
- hip-tests build:
projects/hip-tests/build — for HIP test builds
Accept defaults or provide custom paths?"
If a directory doesn't exist, ask if they want to create it.
If the user does not work with rocm-systems, skip build directory setup entirely.
5. Detect GPU architecture
rocminfo 2>/dev/null | grep "Name:" | head -5
If rocminfo is available, show detected GPUs and ask user to confirm the target architecture.
If not available, ask the user to specify their target GPU family (e.g., gfx1201, gfx942, gfx90a).
6. Create CLAUDE.md (if it doesn't exist)
Only create CLAUDE.md if one doesn't already exist in the current directory. If one exists, leave it alone — it's the user's file.
PLUGIN_ROOT="<path to this plugin>"
if [ ! -f ./CLAUDE.md ]; then
cp "$PLUGIN_ROOT/templates/CLAUDE.md" ./CLAUDE.md
fi
7. Generate directory-map.md
Using the discovered paths and OS selection, write directory-map.md with populated values:
# ROCm Directory Map
This document maps out where all ROCm-related directories live on this system.
It is auto-populated by `/lrt-rocm:setup` or can be edited manually.
## Environment
| Setting | Value |
|---------|-------|
| OS | <linux or windows> |
## Repository Aliases
| Alias | Path | Notes |
|-------|------|-------|
| therock | <discovered_therock_path> | Main ROCm build repo |
| workspace | <cwd> | This meta-workspace |
If the user also works with rocm-systems, add these rows to the aliases table:
| rocm-systems | <discovered_rocm_systems_path> | ROCm Systems Superrepo (submodule) |
If additional TheRock or rocm-systems checkouts were discovered, add:
## Additional Checkouts
| Path | Notes |
|------|-------|
| <additional_path> | <notes> |
Only include the Build Trees section if the user works with rocm-systems:
## Build Trees
### Active Builds
- **CLR build:** `<rocm_systems_path>/projects/clr/build`
- For: HIP and OCL runtime builds
- Configuration: Release
- Target architecture: [<detected_gpu>]
- Built ROCm installation is under `dist/rocm`
- **hip-tests build:** `<rocm_systems_path>/projects/hip-tests/build`
- For: HIP unit tests and stress tests
- Configuration: Debug
- Target architecture: [<detected_gpu>]
8. VSCode integration (optional)
Ask: "Do you use VSCode for code review? The plugin includes an MCP extension for opening diffs directly in VSCode."
If yes:
- Determine VSCode extensions path:
- Remote:
~/.vscode-server/extensions/
- Local:
~/.vscode/extensions/
- Symlink the extension:
ln -s "$PLUGIN_ROOT/vscode-plugins/stella-ide-mcp" <extensions_path>/stella-ide-mcp
- Tell user to reload VSCode
- Configure MCP:
claude mcp add --transport sse vscode http://127.0.0.1:3742/sse
9. Summary
Report what was set up:
- Operating system
- TheRock directory
- rocm-systems path (if configured)
- CLR build directory (if configured)
- hip-tests build directory (if configured)
- Target GPU architecture
- Files created/updated
- VSCode integration status
Say: "Workspace setup complete. Run /lrt-rocm:setup again anytime to update paths."