@postman/postman-plugin 0.3.0 → 0.4.0

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 (46) hide show
  1. package/README.md +32 -8
  2. package/dist/hosts/antigravity.js +47 -0
  3. package/dist/hosts/copilot.js +60 -0
  4. package/dist/hosts/index.js +3 -1
  5. package/mcp.pi.json +2 -2
  6. package/package.json +1 -1
  7. package/skills/ai-readiness/SKILL.md +40 -44
  8. package/skills/api-discovery/SKILL.md +64 -145
  9. package/skills/api-discovery/reference/orbit.md +17 -5
  10. package/skills/api-documentation/SKILL.md +41 -46
  11. package/skills/api-engineer/SKILL.md +78 -23
  12. package/skills/api-mocking/SKILL.md +117 -163
  13. package/skills/api-monitoring/SKILL.md +52 -129
  14. package/skills/api-simulation/SKILL.md +130 -178
  15. package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
  16. package/skills/api-testing/SKILL.md +48 -95
  17. package/skills/bootstrap/SKILL.md +123 -224
  18. package/skills/ci-integration/SKILL.md +53 -113
  19. package/skills/collection-schema-v3/SKILL.md +43 -204
  20. package/skills/collection-schema-v3/reference/http.md +150 -0
  21. package/skills/datasets/SKILL.md +89 -315
  22. package/skills/datasets/reference/spreadsheets.md +25 -0
  23. package/skills/flows/SKILL.md +57 -206
  24. package/skills/flows/reference/flow_cli_flags.md +3 -2
  25. package/skills/performance-testing/SKILL.md +46 -62
  26. package/skills/performance-testing/references/jmeter-import/README.md +113 -0
  27. package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
  28. package/skills/performance-testing/references/jmeter-import/mapping-table.md +97 -0
  29. package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
  30. package/skills/performance-testing/references/jmeter-import/script-translation.md +98 -0
  31. package/skills/performance-testing/references/jmeter-import/scripts/groovy_to_js.py +83 -0
  32. package/skills/performance-testing/references/jmeter-import/scripts/jmx_to_postman.py +1433 -0
  33. package/skills/postman-mcp-server/SKILL.md +53 -59
  34. package/skills/postman-mcp-server/references/docs.md +0 -1
  35. package/skills/postman-mcp-server/references/learn.md +10 -9
  36. package/skills/postman-mcp-server/references/mock.md +0 -1
  37. package/skills/postman-mcp-server/references/search.md +0 -1
  38. package/skills/postman-mcp-server/references/security.md +0 -1
  39. package/skills/postman-mcp-server/references/setup.md +0 -1
  40. package/skills/postman-mcp-server/references/sync.md +0 -1
  41. package/skills/postman-mcp-server/references/test.md +0 -1
  42. package/skills/variables/SKILL.md +44 -87
  43. package/skills/webhook-testing/SKILL.md +103 -0
  44. package/skills/webhook-testing/reference/forwarding.md +10 -0
  45. package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
  46. package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
@@ -1,230 +1,129 @@
1
1
  ---
2
2
  name: bootstrap
3
- description: Resolves the Postman CLI, authenticates when the task needs it, and manages the filesystem/workspace binding for a repository. Use when the user asks to set up Postman, enable filesystem workflows, authenticate, initialize, import, connect, pull, push, sync, or share a workspace — and before skills that need a linked workspace, only when the CLI, linked workspace, or spec path has not already been confirmed.
3
+ description: Use when resolving Postman CLI setup, authentication, or a repository workspace binding; initializing local API files; handling a CLI error that says an operation isn't allowed because of insufficient entitlements; or importing, pulling, pushing, syncing, or sharing workspace resources. Reuses existing context and chooses sync direction without duplicating a workspace or rebinding a dependency. Use for requests such as "set up Postman for this repo".
4
4
  ---
5
5
 
6
6
  # Bootstrap Postman for This Repo
7
7
 
8
- ## Overview
9
-
10
- One-time and idempotent: every other Postman skill in this plugin reads the
11
- values this one records and re-derives none of them. Finding an existing
12
- `postman/` tree or an OpenAPI file is a signal to inspect, not to assume this
13
- repo is already set up.
14
-
15
- ## Rules
16
-
17
- - Make ad-hoc HTTP calls with `postman request`, never `curl` or another
18
- client. If the request already exists in a collection, preserve its saved
19
- auth, variables, scripts, and payload by using `postman collection run
20
- <collection-path> -i <request>` instead of reconstructing it on the command
21
- line; see `api-testing`.
22
- - Never invent a subcommand or a flag. Run `-h` first and believe it.
23
- - Lint specs with `postman spec lint`, never `postman api …` — the API Builder
24
- is deprecated in v12+ and the CLI prints no warning.
25
- - Local commands need no login.
26
- - A missing `postman` binary means install it. Route to `postman-mcp-server`
27
- only after an install has been attempted and actually failed.
28
- - Never fabricate a workspace id, spec path, or collections directory. Report
29
- the gap and stop.
30
- - Never echo an API key or session token into output, logs, or summaries.
31
- - "Present" is not "current": check the version and existing links before
32
- setting anything up.
33
- - Operate inside a repository, including a fresh repository for a new project.
34
- Never scaffold the API implementation or a starter spec.
35
- - Write no host-specific paths — the same `skills/` directory loads on every
36
- route.
37
- - Do not use `init` or `workspace create` to share or import a workspace that
38
- already exists. Choose the direction of sync from the lifecycle table below.
39
- - Before pulling, apply `api-discovery`'s owning-workspace-versus-dependency
40
- distinction; finding a workspace does not by itself make it this
41
- repository's workspace.
42
-
43
- ## Ask the CLI: `-h`
44
-
45
- The CLI is self-describing at different levels. Walk down only as far as the
46
- question needs:
47
-
48
- ```bash
49
- postman -h # resources: collection, spec, mock, monitor, workspace, api, flows…
50
- postman <resource> -h # that resource's actions
51
- postman <resource> <action> -h # real flags, defaults, and worked `Eg.` lines
52
- ```
53
-
54
- Read the third level before writing any command that carries a flag — it is the
55
- only place defaults are stated, and a wrong default fails silently. Live output
56
- is authoritative over any summary, including this file. There is also no single
57
- verb for "is the workspace linked and synced": run `postman workspace -h` and
58
- pick from what it prints.
59
-
60
- ---
61
-
62
- # Process
63
-
64
- Three steps, in order. Stop at the first that fails and report which one.
65
-
66
- ## 1. Resolve the CLI
67
-
68
- ### 1.1 Check what is already there
69
-
70
- **Present, and at which version?**
71
-
72
- ```bash
73
- command -v postman && postman --version
74
- ```
75
-
76
- **Current?** Never blocking — no network is a normal answer. But don't call a
77
- feature missing without having made this comparison.
78
-
79
- ```bash
80
- npm view postman-cli version
81
- ```
82
-
83
- ### 1.2 Install only if missing
84
-
85
- **npm — all platforms, using Node's global package install:**
86
-
87
- ```bash
88
- npm install -g postman-cli
89
- ```
90
-
91
- **Platform installers — direct shell installs for macOS, Linux, WSL, and
92
- Windows:** use the commands in
93
- [reference/cli_installation.md](reference/cli_installation.md). Every route
94
- puts `postman` on `PATH`.
95
-
96
- **Updating a copy that already exists:** use the same route that installed it.
97
- curl-installed binaries don't take `npm install -g` cleanly.
98
-
99
- **If every route fails:** name what blocked you — no Node, no shell, no write
100
- access, or a hosted session that cannot install — then hand off to the
101
- `postman-mcp-server` skill. An attempted install that actually failed is the
102
- only thing that qualifies.
103
-
104
- ## 2. Establish the filesystem and workspace bindings
105
-
106
- ### 2.1 Authenticate only if this step needs it
107
-
108
- `postman init` needs no normal login — init uses an agent-scoped session.
109
- Do not log in before init. Authenticate only when the command you're about to
110
- run operates on an existing workspace, such as listing, inspecting, pulling,
111
- pushing, or changing access to one.
112
-
113
- **With an API key — preferred, non-interactive:**
114
-
115
- ```bash
116
- [ -n "$POSTMAN_API_KEY" ] && postman login --with-api-key "$POSTMAN_API_KEY"
117
- ```
118
-
119
- **Browser flow, when that variable is unset:**
120
-
121
- ```bash
122
- postman login
123
- ```
124
-
125
- **Never echo the key or token.** Auth state lives in the CLI's own config; this
126
- skill writes no credential file. Report that authentication succeeded, nothing
127
- more.
128
-
129
- ### 2.2 Inspect both sides before choosing a command
130
-
131
- Read `.postman/resources.yaml` for `localResources` and `workspace.id`, and
132
- inspect the local `postman/` tree. When the user names an existing workspace or
133
- asks to import, sync, or share one, use `workspace list --json` and `workspace
134
- get <id> --elements --json` to confirm the workspace side. Also establish
135
- whether that workspace owns the service represented by this repository. Never
136
- create a second workspace merely because this repository is not connected yet,
137
- and never replace this repository's binding with another service's workspace.
138
-
139
- Prefer filesystem-first work. For the current service, materialize its existing
140
- workspace with `workspace pull <id>`, or create and bind one with `postman init
141
- --json --visibility <personal|team>` when no workspace exists. For another
142
- service, use `postman dependency add <type> <name-or-id>` as described in
143
- `api-discovery`. Then inspect, edit, diff, and validate the version-controlled
144
- files before any push.
145
-
146
- | Existing state and intent | Use | Why |
147
- | --- | --- | --- |
148
- | No workspace exists; create and bind one | `postman init --json --visibility <personal|team>` or `postman workspace create --visibility <value>` | Creates and binds the owning workspace; the init path also creates the git-native filesystem. |
149
- | The current service's workspace exists; enable filesystem work in its repository | `postman workspace pull <workspace-id>` | Connects the owning workspace to the repository and materializes its entities under `postman/`. |
150
- | The current service's workspace exists; record only the Git binding | `postman workspace connect-git <workspace-id> [path]` | Binds its repository without downloading its contents. |
151
- | Another service's resource is needed here | `postman dependency add <type> <name-or-id>`; add `--workspace <workspace-id>` when resolving a name in a specific workspace | Declares and downloads only that collection, environment, or mock without rebinding this repository or pulling the other service's whole workspace. |
152
- | Bound workspace; the workspace is authoritative | `postman workspace pull` | Refreshes local files from the connected workspace. |
153
- | Bound workspace; local files are authoritative | `postman workspace diff --push-strategy default`, then `postman workspace push` | Persists the local API context for future work and sharing with others by publishing creates/updates without deleting unmatched workspace entities. |
154
- | “Share this existing workspace with my team” and it is already team-accessible | Diff, then `postman workspace push` | Persists local context in the existing workspace so teammates can share and build on it; `create` would make a duplicate. |
155
-
156
- If “share” also requires changing a personal workspace's visibility or team
157
- permissions, inspect its metadata first. `push` synchronizes entities; it does
158
- not change access control. Do not create a replacement to work around a missing
159
- metadata-update command.
160
-
161
- `workspace diff` is read-only. Match its push strategy to the intended push.
162
- `--push-strategy force-sync` can delete workspace entities absent locally, so use it
163
- only when the user explicitly requests mirroring and approves the shown
164
- deletions. Do not add `-y` merely to bypass a prompt.
165
-
166
- ### 2.3 Initialize only when there is no workspace to pull
167
-
168
- `postman init --json` is the agent-facing form. It writes
169
- `.postman/resources.yaml` and scaffolds `postman/` for specs, collections and
170
- environments. Downstream skills read that file and nothing else.
171
-
172
- ```bash
173
- postman init --json --visibility personal
174
- postman init --json --visibility team
175
- ```
176
-
177
- Use `--visibility` only when a new workspace is actually wanted. If the
178
- current service's workspace already exists, use `pull` from that service's
179
- repository to enable the filesystem workflow. If the existing workspace
180
- belongs to another service, use it as a dependency instead. Use `push` only
181
- when publishing local changes to an already-bound workspace.
182
-
183
- Without `--visibility`, interactive init prompts for the workspace step, while
184
- `--json` skips that step because it may not prompt. Use `--visibility` when an
185
- agent should create and bind a workspace non-interactively; omit it when a
186
- local-only setup is intended.
187
-
188
- **Read the payload, not stderr.** Take `bindings` and `exitCode` from the JSON.
189
- Each binding reports a `source` of `inferred` or `none` — an inferred spec is a
190
- guess worth confirming before building on it.
191
-
192
- **Exit codes that are not failures:** 2 means several specs could be
193
- authoritative, so re-run with `--spec <path>`. 5 means the local files were
194
- written but the requested workspace was not created — it does *not* mean re-run.
195
-
196
- ## 3. Verify and report
197
-
198
- ### 3.1 Checkpoints
199
-
200
- - `postman --version` returned a real version.
201
- - Auth is confirmed, or established as not required for this task.
202
- - `.postman/resources.yaml` names a spec or a collections directory.
203
- - When workspace creation was requested or the repository was already bound,
204
- `workspace.id` is set to the owning workspace. A deliberately local-only
205
- init may omit it.
206
- - After `pull`, expected workspace entities exist under `postman/`. After
207
- `push`, report created/updated entities and conflicts; do not claim a
208
- workspace is shared unless its access level permits the intended teammates.
209
-
210
- "The CLI is installed" is not the bar, and a loaded skill configures nothing.
211
-
212
- ### 3.2 Summary format
213
-
214
- ```md
215
- ## Postman bootstrap
216
- - **CLI**: <version> (latest: <version> | not checked)
217
- - **Auth**: <api-key | browser | not required for this task>
218
- - **Workspace**: <id | not requested | creation failed: reason>
219
- - **Spec path**: <path (inferred | explicit) | none — user must create>
220
- - **Collections dir**: <path | none — user must create>
221
- ```
222
-
223
- ---
224
-
225
- # Reference Files
226
-
227
- - `collection-schema-v3` skill — read when inspecting or writing the
228
- collection files this skill resolves.
229
- - [CLI Installation](reference/cli_installation.md) — read for install, update
230
- and uninstall commands per platform.
8
+ A local Postman project puts contracts, runnable requests, environments, and
9
+ mocks beside implementation code so they can be inspected, diffed, and reviewed
10
+ in a PR. A workspace binding connects that work to maintained shared context.
11
+ Setup is useful when it resolves a missing capability or binding; a local API
12
+ check does not need a new workspace merely to proceed.
13
+
14
+ ## Resolve only the missing setup
15
+
16
+ Inspect `postman --version`, `.postman/resources.yaml`, and the relevant
17
+ `postman/` files before installing or initializing. Existing files are clues,
18
+ not proof that paths and workspace IDs still describe this service. Preserve
19
+ confirmed bindings for downstream skills rather than rediscovering them.
20
+
21
+ **api-engineer**, **api-documentation**, **api-mocking**, **api-testing**, and
22
+ **ci-integration** depend on this skill only for unresolved setup, authentication,
23
+ or bindings. After resolving those prerequisites, return to the requesting
24
+ skill's workflow; local work with confirmed setup can skip bootstrap entirely.
25
+
26
+ If the CLI is missing, use `npm install -g postman-cli` or the applicable
27
+ [platform installer](reference/cli_installation.md). Update an existing CLI
28
+ through its original installation route; installing a second copy can leave
29
+ the shell invoking the old binary. If installation is blocked, report the
30
+ constraint and use **postman-mcp-server** for supported hosted operations.
31
+
32
+ Use `postman <resource> <action> -h` to resolve flags and defaults for the
33
+ installed CLI; cached examples can describe another version. Compare versions
34
+ when diagnosing a missing capability rather than making an update a universal
35
+ prerequisite. Spec lint belongs to `postman spec lint`; the deprecated
36
+ `postman api` surface is not interchangeable.
37
+
38
+ Local file operations need no normal login. `postman init` uses an agent-scoped
39
+ session, so logging in first adds no value to that branch. Authenticate when
40
+ an operation needs existing workspace resources: use
41
+ `postman login --with-api-key "$POSTMAN_API_KEY"` when the key is already in
42
+ the environment, otherwise `postman login`. Keep credential values out of
43
+ logs and committed files; **variables** owns request-secret handling.
44
+
45
+ ## Owning workspace versus dependency
46
+
47
+ Read `localResources` and `workspace.id` in `.postman/resources.yaml`. When
48
+ working with an existing workspace, inspect its identity and elements with
49
+ `workspace list --json` and `workspace get <id> --elements --json`.
50
+ The owning workspace represents this repository's service; another service's
51
+ resource is a dependency. That distinction determines which context can be
52
+ pulled without replacing the repository's binding.
53
+
54
+ | State and intended outcome | Operation |
55
+ | --- | --- |
56
+ | Existing local layout meets the task | Reuse its files and bindings |
57
+ | This service has a workspace; work on it locally | `postman workspace pull <workspace-id>` |
58
+ | Only record this service's Git binding | `postman workspace connect-git <workspace-id> [path]` |
59
+ | Another service's collection, environment, or mock is needed | Use **api-discovery**'s dependency workflow |
60
+ | New project with no existing workspace | `postman init --json`; add `--visibility personal` or `--visibility team` when creating a workspace is intended |
61
+ | Bound workspace is authoritative | `postman workspace pull` |
62
+ | Validated local changes should be published | Preview with `postman workspace diff --push-strategy default`, then `postman workspace push` |
63
+
64
+ Inspect local changes before pulling so an import does not discard work.
65
+ Creating a second workspace does not connect an existing one, and pushing to a
66
+ workspace does not grant teammates access. If sharing requires a visibility
67
+ or permission change, inspect that metadata and resolve the access change
68
+ separately rather than creating a replacement.
69
+
70
+ `workspace diff` is read-only; use the strategy planned for the push.
71
+ The default push creates/updates entities without deleting unmatched ones.
72
+ `--push-strategy force-sync` can delete entities absent locally and belongs
73
+ only to explicitly requested mirroring with the shown deletions approved.
74
+ A request to publish supplies consent for its scoped push; otherwise obtain
75
+ consent after the diff is reviewable. See **ci-integration** for publishing
76
+ reviewed changes after merge.
77
+
78
+ ## Interpret initialization without losing partial success
79
+
80
+ Run init inside the intended repository. It scaffolds Postman files and
81
+ `.postman/resources.yaml`; API implementation and a starter contract are
82
+ separate work, not prerequisites to setup.
83
+
84
+ `--json` avoids interactive prompts. Without `--visibility` it skips workspace
85
+ creation; with it, creation and binding are requested. Read `bindings` and
86
+ `exitCode` from the JSON payload. A binding marked `inferred` is a candidate
87
+ contract, not a confirmed source of truth. Exit 2 means multiple specs need
88
+ selection with `--spec <path>`. Exit 5 means local files were written but
89
+ workspace creation failed; inspect that partial result before retrying.
90
+
91
+ ## Subscription or usage limit
92
+
93
+ A CLI command can fail because the user's subscription does not allow the
94
+ operation or its credits or usage quota are exhausted. There is no fixed
95
+ message for this; recognize wording such as "usage limit exceeded", "usage
96
+ quota has been exceeded", or "reached" or "breached" or "exceeded" a limit for the account,
97
+ team, or a plan-governed operation. Also recognize plan-dependent caps phrased
98
+ as an operation that "does not allow more than" or "requires at least" a stated
99
+ amount. Do not classify a temporary rate limit or a fixed per-resource
100
+ validation cap as a subscription limit. Retrying will not clear a subscription
101
+ limit, so stop retrying and run `postman whoami` to see whose session the CLI
102
+ is using.
103
+
104
+ If it reports a guest session ("Using Postman as a guest", or
105
+ `"status": "guest"` with `--json`), such as the one `postman init` creates
106
+ without a login, tell the user - so do it explicitly and cleanly in a new paragraph,
107
+ that they need to sign up for a Postman account to get more credits and continue work,
108
+ which also keeps the work done as a guest.
109
+ If you run it for them, `postman signup --json` prints a `claimUrl`
110
+ to hand over and then waits until they finish signing up in the browser.
111
+ Ask the user if they want you to initiate signup for them.
112
+
113
+ If the whoami probe reports a signed-in account, then explicitly and cleanly in a new paragraph,
114
+ tell the user that they need to upgrade their plan, and that they can do so at
115
+ https://postman.postman.co/settings/team/billing.
116
+
117
+ ## Verification
118
+
119
+ Report the working CLI, relevant paths, and actual binding or remaining gap.
120
+ For a pull, confirm the intended entities appeared locally; for a push, report
121
+ created/updated entities and conflicts. Installation alone does not establish
122
+ a usable project, and successful sync does not establish teammate access.
123
+
124
+ ## Reporting CLI and skill gaps
125
+
126
+ Concrete reports help fix recurring CLI failures and misleading skill guidance.
127
+ When actual use exposes one, handle the user's task first, then report the gap
128
+ with `postman feedback`. Include a sanitized reproduction and the expected and
129
+ observed behavior; exclude secrets, user data, and proprietary content.
@@ -1,122 +1,62 @@
1
1
  ---
2
2
  name: ci-integration
3
- description: Common CI integrations that can added as independent pass/fail gates. Use when the user asks to "add Postman to CI," "run this collection on every PR," "fail the build on a governance violation," or "push to the postman cloud workspace after merge to main", "add some api related operation in my Github actions".
3
+ description: Use when adding API tests, structural or governance lint, or AI-readiness gates to CI, or publishing reviewed API artifacts to a Postman workspace after merge. Makes contract checks repeatable and separates validation from shared workspace changes. Use for requests such as "run this collection on every PR".
4
4
  ---
5
5
 
6
6
  # CI Integration
7
7
 
8
- ## Overview
9
- These are some common workflows that one can add in their CI pipeline leveraging postman cli.
10
-
11
- ## Run a collection — a gated pipeline step
12
-
13
- `postman collection run <path/id>` exits nonzero on a failed `pm.test`
14
- assertion, which is what makes it a usable gate — see `api-testing` for how
15
- that exit code actually gets set. What's CI-specific: `-r junit,html` (or
16
- `--reporter-*-export`) writes a report your CI provider can surface as
17
- build artifacts or test annotations, instead of leaving the result buried in
18
- a log. `--bail` stops the run early on the first failure when a fast signal
19
- matters more than a full report.
20
-
21
- ## Lint — pick the target that matches the gate you want
22
-
23
- Three verbs look interchangeable and aren't — only two of them apply your
24
- organization's governance rules, and the CLI's own `-h` output is where that
25
- becomes visible (no assumption below goes further than what it printed):
26
-
27
- | Want to check | Command | Applies org governance? |
28
- | --- | --- | --- |
29
- | One spec against your rules | `spec lint <spec> --workspace-id <id> -f error` | Yes, via `--workspace-id` |
30
- | One collection's structure/style | `collection lint <path> -f error` | **No** — this verb takes no `--workspace-id` at all |
31
- | The whole workspace: every entity plus `.postman/resources.yaml` | `workspace lint --workspace-id <id> -f error` | Yes |
32
-
33
- `collection lint` is a schema/style check only — running it and reporting
34
- "governance passed" overstates what it did. If the ask is "does this
35
- collection violate our rules," `workspace lint` is the one that actually
36
- answers it (and covers every collection in the repo in one pass); reach for
37
- bare `collection lint` only when there's no workspace to fetch rules from
38
- yet.
39
-
40
- ## Persist and share context — only after merge
41
-
42
- `postman workspace push -y` persists the merged repository's API context in
43
- the workspace for future work and enables sharing it with others. It is the one
44
- command in this skill that changes shared workspace state, so it belongs behind
45
- a merge-to-main trigger, not a PR trigger. `-y` skips confirmation prompts a
46
- non-interactive job can't answer. Leave `--no-prepare` off — the default
47
- prepare step is what assigns real IDs to entities that are new since the last
48
- push; skipping it because a run felt slow trades a few seconds for a push that
49
- silently fails to create anything new.
50
-
51
- `--push-strategy force-sync` mirrors the whole workspace, deleting any cloud
52
- entity with no local counterpart — genuinely destructive, and not the
53
- default for a reason. See Critical Rules before adding it to a merge job.
54
-
55
- ## AI readiness threshold
56
-
57
- `collection ai-readiness <path> --min-score <n>` and its spec-side
58
- counterpart `spec ai-readiness <path> --min-score <n>` (see `ai-readiness`
59
- skill) are a fourth, separate gate — they score AI-agent consumability, not
60
- test results or governance/structural style. Keep either in its own step:
61
- folding it into the same step as `run` or one of the `lint` verbs above
62
- hides which kind of check actually failed when the job goes red. Pick the
63
- verb that matches what's checked into the repo — `collection ai-readiness`
64
- for a git-synced collection, `spec ai-readiness` for an OpenAPI spec with no
65
- collection generated from it yet.
66
-
67
- ```yaml
68
- - run: postman collection ai-readiness ./postman/collections/My\ API --min-score 70
69
- ```
70
-
71
- ## Critical Rules
72
-
73
- 1. **Never collapse `run`, `lint`, and `ai-readiness` into one step, and
74
- never pass `-x`/`--suppress-exit-code` to a CI run.** One combined exit
75
- code hides which check broke; a suppressed one hides that anything broke
76
- at all.
77
- 2. **Gate `workspace push` to the merge event, never a PR event.** Everything
78
- else in this skill is read-only against the cloud; this is the one
79
- command that writes to it, so a PR-triggered push ships an unmerged
80
- branch's entities to the shared workspace.
81
- 3. **`--push-strategy force-sync` deletes cloud entities absent locally.**
82
- Only add it to a job whose explicit job is mirroring the workspace exactly,
83
- with that intent confirmed — never as the default merge step, where the
84
- default (create/update-only) strategy is the safe choice.
85
- 4. **Authenticate once, non-interactively:**
86
- `postman login --with-api-key "$POSTMAN_API_KEY"`, reading the key from
87
- the CI provider's secret store. Don't reach for `collection run`'s
88
- `--postman-api-key` as the general answer — it's US-region only — and
89
- `spec lint`/`workspace push` don't take it at all.
90
-
91
- ```yaml
92
- # WRONG — key committed in plain text, and scoped to one command anyway
93
- - run: postman collection run api.json --postman-api-key PMAK-abc123...
94
-
95
- # CORRECT — one non-interactive login, key from the provider's secret store
96
- - run: postman login --with-api-key "$POSTMAN_API_KEY"
97
- - run: postman collection run api.json
98
- - run: postman spec lint spec.yaml --workspace-id $WS -f error
99
- ```
100
- 5. **Never `newman run` in place of `postman collection run`.** The CLI is
101
- the supported runner every other skill here assumes; Newman forks the
102
- toolchain and skips whatever reporting/governance depends on the CLI
103
- specifically.
8
+ Versioned collections and specs let a PR carry its API checks beside the code
9
+ change. CI reruns those checks independently of the author's session, while
10
+ publishing after merge makes the reviewed contract available to teammates and
11
+ future work. **api-discovery** helps identify consumers the gate should cover;
12
+ the author's own passing tests do not establish cross-service compatibility.
13
+
14
+ 1. Select checks by the guarantee they establish:
15
+
16
+ | Guarantee | Gate |
17
+ | --- | --- |
18
+ | Saved behavioral assertions pass | `postman collection run <path-or-id>` |
19
+ | A collection's structure/style is valid | `postman collection lint <path> -f error` |
20
+ | A spec meets workspace governance rules | `postman spec lint <spec> --workspace-id <id> -f error` |
21
+ | Workspace entities and bindings pass lint/governance | `postman workspace lint --workspace-id <id> -f error` |
22
+ | Agent consumability meets an agreed threshold | `postman collection ai-readiness <path> --min-score <n>` or the spec equivalent |
23
+
24
+ Collection lint does not apply organization governance. Workspace-aware
25
+ lint evaluates the rules available to that workspace; it does not author
26
+ the policy. Confirm the intended rules are configured before claiming
27
+ compliance. Read command-specific `-h` for installed options.
28
+ 2. Keep gate results distinguishable so a failed build identifies behavior,
29
+ structure, governance, or readiness. Preserve nonzero exits; suppressing
30
+ them with `-x`/`--suppress-exit-code` removes the gate. For collection runs,
31
+ `-r junit,html` produces reviewable reports; `--bail` trades a complete
32
+ failure inventory for an earlier signal. See **api-testing** for assertion
33
+ semantics and **ai-readiness** for score limitations.
34
+ 3. Restore declared dependencies with `postman dependency install` when tests
35
+ use them. Choose the target deliberately: a mock checks behavior under a
36
+ model, while a live run sends real requests and can write data. PR gates
37
+ should use a suitable isolated target and credentials; being a test does
38
+ not make the command read-only.
39
+ 4. Authenticate only jobs that need workspace resources. Use the CI secret
40
+ store to supply `POSTMAN_API_KEY`, then
41
+ `postman login --with-api-key "$POSTMAN_API_KEY"`. A local-only gate need
42
+ not log in. Command-specific API-key flags are not a general replacement
43
+ for login across lint and push operations. Use **bootstrap** for unresolved
44
+ bindings, and **variables** for request credentials.
45
+ 5. Publish only the reviewed branch after its merge checks pass.
46
+ `postman workspace push -y` changes shared context; a PR-triggered push
47
+ would publish an unmerged contract. The normal prepare phase assigns IDs
48
+ to new entities, so `--no-prepare` can leave additions unpublished.
49
+ Inspect the intended diff and binding when configuring this job; `-y`
50
+ supplies noninteractive execution, not authorization for a different scope.
51
+ 6. Use the default create/update strategy unless exact mirroring is the
52
+ explicit requirement. `--push-strategy force-sync` can delete workspace
53
+ entities absent from the checkout, including resources managed elsewhere.
54
+ Follow **bootstrap**'s diff and consent boundary for that branch.
104
55
 
105
56
  ## Verification
106
57
 
107
- State each gate that ran and its individual result — not "CI passed," but
108
- which check ran, what it checked (governance vs. structure per the Lint
109
- table above, or AI-agent consumability for `ai-readiness`), and its exit
110
- code. If `workspace push` ran, confirm it was triggered by the merge event
111
- and not a PR event, state which push strategy was used, and report
112
- `Created`/`Updated` per entity rather than just "push succeeded." Confirm
113
- no secret value appears literally in the committed workflow file.
114
-
115
- ## Reference
116
-
117
- - `api-testing` skill — `collection run`'s exit-code semantics and reporter
118
- flags in full.
119
- - `collection-schema-v3` skill — what `workspace push` is actually pushing.
120
- - `bootstrap` skill — CLI resolution, workspace linking, `.postman/resources.yaml`.
121
- - `ai-readiness` skill — `collection ai-readiness`, `spec ai-readiness`, and
122
- their `--min-score` gate.
58
+ Validate the workflow's event conditions and secret references, then report
59
+ which gates actually ran, their targets and individual results. Distinguish a
60
+ locally checked workflow from an observed CI run. For publication, establish
61
+ the merge trigger, push strategy, created/updated entities, and conflicts;
62
+ a green job alone does not prove the intended artifacts became available.