Details
# JFrog Plugin for Claude Code
JFrog plugin for [Claude Code](https://claude.com/product/claude-code): artifact management, security scanning, and supply-chain best practices, and Agent Guard.
## Features
The JFrog plugin provides the following capabilities, grouped by component:
| Component | Feature | Description |
| --- | --- | --- |
| **MCP** | JFrog MCP server | Remote JFrog MCP server auto-attached to every session via `.mcp.json` (OAuth, no API keys). Run `/jfrog-init` to set the host. |
| **Skill** | JFrog Platform | Interact with Artifactory repositories, builds, permissions, users, access tokens, projects, release bundles, and platform administration via the JFrog CLI and REST/GraphQL APIs. Also covers security audits, CVE lookups, and Advanced Security exposure queries. |
| **Skill** | Package curation | Check whether npm, Maven, PyPI, Go, and other packages are safe, curated, or allowed, then download them through Artifactory remote caches or curation-aware package managers. |
| **Hook + Skill** | Agent Package Resolution (Preview) | Automatically route packages installed by the AI agent through your organization's JFrog Artifactory, keeping agent-driven installs inside your Curation, Xray, and governance perimeter. |
| **Hook** | Plugin MCP rewrite | On SessionStart / FileChanged, rewrite discovered installed-plugin `.mcp.json` files through Agent Guard (`--rewrite-mcp-json`) so stdio MCP entries launch via `@jfrog/agent-guard`. |
| **Hook** | Skill Governance (Preview) | Evaluates the skills Claude invokes against your organization's JFrog skill governance policies, and blocks the ones that violate them — showing which policies were violated and the command to request a waiver. Enforcement runs in the JFrog Agent Guard; the hook only carries the event to it. |
| **Skill** | Agent Guard | Claude manages MCPs through the JFrog Agent Guard. Through the Agent Guard you can discover, install, configure, update, and remove MCP servers from the JFrog AI Catalog approved for your project, and authenticate to remote HTTP MCPs via OAuth, API key, or bearer token. |
> [!IMPORTANT]
> **Skill Governance blocks on policy, not on infrastructure.** Three outcomes, and they are
> distinct:
>
> - **Your JFrog policies deny the skill** — **blocked**, naming the policies it violated and the
> command to request a waiver.
> - **The Agent Guard runs, but cannot reach a verdict in time** — **blocked**. It got as far as
> the check and could not answer, so it does not guess.
> - **The Agent Guard cannot be *run at all*** — `npx` missing, the registry unreachable, no JFrog
> server configured — **allowed**. A machine that cannot run the guard is not governed by it, and
> blocking there would stop work without enforcing anything.
>
> A user who is entitled to nothing is unaffected either way: the Agent Guard returns "allow" for
> an unconfigured or unentitled user, so no setup is needed to opt out of the feature.
---
## Prerequisites
Before installing, make sure you have:
- **JFrog host URL and access token** — Your JFrog platform URL and a valid access token.
- **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/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.
---
## Installation
### Install the Claude plugin
From the official Anthropic marketplace, inside Claude Code:
```
/plugin install jfrog@claude-plugins-official
```
Or from a terminal:
```bash
claude plugin install jfrog@claude-plugins-official
```
If install fails with a wall of `Invalid schema: plugins.N...` errors, those entries belong to **other** plugins in the shared official catalog, not JFrog. Claude Code validates the whole marketplace as one unit and does not refresh a stale local cache on install. Update the catalog and retry:
```bash
claude plugin marketplace update claude-plugins-official
claude plugin install jfrog@claude-plugins-official
```
Then run **`/jfrog-init`** to complete the shared readiness walk, **restart Claude Code**, and verify below.
### Local development
From a clone of this repository (repository root **is** the plugin root):
```bash
claude --plugin-dir /path/to/claude-plugin
```
---
## Authentication
### 1. Set persistent environment variables
| Variable | Description |
| --- | --- |
| `JFROG_URL` | Your JFrog platform URL, e.g. `https://mycompany.jfrog.io` (no trailing `/`). |
| `JFROG_ACCESS_TOKEN` | Your JFrog access token |
### 2. Configure the JFrog CLI
If you have never configured the JFrog CLI on this machine:
1. Open your terminal.
2. Run:
```bash
jf config add
```
3. Follow the interactive prompts to enter the same JFrog platform URL and access token.
Setting `JFROG_URL` / `JFROG_ACCESS_TOKEN` alone does **not** replace a successful `/jfrog-init` walk or repair a failed one. Fix the step `/jfrog-init` reports, re-run it, then restart Claude Code.
---
## Verify
Verification is a required install step, not a troubleshooting fallback:
1. `/plugins` → **Installed** — the JFrog plugin is listed.
2. Run **`/jfrog-init`** — it completes without blocking errors. Restart Claude Code if it changed the MCP config.
3. `jf rt ping` — succeeds against your configured server.
If a check fails, see [Recovery](#recovery). Fix the step `/jfrog-init` reports, re-run it, then restart Claude Code.
## Recovery
| Symptom | Do this | Do **not** do this |
| --- | --- | --- |
| MCP missing after install | Run `/jfrog-init`, complete OAuth if prompted, **restart Claude Code**, re-check MCP tools. | Assume `JFROG_URL` alone will register MCP. |
| `/jfrog-init` stopped at CLI/auth | Follow the skill prompt, then **re-run `/jfrog-init`**. | Skip init and only export env vars. |
| Install fails with marketplace schema errors | Run `claude plugin marketplace update claude-plugins-official` and retry. | Treat `plugins.0.source` as a diagnosis of this plugin. |
---
## Plugin MCP rewrite (Agent Guard)
On every Claude Code `SessionStart` (and when `installed_plugins.json` / `known_marketplaces.json` change), the plugin discovers installed-plugin `.mcp.json` paths under `$CLAUDE_CONFIG_DIR/plugins` (default `~/.claude`) — including marketplace live trees for string-source plugins — plus this plugin's own `.mcp.json` when present, and runs `npx @jfrog/agent-guard --rewrite-mcp-json` against those paths. Stdio MCP entries are rewritten to launch through Agent Guard; remote `url` / `http` / `sse` / `ws` entries are left unchanged. A fast SessionStart helper registers FileChanged `watchPaths` (skipped when the kill switch is on); the slower rewrite hook emits `/reload-plugins` guidance via `additionalContext` when files were updated.
The hook soft-fails (never breaks the session): missing project key, Agent Guard gate failure, or rewrite errors log and exit 0. Concurrent rewrite invocations share a lock file and soft-skip with status `busy`.
| Env | Purpose |
| --- | --- |
| `JF_AGENT_REWRITE_MCP_JSON_DISABLE=1` | Kill switch — skip rewrite and watchPaths registration |
| `JF_PROJECT` / `JFROG_PROJECT` | Project key (also inferred from existing `_JF_ARGS project=` in discovered mcp.json) |
| `JF_SERVER` / `JFROG_SERVER_ID` | Optional server ID for the gate / `--server` |
| `JFROG_AGENT_GUARD_VERSION` | Override pinned `@jfrog/agent-guard` version |
| `JFROG_AGENT_GUARD_REPO` | Private npm registry for `@jfrog/agent-guard` |
| `JFROG_AGENT_GUARD_BIN` | Local Agent Guard binary (skips npx) |
| `JF_ALIGN_MCP_JSON_ROOTS` | Override discovery roots (POSIX `:`/`,`; Windows `;`/`,`) |
| `JF_REWRITE_MCP_JSON_LOCK_PATH` | Override rewrite concurrency lock file path |
| `CLAUDE_CONFIG_DIR` | Claude config root (default `~/.claude`) |
---
## Agent Package Resolution (Preview)
> **Preview Notice:** This feature is in preview and licensed under the Apache License 2.0. For clarity: This software is provided "as-is" without warranty of any kind, and without support obligations or service level commitments. Behavior, APIs, conventions, and structure may change without notice between releases. JFrog makes no guarantees of backward compatibility during the preview release cycle. Use in production environments is at your own risk.
The plugin can now automatically route the packages your AI agent installs (npm, PyPI, Maven, Go, Docker, Helm, and NuGet) through your organization's JFrog Artifactory instead of public registries. This keeps agent-driven dependency installs inside your organization's governance perimeter.
Agent Package Resolution is in preview. The shipped template enables it with empty repository bindings (nothing is routed until Consent Enable or an admin adds `defaultGlobalRepos`). To get started:
- **Users:** see the [User Guide](docs/package-resolution-user-guide.md).
- **Admins:** see the [Admin Guide](docs/package-resolution-admin-guide.md).
---
## Usage
Once configured, interact with the JFrog plugin through natural language. Examples are grouped by capability.
### JFrog Platform skill
| Ask the agent… | What happens |
| --- | --- |
| "List my Artifactory repositories." | Returns repositories via the JFrog CLI. |
| "Upload this build to Artifactory." | Publishes build artifacts and metadata. |
| "Run a security audit on this project." | Runs an Xray / Advanced Security audit and summarizes findings. |
| "Show me details on CVE-2021-23337." | Looks up CVE details in JFrog Advanced Security. |
| "Create a scoped access token for CI." | Creates an access token with the requested scope. |
| "Promote this release bundle to production." | Uses Lifecycle / Distribution APIs to promote the bundle. |
### Package curation skill
| Ask the agent… | What happens |
| --- | --- |
| "Is `lodash@4.17.21` safe to install?" | Checks JFrog Public Catalog signals and curation policy for the package. |
| "Is this Maven package approved for use?" | Checks curation entitlement and policy for the requested package. |
| "Download `requests` via JFrog." | Resolves the package through an Artifactory remote cache or curation-aware package manager. |
### Agent Package Resolution
When Agent Package Resolution is enabled and configured, no special prompt syntax is required. Ask the agent to install or use a package as you normally would, and the plugin routes supported package operations through your organization's Artifactory.
| Ask the agent… | What happens |
| -------------------------------------- | ------------------------------------------------------------------------ |
| "Add `lodash` to this project." | Resolves the npm package through the configured Artifactory repository. |
| "Add Excel file import to this app." | The agent selects a suitable package and resolves it through the configured Artifactory repository. |
| "Pull the `alpine` Docker image." | Pulls the image through the configured Artifactory Docker repository. |
### MCP server management (Agent Guard)
| Ask the agent… | What happens |
| --- | --- |
| "Which MCP servers can I install?" | Returns all MCP servers approved for your current project that you can install. |
| "What MCP servers do I already have?" | Returns only the MCP servers already installed on your machine. |
| "Show me the details for the filesystem MCP server." | Returns detailed metadata, required configuration (environment variables, runtime arguments), and active tool policies for a given server. |
| "Add the GitHub MCP server." | Installs an approved MCP server and syncs its tool policies locally. Secrets are requested via a CLI command — never in chat. |
| "Update the environment variables for the Slack MCP." | Replaces the configuration for an already-installed server without removing and reinstalling it. |
| "Remove the Slack MCP server." | Removes the server and its stored credentials from your local setup. Changes apply immediately. |
| "Log in to the remote Jira MCP server using OAuth." | Authenticates with a remote HTTP-based MCP server (OAuth, API key, or bearer token). |
| "Log out of the Jira MCP server." | Removes stored authentication credentials for a server. |
### How secrets are handled
When an MCP server requires a sensitive configuration, the agent cannot set the value directly. Instead, it returns a CLI command for you to copy and run in your terminal. Secrets such as API keys, tokens, and connection strings are never exposed in the agent chat history.
---
## Troubleshooting
### Plugin install fails with marketplace schema errors
`Invalid schema: plugins.0.source`, unrecognized `displayName`, and similar messages with numeric indices come from Claude Code rejecting the **entire** `claude-plugins-official` catalog because some other plugin's entry is invalid or your local copy is stale. They are not a diagnosis of this plugin.
Run `claude plugin marketplace update claude-plugins-official` to re-fetch the catalog, then retry `/plugin install jfrog@claude-plugins-official`.
For Agent Guard / MCP Registry issues, see the [JFrog MCP Registry troubleshooting guide](https://docs.jfrog.com/ai-ml/docs/mcp-registry-troubleshooting).
---
## Updating the vendored skills
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 upstream tag.
2. Run the sync script from the repo root:
```bash
node .github/scripts/sync-skills.mjs
```
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. 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.
---
## Contributing
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development setup, coding conventions, and the pull-request process.
## Security
See [`SECURITY.md`](SECURITY.md) for how to report vulnerabilities.
## License
Licensed under the [Apache License 2.0](LICENSE).
## skills/jfrog-ai-catalog/SKILL.md
---
name: jfrog-ai-catalog
description: >-
Discover, search, install, update, remove, and publish agent skills and
plugins hosted in the JFrog AI Catalog (Artifactory) via the JFrog CLI
(`jf skills`, `jf agent plugins`) and JFrog Agent Guard. Use whenever the
user asks what skills or plugins are available or installed, wants to
browse/search the catalog, see versions, install/update/uninstall/delete a
skill or plugin, or publish/upload/release one to JFrog / Artifactory / the
AI Catalog.
metadata:
role: workflow
---
# JFrog AI Catalog
Discover, install, and manage agent skills and agent plugins from the JFrog AI
Catalog (Artifactory skills/plugins repositories), and publish your own back to
it, all through the JFrog CLI (`jf skills`, `jf agent plugins`) and the JFrog
Agent Guard.
## Choose a reference file
Pick the row matching the user's intent and read that reference file.
| Intent | Read |
|--------|------|
| "What skills are available?" / browse the catalog / list versions / search by name | [references/discovering-skills.md](references/discovering-skills.md) |
| Install a skill with an explicitly resolved version and repo, update a skill, or handle a blocked download | [references/installing-skills.md](references/installing-skills.md) |
| "What's installed?" / remove an installed skill | [references/managing-installed-skills.md](references/managing-installed-skills.md) |
| Publish / upload / release a skill to the catalog | [references/publishing-skills.md](references/publishing-skills.md) |
| "What plugins are available?" / browse the plugin catalog / list plugin versions / search plugins | [references/discovering-plugins.md](references/discovering-plugins.md) |
| Install or update a plugin (latest or a pinned version) | [references/installing-plugins.md](references/installing-plugins.md) |
| "What plugins are installed?" / remove an installed plugin | [references/managing-installed-plugins.md](references/managing-installed-plugins.md) |
| Publish / upload / release a plugin to the catalog | [references/publishing-plugins.md](references/publishing-plugins.md) |
## Prerequisites
- **Read the base `jfrog` skill first.** [`../jfrog/SKILL.md`](../jfrog/SKILL.md)
owns the shared guards this skill depends on, so this skill does **not** repeat
them — follow them there:
- The [environment check](../jfrog/SKILL.md#environment-check) — confirm `jf`
is installed before the first `jf` call, and install it if missing.
- The [server selection rules](../jfrog/SKILL.md#server-selection-rules-mandatory)
— resolve the default `<SID>` once and reuse it, pass `--server-id <SID>`
after the subcommand on every `jf` call, and use one server per request.
**Resolve it now, before any `jf` call:**
```bash
jf config show 2>/dev/null \
| awk '/^Server ID:/{id=$NF} /^Default:[[:space:]]*true/{print id; exit}'
# stdout: the default server-id; if empty, stop and ask which server to use
```
- The stop-on-error rule — on any `jf` failure, stop and never switch servers.
One addition specific to this skill: never `cat` or parse
`~/.jfrog/jfrog-cli.conf.v6` (it can hold access tokens); list servers only
with `jf config show`, which redacts secrets.
- **Agent Guard registry.** Catalog discovery and repo provisioning run through
`npx --yes @jfrog/agent-guard`. `<REGISTRY_URL>` is the npm registry that
provides the `@jfrog/agent-guard` package itself: use `JFROG_AGENT_GUARD_REPO`
if set, otherwise
`https://releases.jfrog.io/artifactory/api/npm/coding-agents-npm/`. Pass the
same `<SID>` to Agent Guard as `--server "<SID>"` so it targets the same server
as your `jf` calls. Agent Guard also reads `JFROG_URL` / `JF_URL` directly when
set, so make sure the `<SID>` you resolved points at that same host.
- **Resolve the project (`<PROJECT>`) only when needed.**
It is required for `--list-skills`, `--list-skill-versions`,
`--provision-skills-repository`, `--list-agent-plugins`,
`--list-agent-plugin-versions`, and `--provision-agent-plugins-repository`.
Resolve it with this priority:
1. Parse `~/.jfrog/setup.json` (if present) and read `.servers["<SID>"].currentActiveProject`.
2. Fall back to `$JF_PROJECT`.
3. If still empty, ask the user for the project key - do **not** guess.
```bash
PROJECT=$(jq -r --arg sid "<SID>" '.servers[$sid].currentActiveProject // empty' \
~/.jfrog/setup.json 2>/dev/null)
[ -z "$PROJECT" ] && PROJECT="${JF_PROJECT:-}"
```
There is no non-admin way to look up or validate project keys (the
`/access/api/v1/projects` list endpoint needs admin), so you cannot
silently correct a display name to a key. If the value looks like a
display name (spaces, mixed case) rather than a short slug, ask the
user to confirm the project **key** specifically. Never assume
`default`, never invent one. Install, update, remove, and publishing to
an explicit `--repo` are keyed by skill/plugin **name** and/or **repo**,
not a project.
- **Bundle manifests differ by type.** Skill bundles require `SKILL.md`
in the bundle root; plugin bundles require `plugin.json`. Validate the
correct file before installing or publishing.
## Workflow overview
```mermaid
flowchart TD
A[User request] --> B{jf CLI installed?}
B -->|No| C[Ask user to install jf CLI, then continue]
B -->|Yes| D{Intent}
C --> D
D -->|List all skills / versions| E[npx @jfrog/agent-guard --list-skills --allowed-only]
D -->|Install / update skill| F[Resolve slug + version, then jf skills install/update]
D -->|List installed skills / remove| G[jf skills list / rm -rf install dir]
D -->|Publish skill| H[Resolve/provision repo, validate bundle, jf skills publish]
D -->|List all plugins / versions| I[npx @jfrog/agent-guard --list-agent-plugins]
D -->|Install / update plugin| J[Resolve slug + version, then jf agent plugins install/update]
D -->|List installed plugins / remove| K[jf agent plugins list / rm -rf install dir]
D -->|Publish plugin| L[Resolve/provision repo, validate bundle, jf agent plugins publish]
```
## Gotchas
Catalog-specific rules only. The shared `jf` guards — single server per request,
stop-on-error, and cautious mutation — live in the base
[`jfrog` skill](../jfrog/SKILL.md); follow those too. Flow-specific rules live in
the reference files above.
- **Which operations mutate**: install and list are read-mostly; remove, registry
delete, and publish mutate state — the base skill's cautious-mutation rule
applies to those three.
- **Session pickup**: installs, updates, and removals usually take effect only at
the next agent session start, so tell the user to restart.
- **Don't leak the plumbing**: present skills/versions/repos to the user, never
the `npx`/Agent Guard commands, `--registry`, flags, or cursors. Run follow-ups
yourself. Discuss catalog filtering only when the user asks about missing or
blocked results; follow the refusal in `discovering-skills.md`.
- **Skill discovery is always policy-scoped**: every skill and skill-version
listing must follow `discovering-skills.md`. Never weaken that listing path,
including for audit, blocked-content, or named-repository requests. Each
`locations[]` entry from `--list-skill-versions` also carries its own
`allowStatus`, since a repo's governance status is a per-repo fact, never a
per-version one (MLAI-1309) — see `discovering-skills.md` and
`installing-skills.md`.
- **Use the response templates verbatim**: where a reference file gives a "reply
using this exact template" block, fill the placeholders and send exactly that,
with the same wording every time and no extra preamble or commentary.
- **Plugins have no Xray support**: skip all Xray-related handling (no 403
gating on download, no inline scan on publish, no `--skip-scan` flag) when
performing any `jf agent plugins` operation.
## skills/jfrog-init/SKILL.md
---
name: jfrog-init
description: Set up and verify the JFrog plugin. Run on first install, to complete initial configuration, or to diagnose a broken setup.
disable-model-invocation: true
compatibility: >-
Requires Node.js 18 or newer, and network access to the JFrog platform.
allowed-tools: Bash(node --version) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-catalog-runtime.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jf-cli.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jf-config.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jfrog-mcp.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-opencode-mcp-auth.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jfrog-mcp-responding.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-project.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-server-ping.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-reinstall-jfrog-plugin.mjs"*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-state-file.mjs" get*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-state-file.mjs" path*) Bash(node "${CLAUDE_SKILL_DIR}/scripts/jfrog-resolve-mcp-config.mjs" --harness) Bash(npx --version) Bash(uname:*) AskUserQuestion
metadata:
role: workflow
---
# /jfrog-init — verify and guide JFrog plugin readiness
**First output must be a tool call, not text.** No "I'll start..." preamble.
Walks a fixed, ordered checklist and stops at the first non-passing result, guiding
the user through the matching fix before re-checking. Every detector in
`scripts/` is idempotent, read-only, JSON-emitting, and implemented in
Node (`.mjs`), so the same detector runs unmodified on macOS, Linux, and
Windows. Step 3's web-login uses this skill's own local `.mjs` scripts,
same as every other step. The one interactive fix step that isn't a Node
script at all is Step 1's Node install itself — a missing Node can't run
a `.mjs` installer, so that one step branches on OS or shell directly.
Approval model — every user-approval point is detailed in its own Step
below (exact wording, `AskUserQuestion` payloads, forbidden phrases);
this is just the map:
- **`node`** — `AskUserQuestion` Yes/No before auto-installing (Step 1).
- **`jf` (JFrog CLI)** — `AskUserQuestion` Yes/No before auto-installing
(Step 2).
- **`jf config`** — `AskUserQuestion` picker (web login, in-session, vs.
access token, which never enters this conversation) (Step 3/4).
- **Project selection** — the user answers with a project name or key;
an `AskUserQuestion` picker offers the first two enumerated projects
plus "Other" (Step 6).
- Everything else is read-only, except: Step 5's placeholder
substitution and OpenCode-only `mcp.jfrog` write (both unattended, no
`AskUserQuestion` — see `references/script-invocation.md`); Step 8's
`~/.netrc` write (same, see `references/marketplace-setup.md`); and
the Final summary's state write below.
Step 1's `nvm` install and `jfrog-install-jf-cli.mjs`, Step 3's
web-login scripts, Step 8's `jfrog-add-claude-marketplace.mjs` call,
and the Final summary's `jfrog-state-file.mjs set` call are
deliberately **not** in `allowed-tools` and will raise the harness's
own approval prompt — intended, not a misconfiguration; see
`references/script-invocation.md`.
## Step 0: resolve the `${CLAUDE_SKILL_DIR}` placeholder (do this FIRST)
**`${CLAUDE_SKILL_DIR}` is this skill's own absolute directory** — the
folder holding this `SKILL.md`, `scripts/`, and `references/`. Every
`node "${CLAUDE_SKILL_DIR}/scripts/…"` command below needs it resolved
first.
- **Claude Code** — substitutes it automatically. Run commands as
written.
- **Every other harness** — you MUST look it up and export it before
Step 1:
1. Look up this skill's absolute directory from wherever your
harness loaded this file (per-harness plugin roots are listed in
`references/mcp-plugin-config.md`). On OpenCode specifically, it
announces its own real path in its own preamble — use that value
directly instead of hunting for it.
2. Export it:
```bash
export CLAUDE_SKILL_DIR="<absolute path to this skill's directory>"
```
3. Verify with the sentinel — **STOP** and re-resolve if it fails:
```bash
ls "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jf-cli.mjs"
```
4. If your harness does not persist environment variables across
commands, use the resolved absolute path directly in every
`node` invocation instead of `${CLAUDE_SKILL_DIR}`.
Skipping this fails silently rather than loudly — see
`references/script-invocation.md` for why. Step 0 resolves *script
paths*; Step 5's `JFROG_INIT_HARNESS` resolves *harness detection*.
Non-Claude harnesses need both.
## At a glance (always-read core)
- **Order matters.** Walk [Steps 1](#step-1-nodejs--18-installed)–[8](#step-8-claude-agent-plugin-marketplace-registered)
in exact order, stop at the first non-passing result — except Step 5's
failure/error outcomes, Step 5b entirely, Step 6's one-retry cap, Step 7's "not
entitled" and "catalog unreachable" outcomes, and Step 8 entirely
(all five non-blocking). See
[The checklist, in order](#the-checklist-in-order).
- **Capturing the exit code before forcing success is mandatory** (`;
rc=$?; true` bash / `; $rc=$LASTEXITCODE; exit 0` PowerShell — see
`references/invoking-and-output-rules.md`'s "Invoking scripts" section). A
bare success-forcer with no capture hides every failure/ask result as success.
- **Approval gates:** `AskUserQuestion` Yes/No before auto-installing
Node (Step 1) or `jf` (Step 2); `AskUserQuestion` picker for
web-login vs. token (Step 3/4); `AskUserQuestion` picker for project
selection (Step 6). Everything else is read-only except Step 5's
placeholder substitution (plus OpenCode `mcp.jfrog` write, and the
kiro-cli `~/.kiro/settings/mcp.json` / Junie `~/.junie/mcp/mcp.json`
merge), Step 8's `~/.netrc` write, and the
Final summary's state write.
- **Never surface the checklist.** Run silently — no step narration, no
raw JSON/exit codes, no branch-reasoning said out loud. See
`references/invoking-and-output-rules.md`'s "Customer-facing output" section.
- **`<server-id>` for Steps 4-7** always comes from the shared resolver
(explicit arg → `JF_SERVER_ID` → `isDefault` → sole configured server
→ ask) — never invented, never `jf`'s own fallback. Step 8 reuses the
same value. See
[Resolving `<server-id>`](#resolving-server-id-for-steps-4-7).
- **Persist state before the final summary** — run
`jfrog-state-file.mjs set` whenever Steps 1-4 all pass, regardless of
Step 5/6/7. See [Final summary](#final-summary).
- **Close with the Final summary.** When Steps 1-4 pass, render the
[Final summary](#final-summary) checklist — never end on ad-hoc
"Summary / Changes" status text.
- **Never store, log, or print an access token** — credentials stay
inside `jf`'s own process or in-memory for one `fetch` call. **Step 8
is the one deliberate exception** (writes `~/.netrc`) — see
[Step 8](#step-8-claude-agent-plugin-marketplace-registered) and
[Non-goals](#non-goals-out-of-scope-for-this-skill).
- **This skill is the exception to, not a consumer of, the base
[`../jfrog/SKILL.md`](../jfrog/SKILL.md)'s prerequisites** — do not
run its environment check as a gate before starting this walk.
Steps: [1](#step-1-nodejs--18-installed) → [2](#step-2-jfrog-cli-installed) →
[3](#step-3-jf-connected-to-a-server) → [4](#step-4-server-reachable--credentials-valid) →
[5](#step-5-jfrog-mcp-plugin-file-has-a-jfrog-entry) → [6](#step-6-project-resolved) →
[7](#step-7-ai-catalog-reachable--user-entitled) →
[8](#step-8-claude-agent-plugin-marketplace-registered)
## Prerequisites
- **Read the base [`../jfrog/SKILL.md`](../jfrog/SKILL.md) for foundational
context** — JFrog Platform concepts and terminology, and the
[Server selection rules](../jfrog/SKILL.md#server-selection-rules-mandatory)
this skill's own "Resolving `<server-id>`" section (below) follows the
same never-guess/never-infer philosophy of, via its own mechanism.
- **This skill is the exception that makes the base skill's prerequisites
true, not a consumer of them.** The base skill's
[environment check](../jfrog/SKILL.md#environment-check) assumes `jf` is
already installed at a working version — `/jfrog-init` is what gets a
user from nothing installed to that point. Do not run the base skill's
environment check as a gate before starting this walk; Steps 1-4 below
are this skill's own, more granular equivalent (Node, `jf` CLI install,
connection, credentials) purpose-built for the "nothing works yet" case.
- **Deliberately does not export `JFROG_CLI_USER_AGENT`**, unlike the
base skill's invariant — see `runJf()` in `scripts/lib/jf.mjs` for why
(telemetry-only impact).
## Operating rules
**Stop and read `references/invoking-and-output-rules.md` in full before running
any command in this walk** — required behavior, not optional
background. It covers three things:
- **Customer-facing output** — the user never sees step numbers, raw
JSON/exit codes, or branch-selection reasoning; only asks, failures
in plain English, and the final summary.
- **Invoking scripts: exit codes are signal, not failure** — every
detector needs `; rc=$?; true` appended, and every Step's branch
table below keys off that captured exit code.
- **Flow** — follow the flow literally, no reordering or skipping; see
`references/flow-diagram.md` for the full map.
## The checklist, in order
1. **Node.js ≥ 18 installed?** — no script; run `node --version` / `npx --version` directly
2. **JFrog CLI (`jf`) installed?** — `scripts/jfrog-detect-jf-cli.mjs`
3. **`jf` connected to a server?** — `scripts/jfrog-detect-jf-config.mjs`
4. **Server reachable + credentials valid?** — `scripts/jfrog-detect-server-ping.mjs [server-id]`
5. **JFrog MCP plugin file has a jfrog entry?** — `scripts/jfrog-detect-jfrog-mcp.mjs [server-id]`, then **is the JFrog MCP server enabled on this JPD?** — `scripts/jfrog-detect-jfrog-mcp-responding.mjs [server-id]` (non-blocking)
- **5b (OpenCode only): MCP auth token present?** —
`scripts/jfrog-detect-opencode-mcp-auth.mjs`, runs only when Step 5
exits 0 and the harness is OpenCode
6. **Project resolved?** — `scripts/jfrog-detect-project.mjs [server-id] [project-input]`
7. **AI Catalog reachable & user entitled?** — `scripts/jfrog-detect-catalog-runtime.mjs [server-id]`
8. **Claude agent-plugin marketplace registered?** — `scripts/jfrog-add-claude-marketplace.mjs [server-id] [project-key]`, Claude Code only
Run detectors in this exact order and stop at the first non-passing
result — except Step 5 going into failure/error (see Step 5), Step 5b entirely
(see Step 5b), Step 6 hitting its one-retry cap (see Step 6), Step 7's
"not entitled" and "catalog unreachable" outcomes (see Step 7), and
Step 8 entirely (see Step 8), all five non-blocking. Step
1 has no script — a Node script can't verify Node exists — so every
step after it is written in Node and can assume Node is present. The
JPD URL is read directly from
`jf config`; there is no separate
`JFROG_PLATFORM_URL` env var. The project key is asked every walk in
Step 6 (the state file at `~/.jfrog/setup.json` may supply a
"reuse the current project?" hint); Step 7's catalog probe takes no
project argument — it only checks catalog reachability and entitlement
for the resolved server.
### Resolving `<server-id>` for Steps 4-7
Order (used by every detector that takes `[server-id]` — resolved
through the single shared `scripts/jfrog-resolve-jf-server.mjs`):
1. Explicit argument passed to the detector.
2. `JF_SERVER_ID` env var.
3. **The server flagged `"isDefault": true`** in `~/.jfrog/jfrog-cli.conf.v6`
— resolved automatically via `scripts/jfrog-resolve-jf-server.mjs`.
4. If only one server is configured, it is used silently.
5. Otherwise the detector exits **2 ("ask")** with a JSON `candidates`
list of the configured server IDs. **Stop and read
`references/server-picker.md` in full** — it has the exact
`AskUserQuestion` payload for showing the user the actual servers to
pick from; do not paraphrase or invent your own prompt. Never invent
a server, never rely on `jf`'s own fallback.
## Step 1: Node.js ≥ 18 installed?
```bash
node --version; true
npx --version; true
```
No script — Node's own binary is the only thing that can answer
"is Node installed", so there's nothing a script would check that
these two commands don't already answer directly. Checked first
because every other script in this walk — including every other
detector — is a Node program. `npx` matters because the JFrog MCP
server (`mcpServers.jfrog`, Step 5) is launched via `npx
@jfrog/agent-guard` — no `npx` means the MCP entry can't start,
regardless of everything else.
Read the output yourself, no JSON to parse:
- Either command errors (e.g. `command not found: node`) → **not usable**:
Node.js (or `npx`) is not installed / the install is broken.
- `node --version` prints a version like `v16.2.0` → parse the major
number yourself. `< 18` → **too old**: "Node.js `<version>` is too old —
jfrog-init requires Node ≥ 18."
- `node --version` ≥ 18 **and** `npx --version` succeeds → proceed to
Step 2.
**Never paste the raw shell output.** Translate to plain English —
"npx is not installed" not `` `command not found` ``, "Node.js v16 is
too old" not the version string verbatim. The raw output is for your
reasoning, not for the user.
On failure, **stop and read `references/node-install-prompt.md` in full
before responding to the user.** It has the exact `AskUserQuestion`
payload, the forbidden phrases, and the install commands — required
behavior, not optional background. Even on the install path there's no
detector *script*: a missing Node can't run a `.mjs` installer, so the
install is a bash/PowerShell command the model runs directly.
## Step 2: JFrog CLI installed?
```bash
node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jf-cli.mjs"; rc=$?; true
```
- **Exit 0** → proceed to Step 3.
- **Exit 1, `reason: "missing"`** → `jf` not found on PATH → **stop
and read `references/jf-cli-install-prompt.md` in full** — required
behavior, not optional background.
- **Exit 1, `reason: "broken"`** → `jf` is on PATH but hung or
failed to run → **stop and read `references/jf-cli-install-prompt.md`
in full** — it has a separate payload for this case; required
behavior, not optional background.
- **Exit 1, `reason: "outdated"`** → `jf` installed but below the
required minimum version → **stop and read
`references/jf-cli-update-prompt.md` in full** — required behavior,
not optional background.
**Read `references/jf-cli-install-internals.md` for the full plan
A/B/C breakdown** — why this walk uses `npm install -g jfrog-cli-v2-jf`
instead of the base skill's OS-specific install docs, and how the
fallback to a checksum-verified direct binary download works.
## Step 3: `jf` connected to a server?
```bash
node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-jf-config.mjs"; rc=$?; true
```
Checked here (right after installing `jf`) so the JFrog CLI is
finished — install + auth — before the walk moves on to any other
prereqs. Keeps the "get `jf` working" story in one contiguous block
from the user's point of view.
**This step does not pick or validate any specific server** — it only
checks that `jf config show` returns at least one configured server,
regardless of how many there are or whether one is marked `isDefault`.
If multiple servers are configured with none marked default, that
ambiguity is surfaced starting at Step 4, not here — see "Resolving
`<server-id>` for Steps 4-7" above.
- **Exit 0** → proceed to Step 4.
- **Exit 1** → `jf` is installed but not connected to any
server. **Stop and read `references/jf-config-auth-picker.md` in
full before responding to the user** — the Step 3 section has the
exact web-login-vs-token `AskUserQuestion`, this skill's own local
web-login script copies (no cross-skill call into the base `jfrog`
skill), and the token command template — required behavior, not
optional background.
## Step 4: Server reachable + credentials valid?
```bash
node "${CLAUDE_SKILL_DIR}/scripts/jfrog-detect-server-ping.mjs" "[server-id]"; rc=$?; true
```
**Stop and read `references/jf-config