AgentSkillsCN

stateResume

从现有状态文件中恢复会话。当您返回继续之前的工作时,可使用此功能。若不带参数,则默认恢复最近一次保存的状态文件;若传入时间戳,则可恢复指定的时间点状态文件。此功能会将状态内容注入到对话上下文中。

SKILL.md
--- frontmatter
name: stateResume
description: Resume from an existing state file. Use when returning to continue previous work. Without arguments, resumes most recent state file. Pass a timestamp to resume a specific file. Injects state content into conversation context.

State Resume

Resume a conversation from an existing state file.

Arguments

  • No argument: Resume most recent state file
  • $ARGUMENTS = timestamp: Resume specific .state/{timestamp}.state.md

Workflow

  1. Get repo root: git rev-parse --show-toplevel
  2. Find state file:
    • If no argument: ls -1 .state/*.state.md | sort -rn | head -1
    • If timestamp provided: .state/{timestamp}.state.md
  3. If file not found, error and suggest /stateList
  4. Read the state file contents
  5. Update frontmatter:
    • Set status: active
    • Update updated timestamp
  6. Output header + full contents:
    code
    Resuming from state file: .state/{timestamp}.state.md
    ---
    [file contents]
    
  7. Remember filename for /stateUpdate calls

Error Handling

If no state files exist:

code
No state files found in .state/
Use /stateCreate to start a new session.

If specified timestamp not found:

code
State file not found: .state/{timestamp}.state.md
Use /stateList to see available state files.