global-prompts-sync
Synchronizes prompt files (agents, rules, commands) from the skill's prompts directory to both GitHub Copilot and OpenCode global configuration directories. Use when the user wants to update their AI editor prompt libraries.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Global Prompts Sync
Overview
This skill synchronizes prompt files from the prompts/ directory to both GitHub Copilot and OpenCode global configuration directories:
- agents: Agent definition files
- rules: Instruction/rules files
- commands: Command prompt files
Directory Structure
global-prompts-sync/
├── SKILL.md
├── scripts/
│ └── sync_prompts.py
└── prompts/
├── agents/ # Agent files (*.agent.md for Copilot, *.md for OpenCode)
├── rules/ # Instruction files (*.instructions.md for Copilot, merged into AGENTS.md for OpenCode)
└── commands/ # Command files (*.prompt.md for Copilot, *.md for OpenCode)
Target Directories
GitHub Copilot
All files are synced to:
- Windows:
/mnt/c/Users/<USERNAME>/AppData/Roaming/Code/User/prompts - File naming conventions:
- agents:
*.agent.md - rules:
*.instructions.md - commands:
*.prompt.md
- agents:
OpenCode
Files are synced to separate directories:
- agents:
~/.config/opencode/agent/or/mnt/c/Users/<USERNAME>/.config/opencode/agent/ - rules:
~/.config/opencode/AGENTS.md(merged from all rules files, front matter removed) - commands:
~/.config/opencode/command/or/mnt/c/Users/<USERNAME>/.config/opencode/command/
Usage
To synchronize prompts to both GitHub Copilot and OpenCode:
python3 {path}/scripts/sync_prompts.py
The script will:
- Detect the environment (WSL/Windows)
- Determine the Windows username
- Sync agents, rules, and commands to GitHub Copilot directories
- Sync agents, rules (merged), and commands to OpenCode directories
- Handle file naming conventions for each editor
- Report the status of each operation
Options
Run with specific targets:
# Sync to GitHub Copilot only
python3 scripts/sync_prompts.py --target copilot
# Sync to OpenCode only
python3 scripts/sync_prompts.py --target opencode
# Sync to both (default)
python3 scripts/sync_prompts.py
Adding Prompts
-
Agents: Add
.mdfiles toprompts/agents/ -
Rules: Add
.mdfiles toprompts/rules/ -
Commands: Add
.mdfiles toprompts/commands/
The script will automatically handle naming conventions for each target editor.
Special Rules Processing
For OpenCode, multiple rule files are merged into a single AGENTS.md file:
- Front matter (YAML) is removed from each file
- Files are concatenated in alphabetical order
- A single
AGENTS.mdis created in OpenCode's config directory
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!