From 0988427ebf8652c8529b0ed05630aba3159a72db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 03:22:02 +0000 Subject: [PATCH 1/6] Initial plan From 76240417838c6c19e85f3d9c6eed58e31873de11 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 03:24:55 +0000 Subject: [PATCH 2/6] Add Codex skill installation script and .codex/INSTALL.md Co-authored-by: Vinluo <30505327+Vinluo@users.noreply.github.com> --- .codex/INSTALL.md | 64 ++++++++++++++++++ README.md | 20 +++++- scripts/install-skills-codex.sh | 116 ++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 .codex/INSTALL.md create mode 100755 scripts/install-skills-codex.sh diff --git a/.codex/INSTALL.md b/.codex/INSTALL.md new file mode 100644 index 00000000..f01b9013 --- /dev/null +++ b/.codex/INSTALL.md @@ -0,0 +1,64 @@ +# Installing obsidian-skills for Codex + +This guide explains how to install obsidian-skills using Codex native skill discovery. + +## Quick Install (One-line) + +Run this from anywhere — no need to clone the repo first: + +```bash +tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" +``` + +## Install from Repo Root + +If you have already cloned the repo: + +```bash +./scripts/install-skills-codex.sh +``` + +## What This Does + +- Syncs all skills from `skills/` into `~/.agents/skills/obsidian-skills/` +- Skills are discovered automatically by Codex at next startup + +## Verify + +```bash +ls -la ~/.agents/skills/obsidian-skills +``` + +Expected directories (one per skill): + +- `defuddle` +- `json-canvas` +- `obsidian-bases` +- `obsidian-cli` +- `obsidian-markdown` + +## Options + +```bash +# Preview without writing +./scripts/install-skills-codex.sh --dry-run + +# Custom skills directory +./scripts/install-skills-codex.sh --skills-dir /custom/path/skills/obsidian-skills +``` + +## Update + +Re-run the install script to sync the latest skills: + +```bash +./scripts/install-skills-codex.sh +``` + +Or use the one-line command above to fetch and install the latest version. + +## Uninstall + +```bash +rm -rf ~/.agents/skills/obsidian-skills +``` diff --git a/README.md b/README.md index ce9cacca..c8723631 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,25 @@ Add the contents of this repo to a `/.claude` folder in the root of your Obsidia #### Codex CLI -Copy the `skills/` directory into your Codex skills path (typically `~/.codex/skills`). See the [Agent Skills specification](https://agentskills.io/specification) for the standard skill format. +**Option 1 — Tell Codex to install (recommended):** + +``` +Fetch and follow instructions from https://raw.githubusercontent.com/Vinluo/obsidian-skills/main/.codex/INSTALL.md +``` + +**Option 2 — One-line script install:** + +```bash +tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" +``` + +**Option 3 — From the repo root:** + +```bash +./scripts/install-skills-codex.sh +``` + +This installs all skills into `~/.agents/skills/obsidian-skills/`. Restart Codex to discover them. See [`.codex/INSTALL.md`](.codex/INSTALL.md) for options including `--dry-run` and custom target directories. #### OpenCode diff --git a/scripts/install-skills-codex.sh b/scripts/install-skills-codex.sh new file mode 100755 index 00000000..7605bb34 --- /dev/null +++ b/scripts/install-skills-codex.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +# +# Install obsidian-skills for Codex native skill discovery. +# +# Syncs each skill from skills/ into the Codex skills directory +# (default: ~/.agents/skills/obsidian-skills). +# +# Usage: +# ./scripts/install-skills-codex.sh [options] +# +# Options: +# --skills-dir PATH Target skills directory (default: ~/.agents/skills/obsidian-skills) +# --dry-run Print actions without writing anything +# -h, --help Show this help message +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +SKILLS_DIR="${HOME}/.agents/skills/obsidian-skills" +DRY_RUN="false" + +usage() { + cat <&2 + exit 1 +} + +# Parse arguments +while [[ $# -gt 0 ]]; do + case "$1" in + --skills-dir) + SKILLS_DIR="$2" + shift 2 + ;; + --dry-run) + DRY_RUN="true" + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + die "Unknown option: $1" + ;; + esac +done + +# Validate repo structure +[[ -d "$REPO_ROOT/skills" ]] || die "skills/ directory not found under repo root: $REPO_ROOT" + +# Collect skill names +mapfile -t SKILL_NAMES < <(find "$REPO_ROOT/skills" -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | sort) +[[ ${#SKILL_NAMES[@]} -gt 0 ]] || die "No skills found in $REPO_ROOT/skills" + +sync_skill() { + local skill="$1" + local src="$REPO_ROOT/skills/$skill" + local dst="$SKILLS_DIR/$skill" + + if [[ "$DRY_RUN" == "true" ]]; then + log "DRY-RUN: sync $src -> $dst" + return + fi + + mkdir -p "$dst" + if command -v rsync >/dev/null 2>&1; then + rsync -a --delete "$src/" "$dst/" + else + local tmp_dst + mkdir -p "$(dirname "$dst")" + tmp_dst="$(mktemp -d)" + if cp -a "$src/." "$tmp_dst/"; then + rm -rf "$dst" + mv "$tmp_dst" "$dst" + else + rm -rf "$tmp_dst" + die "Failed to copy $src to $dst" + fi + fi +} + +if [[ "$DRY_RUN" == "true" ]]; then + log "DRY-RUN mode — no files will be written" +fi + +log "Installing obsidian-skills to: $SKILLS_DIR" + +for skill in "${SKILL_NAMES[@]}"; do + log "Syncing skill: $skill" + sync_skill "$skill" +done + +if [[ "$DRY_RUN" == "false" ]]; then + log "Done. Skills installed to: $SKILLS_DIR" + log "Restart Codex to discover the new skills." +fi From bd69509c699e8483898d5b8383eec0417612091c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 03:30:06 +0000 Subject: [PATCH 3/6] Initial plan From b40e6741ecf17750599d41cd230ca0086e368877 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 03:32:31 +0000 Subject: [PATCH 4/6] Add Windows PowerShell install script and update docs with Windows instructions Co-authored-by: Vinluo <30505327+Vinluo@users.noreply.github.com> --- .codex/INSTALL.md | 52 ++++++++++++++++ README.md | 16 +++++ scripts/install-skills-codex.ps1 | 101 +++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 scripts/install-skills-codex.ps1 diff --git a/.codex/INSTALL.md b/.codex/INSTALL.md index f01b9013..3a7e6cbc 100644 --- a/.codex/INSTALL.md +++ b/.codex/INSTALL.md @@ -6,18 +6,34 @@ This guide explains how to install obsidian-skills using Codex native skill disc Run this from anywhere — no need to clone the repo first: +macOS / Linux: + ```bash tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" ``` +Windows (PowerShell): + +```powershell +$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir +``` + ## Install from Repo Root If you have already cloned the repo: +macOS / Linux: + ```bash ./scripts/install-skills-codex.sh ``` +Windows (PowerShell): + +```powershell +.\scripts\install-skills-codex.ps1 +``` + ## What This Does - Syncs all skills from `skills/` into `~/.agents/skills/obsidian-skills/` @@ -25,10 +41,18 @@ If you have already cloned the repo: ## Verify +macOS / Linux: + ```bash ls -la ~/.agents/skills/obsidian-skills ``` +Windows (PowerShell): + +```powershell +Get-ChildItem "$HOME\.agents\skills\obsidian-skills" +``` + Expected directories (one per skill): - `defuddle` @@ -39,6 +63,8 @@ Expected directories (one per skill): ## Options +macOS / Linux: + ```bash # Preview without writing ./scripts/install-skills-codex.sh --dry-run @@ -47,18 +73,44 @@ Expected directories (one per skill): ./scripts/install-skills-codex.sh --skills-dir /custom/path/skills/obsidian-skills ``` +Windows (PowerShell): + +```powershell +# Preview without writing +.\scripts\install-skills-codex.ps1 -DryRun + +# Custom skills directory +.\scripts\install-skills-codex.ps1 -SkillsDir C:\custom\path\skills\obsidian-skills +``` + ## Update Re-run the install script to sync the latest skills: +macOS / Linux: + ```bash ./scripts/install-skills-codex.sh ``` +Windows (PowerShell): + +```powershell +.\scripts\install-skills-codex.ps1 +``` + Or use the one-line command above to fetch and install the latest version. ## Uninstall +macOS / Linux: + ```bash rm -rf ~/.agents/skills/obsidian-skills ``` + +Windows (PowerShell): + +```powershell +Remove-Item -Recurse -Force "$HOME\.agents\skills\obsidian-skills" +``` diff --git a/README.md b/README.md index c8723631..b5ba866d 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,32 @@ Fetch and follow instructions from https://raw.githubusercontent.com/Vinluo/obsi **Option 2 — One-line script install:** +macOS / Linux: + ```bash tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" ``` +Windows (PowerShell): + +```powershell +$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir +``` + **Option 3 — From the repo root:** +macOS / Linux: + ```bash ./scripts/install-skills-codex.sh ``` +Windows (PowerShell): + +```powershell +.\scripts\install-skills-codex.ps1 +``` + This installs all skills into `~/.agents/skills/obsidian-skills/`. Restart Codex to discover them. See [`.codex/INSTALL.md`](.codex/INSTALL.md) for options including `--dry-run` and custom target directories. #### OpenCode diff --git a/scripts/install-skills-codex.ps1 b/scripts/install-skills-codex.ps1 new file mode 100644 index 00000000..05dca220 --- /dev/null +++ b/scripts/install-skills-codex.ps1 @@ -0,0 +1,101 @@ +#Requires -Version 5.1 +<# +.SYNOPSIS + Install obsidian-skills for Codex native skill discovery. + +.DESCRIPTION + Syncs each skill from skills/ into the Codex skills directory + (default: ~/.agents/skills/obsidian-skills). + +.PARAMETER SkillsDir + Target skills directory (default: ~/.agents/skills/obsidian-skills) + +.PARAMETER DryRun + Print actions without writing anything + +.EXAMPLE + .\scripts\install-skills-codex.ps1 + +.EXAMPLE + .\scripts\install-skills-codex.ps1 -SkillsDir C:\custom\path\skills\obsidian-skills + +.EXAMPLE + .\scripts\install-skills-codex.ps1 -DryRun +#> + +param( + [string]$SkillsDir = (Join-Path $HOME '.agents' 'skills' 'obsidian-skills'), + [switch]$DryRun +) + +$ErrorActionPreference = 'Stop' + +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$RepoRoot = Split-Path -Parent $ScriptDir + +function Write-Log { + param([string]$Message) + Write-Host "[install-skills] $Message" +} + +function Invoke-Die { + param([string]$Message) + Write-Error "[install-skills] Error: $Message" + exit 1 +} + +# Validate repo structure +$SkillsSrc = Join-Path $RepoRoot "skills" +if (-not (Test-Path -Path $SkillsSrc -PathType Container)) { + Invoke-Die "skills/ directory not found under repo root: $RepoRoot" +} + +# Collect skill names +$SkillNames = Get-ChildItem -Path $SkillsSrc -Directory | + Sort-Object Name | + Select-Object -ExpandProperty Name + +if ($SkillNames.Count -eq 0) { + Invoke-Die "No skills found in $SkillsSrc" +} + +function Sync-Skill { + param([string]$SkillName) + + $src = Join-Path $SkillsSrc $SkillName + $dst = Join-Path $SkillsDir $SkillName + + if ($DryRun) { + Write-Log "DRY-RUN: sync $src -> $dst" + return + } + + # Ensure destination parent exists + if (-not (Test-Path -Path $dst)) { + New-Item -ItemType Directory -Path $dst -Force | Out-Null + } + + # Copy all items from src to dst, overwriting existing files + Copy-Item -Path (Join-Path $src '*') -Destination $dst -Recurse -Force + + # Remove items in dst that are no longer in src + Get-ChildItem -Path $dst | Where-Object { + -not (Test-Path (Join-Path $src $_.Name)) + } | Remove-Item -Recurse -Force +} + +if ($DryRun) { + Write-Log "DRY-RUN mode — no files will be written" +} + +Write-Log "Installing obsidian-skills to: $SkillsDir" + +foreach ($skill in $SkillNames) { + Write-Log "Syncing skill: $skill" + Sync-Skill -SkillName $skill +} + +if (-not $DryRun) { + Write-Log "Done. Skills installed to: $SkillsDir" + Write-Log "Restart Codex to discover the new skills." +} From 7d8971ea0592a67257fec3a6baf71971c5b34d63 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 03:49:15 +0000 Subject: [PATCH 5/6] Fix Codex install script URLs to point to upstream kepano/obsidian-skills Co-authored-by: Vinluo <30505327+Vinluo@users.noreply.github.com> --- .codex/INSTALL.md | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.codex/INSTALL.md b/.codex/INSTALL.md index 3a7e6cbc..7fc45f5a 100644 --- a/.codex/INSTALL.md +++ b/.codex/INSTALL.md @@ -9,13 +9,13 @@ Run this from anywhere — no need to clone the repo first: macOS / Linux: ```bash -tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" +tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/kepano/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" ``` Windows (PowerShell): ```powershell -$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir +$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/kepano/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir ``` ## Install from Repo Root diff --git a/README.md b/README.md index b5ba866d..ce1f2529 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Add the contents of this repo to a `/.claude` folder in the root of your Obsidia **Option 1 — Tell Codex to install (recommended):** ``` -Fetch and follow instructions from https://raw.githubusercontent.com/Vinluo/obsidian-skills/main/.codex/INSTALL.md +Fetch and follow instructions from https://raw.githubusercontent.com/kepano/obsidian-skills/main/.codex/INSTALL.md ``` **Option 2 — One-line script install:** @@ -36,13 +36,13 @@ Fetch and follow instructions from https://raw.githubusercontent.com/Vinluo/obsi macOS / Linux: ```bash -tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" +tmp_dir="$(mktemp -d)" && git clone --depth 1 https://github.com/kepano/obsidian-skills.git "$tmp_dir/obsidian-skills" && "$tmp_dir/obsidian-skills/scripts/install-skills-codex.sh" && rm -rf "$tmp_dir" ``` Windows (PowerShell): ```powershell -$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/Vinluo/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir +$tmp_dir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()); New-Item -ItemType Directory -Path $tmp_dir | Out-Null; git clone --depth 1 https://github.com/kepano/obsidian-skills.git "$tmp_dir\obsidian-skills"; & "$tmp_dir\obsidian-skills\scripts\install-skills-codex.ps1"; Remove-Item -Recurse -Force $tmp_dir ``` **Option 3 — From the repo root:** From 477f410e43ffbf0c742f5d7d701de2e976eb286d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 05:08:46 +0000 Subject: [PATCH 6/6] Initial plan