A Python script that generates instruction file from a directory of skills. This tool scans for SKILL.md files in subdirectories and creates or updates a instruction file with the skills list.
Skills pattern was introduced by Anthropic in blog postin October 2025: Introducing Agent Skills.
Skills are simply folders containing a SKILL.md file along with any associated files (e.g., documents or scripts) that an agent can discover and load dynamically to perform better at specific tasks (as described by Langchain in Using skills with Deep Agents).
- Equipping agents for the real world with Agent Skills
- Anthropic documentation.
- Claude Skills are awesome, maybe a bigger deal than MCP (Simon Willison’s Weblog)
- IDE Support: Compatible with VS Code Copilot or any coding agent that supports prompt files (modification of prompt header section might be necessary)
- Smart Updates: Creates new files or updates existing ones
- Zero Dependencies: Uses only standard Python libraries (requires Python 3.7+)
Included skills system prompt text is based on Langchain's Deep Agent skills implementation: https://github.com/langchain-ai/deepagents/blob/master/libs/deepagents-cli/deepagents_cli/skills/middleware.py
No installation required! This script uses only standard Python libraries. Just ensure you have Python 3.7 or later installed.
python generate_skills_prompt.py -w <workspace_root> -s <skills_folder> -t <target_file>| Argument | Short | Long | Required | Default | Description |
|---|---|---|---|---|---|
| Workspace Root | -w |
--workspace |
No | . (current directory) |
Path to the workspace root directory |
| Skills Folder | -s |
--skills |
Yes | - | Path to skills directory (relative to workspace root) |
| Target File | -t |
--target |
Yes | - | Path to output prompt file (relative to workspace root) |
python generate_skills_prompt.py -s skills -t .github/instructions/skills.instructions.md# Windows
python generate_skills_prompt.py -w C:\workspace -s skills -t .github/instructions/skills.instructions.md
# Linux/Mac
python generate_skills_prompt.py -w /home/user/workspace -s skills -t .github/instructions/skills.instructions.mdpython generate_skills_prompt.py -w "C:\My Workspace" -s skills -t ".github/instructions/skills.instructions.md"python generate_skills_prompt.py -w .. -s skills -t .github/instructions/skills.instructions.mdThe script expects skills to be organized in subdirectories, each containing a SKILL.md file:
skills/
├── web-research/
│ └── SKILL.md
├── code-review/
│ └── SKILL.md
└── data-analysis/
└── SKILL.md
Each SKILL.md file must have YAML frontmatter with name and description:
---
name: web-research
description: Comprehensive web research with source validation
---
# Web Research Skill
[Full skill instructions here...]- Scans the skills directory for subdirectories containing
SKILL.mdfiles - Extracts the
nameanddescriptionfrom each file's YAML frontmatter - Generates a formatted skills list
- Creates or Updates the target file:
- If the file doesn't exist: Creates it with a standard template
- If the file exists: Updates the skills list between markers, preserving other content
- If markers are missing or file is empty: Recreates the file
The script uses these markers to identify where to update the skills list:
- Start Marker:
**Available Skills:** - End Marker:
**How to Use Skills
Content between these markers is replaced with the new skills list. Content outside the markers is preserved.
Run the test suite using unittest:
# Run all tests
python -m unittest tests.test_generate_skills_prompt -v
# Run a specific test
python -m unittest tests.test_generate_skills_prompt.TestSkillsGenerator.test_create_new_file -vThe script handles common errors gracefully:
- Non-existent skills folder: Exits with error message
- Missing frontmatter: Skips skill with warning
- Invalid YAML: Skips skill with error message
- Missing markers: Recreates the file with template
- Empty target file: Recreates the file with template
The script provides informative logging:
INFO: Normal operations (creating/updating files, scanning skills)WARNING: Non-critical issues (missing frontmatter)ERROR: Critical issues (missing skills folder, file read errors)
All paths are resolved relative to the workspace root:
- Workspace root is resolved to an absolute path
- Skills folder path =
workspace_root / skills_path - Target file path =
workspace_root / target_path
This ensures consistent behavior regardless of where the script is run from.
When modifying this script:
- Update the docstrings
- Update this README
- Add/update tests as needed
- Run the test suite to verify changes
See CHANGES.md for version history.
This project is licensed under the MIT License. See the LICENSE file for details.
