Created
February 27, 2026 07:03
-
-
Save dodyg/9a69b4adef493f004cdfb00dee1b39bf to your computer and use it in GitHub Desktop.
Install and sync dotnet artisan skills to your project for opencode agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| REPO_URL="https://github.com/novotnyllc/dotnet-artisan" | |
| VENDOR_DIR="$SCRIPT_DIR/vendors/dotnet-artisan" | |
| SKILLS_DIR="$SCRIPT_DIR/skills" | |
| FORCE_UPDATE="${1:-}" | |
| echo "π Syncing dotnet-artisan skills..." | |
| echo "" | |
| if [ -d "$VENDOR_DIR" ]; then | |
| echo "π¦ Updating existing clone..." | |
| (cd "$VENDOR_DIR" && git fetch origin && git reset --hard origin/main) | |
| else | |
| echo "π¦ Cloning dotnet-artisan..." | |
| mkdir -p "$VENDOR_DIR" | |
| git clone --depth 1 "$REPO_URL" "$VENDOR_DIR" | |
| fi | |
| echo "" | |
| echo "π Copying skills to .opencode/skills/..." | |
| mkdir -p "$SKILLS_DIR" | |
| SYNCED=0 | |
| SKIPPED=0 | |
| UPDATED=0 | |
| for skill_dir in "$VENDOR_DIR/skills/"*/; do | |
| skill_name=$(basename "$skill_dir") | |
| target_dir="$SKILLS_DIR/$skill_name" | |
| if [ -d "$target_dir" ] && [ "$FORCE_UPDATE" = "--force" ]; then | |
| rm -rf "$target_dir" | |
| cp -r "$skill_dir" "$SKILLS_DIR/" | |
| echo " β» $skill_name (updated)" | |
| UPDATED=$((UPDATED + 1)) | |
| elif [ -d "$target_dir" ]; then | |
| echo " Β· $skill_name (exists)" | |
| SKIPPED=$((SKIPPED + 1)) | |
| else | |
| cp -r "$skill_dir" "$SKILLS_DIR/" | |
| echo " β $skill_name" | |
| SYNCED=$((SYNCED + 1)) | |
| fi | |
| done | |
| TOTAL=$((SYNCED + SKIPPED + UPDATED)) | |
| echo "" | |
| echo "β Done!" | |
| echo " Total: $TOTAL skills" | |
| echo " New: $SYNCED" | |
| echo " Updated: $UPDATED" | |
| echo " Skipped: $SKIPPED" | |
| echo "" | |
| echo "π Skills location: $SKILLS_DIR" | |
| echo "π‘ Run with --force to update existing skills" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment