Skip to content

feat: skill scripts marketplace#55

Draft
anfibiacreativa wants to merge 12 commits into
mainfrom
feat/skill-scripts-marketplace
Draft

feat: skill scripts marketplace#55
anfibiacreativa wants to merge 12 commits into
mainfrom
feat/skill-scripts-marketplace

Conversation

@anfibiacreativa

@anfibiacreativa anfibiacreativa commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Depends on and must be merged together with adobe/da-nx#572

  • Adds a marketplace provider interface and MARKETPLACES config so the agent can resolve skills from curated external sources in addition to the document's own skill sheet.
  • Introduces the skill_run_script orchestration tool for executing skill scripts fetched from a marketplace provider.
  • Fixes a loadSkillBody bug where non-404 HTTP errors were silently swallowed.

Why

The skill-scripts feature requires the agent to pull skill definitions from a shared marketplace, not just from per-document config. This PR wires up the provider layer and the orchestration tool so da-nx (PR 2) can trigger script execution end-to-end. This PR is co-dependent with da-nx PR 2 — ship them together.

The demo marketplace source (exp-workspace/skills, ew/ tree) is hardcoded for now. It should move to the config sheet / shared config (targeting adobe/skills) before prod. See the skill-script-runtime migration plan.

What Changed

  • MARKETPLACES config block with providerFor(skillId) resolver
  • Marketplace provider interface (fetch + cache layer)
  • skill_run_script tool: resolves skill body via provider, executes script, returns structured result
  • loadSkillBody: propagate non-404 errors instead of returning empty
  • Characterization net: snapshot tests covering existing tool behaviour to catch PLG regressions
  • Security suite: marketplace-only path — no credential or PII leakage, input sanitisation
  • Comms hygiene suite: no internal-detail leaks in agent responses, no step narration

Test Plan

  • 417 tests pass (npm test / wrangler test runner)
  • Characterization suite: no PLG-path regression (existing tools behave identically)
  • Security suite: marketplace fetch uses no stored credentials; PII not echoed
  • Comms hygiene: agent responses contain no internal step narration or implementation details
  • loadSkillBody non-404 fix: confirm HTTP 500 from skill source surfaces as an error, not empty body
  • Manual: run via ew start da-agent on :4200, send chat message that invokes a marketplace skill, confirm round-trip completes

Risks / Follow-ups

  • Demo marketplace source exp-workspace/skills (ew/) is hardcoded — must move to config sheet targeting adobe/skills before prod
  • Co-dependent with da-nx PR 2; do not ship independently
  • Script execution sandbox boundaries enforced by da-nx worker (see PR 2)

Reference

PR 1 of 4 — skill-script marketplace + runtime.
Co-dependent pair: da-agent (PR 1) ↔ da-nx (PR 2) — ship together.
ew-extensions (PR 3) and ew-devs-cli (PR 4) are standalone.

Test URLs

da-agent is a Cloudflare Worker — no AEM preview URL.

  • Local: run via ew start da-agent; worker binds :4200; connect with ref=local
  • Health check: HEAD /chat → 200

anfibiacreativa and others added 12 commits June 27, 2026 11:40
…estration tool

- extend SkillIndexEntry/SkillSummary with optional execution (entry, runtimes,
  capabilities, timeoutMs) parsed from flat execution_* frontmatter fields;
  absent fields → execution: undefined (backwards-compatible)
- folder-loader detects script.js sibling via sub-folder listing; populates
  execution on SkillSummary only when both execution_entry frontmatter and
  script.js are present
- add skill_run_script client-executed tool (no execute fn) registered in
  CANVAS_CLIENT_ONLY_TOOLS; args carry only { skillId, input } — agent never
  passes capabilities or eligibility hints; client (da-nx) resolves those from
  the trusted manifest
- update buildSkillsPromptSection to split prose vs script-runnable skills and
  instruct the model to call skill_run_script with { skillId, input }

Agent reads/indexes only (no execution). The execution-metadata frontmatter
parser is the reusable seam for future AO marketplace integration, which is
deferred to avoid colliding with the in-flight feat/ao-harness-adapter branch
that owns src/ao/.

Co-Authored-By: Claude <noreply@anthropic.com>
…s in skill metadata

- marketplace script detection updated from flat <id>/script.js to
  <id>/scripts/<entry>.<ext> (entry from execution_entry, ext from
  first runtime, e.g. js → .js); checks via GH contents API on the
  scripts/ sub-folder
- execution_dependencies frontmatter field (comma-separated) parsed
  into SkillExecutionMeta.dependencies: string[]; empty array when
  absent; agent reads/indexes only — client decides eligibility/deps
- hardcoded demo source: exp-workspace/skills (pending adobe/skills PR)
- 334 tests pass (5 new: frontmatter deps parsing, scripts/ layout
  detection, missing scripts/ folder, deps surfaced through merge)

Co-Authored-By: Claude <noreply@anthropic.com>
- introduce MARKETPLACE_PATH = 'ew' constant (TODO: update for adobe/skills)
- GH contents listing now targets .../contents/ew?ref=main
- per-skill scripts check now targets .../contents/ew/<id>/scripts?ref=main
- RAW_BASE_URL now includes /ew/ segment for skill.md fetches
- update test URL constants (CONTENTS_URL, rawUrl, scriptsUrl) to match
…ipt-skills

- add guidance to the Script-Runnable Skills system-prompt section
- instructs the model to use { attachmentRef: "<id>" } in skill_run_script
  input when a skill needs an attached file, using the id from the
  attached files listing
- explicitly prohibits passing raw bytes or base64 in arguments
- add test asserting the new attachmentRef guidance appears in the section
…save behavior

Adds test/skills/skill-loading.characterization.test.ts with 31 tests
covering behaviors not asserted in the existing test files:

- loadSkillsIndexFromFolders: [a-z0-9-]+ name regex (uppercase/underscore exclusion),
  all-unreadable folder (404 per file) → source=folder no sheet fallback,
  no execution field on any folder skill, fallback=false + 4xx folder → source=none
- loadSkillBodyFromFolder: non-404 getSource error falls to sheet (bug characterization)
- loadSkillsIndex: source=site vs none, title from plain first line vs heading,
  skips blank leading lines, id/value/body column variants, .md key suffix stripping
- loadSkillContent: id column, value/body columns, .md suffix lookup normalization,
  getSiteConfig error → null, trimmed return value
- saveSkillContent: creates skills sheet when absent, update vs create dedup,
  preserves/sets status, 404 config starts from {}, empty id error, .md id stripping,
  total count updated on append

Co-Authored-By: Claude <noreply@anthropic.com>
…er interface

- define SkillMarketplaceProvider interface (listSkills, getSkillManifest,
  getScript) + SkillManifest type in src/marketplace/provider.ts
- implement GitHubMarketplaceProvider in src/marketplace/gh-provider.ts —
  moves all existing gh-skills fetch logic behind the interface; constructor
  takes { owner, repo, branch, path } so any GH-hosted marketplace can be
  wired in without code changes
- add AOMarketplaceProvider stub (src/marketplace/ao-provider.ts) — returns
  canned data, no real network call; proves the interface is swappable
- introduce MARKETPLACES registry + providerFor factory in gh-skills.ts —
  single source of truth for active sources (future: driven by config sheet/UI);
  buildMarketplaceSkillsIndex iterates providers, concatenates + dedupes by id
- add provider conformance suite (test/marketplace/provider-conformance.test.ts)
  — identical assertions run against both GitHubMarketplaceProvider and
  AOMarketplaceProvider, proving any conforming provider can be swapped in
- add MARKETPLACES/providerFor/merge tests (test/marketplace/marketplace-config.test.ts)
- all 393 tests pass; characterization net and existing gh-skills tests unchanged

Co-Authored-By: Claude <noreply@anthropic.com>
…data, client-only tool

Three security property suites in test/skills/security.test.ts:

- §1 .da/skills folder-loader never sets execution on SkillSummary, even
  when skill.md carries execution_* frontmatter; only marketplace-sourced
  entries carry execution + source="marketplace" in a merged index.
- §2 buildSystemPrompt renders only id/title for script skills — never
  execution output, dependency lists, or raw execution metadata; the
  script-runnable section forbids da_read_skill and requires skill_run_script
  with exact ids; prose-only indexes must not reference skill_run_script.
- §3 skill_run_script has no execute fn (CANVAS_CLIENT_ONLY_TOOLS); all
  canvas-only tools lack execute; description explicitly states client
  execution and forbids passing capabilities/runtimes in call args.

Co-Authored-By: Claude <noreply@anthropic.com>
…quire exact skillId

The script-runnable section now explicitly tells the model these are not prose
skills (no da_read_skill), to copy the skillId exactly, and includes a concrete
skill_run_script example. Fixes the model guessing ids / treating script skills
as 'not configured'.

Co-Authored-By: Claude <noreply@anthropic.com>
…rrors (non-404)

loadSkillBodyFromFolder fell through to the legacy config-sheet fallback on ANY
getSource error. A transient da-admin error (5xx/network) would therefore return
stale/legacy sheet content instead of signaling unavailability. Now only a 404
(file genuinely absent) falls back to the sheet; other errors return null.

Co-Authored-By: Claude <noreply@anthropic.com>
…vior

Flip the frozen assertion from "non-404 falls through to sheet" (old bug)
to "non-404 returns null, sheet not consulted" (correct behavior after fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anfibiacreativa anfibiacreativa marked this pull request as draft July 8, 2026 14:49
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.

1 participant