Skill v1.0.1
currentAutomated scan100/100+5 new
version: "1.0.1" name: repo-mirror-config description: Create, explain, review, or repair RepoMirror schemaVersion 3 import JSON. Use when a user supplies GitHub repository or directory links, wants to restore or move a configuration after local folders changed, asks why an import failed, or needs an importable configuration checked against current path and source rules.
RepoMirror Configuration
Create only schemaVersion: 3 JSON. Read references/schema.md before generating, modifying, or reviewing a configuration. RepoMirror rejects version-2 files.
Workflow
- Ask only for unknown essentials: one or more root directory paths, folder group paths, GitHub links, optional destination names, and mirror preference. For an ambiguous
treeorblobURL whose branch may contain/, ask for the full branch name instead of guessing. - Give every Root Directory a unique
idand an absolutepath. A moved or missing local root is valid when its existing ancestors are accessible directories. When repairing an existing configuration, preserve its saved path unless the user provides a new location; do not guess where a folder moved. Optionalnameis a display label. - Convert each GitHub URL into exactly one Sync Item with that item's
rootId. Accept only HTTPSgithub.comrepository,tree/<branch>/<path>, orblob/<branch>/<path>directory URLs without credentials, ports, query strings, or fragments. Normalize a repository clone URL ending in.gitto a plain repositorysourceUrl. A repository URL usesnullforbranchandsourcePath; a directory URL sets both fields to the exact branch and remaining directory path. A file path may pass configuration validation but fails at preview. - Represent folder groups as
{ rootId, path }objects. Include every ancestor of a nested path (community/toolsalso needscommunity). UsefolderGroup: ""only for a root-level Sync Item. - Generate unique IDs for new roots and items. Preserve valid existing IDs and synchronization history when repairing a configuration. For new items, set
lastStatustonot_syncedand the threelast*fields tonullunless the user provides real synchronization state. - Validate the finished JSON against the checklist below. Return JSON in a fenced
jsonblock, followed by only necessary notes.
Final Checklist
- Use the exact top-level fields from the reference; do not add comments or unknown fields.
- Set
schemaVersionto3. - Keep every root
pathabsolute. One root must not be inside another, including after resolving any existing path ancestors. A missing root alone is not an import error. - Keep folder group paths unique per root, non-empty, relative, and normalized: no leading/trailing slash, repeated slash, backslash,
.or..segment. - Keep every
idunique across the entire configuration and every final<folderGroup>/<destinationName>path unique within its root. - Require each item
rootIdto match a Root Directory, and each non-emptyfolderGroupto match a Folder Group under that root. - Require
repoUrlto match itssourceUrlrepository. - Use HTTPS
github.comURLs without credentials, custom ports, fragments, or query strings. - For a directory link, require
branchandsourcePathto exactly match the URL. - Do not claim a configuration is importable when any check is uncertain; explain the failing field and request the smallest missing detail.
Safety
Explain that importing or adding a link changes only application configuration; it does not fetch the Source, create a missing local folder, or synchronize files. Confirmed sync creates missing folders. If a Root Directory was already moved in Finder and its old path is missing, direct the user to “重新关联现有文件夹” before syncing so RepoMirror does not recreate the old path. Warn that mirror: true permits RepoMirror to delete ordinary destination files absent from the Source after preview confirmation.