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_startreturnspreflight.mode == "init".
Step 1: Preflight + Assessment (composite)
MCP AVAILABILITY — assume atlas-session is available (do NOT run claude mcp list):
- Call
session_start(project_dir, DIRECTIVE)— returns combined preflight + validate + read_context + git_summary + classify_brainstorm + clutter check in ONE call. - If the call errors or times out, STOP and inform user:
Do NOT proceed with any other steps if session_start fails.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 - Extract results:
preflight = result["preflight"],read_context = result["read_context"],git_summary = result["git_summary"],classify_brainstorm = result["classify_brainstorm"],clutter = result["clutter"].
Step 2: Brainstorm Weight + File Organization
- Extract
BRAINSTORM_WEIGHTfromresult["classify_brainstorm"]["weight"]for Step 4.
File organization (only if result["clutter"] is present and status is "cluttered"):
Present the grouped move map from result["clutter"]:
- "Your project root has [N] misplaced files. Proposed cleanup: [summary]. Approve?"
- Options: "Yes, clean up", "Show details first", "Skip"
- If approved, execute moves via
git mv(ifis_git) or file operations.
Step 3: Silent Bootstrap + CI/CD Detection
- Call
session_init(project_dir, DIRECTIVE_OR_PENDING) - Call
session_ensure_governance(project_dir) - Call
session_cache_governance(project_dir) - Run
/init(Claude Code built-in — refreshes CLAUDE.md. Must run in main thread.) - Call
session_restore_governance(project_dir)
CI/CD Scaffold Detection (smart, zero-friction):
Use project_signals from result["preflight"] (already available from Step 1).
Determine CI/CD action based on these rules:
| Condition | Action |
|---|---|
has_ci == true | Skip — already has CI/CD |
has_code_files == false OR is_empty_project == true | Skip — no code to test |
Simple script only (1-2 .py/.sh files, no package manifest) | Skip — toy project |
Has package manifest (package.json, pyproject.toml, Cargo.toml, go.mod) | Prompt user (see below) |
| 3+ code files but no package manifest | Prompt user (see below) |
Prompt when needed:
"This project has code files but no CI/CD. Atlas-Copilot can scaffold GitHub Actions workflows (CI tests + Claude review). Enable?"
Options:
- "Yes, full CI" — scaffold both CI and review workflows
- "CI only" — scaffold CI workflow only
- "Skip" — don't scaffold, don't ask again this session
Scaffold logic (if user accepts):
Detect language/stack from project_signals:
has_package_json→ Node.jshas_pyproject→ Pythonhas_go_mod→ Gohas_cargo_toml→ Rust- Default → Python if
.pyfiles exist, else generic
Create .github/workflows/ directory, then:
- CI workflow (
ci.yml): callsanombyte93/atlas-copilot/.github/workflows/reusable-ci.yml@v1with appropriate inputs - Review workflow (
claude-review.yml): callsanombyte93/atlas-copilot/.github/workflows/reusable-claude-review.yml@v1
Use language-specific defaults:
| Stack | test-command | build-command | install-command |
|---|---|---|---|
| Node.js | npm test -- --coverage --ci | npm run build | npm ci |
| Python | pytest tests/ -x --tb=short | (empty) | pip install -e ".[dev]" |
| Go | go test ./... -v -race | (empty) | go mod download |
| Rust | cargo test --verbose | cargo build --verbose | (empty) |
- Read
custom.mdif 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")thenTeamDelete
- If single task: proceed without team.
- NEVER spawn ad-hoc background Task agents for implementation.
- Invoke
superpowers:test-driven-developmentif soul purpose involves code. - Invoke
superpowers:writing-plansif 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 → `--i