Skip to content

feat(adcp): sync canonical agent skills from protocol tarball#275

Merged
bokelley merged 2 commits intomainfrom
claude/issue-274-sync-skills-from-tarball
Apr 25, 2026
Merged

feat(adcp): sync canonical agent skills from protocol tarball#275
bokelley merged 2 commits intomainfrom
claude/issue-274-sync-skills-from-tarball

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

Closes #274

Extends scripts/sync_schemas.py to extract protocol-managed skills from the same bundle it already uses for schemas. After adcontextprotocol/adcp#3097 merged, the tarball's manifest.json enumerates seven skills (adcp-brand, adcp-creative, adcp-governance, adcp-media-buy, adcp-si, adcp-signals, call-adcp-agent). Without this sync, coding agents using the Python SDK see no skill content and fall back to training-data hallucinations of AdCP shapes.

  • sync_skills_from_bundle(bundle_root, skills_dir) — reads manifest.json, copies each listed skill directory (excluding embedded schemas/ subdirs), snapshots previous state as <name>.previous, leaves SDK-local skills untouched
  • _extract_bundle() — owns TemporaryDirectory lifecycle, shared between schema and skills extraction; cleans up correctly on extraction failure
  • replace_cache_from_bundle(bundle_root) — refactored to accept pre-extracted bundle root (was tgz_bytes + version)
  • --no-skills flag — skip skills sync; wired to check-schema-drift Makefile target so schema-only drift checks don't write to skills/
  • skills/*.previous added to .gitignore
  • 15 tests covering: no manifest, empty list, copy, schemas/ exclusion, snapshot create/replace, local-only untouched, path traversal (../evil and good/../evil), non-string name, missing bundle dir (with pre-existing dst preserved), multiple skills

What was tested

  • pytest tests/test_sync_schemas.py — 15 passed
  • Full suite (pytest tests/ --ignore=tests/integration --ignore=tests/conformance/signing/test_ip_pinned_transport.py) — 2173 passed, 0 failures from this change (one pre-existing network test fails on example.com returning 403 in the sandbox)
  • ruff check scripts/sync_schemas.py — clean (scripts/ excluded per pyproject.toml)

Pre-PR review

  • code-reviewer: approved — no blockers; two issues fixed (path-traversal bypass via good/../evil, encoding on read_text); one nit surfaced in PR body (_extract_bundle could be a @contextmanager — follow-up)
  • dx-expert: approved — all four DX blockers addressed; one nit (CI step name Download latest schemas is stale — cannot fix, .github/** is off-limits per repo policy)

Nits surfaced (not fixed — follow-up candidates)

  • _extract_bundle returns an unmanaged TemporaryDirectory; a @contextmanager would be harder to misuse
  • CI workflow step name Download latest schemas is now mildly stale (also syncs skills) — blocked by .github/** edit restriction

Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}


Generated by Claude Code

claude added 2 commits April 25, 2026 12:17
Extends scripts/sync_schemas.py to extract protocol-managed skills
from the same bundle it already uses for schemas. Reads manifest.json
to enumerate skills, copies each skill tree (excluding nested schemas/
subdirs), and snapshots previous versions as <name>.previous siblings.
SDK-local skills not in the manifest are left untouched.

- Add sync_skills_from_bundle() with path-traversal guard, str validation,
  and manifest-driven copy excluding schemas/ subdirs
- Refactor replace_cache_from_bundle() to accept pre-extracted bundle_root
  (extract_bundle() now owns the TemporaryDirectory lifecycle)
- Add --no-skills flag so check-schema-drift Makefile target skips skill
  sync when only checking schema drift
- Add skills/*.previous to .gitignore (snapshot working copies)
- Add 11 tests covering all discrete behaviors

Closes #274

https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
- Strengthen path-traversal guard: reject any name containing "/" or
  where name != Path(name).name (covers "good/../evil" bypass)
- Add encoding="utf-8" to manifest.json read_text()
- Move src.is_dir() check before dst manipulation to prevent data loss
  when a skill is listed in manifest but absent from the bundle
- Add replace_cache_from_bundle tests and path_traversal_slash test
- Add check-schema-drift to Makefile .PHONY

https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
@github-actions
Copy link
Copy Markdown
Contributor

IPR Policy Agreement Required

Thank you for your contribution! Before we can accept your pull request, you must agree to our Intellectual Property Rights Policy.

By making a Contribution, you agree that:

  • You grant the Foundation a perpetual, irrevocable, worldwide, non-exclusive, royalty-free copyright license to your Contribution
  • You grant a patent license under any Necessary Claims
  • You represent that you own or have sufficient rights to grant these licenses

To agree, please comment below with the exact phrase:

I have read the IPR Policy

You can read the full IPR Policy here.


I have read the IPR Policy


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@bokelley
Copy link
Copy Markdown
Contributor Author

I have read the IPR Policy

@bokelley bokelley marked this pull request as ready for review April 25, 2026 23:59
@bokelley bokelley merged commit 5312f05 into main Apr 25, 2026
10 of 11 checks passed
@bokelley bokelley deleted the claude/issue-274-sync-skills-from-tarball branch April 25, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync canonical agent skills from the protocol tarball

2 participants