Skip to content

[FEATURE] 资源管理支持从标准 Agent Skills / Agent Plugins 仓库批量导入 #1658

Description

@FenjuFu

Problem

Astron Agent already supports Skill folders in Resource Management and the standard Agent read_skill / run_skill runtime added by #1427. The missing step is repository-level ingestion: operators must clone a collection locally and upload every file through the browser before any Skill becomes selectable.

K-Dense-AI/scientific-agent-skills is a concrete standards-based fixture:

plugin.json
skills/
  scanpy/SKILL.md
  rdkit/SKILL.md
  literature-review/SKILL.md
  ...

It is an Agent Plugins 1.0.0 package with 160+ immediate skills/<name>/SKILL.md directories. The current /skill-file/upload-directory path accepts browser-provided multipart files and paths, but it has no repository URL/ref, import plan, collection metadata, source provenance, repeatable update path, or per-skill selection. Files rejected by the upload allowlist can also be skipped without giving an operator a repository-level compatibility report.

Proposed Solution

Add a dry-run-first external Skill repository importer to Resource Management.

Suggested MVP:

  1. Accept a public HTTPS Git repository URL, a required tag/commit SHA, and an optional skills subdirectory (default skills/).
  2. Fetch into an isolated temporary workspace with strict URL, redirect, timeout, total-size, file-count, and per-file limits. Reject private/reserved network targets; do not accept embedded credentials, submodules, Git LFS downloads, or arbitrary Git config.
  3. Read root plugin.json only as optional collection/source metadata. Do not import hooks or execute repository code.
  4. Discover immediate child directories containing SKILL.md, parse the standard frontmatter (including nested metadata.version), and show a dry-run table with name, description, version, license, path, file count/size, unsupported files, and validation errors.
  5. Let the operator select a reviewed subset before import. Import each selected Skill as a normal Resource Management folder so existing authorization, storage, audit, and Agent attachment flows remain authoritative.
  6. Persist provenance per imported Skill: repository URL, requested ref, resolved commit SHA, source path, content fingerprint, and imported timestamp.
  7. Define deterministic collision behavior (skip, replace-unattached draft, or rename); never silently overwrite an existing folder. Return per-skill results so one invalid Skill does not hide successful imports.
  8. Keep scheduled synchronization and automatic upstream updates out of the MVP. A later sync must produce a diff and require explicit approval.

Security Boundary

  • Import is inert: no script, hook, package install, or Skill instruction runs during discovery/import.
  • Archive/path traversal and symlink escapes must be rejected before storage.
  • Unsupported or oversized files must be reported, not silently treated as a complete import.
  • Repository credentials and private repository support are out of scope for the first slice.
  • Imported Skills still use the existing sandbox behavior when an Agent later invokes run_skill.

Acceptance Fixture: Scientific Agent Skills

Use K-Dense-AI/scientific-agent-skills@v2.64.0 as an integration fixture without downloading model/data dependencies:

  • The importer resolves and records the immutable commit behind v2.64.0.
  • Dry-run discovers scanpy, rdkit, and literature-review as separate Skills from skills/.
  • Nested metadata.version is preserved for each Skill.
  • Every included file is either planned for import or reported with an explicit incompatibility; nothing is silently dropped.
  • Selecting only those three Skills imports three independent Resource Management folders.
  • Re-running the same ref is idempotent and reports unchanged content.
  • An imported Skill appears in the existing Agent Skill selector and works through the existing read_skill path; runtime execution behavior remains governed by current sandbox configuration.
  • Malicious URL, redirect-to-private-IP, traversal, symlink escape, oversized archive, and duplicate-folder tests are included.

Alternatives

  1. Manual folder upload: works for a few Skills but loses repository/ref provenance and does not scale to a reviewed collection.
  2. Publish through SkillHub first: useful for governed team distribution and documented in K-Dense PR Feature/fe refactor #241, but Astron Resource Management still lacks a direct repository intake path.
  3. Treat the whole Agent Plugin as one Skill: rejected because each immediate child has its own trigger, metadata, license, dependencies, and lifecycle.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions