ScienceDiscovery
中文 GitHub

Skill Progressive Disclosure

The staged-package and progressive-load path below describes the native executor. By default, JiuwenSwarm installs selected Skills for skill_tool, with read_skill and read_skill_resource as fallbacks; see Agent backends.

This page explains how a model discovers, reads, and audits Agent Skills during a run. Selected Skills are staged into the sandbox as complete frozen packages, and the prompt still stays light by carrying metadata and paths rather than content.

Design goals

Runtime flow

effective Session skills → API frozen revisions
  └─ prepareSkillSandbox writes the complete packages to a per-execution snapshot root
       ↓
  sandbox starts with the packages already mounted
    ├─ $SCIENCEDISCOVERY_SKILLS_DIR            (read-only; /skills under bubblewrap)
    │    └─ <skillId>/SKILL.md, scripts/, references/, assets/…
    └─ $SCIENCEDISCOVERY_SKILL_EXTENSIONS_DIR  (writable; /skill-extensions under bubblewrap)
       ↓
  prompt lists <package_path> and <package_hash> per selected skill
       ↓
  read $SCIENCEDISCOVERY_SKILLS_DIR/<skillId>/SKILL.md with read_file  (read_skill remains a fallback)
    ├─ read referenced supporting text from the same package path
    └─ execute a bundled script in place with explicit argv

Locations

Path Mode Purpose
$SCIENCEDISCOVERY_SKILLS_DIR/<skillId> read-only Complete frozen package for one selected Skill, including SKILL.md, scripts/, references/, and assets
$SCIENCEDISCOVERY_SKILLS_DIR/.sciencediscovery-snapshot.json read-only Manifest recording each staged skill id, revision, version, and package hash
$SCIENCEDISCOVERY_SKILL_EXTENSIONS_DIR writable Reserved extension area for later self-evolution; empty by default and never part of the frozen tree

Always address a package through $SCIENCEDISCOVERY_SKILLS_DIR, which is the form the prompt advertises as <package_path>. The expanded value is platform-specific: under bubblewrap it is the bind path /skills, while macOS Seatbelt has no mount namespace and the variable holds the real host snapshot directory. Hardcoding /skills therefore works on Linux and breaks on macOS.

Both sides understand the variable form. Shells and Python expand it normally; the Node-side workspace tools (read_file, list_files, and run_shell's scriptPath) accept $SCIENCEDISCOVERY_SKILLS_DIR/..., ${SCIENCEDISCOVERY_SKILLS_DIR}/..., and the bare bind path as aliases for the same file, and run_shell re-emits a script path through the variable so the generated command runs unchanged on either sandbox.

Tool responsibilities

Tool Location Responsibility
read_file Node workspace tool Page through any staged package file under the packages root, exactly as for a workspace file
run_shell Runner sandbox Execute a bundled script in place from its package path with explicit argv
read_skill Node workspace tool Compatibility channel returning the same frozen instructions and the package path
read_skill_resource Node workspace tool Bounded UTF-8 read of one snapshot resource; never executes scripts or installs dependencies

Staging happens in prepareSkillSandbox (services/api), the mounts are applied by services/runner, and the tools come from createWorkspaceTools in packages/workspace.

Why a staged snapshot rather than the live catalog path

Exposing the catalog's live SKILL.md location would let a mid-run disk edit change what the model reads, breaking the fixed revision and package hash recorded in the Prompt Manifest. Staging solves both halves: the model gets an ordinary file path, and the bytes behind it are the frozen revision copied once per execution, verified against the recorded package hash before the sandbox starts.

Security boundary

Related entry points