skill-importer
Skill Importer
Overview
The Skill Importer maintains a list of skills from remote GitHub repositories that can be imported into the local .github/skills/ directory. It uses a configuration file to track skill sources and provides both automated and manual import methods.
Quick Start (Automated)
The easiest way to import skills is using the automated script located in the scripts/ directory:
# Import all enabled skills
cd .github/skills/skill-importer
python3 scripts/import_skills.py --all
# Import a specific skill
python3 scripts/import_skills.py --skill sync-job-expert
# Update existing skills
python3 scripts/import_skills.py --all --update
See scripts/import_skills.py for the implementation.
Core Workflow
1. Managing Skill Sources
Skill sources are maintained in assets/skill-sources.yaml:
skills:
- name: skill-name
url: https://github.com/owner/repo/tree/branch/.github/skills/skill-name
enabled: true
description: Brief description of the skill
URL Format:
- GitHub tree URLs:
https://github.com/owner/repo/tree/branch/path/to/skill
2. Automated Importing (Recommended)
Use the import_skills.py script (located in scripts/ directory) for automated imports:
python3 scripts/import_skills.py --all # Import all enabled skills
python3 scripts/import_skills.py --skill NAME # Import specific skill
python3 scripts/import_skills.py --all --update # Update existing skills
python3 scripts/import_skills.py --all --dry-run # Preview without importing
The script automates all the manual steps below (cloning, copying, cleanup, verification).
3. Manual Importing Skills
To import a skill from a remote repository, follow these steps:
Step 1: Clone the Source Repository
# Clone the repository containing the skill
cd /tmp
git clone --depth 1 --branch <branch> --single-branch https://github.com/<owner>/<repo>.git <temp_dir>
Example:
cd /tmp
git clone --depth 1 --branch custom --single-branch https://github.com/kehwar/frappe.git frappe_custom
Step 2: Copy the Skill to Local Directory
# Copy the skill directory to your local .github/skills/ directory
cp -r <temp_dir>/.github/skills/<skill-name> /path/to/your/repo/.github/skills/
Example:
cp -r /tmp/frappe_custom/.github/skills/doctype-schema-expert /home/runner/work/frappe_soldamundo/frappe_soldamundo/.github/skills/
Step 3: Clean Up Temporary Files
# Remove the temporary clone
rm -rf <temp_dir>
Example:
rm -rf /tmp/frappe_custom
Step 4: Verify the Import
# Check that the skill was copied correctly
ls -la /path/to/your/repo/.github/skills/<skill-name>/
4. Adding New Skill Sources
To add a new skill source:
- Find the GitHub URL to the skill directory (tree view)
- Add an entry to
assets/skill-sources.yaml:
skills:
# ... existing skills ...
- name: new-skill-name
url: https://github.com/user/repo/tree/main/.github/skills/new-skill
enabled: true
description: What this skill does
- Import the skill using the automated script:
python3 scripts/import_skills.py --skill new-skill-name
5. Updating Skills
To update skills with the latest versions from remote sources:
Using the automated script (recommended):
python3 scripts/import_skills.py --skill <skill-name> --update # Update one skill
python3 scripts/import_skills.py --all --update # Update all skills
Manual method:
-
Remove the existing local skill directory:
rm -rf .github/skills/<skill-name> -
Follow the manual import steps above to re-download the skill
Important Notes
Warning: When updating, the local skill directory will be completely replaced. Any local modifications will be lost.
Network Dependency: Manual importing requires internet access to clone skills from GitHub.
Use Cases
-
Copying Skills Between Repositories
- Add skill sources from other projects
- Import them into current repository
- Keep them synchronized by re-importing when needed
-
Maintaining Skill Libraries
- Track multiple upstream skill sources
- Update skills manually when needed
- Disable/enable specific skills as needed
-
Distributing Common Skills
- Maintain canonical skill versions in one repository
- Import them into multiple dependent repositories
- Keep all copies in sync by re-importing
Complete Example
Here's a complete example of importing the doctype-schema-expert skill:
# Step 1: Add to skill-sources.yaml
cat >> .github/skills/skill-importer/assets/skill-sources.yaml << 'EOF'
- name: doctype-schema-expert
url: https://github.com/kehwar/frappe/tree/custom/.github/skills/doctype-schema-expert
enabled: true
description: Expert skill for working with Frappe DocType schemas
EOF
# Step 2: Clone the source repository
cd /tmp
git clone --depth 1 --branch custom --single-branch https://github.com/kehwar/frappe.git frappe_custom
# Step 3: Copy the skill
cp -r /tmp/frappe_custom/.github/skills/doctype-schema-expert .github/skills/
# Step 4: Clean up
rm -rf /tmp/frappe_custom
# Step 5: Verify
ls -la .github/skills/doctype-schema-expert/
More from kehwar/frappe_tweaks
frappe-tweaks-power-query-expert
Expert guidance for connecting Power Query (Power BI, Excel) to Frappe apps and reports. Use when building Power Query M code for Frappe data access, integrating Frappe reports with Power BI/Excel, implementing authentication for Power Query connections, handling heavy/long-running reports with report_long_polling API to avoid timeouts, applying column types and transformations, or troubleshooting Power Query caching and connection issues.
6open-observe-api-expert
Expert guidance for OpenObserve API integration in Frappe Tweaks. Use when creating, configuring, or troubleshooting OpenObserve API DocType, implementing send_logs() or search_logs() functionality, integrating with Server Scripts/Business Logic/Client-side code, debugging connection issues, or implementing logging, monitoring, error tracking, performance metrics, or audit trail use cases.
5frappe-ci-expert
Expert guidance for setting up CI/CD tests for Frappe apps. Use when users ask about GitHub Actions workflows, CI test setup, continuous integration for Frappe apps, running tests in CI environments, database setup for CI, bench configuration in CI, or automating tests for Frappe/ERPNext applications.
4workflow-expert
Expert guidance on Frappe Workflow system including workflow structure, states and transitions, workflow actions, email notifications, permission hooks (before_transition, after_transition, filter_workflow_transitions, has_workflow_action_permission), and best practices. Use when creating workflows, implementing workflow logic, understanding state transitions, working with workflow actions, configuring email notifications, or troubleshooting workflow-related issues.
4report-expert
Expert guidance on Frappe reports including report types, structure, creation workflow, and best practices. Use when creating standard script reports, query reports, understanding report structure, working with columns and filters, or troubleshooting report-related issues.
4api-reviewer
Security review and analysis for Frappe API endpoints decorated with @frappe.whitelist(). Use when reviewing API security, checking for permission vulnerabilities, scanning for unprotected endpoints, validating role restrictions, or auditing API endpoints for security best practices. Helps identify missing frappe.only_for(), frappe.has_permission(), or frappe.get_list() usage.
4