session-isolation
Use when orchestrating workflows that generate multiple files (designs, reviews, reports) to prevent file collisions across concurrent or sequential sessions with unique session directories.
Install
mkdir -p .claude/skills/session-isolation && curl -L -o skill.zip "https://mcp.directory/api/skills/download/9162" && unzip -o skill.zip -d .claude/skills/session-isolation && rm skill.zipInstalls to .claude/skills/session-isolation
About this skill
Session Isolation Pattern
Session-based artifact isolation for multi-artifact workflows. Use when orchestrating workflows that generate multiple files (designs, reviews, reports) to prevent file collisions across concurrent or sequential sessions.
Problem
When multiple workflows run (even sequentially), artifacts with the same name collide:
Session 1 (SEO): writes ai-docs/plan-review-grok.md
Session 2 (API): writes ai-docs/plan-review-grok.md <-- OVERWRITES!
Solution
Use unique session folders to isolate artifacts:
ai-docs/sessions/agentdev-seo-20260105-143022-a3f2/
├── session-meta.json # Session tracking
├── design.md # Primary artifact
├── reviews/
│ ├── plan-review/ # Plan review phase
│ │ ├── internal.md
│ │ ├── grok.md
│ │ └── consolidated.md
│ └── impl-review/ # Implementation review phase
│ ├── internal.md
│ └── consolidated.md
└── report.md # Final report
Implementation Pattern
1. Session Initialization (Orchestrator)
Add to Phase 0 of your orchestrator command:
# Generate unique session path
TARGET_SLUG=$(echo "${TARGET_NAME:-workflow}" | tr '[:upper:] ' '[:lower:]-' | sed 's/[^a-z0-9-]//g' | head -c20)
SESSION_BASE="${WORKFLOW_TYPE}-${TARGET_SLUG}-$(date +%Y%m%d-%H%M%S)-$(head -c4 /dev/urandom | xxd -p | head -c4)"
SESSION_PATH="ai-docs/sessions/${SESSION_BASE}"
# Create directory structure
mkdir -p "${SESSION_PATH}/reviews/plan-review" \
"${SESSION_PATH}/reviews/impl-review" || {
echo "Warning: Cannot create session directory, using legacy mode"
SESSION_PATH="ai-docs"
}
# Create session metadata (if not legacy mode)
if [[ "$SESSION_PATH" != "ai-docs" ]]; then
cat > "${SESSION_PATH}/session-meta.json" << EOF
{
"session_id": "${SESSION_BASE}",
"type": "${WORKFLOW_TYPE}",
"target": "${USER_REQUEST}",
"started_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"status": "in_progress"
}
EOF
fi
2. Pass SESSION_PATH to Sub-Agents
Include in all agent prompts:
SESSION_PATH: ${SESSION_PATH}
{actual task description}
Save output to: ${SESSION_PATH}/{artifact_path}
3. Sub-Agent SESSION_PATH Detection
Add to agent <critical_constraints>:
<session_path_support>
**Check for Session Path Directive**
If prompt contains `SESSION_PATH: {path}`:
1. Extract the session path
2. Use it for all output file paths
3. Primary artifact: `${SESSION_PATH}/{type}.md`
4. Reviews: `${SESSION_PATH}/reviews/{phase}/{model}.md`
**If NO SESSION_PATH**: Use legacy paths (ai-docs/)
</session_path_support>
4. Session Completion
Update metadata when workflow completes:
if [[ -f "${SESSION_PATH}/session-meta.json" ]]; then
jq '.status = "completed" | .completed_at = (now | strftime("%Y-%m-%dT%H:%M:%SZ"))' \
"${SESSION_PATH}/session-meta.json" > "${SESSION_PATH}/session-meta.json.tmp" && \
mv "${SESSION_PATH}/session-meta.json.tmp" "${SESSION_PATH}/session-meta.json"
fi
Artifact Path Mapping
| Artifact Type | SESSION_PATH Format | Legacy Format |
|---|---|---|
| Design/Context | ${SESSION_PATH}/design.md | ai-docs/agent-design-{name}.md |
| Plan Review | ${SESSION_PATH}/reviews/plan-review/{model}.md | ai-docs/plan-review-{model}.md |
| Impl Review | ${SESSION_PATH}/reviews/impl-review/{model}.md | ai-docs/impl-review-{model}.md |
| Consolidated | ${SESSION_PATH}/reviews/{phase}/consolidated.md | ai-docs/{phase}-consolidated.md |
| Final Report | ${SESSION_PATH}/report.md | ai-docs/{workflow}-report-{name}.md |
Backward Compatibility
Legacy Mode Triggers:
SESSION_PATHnot provided in prompt- Directory creation fails (permissions)
- Explicit
LEGACY_MODE: truein prompt
Behavior:
- Fall back to flat
ai-docs/paths - Log warning about legacy mode
- All features still work, just without isolation
Session Metadata Schema
{
"session_id": "agentdev-seo-20260105-143022-a3f2",
"type": "agentdev",
"target": "SEO agent improvements",
"started_at": "2026-01-05T14:30:22Z",
"completed_at": "2026-01-05T15:45:30Z",
"status": "completed",
"phases_completed": ["init", "design", "plan-review", "implementation", "quality-review"],
"models_used": ["claude-embedded", "x-ai/grok-code-fast-1", "google/gemini-3-pro"],
"artifacts": {
"design": "design.md",
"plan_reviews": ["reviews/plan-review/internal.md", "reviews/plan-review/grok.md"],
"impl_reviews": ["reviews/impl-review/internal.md", "reviews/impl-review/gemini.md"],
"report": "report.md"
}
}
Plugins Using Session Isolation
| Plugin | Command | Session Pattern |
|---|---|---|
| agentdev | /develop | agentdev-{target}-{timestamp}-{random} |
| frontend | /review, /implement | review-{timestamp}-{random} |
| seo | /review, /alternatives | seo-review-{timestamp}-{random} |
| multimodel | /team | team-{task-slug}-{timestamp}-{random} |
Team Session Example
The /team command creates a session for multi-model blind voting:
ai-docs/sessions/team-stats-validation-20260209-143022-a3f2/
├── task.md # Raw task description (shared by all models)
├── grok-result.md # Grok's investigation findings
├── gemini-result.md # Gemini's investigation findings
├── deepseek-result.md # DeepSeek's investigation findings
├── internal-result.md # Internal Claude's findings
└── verdict.md # Aggregated verdict with vote breakdown
Key difference from other plugins: Team sessions contain results from multiple AI models investigating the same task independently. Each model writes to its own result file to prevent conflicts during parallel execution.
Best Practices
- Always initialize early: Session creation should happen in Phase 0
- Include SESSION_PATH in all prompts: Sub-agents need it for output paths
- Use descriptive slugs: Include workflow type and target in folder name
- Update metadata on completion: Track status changes
- Fallback gracefully: Never fail the workflow due to session creation issues
More by MadAppGang
View all skills by MadAppGang →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
pdf-to-markdown
aliceisjustplaying
Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.
Related MCP Servers
Browse all serversConnect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
AI-driven CAD modeling with FreeCAD: control design workflows, generate logos, and edit objects using remote Python scri
Transform Figma designs into high-quality code with AI. Seamless figma to code and figma to html workflows for efficient
Empower AI agents for efficient API automation in Postman for API testing. Streamline workflows and boost productivity w
Access mac keyboard shortcuts for screen capture and automate workflows with Siri Shortcuts. Streamline hotkey screensho
Generate and edit images from text with Nano-Banana, an AI image generator powered by Gemini 2.5 Flash. Fast, seamless,
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.