|
| 1 | +# /jfrog-init — full flow diagram |
| 2 | + |
| 3 | +Visual companion to the numbered Steps in `SKILL.md`. Every decision |
| 4 | +node here is also fully documented — including the exact user-facing |
| 5 | +wording — in the corresponding Step section of `SKILL.md`; this diagram |
| 6 | +adds nothing new, it's a compressed map of that same prose for |
| 7 | +at-a-glance orientation. `SKILL.md`'s Step-by-step text is the |
| 8 | +authoritative source for wording and behavior — follow it literally. |
| 9 | + |
| 10 | +```mermaid |
| 11 | +flowchart TD |
| 12 | + Start(["/jfrog-init"]) --> S1 |
| 13 | +
|
| 14 | + S1["1. Node.js >= 18 installed? (no script — node --version / npx --version)"]:::stepBox |
| 15 | + S1 -->|no| ASKNODE["AskUserQuestion: Install Node.js now? Yes/No"]:::fixBox |
| 16 | + ASKNODE -->|Yes, macOS/Linux| NVMINSTALL["Install nvm (pinned version) + nvm install --lts"]:::autoBox |
| 17 | + ASKNODE -->|Yes, Windows| WINGETNODE["winget install OpenJS.NodeJS.LTS"]:::autoBox |
| 18 | + ASKNODE -->|No| STOP0["STOP: cannot proceed without Node"]:::stopBox |
| 19 | + NVMINSTALL -->|failed| F1["Fall back: ask user to install Node.js >= 18 manually"]:::fixBox |
| 20 | + NVMINSTALL -->|ok| S2 |
| 21 | + WINGETNODE --> F1W["Tell user: open a new terminal, re-run /jfrog-init"]:::fixBox |
| 22 | + S1 -->|yes| S2 |
| 23 | +
|
| 24 | + S2["2. jf CLI installed and >= 2.106.0?"]:::stepBox |
| 25 | + S2 -->|missing| ASKJF["AskUserQuestion: Install JFrog CLI? Yes/No"]:::fixBox |
| 26 | + S2 -->|outdated| ASKJFU["AskUserQuestion: Update JFrog CLI? Yes/No"]:::fixBox |
| 27 | + ASKJF -->|Yes| INSTJF["jfrog-install-jf-cli.mjs: Plan A npm install -g jfrog-cli-v2-jf"]:::autoBox |
| 28 | + ASKJFU -->|Yes| INSTJF |
| 29 | + ASKJF -->|No| STOP0J["STOP: cannot proceed without jf"]:::stopBox |
| 30 | + ASKJFU -->|No| STOP0J |
| 31 | + INSTJF -->|npm exited 0, but resolving jf is shadowed by an earlier install on PATH| SHADOW["Report shadowing — move npm's bin ahead on PATH, or remove the other install"]:::fixBox |
| 32 | + SHADOW --> PLANC |
| 33 | + INSTJF -->|npm failed, or exited 0 but jf still isn't resolving up to date and not shadowed, and a private registry is configured| PLANB["Plan B: retry npm install against the public registry"]:::autoBox |
| 34 | + PLANB -->|jf now resolves up to date| S2RE |
| 35 | + PLANB -->|still not up to date| PLANC |
| 36 | + INSTJF -->|npm missing, or Plan A/B failed to leave an up-to-date jf on PATH| PLANC["Plan C: direct binary download to ~/.jfrog/bin, checksum-verified, runs jf --version to confirm"]:::autoBox |
| 37 | + PLANC -->|Windows| WINPS["Print PowerShell one-liner — user runs it themselves, then re-runs /jfrog-init"]:::fixBox |
| 38 | + PLANC -->|macOS/Linux| S2RE |
| 39 | + INSTJF -->|npm succeeded and jf now resolves >= 2.106.0| S2RE["Re-check: installed and >= 2.106.0?"]:::stepBox |
| 40 | + S2RE -->|still missing/outdated| STOP1["STOP: show raw install error"]:::stopBox |
| 41 | + S2RE -->|ok| S3 |
| 42 | + S2 -->|yes| S3 |
| 43 | +
|
| 44 | + S3["3. jf connected to a server?"]:::stepBox |
| 45 | + S3 -->|no| ASKMETHOD["AskUserQuestion: Web login or Access token?"]:::fixBox |
| 46 | + ASKMETHOD -->|Web login| WEBLOGIN["Register session, show code/link, retrieve + save credentials — all in-session, this skill's own local scripts"]:::autoBox |
| 47 | + WEBLOGIN --> S3ASKW["AskUserQuestion: Did you finish logging in? Yes/No"]:::fixBox |
| 48 | + S3ASKW -->|Yes| S3 |
| 49 | + S3ASKW -->|No| STOP0B["STOP: user cancelled"]:::stopBox |
| 50 | + ASKMETHOD -->|Access token| F3["Print one command, --url pre-filled — user runs it themselves in their own terminal, pastes the token"]:::fixBox |
| 51 | + F3 --> S3ASK["AskUserQuestion: Did you finish running that command? Yes/No"]:::fixBox |
| 52 | + S3ASK -->|Yes| S3 |
| 53 | + S3ASK -->|No| STOP0B |
| 54 | + S3 -->|yes| S4 |
| 55 | +
|
| 56 | + S4["4. Server reachable and credentials valid?"]:::stepBox |
| 57 | + S4 -->|multiple servers, no default| ASKSRV["AskUserQuestion: pick server-id"]:::fixBox |
| 58 | + ASKSRV --> S4 |
| 59 | + S4 -->|reachable, but token invalid/expired| F4["Print one command, --url and --server-id pre-filled (token-only, no web option — avoids a duplicate server) — user runs it themselves"]:::fixBox |
| 60 | + F4 --> S4ASK["AskUserQuestion: Did you finish running that command? Yes/No"]:::fixBox |
| 61 | + S4ASK -->|Yes| S4 |
| 62 | + S4ASK -->|No| STOP0C["STOP: user cancelled"]:::stopBox |
| 63 | + S4 -->|unreachable/timeout/other| STOP2["STOP: show raw error (network/URL hint included)"]:::stopBox |
| 64 | + S4 -->|yes| S5 |
| 65 | +
|
| 66 | + S5["5. Plugin mcp.json has mcpServers.jfrog? (auto-substitutes a JFROG_PLATFORM_URL/JFROG_URL placeholder inline, if present)"]:::stepBox |
| 67 | + S5 -->|substitution needed, server-id ambiguous| ASKSRV5["AskUserQuestion: pick server-id"]:::fixBox |
| 68 | + ASKSRV5 --> S5 |
| 69 | + S5 -->|missing/invalid/no entry, incl. substitution failure| F5["Note: reinstall or update the JFrog plugin, or resolve jf config (non-blocking)"]:::fixBox |
| 70 | + F5 --> S6 |
| 71 | + S5 -->|yes, valid url| S6 |
| 72 | +
|
| 73 | + S6["6. Project resolved?"]:::stepBox |
| 74 | + S6 -->|state file has current project| ASKREUSE["AskUserQuestion: reuse CURRENT or pick different"]:::fixBox |
| 75 | + ASKREUSE -->|reuse| VALPROJ["Validate via authenticated GET /access/api/v1/projects/KEY"]:::stepBox |
| 76 | + ASKREUSE -->|different| ASKPROJ["AskUserQuestion: first 2 projects, or Other to type one"]:::fixBox |
| 77 | + S6 -->|no state file| ASKPROJ |
| 78 | + ASKPROJ --> RESOLVE["Resolve name-or-key (case-insensitive) against project list from authenticated GET /access/api/v1/projects"]:::stepBox |
| 79 | + RESOLVE -->|no match, 1st attempt| ASKPROJ |
| 80 | + RESOLVE -->|no match again, 2nd attempt: give up| F6 |
| 81 | + RESOLVE -->|matched| VALPROJ |
| 82 | + VALPROJ -->|404 or 403, 1st attempt| ASKPROJ |
| 83 | + VALPROJ -->|404 or 403 again, 2nd attempt: give up| F6 |
| 84 | + VALPROJ -->|401, credentials rejected| STOPCREDS["STOP: show raw error (re-auth via the Step 3/4 picker)"]:::stopBox |
| 85 | + VALPROJ -->|2xx| S7 |
| 86 | +
|
| 87 | + F6["Note: no project resolved after 1 retry — continue without one (non-blocking)"]:::fixBox |
| 88 | + F6 --> S7 |
| 89 | +
|
| 90 | + S7["7. AI Catalog reachable and user entitled?"]:::stepBox |
| 91 | + S7 -->|anon 404 / connection failure / 5xx, exit 1| F7U["Note: catalogReason=unreachable — JPD may not host AI Catalog, or it's down right now (non-blocking)"]:::fixBox |
| 92 | + F7U --> WRITE |
| 93 | + S7 -->|authed 401 or 403, not entitled, exit 4| F7E["Note: catalogReason=not_entitled — ask JFrog admin for AI Catalog Read role (non-blocking)"]:::fixBox |
| 94 | + F7E --> WRITE |
| 95 | + S7 -->|ambiguous server-id, exit 2| ASKSRV7["AskUserQuestion: which jf server? (server-picker.md), then re-run"]:::fixBox |
| 96 | + ASKSRV7 --> S7 |
| 97 | + S7 -->|jf missing / credentials rejected / unexpected response shape, exit 3| STOP7["STOP: show raw error — no state file written"]:::stopBox |
| 98 | + S7 -->|yes, entitled, exit 0| WRITE["Write state file: server, jpdUrl, and currentActiveProject if resolved (else previous project, if any, is kept) — written on every NON-blocking path out of Step 7"]:::autoBox |
| 99 | +
|
| 100 | + WRITE --> S8CHECK{"Step 7 green AND harness == Claude Code? (detectHarness() reused from Step 5)"}:::stepBox |
| 101 | + S8CHECK -->|no| DONE |
| 102 | + S8CHECK -->|yes| S8["8. Claude agent-plugin marketplace registered?"]:::stepBox |
| 103 | + S8 -->|exit 0, success| F8OK["Reply: Added the JFrog marketplace ... — trailing sentence after Final Summary"]:::autoBox |
| 104 | + S8 -->|exit 1 or 3, failed| DONE |
| 105 | + F8OK --> DONE |
| 106 | +
|
| 107 | + DONE(["JFrog init complete"]):::doneBox |
| 108 | +
|
| 109 | + classDef stepBox fill:#e8f0fe,stroke:#1a73e8,color:#000 |
| 110 | + classDef fixBox fill:#fff4e5,stroke:#f9a825,color:#000 |
| 111 | + classDef autoBox fill:#e6f4ea,stroke:#137333,color:#000 |
| 112 | + classDef doneBox fill:#e6f4ea,stroke:#137333,color:#000 |
| 113 | + classDef stopBox fill:#fce8e6,stroke:#c5221f,color:#000 |
| 114 | +``` |
0 commit comments