MCPcopy Index your code
hub / github.com/github/copilot-sdk / create_skill_dir

Function create_skill_dir

python/e2e/test_skills_e2e.py:29–52  ·  view source on GitHub ↗

Create a skills directory in the working directory

(work_dir: str)

Source from the content-addressed store, hash-verified

27
28
29def create_skill_dir(work_dir: str) -> str:
30 """Create a skills directory in the working directory"""
31 skills_dir = os.path.join(work_dir, ".test_skills")
32 os.makedirs(skills_dir, exist_ok=True)
33
34 # Create a skill subdirectory with SKILL.md
35 skill_subdir = os.path.join(skills_dir, "test-skill")
36 os.makedirs(skill_subdir, exist_ok=True)
37
38 # Create a skill that instructs the model to include a specific marker in responses
39 skill_content = f"""---
40name: test-skill
41description: A test skill that adds a marker to responses
42---
43
44# Test Skill Instructions
45
46IMPORTANT: You MUST include the exact text "{SKILL_MARKER}" somewhere in EVERY response you give. \
47This is a mandatory requirement. Include it naturally in your response.
48""".replace("\r", "")
49 with open(os.path.join(skill_subdir, "SKILL.md"), "w", newline="\n") as f:
50 f.write(skill_content)
51
52 return skills_dir
53
54
55class TestSkillBehavior:

Calls 2

joinMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…