Session initialization and lifecycle management: bootstraps session context, organizes files, generates CLAUDE.md, manages soul purpose lifecycle with completion protocol and active context harvesting. Use when user says /start, /init, bootstrap session, initialize session, or organize project.
Session initialization and lifecycle management: bootstraps session context, organizes files, generates CLAUDE.md, manages soul purpose lifecycle with completion protocol and active context harvesting. Use when user says /start, /init, bootstrap session, initialize session, or organize project.
user-invocable
true
Session Init & Lifecycle Skill
User runs /start. Questions upfront. Everything else silent. Then seamlessly continue working.
All session operations use atlas-session MCP tools directly (prefixed session_* and contract_*). Use ToolSearch to discover them.
Directive Capture
Capture any text after /start as DIRECTIVE. If empty, the soul purpose is the directive.
The skill NEVER finishes with "ready to go" and stops. After setup, immediately begin working.
UX Contract (MANDATORY)
NEVER announce step names — no "Init Step 1", no "Wave 2"
NEVER narrate internal process — no "Detecting environment..."
NEVER explain what you're about to do — just ask questions, then do it silently
User sees ONLY: questions and seamless continuation into work
Batch questions — as few rounds as possible
No "done" message that stops — after setup, immediately begin working
Hard Invariants
User authority is absolute — AI NEVER closes a soul purpose. Only suggests; user decides.
Zero unsolicited behavior — Skill ONLY runs when user types /start.
Human-visible memory only — All state lives in files.
Idempotent — Safe to run multiple times.
Templates are immutable — NEVER edit bundled template files.
NEVER auto-invoke doubt agent. Only offer it.
Trust separation — for bounty verify, spawn a separate finality Task agent. Never the same agent that submits.
AtlasCoin is optional — if the service is down, tell the user and continue without bounty tracking.
Service Availability (MANDATORY)
NEVER run claude mcp list — assume atlas-session is available, handle errors on first call
NEVER block on external services — log the gap and continue with degraded mode
Fallback hierarchy: try tool → if error/timeout → tell user what's degraded → continue
Service
If Unavailable
Action
atlas-session MCP
session_start errors/times out
STOP — required for /start
AtlasCoin
contract_health() fails
Continue without bounty tracking
Perplexity
Research queries fail
Context7 + WebSearch fallback
Context7
Doc queries fail
Perplexity results only
Bitwarden
Vault locked/unavailable
Tell user, skip credential fetch
INIT MODE
Triggered when session_start returns preflight.mode == "init".
Step 1: Preflight + Assessment (composite)
MCP AVAILABILITY — assume atlas-session is available (do NOT run claude mcp list):
If the call errors or times out, STOP and inform user:
atlas-session MCP is not responding. /start requires this MCP to function.
To fix:
1. Check ~/.claude.json or project .mcp.json has atlas-session entry
2. Verify Python module: python3 -c "from atlas_session import server"
3. Restart Claude Code after fixing
Do NOT proceed with any other steps if session_start fails.
Read custom.md if it exists, follow instructions under "During Init".
Step 4: Quick Clarify + Activate + Continuation
Quick Clarify runs first (always):
Invoke skill: "quick-clarify" with the DIRECTIVE.
This asks 3 questions: deliverable type, done criteria, and size.
For Medium/Large tasks, it also runs research.
After brainstorm completes:
Call session_activate(project_dir, DERIVED_SOUL_PURPOSE, DIRECTIVE_OR_PENDING) — sets soul purpose, enables stop hook, and returns feature claims in ONE call.
Extract feature claims from the result for tracking.
Bounty creation (optional):
Call contract_health(). If healthy, call contract_create(project_dir, DERIVED_SOUL_PURPOSE, escrow, criteria) using contract_draft_criteria for suggestions.
Default escrow: 100. Increase for complex soul purposes at AI's discretion.
If AtlasCoin is down, tell user and continue without bounty.
Before Starting Work (MANDATORY)
Count independent tasks in the soul purpose.
If 2+ independent tasks:
TeamCreate("{project}-work") — assign directory-level file ownership per teammate
Lead coordinates via SendMessage — does NOT implement
On completion: SendMessage(type: "shutdown_request") then TeamDelete
If single task: proceed without team.
NEVER spawn ad-hoc background Task agents for implementation.
Invoke superpowers:test-driven-development if soul purpose involves code.
Invoke superpowers:writing-plans if soul purpose has 3+ steps.
Auto-Invocation of Soul Loop (MANDATORY for code tasks)
Detect if Soul Loop should be enabled:
Check if soul purpose involves code — Look for keywords: "implement", "build", "fix", "add", "create", "refactor", "update", "write"
Determine intensity from task size (from quick-clarify):
Small → --intensity small
Medium → --intensity medium
Large → --intensity long
Configure gates from project structure:
GATES="research,deterministic"# Add E2E gate if tests/e2e/ existsif [[ -d "$PROJECT_DIR/tests/e2e" ]]; then
GATES="$GATES,e2e"fi# Add Acceptance gate if config/trello-testing.json existsif [[ -f "$PROJECT_DIR/config/trello-testing.json" ]]; then
GATES="$GATES,acceptance"fi
MCP AVAILABILITY — assume atlas-session is available (do NOT run claude mcp list):
Call session_start(project_dir, DIRECTIVE) — returns combined assessment in one call.
If the call errors or times out, STOP and inform user (same message as Init Mode). Do NOT proceed.
Extract: preflight, validate, read_context, git_summary, classify_brainstorm, clutter from the result.
Call session_cache_governance(project_dir)
Run /init in main thread.
Call session_restore_governance(project_dir)
Compareread_context against git_summary: if context is stale (commits exist that aren't reflected in active context), update session-context/CLAUDE-activeContext.md with real progress.
Check capability inventory: call session_capability_inventory(project_dir) and check response.
If cache_hit == True and git_changed == False: inventory is current, skip extraction.
If needs_generation == True: inventory requires generation. The MCP tool returns inventory_path when ready.
Read CLAUDE-capability-inventory.md if it exists. Extract untested code, security claims, and feature claims with gaps.
Check bounty: if session-context/BOUNTY_ID.txt exists, call contract_get_status(project_dir).
Read custom.md if it exists, follow instructions under "During Reconcile".
Root Cleanup
If result["clutter"] is present and status is "cluttered", present move map to user (same flow as Init Step 2).
Step 2: Directive + Features + Self-Assessment
If DIRECTIVE is non-empty (3+ words) AND status_hint is no_purpose:
Call session_archive(project_dir, "(pending)", DIRECTIVE) to set soul purpose
Skip Step 3, go to Step 4 with lightweight brainstorm
If DIRECTIVE is non-empty (3+ words) AND soul purpose exists:
Skip Step 3, go to Step 4 — work on directive (overrides for this session)
Using read_context + features_read + git_summary, classify:
clearly_incomplete: open tasks non-empty, active blockers, criteria not met
probably_complete: no open tasks, artifacts exist, criteria met
uncertain: mixed signals
Step 3: User Interaction (conditional)
If clearly_incomplete: No questions. Skip to Step 4.
If probably_complete or uncertain:
Ask ONE question: "Soul purpose: '[text]'. [1-2 sentence assessment]. [Bounty: active/none]. What would you like to do?"
Call session_close(project_dir) — returns combined harvest + features_read + hook_deactivate in ONE call.
Extract harvest = result["harvest"], features = result["features"], hook = result["hook"].
If promotable content exists in harvest, assess what to promote (decisions need rationale, patterns must be reusable, troubleshooting must have verified solutions). Present to user for approval.
After approval, append promoted content to target files via Edit tool.
If pending features exist in features, run their proofs (shell commands, file checks).
Update feature status in CLAUDE-features.md.
Step 2: Code Review Gate
Invoke superpowers:verification-before-completion — run doubt review on recent changes.
If critical issues found, present to user: "Fix issues first" / "Close anyway" / "Continue working".
Invoke superpowers:requesting-code-review before PR creation.