-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
61 lines (56 loc) · 2.51 KB
/
Copy pathJustfile
File metadata and controls
61 lines (56 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
claude_manifest := "plugins/thiagowfx/.claude-plugin/plugin.json"
pi_manifest := "package.json"
skills_dir := "plugins/thiagowfx/skills"
# List recipes
default:
@just --list
# Print the current plugin version
version:
@jq -r .version {{ claude_manifest }}
# Update the installed thiagowfx plugin to the latest published version (restart required to apply)
update:
claude plugin marketplace update thiagowfx
claude plugin update thiagowfx@thiagowfx
# Bump the plugin version (level = major | minor | patch)
bump level="patch":
#!/usr/bin/env bash
set -euo pipefail
cur=$(jq -r .version {{ claude_manifest }})
IFS=. read -r major minor patch <<<"$cur"
case "{{ level }}" in
major) major=$((major + 1)); minor=0; patch=0 ;;
minor) minor=$((minor + 1)); patch=0 ;;
patch) patch=$((patch + 1)) ;;
*) echo "level must be major, minor, or patch" >&2; exit 1 ;;
esac
new="$major.$minor.$patch"
tmp=$(mktemp)
jq --arg v "$new" '.version = $v' {{ claude_manifest }} >"$tmp" && mv "$tmp" {{ claude_manifest }}
tmp=$(mktemp)
jq --arg v "$new" '.version = $v' {{ pi_manifest }} >"$tmp" && mv "$tmp" {{ pi_manifest }}
echo "$cur -> $new"
# Scaffold a third-party skill from upstream (e.g. `just vendor-skill mattpocock/skills handoff`)
vendor-skill pkg skill:
#!/usr/bin/env bash
set -euo pipefail
dir="{{ skills_dir }}/{{ skill }}"
if [[ -e "$dir" ]]; then echo "$dir already exists" >&2; exit 1; fi
# Fetch into a tempfile and validate before creating the skill dir, so a failed or
# redesigned upstream fetch never leaves a partial dir behind.
# `skills use` prints a prompt preamble + the SKILL.md fenced block; extract the block.
tmp=$(mktemp)
npx -y skills@latest use "{{ pkg }}@{{ skill }}" \
| sed -n '/^<SKILL.md>$/,/^<\/SKILL.md>$/p' \
| sed '1d;$d' \
> "$tmp"
if [[ ! -s "$tmp" ]]; then echo "fetch produced empty SKILL.md" >&2; exit 1; fi
mkdir -p "$dir"
mv "$tmp" "$dir/SKILL.md"
echo "Scaffolded $dir/SKILL.md from {{ pkg }}@{{ skill }}"
echo
echo "Manual steps remaining:"
echo " 1. Add 'source:' to frontmatter: source: https://github.com/{{ pkg }} (<path>, <LICENSE> © <Author>)"
echo " 2. Make body self-contained — drop refs to helper files / sibling skills not in this repo"
echo " 3. README.md: add skills-table row + provenance paragraph mention"
echo " 4. THIRD_PARTY.md: add bullet under the upstream's heading (+ license notice if new owner)"
echo " 5. just bump"