| name | export-current-context |
| description | Export the current Agent conversation, project context, decisions, tasks, and artifacts into AI Platform Package and create or update a time-stamped revision. Use when the user says “导出当前所有内容”, “保存到 APP”, “同步当前 Agent”, “export current context”, or asks to archive the current session in AI Platform Package. |
Export Current Context
Export only user-visible context. Never include hidden reasoning, credentials, cookies, API keys, access tokens, or unrelated files.
Workflow
- Read references/package-schema.md.
- Collect the complete available conversation verbatim in chronological order. Never replace assistant responses with summaries such as “completed writing” or “created files”. Preserve each message role and original Markdown.
- Add relevant project state as documents: instructions, decisions, active tasks, durable memory, and artifacts. Read and include the full UTF-8 contents of text artifacts such as Markdown, text, JSON, YAML, and source code. Record paths only for binary files.
- Reuse a stable conversation
id across repeated exports of the same session. Never include version labels or timestamps such as -v2, _v3, or -20260729 in the ID. Put version labels in the title instead.
- Write the package JSON to a temporary file outside the project. Do not add export artifacts to the user's repository.
- Resolve the script path against this Skill directory, then run
python <skill-directory>/scripts/export_to_app.py --package <temporary-json-path> --validate-only. Correct every reported error.
- Run the same command without
--validate-only to send the package to APP.
- Report the APP receipt, imported conversation count, and export timestamp. Every explicit Agent export creates a new time revision, even when the visible content is unchanged.
- Delete the temporary package after a successful export.
The script starts AI Platform Package when it is not running. Set AI_PLATFORM_PACKAGE_EXE only when the installed executable cannot be discovered automatically.
Failure handling
- If APP cannot be found, keep the temporary package and report its exact path.
- If APP rejects the package, correct schema or sensitive-field errors and retry once.
- Do not bypass the localhost token or write directly to SQLite.