@@ -683,6 +683,25 @@ def test_conventional_skill_scripts_are_not_concealed(
683683 assert coverage == []
684684
685685
686+ def test_conventional_skill_script_with_compatible_env_shebang_is_not_concealed (
687+ tmp_path : Path ,
688+ ) -> None :
689+ skill_root = tmp_path / ".claude" / "skills" / "demo"
690+ script = skill_root / "scripts" / "run.py"
691+ script .parent .mkdir (parents = True )
692+ (skill_root / "SKILL.md" ).write_text ("# Demo\n " , encoding = "utf-8" )
693+ script .write_bytes (b"#!/usr/bin/env python3\n print(1)\n " )
694+
695+ result = build_context ({"skill_path" : str (tmp_path ), "use_llm" : False })
696+
697+ metadata = next (
698+ item
699+ for item in result ["component_metadata" ]
700+ if item ["path" ] == ".claude/skills/demo/scripts/run.py"
701+ )
702+ assert metadata ["concealed_executable" ] is False
703+
704+
686705@pytest .mark .parametrize (
687706 ("relative_path" , "payload" , "manifest" , "source_local_only" ),
688707 [
@@ -697,6 +716,18 @@ def test_conventional_skill_scripts_are_not_concealed(
697716 (".claude/skills/demo/scripts/tool.py" , b"MZ" + b"\0 " * 20 , True , False ),
698717 (".claude/skills/demo/scripts/run" , b"#!/bin/sh\n true\n " , True , False ),
699718 (".claude/skills/demo/scripts/run.bat" , b"@echo off\r \n " , True , False ),
719+ (
720+ ".claude/skills/demo/scripts/run.py" ,
721+ b"#!/usr/bin/env -Sbash\n true\n " ,
722+ True ,
723+ False ,
724+ ),
725+ (
726+ ".claude/skills/demo/scripts/run.py" ,
727+ b"#!/usr/bin/env --split-string=bash\n true\n " ,
728+ True ,
729+ False ,
730+ ),
700731 (".claude/skills/.demo/scripts/run.py" , b"#!/usr/bin/env python3\n print(1)\n " , True , False ),
701732 (
702733 ".claude/skills/demo/scripts/.cache/run.py" ,
@@ -725,7 +756,7 @@ def test_skill_script_exemption_fails_closed(
725756 target = tmp_path / relative_path
726757 target .parent .mkdir (parents = True )
727758 target .write_bytes (payload )
728- skill_root = tmp_path / ".claude" / "skills" / "demo"
759+ skill_root = target . parents [ 1 ]
729760 skill_root .mkdir (parents = True , exist_ok = True )
730761 if manifest is True :
731762 (skill_root / "SKILL.md" ).write_text ("# Demo\n " , encoding = "utf-8" )
0 commit comments