Skip to content

martin1847/evolab / skills/cto-orchestration

cto-orchestration

Unverified

以 CTO/orchestrator 模式管理多 agent 软件交付。用户要求“你做 CTO/编排者”“派 omp/codex 去做”“goal 模式派发”、管理多会话开发或接入这套工作流时使用;“复盘/收口/retro/retrospective”“工作盘点/盘点候选/stocktake”也必须触发,盘点只提案不动工。新项目先用 repo-governance-bootstrap 建治理骨架。不用于单 agent 小任务、无需评审循环的局部改动或纯文档初始化。

FileKindSize
README.mdmarkdown5.3 KB
SKILL.mdskill md15.8 KB
references/agentctl/README.mdmarkdown26.8 KB
references/agentctl/agentctlexecutablescript57.6 KB
references/agentctl/codegraph-hooks.shexecutablescript2.5 KB
references/agentctl/cto-guard-agent.pyexecutablescript26.6 KB
references/agentctl/cto-guard-bash.pyexecutablescript150.5 KB
references/agentctl/cto-guard-edit.pyexecutablescript16.7 KB
references/agentctl/cto-guard-stop.pyexecutablescript7.6 KB
references/agentctl/duplexctl.pyexecutablescript239.5 KB
references/agentctl/guard-hooks.jsonconfig1.5 KB
references/agentctl/identity.pyexecutablescript113.5 KB
references/agentctl/post-checkout-codegraph.shscript18 B
references/agentctl/seat-census.pyscript10.8 KB
references/agentctl/watchctl.pyexecutablescript143.2 KB
references/agents-md-orchestration-section.mdmarkdown5.3 KB
references/decision-queue.mdmarkdown5.7 KB
references/dispatch-baseline.mdmarkdown3.7 KB
references/doc-lifecycle.pyexecutablescript9.2 KB
references/frontend-verify.mdmarkdown7.9 KB
references/goal-clauses.mdmarkdown8.0 KB
references/goal-preflight.pyexecutablescript40.9 KB
references/goal-template.mdmarkdown10.8 KB
references/implementation-discipline.mdmarkdown8.0 KB
references/measurement-protocol.mdmarkdown4.2 KB
references/onboarding-checklist.mdmarkdown3.2 KB
references/queue-freshness.pyexecutablescript3.8 KB
references/queue-hooks.jsonconfig617 B
references/retro-check.shexecutablescript28.2 KB
references/retro-hooks.jsonconfig2.2 KB
references/retro-reminder.shexecutablescript5.8 KB
references/retrospective.mdmarkdown7.7 KB
references/review-brief-preamble.mdmarkdown3.4 KB
references/review-dispatch.mdmarkdown14.4 KB
references/session-economics.pyexecutablescript18.2 KB
references/shock-in-the-loop.mdmarkdown3.8 KB
references/stocktake.mdmarkdown2.3 KB

references/queue-freshness.py

View on GitHub
#!/usr/bin/env python3
"""queue-freshness — SessionStart/UserPromptSubmit hook for DECISION_QUEUE hygiene.

It surfaces cleared-history residue, queue byte bloat and staleness against orchestration activity.

Reminder-only, never blocks: there is no deterministic per-turn "unlogged T2 decision" signal
to gate on, and a pseudo-precise block is worse than a reminder (false denies + the 8-strike
Stop-hook fuse). If T2 interception ever leaves a marker file, this can be upgraded to a gate.

Wiring: entries in ../queue-hooks.json (optional — only for projects that keep a DECISION_QUEUE).
Env: QUEUE_STALE_GRACE_SECS (default 3600), QUEUE_NAG_INTERVAL_SECS (default 3600).
Exit 0 always; speaks via hookSpecificOutput.additionalContext (system-reminder channel —
plain stdout is NOT reliably shown to the model for non-blocking hooks).
"""
import glob
import hashlib
import json
import os
import sys
import tempfile
import time


def has_cleared_history(queue):
    """True when the legacy/empty CLEARED section still contains meaningful content."""
    try:
        lines = open(queue, encoding="utf-8").read().splitlines()
    except OSError:
        return False
    inside = False
    for line in lines:
        stripped = line.strip()
        if stripped.startswith("## "):
            if inside:
                return False
            upper = stripped.upper()
            inside = "✅" in stripped and ("CLEARED" in upper or "已清" in stripped)
            continue
        if inside and stripped and not stripped.startswith("<!--"):
            return True
    return False


def main():
    try:
        data = json.load(sys.stdin)
    except Exception:
        return
    root = data.get("cwd") or os.environ.get("CLAUDE_PROJECT_DIR") or os.getcwd()
    queue = os.path.join(root, "docs", "DECISION_QUEUE.md")
    if not os.path.isfile(queue):
        return
    event = data.get("hook_event_name") or "UserPromptSubmit"
    issues = []
    size = os.path.getsize(queue)
    if size > 16384:
        issues.append(f"DECISION_QUEUE.md is {size} bytes (cap 16384); prune or archive stale entries.")
    if has_cleared_history(queue):
        issues.append(
            "DECISION_QUEUE.md still contains entries under its cleared-history section. "
            "Treat every one as CLOSED and never rehydrate it into active work. Remove those "
            "entries before handoff/compact; git history is the audit trail."
        )
    orch_files = [f for f in glob.glob(os.path.join(root, "docs", "orchestration", "**", "*"),
                                       recursive=True) if os.path.isfile(f)]
    if orch_files:
        newest = max(os.path.getmtime(f) for f in orch_files)
        grace = int(os.environ.get("QUEUE_STALE_GRACE_SECS", "3600"))
        qm = os.path.getmtime(queue)
        if qm + grace < newest:
            hrs = (newest - qm) / 3600
            issues.append(
                f"DECISION_QUEUE.md is {hrs:.1f}h staler than the newest docs/orchestration/ "
                "activity. Refresh active decisions and re-float due revisit triggers."
            )
    if not issues:
        return
    # A new/resumed/compacted context must always see hygiene state. Mid-session prompts are
    # rate-limited to avoid repeated noise.
    tag = hashlib.sha256(root.encode()).hexdigest()[:8]
    stamp = os.path.join(tempfile.gettempdir(), f"queue-freshness-nag-{tag}")
    interval = int(os.environ.get("QUEUE_NAG_INTERVAL_SECS", "3600"))
    if event == "UserPromptSubmit":
        try:
            if os.path.exists(stamp) and time.time() - os.path.getmtime(stamp) < interval:
                return
            open(stamp, "w").close()
        except OSError:
            pass
    print(json.dumps({"hookSpecificOutput": {
        "hookEventName": event,
        "additionalContext": "⚖️ " + " ".join(issues)
    }}))


main()
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall