From 6edaf5231f72e3b40e4c6789857c9dc35e29b850 Mon Sep 17 00:00:00 2001 From: tommy0103 Date: Sat, 11 Jul 2026 16:18:43 +0800 Subject: [PATCH] ci: auto-publish skill artifact to tommy0103/obelisk-skill on push to main (Phase 7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a GitHub Actions workflow that builds the readable, non-bundled skill artifact (`npm run build:skill`) and force-pushes it to the dedicated tommy0103/obelisk-skill public repo whenever the main branch is updated. The skill repo is a pure derivative — no manual commits, no PRs; the source of truth stays in tommy0103/obelisk. - .github/workflows/publish-skill.yml: checkout → npm ci → build:skill → clone skill repo → replace content → commit + force push. Auth via SKILL_REPO_DEPLOY_KEY (SSH deploy key with write access to obelisk-skill). - packaging/skill-README.md: the README placed in the skill repo (install instructions + link back to source + "auto-published, don't PR here"). - packaging/skill-LICENSE: MIT license for the skill artifact (relicensed from the AGPL-3.0 source by the copyright holder). - packaging/publish-skill.sh: local convenience script for manual publish. - packaging/skill-package.json: license field updated to MIT. - README.md: install command updated to tommy0103/obelisk-skill. - package.json: add publish:skill script. The skill repo is MIT-licensed for zero adoption friction (local tool, no library API, no derivative works expected); the source repo stays AGPL-3.0. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/publish-skill.yml | 54 +++++++++++++++++++++++++++++ README.md | 2 +- package.json | 3 +- packaging/publish-skill.sh | 21 +++++++++++ packaging/skill-LICENSE | 21 +++++++++++ packaging/skill-README.md | 29 ++++++++++++++++ packaging/skill-package.json | 2 +- 7 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-skill.yml create mode 100755 packaging/publish-skill.sh create mode 100644 packaging/skill-LICENSE create mode 100644 packaging/skill-README.md diff --git a/.github/workflows/publish-skill.yml b/.github/workflows/publish-skill.yml new file mode 100644 index 0000000..dd983fa --- /dev/null +++ b/.github/workflows/publish-skill.yml @@ -0,0 +1,54 @@ +name: Publish Skill + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + + - run: npm ci + + - run: npm run build:skill + + - name: Push to obelisk-skill + env: + DEPLOY_KEY: ${{ secrets.SKILL_REPO_DEPLOY_KEY }} + run: | + set -euo pipefail + mkdir -p ~/.ssh + echo "$DEPLOY_KEY" > ~/.ssh/skill_deploy + chmod 600 ~/.ssh/skill_deploy + export GIT_SSH_COMMAND="ssh -i ~/.ssh/skill_deploy -o StrictHostKeyChecking=no" + + SKILL_DIR=$(mktemp -d) + git clone --depth 1 git@github.com:tommy0103/obelisk-skill.git "$SKILL_DIR" || { + # First push: init an empty repo + git init "$SKILL_DIR" + git -C "$SKILL_DIR" remote add origin git@github.com:tommy0103/obelisk-skill.git + } + + # Replace all content with the fresh build + find "$SKILL_DIR" -mindepth 1 -not -path "$SKILL_DIR/.git*" -delete + cp -R dist/obelisk-skill/* "$SKILL_DIR/" + cp packaging/skill-README.md "$SKILL_DIR/README.md" + cp packaging/skill-LICENSE "$SKILL_DIR/LICENSE" + + cd "$SKILL_DIR" + git add -A + if git diff --cached --quiet; then + echo "No changes to publish" + exit 0 + fi + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git commit -m "publish: $(date -u +%Y-%m-%dT%H:%M:%SZ) from tommy0103/obelisk@${GITHUB_SHA::7}" + git push --force origin HEAD:main diff --git a/README.md b/README.md index dce23b7..4978ba2 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Anything Claude Code has done before -- sessions, tool calls, subagents, workflo ## Install ```bash -npx skills add tommy0103/obelisk +npx skills add tommy0103/obelisk-skill ``` Or manually: copy `obelisk/` into your project's `.claude/skills/`. diff --git a/package.json b/package.json index c519eed..048e176 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "typecheck": "tsc --noEmit && tsc --noEmit -p app/tsconfig.json", "lint": "eslint .", "build:core": "rm -rf dist && tsc -p tsconfig.build.json", - "build:skill": "rm -rf dist/obelisk-skill && tsc -p tsconfig.skill.json && cp scripts/schema.sql dist/obelisk-skill/scripts/ && cp SKILL.md dist/obelisk-skill/ && cp -R references dist/obelisk-skill/references && cp packaging/skill-package.json dist/obelisk-skill/package.json" + "build:skill": "rm -rf dist/obelisk-skill && tsc -p tsconfig.skill.json && cp scripts/schema.sql dist/obelisk-skill/scripts/ && cp SKILL.md dist/obelisk-skill/ && cp -R references dist/obelisk-skill/references && cp packaging/skill-package.json dist/obelisk-skill/package.json", + "publish:skill": "npm run build:skill && packaging/publish-skill.sh" }, "devDependencies": { "@eslint/js": "^10.0.1", diff --git a/packaging/publish-skill.sh b/packaging/publish-skill.sh new file mode 100755 index 0000000..91ecc65 --- /dev/null +++ b/packaging/publish-skill.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +SKILL_DIR="dist/obelisk-skill" +REMOTE="git@github.com:tommy0103/obelisk-skill.git" + +if [ ! -d "$SKILL_DIR/scripts" ]; then + echo "Error: run 'npm run build:skill' first" >&2 + exit 1 +fi + +cp packaging/skill-README.md "$SKILL_DIR/README.md" +cp packaging/skill-LICENSE "$SKILL_DIR/LICENSE" + +cd "$SKILL_DIR" +rm -rf .git +git init +git remote add origin "$REMOTE" +git add -A +git commit -m "publish: $(date -u +%Y-%m-%dT%H:%M:%SZ)" +git push --force origin HEAD:main diff --git a/packaging/skill-LICENSE b/packaging/skill-LICENSE new file mode 100644 index 0000000..9bb811e --- /dev/null +++ b/packaging/skill-LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025–2026 tommy0103 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packaging/skill-README.md b/packaging/skill-README.md new file mode 100644 index 0000000..f614d0a --- /dev/null +++ b/packaging/skill-README.md @@ -0,0 +1,29 @@ +# Obelisk Skill + +Explicit memory infrastructure for coding agents — a queryable SQLite evidence +layer over local Claude Code and Codex session history. + +## Install + +```bash +npx skills add tommy0103/obelisk-skill +``` + +Then in any Claude Code session: + +``` +/obelisk +``` + +## Source + +This repository is **auto-published** from the compiled skill artifact of +[tommy0103/obelisk](https://github.com/tommy0103/obelisk). Do not open pull +requests here — contribute to the source repo instead. + +## License + +MIT — see [LICENSE](LICENSE) in this repository. The +[source repository](https://github.com/tommy0103/obelisk) is AGPL-3.0; this +compiled skill artifact is explicitly relicensed under MIT by the copyright +holder. diff --git a/packaging/skill-package.json b/packaging/skill-package.json index 26c41a6..885c1b7 100644 --- a/packaging/skill-package.json +++ b/packaging/skill-package.json @@ -3,5 +3,5 @@ "version": "0.1.0", "type": "module", "description": "Obelisk skill artifact — readable compiled Core (providers + persist + runtime) over local Claude Code and Codex history. Built by `npm run build:skill`; sources live in the main repo.", - "license": "AGPL-3.0" + "license": "MIT" }