docs: add agent-readable documentation and repository metadata - #742
Conversation
Ship version-matched Markdown task docs and runnable examples inside the published package so they always match the installed version. Add LICENSE, SECURITY.md, AGENTS.md, and context7.json. - docs/: 12 self-contained task guides, published with the package - examples/: 5 complete runnable scripts - LICENSE: MIT (previously only declared in package.json) - SECURITY.md: private vulnerability reporting and disclosure process - AGENTS.md + CLAUDE.md: contributor guide for coding agents - context7.json: Context7 library ownership verification - README: restructured around install, quick start, and common tasks - package.json: publish docs/, examples/, SECURITY.md, CHANGELOG.md Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| @@ -0,0 +1,47 @@ | |||
| # Migrate to the v2 API | |||
There was a problem hiding this comment.
Shouldn't this file explain when this is necessary/applicable?
| // "Cannot read properties of undefined". | ||
| ``` | ||
|
|
||
| Either import the root and use `.v2` everywhere, or (recommended) import `.v2` once and |
There was a problem hiding this comment.
Wouldn't it be better for this advice to be decisive? Why is it an either/or?
| ## When to use | ||
|
|
||
| Content uploaded by users must be reviewed before it is delivered. Moderation in | ||
| Cloudinary is stateful: assets are `pending` until a decision is recorded, and your |
There was a problem hiding this comment.
Do we need to explain here what "pending" status means? (It can mean different things for delivery, viewing in the console and maybe other areas)
| ## Related | ||
|
|
||
| - Runnable example: `examples/moderate-upload.js` | ||
| - Hosted reference: https://cloudinary.com/documentation/cloudinary_moderation |
There was a problem hiding this comment.
Shouldn't this link to the markdown version https://cloudinary.com/documentation/cloudinary_moderation.md?
(Applicable to all links in this PR)
| ## Pattern: analysis to reviewed metadata | ||
|
|
||
| The robust AI workflow is not "run a model, trust the output" — it is: | ||
|
|
||
| 1. Run AI analysis on the asset (captioning, tagging — for example the | ||
| [Analyze API](https://cloudinary.com/documentation/analyze_api_guide), subscription required). | ||
| 2. Have a human or business rule review/normalize the output. | ||
| 3. Write the **approved** values as structured metadata. | ||
| 4. Search, route, and deliver based on that metadata. | ||
|
|
||
| This keeps model output out of your delivery path until it has been accepted. |
There was a problem hiding this comment.
What is this based on? Why is there promoting a human in the loop?
| @@ -0,0 +1,53 @@ | |||
| /** | |||
| * Sign a browser upload on your server. | |||
There was a problem hiding this comment.
Why do you need to mention this is from a browser?
| * Sign a browser upload on your server. | |
| * Sign an upload on your server. |
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "url": "https://context7.com/cloudinary/cloudinary_npm", | |||
| "public_key": "pk_obmsxAKm09jm0si62jh1m" | |||
- moderate-upload: pending does not block delivery; document statuses, automatic moderator values, and pipe-list ordering - platform-capabilities: restructure into use-case tables; add Start here section covering Skills, MCP servers, CLI, and documentation indexes - get-credentials: new page for provisioning a cloud or signing up - import-and-call: replaces migrate-to-v2 - sign-browser-upload: state signature validity; note signed-parameter rule - upload-image: separate per-request, environment, and chunk size limits - search-and-manage-assets: structured error handling; search syntax reference - use-structured-metadata: normalize model output against the schema - troubleshoot-errors: 423 Processing; platform status page - prefer asset_id for stored references - link documentation as Markdown from docs/ and examples/ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
All 36 comments addressed. Flagging only where I did not apply it as written:
Verified against a live account: all 5 examples and every doc snippet run green; lint clean, 315 unit tests passing. |
|
|
||
| ## Automatic moderation | ||
|
|
||
| Pass an add-on name instead of `manual` to get an automated verdict: |
There was a problem hiding this comment.
Mention that these add-ons need to be enabled by the user, and terms of service need to accepted by the user
njb90
left a comment
There was a problem hiding this comment.
Looks great - worth addressing the issue Eitan raised on the exception response structure. The additional examples here will also greatly improve context7.
Report errors the way an SDK user sees them, not as HTTP status codes: - Troubleshooting entries are keyed on the message the SDK actually returns (`Invalid api_key`, `api_secret mismatch`, `Rate limit exceeded`, `You don't have an active subscription for <add-on>`) instead of `401 Unauthorized` / `420 Rate limit exceeded`. - Docs and examples log `message` from the rejection rather than building a string or dumping the whole object, which on Admin and Search calls carries the api_secret. - Note that add-ons must be registered in the console, and that some third-party add-ons also require accepting the provider's terms of service. Also: `upload-large-video.js` no longer downloads the sample video over an explicitly supplied path; a missing file now fails instead of looking like a successful upload. Messages verified against a live cloud. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Ship version-matched Markdown task docs and runnable examples inside the published package so they always match the installed version. Add LICENSE, SECURITY.md, AGENTS.md, and context7.json.
Brief Summary of Changes
What Does This PR Address?
Are Tests Included?
Reviewer, Please Note: