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/demo_plan.py
View on GitHub"""Offline reference-fleet simulation. Never issues a dispatch receipt or reads host state."""
from datetime import datetime, timedelta, timezone
import json
import os
from pathlib import Path
from unittest.mock import patch
import account_fleet
import allocator
# The same bounded task as examples/task.json, so `plan --demo` needs no file from the repository. The profile is what the
# classifier would answer, including the four category demands the router scores on.
SAMPLE_DOCUMENT = {'task': {
'objective': 'Add a missing timeout option to a Python command-line tool, update its help text, and run the existing pytest suite.',
'context': 'A bounded coding task in an existing checkout, estimated at 1.5 active worker-hours. '
'The local test fixtures are needed to verify the change.',
'expected_hours': 1.5,
'needs': {'local_only': True, 'local_only_reason': 'Runs pytest against local repository fixtures on this machine.'},
'profile': {
'work_kind': 'code_implementation', 'primary_level': 2, 'secondary_kind': 'none', 'secondary_level': 0,
'access': 'write', 'local_only': True, 'needs_visual': False, 'wants_fast': False,
'expected_hours': 1.5, 'task_count': '1',
},
}}
# OPENCODE_DB_PATH names a file that does not exist: the local OpenCode usage database is host state too.
NO_HOST_STATE_ENV = {'ROUTER_LAUNCH_FAILURES': 'off', 'ROUTER_PROVIDER_RETRY': 'off', 'ROUTER_MODEL_LATCH': 'off',
'AGENTCOMPASS_LIVE_MODELS': 'off', 'OPENCODE_DB_PATH': 'demo-no-opencode.db'}
def sample_document():
return json.loads(json.dumps(SAMPLE_DOCUMENT))
def reference_accounts(fleet=None):
"""Use an explicit offline fleet (the reference fleet, or ``fleet``); never inspect this machine's saved account
state."""
with patch.dict(os.environ, NO_HOST_STATE_ENV):
return account_fleet.load_accounts(document=fleet if fleet is not None else account_fleet.reference_fleet_document())
# The synthetic snapshot of an account the illustrative one below does not name: (remaining %, hours to reset).
OTHER_ACCOUNT = (80, 120)
def priced_fleet(fleet):
"""A public accounts document as an install would see it once discovery found its accounts: each account of a family
the reference fleet signs in to (a verified fixture account) is verified, declares that family and takes the
reference fleet's plan tier for it, so its windows are priced from the set's own capacity data. Accounts of other
families stay as the document has them (out of automatic routing until discovery prices them)."""
doc = json.loads(json.dumps(fleet))
tiers = {}
for name, spec in account_fleet.reference_fleet_document()['accounts'].items():
if isinstance(spec, dict) and spec.get('verified') and spec.get('plan'):
tiers.setdefault(spec.get('family') or name, spec['plan'])
for name, spec in (doc.get('accounts') or {}).items():
if isinstance(spec, dict) and name in tiers:
spec.update(verified=True, family=name, plan=tiers[name])
spec.pop('capacity_status', None)
return doc
def plan(document, fleet=None):
"""Offline plan of ``document`` on the reference fleet, or on ``fleet`` (a public accounts document: the acceptance of
a reference set routes on the set's own fleet), with a synthetic quota snapshot."""
task = document.get('task')
if not isinstance(task, dict) or not task:
raise ValueError('Input requires task.')
# Continuations refer to live sessions; a demo always starts a fresh simulated task.
task = {k: v for k, v in task.items() if k not in ('chain', 'worker')}
now = datetime(2026, 10, 27, 12, tzinfo=timezone.utc)
accounts = reference_accounts(fleet)
# Illustrative observations, not a claim about current subscriptions or model availability.
snapshot = {'claude': (55, 112), 'codex': (83, 144), 'antigravity': (63, 89), 'dot': (100, 168)}
if fleet is None:
accounts['accounts'] = {k: v for k, v in accounts['accounts'].items() if k in snapshot}
else:
snapshot = {name: snapshot.get(name, OTHER_ACCOUNT) for name in accounts['accounts']}
usage = {'status': 'demo_reference', 'read_ok': True, 'read_at': now.isoformat(), 'accounts': {}}
for name, spec in accounts['accounts'].items():
remaining, reset_hours = snapshot[name]
windows = []
for wid, window in spec.get('windows', {}).items():
short = window.get('hours', 168) < 24
windows.append({'id': wid, 'used_pct': 10 if short else 100 - remaining,
'remaining_pct_before_reset': 90 if short else remaining,
'seconds_until_reset': (4 if short else reset_hours) * 3600,
'resets_at': (now + timedelta(hours=4 if short else reset_hours)).isoformat()})
usage['accounts'][name] = {'status': 'fresh', 'available': True, 'stale': False,
'fetched_at': now.isoformat(), 'windows': windows}
with patch.dict(os.environ, NO_HOST_STATE_ENV): # this machine's cooldowns/holds/latches are host state
result = allocator.plan(task, usage, now, records=[], accounts=accounts, overrides=[],
host_policy_config={'allowed_accounts': list(snapshot)},
read_local_state=False)
result['demo'] = True
result['notice'] = ('DEMO: synthetic quota snapshot and reference fleet aliases. No credentials, live quotas, '
'network calls, ledger writes or worker launches. Rankings are illustrative.')
return result
def format_table(result):
lines = [result.get('notice', 'Candidate ranking'), '', f"{'Rank':<5} {'Bundle':<24} {'Score':>8} Status"]
rank = 0
for candidate in result.get('ranking', []):
excluded = candidate.get('excluded') or []
if not excluded:
rank += 1
score = '-' if candidate.get('score') is None else f"{candidate['score']:.4f}"
status = '; '.join(excluded) if excluded else ('winner' if candidate['id'] == result.get('choice') else 'eligible')
lines.append(f"{str(rank) if not excluded else '-':<5} {candidate['id']:<24} {score:>8} {status}")
lines.extend(['', result.get('decision', {}).get('reason', '')])
lines.extend(f'warning: {text}' for text in result.get('warnings') or ())
return '\n'.join(lines)
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 |