SuperAPI AI Directory

skill-backup

General & other

View repository

Updated 10-15 23:48

About this skill

Skill Backup

The personal skill index is divided into two categories:Self-built skillsBack up their source files;External skillsKeep only the upstream reference and installation information in the README.

Managed installation directories (such as .agents/skills/ or plugin caches) are not reliable skill sources: they may be overwritten or deleted by the package manager. If the user has made modifications in one of them, first copy them to a directory owned by the user, then use that directory as the subsequent backup source.

Workflow

Step 1: Locate the index repository and classify

Prefer the local checkout or repository address provided by the user; otherwise look for a common local clone, and if necessary use L-yifan/skills to create a named temporary clone. Record the actual working directory, whether it is a temporary clone created for this task, and its initial git status. A checkout provided by the user is never a temporary directory and must not be deleted automatically.

Then classify: GitHub URLs, marketplace links, or third-party skills are by defaultExternal skills; local directories, or skills newly created by the user or written for this repository, areSelf-built skills. When the user explicitly requests vendoring, treat them as self-built skills.

Completion condition: a writable index repository working directory, the initial working tree state, and a single classification have been determined.

Step 2A: Record external skills

Read the upstream SKILL.md and its official installation instructions; add or update a row in the README's external skills table, preserving the source and a verifiable installation command. The description follows the language and format of the table it is in.

Completion condition: the README entry can be traced back to the upstream; the installation command comes from the upstream rather than being guessed.

Step 2B: Verify the self-built skill source

Prefer the user-owned source directory specified by the user. When a copy needs to be found, first list the files of each candidate, then compare with the old version in the repository; choose the candidate whose "files are complete and consistent with the intent of this change"; modification time is used only as a tiebreaker among equivalent candidates. Managed installation directories can only serve as recovery candidates, not as the sole trusted source.

If the source directory is missing files that were in the old version of the repository, first determine whether the difference is an intentional deletion or a loss of source files; if it cannot be determined, keep the old files and report to the user.

Completion condition: the selected source directory and the basis for the selection have been recorded;SKILL.md, reference, and script file lists have all been verified against the old version. If a user-owned intermediate source copy was created for a managed installation directory, also record its path and its "intermediate for this task only" identity.

Step 3: Sync self-built skills and README

Sync the verified complete source directory to the skill directory in the index repository, and apply only confirmed deletions. Update the README's self-built skill entry, description, and version date (if the index uses version dates).

Completion condition: the target directory contains all verified files; the README entry reflects the current skill; the repository diff contains no unexplained deletions or extra files.

Step 4: Verify, publish, and deliver

Check git diff and git status --short; verify that the README table has a consistent number of columns; for self-built skills, verify that the frontmatter's name and description both exist and are non-empty. Commit, push, or create a PR only when the user requests it.

Temporary directory cleanup rules:

  • If a temporary clone or intermediate source copy was created for this task, and the push requested by the user has succeeded: confirm that the commit is on the remote,git status --short When it is empty and the branch is no longer ahead of the remote, automatically delete these two temporary directories.
  • If authorization to commit/push has not been obtained, the push fails, or there are still uncommitted changes: keep the temporary clone and the relay source copy, clearly report the paths and the reason for keeping them, and do not discard unpublished content just to clean up.
  • Checkouts explicitly provided by the user, the original self-built skill directory, and other pre-existing directories must never be automatically deleted.
  • Before cleanup, first resolve the absolute path of each target and confirm that it is within the temporary parent directory created this time; after cleanup, verify that the path no longer exists.

The final reply lists the changed files, release status, and complete installation commands: for self-built skills, use the actual index repository and sync directory names; for external skills, use only upstream verified commands. For unpushed self-built skills, state that the command will obtain this version after pushing; when there is no reliable external command, clearly state that it cannot be safely inferred.

Completion conditions: all changes have been verified and explained; temporary directories have been cleaned up according to the above wrap-up rules, or the retained paths and reasons have been explained; there are no guessed installation commands in the delivery.