

___x_cmd_kimi_offload(){

    local from=""
    local to=""
    local prompt=""

    while [ $# -gt 0 ]; do
        case "$1" in
            -h|--help)      ___x_cmd help -m kimi offload "$@" ; return 0 ;;
            --from)         from="$2" ;     arg:2:shift ;;
            --to)           to="$2" ;       arg:2:shift ;;
            -p|--prompt)    prompt="$2";    arg:2:shift ;;
            *)              break ;;
        esac
    done

    local topic="$1"
    [ -n "$topic" ]     ||  N=kimi M="Please provide the topic of content to offload." log:ret:1

    local final_prompt="Extract content related to the topic '${topic}'.
Ensure accuracy: verify all extracted content is correct and relevant. No fabrication.
"

    if [ -z "$from" ]; then
        final_prompt="${final_prompt}
Try to search the topic of the files used for AI. Like CLAUDE.md, AGENTS.md, or other markdown files that used by AI.
"
    else
        final_prompt="${final_prompt}
The contents to offload of this topic currently in the file -> $from
This is one of the two files you can ONLY change. The other file is the contents you will finally offload to.
"
    fi

    if [ -n "$to" ]; then
        final_prompt="${final_prompt}
Please put all these contents into this file -> $to "
    fi

    [ -z "$prompt" ] || final_prompt="
Please follow the prompt:

$prompt

$final_prompt
"

    ___x_cmd kimi --print -p "$final_prompt"

}
