richfrem/agent-plugins-skills / plugins/agent-agentic-os/.apm/skills/running-control-plane
running-control-plane
FlaggedCRITICAL INTAKE GATEWAY: use at the start of any non-trivial engineering task, feature, refactor, multi-file bugfix, work package or new idea, including requests to explore, brainstorm, build, fix or change something, before planning or code changes. Enforces read-only discovery, 1-3 structured questions with defaults, control-plane registration and the immutable four-pillar TASK_SPEC.md. Also runs the rest of the control plane: health ("run health check", "check os metrics", "system monitor", event bus, locks, memory, "is my signing identity ready" status check), transition simulation ("dry run transition", "simulate transition", "check edge X -> Y"), worktree selection, and gating on/off ("disable the control plane", "turn off the push guard", "stop gating my commits"). Not for project setup or key creation (use setting-up-agentic-os) or improving skills (use improving-skills-in-lab).
scripts/worktree_manager.py
View on GitHub"""
worktree_manager.py -- Native-First Worktree Planning with Portable Fallback
==================================================================================
Purpose:
Native-first worktree planning with a governed portable fallback. Prefers a
runtime's confirmed native worktree capability; otherwise plans (and bounds) a
portable `.worktrees/<task_id>` placement, and routes cleanup commands per the
chosen strategy.
Key Input Dependencies:
- capability_probe.py's RuntimeCapabilities (native_worktree flag,
worktree_activation/portable_fallback guidance strings).
Key Functions:
- WorktreePlan -- frozen dataclass describing one planned worktree.
- validate_portable_placement() -- bounds a portable path under `.worktrees`.
- build_worktree_plan() -- chooses "native" or "portable" strategy and returns
the resulting WorktreePlan.
- cleanup_command() -- returns (without executing) the cleanup command for a
given path and strategy ("native" or "portable").
"""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import Sequence
from capability_probe import RuntimeCapabilities
# WorktreePlan.strategy / cleanup_command() strategy values -- named here since this
# module owns the concept; import from here rather than retyping the literal.
STRATEGY_NATIVE = "native"
STRATEGY_PORTABLE = "portable"
@dataclass(frozen=True)
class WorktreePlan:
task_id: str
branch_name: str
strategy: str
path: Path
activation_guidance: str
fallback_command: str
def validate_portable_placement(path: Path, repo_root: Path) -> Path:
"""Require portable worktrees to remain below the repository's .worktrees dir."""
worktree_root = (repo_root / ".worktrees").resolve()
candidate = path.resolve()
if candidate != worktree_root and worktree_root not in candidate.parents:
raise ValueError(f"Portable worktree must be below {worktree_root}")
return path
def build_worktree_plan(
task_id: str,
branch_name: str,
repo_root: Path,
capabilities: RuntimeCapabilities,
) -> WorktreePlan:
"""Prefer confirmed native worktrees; otherwise retain the portable placement."""
portable_path = repo_root / ".worktrees" / task_id
if capabilities.native_worktree:
return WorktreePlan(task_id, branch_name, STRATEGY_NATIVE, portable_path,
capabilities.worktree_activation, capabilities.portable_fallback)
validate_portable_placement(portable_path, repo_root)
return WorktreePlan(task_id, branch_name, STRATEGY_PORTABLE, portable_path,
capabilities.worktree_activation, capabilities.portable_fallback)
def cleanup_command(path: Path, strategy: str) -> list[str]:
"""Return an explicit cleanup command without executing it."""
if strategy == STRATEGY_NATIVE:
return ["native-worktree-cleanup", str(path)]
if strategy == STRATEGY_PORTABLE:
return ["git", "worktree", "remove", str(path)]
raise ValueError(f"Unknown worktree strategy: {strategy}")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |