.claude/skills/ac-session-manager/SKILL.md
Session lifecycle management for autonomous coding. Use when starting sessions, resuming work, detecting session type (init vs continue), or managing auto-continuation between sessions.
npx skillsauth add adaptationio/skrillz ac-session-managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete session lifecycle management for autonomous coding operations.
Manages the full session lifecycle:
from scripts.session_manager import SessionManager
manager = SessionManager(project_dir)
session_type = await manager.detect_type()
if session_type == "INIT":
# First run - initialize project
await manager.run_initializer()
elif session_type == "CONTINUE":
# Resume work
await manager.run_continuation()
elif session_type == "COMPLETE":
print("All features complete!")
async with SessionManager(project_dir) as session:
result = await session.run(prompt)
print(f"Status: {result.status}")
┌─────────────────────────────────────────────────────────────┐
│ SESSION LIFECYCLE │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. DETECT SESSION TYPE │
│ ├─ Check for feature_list.json │
│ ├─ If missing → INIT session │
│ ├─ If handoff exists → CONTINUE_FROM_HANDOFF │
│ ├─ If all pass → COMPLETE │
│ └─ Otherwise → CONTINUE_IMPLEMENTATION │
│ │
│ 2. CREATE SESSION │
│ ├─ Initialize SDK client │
│ ├─ Configure tools and permissions │
│ └─ Set working directory │
│ │
│ 3. RUN SESSION │
│ ├─ Execute prompt (initializer or coding) │
│ ├─ Handle tool calls │
│ └─ Capture results │
│ │
│ 4. END SESSION │
│ ├─ Save state │
│ ├─ Check completion status │
│ └─ Trigger auto-continue or shutdown │
│ │
└─────────────────────────────────────────────────────────────┘
| Type | Condition | Action |
|------|-----------|--------|
| INIT | No feature_list.json | Run initializer agent |
| CONTINUE_FROM_HANDOFF | handoffs/current.json exists | Resume from handoff |
| CONTINUE_IMPLEMENTATION | Features incomplete | Continue coding |
| COMPLETE | All features pass | Generate report, exit |
def detect_session_type(project_dir: Path) -> SessionType:
# Check for initialization
if not (project_dir / "feature_list.json").exists():
return SessionType.INIT
# Check for handoff
if (project_dir / ".claude/handoffs/current.json").exists():
return SessionType.CONTINUE_FROM_HANDOFF
# Check completion
features = load_features(project_dir)
if all(f["passes"] for f in features):
return SessionType.COMPLETE
return SessionType.CONTINUE_IMPLEMENTATION
session = await SessionManager.create(
project_dir=project_dir,
model="claude-opus-4-5-20251101",
max_turns=1000,
tools=["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
)
result = await session.run_initializer(
spec="Build a task management app with auth..."
)
# Creates:
# - feature_list.json (100+ features)
# - init.sh (environment setup)
# - Project scaffold
result = await session.run_continuation()
# Loads state, resumes at current feature
# Configure auto-continuation
session.configure_auto_continue(
enabled=True,
delay_seconds=3
)
# After session ends, automatically starts next
await session.run()
# ... session completes ...
# [3 second delay]
# Next session starts automatically
await session.shutdown(
save_state=True,
create_handoff=True
)
# Saves state, creates handoff for next session
@dataclass
class SessionConfig:
model: str = "claude-opus-4-5-20251101"
max_turns: int = 1000
timeout_ms: int = 600000
continue_delay: int = 3
max_sessions: int = None # Unlimited
# Tool configuration
tools: list = field(default_factory=lambda: [
"Read", "Write", "Edit", "Bash", "Glob", "Grep"
])
# Permissions
sandbox_enabled: bool = True
allowed_paths: list = field(default_factory=lambda: ["./**"])
SESSION 1: Initialize + Features 1-15
│
▼ (context 85% → handoff)
SESSION 2: Resume + Features 16-30
│
▼ (context 85% → handoff)
SESSION 3: Resume + Features 31-50
│
▼
COMPLETE: All features pass!
// .claude-session-state.json
{
"id": "session-20250115-100000",
"type": "CONTINUE_IMPLEMENTATION",
"status": "running",
"iteration": 5,
"started_at": "2025-01-15T10:00:00Z",
"features_this_session": ["auth-001", "auth-002"],
"context_usage": 0.65
}
You are initializing an autonomous coding project.
SPECIFICATION:
{spec}
Your tasks:
1. Analyze the specification
2. Generate feature_list.json with 100+ testable features
3. Create init.sh for environment setup
4. Scaffold initial project structure
5. Initialize git repository
6. Commit initial state
Output MUST include:
- feature_list.json (all features passes: false)
- init.sh (executable setup script)
- Project files (scaffold)
You are continuing autonomous development.
Current state:
- Features completed: {completed}/{total}
- Current feature: {current_feature}
- Last action: {last_action}
Resume implementing features following TDD:
1. Select next incomplete feature
2. Write failing test (RED)
3. Implement to pass (GREEN)
4. Refactor as needed
5. Commit changes
Work on ONE feature at a time.
Update feature_list.json when feature passes.
references/SESSION-LIFECYCLE.md - Detailed lifecyclereferences/PROMPTS.md - Session promptsreferences/MULTI-SESSION.md - Multi-session patternsscripts/session_manager.py - Core SessionManagerscripts/session_detector.py - Session type detectionscripts/auto_continue.py - Auto-continuation logicscripts/prompts.py - Prompt templatesdevelopment
Setup secure web-based terminal access to WSL2 from mobile/tablet via ttyd + ngrok/Cloudflare/Tailscale. One-command install, start, stop, status. Use when you need remote terminal access, web terminal, browser-based shell, or mobile access to WSL2 environment.
development
Complete development workflows where Claude writes the code while Gemini and Codex provide research, planning, reviews, and different perspectives. Claude remains the main developer. Use for complex projects requiring expert planning and multi-perspective reviews.
development
Systematic progress tracking for skill development. Manages task states (pending/in_progress/completed), updates in real-time, reports progress, identifies blockers, and maintains momentum. Use when tracking skill development, coordinating work, or reporting progress.
testing
Comprehensive testing workflow orchestrating functional testing, example validation, integration testing, and usability assessment. Sequential workflow for complete skill testing from examples through scenarios to integration validation. Use when conducting thorough testing, pre-deployment validation, ensuring skill functionality, or comprehensive quality checks.