akiiwa-games/AgentCompass / skills/agent-compass
agent-compass
FlaggedChoose owner, model and effort, outbound authorization, advisor use, and continuation for delegated work. Reads local usage and effective account policy, profiles the task with the configured System-One scorer, then allocates a compatible worker. Use for independent worker or advisor work; ordinary local execution needs no routing.
scripts/override_store.py
View on GitHub"""Process-safe override transactions; the stable sidecar lock is never unlinked."""
from contextlib import contextmanager
import json
import os
from pathlib import Path
import tempfile
import time
@contextmanager
def locked(path, timeout=10):
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
# The lock is on byte 0 whether or not the file holds one: nothing is written, since a write of that byte from a
# second handle is refused while the first holds the lock.
with open(str(path) + '.lock', 'a+b') as handle:
deadline = time.monotonic() + timeout
while True:
try:
handle.seek(0)
if os.name == 'nt':
import msvcrt
msvcrt.locking(handle.fileno(), msvcrt.LK_NBLCK, 1)
else:
import fcntl
fcntl.flock(handle.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
break
except OSError:
if time.monotonic() >= deadline:
raise TimeoutError('Override store is busy') from None
time.sleep(0.05)
try:
yield
finally:
handle.seek(0)
if os.name == 'nt':
msvcrt.locking(handle.fileno(), msvcrt.LK_UNLCK, 1)
else:
fcntl.flock(handle.fileno(), fcntl.LOCK_UN)
def retry_denied(call, attempts=5, pause=0.05):
"""Windows denies a replace while a reader has the file open, and an open during a replace."""
for attempt in range(attempts - 1):
try:
return call()
except PermissionError:
time.sleep(pause)
return call()
def write(path, document):
"""Atomic replacement; caller holds locked(path) across read/modify/write."""
path = Path(path)
fd, temporary = tempfile.mkstemp(prefix=path.name + '.', suffix='.tmp', dir=path.parent)
try:
with os.fdopen(fd, 'w', encoding='utf-8') as handle:
json.dump(document, handle, ensure_ascii=False, indent=2)
handle.flush()
os.fsync(handle.fileno())
retry_denied(lambda: os.replace(temporary, path))
finally:
if os.path.exists(temporary):
os.unlink(temporary)
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 |