Skip to content

Signal-Loop/AgentSkillsPattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skills Instruction Generator for VS Code Copilot

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.

AgentSkillsPattern

Skills Pattern

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).

Resources

Skill Repositories

Features

  • 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+)

Prompt text

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

Installation

No installation required! This script uses only standard Python libraries. Just ensure you have Python 3.7 or later installed.

Usage

Basic Syntax

python generate_skills_prompt.py -w <workspace_root> -s <skills_folder> -t <target_file>

Arguments

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)

Examples

Using default workspace (current directory)

python generate_skills_prompt.py -s skills -t .github/instructions/skills.instructions.md

Explicit workspace root

# 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.md

Workspace with spaces

python generate_skills_prompt.py -w "C:\My Workspace" -s skills -t ".github/instructions/skills.instructions.md"

Using parent directory as workspace

python generate_skills_prompt.py -w .. -s skills -t .github/instructions/skills.instructions.md

Skills Directory Structure

The 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

SKILL.md Format

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...]

How It Works

  1. Scans the skills directory for subdirectories containing SKILL.md files
  2. Extracts the name and description from each file's YAML frontmatter
  3. Generates a formatted skills list
  4. 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

Markers

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.

Testing

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 -v

Error Handling

The 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

Logging

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)

Path Resolution

All paths are resolved relative to the workspace root:

  1. Workspace root is resolved to an absolute path
  2. Skills folder path = workspace_root / skills_path
  3. Target file path = workspace_root / target_path

This ensures consistent behavior regardless of where the script is run from.

Contributing

When modifying this script:

  1. Update the docstrings
  2. Update this README
  3. Add/update tests as needed
  4. Run the test suite to verify changes

Changes

See CHANGES.md for version history.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Skills Instruction Generator for VS Code Copilot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages