feat: creative-agent docs polish + CLI warns on removed flags#844
Merged
Conversation
…eative-template example Discoverability fix for existing SDK surface (factories and response helpers already shipped; integrators weren't finding them). - scripts/generate-agent-docs.ts: TOOL_GOTCHAS data map drives new 'Watch out:' blocks on build_creative, preview_creative, and list_creative_formats. Points at the compile-time-safe response helpers and flags the audio-formats renders gap. - skills/build-creative-agent/SKILL.md: cross-cutting pitfalls now name audioAsset and spell out that platform-native top-level fields are invalid. New Audio subsection under creative-template covering type: 'audio', renders with duration_seconds, async render pipelines, and a handler using buildCreativeResponse + audioAsset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
--platform-type was removed from the SDK in 5.1; comply() throws when it's passed programmatically, but the CLI was capturing and dropping it silently. Third-party CI scripts that still pass it believe they're filtering agent selection when they aren't. storyboard run and its comply alias now emit a stderr warning naming the flag, removal version, and migration path. Suppressed under --json. Detection covers both space-separated and equals forms. REMOVED_FLAGS is a single data map for future deprecations. Closes #842. (#841 deferred pending convention RFC — see issue thread.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… stale-gotcha guard Addresses three reviewer findings on PR #844: - tests hit live network: CLI tests passed --dry-run + storyboard id, but runFullAssessment doesn't short-circuit on --dry-run. Rewrote the suite to call with no agent arg so handleStoryboardRun exits at the Usage check (exit 2) before any network call. Added 10s spawnSync timeouts so a future regression fails fast instead of hanging. Added a test that asserts the warning is advisory (doesn't alter exit status). - --json suppressed the stderr warning: wrong contract. stderr doesn't pollute stdout JSON, and CI scripts running under --json are precisely where the warning needs to land. Removed the jsonOutput guard; flipped the test accordingly. - stale-gotcha guard: a tool rename would silently drop the "Watch out:" block from llms.txt. Generator now fails with a named error if any TOOL_GOTCHAS key doesn't resolve to a tool in the schema index. Also: - Prefix changed from "[warn]" to "DEPRECATED:" for consistency with the existing comply-alias deprecation banner at bin/adcp.js:995. - Skill: split long cross-cutting-pitfalls bullet into shape-rules + asset-factory-rules. Split audio code block into format-decl and handler, so the import isn't visually nested inside a listCreativeFormats literal. Added third delta note ("inputs are text assets keyed by asset_id — read .content not .text") and a pointer to the webhooks section for async render pipelines. Fixed pre-existing TextAsset shape doc (was "{ text: string }", schema says { content: string }). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Expert reviews addressed in bdbfded. Ran three experts in parallel: code-reviewer, docs-expert, dx-expert. Fixed (all three reviewers converged):
Fixed (docs-expert):
Deferred with notes:
Tests: 6/6 pass, ~3s total. Typecheck clean. Generator idempotent. |
EmmaLouise2018
approved these changes
Apr 23, 2026
This was referenced Apr 23, 2026
bokelley
added a commit
that referenced
this pull request
Apr 23, 2026
…hape-drift hint (#848) * feat(sdk): displayRender + parameterizedRender factories for Format.renders[] Closes #846. Fixes spec-non-conformant audio guidance shipped in #844. Format.renders[] items have a oneOf — each entry must satisfy either `dimensions` (width + height required) OR `parameters_from_format_id: true`. A render with only `{ role }` or `{ role, duration_seconds }` fails that oneOf. The audio example in the skill from #844 was wrong on this point. - src/lib/utils/format-render-builders.ts: typed factories matching the two valid branches. displayRender({ role, dimensions }) for W×H formats; parameterizedRender({ role }) for audio and template formats (auto-injects parameters_from_format_id: true). - src/lib/index.ts: export the factories and their shape types. FormatRender namespace NOT exported — name collision with the existing v3 structural interface in utils/format-renders. - skills/build-creative-agent/SKILL.md: audio subsection now uses parameterizedRender; duration/codec go in format_id.parameters via accepts_parameters. Display example updated to use displayRender. - scripts/generate-agent-docs.ts: TOOL_GOTCHAS.list_creative_formats points at the factories and corrects the audio guidance. - docs/llms.txt regenerated. Tests: 4/4 pass — injection correctness, non-pixel units, oneOf invariant guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(cli): --strict-flags to fail CI when removed flags are passed Closes #847. Non-breaking extension of the #844 warning helper. By default, removed-flag detection is advisory — stderr warns, exit status reflects the underlying command. CI pipelines that want to catch stale scripts as build-breakers now opt in with --strict-flags: if any flag from REMOVED_FLAGS is present, the run exits 2 after printing a pointed error that names every offender. - bin/adcp.js: warnRemovedFlags() returns the list of found flags. handleStoryboardRun checks args.includes('--strict-flags') and exits 2 when found.length > 0. - test/lib/cli-removed-flags.test.js: 2 new tests — hard-exit on strict + removed, no-op on strict alone. Tests: 8/8 pass. Rest of test suite unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(testing): actionable hint for build_creative platform-native response drift Closes #845. When a build_creative response ships { tag_url, creative_id, media_type } at the top level without { creative_manifest }, the storyboard runner's schema error ("/ must have required property 'creative_manifest'") is accurate but not actionable. A developer staring at that line doesn't see "oh, I had the shape inverted." detectShapeDriftHint() recognizes this pattern and attaches an actionable fix-recipe to ValidationResult.warning that names buildCreativeResponse/buildCreativeMultiResponse, points at @adcp/client/server, and references the build-creative-agent skill's creative-template section. - src/lib/testing/storyboard/validations.ts: detectShapeDriftHint() runs alongside the existing strict-verdict composition. Hint reaches ValidationResult.warning on both Zod-pass and Zod-fail branches (platform-native shape fails Zod; hint is the same). - test/lib/shape-drift-hint.test.js: 6 tests covering positive detection (full drift, partial drift), negative (correct shape, empty payload), and other-tool isolation. Motivating case: scope3 agentic-adapters#100. Intentionally scoped to build_creative today — the detector is a switch on taskName, easy to extend as new drift patterns surface in real integrations. Tests: 6/6 pass. Full related suite 34/34. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: add changeset for creative-agent follow-ups Covers #845 (shape-drift hint), #846 (render factories + audio-example correction), #847 (--strict-flags CLI). Minor bump — new public SDK exports (displayRender, parameterizedRender) and a new CLI flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style: prettier fix on cli-removed-flags test * fix: address expert review — FormatRender namespace, strict-flags on step, tighter hint, CLI docs DX-expert + code-reviewer feedback on #848. - docs/CLI.md: remove three occurrences of the removed --platform-type / --list-platform-types flags that would have sent readers straight into the new --strict-flags exit path. Add --strict-flags to the recommended CI example. Document the 5.1 removal explicitly. - FormatRender namespace (const) now exports FormatRender.display / .parameterized / .template for one-dot autocomplete. Reachable via the same name as the v3 structural type (FormatRenderEntry — renamed; the old FormatRender type alias stays in utils/format-renders with a @deprecated tag for anyone importing the sub-module directly). - templateRender alias for parameterizedRender — matches creative-template specialism terminology. Both exported; pick either. - RenderItem discriminated union export (DimensionsRender | ParameterizedRender) for consumers building renders[] arrays by hand. - detectShapeDriftHint tightened: 2 sentences, dropped SKILL pointer (a dev hitting this is in their terminal looking for the fix). - enforceStrictFlags factored out of handleStoryboardRun; storyboard step now shares it, so --platform-type on `adcp storyboard step` warns and honors --strict-flags too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles two small, thematically related improvements that surfaced from reviewing scope3data/agentic-adapters#100 (AudioStack creative transformer):
Docs (closes #838, #839, #840) — The typed
buildCreativeResponse/buildCreativeMultiResponsehelpers andaudioAsset({...})factory already shipped. Integrators weren't finding them.scripts/generate-agent-docs.ts—TOOL_GOTCHASdata map drives**Watch out:**blocks below the Response section forbuild_creative,preview_creative,list_creative_formats. Easy to extend per tool.docs/llms.txtregenerated.skills/build-creative-agent/SKILL.md— cross-cutting pitfalls mentionaudioAsset, asset-values lists the audio shape, and a new#### Audio creative-template (TTS / mix / master)subsection coverstype: 'audio',renders: [{ role, duration_seconds }], async render pipelines, and a handler usingbuildCreativeResponse+audioAsset.CLI (closes #842) —
--platform-typewas removed in 5.1 but the CLI was silently dropping it. Third-party CI scripts that still pass it believe they're filtering agent selection when they aren't.bin/adcp.js—storyboard runand itscomplyalias now emit a stderr warning naming the flag, removal version, and migration path. Suppressed under--json. Detection covers--flag valueand--flag=valueforms.REMOVED_FLAGSis a single data map for future deprecations.test/lib/cli-removed-flags.test.js— 5 spawn-based tests.Out of scope
--no-sandbox) — deferred pending convention RFC. See thread.Test plan
npm run generate-agent-docs— idempotent ("up to date" on second run)npm run typecheck— cleannode --test test/lib/cli-removed-flags.test.js— 5/5 passadcp storyboard run test-mcp --platform-type creative_transformer --dry-run capability_discoveryemits the expected warning--jsonkeeps stdout pure JSONdocs/llms.txtand SKILL.md — new content reads cleanly🤖 Generated with Claude Code