[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D53M4ZPQBARBMWNF4TNM93":3,"skill-same:01M7D53M4ZPQBARBMWNF4TNM93":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7D53M4ZPQBARBMWNF4TNM93","restore-legacy-sessions",null,"Use when ZCode needs to inspect, plan, or execute restoration of old ACP-era ZCode sessions from ~\u002F.zcode\u002Fv2\u002Fsessions into the new ZCode task\u002Fsession stores. Trigger when the user wants to choose a previous agent, select a workspace to restore, pick a specific historical conversation, dry-run legacy session migration, or reason about tasks-index.sqlite and ~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite consistency.","zai-org\u002FZCode","zai-org","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F223098841?v=4","01M7D3Y10287Y0CNVHSNZ4GD03","Z.ai","01M7D3Y10SKN81G21P442YTCYP",8689,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fapps\u002Fzcode-cli\u002Fpackages\u002Frestore-legacy-sessions-plugin\u002Fskills\u002Frestore-legacy-sessions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: restore-legacy-sessions\ndescription: Use when ZCode needs to inspect, plan, or execute restoration of old ACP-era ZCode sessions from ~\u002F.zcode\u002Fv2\u002Fsessions into the new ZCode task\u002Fsession stores. Trigger when the user wants to choose a previous agent, select a workspace to restore, pick a specific historical conversation, dry-run legacy session migration, or reason about tasks-index.sqlite and ~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite consistency.\n---\n\n# Restore Legacy Sessions\n\n## Overview\n\nUse this skill to guide old ACP-era ZCode session restoration. The first job is selection, not mutation: identify the source agent, the workspace, and the exact conversation before proposing any write to the new stores.\n\n## Stores\n\n- Legacy snapshots: `~\u002F.zcode\u002Fv2\u002Fsessions\u002F{workspaceHash}\u002F{legacyTaskId}.json`\n- Task index: `~\u002F.zcode\u002Fv2\u002Ftasks-index.sqlite`\n- New ZCode session DB: `~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite`\n\nUse `restoredTaskId = meta.acpSessionId || meta.taskId`. The legacy snapshot filename and `meta.taskId` are historical IDs; the app task list often uses `meta.acpSessionId` as the real task\u002Fsession ID.\n\nThe scan script defaults to the live legacy source `~\u002F.zcode\u002Fv2\u002Fsessions`; pass `--legacy-dir \u003Cpath>` only when the user explicitly asks to inspect another source directory.\n\nRestored ACP-era conversations are normal ZCode Agent history, so persisted provider fields must be `glm`. Treat the snapshot provider as legacy source context only; do not write task-index `migration_source` or `meta_json.migrationSource` for these restores. The `migrationSource` enum is reserved for the existing Claude Code native import path (`claudeCode`).\n\n## Selection Workflow\n\nResolve script paths relative to this `SKILL.md` directory. When running from another working directory, use the absolute path to the script inside the plugin cache.\n\nList source agents:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs agents\n```\n\nAfter the user chooses an agent, list workspaces for that agent:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs workspaces --agent glm\n```\n\nAfter the user chooses a workspace, list conversations:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs conversations --agent glm --workspace \u002FUsers\u002Fdev\u002Ftest\u002Fz-m\n```\n\nUse `--query \u003Ctext>` to narrow conversations by title, message content, task id, or session id. Use `--json` when feeding the result into `jq` or another script.\n\n## Presenting Choices\n\nAsk for one choice at a time unless the user already supplied enough filters:\n\n1. previous agent\u002Fprovider\n2. workspace to restore\n3. conversation to restore\n\nShow compact numbered options with title, updated time, message count, `restoredTaskId`, and restore state. If there are many options, show the top 20 by `updatedAt` and tell the user how to filter with `--query`.\n\nAfter the user chooses an exact conversation, run a dry run first:\n\n```bash\nnode scripts\u002Frestore-conversation.mjs --snapshot ~\u002F.zcode\u002Fv2\u002Fsessions\u002F\u003CworkspaceHash>\u002F\u003ClegacyTaskId>.json --dry-run\n```\n\nThen apply the restore:\n\n```bash\nnode scripts\u002Frestore-conversation.mjs --snapshot ~\u002F.zcode\u002Fv2\u002Fsessions\u002F\u003CworkspaceHash>\u002F\u003ClegacyTaskId>.json\n```\n\n## Restore States\n\n- `ready`: CLI DB and task-index both already contain the restored task id.\n- `needs-cli-db`: task-index exists, but `~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite` has no session row; rebuild the real session from the legacy snapshot.\n- `needs-task-index`: CLI DB exists, but task-index is missing; backfill task-index only.\n- `needs-full-import`: both stores are missing; import session history and then index it.\n\n## Mutation Rules\n\nDo not write data during selection. Before any apply step:\n\n- Create timestamped backups of `tasks-index.sqlite` and `db.sqlite`.\n- Keep writes idempotent; never overwrite a new real session that already contains user continuation messages.\n- Preserve task-index `pinned`, `archived`, `deleted`, and `title_overridden`.\n- Use `workspaceKey = workspaceIdentity?.trim() || workspacePath` for identity\u002Fisolation semantics.\n- Write task-index `provider = \"glm\"` and CLI message `providerID = \"glm\"` regardless of the snapshot provider.\n- Keep `task-index.meta_json.taskId = restoredTaskId`; never leave it as the old snapshot `meta.taskId`.\n- Leave task-index `migration_source` empty for ACP-era restores. If a previous restore wrote `legacy-session`, clear it before validating visibility.\n- Write CLI DB `part` rows for visible text and tool calls. The app detail page renders from `part`; `message.data.content` alone is not enough.\n- Preserve assistant threading by setting `parentID` to the preceding user message id when possible.\n- Do not start old ACP runtimes. Restore from snapshots and new ZCode stores only.\n\nFor app code changes, update a spec under `docs\u002F` before implementation and run `pnpm typecheck` and `pnpm lint`.\n","# Restore Legacy Sessions\n\n## Overview\n\nUse this skill to guide old ACP-era ZCode session restoration. The first job is selection, not mutation: identify the source agent, the workspace, and the exact conversation before proposing any write to the new stores.\n\n## Stores\n\n- Legacy snapshots: `~\u002F.zcode\u002Fv2\u002Fsessions\u002F{workspaceHash}\u002F{legacyTaskId}.json`\n- Task index: `~\u002F.zcode\u002Fv2\u002Ftasks-index.sqlite`\n- New ZCode session DB: `~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite`\n\nUse `restoredTaskId = meta.acpSessionId || meta.taskId`. The legacy snapshot filename and `meta.taskId` are historical IDs; the app task list often uses `meta.acpSessionId` as the real task\u002Fsession ID.\n\nThe scan script defaults to the live legacy source `~\u002F.zcode\u002Fv2\u002Fsessions`; pass `--legacy-dir \u003Cpath>` only when the user explicitly asks to inspect another source directory.\n\nRestored ACP-era conversations are normal ZCode Agent history, so persisted provider fields must be `glm`. Treat the snapshot provider as legacy source context only; do not write task-index `migration_source` or `meta_json.migrationSource` for these restores. The `migrationSource` enum is reserved for the existing Claude Code native import path (`claudeCode`).\n\n## Selection Workflow\n\nResolve script paths relative to this `SKILL.md` directory. When running from another working directory, use the absolute path to the script inside the plugin cache.\n\nList source agents:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs agents\n```\n\nAfter the user chooses an agent, list workspaces for that agent:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs workspaces --agent glm\n```\n\nAfter the user chooses a workspace, list conversations:\n\n```bash\nnode scripts\u002Fscan-legacy-sessions.mjs conversations --agent glm --workspace \u002FUsers\u002Fdev\u002Ftest\u002Fz-m\n```\n\nUse `--query \u003Ctext>` to narrow conversations by title, message content, task id, or session id. Use `--json` when feeding the result into `jq` or another script.\n\n## Presenting Choices\n\nAsk for one choice at a time unless the user already supplied enough filters:\n\n1. previous agent\u002Fprovider\n2. workspace to restore\n3. conversation to restore\n\nShow compact numbered options with title, updated time, message count, `restoredTaskId`, and restore state. If there are many options, show the top 20 by `updatedAt` and tell the user how to filter with `--query`.\n\nAfter the user chooses an exact conversation, run a dry run first:\n\n```bash\nnode scripts\u002Frestore-conversation.mjs --snapshot ~\u002F.zcode\u002Fv2\u002Fsessions\u002F\u003CworkspaceHash>\u002F\u003ClegacyTaskId>.json --dry-run\n```\n\nThen apply the restore:\n\n```bash\nnode scripts\u002Frestore-conversation.mjs --snapshot ~\u002F.zcode\u002Fv2\u002Fsessions\u002F\u003CworkspaceHash>\u002F\u003ClegacyTaskId>.json\n```\n\n## Restore States\n\n- `ready`: CLI DB and task-index both already contain the restored task id.\n- `needs-cli-db`: task-index exists, but `~\u002F.zcode\u002Fcli\u002Fdb\u002Fdb.sqlite` has no session row; rebuild the real session from the legacy snapshot.\n- `needs-task-index`: CLI DB exists, but task-index is missing; backfill task-index only.\n- `needs-full-import`: both stores are missing; import session history and then index it.\n\n## Mutation Rules\n\nDo not write data during selection. Before any apply step:\n\n- Create timestamped backups of `tasks-index.sqlite` and `db.sqlite`.\n- Keep writes idempotent; never overwrite a new real session that already contains user continuation messages.\n- Preserve task-index `pinned`, `archived`, `deleted`, and `title_overridden`.\n- Use `workspaceKey = workspaceIdentity?.trim() || workspacePath` for identity\u002Fisolation semantics.\n- Write task-index `provider = \"glm\"` and CLI message `providerID = \"glm\"` regardless of the snapshot provider.\n- Keep `task-index.meta_json.taskId = restoredTaskId`; never leave it as the old snapshot `meta.taskId`.\n- Leave task-index `migration_source` empty for ACP-era restores. If a previous restore wrote `legacy-session`, clear it before validating visibility.\n- Write CLI DB `part` rows for visible text and tool calls. The app detail page renders from `part`; `message.data.content` alone is not enough.\n- Preserve assistant threading by setting `parentID` to the preceding user message id when possible.\n- Do not start old ACP runtimes. Restore from snapshots and new ZCode stores only.\n\nFor app code changes, update a spec under `docs\u002F` before implementation and run `pnpm typecheck` and `pnpm lint`.\n",{"name":5,"description":7},"main","fec975905a2abd4c07e35c40d51fa097a2258ec9","apps\u002Fzcode-cli\u002Fpackages\u002Frestore-legacy-sessions-plugin\u002Fskills\u002Frestore-legacy-sessions",2710,"https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode","https:\u002F\u002Fzcode.z.ai\u002F","https:\u002F\u002Fgithub.com\u002Fzai-org","https:\u002F\u002Fwww.zhipuai.cn\u002Fen","ChatGLM, GLM-4.5, CogVLM, CodeGeeX, CogView, CogVideoX | CogDL, AMiner | Zhipu.ai (Z.ai)","2026-11-13 16:21:40",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add zai-org\u002FZCode --skill restore-legacy-sessions",{"tool":40,"command":41},"bunx","bunx skills add zai-org\u002FZCode --skill restore-legacy-sessions",{"tool":43,"command":44},"pnpm","pnpm dlx skills add zai-org\u002FZCode --skill restore-legacy-sessions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fapps\u002Fzcode-cli\u002Fpackages\u002Frestore-legacy-sessions-plugin\u002Fskills\u002Frestore-legacy-sessions\u002FSKILL.md",true,[48,54],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"scripts\u002Frestore-conversation.mjs","SCRIPT","脚本",22137,"https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fapps\u002Fzcode-cli\u002Fpackages\u002Frestore-legacy-sessions-plugin\u002Fskills\u002Frestore-legacy-sessions\u002Fscripts\u002Frestore-conversation.mjs",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"scripts\u002Fscan-legacy-sessions.mjs",14471,"https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fapps\u002Fzcode-cli\u002Fpackages\u002Frestore-legacy-sessions-plugin\u002Fskills\u002Frestore-legacy-sessions\u002Fscripts\u002Fscan-legacy-sessions.mjs",[59,66,73,80,87,94],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7D57RTFKZH4SFFWF6NXSQ62","plugin-mcp-ping","E2E workspace Plugin skill marker","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Fplugin-mcp-skill\u002Fe2e-plugin-mcp-ping\u002Fskills\u002Fplugin-mcp-ping\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7D57NRW93T0ETX2QPQY3JCP","e2e-ext-compat-plain","PLM-EXT-STORE fixture skill for e2e-ext-compat-plain.","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Ffs\u002Fplugins\u002Fplugin-store-extension-compat\u002Fstore-market\u002Fplugins\u002Fe2e-ext-compat-plain\u002Fskills\u002Fe2e-ext-compat-plain\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D57JYKJK5A4VW7Y5MYEA7R","e2e-ext-compat-ok","PLM-EXT-STORE fixture skill for e2e-ext-compat-ok.","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Ffs\u002Fplugins\u002Fplugin-store-extension-compat\u002Fstore-market\u002Fplugins\u002Fe2e-ext-compat-ok\u002Fskills\u002Fe2e-ext-compat-ok\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7D57FZQKN28QJJ0HVG93ACN","e2e-ext-compat-installed","PLM-EXT-STORE fixture skill for e2e-ext-compat-installed.","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Ffs\u002Fplugins\u002Fplugin-store-extension-compat\u002Fstore-market\u002Fplugins\u002Fe2e-ext-compat-installed\u002Fskills\u002Fe2e-ext-compat-installed\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7D57C9W30WJ3NJDAYX2MN0J","e2e-ext-compat-future","PLM-EXT-STORE fixture skill for e2e-ext-compat-future.","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Ffs\u002Fplugins\u002Fplugin-store-extension-compat\u002Fstore-market\u002Fplugins\u002Fe2e-ext-compat-future\u002Fskills\u002Fe2e-ext-compat-future\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7D579KKRR6D2GPVW4J4QWVT","e2e-store-skill-b","E2E store fixture skill b","https:\u002F\u002Fgithub.com\u002Fzai-org\u002FZCode\u002Fblob\u002Fmain\u002Fpackages\u002Fdesktop\u002Ftest\u002Fe2e\u002Ffixtures\u002Ffs\u002Fplugins\u002Fplugin-extension-reads\u002Fstore-market\u002Fplugins\u002Fe2e-ext-store-b\u002Fskills\u002Fe2e-store-skill-b\u002FSKILL.md",[],[]]