@jfrog/opencode-jfrog-plugin 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +105 -51
  2. package/dist/index.js +30 -238
  3. package/package.json +6 -6
  4. package/skills/jfrog/SKILL.md +529 -0
  5. package/skills/jfrog/assets/.gitkeep +0 -0
  6. package/skills/jfrog/references/apptrust-entities.md +154 -0
  7. package/skills/jfrog/references/artifactory-api-gaps.md +206 -0
  8. package/skills/jfrog/references/artifactory-aql-syntax.md +656 -0
  9. package/skills/jfrog/references/artifactory-entities.md +236 -0
  10. package/skills/jfrog/references/artifactory-operations.md +178 -0
  11. package/skills/jfrog/references/catalog-entities.md +219 -0
  12. package/skills/jfrog/references/general-bulk-operations-and-agent-patterns.md +93 -0
  13. package/skills/jfrog/references/general-parallel-execution.md +131 -0
  14. package/skills/jfrog/references/general-use-case-hints.md +27 -0
  15. package/skills/jfrog/references/jfrog-brand-html-report.md +98 -0
  16. package/skills/jfrog/references/jfrog-cli-install-upgrade.md +30 -0
  17. package/skills/jfrog/references/jfrog-entity-index.md +112 -0
  18. package/skills/jfrog/references/jfrog-login-flow.md +132 -0
  19. package/skills/jfrog/references/jfrog-url-references.md +51 -0
  20. package/skills/jfrog/references/onemodel-common-patterns.md +323 -0
  21. package/skills/jfrog/references/onemodel-graphql.md +446 -0
  22. package/skills/jfrog/references/onemodel-query-examples.md +753 -0
  23. package/skills/jfrog/references/platform-access-entities.md +200 -0
  24. package/skills/jfrog/references/platform-admin-api-gaps.md +164 -0
  25. package/skills/jfrog/references/platform-admin-operations.md +58 -0
  26. package/skills/jfrog/references/projects-api.md +241 -0
  27. package/skills/jfrog/references/release-lifecycle-entities.md +180 -0
  28. package/skills/jfrog/references/stored-packages-entities.md +165 -0
  29. package/skills/jfrog/references/xray-entities.md +740 -0
  30. package/skills/jfrog/scripts/check-environment.sh +224 -0
  31. package/skills/jfrog/scripts/jfrog-login-register-session.sh +84 -0
  32. package/skills/jfrog/scripts/jfrog-login-save-credentials.sh +128 -0
  33. package/skills/jfrog-package-safety-and-download/SKILL.md +275 -0
  34. package/sync-skills-vendor.json +5 -0
@@ -0,0 +1,93 @@
1
+ # Bulk operations and agent execution patterns
2
+
3
+ Platform-wide guidance for agents that gather data from multiple JFrog products
4
+ (Artifactory, Xray, Access, Distribution, etc.), run long shell
5
+ sequences, or parallelize work. Product-specific field names and endpoints live
6
+ in the other `references/*` files; this document describes **patterns**, not
7
+ one workflow.
8
+
9
+ ## List vs detail responses
10
+
11
+ Many REST surfaces expose a **light list** (keys, names, minimal fields) and a
12
+ **richer GET by id or key**. Fields needed for audits, reporting, joins, or
13
+ permission checks may appear **only** on the detail response. Before building a
14
+ multi-step flow on a single list call, confirm in API docs or with a sample GET
15
+ whether the fields you need are present.
16
+
17
+ ## Volume, batching, and timeouts
18
+
19
+ - Estimate **N** round-trips (list + per-item GETs, paginated APIs, etc.) before
20
+ starting so execution time and tool timeouts stay predictable.
21
+ - Prefer batching independent reads in one Shell invocation when credentials and
22
+ tier match (see SKILL.md **Batch and parallel execution**).
23
+ - Split very large work across chunks, parallel Shell calls, or subagents when
24
+ the skill's tiering guidance says so.
25
+ - Before starting an N+1 loop (list + per-item detail), **estimate wall time**
26
+ as roughly `N * 1.5s` for sequential calls. Set `block_until_ms` to at
27
+ least that estimate plus a 30-second buffer.
28
+ - For loops exceeding ~60 items, prefer a single Shell invocation that writes
29
+ progress to a log file (`>> /tmp/jf-progress-$$.log`) so partial results
30
+ are visible even if the job is interrupted.
31
+ - If the task is read-only and items are independent, consider Tier 2 or
32
+ Tier 3 parallelism (see `general-parallel-execution.md`) to reduce total time —
33
+ but respect rate limits and keep concurrency modest (4-8 parallel calls).
34
+
35
+ ## Parallelism and shared files
36
+
37
+ **Unsafe:** Multiple concurrent processes appending lines to the **same** file
38
+ (JSONL, logs, ndjson) without synchronization. Output can interleave on one
39
+ line and break parsers (e.g. JSON "Extra data" errors).
40
+
41
+ **Safer:**
42
+
43
+ - Write sequentially to one file; or
44
+ - One temp file per worker or chunk, then concatenate; or
45
+ - Use advisory locking (`flock`) if one file must be shared.
46
+
47
+ For bulk API or CLI output files, use `/tmp` or `mktemp`; do not use
48
+ `~/.jfrog/skills-cache/` except for `jfrog-skill-state.json` and the OneModel
49
+ schema file (see main SKILL.md).
50
+
51
+ ## Shell hygiene
52
+
53
+ - Use `set -euo pipefail` in non-trivial scripts so failures are not silent.
54
+ - Use unique temp paths (e.g. `$$` in the filename) and **echo the expanded
55
+ path** so it can be reused across Shell calls (see SKILL.md **Preserving
56
+ command output** for the `$$` + echo, session ID, and hardcoded patterns).
57
+ - Parse CLI and API JSON with **`jq`**.
58
+
59
+ ## Safe multi-response collection
60
+
61
+ When looping over items (repos, builds, users) and fetching detail for each:
62
+
63
+ 1. Save each response to a variable or per-item file.
64
+ 2. Validate with `jq -e . >/dev/null 2>&1` before appending.
65
+ 3. On validation failure, write a structured error line so the caller can
66
+ report partial results instead of crashing.
67
+ 4. After the loop, `jq -s '.' results.ndjson` to produce a single array.
68
+
69
+ ```bash
70
+ : >results.ndjson
71
+ while read -r key; do
72
+ body=$(jf api "/artifactory/api/repositories/$key" || true)
73
+ if echo "$body" | jq -e . >/dev/null 2>&1; then
74
+ echo "$body" | jq -c . >>results.ndjson
75
+ else
76
+ printf '{"key":"%s","_error":"invalid_response"}\n' "$key" >>results.ndjson
77
+ fi
78
+ done < <(jq -r '.[].key' list.json)
79
+ jq -s '.' results.ndjson > details.json
80
+ ```
81
+
82
+ Never pipe a loop of `jf api` calls directly into `jq -s` without
83
+ per-body validation.
84
+
85
+ ## Where to find product specifics
86
+
87
+ - Artifactory REST nuances: `references/artifactory-api-gaps.md`
88
+ - Platform admin / Access: `references/platform-admin-api-gaps.md`
89
+ - JFrog Projects (endpoints): `references/projects-api.md`
90
+ - Joining Artifactory repos to Projects (`projectKey`, roles, environments):
91
+ `references/platform-access-entities.md`
92
+ - Platform API invocation (all products through `jf api`): see
93
+ `SKILL.md` § *Invoking platform APIs with `jf api`*
@@ -0,0 +1,131 @@
1
+ # Batch and Parallel Execution
2
+
3
+ When a task requires multiple independent operations, use the lightest
4
+ parallelism mechanism that fits. Three tiers are available, from lightest to
5
+ heaviest:
6
+
7
+ | Tier | Mechanism | Best for |
8
+ |------|-----------|----------|
9
+ | 1 | Single Shell call with `&&` | Few commands, same credentials |
10
+ | 2 | Parallel Shell tool calls | Independent commands that can run concurrently |
11
+ | 3 | Parallel subagents (Task tool) | Large multi-step jobs where each branch needs its own reasoning |
12
+
13
+ ## Tier 1: Batch within a single Shell call
14
+
15
+ Combine independent commands with `&&`. All JFrog API calls go through the
16
+ same `jf api` command and the same `jf config` server, so batching them
17
+ together is both safe and efficient:
18
+
19
+ ```bash
20
+ jf api /artifactory/api/repositories > /tmp/jf-repos-$$.json && \
21
+ jf api /artifactory/api/system/ping > /tmp/jf-ping-$$.json && \
22
+ jf api /artifactory/api/storageinfo > /tmp/jf-storage-$$.json
23
+ ```
24
+
25
+ Cross-product reads batch the same way:
26
+
27
+ ```bash
28
+ jf api /access/api/v2/users/ > /tmp/jf-users-$$.json && \
29
+ jf api /access/api/v2/groups/ > /tmp/jf-groups-$$.json && \
30
+ jf api /access/api/v2/permissions/ > /tmp/jf-perms-$$.json
31
+ ```
32
+
33
+ ## Tier 2: Parallel Shell tool calls
34
+
35
+ Use multiple Shell tool calls in the same message when the commands are
36
+ independent and the total runtime benefits from concurrency:
37
+
38
+ ```bash
39
+ # Shell call 1 — echo the expanded path so the agent can reference it later
40
+ OUT=/tmp/jf-repos-$$.json
41
+ jf api /artifactory/api/repositories > "$OUT" && echo "$OUT"
42
+
43
+ # Shell call 2 (parallel) — same pattern, different PID
44
+ OUT=/tmp/jf-users-$$.json
45
+ jf api /access/api/v2/users/ > "$OUT" && echo "$OUT"
46
+ ```
47
+
48
+ Each parallel Shell call gets a different PID, so `$$` expands to different
49
+ values. Echo the path so the agent knows the literal filename for cross-call
50
+ use (see SKILL.md **Preserving command output**).
51
+
52
+ ## Tier 3: Parallel subagents
53
+
54
+ For tasks with multiple independent branches that each require several steps
55
+ or their own reasoning — such as generating a platform health report with
56
+ separate sections, auditing both repository config and security policies, or
57
+ comparing configurations across servers the user explicitly named — launch
58
+ parallel subagents using the Task tool.
59
+
60
+ Each subagent runs autonomously, executes its own CLI/API calls, and returns
61
+ a structured result. The parent agent assembles the final answer.
62
+
63
+ ### Example — platform audit with three parallel subagents
64
+
65
+ ```
66
+ Subagent 1 (shell): "Collect repository data"
67
+ → jf api /artifactory/api/repositories
68
+ → jf api /artifactory/api/storageinfo
69
+ → Return repo count, types, total size
70
+
71
+ Subagent 2 (shell): "Collect security configuration"
72
+ → jf api /xray/api/v2/policies
73
+ → jf api /xray/api/v2/watches
74
+ → Return policy count, watch count, coverage gaps
75
+
76
+ Subagent 3 (shell): "Collect user and permission data"
77
+ → jf api /access/api/v2/users/
78
+ → jf api /access/api/v2/groups/
79
+ → jf api /access/api/v2/permissions/
80
+ → Return user count, group count, admin users
81
+ ```
82
+
83
+ All three subagents run concurrently. Once all complete, the parent agent
84
+ merges their results into a unified report.
85
+
86
+ ### How to structure a subagent prompt
87
+
88
+ 1. State the goal clearly (e.g. "Collect all Xray policies and watches").
89
+ 2. Provide the exact commands to run, or name the API tier and let the
90
+ subagent discover via `--help`.
91
+ 3. Tell the subagent to save output to `/tmp/jf-<label>-$$.json`, echo the
92
+ expanded path, and return a structured summary.
93
+ 4. Specify what to return (counts, lists, specific fields) so the parent can
94
+ assemble the final output without re-reading raw data.
95
+
96
+ ### Subagent type selection
97
+
98
+ - Use `subagent_type="shell"` for straightforward command sequences where the
99
+ commands are known ahead of time.
100
+ - Use `subagent_type="generalPurpose"` when the subagent needs to read skill
101
+ references, discover commands via `--help`, or adapt its approach based on
102
+ intermediate results.
103
+
104
+ ## When to use each tier
105
+
106
+ | Scenario | Tier |
107
+ |----------|------|
108
+ | 2–5 independent reads, same server | 1 (single Shell) |
109
+ | Many independent reads where concurrency cuts total runtime | 2 (parallel Shell) |
110
+ | Full platform audit, multi-section report, cross-server comparison | 3 (subagents) |
111
+ | Task branches need different reference files or reasoning | 3 (subagents) |
112
+ | Simple one-shot data fetch | 1 (single Shell) |
113
+
114
+ ## When NOT to parallelize
115
+
116
+ - A later command depends on the output of an earlier one (use sequential
117
+ calls instead and process the output in between).
118
+ - The calls include **mutating operations** — keep those separate so the user
119
+ can review each one.
120
+ - Commands would target different servers — only operate on the server(s) the
121
+ user explicitly named (or the default). Never fall back to or iterate
122
+ through other configured servers. See SKILL.md **Server selection rules**.
123
+ - The task is small enough that a single Shell call completes in seconds — the
124
+ overhead of launching subagents is not justified.
125
+
126
+ ## Aggregating many outputs (JSONL, logs, ndjson)
127
+
128
+ Do **not** have multiple background processes append **unsynchronized** to the
129
+ same file — lines can interleave and corrupt machine-readable output. Prefer
130
+ sequential writes, one file per worker or chunk then concatenate, or file
131
+ locking. See `references/general-bulk-operations-and-agent-patterns.md`.
@@ -0,0 +1,27 @@
1
+ # Use-case hints (living log)
2
+
3
+ Symptoms, causes, and mitigations discovered while using this skill on real
4
+ tasks. **Append** a new row when you confirm a novel issue (any product or
5
+ workflow). Keep entries short and actionable.
6
+
7
+ | Area | Symptom | Cause | Mitigation | Notes |
8
+ |------|---------|-------|------------|-------|
9
+ | Parallel I/O | JSONL or ndjson parse errors ("Extra data", merged objects on one line) | Concurrent unsynchronized `>>` to the same file from parallel jobs | Sequential writes, one file per worker then `cat`, or `flock` | Generic pattern for any bulk CLI output |
10
+ | APIs (general) | Report or script missing fields that appear in the UI or docs | List endpoint omitted fields; detail GET has the full record | List then GET by id/key when needed; see `general-bulk-operations-and-agent-patterns.md` | Applies across products |
11
+ | Access / Projects | Project groups list looks empty in code | Response may use `members` for the group entries, not `groups` | Accept both keys when parsing | See `projects-api.md` |
12
+ | Bulk detail fetches | `jq` parse error ("Extra data" or "Invalid ...") on slurped detail array | One or more detail GETs returned empty/HTML/error body; `jq -s` chokes on non-JSON mixed in | Validate each response with `jq -e .` before appending; write error placeholder for failures; see `general-bulk-operations-and-agent-patterns.md` | Applies to any per-item loop (repos, builds, users) |
13
+ | Agent timeouts | Shell job silently moves to background; no captured output | `block_until_ms` too low for N sequential API calls (~1-2s each) | Estimate `N * 1.5s + 30s` buffer; set `block_until_ms` accordingly; or use parallel execution | Default 30s insufficient for >20 items |
14
+ | Sandbox + workspace writes | Generated report JSON or HTML not written; script exits 0 but file missing | Sandbox blocks some paths; agents sometimes wrongly target `~/.jfrog/skills-cache/` for scratch files (disallowed — only state + schema belong there) | Write reports and API responses under `/tmp` or the user workspace; only the two allowed cache files (`jfrog-skill-state.json`, `onemodel-schema-<id>.graphql`) belong in `~/.jfrog/skills-cache/` | `skills-cache/` is not a temp directory; see SKILL.md **`~/.jfrog/skills-cache/` — allowed files only** |
15
+ | `jf api` and redirects | Responses are empty or contain redirect HTML instead of expected content | `jf api` does not expose `-L`; it follows the redirect chain the Artifactory REST API returns by default but will not transparently hop across an unexpected 3xx to a binary URL | For remote-repo artifact content (e.g. fetching a file via `/artifactory/<repo>/<path>`), use `jf rt dl` instead of `jf api` — it handles 302s to CDN hosts. Reserve `jf api` for REST metadata/operation endpoints. | Applies when reading artifact **content**, not REST metadata |
16
+ | Curation testing | `jf curation-audit` or `jf npm install` through a curated remote shows 1 download for the tested package even though no user downloaded it | The curation test itself fetches the package through Artifactory, which creates a cache entry and increments download stats | Account for this in download history analysis — the download was the curation test, not a real consumer pull | Also applies to `jf npmc` + `jf npm install` flows |
17
+ | Agent-invented mutations | Agent copies or moves artifacts into a local repo to satisfy a precondition for a different operation (e.g., copy a package so evidence can be created on it) | Requested operation failed because the artifact was not in the specified repo; agent autonomously performed a copy/move/upload to "fix" the gap | **Never** perform unrequested copy, move, upload, or create-repo to work around a failed precondition — stop and report the gap to the user. See SKILL.md § Cautious execution rule 6 | Copying into a local repo can silently change virtual repo resolution for all consumers, trigger replication, and affect Xray indexing |
18
+
19
+ ## How to extend this file
20
+
21
+ 1. Reproduce the issue once on a real server or fixture.
22
+ 2. Add one table row (or a short new subsection if the table is a poor fit).
23
+ 3. Prefer general wording so the next use case on a different product still benefits.
24
+ 4. Before appending, scan existing entries for duplicates or near-duplicates —
25
+ update the existing row instead of adding a new one.
26
+ 5. Keep this file under 80 rows. If it grows beyond that, consolidate related
27
+ entries or promote recurring patterns into the relevant reference file.
@@ -0,0 +1,98 @@
1
+ # JFrog-aligned styling for standalone HTML reports
2
+
3
+ Use this reference when producing a **pretty, self-contained HTML file** (single file with embedded CSS) that presents data fetched from the JFrog Platform. It complements the operational steps in `SKILL.md`; it does not replace [JFrog Brand Guidelines](https://jfrog.com/brand-guidelines/).
4
+
5
+ ## When this applies
6
+
7
+ - The user asked for HTML output (not only Markdown).
8
+ - The report should feel **professionally aligned** with JFrog’s public brand (terminology, palette, restraint) without impersonating JFrog or implying endorsement.
9
+
10
+ ## Authoritative source
11
+
12
+ - **Brand guidelines**: [https://jfrog.com/brand-guidelines/](https://jfrog.com/brand-guidelines/) — rules for JFrog Marks, nominative use, naming, and what not to do (e.g. do not copy JFrog’s site “look and feel” wholesale, do not modify official logos, do not use the favicon on your pages).
13
+ - **Media Kit**: linked from that page (logos in AI/PNG). Use official assets only if the user needs a logo; scale proportionally and add clarifying context per the guidelines.
14
+
15
+ ## Naming and copy
16
+
17
+ - Use **JFrog** with a capital **JF** in prose. For the CLI command name, use lowercase **`jfrog`** where that matches actual command-line usage (per JFrog’s own spelling note on the brand page).
18
+ - Use **correct product names**: JFrog Artifactory, JFrog Xray, JFrog Platform, etc., when referring to those products.
19
+ - Give the report a **distinct title** that describes the content (e.g. “Repository inventory — Acme Corp — 2026-03-24”). Do **not** name the file or the document as if it were an official JFrog publication.
20
+ - Add a short **footer or subtitle** when helpful, e.g. that the document was generated from the user’s environment for their analysis, and is **not** sponsored or endorsed by JFrog (nominative use only).
21
+
22
+ ## Visual design (aligned, not a clone)
23
+
24
+ The brand page asks users not to imitate JFrog’s proprietary layout and marks. For HTML reports:
25
+
26
+ - Prefer a **clean, neutral layout**: plenty of whitespace, readable line length, clear hierarchy (one `<h1>`, logical `<h2>`/`h3>`).
27
+ - Use **one accent color** associated with JFrog’s digital brand (green) for links, key metrics, or section rules — not for large solid backgrounds that mimic marketing hero sections.
28
+ - Use **system or widely available fonts** (`system-ui`, sensible fallbacks) unless the user asks for a specific font. Do not claim typography is “the official JFrog font” unless taken from approved assets.
29
+ - Avoid decorative elements that could be confused with JFrog logos, patterns, or the jfrog.com chrome.
30
+
31
+ ## Suggested CSS tokens (embedded in `<style>`)
32
+
33
+ These are **practical defaults** for internal or technical reports. Adjust if the user’s org has its own template; verify accent against current brand materials if the output is customer-facing.
34
+
35
+ ```css
36
+ :root {
37
+ /* Accent — common on JFrog digital properties; confirm vs Media Kit / brand updates */
38
+ --jfrog-accent: #40be46;
39
+ --jfrog-accent-hover: #36a63d;
40
+ /* Neutrals */
41
+ --text-primary: #1a1a1a;
42
+ --text-muted: #5c5c5c;
43
+ --border-subtle: #e4e4e4;
44
+ --bg-page: #ffffff;
45
+ --bg-muted: #f7f8f8;
46
+ }
47
+
48
+ body {
49
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
50
+ color: var(--text-primary);
51
+ background: var(--bg-page);
52
+ line-height: 1.5;
53
+ margin: 0;
54
+ padding: 2rem clamp(1rem, 4vw, 3rem);
55
+ max-width: 56rem;
56
+ }
57
+
58
+ a {
59
+ color: var(--jfrog-accent);
60
+ }
61
+ a:hover {
62
+ color: var(--jfrog-accent-hover);
63
+ }
64
+
65
+ h1 {
66
+ font-weight: 700;
67
+ font-size: 1.75rem;
68
+ border-bottom: 3px solid var(--jfrog-accent);
69
+ padding-bottom: 0.35rem;
70
+ }
71
+
72
+ table {
73
+ border-collapse: collapse;
74
+ width: 100%;
75
+ font-size: 0.95rem;
76
+ }
77
+ th, td {
78
+ border: 1px solid var(--border-subtle);
79
+ padding: 0.5rem 0.65rem;
80
+ text-align: left;
81
+ }
82
+ thead {
83
+ background: var(--bg-muted);
84
+ }
85
+
86
+ code, pre {
87
+ font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
88
+ font-size: 0.9em;
89
+ }
90
+ ```
91
+
92
+ ## Optional logo
93
+
94
+ Only if the user explicitly wants a logo: use files from the **JFrog Media Kit**, do not alter colors or geometry, and include nearby text that this report is **about** their JFrog deployment, not **by** JFrog — consistent with nominative-use expectations on the brand page.
95
+
96
+ ## Markdown alternative
97
+
98
+ If the user prefers **Markdown** only, follow normal project conventions; apply this file when the deliverable is **standalone HTML** with branding-aligned styling.
@@ -0,0 +1,30 @@
1
+ # JFrog CLI Install & Upgrade
2
+
3
+ ## Installing the JFrog CLI
4
+
5
+ If `jf` is not installed (environment check exits with code 2), guide the user:
6
+
7
+ ```bash
8
+ # macOS
9
+ brew install jfrog-cli
10
+
11
+ # Linux / generic
12
+ curl -fL https://install-cli.jfrog.io | sh
13
+ ```
14
+
15
+ After installation, run `jf --version` to confirm and refresh the cache.
16
+
17
+ ## Upgrading the JFrog CLI
18
+
19
+ If the environment check reports a newer version is available, inform the user
20
+ and offer to upgrade:
21
+
22
+ ```bash
23
+ # macOS
24
+ brew upgrade jfrog-cli
25
+
26
+ # Linux / generic (reinstall)
27
+ curl -fL https://install-cli.jfrog.io | sh
28
+ ```
29
+
30
+ After upgrading, run `jf --version` to confirm and refresh the cache.
@@ -0,0 +1,112 @@
1
+ # JFrog entity index
2
+
3
+ When to read this file:
4
+
5
+ - The user mentions a JFrog entity and you need to identify which **domain** it belongs to.
6
+ - You are planning an operation that spans **multiple products** (e.g. build → scan → release).
7
+ - You need a quick **one-line definition** before deciding whether to load the full domain reference.
8
+ - You need **GraphQL (OneModel)** entry points (workflow, examples, patterns) —
9
+ see [GraphQL (OneModel)](#graphql-onemodel) below.
10
+
11
+ After identifying the domain, follow the pointer in the **Reference** column for
12
+ detailed definitions, relationships, and agent rules.
13
+
14
+ ## Cross-product flow
15
+
16
+ ```mermaid
17
+ flowchart TD
18
+ Art[Artifact] -->|stored in| Repo[Repository]
19
+ Repo -->|abstracted as| SP[Stored Package]
20
+ Build[Build Info] -->|references by checksum| Art
21
+ Repo -->|indexed by| Xray
22
+ Build -->|scanned by| Xray
23
+ Xray -->|evaluates via watches/policies| Viol[Violation]
24
+ Build -->|assembled into| RB[Release Bundle]
25
+ Art -->|included in| RB
26
+ RB -->|promoted through| Env[Environments]
27
+ RB -->|distributed to| Edge[Edge Nodes]
28
+ RB -->|sources| App[Application Version]
29
+ Build -->|sources| App
30
+ SP -->|package location| App
31
+ App -->|promoted through stages| AppStage[App Stages]
32
+ Evd[Evidence] -.->|attests| RB
33
+ Evd -.->|attests| App
34
+ Evd -.->|attests| SP
35
+ Cat[Catalog] -.->|enriches metadata| SP
36
+ ```
37
+
38
+ Key takeaway: **artifacts** are the atomic unit. Builds reference them,
39
+ Xray scans them, release bundles collect them, distribution delivers them.
40
+ **Applications** orchestrate the top-level release flow. **Stored Packages**
41
+ bridge artifacts to the package abstraction. **Catalog** enriches packages
42
+ with global security, legal, and operational metadata. **Evidence** attests
43
+ to entities across all domains.
44
+
45
+ ## GraphQL (OneModel)
46
+
47
+ For the unified **OneModel GraphQL** API (cross-product list/search over
48
+ applications, packages, evidence, release bundles, catalog, and related
49
+ entities on the platform base URL):
50
+
51
+ - **Workflow** — mandatory per-server supergraph schema, validation, execution,
52
+ errors: `onemodel-graphql.md`
53
+ - **Query templates and domain examples** — `onemodel-query-examples.md`
54
+ - **Pagination, variables, date formats** — `onemodel-common-patterns.md`
55
+
56
+ Also see **GraphQL (OneModel)** in the base `SKILL.md` (Tier 3 curl).
57
+
58
+ ## Entity lookup
59
+
60
+ | Entity | Domain | Definition | Reference |
61
+ |--------|--------|------------|-----------|
62
+ | **Local repository** | Artifactory | Stores artifacts deployed directly (upload, promote, move) | `artifactory-entities.md` |
63
+ | **Remote repository** | Artifactory | Proxy/cache for an external source; cached artifacts live in its `-cache` repo | `artifactory-entities.md` |
64
+ | **Virtual repository** | Artifactory | Aggregates local and remote repos under a single resolution URL | `artifactory-entities.md` |
65
+ | **Federated repository** | Artifactory | Local repo that synchronizes across multiple Platform Deployments | `artifactory-entities.md` |
66
+ | **Artifact** | Artifactory | A file stored in a repository, identified by repo + path + name | `artifactory-entities.md` |
67
+ | **Property** | Artifactory | Key-value metadata attached to an artifact or folder | `artifactory-entities.md` |
68
+ | **Package type** | Artifactory | Repo-level setting that determines layout, metadata indexing, and client protocol | `artifactory-entities.md` |
69
+ | **Build info** | Artifactory | Metadata record linking a CI/CD build to the artifacts it produced | `artifactory-entities.md` |
70
+ | **Build promotion** | Artifactory | Status change on a build that can move/copy artifacts between repos | `artifactory-entities.md` |
71
+ | **Permission** | Artifactory / Access | RBAC policy mapping resources (repos, builds, bundles, destinations) to user/group actions. V2 via Access, V1 (permission targets) via Artifactory | `artifactory-entities.md` |
72
+ | **Replication** | Artifactory | Sync configuration that copies artifacts/properties between repos | `artifactory-entities.md` |
73
+ | **Indexed resource** | Xray | A repository, build, or release bundle that Xray indexes for scanning | `xray-entities.md` |
74
+ | **Component** | Xray | A software package identified and tracked by Xray during scanning | `xray-entities.md` |
75
+ | **Vulnerability** | Xray | A known security issue (CVE) associated with a component version | `xray-entities.md` |
76
+ | **Contextual analysis** | Xray | Assessment of whether a vulnerability is reachable in the usage context | `xray-entities.md` |
77
+ | **License** | Xray | License metadata associated with a component, used for compliance policies | `xray-entities.md` |
78
+ | **Watch** | Xray | Links resources (repos, builds) to policies for continuous monitoring | `xray-entities.md` |
79
+ | **Policy** | Xray | Rules that evaluate components and produce violations when matched | `xray-entities.md` |
80
+ | **Violation** | Xray | Generated when a component in a watched resource matches a policy rule | `xray-entities.md` |
81
+ | **Ignore rule** | Xray | Suppresses specific violations by component, CVE, path, or other criteria | `xray-entities.md` |
82
+ | **Exposure** | Xray (Advanced Security) | Actionable finding from exposures scanning — secrets, IaC issues, service misconfigurations, or application security risks detected in artifacts | `xray-entities.md` |
83
+ | **Curation audit event** | Xray (Curation) | Record of a package check through a curated repository — approved or blocked, with policy details; supports dry-run analysis | `xray-entities.md` |
84
+ | **Report** | Xray | On-demand security, license, or operational analysis over a defined scope | `xray-entities.md` |
85
+ | **Release Bundle** | Release Lifecycle | Immutable, versioned collection of artifacts for promotion and distribution | `release-lifecycle-entities.md` |
86
+ | **Lifecycle stage** | Release Lifecycle | Progression of a release bundle through environments (e.g. DEV → PROD) | `release-lifecycle-entities.md` |
87
+ | **Distribution** | Release Lifecycle | Delivery of a release bundle to Edge nodes or other Platform Deployments | `release-lifecycle-entities.md` |
88
+ | **Evidence** | Release Lifecycle | Cryptographic attestation attached to release bundles, apps, or packages (cross-domain) | `release-lifecycle-entities.md` |
89
+ | **Evidence subject** | Release Lifecycle | Cross-domain anchor linking evidence to its target entity via `fullPath` | `release-lifecycle-entities.md` |
90
+ | **Application** | AppTrust | Software application with versions, owners, criticality, and maturity level | `apptrust-entities.md` |
91
+ | **Application version** | AppTrust | Versioned instance with releasables, sources, promotion history, and release status | `apptrust-entities.md` |
92
+ | **Releasable** | AppTrust | Deployable unit within an app version — a package version or individual artifact | `apptrust-entities.md` |
93
+ | **Application version promotion** | AppTrust | Stage-to-stage progression of an app version (with status tracking) | `apptrust-entities.md` |
94
+ | **Application version source** | AppTrust | What produced releasables: Build, ReleaseBundle, ApplicationVersion, or Direct | `apptrust-entities.md` |
95
+ | **Stored package** | Stored Packages | Package as known to Artifactory's metadata layer (name + type + versions) | `stored-packages-entities.md` |
96
+ | **Stored package version** | Stored Packages | Specific version with locations, artifacts, tags, qualifiers, and stats | `stored-packages-entities.md` |
97
+ | **Stored package version location** | Stored Packages | Where a package version lives (repo key + path) — bridge to Applications and Evidence | `stored-packages-entities.md` |
98
+ | **Stored package artifact** | Stored Packages | Binary file within a package version (checksums, size, mime type) | `stored-packages-entities.md` |
99
+ | **Public package** | Catalog | Package in JFrog's global database with security, legal, and operational metadata | `catalog-entities.md` |
100
+ | **Public package version** | Catalog | Version with vulnerability, license, operational info, and dependencies | `catalog-entities.md` |
101
+ | **Public vulnerability** | Catalog | CVE with CVSS v2/v3/v4, EPSS, advisories (NVD, GHSA, JFrog), known exploits | `catalog-entities.md` |
102
+ | **Public license** | Catalog | License metadata with permissions, limitations, and patent conditions | `catalog-entities.md` |
103
+ | **Custom package** | Catalog | Package in the organization's private catalog view with custom labels | `catalog-entities.md` |
104
+ | **Custom catalog label** | Catalog | Organization-defined label for categorizing packages (manual or automatic) | `catalog-entities.md` |
105
+ | **MCP service** | Catalog | Model Context Protocol service registered in the public catalog | `catalog-entities.md` |
106
+ | **Project** | Platform / Access | Organizational container with its own members, roles, and resources | `platform-access-entities.md` |
107
+ | **Project role** | Platform / Access | Per-project role definition scoping actions to environments | `platform-access-entities.md` |
108
+ | **Project member** | Platform / Access | User or group assigned a role within a project | `platform-access-entities.md` |
109
+ | **Environment** | Platform / Access | Groups resources and scopes RBAC; used in projects and release lifecycle | `platform-access-entities.md` |
110
+ | **User** | Platform / Access | Platform identity that authenticates and is granted permissions | `platform-access-entities.md` |
111
+ | **Group** | Platform / Access | Named collection of users; simplifies permission management | `platform-access-entities.md` |
112
+ | **Access token** | Platform / Access | Bearer credential with scoped permissions and optional expiry | `platform-access-entities.md` |
@@ -0,0 +1,132 @@
1
+ # Server Login Flow
2
+
3
+ How to add or authenticate a JFrog Platform server. The agent drives this
4
+ flow — the user only interacts via their browser.
5
+
6
+ Requires Artifactory 7.64.0+ and the JFrog CLI (`jf`).
7
+
8
+ ## Security rules
9
+
10
+ - Never print, echo, or display access tokens in terminal output or chat.
11
+ - When confirming auth status, say "authenticated as user X" — never show
12
+ the token.
13
+ - `jf config` is the sole credential store. Never store tokens in files,
14
+ env var profiles, or project directories.
15
+ - Validate URLs with the ping endpoint before using them in shell commands.
16
+
17
+ ## Resolve the active environment
18
+
19
+ ```bash
20
+ jf config show 2>/dev/null
21
+ ```
22
+
23
+ - **0 servers** — ask the user for their JFrog Platform URL, then go to
24
+ Web Login.
25
+ - **1 server** — use it: `jf config use <server-id>`, done.
26
+ - **2+ servers** — if the user named a specific server, use that one. Otherwise
27
+ use the current default. If no default is set, list server IDs and URLs and
28
+ ask the user which to use. **Never iterate through servers or fall back to
29
+ another server on error** — see SKILL.md **Server selection rules**.
30
+
31
+ ## Web login (preferred)
32
+
33
+ ### 1. Verify server and register session
34
+
35
+ ```bash
36
+ bash <skill_path>/scripts/jfrog-login-register-session.sh "https://mycompany.jfrog.io"
37
+ ```
38
+
39
+ The script pings the server, generates a session UUID, and registers it with
40
+ the Access API. On success it outputs:
41
+
42
+ ```
43
+ SESSION_UUID=<uuid>
44
+ VERIFY_CODE=<last 4 chars>
45
+ ```
46
+
47
+ Exit codes: 0 = success, 2 = server unreachable, 3 = registration failed.
48
+
49
+ ### 2. Show the user the verification code and login link
50
+
51
+ Build the login URL:
52
+
53
+ ```
54
+ ${JFROG_PLATFORM_URL}/ui/login?jfClientSession=${SESSION_UUID}&jfClientName=JFrog-Skills&jfClientCode=1
55
+ ```
56
+
57
+ Show the verification code prominently, then the clickable link:
58
+
59
+ > ## Verification code: `<last 4 chars of SESSION_UUID>`
60
+ >
61
+ > Open the login link from above, then enter the code.
62
+ >
63
+ > Let me know when you're done.
64
+
65
+ Wait for the user to confirm. Do not poll automatically.
66
+
67
+ ### 3. Retrieve token, save credentials, verify
68
+
69
+ ```bash
70
+ bash <skill_path>/scripts/jfrog-login-save-credentials.sh \
71
+ "https://mycompany.jfrog.io" \
72
+ "<SESSION_UUID from step 1>"
73
+ ```
74
+
75
+ Substitute the literal platform URL and session UUID from step 1 output.
76
+
77
+ The script retrieves the one-time token, derives a server ID from the URL,
78
+ saves credentials via `jf config add`, and verifies with an Artifactory
79
+ version check. It leaves the current default `jf` server unchanged — pass
80
+ `--server-id=<id>` explicitly on subsequent calls (the SKILL.md "Server
81
+ selection rules" require this anyway). On success it outputs:
82
+
83
+ ```
84
+ SERVER_ID=<derived-id>
85
+ --- Verifying authentication ---
86
+ { "version" : "7.x.x", ... }
87
+ ```
88
+
89
+ Exit codes: 0 = success, 2 = token retrieval failed (user may not have
90
+ completed browser login — HTTP 400), 3 = empty token, 4 = config save or
91
+ verification failed.
92
+
93
+ **The token endpoint is one-time-use.** If consumed (even in a failed save),
94
+ the session UUID is invalidated and the flow must restart from step 1.
95
+
96
+ ## Post-login handoff (mandatory gate)
97
+
98
+ Before any other JFrog operation against the new server, ask the user:
99
+
100
+ > Logged in to `<SERVER_ID>`. Do you want to make it the default `jf`
101
+ > server? (If you say no, I'll keep using `--server-id=<SERVER_ID>`
102
+ > explicitly for follow-up calls.)
103
+
104
+ - Confirm → `jf config use <SERVER_ID>`, then resume the original task.
105
+ - Decline or no answer → keep `--server-id=<SERVER_ID>` on every `jf` call.
106
+
107
+ ## Fallback: manual token setup
108
+
109
+ If web login fails (server too old, network restrictions):
110
+
111
+ 1. Ask the user to generate a token in the JFrog UI:
112
+ **Administration > Identity and Access > Access Tokens > Generate Token**
113
+ 2. Save it non-interactively:
114
+
115
+ ```bash
116
+ jf config add <server-id> \
117
+ --url=https://<jfrog-url> \
118
+ --access-token=<token> \
119
+ --interactive=false
120
+ ```
121
+
122
+ ## Gotchas
123
+
124
+ - The token endpoint (`/token/{uuid}`) is **one-time-use**. If consumed
125
+ (even in a failed save), the session UUID is invalidated and the flow
126
+ must restart from step 1. The save-credentials script handles cleanup,
127
+ but if it exits non-zero after consuming the token, restart from step 1.
128
+ - Server ID is derived from the hostname: `https://mycompany.jfrog.io`
129
+ becomes `mycompany`. Self-hosted URLs are slugified:
130
+ `https://artifactory.internal.corp` becomes `artifactory-internal-corp`.
131
+ - `**jf`**, `**uuidgen**` (register-session), and `**jq**` (save-credentials) must be on PATH.
132
+