← Về thư mục
📄 / / proc / 1985 / task / 2049 / cwd / .gemini / antigravity-cli / builtin / skills / migrate-workflows / SKILL.md

name: migrate-workflows description: Automatically migrate legacy workflows to modern skills across global and workspace configurations. Scans for existing workflows, creates target SKILL.md files, and safely archives old workflow files.


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:


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:

  1. Global Workflows:

    • ~/.gemini/config/global_workflows/*.md
    • ~/.gemini/config/workflows/*.md
    • Manifests: ~/.gemini/config/workflows.json
  2. 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

[!NOTE] OS-Specific Path and Output Formatting: - Adapt path resolution to the host OS (%USERPROFILE% on Windows vs. $HOME on macOS/Linux). - When presenting tables, progress, or summaries to the user, always format paths using the host OS path separators (e.g. \ on Windows such as %USERPROFILE%\.gemini\config\global_workflows\<name>.md, / on macOS/Linux).

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

Step 2: Convert Each Workflow to a Skill (Idempotent Execution)

For each workflow file:

  1. Check existing skill (Overwrite Protection):

    • If <target_dir>/<name>/SKILL.md already 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.md does not exist, proceed with conversion.
  2. Read and format the source workflow:

    • Read the source .md file 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 name and description:

      ```markdown

      name: description:


      </h1> <p><Workflow instructions and guidelines> ``` - Retain all prompt instructions, arguments, and guidelines from the original workflow.</p> </li> </ul> </li> <li> <p><strong>Write the target skill file</strong>:</p> <ul> <li>Create the directory: <code><target_dir>/<name>/</code> (e.g. <code><workspace>/.agents/skills/<name>/</code> or <code>~/.gemini/config/skills/<name>/</code>)</li> <li>Write the file: <code><target_dir>/<name>/SKILL.md</code></li> </ul> </li> <li> <p><strong>Archive the legacy workflow safely</strong>:</p> <ul> <li>Rename the old <code>.md</code> workflow file to <code><name>.md.bak</code> (e.g. using <code>mv my_workflow.md my_workflow.md.bak</code> on Linux/macOS, or using <code>Move-Item</code> / file tools on Windows). Do not permanently delete the file so that the original content is safely preserved as a backup.</li> <li>Remove migrated workflow entries from any <code>workflows.json</code> manifests.</li> </ul> </li> </ol> <hr /> <h3 id="step-3-verify-and-confirm">Step 3: Verify and Confirm</h3> <ol> <li>Confirm all target <code>SKILL.md</code> files exist and legacy workflows have been renamed to <code>.md.bak</code>.</li> <li>Inform the user of the final summary:<ul> <li>Newly migrated skills (<code>SKILL.md</code>).</li> <li>Previously migrated skills skipped (preserved existing <code>SKILL.md</code> files).</li> <li>Legacy workflow files safely archived as <code>.md.bak</code>.</li> </ul> </li> </ol></div> <script> document.querySelectorAll('h1,h2,h3,h4').forEach(h => { h.addEventListener('click', function() { // toggle current heading indicator var s = this.style || this; s = this; // find all siblings after this heading up to next same-or-higher-level heading var tag = this.tagName; var els = []; var next = this.nextElementSibling; var levels = ['H1','H2','H3','H4','H5','H6']; var myIdx = levels.indexOf(tag); while (next && next.tagName !== undefined) { var nt = next.tagName; var nIdx = levels.indexOf(nt); if (nIdx >= 0 && nIdx <= myIdx) break; // reached same or higher heading els.push(next); next = next.nextElementSibling; } var collapsed = this.classList.toggle('collapsed'); els.forEach(function(el) { el.classList.toggle('collapsed-content', collapsed); }); }); }); </script> </body></html>