Skip to content

Commit 0c0cc5c

Browse files
committed
revert change
1 parent d14d40a commit 0c0cc5c

1 file changed

Lines changed: 1 addition & 50 deletions

File tree

.github/scripts/import_external_skills.py

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
1010
1. Shallow-clones the repo at the pinned `ref` into a temp directory,
1111
using sparse-checkout so only the configured `path` is fetched.
12-
2. Copies each named skill folder into `skills/<skill>/`, plus any declared
13-
companion files (e.g. templates linked from agent markdown but stored
14-
outside the skill subtree in the upstream repo).
12+
2. Copies each named skill folder into `skills/<skill>/`.
1513
3. Writes `.federated.json` inside each copy with source metadata so we
1614
can tell vendored skills apart from skills authored in this repo.
1715
4. Rewrites relative markdown links that point outside the copied skill
@@ -355,45 +353,6 @@ def copy_skill(src: Path, dest: Path) -> None:
355353
shutil.copytree(src, dest)
356354

357355

358-
# Repo-relative paths (inside the upstream clone) that a federated skill links
359-
# to but that live outside its copied subtree. Fetched with `git show` so the
360-
# sparse checkout does not need to widen.
361-
_COMPANION_FILES: dict[tuple[str, str], list[tuple[str, str]]] = {
362-
("amd-agi-tracelens", "analysis-orchestrator"): [
363-
(
364-
"TraceLens/Agent/Analysis/utils/templates/sub_agent_spec.md",
365-
"utils/templates/sub_agent_spec.md",
366-
),
367-
],
368-
}
369-
370-
371-
def vendor_companion_files(
372-
clone_dir: Path,
373-
commit: str,
374-
dest_skill: Path,
375-
source_name: str,
376-
skill_folder: str,
377-
log: list[str],
378-
) -> None:
379-
"""Materialize companion blobs linked from agent markdown but outside the skill folder."""
380-
for repo_rel, dest_rel in _COMPANION_FILES.get((source_name, skill_folder), []):
381-
result = subprocess.run(
382-
["git", "show", f"{commit}:{repo_rel}"],
383-
cwd=clone_dir,
384-
check=True,
385-
capture_output=True,
386-
text=True,
387-
)
388-
out = dest_skill / dest_rel
389-
out.parent.mkdir(parents=True, exist_ok=True)
390-
out.write_text(result.stdout, encoding="utf-8")
391-
log.append(
392-
f"[{source_name}] vendored companion {repo_rel} -> "
393-
f"skills/{skill_folder}/{dest_rel}"
394-
)
395-
396-
397356
def write_marker(
398357
skill_dir: Path,
399358
source: Source,
@@ -543,14 +502,6 @@ def import_source(
543502
log.append(f"[{source.name}] {action} {spec.folder} -> skills/{spec.folder}")
544503
if not dry_run:
545504
copy_skill(src_skill, dest_skill)
546-
vendor_companion_files(
547-
tmp_path,
548-
commit,
549-
dest_skill,
550-
source.name,
551-
spec.folder,
552-
log,
553-
)
554505
write_marker(dest_skill, source, commit, relative_path)
555506
write_card(dest_skill, source, marketplace_description)
556507
rewrite_external_references(

0 commit comments

Comments
 (0)