agentleFS
anombyte93anombyte93/atlas-session-lifecycle/skills/start/SKILL.md

start

Skill85 starsChanged 9 months agoMITView on GitHub

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.

  • Installs packages
  • Commits and pushes

67 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-engine, playtest-report and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CoralGameSkill

    setup-engine

    Configure the project's game engine and version. Pins the engine in CLAUDE.md, detects knowledge gaps, and populates engine reference docs via WebSearch when the version is beyond the LLM's training data.

    Also in 7 projects that use this

  • CoralGameSkill

    playtest-report

    Generates a structured playtest report template or analyzes existing playtest notes into a structured format. Use this to standardize playtest feedback collection and analysis.

    Also in 6 projects that use this

  • cenconq25Skill

    asset-spec

    Generates per-asset visual specifications and AI-generation prompts from PRDs and the design bible. Produces structured spec files and updates a master asset manifest. Use after design bible is approved and a UX spec or PRD identifies assets to produce. Output: design/assets/<asset>.md plus design/assets/manifest.md.

    Also in 5 projects that use this

  • cenconq25Skill

    create-control-manifest

    Produces a flat, immediately-actionable rules sheet — do this, never do that, per system and per layer — extracted from accepted ADRs, technical preferences, and framework reference docs. More directly usable than ADRs for day-to-day implementation. Run after /architecture-review passes.

    Also in 5 projects that use this

  • +3 more from CoralGame
  • +5 more from cenconq25

The file

Show its rules and text

We split this skill into the rules it gives an agent

55 rules. 0 are common, 20 are distinctive, and 35 are very specific to this project.

  • 0

    Common

    Most of the 59 edited versions we read keep these.

  • 20

    Distinctive

    This author's own choices. Worth a look.

  • 35

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All session operations use atlas-session MCP tools directly (prefixed session_* and contract_*).

    line 11
  2. Very specific:

    Call session_start(project_dir, DIRECTIVE) — returns combined preflight + validate + read_context + git_summary + classify_brainstorm + …

    line 62
  3. Distinctive:

    If the call errors or times out, STOP and inform user:

    line 63
  4. Distinctive:

    Do NOT proceed with any other steps if session_start fails.

    line 72
  5. Very specific:

    If approved, execute moves via git mv (if is_git) or file operations.

    line 84
  6. Very specific:

    Run /init (Claude Code built-in — refreshes CLAUDE.md.

    line 91
  7. Very specific:

    Use project_signals from result["preflight"] (already available from Step 1).

    line 96
  8. Very specific:

    Default → Python if .py files exist, else generic

    line 124
  9. Very specific:

    Create .github/workflows/ directory, then:

    line 126
  10. Very specific:

    Read custom.md if it exists, follow instructions under "During Init".

    line 138
  11. Very specific:

    Call session_activate(project_dir, DERIVED_SOUL_PURPOSE, DIRECTIVE_OR_PENDING) — sets soul purpose, enables stop hook, and returns feature …

    line 150
  12. Very specific:

    Call contract_health(). If healthy, call contract_create(project_dir, DERIVED_SOUL_PURPOSE, escrow, criteria) using contract_draft_criteria …

    line 155
  13. Distinctive:

    Default escrow: 100. Increase for complex soul purposes at AI's discretion.

    line 157
  14. Distinctive:

    If AtlasCoin is down, tell user and continue without bounty.

    line 159
  15. Distinctive:

    If single task: proceed without team.

    line 168
  16. Distinctive:

    NEVER spawn ad-hoc background Task agents for implementation.

    line 169
  17. Very specific:

    If iterative development is appropriate for the soul purpose, use /ralph-loop:

    line 207
  18. Distinctive:

    Quality (soft warning): Test failures, feature proof failures

    line 229
  19. Distinctive:

    Before any assessment, save the current session state so context files reflect reality:

    line 247
  20. Very specific:

    Call session_start(project_dir, DIRECTIVE) — returns combined assessment in one call.

    line 256
  21. Distinctive:

    If the call errors or times out, STOP and inform user (same message as Init Mode).

    line 257
  22. Very specific:

    Run /init in main thread.

    line 260
  23. Very specific:

    Check capability inventory: call session_capability_inventory(project_dir) and check response.

    line 263
  24. Very specific:

    If cache_hit == True and git_changed == False: inventory is current, skip extraction.

    line 264
  25. Very specific:

    If needs_generation == True: inventory requires generation.

    line 265
  26. Very specific:

    Read CLAUDE-capability-inventory.md if it exists.

    line 266
  27. Very specific:

    Check bounty: if session-context/BOUNTY_ID.txt exists, call contract_get_status(project_dir).

    line 267
  28. Very specific:

    Read custom.md if it exists, follow instructions under "During Reconcile".

    line 268
  29. Very specific:

    If result["clutter"] is present and status is "cluttered", present move map to user (same flow as Init Step 2).

    line 272
  30. Very specific:

    Call session_archive(project_dir, "(pending)", DIRECTIVE) to set soul purpose

    line 277
  31. Very specific:

    Call session_features_read(project_dir) — check feature claim status.

    line 285
  32. Very specific:

    If clearly_incomplete: No questions. Skip to Step 4.

    line 293
  33. Distinctive:

    Ask ONE question: "Soul purpose: '[text]'.

    line 296
  34. Distinctive:

    "Close": Run Settlement Flow below.

    line 299
  35. Distinctive:

    "Redefine": Ask for new purpose, then run Settlement Flow with new purpose.

    line 300
  36. Very specific:

    No active soul purpose: Ask user what to work on, set as new soul purpose via session_archive.

    line 309
  37. Distinctive:

    Check if a Ralph Loop is already active:

    line 325
  38. Very specific:

    Read custom.md if it exists, follow instructions under "During Settlement".

    line 339
  39. Very specific:

    Call session_close(project_dir) — returns combined harvest + features_read + hook_deactivate in ONE call.

    line 343
  40. Very specific:

    If promotable content exists in harvest, assess what to promote (decisions need rationale, patterns must be reusable, troubleshooting must …

    line 345
  41. Distinctive:

    After approval, append promoted content to target files via Edit tool.

    line 346
  42. Very specific:

    If pending features exist in features, run their proofs (shell commands, file checks).

    line 347
  43. Very specific:

    Update feature status in CLAUDE-features.md.

    line 348
  44. Distinctive:

    If critical issues found, present to user: "Fix issues first" / "Close anyway" / "Continue working".

    line 353
  45. Very specific:

    Create PR: gh pr create --title "..." --body "..." with review summary.

    line 359
  46. Very specific:

    Call contract_run_tests(project_dir) — execute all criteria.

    line 364
  47. Very specific:

    If tests pass, call contract_submit(project_dir).

    line 365
  48. Distinctive:

    Wait for finality result.

    line 367
  49. Very specific:

    If verified: call contract_settle(project_dir).

    line 368
  50. Distinctive:

    If failed: present to user — "Fix and re-verify" / "Close anyway (forfeit)" / "Continue working".

    line 369
  51. Very specific:

    Call session_archive(project_dir, OLD_PURPOSE, NEW_PURPOSE) — archive soul purpose, reset active context.

    line 373
  52. Very specific:

    Remove Ralph Loop indicator: rm -f ~/.claude/ralph-loop.local.md

    line 374
  53. Distinctive:

    During Init: After session-context is bootstrapped (Step 3)

    line 384
  54. Distinctive:

    During Reconcile: After read-context, before assessment (Step 1)

    line 385
  55. Distinctive:

    During Settlement: Before harvest + archive (Settlement Step 1)

    line 386

“Common” is measured: kept by at least 6 in 10 of the 59 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

  1. NEVER announce step names — no "Init Step 1", no "Wave 2"
  2. NEVER narrate internal process — no "Detecting environment..."
  3. NEVER explain what you're about to do — just ask questions, then do it silently
  4. User sees ONLY: questions and seamless continuation into work
  5. Batch questions — as few rounds as possible
  6. No "done" message that stops — after setup, immediately begin working

Hard Invariants

  1. User authority is absolute — AI NEVER closes a soul purpose. Only suggests; user decides.
  2. Zero unsolicited behavior — Skill ONLY runs when user types /start.
  3. Human-visible memory only — All state lives in files.
  4. Idempotent — Safe to run multiple times.
  5. Templates are immutable — NEVER edit bundled template files.
  6. NEVER auto-invoke doubt agent. Only offer it.
  7. Trust separation — for bounty verify, spawn a separate finality Task agent. Never the same agent that submits.
  8. AtlasCoin is optional — if the service is down, tell the user and continue without bounty tracking.

Service Availability (MANDATORY)

  1. NEVER run claude mcp list — assume atlas-session is available, handle errors on first call
  2. NEVER block on external services — log the gap and continue with degraded mode
  3. Fallback hierarchy: try tool → if error/timeout → tell user what's degraded → continue
ServiceIf UnavailableAction
atlas-session MCPsession_start errors/times outSTOP — required for /start
AtlasCoincontract_health() failsContinue without bounty tracking
PerplexityResearch queries failContext7 + WebSearch fallback
Context7Doc queries failPerplexity results only
BitwardenVault locked/unavailableTell 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):

  1. Call session_start(project_dir, DIRECTIVE) — returns combined preflight + validate + read_context + git_summary + classify_brainstorm + clutter check in ONE call.
  2. 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.
  3. 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

  1. Extract BRAINSTORM_WEIGHT from result["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 (if is_git) or file operations.

Step 3: Silent Bootstrap + CI/CD Detection

  1. Call session_init(project_dir, DIRECTIVE_OR_PENDING)
  2. Call session_ensure_governance(project_dir)
  3. Call session_cache_governance(project_dir)
  4. Run /init (Claude Code built-in — refreshes CLAUDE.md. Must run in main thread.)
  5. 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:

ConditionAction
has_ci == trueSkip — already has CI/CD
has_code_files == false OR is_empty_project == trueSkip — 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 manifestPrompt 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.js
  • has_pyproject → Python
  • has_go_mod → Go
  • has_cargo_toml → Rust
  • Default → Python if .py files exist, else generic

Create .github/workflows/ directory, then:

  1. CI workflow (ci.yml): calls anombyte93/atlas-copilot/.github/workflows/reusable-ci.yml@v1 with appropriate inputs
  2. Review workflow (claude-review.yml): calls anombyte93/atlas-copilot/.github/workflows/reusable-claude-review.yml@v1

Use language-specific defaults:

Stacktest-commandbuild-commandinstall-command
Node.jsnpm test -- --coverage --cinpm run buildnpm ci
Pythonpytest tests/ -x --tb=short(empty)pip install -e ".[dev]"
Gogo test ./... -v -race(empty)go mod download
Rustcargo test --verbosecargo build --verbose(empty)
  1. 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:

  1. Call session_activate(project_dir, DERIVED_SOUL_PURPOSE, DIRECTIVE_OR_PENDING) — sets soul purpose, enables stop hook, and returns feature claims in ONE call.
  2. 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)

  1. Count independent tasks in the soul purpose.
  2. 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
  3. If single task: proceed without team.
  4. NEVER spawn ad-hoc background Task agents for implementation.
  5. Invoke superpowers:test-driven-development if soul purpose involves code.
  6. 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:

  1. Check if soul purpose involves code — Look for keywords: "implement", "build", "fix", "add", "create", "refactor", "update", "write"
  2. Determine intensity from task size (from quick-clarify):
    • Small → --intensity small
    • Medium → --intensity medium
    • Large → --intensity long
  3. Configure gates from project structure:
    GATES="research,deterministic"
    
    # Add E2E gate if tests/e2e/ exists
    if [[ -d "$PROJECT_DIR/tests/e2e" ]]; then
      GATES="$GATES,e2e"
    fi
    
    # Add Acceptance gate if config/trello-testing.json exists
    if [[ -f "$PROJECT_DIR/config/trello-testing.json" ]]; then
      GATES="$GATES,acceptance"
    fi
  4. Invoke Soul Loop:
    /soul-loop "$DERIVED_SOUL_PURPOSE" --intensity $INTENSITY --gates "$GATES"

This is automatic — do not ask the user. Soul Loop provides the backpressure guardrails for iterative development.

Ralph Loop Invocation (optional, for iterative work)

If iterative development is appropriate for the soul purpose, use /ralph-loop:

/ralph-loop "DERIVED_SOUL_PURPOSE" --max-iterations N --completion-promise "TEXT"

The user controls iterations and completion promises.

CRITICAL: you must call the Skill tool — not just mention it in text.

Soul Loop Invocation (backpressure-enforced iteration)

Soul Loop enforces hierarchical backpressure gates on each iteration. Use for iterative development that needs quality guardrails.

IntensityInvocation
Small/soul-loop "SOUL_PURPOSE" --intensity small
Medium/soul-loop "SOUL_PURPOSE" --intensity medium
LongFirst skill: "prd-taskmaster", then /soul-loop "SOUL_PURPOSE" --intensity long

Gate Hierarchy:

  • Critical (hard block): Max iterations, state corruption, 10+ failures
  • Quality (soft warning): Test failures, feature proof failures
  • Progressive (friction): 5+ failures warns, 10+ hard stops
  • Agentic (allow exit): Completion promise matched via <promise> tag

To complete: Output <promise>YOUR_COMPLETION_PROMISE</promise> when done.

CRITICAL: Soul loop enforces backpressure. Test failures allow continued iteration with warnings. After 10 failures, hard block.


RECONCILE MODE

Triggered when session_start returns preflight.mode == "reconcile".

UX: Everything in Steps 1-2 is invisible to the user. First visible interaction is a question (Step 3) or seamless work continuation (Step 4).

Step 0: Sync Previous State

Before any assessment, save the current session state so context files reflect reality:

  1. Invoke /sync — updates all session-context files and MEMORY.md with current progress.
  2. This is silent — no output shown to user.

Step 1: Silent Assessment + Context Reality Check (composite)

MCP AVAILABILITY — assume atlas-session is available (do NOT run claude mcp list):

  1. Call session_start(project_dir, DIRECTIVE) — returns combined assessment in one call.
  2. If the call errors or times out, STOP and inform user (same message as Init Mode). Do NOT proceed.
  3. Extract: preflight, validate, read_context, git_summary, classify_brainstorm, clutter from the result.
  4. Call session_cache_governance(project_dir)
  5. Run /init in main thread.
  6. Call session_restore_governance(project_dir)
  7. Compare read_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.
  8. 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.
  9. Read CLAUDE-capability-inventory.md if it exists. Extract untested code, security claims, and feature claims with gaps.
  10. Check bounty: if session-context/BOUNTY_ID.txt exists, call contract_get_status(project_dir).
  11. 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)

Otherwise (no directive):

  1. Call session_features_read(project_dir) — check feature claim status.
  2. 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?"

  • Options: "Continue", "Verify first", "Close", "Redefine"
  • "Verify first": Invoke superpowers:verification-before-completion, fold findings into re-presented question.
  • "Close": Run Settlement Flow below.
  • "Redefine": Ask for new purpose, then run Settlement Flow with new purpose.

Step 4: Continuation

Transition directly into work. No "session reconciled" message.

  • DIRECTIVE provided: Begin working on directive.
  • Soul purpose redefined: Begin working on new purpose.
  • clearly_incomplete: Pick up where last session left off using active context.
  • No active soul purpose: Ask user what to work on, set as new soul purpose via session_archive.

Before Starting Work (MANDATORY)

  1. Count independent tasks in the soul purpose.
  2. 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
  3. If single task: proceed without team.
  4. NEVER spawn ad-hoc background Task agents for implementation.
  5. Invoke superpowers:test-driven-development if soul purpose involves code.
  6. Invoke superpowers:writing-plans if soul purpose has 3+ steps.

Ralph Loop Check (Reconcile)

Check if a Ralph Loop is already active:

test -f ~/.claude/ralph-loop.local.md && echo "active" || echo "inactive"

Note: Ralph Loop is no longer auto-invoked. User can manually start it with /ralph-loop if needed for iterative work.


SETTLEMENT FLOW

Triggered when user chooses "Close" in Reconcile Step 3.

Read custom.md if it exists, follow instructions under "During Settlement".

Step 1: Harvest + Promote + Feature Verification (composite)

  1. Call session_close(project_dir) — returns combined harvest + features_read + hook_deactivate in ONE call.
  2. Extract harvest = result["harvest"], features = result["features"], hook = result["hook"].
  3. 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.
  4. After approval, append promoted content to target files via Edit tool.
  5. If pending features exist in features, run their proofs (shell commands, file checks).
  6. Update feature status in CLAUDE-features.md.

Step 2: Code Review Gate

  1. Invoke superpowers:verification-before-completion — run doubt review on recent changes.
  2. If critical issues found, present to user: "Fix issues first" / "Close anyway" / "Continue working".
  3. Invoke superpowers:requesting-code-review before PR creation.

Step 3: PR Creation

  1. Push current branch: git push -u origin HEAD
  2. Create PR: gh pr create --title "..." --body "..." with review summary.
  3. Return PR URL to user.

Step 4: Bounty Settlement (if bounty exists)

  1. Call contract_run_tests(project_dir) — execute all criteria.
  2. If tests pass, call contract_submit(project_dir).
  3. Spawn a single finality Task agent: Task(subagent_type: "general-purpose", prompt: "You are finality-agent. Verify bounty [ID] independently. Call contract_verify. Report pass/fail.")
  4. Wait for finality result.
  5. If verified: call contract_settle(project_dir). Tell user tokens earned.
  6. If failed: present to user — "Fix and re-verify" / "Close anyway (forfeit)" / "Continue working".

Step 5: Archive + Cleanup

  1. Call session_archive(project_dir, OLD_PURPOSE, NEW_PURPOSE) — archive soul purpose, reset active context.
  2. Remove Ralph Loop indicator: rm -f ~/.claude/ralph-loop.local.md
  3. Tell user: "Session closed. Soul purpose '[text]' archived." (Include token info if bounty settled.)

Customizations

Create or edit custom.md in the plugin root directory.

The AI reads custom.md at each lifecycle phase:

  • During Init: After session-context is bootstrapped (Step 3)
  • During Reconcile: After read-context, before assessment (Step 1)
  • During Settlement: Before harvest + archive (Settlement Step 1)
  • Always: Applied in all modes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.