From is-it-magic
Set up this machine for the is-it-magic plugin — sync all plugin rules into ~/.claude/rules/ and enable favoured language LSPs in user settings. Idempotent; re-run to refresh.
How this skill is triggered — by the user, by Claude, or both
Slash command
/is-it-magic:devbox-initThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up (or refresh) this machine for use with the is-it-magic plugin. Syncs all bundled plugin rules into `~/.claude/rules/` and ensures the favoured language LSP plugins are present in the user-level `~/.claude/settings.json`. Fully idempotent — re-run at any time after a plugin update to pull in the latest rules or settings.
Set up (or refresh) this machine for use with the is-it-magic plugin. Syncs all bundled plugin rules into ~/.claude/rules/ and ensures the favoured language LSP plugins are present in the user-level ~/.claude/settings.json. Fully idempotent — re-run at any time after a plugin update to pull in the latest rules or settings.
This skill takes no arguments. If any text is passed after the slash command, note that no arguments are accepted and proceed without interruption. Non-interactive — never use AskUserQuestion.
PLUGIN_RULES_DIRSet PLUGIN_RULES_DIR to the bundled rules directory inside the plugin:
PLUGIN_RULES_DIR = ${CLAUDE_PLUGIN_ROOT}/rules/
TARGET_DIR and SETTINGS_FILEDetect the platform at runtime by inspecting environment variables — check USERPROFILE first (Windows), then HOME (Unix):
# Unix
echo "$HOME"
# Windows
echo "$env:USERPROFILE"
Compute the target paths:
USERPROFILE is set):
TARGET_DIR = %USERPROFILE%\.claude\rules\SETTINGS_FILE = %USERPROFILE%\.claude\settings.jsonHOME is set):
TARGET_DIR = $HOME/.claude/rules/SETTINGS_FILE = $HOME/.claude/settings.jsonIf neither variable resolves, stop immediately:
Cannot resolve home directory — neither USERPROFILE nor HOME is set.
Cannot determine target paths. Aborting.
devbox-init — Resolved paths
──────────────────────────────────────────────
Plugin rules source : <PLUGIN_RULES_DIR>
Rules target : <TARGET_DIR>
Settings file : <SETTINGS_FILE>
──────────────────────────────────────────────
List all .md files in PLUGIN_RULES_DIR:
# Unix
ls "$PLUGIN_RULES_DIR"*.md
# Windows
Get-ChildItem -Path "$PLUGIN_RULES_DIR" -Filter "*.md"
Expected files include (e.g.) general.md, csharp-lang.md, typescript-lang.md, infra-lang.md, infra-naming.md, python-lang.md — but the actual set is whatever .md files are present in PLUGIN_RULES_DIR at runtime. The glob commands above are the authoritative enumeration; the list here is illustrative only.
Store the result as FILES_FOUND.
If FILES_FOUND is empty or the directory is unreadable, stop immediately:
No rule files found in <PLUGIN_RULES_DIR>. Is the plugin installed correctly?
Otherwise, print the enumerated file list:
Source files found:
<file 1>
<file 2>
… (one line per file in FILES_FOUND)
Create TARGET_DIR if it does not already exist. This is idempotent.
# Unix
mkdir -p "$TARGET_DIR"
# Windows
New-Item -ItemType Directory -Force -Path "$TARGET_DIR"
If directory creation fails, stop immediately:
Failed to create target directory: <TARGET_DIR>
Error: <error detail>
Aborting — no files were copied.
For each file enumerated in Step 1.1, copy it verbatim from source to target, overwriting any existing file. No content transformation, no merge, no frontmatter stripping. The plugin is the source of truth.
# Unix — repeat for each file
cp "$PLUGIN_RULES_DIR<filename>" "$TARGET_DIR<filename>"
# Windows — repeat for each file
Copy-Item -Path "$PLUGIN_RULES_DIR\<filename>" -Destination "$TARGET_DIR\<filename>" -Force
Track each outcome individually:
FILES_WRITTEN).Ensure the three favoured language LSP plugins are present under enabledPlugins in SETTINGS_FILE.
Read SETTINGS_FILE if it exists. If the file does not exist, start from {}.
Check which of the following keys are absent from enabledPlugins (or missing entirely because the enabledPlugins object does not exist):
| Key | Purpose |
|---|---|
csharp-lsp@claude-plugins-official | C# / .NET language intelligence |
typescript-lsp@claude-plugins-official | TypeScript / Vue language intelligence |
pyright-lsp@claude-plugins-official | Python language intelligence |
Collect the missing keys as KEYS_TO_ADD. Any key that is already present with any value is left untouched.
If KEYS_TO_ADD is non-empty:
enabledPlugins set to true.SETTINGS_FILE.If KEYS_TO_ADD is empty, this step is a no-op — do not rewrite the file.
Use PowerShell or bash depending on the detected platform:
# Windows — read, merge, write
$settings = if (Test-Path "$SETTINGS_FILE") {
Get-Content "$SETTINGS_FILE" -Raw | ConvertFrom-Json
} else {
[PSCustomObject]@{}
}
if (-not $settings.enabledPlugins) {
$settings | Add-Member -NotePropertyName 'enabledPlugins' -NotePropertyValue ([PSCustomObject]@{})
}
# Add each missing key
$settings.enabledPlugins | Add-Member -NotePropertyName '<key>' -NotePropertyValue $true -Force
$settings | ConvertTo-Json -Depth 10 | Set-Content "$SETTINGS_FILE"
# Unix — read, merge, write (requires jq)
jq '.enabledPlugins["<key>"] = true' "$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" && mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE"
If writing fails, record the failure and continue to Phase 3 (report the failure in the summary).
devbox-init — Complete
──────────────────────────────────────────────
Rules synced to <TARGET_DIR> (<count of FILES_WRITTEN>):
<file 1> → <TARGET_DIR><file 1>
<file 2> → <TARGET_DIR><file 2>
… (one line per file in FILES_WRITTEN)
Rules now load globally in every Claude Code session on this machine.
Language-specific rules (csharp-lang, typescript-lang, etc.) stay dormant until
files matching their paths: frontmatter appear in the active project.
──────────────────────────────────────────────
LSP enablement (<SETTINGS_FILE>):
csharp-lsp@claude-plugins-official — <added | already present>
typescript-lsp@claude-plugins-official — <added | already present>
pyright-lsp@claude-plugins-official — <added | already present>
──────────────────────────────────────────────
Where FILES_WRITTEN is the subset of FILES_FOUND copied successfully. Counts and lines are derived at runtime — never hardcoded.
If any files failed to copy, append a separate FAILED section:
FAILED (<N>):
<filename> — <error detail>
If all files failed, replace the "Rules synced" section with:
No rule files were written. See FAILED section above.
${CLAUDE_PLUGIN_ROOT}/rules/ — they are read-only for this skill.AskUserQuestion. Proceed autonomously.~/.claude/rules/ and ~/.claude/settings.json are touched.~/.claude/rules/ will be overwritten the next time this skill is run. The plugin is the source of truth.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub gbr-perso-1/is-it-magic --plugin is-it-magic