From 066033e79d7800916bc60baaa69ae8870efc620a Mon Sep 17 00:00:00 2001 From: Yoni Melki Date: Tue, 25 Aug 2026 22:37:08 +0300 Subject: [PATCH 1/2] AX-2170 - Remove plugin versions from READMEs Versions live in manifests, tags, and GitHub Releases. CI now fails if READMEs reintroduce version strings. Co-authored-by: Cursor --- .github/workflows/validate.yml | 5 ++ README.md | 7 +-- scripts/validate-readme-no-version.mjs | 78 ++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 scripts/validate-readme-no-version.mjs diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 6b3d491..158c8be 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -23,6 +23,11 @@ jobs: - name: Validate plugin layout run: node scripts/validate-claude-plugin.mjs + - name: Validate README has no plugin version + env: + PLUGIN_MANIFEST: .claude-plugin/plugin.json + run: node scripts/validate-readme-no-version.mjs + - name: Run MCP rewrite hook unit tests run: node --test scripts/claude-mcp-json-discover.test.mjs scripts/claude-align-mcp-json.test.mjs scripts/rewrite-mcp-json.test.mjs scripts/agent-guard-check.test.mjs - name: Validate the skill-enforcement hook diff --git a/README.md b/README.md index e3a5809..8bd6089 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Before installing, make sure you have: - **Claude Code CLI** (≥ 1.0) — The Claude Code CLI. - **Node.js** (≥ 18) — with `npx` on your `PATH` (used by the Agent Guard). Without it Skill Governance cannot run, and governed actions are allowed unchecked. - **Git Bash on Windows** — the Skill Governance hook runs as a Bash command so that it behaves identically on every platform. Install [Git for Windows](https://git-scm.com/downloads/win); without it the hook cannot run and governed actions are allowed unchecked. Not needed on macOS or Linux. -- **Skill runtime requirements** — `jf` CLI, `jq`, and `curl` on `PATH`, plus a configured JFrog instance. For the minimum versions, see the upstream skills [`Requirements`](https://github.com/jfrog/jfrog-skills/blob/v0.11.0/README.md#requirements). Configure the CLI with `jf config add` — see [Authentication](#authentication). +- **Skill runtime requirements** — `jf` CLI, `jq`, and `curl` on `PATH`, plus a configured JFrog instance. For the minimum versions, see the upstream skills [`Requirements`](https://github.com/jfrog/jfrog-skills/blob/main/README.md#requirements). Configure the CLI with `jf config add` — see [Authentication](#authentication). - **JFrog AI Catalog** (optional) — If you want to use the Agent Guard feature, your JFrog subscription needs to include the AI Catalog entitlement. Contact your JFrog account team if you're unsure whether it's enabled. - **JFrog CLI ≥ 2.105.0** (optional) — If you want the Agent Guard to auto-resolve the credentials/server ID from the JFrog CLI configuration. Older CLIs don't support the `--format` flag used by `jf config show` for this. - **JFrog project** (optional) — If you want to use the Agent Guard feature. @@ -228,7 +228,7 @@ For Agent Guard / MCP Registry issues, see the [JFrog MCP Registry troubleshooti The `skills/` tree is vendored from [`jfrog/jfrog-skills`](https://github.com/jfrog/jfrog-skills) at the version pinned in [`.github/scripts/sync-skills-vendor.json`](.github/scripts/sync-skills-vendor.json). To pull a newer upstream release into this repo: -1. Bump `pin` in `.github/scripts/sync-skills-vendor.json` to the new tag (e.g. `v0.12.0`). +1. Bump `pin` in `.github/scripts/sync-skills-vendor.json` to the new upstream tag. 2. Run the sync script from the repo root: ```bash @@ -237,8 +237,7 @@ The `skills/` tree is vendored from [`jfrog/jfrog-skills`](https://github.com/jf It downloads the pinned tarball from `codeload.github.com`, extracts it, and replaces the directories listed in `paths` (today: `skills/`). 3. Bump `version` in [`.claude-plugin/plugin.json`](.claude-plugin/plugin.json) so users actually receive the update — Claude Code skips installs whose resolved version hasn't changed. -4. Update the pinned-version link in the [Prerequisites](#prerequisites) section so the skill runtime requirements point at the new tag. -5. Commit the pin bump, the regenerated `skills/` tree, the version bump, and the README link bump together, and open a PR. +4. Commit the pin bump, the regenerated `skills/` tree, and the version bump together, and open a PR. See [`VENDOR.md`](VENDOR.md) for the full picture. diff --git a/scripts/validate-readme-no-version.mjs b/scripts/validate-readme-no-version.mjs new file mode 100644 index 0000000..513ce95 --- /dev/null +++ b/scripts/validate-readme-no-version.mjs @@ -0,0 +1,78 @@ +#!/usr/bin/env node + +// Copyright (c) JFrog Ltd. 2026 +// Licensed under the Apache License, Version 2.0 +// https://www.apache.org/licenses/LICENSE-2.0 + +import { readFileSync, existsSync } from "node:fs"; +import process from "node:process"; + +const docPaths = (process.env.DOCS || process.env.README_PATH || "README.md") + .split(/\s+/) + .filter(Boolean); + +const errors = []; + +for (const docPath of docPaths) { + const content = readFileSync(docPath, "utf8"); + validateDoc(docPath, content, errors); +} + +function validateDoc(docPath, content, errors) { + +const bannedPatterns = [ + { + re: /current version/i, + msg: 'README must not include a "Current version" callout — use GitHub Releases/tags.', + }, + { + re: /^## Versioning\s*$/m, + msg: 'README must not include a "## Versioning" section — versions live in the manifest and GitHub Releases.', + }, + { + re: /then tag \(for example `v/i, + msg: "README must not include example release tags.", + }, + { + re: /github\.com\/jfrog\/jfrog-skills\/blob\/v\d+\.\d+\.\d+/i, + msg: "README must not pin jfrog-skills doc links to a release tag — use main README or sync-skills-vendor.json.", + }, + { + re: /codeload\.github\.com\/jfrog\/jfrog-skills\/(tar\.gz|zip)\/v\d+\.\d+\.\d+/i, + msg: "README must not embed jfrog-skills release tags in download URLs.", + }, +]; + + for (const { re, msg } of bannedPatterns) { + if (re.test(content)) { + errors.push(`${docPath}: ${msg}`); + } + } + + const manifestPath = process.env.PLUGIN_MANIFEST; + if (docPath.endsWith("README.md") && manifestPath && existsSync(manifestPath)) { + let version; + if (manifestPath.endsWith(".json")) { + version = JSON.parse(readFileSync(manifestPath, "utf8")).version; + } else if (manifestPath.endsWith("gradle.properties")) { + const match = readFileSync(manifestPath, "utf8").match(/^version\s*=\s*(.+)$/m); + version = match?.[1]?.trim(); + } + + if (version && content.includes(version)) { + errors.push( + `${docPath}: contains plugin version "${version}" — authoritative source is ${manifestPath}.` + ); + } + } +} + +if (errors.length > 0) { + console.error("README version validation failed:"); + for (const error of errors) { + console.error(`- ${error}`); + } + process.exit(1); +} + +console.log("README version validation passed."); From 047efc3e518515fe0546202c8c70e0e92f8fdf95 Mon Sep 17 00:00:00 2001 From: Yoni Melki Date: Mon, 31 Aug 2026 23:57:15 +0300 Subject: [PATCH 2/2] AX-2170 - Drop README version tests and leftover pin-sync machinery README prose checks are a maintenance trap. Vendor docs now name the authoritative pin and version sources. Co-authored-by: Cursor --- .github/workflows/validate.yml | 5 -- VENDOR.md | 3 + scripts/validate-readme-no-version.mjs | 78 -------------------------- 3 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 scripts/validate-readme-no-version.mjs diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 158c8be..6b3d491 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -23,11 +23,6 @@ jobs: - name: Validate plugin layout run: node scripts/validate-claude-plugin.mjs - - name: Validate README has no plugin version - env: - PLUGIN_MANIFEST: .claude-plugin/plugin.json - run: node scripts/validate-readme-no-version.mjs - - name: Run MCP rewrite hook unit tests run: node --test scripts/claude-mcp-json-discover.test.mjs scripts/claude-align-mcp-json.test.mjs scripts/rewrite-mcp-json.test.mjs scripts/agent-guard-check.test.mjs - name: Validate the skill-enforcement hook diff --git a/VENDOR.md b/VENDOR.md index 4f4ade6..53fdb10 100644 --- a/VENDOR.md +++ b/VENDOR.md @@ -6,9 +6,12 @@ The skill packages under `skills/` are vendored from **[jfrog/jfrog-skills](http | --- | --- | | **Repository** | https://github.com/jfrog/jfrog-skills | | **Pinned release** | see `pin` in [`.github/scripts/sync-skills-vendor.json`](.github/scripts/sync-skills-vendor.json) | +| **Plugin version** | see `version` in [`.claude-plugin/plugin.json`](.claude-plugin/plugin.json) | Included directories: `jfrog/`, `jfrog-ai-catalog-skills/`, `jfrog-package-curation/`, `jfrog-reference-architecture/`, `jfrog-setup-package-managers/` (as of the pinned release). +The README deliberately omits release numbers. The manifest and GitHub tags/releases are the authoritative plugin-version sources; the vendor configuration is the authoritative skills pin. + ## Refreshing When the upstream repo publishes a new release, refresh the vendored tree via a PR that: diff --git a/scripts/validate-readme-no-version.mjs b/scripts/validate-readme-no-version.mjs deleted file mode 100644 index 513ce95..0000000 --- a/scripts/validate-readme-no-version.mjs +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env node - -// Copyright (c) JFrog Ltd. 2026 -// Licensed under the Apache License, Version 2.0 -// https://www.apache.org/licenses/LICENSE-2.0 - -import { readFileSync, existsSync } from "node:fs"; -import process from "node:process"; - -const docPaths = (process.env.DOCS || process.env.README_PATH || "README.md") - .split(/\s+/) - .filter(Boolean); - -const errors = []; - -for (const docPath of docPaths) { - const content = readFileSync(docPath, "utf8"); - validateDoc(docPath, content, errors); -} - -function validateDoc(docPath, content, errors) { - -const bannedPatterns = [ - { - re: /current version/i, - msg: 'README must not include a "Current version" callout — use GitHub Releases/tags.', - }, - { - re: /^## Versioning\s*$/m, - msg: 'README must not include a "## Versioning" section — versions live in the manifest and GitHub Releases.', - }, - { - re: /then tag \(for example `v/i, - msg: "README must not include example release tags.", - }, - { - re: /github\.com\/jfrog\/jfrog-skills\/blob\/v\d+\.\d+\.\d+/i, - msg: "README must not pin jfrog-skills doc links to a release tag — use main README or sync-skills-vendor.json.", - }, - { - re: /codeload\.github\.com\/jfrog\/jfrog-skills\/(tar\.gz|zip)\/v\d+\.\d+\.\d+/i, - msg: "README must not embed jfrog-skills release tags in download URLs.", - }, -]; - - for (const { re, msg } of bannedPatterns) { - if (re.test(content)) { - errors.push(`${docPath}: ${msg}`); - } - } - - const manifestPath = process.env.PLUGIN_MANIFEST; - if (docPath.endsWith("README.md") && manifestPath && existsSync(manifestPath)) { - let version; - if (manifestPath.endsWith(".json")) { - version = JSON.parse(readFileSync(manifestPath, "utf8")).version; - } else if (manifestPath.endsWith("gradle.properties")) { - const match = readFileSync(manifestPath, "utf8").match(/^version\s*=\s*(.+)$/m); - version = match?.[1]?.trim(); - } - - if (version && content.includes(version)) { - errors.push( - `${docPath}: contains plugin version "${version}" — authoritative source is ${manifestPath}.` - ); - } - } -} - -if (errors.length > 0) { - console.error("README version validation failed:"); - for (const error of errors) { - console.error(`- ${error}`); - } - process.exit(1); -} - -console.log("README version validation passed.");