Continuation Prompt#

Generate a continuation prompt that captures conversation state for resuming work in a new session.

Description#

The cprompt skill snapshots the current conversation context into a structured prompt, writes it to a markdown file, prints it to stdout, and attempts to copy it to the system clipboard when a supported clipboard tool is available. The prompt is written as instructions to a future agent session so work can resume without re-discovery.

Three detail levels control how much context is captured:

  • short (default) – branch, task, current state, next steps.

  • medium – adds completed work, decisions, files touched, blockers.

  • long – full context dump with rationale, ruled-out approaches, open questions, and file paths with line numbers.

Triggers#

Explicit invocation only:

/wf:cprompt
/wf:cprompt short
/wf:cprompt m
/wf:cprompt long

Arguments#

One optional positional argument:

Argument

Aliases

Description

short

s

(default) Minimum context to resume: branch, task, next step.

medium

m

Adds: completed work, decisions, files touched, blockers.

long

l

Full dump: rationale, ruled-out approaches, open questions, file paths with line numbers.

Workflow#

  1. Parse argument

    • Normalise the input to lowercase and match against valid options.

    • Default to short if omitted.

    • Reject unrecognised values with a list of valid options.

  2. Gather context

    • Uses only information already in the conversation – no tool calls, no git commands, no file reads.

    • Collects: branch, repo, task summary, work completed, decisions, files touched, current state, next steps, blockers, and (for long) ruled-out approaches and key file locations.

  3. Generate prompt

    • Builds a markdown prompt using the template for the requested detail level.

    • Written in second person imperative as instructions to a future session.

  4. Write markdown file

    • Writes to ./resources/agent-docs/CPROMPT.md when ./resources/agent-docs exists as a writable directory.

    • Falls back to /tmp/CPROMPT.md otherwise.

    • Reports the path that was written.

  5. Copy to clipboard

    • Auto-detects the available clipboard tool in order: wl-copy (Wayland), xclip, xsel, pbcopy.

    • Reports a warning if no clipboard tool is found.

  6. Display

    • Prints the generated prompt to the conversation.

    • Reports the markdown file path.

    • Reports clipboard copy success or failure.

Output Format#

The prompt follows a structured markdown template. Example (short):

## Continue: Add cprompt skill to llm-workflow plugin

**Branch:** dev
**Repo:** /home/user/code/llm-workflow

### Status
SKILL.md created and registered. Docs written. Ready for testing.

### Next Steps
- Reload plugins and test `/wf:cprompt` at all three lengths
- Commit changes

Example Usage#

Quick save before clearing context:

> /wf:cprompt

Medium detail before exiting for the day:

> /wf:cprompt m

Full context dump before a long break:

> /wf:cprompt long

Clipboard Detection#

The skill tries clipboard tools in this order:

  1. wl-copy – Wayland compositor

  2. xclip -selection clipboard – X11

  3. xsel --clipboard --input – X11 (fallback)

  4. pbcopy – macOS

If none are found, the prompt is still displayed in the conversation for manual copying.

File Output#

The prompt is also saved as markdown:

  • ./resources/agent-docs/CPROMPT.md when that directory exists and is writable.

  • /tmp/CPROMPT.md when ./resources/agent-docs is unavailable.

The file is overwritten on each run so it always contains the latest continuation prompt.

Limits#

  • Conversation context only: Does not run commands or read files. If the conversation has limited context, the prompt reflects that.

  • Snapshot: The prompt captures state at invocation time. It does not update if work continues afterward.

  • No auto-exit/clear: The skill generates and copies the prompt. The user must manually run /exit or /clear afterward.