---
name: load-checkpoint
description: Load a reusable checkpoint, and expand the topic and its related information saved in the checkpoint into the context.
argument-hint: "<name>"
---

Search for and load a checkpoint file (relative path from this skill file: `../../checkpoints/checkpoint-<name>-<timestamp>.md`) to restore relevant info, templates, and precautions.

## Inputs

1.  **Name**: The name of the checkpoint to search for.

Parse this from the user's argument (e.g., `new-skill`). If the argument is not provided, list all available checkpoints and ask the user to select one.

## Checkpoint Selection Logic

1.  **Locate Checkpoints**:
    -   Look inside the directory `../../checkpoints/` relative to this skill file.
2.  **Find Matches**:
    -   If the argument (name) is provided:
        -   Search for checkpoint files whose names contain or match the argument.
        -   If exactly one match is found, select it.
        -   If multiple matches are found, load the checkpoint with the latest timestamp.
        -   If no matches are found, notify the user, list all available checkpoint files, and ask them to select one.
    -   If the argument is not provided:
        -   If there is only one checkpoint file, select it.
        -   If there are multiple checkpoint files, list them all and ask the user to choose which one to load.
        -   If there are no checkpoint files, inform the user that no checkpoints were found.

## Loading Checkpoint

Once a checkpoint file is selected and read, perform the following steps:

1.  **Restore Relevant Info, Templates, and Precautions**:
    -   Expand relevant info (background, design, domain knowledge, etc.), templates, and precautions into the context.
