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/test_usage_core_claude_accounts.py
View on GitHub"""Second Claude account must never borrow or refresh the first account's token."""
import unittest
from datetime import datetime, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import patch
import usage_core as usage
class ClaudeAccountsTests(unittest.TestCase):
def test_missing_second_account_does_not_fall_back(self):
with TemporaryDirectory() as folder, patch.object(usage, 'CLAUDE_HOME_2', Path(folder)):
self.assertFalse(usage.provider_available('claude-2:7d'))
def test_rate_limit_backoff_and_cached_usage_are_account_scoped(self):
with TemporaryDirectory() as folder, patch.object(usage, 'CACHE_PATH', Path(folder) / 'cache.json'):
usage.set_claude_backoff(provider_id='claude-2')
self.assertTrue(usage.claude_in_backoff('claude-2'))
self.assertFalse(usage.claude_in_backoff())
usage.clear_claude_backoff()
self.assertTrue(usage.claude_in_backoff('claude-2'))
good = usage.ProviderUsage(provider_id='claude', display_name='claude', available=True,
fetched_at=datetime.now(timezone.utc).isoformat())
usage.cache_put_provider(good)
self.assertFalse(usage._claude_rate_limited_usage('claude-2').available)
def test_hud_retries_token_refreshed_by_cli(self):
with patch.object(usage, 'read_claude_oauth', side_effect=[({'accessToken': 'old'}, None), ({'accessToken': 'new'}, None)]), patch.object(
usage, 'http_json', side_effect=[(401, None), (200, {})]
) as call:
self.assertEqual(usage.claude_authorized_json('usage', home=Path('second')), (200, {}))
self.assertEqual(call.call_args.kwargs['headers']['Authorization'], 'Bearer new')
if __name__ == '__main__':
unittest.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 |