agentleFS
issue-orchestratorissue-orchestrator/issue-orchestrator/.claude/skills/startup/SKILL.md

startup

Skill10 starsChanged 2 months agoApache-2.0View on GitHub

Understand the unified launcher, doctor checks, and startup sequence. Use when working on launcher.py, doctor checks, supervisor.py, run_orchestrator.py, startup_manager.py, or entry point startup code (cli.py, control_api.py, mcp_server.py).

  • Reads credentials

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    All entry points (CLI, Control Center, MCP) share the same pre-flight checks via infra/launcher.py.

    line 24
  2. Very specific:

    Verification: Do hooks actually block dangerous commands?

    line 126
  3. Distinctive:

    AI Gate: When due, spawn supported agent CLIs to prove the end-to-end hook gate works.

    line 127
  4. Very specific:

    After the orchestrator process starts (either in-process or via supervisor), StartupManager.run_startup() handles runtime initialization:

    line 172
  5. Distinctive:

    Check in-progress issues (orphaned labels, open PRs, partial work)

    line 179

“Common” is measured: kept by at least 6 in 10 of the 8 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

Startup & Launcher

Unified startup architecture for all entry points.

When to Use

  • Working on startup/launch code in any entry point
  • Debugging doctor check failures
  • Modifying pre-flight checks
  • Understanding the supervisor process model
  • Troubleshooting "orchestrator won't start" issues

For general orchestrator runtime issues, use troubleshooting skill.


Unified Launcher Architecture

All entry points (CLI, Control Center, MCP) share the same pre-flight checks via infra/launcher.py. Hook verification is part of the doctor checks, not the runtime startup sequence.

CLI (cmd_start)         Control Center (/control/start)     MCP (start)
       |                           |                            |
       v                           v                            v
launch_preflight_only()    launch_subprocess()          launch_subprocess()
       |                           |                            |
       +----------+----------------+----------------------------+
                  |
                  v
         _run_preflight(config)  <-- shared doctor checks
                  |
                  v
         DoctorResult (ok / warning / error)
                  |
          +-------+-------+
          |               |
    CLI: in-process   CC/MCP: supervisor.start()
    build_orchestrator()    (subprocess)

Key Functions

FunctionFilePurpose
preflight()infra/launcher.pyRun doctor only, return readiness
launch_preflight_only()infra/launcher.pyAlias for CLI (doctor only)
launch_subprocess()infra/launcher.pyDoctor + supervisor.start()
run_doctor()infra/doctor/runner.pyAll diagnostic checks
supervisor.start()infra/supervisor.pyLaunch orchestrator subprocess

Control Center Auth Boundary

Control Center launches repository engines directly through launch_subprocess() and supervisor.start(). It does not execute target-repo wrapper scripts. If a target repo relies on a wrapper script to export a GitHub token from Keychain, that export is bypassed for Control Center launches.

For repo-specific GitHub auth, inspect the selected repo config itself:

repo:
  github:
    token_env: TIXMEUP_GITHUB_TOKEN
    keyring_service: tixmeup-github
    keyring_username: "${USER}"

token_env only works when the variable is already present in the Control Center process environment. Add keyring_service and keyring_username when Control Center should resolve the token from macOS Keychain without a manual env export.

LaunchResult

@dataclass
class LaunchResult:
    doctor: DoctorResult       # All check results
    launched: bool             # Whether subprocess was started
    status: str                # "ok" | "doctor_error" | "doctor_warning" | "already_running" | "launch_error"
    error: str | None          # Error message if launch_error
    supervisor: dict | None    # Supervisor info (pid, port, instance_id or instances) when available

Doctor Checks

The doctor runs a comprehensive set of checks. Hook verification uses a 2-tier system: Installation and Verification.

Check Categories

CheckFileWhat It Tests
GitHub Authchecks/github.pyConfigured token sources and repo access
AI Provider CLIschecks/ai.pyClaude/agent CLIs installed
Config Filechecks/config.pyConfig loads, validates
Config Schemachecks/config.pyNo unknown fields
Template Variableschecks/config.pyValid template vars
Repositorychecks/config.pyRepo set or auto-detected
Worktree Remediationchecks/config.pyRemediation settings
Milestoneschecks/milestones.pyConfigured milestone order exists
Hook Installationchecks/hooks.pyAI hook files present for configured agents
Hook Verificationchecks/hooks.pyAI hooks/execpolicy actually block dangerous commands
AI Gatechecks/hooks.pyPeriodic live agent hook gate when due
Repo Guardrailschecks/hooks.pyRepo-local pre-push guardrails from setup-guardrails
Worktree Hook Corruptionchecks/hooks.pyManaged wrapper recursion/corruption detection
Workspacechecks/workspace.pyWorking dir, agents
Settings Schemachecks/schema.pySchema-driven path and agent reference checks
Guardrailschecks/guardrails.pySafety checks pass
Code Reviewchecks/review.pyReview config valid
E2E Runnerchecks/e2e.pyE2E config valid
Clock Syncchecks/clock_sync.pyClock drift dangerous to claim coordination

Hook Verification

  1. Installation: Are hook files present? (is_installed())
  2. Verification: Do hooks actually block dangerous commands? (verify_hooks())
  3. AI Gate: When due, spawn supported agent CLIs to prove the end-to-end hook gate works.

Verification only runs when installation succeeds. The AI gate respects hooks.ai_gate.interval_days and hooks.ai_gate.dangerous_allow_failure.


Entry Point Flows

CLI (cmd_start in cli.py)

launch_result = launch_preflight_only(config, runner)
if launch_result.status == "doctor_error":
    # Print errors and exit
    return 1
# Continue with in-process orchestrator
orchestrator = build_orchestrator(config)
await orchestrator.startup()
await orchestrator.run_loop()

Control Center (control_start in control_api.py)

launch_result = launch_subprocess(repo_root, config, config_name)
if launch_result.status == "doctor_error":
    return JSONResponse({"error": "doctor_failed", ...}, status_code=422)
if launch_result.status == "already_running":
    return JSONResponse({"error": "already_running", ...}, status_code=409)
if not launch_result.launched:
    return JSONResponse({"error": "launch_failed", ...}, status_code=500)
return JSONResponse({"status": "started", **launch_result.supervisor})

MCP (start in mcp_server.py)

launch_result = launch_subprocess(repo_root, config, config_name)
return {"launch": launch_result.to_dict()}

Runtime Startup (StartupManager)

After the orchestrator process starts (either in-process or via supervisor), StartupManager.run_startup() handles runtime initialization:

  1. Emit config event
  2. Clean up stale in-progress labels
  3. Clean up idle terminal sessions
  4. Discover and restore running sessions
  5. Check in-progress issues (orphaned labels, open PRs, partial work)
  6. Recover pending code reviews
  7. Recover pending tech lead reviews
  8. Recover pending validation retries
  9. Recover orphaned cleanups
  10. Resume partial work
  11. Audit and cache the queue

Key file: control/startup_manager.py


Key Files

FilePurpose
infra/launcher.pyUnified launcher (preflight + subprocess launch)
infra/doctor/runner.pyDoctor check runner
infra/doctor/types.pyCheck and DoctorResult dataclasses
infra/doctor/checks/hooks.pyHook verification checks (2-tier)
infra/doctor/checks/config.pyConfig and repo checks
infra/supervisor.pyProcess supervisor (start/stop/status)
control/startup_manager.pyRuntime startup sequence
entrypoints/cli.pyCLI entry point (cmd_start)
entrypoints/control_api.pyControl Center API
entrypoints/mcp_server.pyMCP server entry point
entrypoints/bootstrap.pyComposition root (wires dependencies)

Troubleshooting Startup Failures

SymptomCheckFix
"Startup checks failed"Doctor errorRun issue-orchestrator doctor
"Hooks not installed"AI hook installation checkRun issue-orchestrator setup-hooks
"Repo guardrails not installed"Repo Guardrails checkRun issue-orchestrator setup-guardrails
"Hook verification failed"Hook Verification checkRun issue-orchestrator verify
"Config not found"Config File checkCreate .issue-orchestrator/config/modes/default/default.yaml
"Repository not configured"Repository checkSet repo.name in config or run from git repo
"Already running" (409)Lock fileStop existing instance or use force_restart
"Config validation errors"Config Validation checkFix config per error messages
Orchestrator crashes on startupStartupManager errorCheck orchestrator log

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.