feat: skill scripts marketplace#55
Draft
anfibiacreativa wants to merge 12 commits into
Draft
Conversation
…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>
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
Depends on and must be merged together with adobe/da-nx#572
MARKETPLACESconfig so the agent can resolve skills from curated external sources in addition to the document's own skill sheet.skill_run_scriptorchestration tool for executing skill scripts fetched from a marketplace provider.loadSkillBodybug 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 (targetingadobe/skills) before prod. See the skill-script-runtime migration plan.What Changed
MARKETPLACESconfig block withproviderFor(skillId)resolverskill_run_scripttool: resolves skill body via provider, executes script, returns structured resultloadSkillBody: propagate non-404 errors instead of returning emptyTest Plan
npm test/ wrangler test runner)loadSkillBodynon-404 fix: confirm HTTP 500 from skill source surfaces as an error, not empty bodyew start da-agenton:4200, send chat message that invokes a marketplace skill, confirm round-trip completesRisks / Follow-ups
exp-workspace/skills(ew/) is hardcoded — must move to config sheet targetingadobe/skillsbefore prodReference
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.
ew start da-agent; worker binds:4200; connect withref=localHEAD /chat → 200