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