AgentSkillsCN

Skill Sync

技能同步

SKILL.md

name: skill-sync description: > Sync skill metadata with the Auto-invoke sections in AGENTS.md. Trigger: When you change a skill's metadata (metadata.scope/metadata.auto_invoke), regenerate the Auto-invoke tables, or run ./skills/skill-sync/assets/sync.sh. license: MIT metadata: author: GGA Team version: "1.0" scope: [root] auto_invoke: - "After creating/modifying a skill" - "Regenerate AGENTS.md Auto-invoke tables (sync.sh)" - "Troubleshoot why a skill is missing from AGENTS.md auto-invoke" allowed-tools: Read, Edit, Write, Glob, Grep, Bash

When to Use It

  • After creating a new skill under skills/.
  • After updating the metadata (scope or auto_invoke) of an existing skill.
  • When troubleshooting a missing skill entry in an AGENTS.md Auto-invoke section.

Critical Patterns

  • ALWAYS run the script from a compatible shell (Git Bash on Windows) to avoid incompatibilities.
  • NEVER edit the "Auto-invoke Capabilities" tables manually; the script overwrites them.
  • ALWAYS ensure SKILL.md has valid YAML frontmatter before syncing.
  • ALWAYS include the root scope when the skill must appear in the top-level AGENTS.md.

Purpose (Overview)

Every skill that should show up in an Auto-invoke section must define these metadata fields.

auto_invoke can be a single string or a list of actions:

yaml
metadata:
  author: YourName
  version: "1.0"
  scope: [root, backend]                   # AGENTS.md files to update

  # Option A: single action
  auto_invoke: "Creating/modifying components"

  # Option B: multiple actions
  # auto_invoke:
  #   - "Creating/modifying components"
  #   - "Refactoring business logic"

Scope Values

ScopeUpdated File
rootAGENTS.md (root of project)
copilot.github/copilot-instructions.md
<custom>Auto-detected AGENTS.md in subdirectories matching scope name

Examples:

  • scope: [root] → Updates /AGENTS.md
  • scope: [root, backend] → Updates /AGENTS.md and /Backend/AGENTS.md (if exists)
  • scope: [api, web] → Updates any subdirectory containing "api" or "web" with AGENTS.md

Skills can define multiple scopes: scope: [root, backend, api]


Usage

After Creating/Modifying a Skill

bash
./skills/skill-sync/assets/sync.sh

What the Script Does

  1. Reads every skills/*/SKILL.md file.
  2. Extracts metadata.scope and metadata.auto_invoke.
  3. Generates Auto-invoke tables for each AGENTS.md.
  4. Rewrites the ### Auto-invoke Skills section in every file.

Commands

bash
# Sync every AGENTS.md
./skills/skill-sync/assets/sync.sh

# Dry run (preview changes)
./skills/skill-sync/assets/sync.sh --dry-run

# Sync a specific scope
./skills/skill-sync/assets/sync.sh --scope backend