agentic-skill-mill 1.0.9 → 1.0.11

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/install-local.ps1 DELETED
@@ -1,385 +0,0 @@
1
- $ErrorActionPreference = 'Stop'
2
-
3
- $ProjectName = 'agentic-skill-mill'
4
- $CliBinName = 'skillmill'
5
- $ManagedMarker = 'managed_by: agentic-skill-mill'
6
- $Skills = @('agentic-skill-mill')
7
- $SkillDir = Split-Path -Parent $MyInvocation.MyCommand.Path
8
- $UserHome = [Environment]::GetFolderPath('UserProfile')
9
- $AppData = [Environment]::GetFolderPath('ApplicationData')
10
- $CodeXHomeDir = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $UserHome '.codex' }
11
-
12
- $ClaudeSkillsDir = Join-Path $UserHome '.claude\skills'
13
- $CursorRulesDir = Join-Path $UserHome '.cursor\rules'
14
- $CursorSkillsDir = Join-Path $UserHome '.cursor\skills'
15
- $WindsurfRulesDir = Join-Path $UserHome '.windsurf\rules'
16
- $WindsurfSkillsDir = Join-Path $UserHome '.codeium\windsurf\skills'
17
- $OpenCodeAgentsDirs = @(
18
- Join-Path $AppData 'opencode\agents',
19
- Join-Path $UserHome '.opencode\agents'
20
- )
21
- $CodeXSkillsDir = Join-Path $CodeXHomeDir 'skills'
22
- $CompiledDir = Join-Path $SkillDir 'compiled'
23
-
24
- function Show-Help {
25
- Write-Host 'Usage: powershell -ExecutionPolicy Bypass -File .\install-local.ps1 [options]'
26
- Write-Host ''
27
- Write-Host 'Options:'
28
- Write-Host ' --claude Install skills for Claude Code'
29
- Write-Host ' --cursor Install skills for Cursor'
30
- Write-Host ' --windsurf Install skills for Windsurf'
31
- Write-Host ' --opencode Install skills for OpenCode'
32
- Write-Host ' --codex Install skills for Codex'
33
- Write-Host ' --all Install for all five tools'
34
- Write-Host ' --skills-only Skip npm install/build/link (just copy skills)'
35
- Write-Host ' --uninstall Remove installed skills from target tools'
36
- Write-Host ' --compile-only Generate compiled/ output directory (no install)'
37
- Write-Host ' -h, --help Show this help'
38
- Write-Host ''
39
- Write-Host 'No flags = auto-detect installed tools.'
40
- }
41
-
42
- function Invoke-Step {
43
- param(
44
- [Parameter(Mandatory = $true)][string]$FilePath,
45
- [string[]]$Arguments = @(),
46
- [string]$WorkingDirectory = $SkillDir,
47
- [switch]$AllowFailure
48
- )
49
-
50
- $argText = if ($Arguments.Count -gt 0) { ' ' + ($Arguments -join ' ') } else { '' }
51
- Write-Host ("> {0}{1}" -f $FilePath, $argText)
52
- Push-Location $WorkingDirectory
53
- try {
54
- & $FilePath @Arguments
55
- if (-not $AllowFailure -and $LASTEXITCODE -ne 0) {
56
- throw "Command failed with exit code $LASTEXITCODE: $FilePath$argText"
57
- }
58
- }
59
- finally {
60
- Pop-Location
61
- }
62
- }
63
-
64
- function Ensure-Directory {
65
- param([Parameter(Mandatory = $true)][string]$Path)
66
- New-Item -ItemType Directory -Force -Path $Path | Out-Null
67
- }
68
-
69
- function Remove-ManagedFiles {
70
- param([Parameter(Mandatory = $true)][string]$Path)
71
-
72
- if (-not (Test-Path -LiteralPath $Path -PathType Container)) {
73
- return
74
- }
75
-
76
- Get-ChildItem -LiteralPath $Path -Recurse -File | ForEach-Object {
77
- $file = $_
78
- $matches = Select-String -Path $file.FullName -SimpleMatch -Pattern $ManagedMarker -Quiet -ErrorAction SilentlyContinue
79
- if ($matches) {
80
- Remove-Item -LiteralPath $file.FullName -Force
81
- Write-Host " Removed: $($file.FullName)"
82
- $parent = Split-Path -Parent $file.FullName
83
- if ($parent -and ([IO.Path]::GetFullPath($parent) -ne [IO.Path]::GetFullPath($Path))) {
84
- try {
85
- Remove-Item -LiteralPath $parent -Force -ErrorAction Stop
86
- }
87
- catch {
88
- }
89
- }
90
- }
91
- }
92
- }
93
-
94
- function Install-Claude {
95
- param([Parameter(Mandatory = $true)][string]$SkillName)
96
- $src = Join-Path $CompiledDir "claude\$SkillName\SKILL.md"
97
- $destDir = Join-Path $ClaudeSkillsDir $SkillName
98
- Ensure-Directory -Path $destDir
99
- Copy-Item -LiteralPath $src -Destination (Join-Path $destDir 'SKILL.md') -Force
100
- Write-Host " Claude: $(Join-Path $destDir 'SKILL.md')"
101
- }
102
-
103
- function Install-Cursor {
104
- param([Parameter(Mandatory = $true)][string]$SkillName)
105
- $srcRule = Join-Path $CompiledDir "cursor\rules\$SkillName.mdc"
106
- Ensure-Directory -Path $CursorRulesDir
107
- Copy-Item -LiteralPath $srcRule -Destination (Join-Path $CursorRulesDir "$SkillName.mdc") -Force
108
- Write-Host " Cursor (rule): $(Join-Path $CursorRulesDir "$SkillName.mdc")"
109
- $srcSkill = Join-Path $CompiledDir "cursor\skills\$SkillName\SKILL.md"
110
- $destDir = Join-Path $CursorSkillsDir $SkillName
111
- Ensure-Directory -Path $destDir
112
- Copy-Item -LiteralPath $srcSkill -Destination (Join-Path $destDir 'SKILL.md') -Force
113
- Write-Host " Cursor (skill): $(Join-Path $destDir 'SKILL.md')"
114
- }
115
-
116
- function Install-Windsurf {
117
- param([Parameter(Mandatory = $true)][string]$SkillName)
118
- $srcRule = Join-Path $CompiledDir "windsurf\rules\$SkillName.md"
119
- Ensure-Directory -Path $WindsurfRulesDir
120
- Copy-Item -LiteralPath $srcRule -Destination (Join-Path $WindsurfRulesDir "$SkillName.md") -Force
121
- Write-Host " Windsurf (rule): $(Join-Path $WindsurfRulesDir "$SkillName.md")"
122
- $srcSkill = Join-Path $CompiledDir "windsurf\skills\$SkillName\SKILL.md"
123
- $destDir = Join-Path $WindsurfSkillsDir $SkillName
124
- Ensure-Directory -Path $destDir
125
- Copy-Item -LiteralPath $srcSkill -Destination (Join-Path $destDir 'SKILL.md') -Force
126
- Write-Host " Windsurf (skill): $(Join-Path $destDir 'SKILL.md')"
127
- }
128
-
129
- function Install-OpenCode {
130
- param([Parameter(Mandatory = $true)][string]$SkillName)
131
- $src = Join-Path $CompiledDir "opencode\$SkillName.md"
132
- $destRoot = $OpenCodeAgentsDirs[0]
133
- Ensure-Directory -Path $destRoot
134
- Copy-Item -LiteralPath $src -Destination (Join-Path $destRoot "$SkillName.md") -Force
135
- Write-Host " OpenCode: $(Join-Path $destRoot "$SkillName.md")"
136
- }
137
-
138
- function Install-Codex {
139
- param([Parameter(Mandatory = $true)][string]$SkillName)
140
- $src = Join-Path $CompiledDir "codex\$SkillName\SKILL.md"
141
- $destDir = Join-Path $CodeXSkillsDir $SkillName
142
- Ensure-Directory -Path $destDir
143
- Copy-Item -LiteralPath $src -Destination (Join-Path $destDir 'SKILL.md') -Force
144
- Write-Host " Codex: $(Join-Path $destDir 'SKILL.md')"
145
- }
146
-
147
- function Uninstall-Claude {
148
- foreach ($skill in $Skills) {
149
- $path = Join-Path $ClaudeSkillsDir $skill
150
- if (Test-Path -LiteralPath $path) {
151
- Remove-Item -LiteralPath $path -Recurse -Force
152
- }
153
- }
154
- Write-Host ' Claude: removed'
155
- }
156
-
157
- function Uninstall-Cursor {
158
- foreach ($skill in $Skills) {
159
- $rulePath = Join-Path $CursorRulesDir "$skill.mdc"
160
- $skillPath = Join-Path $CursorSkillsDir $skill
161
- if (Test-Path -LiteralPath $rulePath) {
162
- Remove-Item -LiteralPath $rulePath -Force
163
- }
164
- if (Test-Path -LiteralPath $skillPath) {
165
- Remove-Item -LiteralPath $skillPath -Recurse -Force
166
- }
167
- }
168
- Write-Host ' Cursor: removed'
169
- }
170
-
171
- function Uninstall-Windsurf {
172
- foreach ($skill in $Skills) {
173
- $rulePath = Join-Path $WindsurfRulesDir "$skill.md"
174
- $skillPath = Join-Path $WindsurfSkillsDir $skill
175
- if (Test-Path -LiteralPath $rulePath) {
176
- Remove-Item -LiteralPath $rulePath -Force
177
- }
178
- if (Test-Path -LiteralPath $skillPath) {
179
- Remove-Item -LiteralPath $skillPath -Recurse -Force
180
- }
181
- }
182
- Write-Host ' Windsurf: removed'
183
- }
184
-
185
- function Uninstall-OpenCode {
186
- foreach ($root in $OpenCodeAgentsDirs) {
187
- foreach ($skill in $Skills) {
188
- $path = Join-Path $root "$skill.md"
189
- if (Test-Path -LiteralPath $path) {
190
- Remove-Item -LiteralPath $path -Force
191
- }
192
- }
193
- }
194
- Write-Host ' OpenCode: removed'
195
- }
196
-
197
- function Uninstall-Codex {
198
- foreach ($skill in $Skills) {
199
- $path = Join-Path $CodeXSkillsDir $skill
200
- if (Test-Path -LiteralPath $path) {
201
- Remove-Item -LiteralPath $path -Recurse -Force
202
- }
203
- }
204
- Write-Host ' Codex: removed'
205
- }
206
-
207
- function Get-DetectedEditors {
208
- $detected = New-Object System.Collections.Generic.List[string]
209
- if (Test-Path -LiteralPath (Join-Path $UserHome '.claude')) { $detected.Add('claude') }
210
- if (Test-Path -LiteralPath (Join-Path $UserHome '.cursor')) { $detected.Add('cursor') }
211
- if ((Test-Path -LiteralPath (Join-Path $UserHome '.windsurf')) -or (Test-Path -LiteralPath (Join-Path $UserHome '.codeium\windsurf'))) { $detected.Add('windsurf') }
212
- foreach ($root in $OpenCodeAgentsDirs) {
213
- $parent = Split-Path -Parent $root
214
- if (Test-Path -LiteralPath $parent) {
215
- $detected.Add('opencode')
216
- break
217
- }
218
- }
219
- if ($env:CODEX_HOME -or (Test-Path -LiteralPath $CodeXHomeDir)) { $detected.Add('codex') }
220
- return $detected.ToArray()
221
- }
222
-
223
- $targets = New-Object System.Collections.Generic.List[string]
224
- $doBuild = $true
225
- $doUninstall = $false
226
- $doCompileOnly = $false
227
-
228
- for ($i = 0; $i -lt $args.Count; $i++) {
229
- switch ($args[$i]) {
230
- '--claude' { $targets.Add('claude'); continue }
231
- '--cursor' { $targets.Add('cursor'); continue }
232
- '--windsurf' { $targets.Add('windsurf'); continue }
233
- '--opencode' { $targets.Add('opencode'); continue }
234
- '--codex' { $targets.Add('codex'); continue }
235
- '--all' {
236
- $targets.Clear()
237
- @('claude', 'cursor', 'windsurf', 'opencode', 'codex') | ForEach-Object { $targets.Add($_) }
238
- continue
239
- }
240
- '--skills-only' { $doBuild = $false; continue }
241
- '--uninstall' { $doUninstall = $true; continue }
242
- '--compile-only' { $doCompileOnly = $true; continue }
243
- '--help' { Show-Help; exit 0 }
244
- '-h' { Show-Help; exit 0 }
245
- default {
246
- Write-Error "Unknown option: $($args[$i])`nRun: powershell -ExecutionPolicy Bypass -File .\install-local.ps1 --help"
247
- }
248
- }
249
- }
250
-
251
- if ($doCompileOnly) {
252
- Write-Host '==> Delegating to compile.mjs...'
253
- Invoke-Step -FilePath 'node' -Arguments @((Join-Path $SkillDir 'skill\build\compile.mjs'))
254
- exit 0
255
- }
256
-
257
- if ($targets.Count -eq 0) {
258
- (Get-DetectedEditors) | ForEach-Object { $targets.Add($_) }
259
- }
260
-
261
- if ($targets.Count -eq 0) {
262
- throw 'ERROR: No supported tools detected. Use --claude, --cursor, --windsurf, --opencode, or --codex.'
263
- }
264
-
265
- Write-Host "==> $ProjectName setup"
266
- Write-Host " Project: $SkillDir"
267
- Write-Host " Targets: $($targets -join ' ')"
268
- Write-Host ''
269
-
270
- if ($doUninstall) {
271
- Write-Host "==> Uninstalling $ProjectName"
272
- Write-Host " Targets: $($targets -join ' ')"
273
- Write-Host ''
274
-
275
- foreach ($target in $targets) {
276
- switch ($target) {
277
- 'claude' { Uninstall-Claude }
278
- 'cursor' { Uninstall-Cursor }
279
- 'windsurf' { Uninstall-Windsurf }
280
- 'opencode' { Uninstall-OpenCode }
281
- 'codex' { Uninstall-Codex }
282
- }
283
- }
284
-
285
- Write-Host "--> Removing $CliBinName CLI..."
286
- Invoke-Step -FilePath 'npm' -Arguments @('unlink', $ProjectName) -AllowFailure
287
- $skillmillCmd = Get-Command $CliBinName -ErrorAction SilentlyContinue
288
- if ($skillmillCmd) {
289
- Write-Host " WARNING: $CliBinName still in PATH at $($skillmillCmd.Source)"
290
- }
291
- else {
292
- Write-Host " $CliBinName removed"
293
- }
294
-
295
- Write-Host ''
296
- Write-Host '==> Done. Skills and CLI removed.'
297
- exit 0
298
- }
299
-
300
- if ($doBuild) {
301
- Write-Host '--> Installing dependencies...'
302
- Invoke-Step -FilePath 'npm' -Arguments @('install')
303
-
304
- Write-Host '--> Cleaning previous build...'
305
- $distDir = Join-Path $SkillDir 'dist'
306
- if (Test-Path -LiteralPath $distDir) {
307
- Remove-Item -LiteralPath $distDir -Recurse -Force
308
- }
309
-
310
- Write-Host '--> Building TypeScript...'
311
- Invoke-Step -FilePath 'npm' -Arguments @('run', 'build')
312
-
313
- Write-Host '--> Compiling skills...'
314
- Invoke-Step -FilePath 'npm' -Arguments @('run', 'compile')
315
-
316
- Write-Host "--> Installing $CliBinName CLI globally..."
317
- Invoke-Step -FilePath 'npm' -Arguments @('link')
318
-
319
- $npmPrefix = (& npm prefix -g).Trim()
320
- if ($LASTEXITCODE -ne 0) {
321
- throw 'Failed to determine npm global prefix.'
322
- }
323
- $candidateBins = @(
324
- Join-Path $npmPrefix "$CliBinName.cmd",
325
- Join-Path $npmPrefix $CliBinName,
326
- Join-Path (Join-Path $npmPrefix 'bin') "$CliBinName.cmd",
327
- Join-Path (Join-Path $npmPrefix 'bin') $CliBinName
328
- )
329
- $cliPath = $candidateBins | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
330
- if ($cliPath) {
331
- Write-Host " $CliBinName: $cliPath"
332
- $cliVersion = (& $cliPath --version 2>$null)
333
- if ($LASTEXITCODE -eq 0 -and $cliVersion) {
334
- Write-Host " version: $cliVersion"
335
- }
336
- else {
337
- Write-Host ' version: unknown'
338
- }
339
- }
340
- else {
341
- Write-Host " WARNING: $CliBinName not found under npm global prefix after npm link."
342
- Write-Host ' Try running: npm link'
343
- }
344
- }
345
-
346
- Write-Host "--> Cleaning stale $ProjectName files..."
347
- foreach ($target in $targets) {
348
- switch ($target) {
349
- 'claude' { Remove-ManagedFiles -Path $ClaudeSkillsDir }
350
- 'cursor' {
351
- Remove-ManagedFiles -Path $CursorRulesDir
352
- Remove-ManagedFiles -Path $CursorSkillsDir
353
- }
354
- 'windsurf' {
355
- Remove-ManagedFiles -Path $WindsurfRulesDir
356
- Remove-ManagedFiles -Path $WindsurfSkillsDir
357
- }
358
- 'opencode' {
359
- foreach ($root in $OpenCodeAgentsDirs) {
360
- Remove-ManagedFiles -Path $root
361
- }
362
- }
363
- 'codex' { Remove-ManagedFiles -Path $CodeXSkillsDir }
364
- }
365
- }
366
-
367
- Write-Host '--> Installing skills...'
368
- foreach ($skill in $Skills) {
369
- Write-Host " ${skill}:"
370
- foreach ($target in $targets) {
371
- switch ($target) {
372
- 'claude' { Install-Claude -SkillName $skill }
373
- 'cursor' { Install-Cursor -SkillName $skill }
374
- 'windsurf' { Install-Windsurf -SkillName $skill }
375
- 'opencode' { Install-OpenCode -SkillName $skill }
376
- 'codex' { Install-Codex -SkillName $skill }
377
- }
378
- }
379
- }
380
-
381
- Write-Host ''
382
- Write-Host '==> Done.'
383
- Write-Host ''
384
- Write-Host "Skills installed for: $($targets -join ' ')"
385
- Write-Host "CLI available as: $CliBinName"
package/install-local.sh DELETED
@@ -1,265 +0,0 @@
1
- #!/usr/bin/env bash
2
- # install-local.sh -- Local project setup: build companion CLI + install skills for AI coding tools
3
- # Run from the project root: bash install-local.sh [--claude] [--cursor] [--windsurf] [--opencode] [--codex] [--all]
4
- # No flags = auto-detect installed tools
5
-
6
- set -e
7
-
8
- # ===========================================================================
9
- # CONFIGURE: Change these values for your project
10
- # ===========================================================================
11
-
12
- PROJECT_NAME="agentic-skill-mill" # Used in log messages
13
- CLI_BIN_NAME="skillmill" # The bin name from package.json
14
- MANAGED_MARKER="managed_by: agentic-skill-mill" # Must match compile.mjs MANAGED_BY
15
- SKILLS=("agentic-skill-mill") # All skill names from manifest.json
16
-
17
- # ===========================================================================
18
- # End configuration
19
- # ===========================================================================
20
-
21
- SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
22
-
23
- # --- Target directories ---
24
- CLAUDE_SKILLS_DIR="$HOME/.claude/skills"
25
- CURSOR_RULES_DIR="$HOME/.cursor/rules"
26
- CURSOR_SKILLS_DIR="$HOME/.cursor/skills"
27
- WINDSURF_RULES_DIR="$HOME/.windsurf/rules"
28
- WINDSURF_SKILLS_DIR="$HOME/.codeium/windsurf/skills"
29
- OPENCODE_AGENTS_DIR="$HOME/.config/opencode/agents"
30
- CODEX_HOME_DIR="${CODEX_HOME:-$HOME/.codex}"
31
- CODEX_SKILLS_DIR="$CODEX_HOME_DIR/skills"
32
-
33
- # --- Stale file cleanup (marker-based) ---
34
-
35
- cleanup_managed() {
36
- local dir="$1"
37
- [[ -d "$dir" ]] || return 0
38
- grep -rl "$MANAGED_MARKER" "$dir" 2>/dev/null | while read -r f; do
39
- rm -f "$f"
40
- local parent; parent="$(dirname "$f")"
41
- [[ "$parent" != "$dir" ]] && rmdir "$parent" 2>/dev/null || true
42
- echo " Removed: $f"
43
- done
44
- }
45
-
46
- # --- Install functions (copy from compiled/ output) ---
47
-
48
- COMPILED_DIR="$SKILL_DIR/compiled"
49
-
50
- install_claude() {
51
- local skill_name="$1"
52
- local src="$COMPILED_DIR/claude/${skill_name}/SKILL.md"
53
- local dest_dir="$CLAUDE_SKILLS_DIR/${skill_name}"
54
- mkdir -p "$dest_dir"
55
- cp "$src" "$dest_dir/SKILL.md"
56
- echo " Claude: $dest_dir/SKILL.md"
57
- }
58
-
59
- install_cursor() {
60
- local skill_name="$1"
61
- local src="$COMPILED_DIR/cursor/rules/${skill_name}.mdc"
62
- mkdir -p "$CURSOR_RULES_DIR"
63
- cp "$src" "$CURSOR_RULES_DIR/${skill_name}.mdc"
64
- echo " Cursor (rule): $CURSOR_RULES_DIR/${skill_name}.mdc"
65
- local src2="$COMPILED_DIR/cursor/skills/${skill_name}/SKILL.md"
66
- local dest_dir="$CURSOR_SKILLS_DIR/${skill_name}"
67
- mkdir -p "$dest_dir"
68
- cp "$src2" "$dest_dir/SKILL.md"
69
- echo " Cursor (skill): $dest_dir/SKILL.md"
70
- }
71
-
72
- install_windsurf() {
73
- local skill_name="$1"
74
- local src="$COMPILED_DIR/windsurf/rules/${skill_name}.md"
75
- mkdir -p "$WINDSURF_RULES_DIR"
76
- cp "$src" "$WINDSURF_RULES_DIR/${skill_name}.md"
77
- echo " Windsurf (rule): $WINDSURF_RULES_DIR/${skill_name}.md"
78
- local src2="$COMPILED_DIR/windsurf/skills/${skill_name}/SKILL.md"
79
- local dest_dir="$WINDSURF_SKILLS_DIR/${skill_name}"
80
- mkdir -p "$dest_dir"
81
- cp "$src2" "$dest_dir/SKILL.md"
82
- echo " Windsurf (skill): $dest_dir/SKILL.md"
83
- }
84
-
85
- install_opencode() {
86
- local skill_name="$1"
87
- local src="$COMPILED_DIR/opencode/${skill_name}.md"
88
- mkdir -p "$OPENCODE_AGENTS_DIR"
89
- cp "$src" "$OPENCODE_AGENTS_DIR/${skill_name}.md"
90
- echo " OpenCode: $OPENCODE_AGENTS_DIR/${skill_name}.md"
91
- }
92
-
93
- install_codex() {
94
- local skill_name="$1"
95
- local src="$COMPILED_DIR/codex/${skill_name}/SKILL.md"
96
- local dest_dir="$CODEX_SKILLS_DIR/${skill_name}"
97
- mkdir -p "$dest_dir"
98
- cp "$src" "$dest_dir/SKILL.md"
99
- echo " Codex: $dest_dir/SKILL.md"
100
- }
101
-
102
- # --- Uninstall ---
103
-
104
- uninstall_claude() { for skill in "${SKILLS[@]}"; do rm -rf "$CLAUDE_SKILLS_DIR/$skill"; done; echo " Claude: removed"; }
105
- uninstall_cursor() { for skill in "${SKILLS[@]}"; do rm -f "$CURSOR_RULES_DIR/${skill}.mdc"; rm -rf "$CURSOR_SKILLS_DIR/$skill"; done; echo " Cursor: removed"; }
106
- uninstall_windsurf() { for skill in "${SKILLS[@]}"; do rm -f "$WINDSURF_RULES_DIR/${skill}.md"; rm -rf "$WINDSURF_SKILLS_DIR/$skill"; done; echo " Windsurf: removed"; }
107
- uninstall_opencode() { for skill in "${SKILLS[@]}"; do rm -f "$OPENCODE_AGENTS_DIR/${skill}.md"; done; echo " OpenCode: removed"; }
108
- uninstall_codex() { for skill in "${SKILLS[@]}"; do rm -rf "$CODEX_SKILLS_DIR/$skill"; done; echo " Codex: removed"; }
109
-
110
- # --- Auto-detection ---
111
-
112
- detect_editors() {
113
- local detected=()
114
- [[ -d "$HOME/.claude" ]] && detected+=("claude")
115
- [[ -d "$HOME/.cursor" ]] && detected+=("cursor")
116
- [[ -d "$HOME/.windsurf" || -d "$HOME/.codeium/windsurf" ]] && detected+=("windsurf")
117
- [[ -d "$HOME/.config/opencode" || -d "$HOME/.opencode" ]] && detected+=("opencode")
118
- [[ -n "${CODEX_HOME:-}" || -d "$CODEX_HOME_DIR" ]] && detected+=("codex")
119
- echo "${detected[@]}"
120
- }
121
-
122
- # --- CLI parsing ---
123
-
124
- TARGETS=()
125
- DO_BUILD=true
126
- DO_UNINSTALL=false
127
- DO_COMPILE_ONLY=false
128
-
129
- while [[ $# -gt 0 ]]; do
130
- case "$1" in
131
- --claude) TARGETS+=("claude"); shift ;;
132
- --cursor) TARGETS+=("cursor"); shift ;;
133
- --windsurf) TARGETS+=("windsurf"); shift ;;
134
- --opencode) TARGETS+=("opencode"); shift ;;
135
- --codex) TARGETS+=("codex"); shift ;;
136
- --all) TARGETS=("claude" "cursor" "windsurf" "opencode" "codex"); shift ;;
137
- --skills-only) DO_BUILD=false; shift ;;
138
- --uninstall) DO_UNINSTALL=true; shift ;;
139
- --compile-only) DO_COMPILE_ONLY=true; shift ;;
140
- --help|-h)
141
- echo "Usage: bash install-local.sh [options]"
142
- echo ""
143
- echo "Options:"
144
- echo " --claude Install skills for Claude Code"
145
- echo " --cursor Install skills for Cursor"
146
- echo " --windsurf Install skills for Windsurf"
147
- echo " --opencode Install skills for OpenCode"
148
- echo " --codex Install skills for Codex"
149
- echo " --all Install for all five tools"
150
- echo " --skills-only Skip npm install/build/link (just copy skills)"
151
- echo " --uninstall Remove installed skills from target tools"
152
- echo " --compile-only Generate compiled/ output directory (no install)"
153
- echo " -h, --help Show this help"
154
- echo ""
155
- echo "No flags = auto-detect installed tools."
156
- exit 0
157
- ;;
158
- *)
159
- echo "Unknown option: $1"
160
- echo "Run: bash install-local.sh --help"
161
- exit 1
162
- ;;
163
- esac
164
- done
165
-
166
- # --- Compile-only path ---
167
-
168
- if [[ "$DO_COMPILE_ONLY" == true ]]; then
169
- echo "==> Delegating to compile.mjs..."
170
- node "$SKILL_DIR/skill/build/compile.mjs"
171
- exit $?
172
- fi
173
-
174
- # Auto-detect if no targets specified
175
- if [[ ${#TARGETS[@]} -eq 0 ]]; then
176
- read -ra TARGETS <<< "$(detect_editors)"
177
- fi
178
-
179
- if [[ ${#TARGETS[@]} -eq 0 ]]; then
180
- echo "ERROR: No supported tools detected. Use --claude, --cursor, --windsurf, --opencode, or --codex."
181
- exit 1
182
- fi
183
-
184
- # --- Uninstall path ---
185
-
186
- if [[ "$DO_UNINSTALL" == true ]]; then
187
- echo "==> Uninstalling $PROJECT_NAME"
188
- echo " Targets: ${TARGETS[*]}"
189
- echo ""
190
- for target in "${TARGETS[@]}"; do
191
- "uninstall_${target}"
192
- done
193
-
194
- echo "--> Removing $CLI_BIN_NAME CLI..."
195
- npm unlink "$PROJECT_NAME" 2>/dev/null || true
196
- hash -r 2>/dev/null || true
197
- if command -v "$CLI_BIN_NAME" &>/dev/null; then
198
- echo " WARNING: $CLI_BIN_NAME still in PATH at $(which "$CLI_BIN_NAME")"
199
- else
200
- echo " $CLI_BIN_NAME removed"
201
- fi
202
-
203
- echo ""
204
- echo "==> Done. Skills and CLI removed."
205
- exit 0
206
- fi
207
-
208
- # --- Install path ---
209
-
210
- echo "==> $PROJECT_NAME setup"
211
- echo " Project: $SKILL_DIR"
212
- echo " Targets: ${TARGETS[*]}"
213
- echo ""
214
-
215
- if [[ "$DO_BUILD" == true ]]; then
216
- echo "--> Installing dependencies..."
217
- npm install
218
-
219
- echo "--> Cleaning previous build..."
220
- rm -rf "$SKILL_DIR/dist"
221
-
222
- echo "--> Building TypeScript..."
223
- npm run build
224
- chmod +x "$SKILL_DIR/dist/cli/index.js"
225
-
226
- echo "--> Compiling skills..."
227
- npm run compile
228
-
229
- echo "--> Installing $CLI_BIN_NAME CLI globally..."
230
- npm link
231
-
232
- NPM_BIN="$(npm prefix -g)/bin"
233
- if [[ -x "$NPM_BIN/$CLI_BIN_NAME" ]]; then
234
- echo " $CLI_BIN_NAME: $NPM_BIN/$CLI_BIN_NAME"
235
- echo " version: $("$NPM_BIN/$CLI_BIN_NAME" --version 2>/dev/null || echo 'unknown')"
236
- else
237
- echo " WARNING: $CLI_BIN_NAME not found in $NPM_BIN after npm link."
238
- echo " Try running: npm link"
239
- fi
240
- fi
241
-
242
- echo "--> Cleaning stale $PROJECT_NAME files..."
243
- for target in "${TARGETS[@]}"; do
244
- case "$target" in
245
- claude) cleanup_managed "$CLAUDE_SKILLS_DIR" ;;
246
- cursor) cleanup_managed "$CURSOR_RULES_DIR"; cleanup_managed "$CURSOR_SKILLS_DIR" ;;
247
- windsurf) cleanup_managed "$WINDSURF_RULES_DIR"; cleanup_managed "$WINDSURF_SKILLS_DIR" ;;
248
- opencode) cleanup_managed "$OPENCODE_AGENTS_DIR" ;;
249
- codex) cleanup_managed "$CODEX_SKILLS_DIR" ;;
250
- esac
251
- done
252
-
253
- echo "--> Installing skills..."
254
- for skill in "${SKILLS[@]}"; do
255
- echo " ${skill}:"
256
- for target in "${TARGETS[@]}"; do
257
- "install_${target}" "$skill"
258
- done
259
- done
260
-
261
- echo ""
262
- echo "==> Done."
263
- echo ""
264
- echo "Skills installed for: ${TARGETS[*]}"
265
- echo "CLI available as: $CLI_BIN_NAME"
package/install.ps1 DELETED
@@ -1,48 +0,0 @@
1
- $ErrorActionPreference = 'Stop'
2
-
3
- $PackageName = if ($env:SKILLMILL_PACKAGE_NAME) { $env:SKILLMILL_PACKAGE_NAME } else { 'agentic-skill-mill' }
4
- $PackageVersion = if ($env:SKILLMILL_PACKAGE_VERSION) { $env:SKILLMILL_PACKAGE_VERSION } else { 'latest' }
5
-
6
- if ($args.Count -gt 0 -and ($args[0] -eq '--help' -or $args[0] -eq '-h')) {
7
- Write-Host 'Usage: powershell -ExecutionPolicy Bypass -File .\install.ps1 [tool flags]'
8
- Write-Host ''
9
- Write-Host "This script installs ${PackageName}@${PackageVersion} globally and then"
10
- Write-Host 'runs install-local.ps1 --skills-only with the flags you provide.'
11
- Write-Host ''
12
- Write-Host 'Examples:'
13
- Write-Host ' powershell -ExecutionPolicy Bypass -File .\install.ps1 --all'
14
- Write-Host ' powershell -ExecutionPolicy Bypass -File .\install.ps1 --cursor'
15
- Write-Host ''
16
- Write-Host 'Environment overrides:'
17
- Write-Host ' SKILLMILL_PACKAGE_NAME Package to install (default: agentic-skill-mill)'
18
- Write-Host ' SKILLMILL_PACKAGE_VERSION Version tag (default: latest)'
19
- exit 0
20
- }
21
-
22
- Write-Host "==> Installing utility library: ${PackageName}@${PackageVersion}"
23
- & npm install -g "${PackageName}@${PackageVersion}"
24
- if ($LASTEXITCODE -ne 0) {
25
- throw 'npm install -g failed.'
26
- }
27
-
28
- $globalNodeModules = (& npm root -g).Trim()
29
- if ($LASTEXITCODE -ne 0 -or -not $globalNodeModules) {
30
- throw 'Failed to resolve npm global node_modules directory.'
31
- }
32
-
33
- $packageDir = Join-Path $globalNodeModules $PackageName
34
- $localInstaller = Join-Path $packageDir 'install-local.ps1'
35
-
36
- if (-not (Test-Path -LiteralPath $localInstaller -PathType Leaf)) {
37
- throw "ERROR: Could not find install-local.ps1 at: $localInstaller`nCheck the package 'files' list to ensure install-local.ps1 is published."
38
- }
39
-
40
- Write-Host '==> Installing skills via local installer (skills-only mode)'
41
- & powershell -ExecutionPolicy Bypass -File $localInstaller --skills-only @args
42
- if ($LASTEXITCODE -ne 0) {
43
- throw 'The local PowerShell installer failed.'
44
- }
45
-
46
- Write-Host ''
47
- Write-Host '==> Done.'
48
- Write-Host 'Utility and skills installed.'