migrate-workflows
Automatically migrate legacy workflows (.agents/workflows/ or ~/.gemini/config/workflows/) to skills (.agents/skills/ or ~/.gemini/config/skills/). Scans for existing workflows, creates target SKILL.md files, and archives old workflow files.
- License 许可
- MIT
- 最近更新
- 2026-08-31
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- migrate-workflows
- description
- Automatically migrate legacy workflows (.agents/workflows/ or ~/.gemini/config/workflows/) to skills (.agents/skills/ or ~/.gemini/config/skills/). Scans for existing workflows, creates target SKILL.md files, and archives old workflow files.
03 SKILL.md 正文
Migrate Workflows to Skills
Use this skill to autonomously migrate legacy workflow files to modern skills.
Workflows (.agents/workflows/*.md or _agents/workflows/*.md) are deprecated.
Skills (.agents/skills/<name>/SKILL.md or _agents/skills/<name>/SKILL.md)
provide all the capabilities of workflows, plus:
- First-class slash command support (typing
/<name>in the chat input box). - Semantic agent discovery (the agent can automatically invoke the skill when relevant).
- Multi-file capabilities (supporting helper scripts, templates, and references).
Instructions for the Agent
When this skill is invoked, you must execute the migration automatically by performing the following steps:
Step 1: Discover Existing Workflows
Scan global and workspace (if applicable) configuration directories
using filesystem search tools for legacy .md workflow files and
workflows.json manifests:
-
Global Workflows:
~/.gemini/config/global_workflows/*.md~/.gemini/config/workflows/*.md- Manifests:
~/.gemini/config/workflows.json
-
Workspace Workflows (for each open workspace root and parent directories):
<workspace_root>/.agents/workflows/*.md<workspace_root>/_agents/workflows/*.md<workspace_root>/.agent/workflows/*.md<workspace_root>/_agent/workflows/*.md- Manifests:
<workspace_root>/{.agents,_agents,.agent,_agent}/workflows.json
Check each discovered workflow against existing skills: For each workflow,
check if <target_skill_dir>/<name>/SKILL.md already exists to determine
whether it has already been migrated.
Present the discovered workflows, their migration targets, and status:
| Scope | Workflow Name | Source Path | Target Skill Path | Status |
|---|---|---|---|---|
| Global | <name> |
~/.gemini/config/global_workflows/<name>.md |
~/.gemini/config/skills/<name>/SKILL.md |
Pending / Already Migrated |
| Global | <name> |
~/.gemini/config/workflows/<name>.md |
~/.gemini/config/skills/<name>/SKILL.md |
Pending / Already Migrated |
| Workspace | <name> |
<workspace>/.agents/workflows/<name>.md |
<workspace>/.agents/skills/<name>/SKILL.md |
Pending / Already Migrated |
| Workspace | <name> |
<workspace>/_agents/workflows/<name>.md |
<workspace>/_agents/skills/<name>/SKILL.md |
Pending / Already Migrated |
- If no workflow files are found (or all have already been cleaned up), inform the user that their workspace and global configs are already clean.
- If all workflows are
Already Migrated, inform the user that targetSKILL.mdfiles already exist and proceed directly to archiving/cleaning up the remaining legacy files without overwriting existing skills.
Step 2: Convert Each Workflow to a Skill (Idempotent Execution)
For each workflow file:
-
Check existing skill (Overwrite Protection):
- If
<target_dir>/<name>/SKILL.mdalready exists, do not overwrite it (preserves any manual edits or improvements made after prior migrations). Skip to Step 2.4 (cleanup/archiving). - If
<target_dir>/<name>/SKILL.mddoes not exist, proceed with conversion.
- If
-
Read and format the source workflow:
-
Read the source
.mdfile content. -
Inspect existing frontmatter (if any) and markdown body.
-
Extract the workflow's title, description, or purpose from the content.
-
Ensure standard YAML frontmatter with
nameanddescription:--- name: <name> description: <concise one-sentence description of what the skill does and when to use it> --- # <Title> <Workflow instructions and guidelines> -
Retain all prompt instructions, arguments, and guidelines from the original workflow.
-
-
Write the target skill file:
- Create the directory:
<target_dir>/<name>/(e.g.<workspace>/.agents/skills/<name>/or~/.gemini/config/skills/<name>/) - Write the file:
<target_dir>/<name>/SKILL.md
- Create the directory:
-
Archive the legacy workflow safely:
- Rename the old
.mdworkflow file to<name>.md.bak(e.g.mv my_workflow.md my_workflow.md.bak). Do not permanently delete the file so that the original content is safely preserved as a backup. - Remove migrated workflow entries from any
workflows.jsonmanifests.
- Rename the old
Step 3: Verify and Confirm
- Confirm all target
SKILL.mdfiles exist and legacy workflows have been renamed to.md.bak. - Inform the user of the final summary:
- Newly migrated skills (
SKILL.md). - Previously migrated skills skipped (preserved existing
SKILL.mdfiles). - Legacy workflow files safely archived as
.md.bak.
- Newly migrated skills (
- Remind the user that the skills are immediately available:
- Slash Commands: Typing
/<name>in chat invokes the skill. - Agent Discovery: The agent will discover and use the skill when relevant tasks arise.
- Slash Commands: Typing
04 同仓库更多 Skills
xcode-project-setup
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
workflow-skill-creator
Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say "make this a skill", "create a skill from what we just did", "package this workflow" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).
verify-and-stop
Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.
verification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always