From f864655848b8e20ed0c3fa36f04071aa6769a74b Mon Sep 17 00:00:00 2001 From: Mohsen Azimi <543633+mohsen1@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:27:05 +0100 Subject: [PATCH 1/2] Verify published skills without rewriting the repository --- .github/workflows/sync.yml | 60 ------------------------------------ .github/workflows/verify.yml | 36 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/sync.yml create mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml deleted file mode 100644 index d16b092..0000000 --- a/.github/workflows/sync.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Every hour, replace this repository's tree, except .github/, with the one -# proofline.sh publishes at /.well-known/agent-skills/repository.json. The -# marketing site builds that file from the monorepo on each deployment, so a -# merged skill change reaches this repository within an hour of its deployment. -# The job writes with this repository's own token and holds no other credential. -name: Sync - -on: - schedule: - - cron: "17 * * * *" - workflow_dispatch: - -permissions: - contents: write - -concurrency: - group: sync - cancel-in-progress: false - -jobs: - sync: - runs-on: ubuntu-24.04 - timeout-minutes: 5 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Replace the tree with the published one - run: | - curl --fail --silent --show-error --location --retry 3 --max-time 30 \ - --output "$RUNNER_TEMP/repository.json" \ - https://proofline.sh/.well-known/agent-skills/repository.json - python3 - "$RUNNER_TEMP/repository.json" <<'PY' - import json, shutil, sys - from pathlib import Path, PurePosixPath - - files = json.loads(Path(sys.argv[1]).read_text())["files"] - required = {".claude-plugin/marketplace.json", "plugins/proofline/.claude-plugin/plugin.json"} - if not required <= files.keys(): - sys.exit("the published tree has no marketplace or plugin manifest") - for path in files: - parts = PurePosixPath(path).parts - if PurePosixPath(path).is_absolute() or ".." in parts or parts[0] in (".git", ".github"): - sys.exit(f"the published tree names a path it may not write: {path}") - for entry in Path(".").iterdir(): - if entry.name not in (".git", ".github"): - shutil.rmtree(entry) if entry.is_dir() else entry.unlink() - for path, text in files.items(): - Path(path).parent.mkdir(parents=True, exist_ok=True) - Path(path).write_text(text) - PY - - name: Commit a changed tree - run: | - git add --all - if git diff --cached --quiet; then - echo "The repository already matches proofline.sh." - exit 0 - fi - git -c user.name="github-actions[bot]" \ - -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ - commit --quiet --message "Sync from https://proofline.sh" - git push --quiet origin HEAD:main diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..b6ae88c --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,36 @@ +name: Verify published skills + +on: workflow_dispatch + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Compare the checkout with the published skills + run: | + curl --fail --silent --show-error --retry 3 --max-time 30 \ + --output "$RUNNER_TEMP/repository.json" \ + https://proofline.sh/.well-known/agent-skills/repository.json + python3 - "$RUNNER_TEMP/repository.json" <<'PY' + import json + import subprocess + import sys + from pathlib import Path + + files = json.loads(Path(sys.argv[1]).read_bytes())["files"] + tracked = subprocess.check_output(["git", "ls-files", "-z"]).decode().split("\0") + managed = {p for p in tracked if p and p != "AGENTS.md" and not p.startswith(".github/")} + if set(files) != managed: + sys.exit("The published file list differs from the checkout.") + for name in sorted(managed): + path = Path(name) + if path.resolve() != Path.cwd() / name or path.read_bytes() != files[name].encode(): + sys.exit(f"The published file differs from the checkout: {name}") + PY From 916dfe55a07c96d63080d81ac9c252ed528ed3ab Mon Sep 17 00:00:00 2001 From: Mohsen Azimi <543633+mohsen1@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:47:56 +0100 Subject: [PATCH 2/2] Release review command fixes --- .github/scripts/release-command | 31 +++++++++++++ .github/workflows/command-release.yml | 65 +++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/scripts/release-command create mode 100644 .github/workflows/command-release.yml diff --git a/.github/scripts/release-command b/.github/scripts/release-command new file mode 100644 index 0000000..9a96cbb --- /dev/null +++ b/.github/scripts/release-command @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Prepare a patch release for changes to the review command instructions.""" + +import json +import re +import subprocess +from pathlib import Path + +plugin = Path("plugins/proofline/.claude-plugin/plugin.json") +catalog = Path(".claude-plugin/marketplace.json") +command = Path("plugins/proofline/commands/review.md") +released = subprocess.check_output(["git", "log", "-1", "--format=%H", "--", plugin], text=True).strip() +previous = subprocess.check_output(["git", "show", f"{released}:{command}"]) +current = command.read_bytes() +if current == previous: + raise SystemExit(0) +before, after = (data.split(b"---\n", 2) for data in (previous, current)) +if len(before) != 3 or len(after) != 3 or before[:2] != after[:2]: + raise SystemExit("Command metadata changed. Review the command declaration before releasing.") +number = json.loads(plugin.read_bytes())["version"] +if not re.fullmatch(r"(?:0|[1-9][0-9]*)(?:\.(?:0|[1-9][0-9]*)){2}", number): + raise SystemExit("Expected a stable plugin version.") +major, minor, patch = map(int, number.split(".")) +updated = f"{major}.{minor}.{patch + 1}" +for path in (plugin, catalog): + text = path.read_text() + old = f'"version": "{number}"' + if text.count(old) != 1: + raise SystemExit(f"{path} must contain the released version exactly once.") + path.write_text(text.replace(old, f'"version": "{updated}"')) +print(f"Prepared plugin version {updated}.") diff --git a/.github/workflows/command-release.yml b/.github/workflows/command-release.yml new file mode 100644 index 0000000..f6fae19 --- /dev/null +++ b/.github/workflows/command-release.yml @@ -0,0 +1,65 @@ +name: Release command fixes +on: + push: + branches: [main] + paths: [plugins/proofline/commands/review.md] + pull_request: + paths: + - .github/scripts/release-command + - .github/workflows/command-release.yml + - plugins/proofline/commands/review.md + workflow_dispatch: + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - name: Check a command-only release and a repeat run + run: | + git config user.name "Release check" + git config user.email "release-check@users.noreply.github.com" + git switch --detach + command=plugins/proofline/commands/review.md + plugin=plugins/proofline/.claude-plugin/plugin.json + catalog=.claude-plugin/marketplace.json + python3 .github/scripts/release-command + git add "$plugin" "$catalog" + if ! git diff --cached --quiet; then git commit -m "Prepare current command"; fi + printf '\nUse the installed command.\n' >> "$command" + git add "$command" + git commit -m "Exercise a command fix" + python3 .github/scripts/release-command + test "$(git diff --name-only | sort)" = "$(printf '%s\n' "$plugin" "$catalog" | sort)" + git add "$plugin" "$catalog" + git commit -m "Verify the patch version" + python3 .github/scripts/release-command + git diff --exit-code + release: + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + needs: check + concurrency: release-review-command + permissions: + contents: write + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: main + fetch-depth: 0 + persist-credentials: false + - run: python3 .github/scripts/release-command + - name: Publish the updated plugin version + env: + GH_TOKEN: ${{ github.token }} + run: | + git add .claude-plugin/marketplace.json plugins/proofline/.claude-plugin/plugin.json + if git diff --cached --quiet; then exit 0; fi + git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" commit -m "Release review command fix" + git -c credential.helper= -c 'credential.helper=!gh auth git-credential' push origin HEAD:refs/heads/main