Skip to content
collab-session-mgmt logo

Session Management

collab-session-mgmt

Detailed procedures for finding, creating, and resuming collab sessions

SKILL.md

Full skill instructions

Session Management

Detailed procedures for finding, creating, and resuming collab sessions.


Step 2: Find Sessions

ls -d .collab/​*/ 2>/​dev/​null | xargs -I{} basename {}

If sessions exist:

  1. For each session, get phase via MCP:
    Tool: mcp__plugin_mermaid-collab_mermaid__get_session_state
    Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>" }
    
    Returns: { "phase": "brainstorming", "lastActivity": "...", ... }
  2. Display list with numbered options:
    Existing sessions:
    
    1. bright-calm-river - brainstorming
    2. swift-green-meadow - implementation
    3. Create new session
    
    Select option (1-3):
    
  3. If user selects existing session number → Jump to Step 5: Resume Session
  4. If user selects 'new' option → Continue to Step 3

If no sessions exist: Continue to Step 3


Step 3: Create Session

3.1 Ensure .gitignore

if [ -f .gitignore ]; then
  git check-ignore -q .collab 2>/​dev/​null || echo ".collab/" >> .gitignore
fi

Note: Only modifies .gitignore if it already exists. Does not create a new .gitignore file.

3.2 Generate or Choose Name

  1. Generate a suggested name:

    Tool: mcp__plugin_mermaid-collab_mermaid__generate_session_name
    Args: {}
    

    Returns: { name: "bright-calm-river" }

  2. Present options to user:

    Generated session name: bright-calm-river
    
    1. Use this name
    2. Pick my own name
    
    Select option (1-2):
    
  3. If user selects "1. Use this name":

    • Use the generated name
    • Continue to Step 3.3
  4. If user selects "2. Pick my own name": a. Prompt: "Enter session name (alphanumeric and hyphens only):" b. Validate input:

    • Must match pattern: /^[a-zA-Z0-9-]+$/
    • Must not be empty c. If invalid:
    • Show error: "Invalid name. Use only letters, numbers, and hyphens."
    • Return to step 4a (re-prompt) d. If valid:
    • Use the custom name
    • Continue to Step 3.3

3.3 Initialize Session State

Initialize collab-state.json via MCP (creates folder and design.md automatically):

Tool: mcp__plugin_mermaid-collab_mermaid__update_session_state
Args: {
  "project": "<absolute-path-to-cwd>",
  "session": "<session-name>",
  "phase": "brainstorming",
  "currentItem": null
}

Note: lastActivity is automatically updated. The design.md file is auto-created by sessionRegistry.register() when any MCP tool is first called for this session.

3.4 Set Environment Variable

Set the session path environment variable for hooks:

export COLLAB_SESSION_PATH="$(pwd)/​.collab/<name>"

3.5 Invoke gather-session-goals

Invoke skill: gather-session-goals

This skill will:

  • Ask user what they want to accomplish
  • Classify each item as code/​bugfix/​task
  • Write Work Items section to design doc
  • All items start with Status: pending

After gather-session-goals returns → Jump to Work Item Loop (see collab-work-item-loop skill)


Step 5: Resume Session

When user selects an existing session from Step 2.

5.1 Check for Context Snapshot

Tool: mcp__plugin_mermaid-collab_mermaid__has_snapshot
Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>" }

Returns: { "exists": true } or { "exists": false }

If snapshot exists:

  1. Load snapshot:

    Tool: mcp__plugin_mermaid-collab_mermaid__load_snapshot
    Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>" }
    

    Returns: { "version": 1, "timestamp": "...", "activeSkill": "...", "currentStep": "...", ... }

  2. Display restoration message:

    Restoring from context snapshot...
    Active skill: <activeSkill>
    Step: <currentStep>
    
  3. Delete snapshot (one-time use):

    Tool: mcp__plugin_mermaid-collab_mermaid__delete_snapshot
    Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>" }
    
  4. Update state:

    Tool: mcp__plugin_mermaid-collab_mermaid__update_session_state
    Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>", "hasSnapshot": false }
    
  5. Invoke the active skill directly:

    • If activeSkill == "brainstorming" → Invoke brainstorming skill
    • If activeSkill == "rough-draft" → Invoke rough-draft skill
    • If activeSkill == "executing-plans" → Invoke executing-plans skill

STOP - skill takes over from here.

If no snapshot: Continue to 5.2 (existing resume behavior, route by phase)

5.2 Set Environment Variable

export COLLAB_SESSION_PATH="$(pwd)/​.collab/<name>"

5.3 Read State

Tool: mcp__plugin_mermaid-collab_mermaid__get_session_state
Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>" }

Returns: { "phase": "...", "lastActivity": "...", "currentItem": ..., ... }

5.4 Display Session Info

Session Resumed: <name>
Phase: <phase>
Dashboard: http://localhost:3737

Checking work item status...

5.5 Invoke ready-to-implement

Always route through ready-to-implement for resume:

Invoke skill: ready-to-implement

ready-to-implement will:

  • If pending items exist → return with action: "return_to_loop" → Go to Work Item Loop (see collab-work-item-loop skill)
  • If all documented → proceed to rough-draft (on user confirmation)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View