@trac3er/oh-my-god 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/.claude-plugin/marketplace.json +8 -8
  2. package/.claude-plugin/plugin.json +5 -4
  3. package/.claude-plugin/scripts/uninstall.sh +74 -3
  4. package/.claude-plugin/scripts/update.sh +78 -3
  5. package/.coveragerc +26 -0
  6. package/.mcp.json +4 -4
  7. package/CHANGELOG.md +14 -0
  8. package/CODE_OF_CONDUCT.md +27 -0
  9. package/CONTRIBUTING.md +62 -0
  10. package/OMG-setup.sh +1201 -355
  11. package/README.md +77 -56
  12. package/SECURITY.md +25 -0
  13. package/agents/__init__.py +1 -0
  14. package/agents/model_roles.py +196 -0
  15. package/agents/omg-architect-mode.md +3 -5
  16. package/agents/omg-backend-engineer.md +3 -5
  17. package/agents/omg-database-engineer.md +3 -5
  18. package/agents/omg-frontend-designer.md +4 -5
  19. package/agents/omg-implement-mode.md +4 -5
  20. package/agents/omg-infra-engineer.md +3 -5
  21. package/agents/omg-research-mode.md +4 -6
  22. package/agents/omg-security-auditor.md +3 -5
  23. package/agents/omg-testing-engineer.md +3 -5
  24. package/build/lib/yaml.py +321 -0
  25. package/commands/OMG:ai-commit.md +101 -14
  26. package/commands/OMG:arch.md +302 -19
  27. package/commands/OMG:ccg.md +12 -7
  28. package/commands/OMG:compat.md +25 -17
  29. package/commands/OMG:cost.md +173 -13
  30. package/commands/OMG:crazy.md +1 -1
  31. package/commands/OMG:create-agent.md +170 -20
  32. package/commands/OMG:deps.md +235 -17
  33. package/commands/OMG:domain-init.md +1 -1
  34. package/commands/OMG:escalate.md +41 -12
  35. package/commands/OMG:health-check.md +37 -13
  36. package/commands/OMG:init.md +122 -14
  37. package/commands/OMG:project-init.md +1 -1
  38. package/commands/OMG:session-branch.md +76 -9
  39. package/commands/OMG:session-fork.md +42 -5
  40. package/commands/OMG:session-merge.md +124 -8
  41. package/commands/OMG:setup.md +69 -12
  42. package/commands/OMG:stats.md +215 -14
  43. package/commands/OMG:teams.md +19 -10
  44. package/config/lsp_languages.yaml +8 -0
  45. package/hooks/__init__.py +0 -0
  46. package/hooks/_agent_registry.py +423 -0
  47. package/hooks/_analytics.py +291 -0
  48. package/hooks/_budget.py +31 -0
  49. package/hooks/_common.py +569 -0
  50. package/hooks/_compression_optimizer.py +119 -0
  51. package/hooks/_cost_ledger.py +176 -0
  52. package/hooks/_learnings.py +126 -0
  53. package/hooks/_memory.py +103 -0
  54. package/hooks/_protected_context.py +150 -0
  55. package/hooks/_token_counter.py +221 -0
  56. package/hooks/branch_manager.py +236 -0
  57. package/hooks/budget_governor.py +232 -0
  58. package/hooks/circuit-breaker.py +270 -0
  59. package/hooks/compression_feedback.py +254 -0
  60. package/hooks/config-guard.py +216 -0
  61. package/hooks/context_pressure.py +53 -0
  62. package/hooks/credential_store.py +1020 -0
  63. package/hooks/fetch-rate-limits.py +212 -0
  64. package/hooks/firewall.py +48 -0
  65. package/hooks/hashline-formatter-bridge.py +224 -0
  66. package/hooks/hashline-injector.py +273 -0
  67. package/hooks/hashline-validator.py +216 -0
  68. package/hooks/idle-detector.py +95 -0
  69. package/hooks/intentgate-keyword-detector.py +188 -0
  70. package/hooks/magic-keyword-router.py +195 -0
  71. package/hooks/policy_engine.py +505 -0
  72. package/hooks/post-tool-failure.py +19 -0
  73. package/hooks/post-write.py +219 -0
  74. package/hooks/post_write.py +46 -0
  75. package/hooks/pre-compact.py +398 -0
  76. package/hooks/pre-tool-inject.py +98 -0
  77. package/hooks/prompt-enhancer.py +672 -0
  78. package/hooks/quality-runner.py +191 -0
  79. package/hooks/query.py +512 -0
  80. package/hooks/secret-guard.py +61 -0
  81. package/hooks/secret_audit.py +144 -0
  82. package/hooks/session-end-capture.py +137 -0
  83. package/hooks/session-start.py +277 -0
  84. package/hooks/setup_wizard.py +582 -0
  85. package/hooks/shadow_manager.py +297 -0
  86. package/hooks/state_migration.py +225 -0
  87. package/hooks/stop-gate.py +7 -0
  88. package/hooks/stop_dispatcher.py +945 -0
  89. package/hooks/test-validator.py +361 -0
  90. package/hooks/test_generator_hook.py +123 -0
  91. package/hooks/todo-state-tracker.py +114 -0
  92. package/hooks/tool-ledger.py +149 -0
  93. package/hooks/trust_review.py +585 -0
  94. package/hud/omg-hud.mjs +31 -1
  95. package/lab/__init__.py +1 -0
  96. package/lab/pipeline.py +75 -0
  97. package/lab/policies.py +52 -0
  98. package/package.json +7 -18
  99. package/plugins/README.md +33 -61
  100. package/plugins/advanced/commands/OMG:deep-plan.md +3 -3
  101. package/plugins/advanced/commands/OMG:learn.md +1 -1
  102. package/plugins/advanced/commands/OMG:security-review.md +3 -3
  103. package/plugins/advanced/commands/OMG:ship.md +1 -1
  104. package/plugins/advanced/plugin.json +1 -1
  105. package/plugins/core/plugin.json +8 -3
  106. package/plugins/dephealth/__init__.py +0 -0
  107. package/plugins/dephealth/cve_scanner.py +188 -0
  108. package/plugins/dephealth/license_checker.py +135 -0
  109. package/plugins/dephealth/manifest_detector.py +423 -0
  110. package/plugins/dephealth/vuln_analyzer.py +169 -0
  111. package/plugins/testgen/__init__.py +0 -0
  112. package/plugins/testgen/codamosa_engine.py +402 -0
  113. package/plugins/testgen/edge_case_synthesizer.py +184 -0
  114. package/plugins/testgen/framework_detector.py +271 -0
  115. package/plugins/testgen/skeleton_generator.py +219 -0
  116. package/plugins/viz/__init__.py +0 -0
  117. package/plugins/viz/ast_parser.py +139 -0
  118. package/plugins/viz/diagram_generator.py +192 -0
  119. package/plugins/viz/graph_builder.py +444 -0
  120. package/plugins/viz/native_parsers.py +259 -0
  121. package/plugins/viz/regex_parser.py +112 -0
  122. package/pyproject.toml +81 -0
  123. package/rules/contextual/write-verify.md +2 -2
  124. package/rules/core/00-truth.md +1 -1
  125. package/rules/core/01-surgical.md +1 -1
  126. package/rules/core/02-circuit-breaker.md +2 -2
  127. package/rules/core/03-ensemble.md +3 -3
  128. package/rules/core/04-testing.md +3 -3
  129. package/runtime/__init__.py +32 -0
  130. package/runtime/adapters/__init__.py +13 -0
  131. package/runtime/adapters/claude.py +60 -0
  132. package/runtime/adapters/gpt.py +53 -0
  133. package/runtime/adapters/local.py +53 -0
  134. package/runtime/adoption.py +212 -0
  135. package/runtime/business_workflow.py +220 -0
  136. package/runtime/cli_provider.py +85 -0
  137. package/runtime/compat.py +1299 -0
  138. package/runtime/custom_agent_loader.py +366 -0
  139. package/runtime/dispatcher.py +47 -0
  140. package/runtime/ecosystem.py +371 -0
  141. package/runtime/legacy_compat.py +7 -0
  142. package/runtime/mcp_config_writers.py +115 -0
  143. package/runtime/mcp_lifecycle.py +153 -0
  144. package/runtime/mcp_memory_server.py +135 -0
  145. package/runtime/memory_parsers/__init__.py +0 -0
  146. package/runtime/memory_parsers/chatgpt_parser.py +257 -0
  147. package/runtime/memory_parsers/claude_import.py +107 -0
  148. package/runtime/memory_parsers/export.py +97 -0
  149. package/runtime/memory_parsers/gemini_import.py +91 -0
  150. package/runtime/memory_parsers/kimi_import.py +91 -0
  151. package/runtime/memory_store.py +215 -0
  152. package/runtime/omc_compat.py +7 -0
  153. package/runtime/providers/__init__.py +0 -0
  154. package/runtime/providers/codex_provider.py +112 -0
  155. package/runtime/providers/gemini_provider.py +128 -0
  156. package/runtime/providers/kimi_provider.py +151 -0
  157. package/runtime/providers/opencode_provider.py +144 -0
  158. package/runtime/subagent_dispatcher.py +362 -0
  159. package/runtime/team_router.py +1167 -0
  160. package/runtime/tmux_session_manager.py +169 -0
  161. package/scripts/check-omg-compat-contract-snapshot.py +137 -0
  162. package/scripts/check-omg-contract-snapshot.py +12 -0
  163. package/scripts/check-omg-public-ready.py +193 -0
  164. package/scripts/check-omg-standalone-clean.py +103 -0
  165. package/scripts/legacy_to_omg_migrate.py +29 -0
  166. package/scripts/migrate-legacy.py +464 -0
  167. package/scripts/omc_to_omg_migrate.py +12 -0
  168. package/scripts/omg.py +492 -0
  169. package/scripts/settings-merge.py +283 -0
  170. package/scripts/verify-standalone.sh +8 -4
  171. package/settings.json +126 -29
  172. package/templates/profile.yaml +1 -1
  173. package/tools/__init__.py +2 -0
  174. package/tools/browser_consent.py +289 -0
  175. package/tools/browser_stealth.py +481 -0
  176. package/tools/browser_tool.py +448 -0
  177. package/tools/changelog_generator.py +347 -0
  178. package/tools/commit_splitter.py +746 -0
  179. package/tools/config_discovery.py +151 -0
  180. package/tools/config_merger.py +449 -0
  181. package/tools/dashboard_generator.py +300 -0
  182. package/tools/git_inspector.py +298 -0
  183. package/tools/lsp_client.py +275 -0
  184. package/tools/lsp_discovery.py +231 -0
  185. package/tools/lsp_operations.py +392 -0
  186. package/tools/pr_generator.py +404 -0
  187. package/tools/python_repl.py +656 -0
  188. package/tools/python_sandbox.py +609 -0
  189. package/tools/search_providers/__init__.py +77 -0
  190. package/tools/search_providers/brave.py +115 -0
  191. package/tools/search_providers/exa.py +116 -0
  192. package/tools/search_providers/jina.py +104 -0
  193. package/tools/search_providers/perplexity.py +139 -0
  194. package/tools/search_providers/synthetic.py +74 -0
  195. package/tools/session_snapshot.py +736 -0
  196. package/tools/ssh_manager.py +912 -0
  197. package/tools/theme_engine.py +294 -0
  198. package/tools/theme_selector.py +137 -0
  199. package/tools/web_search.py +622 -0
  200. package/yaml.py +321 -0
  201. package/.claude-plugin/scripts/install.sh +0 -9
  202. package/bun.lock +0 -23
  203. package/bunfig.toml +0 -3
  204. package/hooks/_budget.ts +0 -1
  205. package/hooks/_common.ts +0 -63
  206. package/hooks/circuit-breaker.ts +0 -101
  207. package/hooks/config-guard.ts +0 -4
  208. package/hooks/firewall.ts +0 -20
  209. package/hooks/policy_engine.ts +0 -156
  210. package/hooks/post-tool-failure.ts +0 -22
  211. package/hooks/post-write.ts +0 -4
  212. package/hooks/pre-tool-inject.ts +0 -4
  213. package/hooks/prompt-enhancer.ts +0 -46
  214. package/hooks/quality-runner.ts +0 -24
  215. package/hooks/secret-guard.ts +0 -4
  216. package/hooks/session-end-capture.ts +0 -19
  217. package/hooks/session-start.ts +0 -19
  218. package/hooks/shadow_manager.ts +0 -81
  219. package/hooks/stop-gate.ts +0 -22
  220. package/hooks/stop_dispatcher.ts +0 -147
  221. package/hooks/test-generator-hook.ts +0 -4
  222. package/hooks/tool-ledger.ts +0 -27
  223. package/hooks/trust_review.ts +0 -175
  224. package/lab/pipeline.ts +0 -75
  225. package/lab/policies.ts +0 -68
  226. package/runtime/common.ts +0 -111
  227. package/runtime/compat.ts +0 -174
  228. package/runtime/dispatcher.ts +0 -25
  229. package/runtime/ecosystem.ts +0 -186
  230. package/runtime/provider_bootstrap.ts +0 -99
  231. package/runtime/provider_smoke.ts +0 -34
  232. package/runtime/release_readiness.ts +0 -186
  233. package/runtime/team_router.ts +0 -144
  234. package/scripts/check-omg-compat-contract-snapshot.ts +0 -20
  235. package/scripts/check-omg-standalone-clean.ts +0 -12
  236. package/scripts/check-runtime-clean.ts +0 -94
  237. package/scripts/omg.ts +0 -352
  238. package/scripts/settings-merge.ts +0 -93
  239. package/tools/commit_splitter.ts +0 -23
  240. package/tools/git_inspector.ts +0 -18
  241. package/tools/session_snapshot.ts +0 -47
  242. package/trac3er-oh-my-god-2.0.0.tgz +0 -0
  243. package/tsconfig.json +0 -15
package/README.md CHANGED
@@ -1,85 +1,106 @@
1
- # OMG v2 Bun Runtime
1
+ # OMG 2.0.2
2
2
 
3
- OMG `v2.0.0` runs on Bun + TypeScript. The public product surface stays stable:
3
+ [![Compat Gate](https://github.com/trac3er00/OMG/actions/workflows/omg-compat-gate.yml/badge.svg)](https://github.com/trac3er00/OMG/actions/workflows/omg-compat-gate.yml)
4
+ [![npm version](https://img.shields.io/npm/v/%40trac3er%2Foh-my-god)](https://www.npmjs.com/package/@trac3er/oh-my-god)
5
+ [![License](https://img.shields.io/github/license/trac3er00/OMG)](LICENSE)
4
6
 
5
- - `omg` remains the CLI entrypoint
6
- - Claude hooks still write to `.omg/`
7
- - standalone install, plugin install, update, and uninstall still go through `OMG-setup.sh`
8
- - team routing, compat, provider status, and release readiness keep the same subcommands
7
+ OMG upgrades your agent host instead of replacing it. It gives Claude Code, Codex, OpenCode, and other supported CLIs a tighter setup flow, stronger orchestration, native adoption from older plugin stacks, and proof-backed verification.
9
8
 
10
- ## Requirements
9
+ - Brand: `OMG`
10
+ - Repo: `https://github.com/trac3er00/OMG`
11
+ - npm: `@trac3er/oh-my-god`
12
+ - Plugin id: `omg`
13
+ - Marketplace id: `omg`
14
+ - Version: `2.0.2`
11
15
 
12
- - Bun `>= 1.3`
13
- - Claude Code or a compatible `~/.claude` config
14
- - optional provider CLIs for multi-provider routing: `codex`, `gemini`, `kimi`
16
+ ## Why OMG
15
17
 
16
- ## Install
18
+ - Small front door: install, run `/OMG:setup`, then `/OMG:crazy <goal>`.
19
+ - Multi-host support: Claude Code, Codex, OpenCode, Gemini CLI, and Kimi CLI.
20
+ - Native adoption: setup detects OMC, OMX, and Superpowers-style environments without exposing copycat public migration commands.
21
+ - Proof-first delivery: verification, provider coverage, HUD artifacts, and transcripts are published instead of implied.
22
+
23
+ ![OMG HUD](docs/assets/omg-hud.svg)
24
+
25
+ ## Quickstart
26
+
27
+ Install with npm:
17
28
 
18
29
  ```bash
19
- bun install
20
- ./OMG-setup.sh install
30
+ npm install @trac3er/oh-my-god
21
31
  ```
22
32
 
23
- Plugin bundle mode:
33
+ Or clone and run the setup manager:
24
34
 
25
35
  ```bash
26
- ./OMG-setup.sh install --install-as-plugin
36
+ git clone https://github.com/trac3er00/OMG
37
+ cd OMG
38
+ chmod +x OMG-setup.sh
39
+ ./OMG-setup.sh install --mode=omg-only --preset=balanced
27
40
  ```
28
41
 
29
- Upgrade or remove:
42
+ Then run:
30
43
 
31
- ```bash
32
- ./OMG-setup.sh update
33
- ./OMG-setup.sh uninstall
44
+ ```text
45
+ /OMG:setup
46
+ /OMG:crazy stabilize auth and dashboard flows
34
47
  ```
35
48
 
36
- ## CLI
49
+ Success looks like:
37
50
 
38
- Local source execution:
51
+ - supported hosts are detected
52
+ - `.mcp.json` is configured
53
+ - `.omg/state/adoption-report.json` is written when another ecosystem is present
54
+ - OMG reports the selected preset and next step
39
55
 
40
- ```bash
41
- bun scripts/omg.ts teams --target auto --problem "debug auth regression"
42
- bun scripts/omg.ts ccg --problem "refactor dashboard + API contract"
43
- bun scripts/omg.ts compat list
44
- bun scripts/omg.ts providers status
45
- bun scripts/omg.ts release readiness
46
- ```
56
+ ## Install Guides
47
57
 
48
- When installed from npm, the package exposes the same surface as:
58
+ - Claude Code: [docs/install/claude-code.md](docs/install/claude-code.md)
59
+ - Codex: [docs/install/codex.md](docs/install/codex.md)
60
+ - OpenCode: [docs/install/opencode.md](docs/install/opencode.md)
49
61
 
50
- ```bash
51
- omg teams --target auto --problem "debug auth regression"
52
- ```
62
+ ## Native Adoption
53
63
 
54
- ## Runtime Layout
64
+ OMG uses native setup language instead of public migration commands.
55
65
 
56
- - `scripts/omg.ts`: Bun CLI
57
- - `hooks/*.ts`: Claude hook entrypoints
58
- - `runtime/*.ts`: routing, compat, provider, and release helpers
59
- - `control_plane/*.ts`: local JSON control-plane API
60
- - `lab/*.ts`: Bun pipeline policy and evaluation flow
61
- - `registry/verify_artifact.ts`: supply-artifact verification
62
- - `omg_natives/index.ts`: Bun-native helper surface
63
- - `tools/*.ts`: Bun support utilities used by commands and tests
66
+ - `OMG-only`: recommended. OMG becomes the primary hooks, HUD, MCP, and orchestration layer.
67
+ - `coexist`: advanced. OMG preserves non-conflicting third-party surfaces and records overlap instead of overwriting it.
68
+ - Presets: `safe`, `balanced`, `interop`, `labs`.
64
69
 
65
- Stable `settings.json` only registers hooks that perform work at runtime: session start/end capture, the Bash circuit breaker, tool ledger, post-tool-failure, and stop dispatch.
70
+ Compatibility references to OMC, OMX, and Superpowers are documented here: [docs/migration/native-adoption.md](docs/migration/native-adoption.md)
66
71
 
67
- ## Verification
72
+ ## Proof
68
73
 
69
- ```bash
70
- bun run typecheck
71
- bun test
72
- bun run check:runtime-clean
73
- ```
74
+ Current local verification for this release: `2452 passed, 2 skipped` on March 6, 2026.
74
75
 
75
- Control plane:
76
+ - Verification and provider matrix: [docs/proof.md](docs/proof.md)
77
+ - Sample setup transcript: [docs/transcripts/setup.md](docs/transcripts/setup.md)
78
+ - Sample crazy transcript: [docs/transcripts/crazy.md](docs/transcripts/crazy.md)
79
+ - Release process: [docs/release-checklist.md](docs/release-checklist.md)
76
80
 
77
- ```bash
78
- bun control_plane/server.ts --port 8787
79
- ```
81
+ ## Command Surface
82
+
83
+ Primary entry points:
84
+
85
+ - `/OMG:setup`
86
+ - `/OMG:crazy`
87
+
88
+ Advanced surfaces stay available for deeper workflows:
89
+
90
+ - `/OMG:teams`
91
+ - `/OMG:ccg`
92
+ - `/OMG:compat`
93
+ - `/OMG:ship`
94
+ - `/OMG:security-review`
95
+
96
+ ## Contributing
97
+
98
+ Public contributions are welcome.
99
+
100
+ - Contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md)
101
+ - Security reporting: [SECURITY.md](SECURITY.md)
102
+ - Changelog: [CHANGELOG.md](CHANGELOG.md)
80
103
 
81
- ## Release Notes
104
+ ## Positioning
82
105
 
83
- - prerelease tags matching `v*-beta.*` publish to npm with the `beta` dist-tag
84
- - stable tags continue to publish on `latest`
85
- - the repo includes a legacy-runtime cleanliness gate that fails if retired runtime files or stale command references return
106
+ OMG is a plugin and orchestration layer for supported CLIs. It is not a base-model training project. The goal is to make frontier agent hosts tighter, safer, more interoperable, and more verifiable than the default experience.
package/SECURITY.md ADDED
@@ -0,0 +1,25 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ Please use GitHub's private vulnerability reporting for this repository if it is enabled.
6
+
7
+ If private reporting is not available, do not open a public issue with exploit details. Open a minimal issue asking for a private contact path through the maintainer's GitHub profile instead.
8
+
9
+ Include:
10
+
11
+ - affected version
12
+ - impact
13
+ - reproduction steps
14
+ - proof of concept if safe to share privately
15
+ - suggested mitigation if known
16
+
17
+ ## Response Expectations
18
+
19
+ - We will triage reports before public discussion.
20
+ - We may ask for additional reproduction details.
21
+ - Coordinated disclosure is preferred over immediate public disclosure.
22
+
23
+ ## Supported Versions
24
+
25
+ Security fixes are prioritized for the latest released version.
@@ -0,0 +1 @@
1
+ """OMG agents module."""
@@ -0,0 +1,196 @@
1
+ #!/usr/bin/env python3
2
+ """Model roles loader — defines role configurations for model selection.
3
+
4
+ Loads role definitions from _model_roles.yaml and provides utilities for
5
+ role-based model selection, CLI argument parsing, and feature flag control.
6
+ """
7
+ import os
8
+ import sys
9
+ from pathlib import Path
10
+ from typing import Optional
11
+
12
+ # Try to import yaml; fall back to json if not available
13
+ try:
14
+ import yaml
15
+ HAS_YAML = True
16
+ except ImportError:
17
+ HAS_YAML = False
18
+ import json
19
+
20
+ # Add parent directory to path for importing from hooks
21
+ _AGENTS_DIR = Path(__file__).parent
22
+ _HOOKS_DIR = _AGENTS_DIR.parent / "hooks"
23
+ if str(_HOOKS_DIR) not in sys.path:
24
+ sys.path.insert(0, str(_HOOKS_DIR))
25
+
26
+ try:
27
+ from _common import get_feature_flag, get_project_dir
28
+ except ImportError:
29
+ # Fallback if _common is not available
30
+ def get_feature_flag(flag_name, default=True):
31
+ env_key = f"OMG_{flag_name.upper()}_ENABLED"
32
+ env_val = os.environ.get(env_key, "").lower()
33
+ if env_val in ("0", "false", "no"):
34
+ return False
35
+ if env_val in ("1", "true", "yes"):
36
+ return True
37
+ return default
38
+
39
+ def get_project_dir():
40
+ return os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
41
+
42
+
43
+ # Global roles dictionary
44
+ ROLES: dict = {}
45
+
46
+
47
+ def _load_roles() -> dict:
48
+ """Load role definitions from _model_roles.yaml.
49
+
50
+ Returns:
51
+ Dictionary mapping role names to role configurations.
52
+ Falls back to default roles if YAML cannot be loaded.
53
+ """
54
+ roles_file = _AGENTS_DIR / "_model_roles.yaml"
55
+
56
+ if not roles_file.exists():
57
+ return _get_default_roles()
58
+
59
+ try:
60
+ if HAS_YAML:
61
+ with open(roles_file, "r") as f:
62
+ data = yaml.safe_load(f)
63
+ if data and "roles" in data:
64
+ return data["roles"]
65
+ except Exception as e:
66
+ print(f"[OMG] Warning: Failed to load roles from {roles_file}: {e}", file=sys.stderr)
67
+
68
+
69
+ return _get_default_roles()
70
+
71
+
72
+ def _get_default_roles() -> dict:
73
+ """Return hardcoded default roles if YAML cannot be loaded."""
74
+ return {
75
+ "default": {
76
+ "model": "claude-opus-4-5",
77
+ "temperature": 1.0,
78
+ "max_tokens": 8192,
79
+ "description": "Default balanced model for general tasks"
80
+ },
81
+ "smol": {
82
+ "model": "claude-haiku-4-5",
83
+ "temperature": 0.7,
84
+ "max_tokens": 4096,
85
+ "description": "Fast cheap model for simple/trivial tasks"
86
+ },
87
+ "slow": {
88
+ "model": "claude-opus-4-5",
89
+ "temperature": 0.5,
90
+ "max_tokens": 16384,
91
+ "description": "Careful deliberate model for complex reasoning"
92
+ },
93
+ "plan": {
94
+ "model": "claude-sonnet-4-5",
95
+ "temperature": 0.8,
96
+ "max_tokens": 8192,
97
+ "description": "Planning and architecture model"
98
+ },
99
+ "commit": {
100
+ "model": "claude-haiku-4-5",
101
+ "temperature": 0.3,
102
+ "max_tokens": 2048,
103
+ "description": "Concise model for git commits and short summaries"
104
+ }
105
+ }
106
+
107
+
108
+ def get_role(name: str) -> dict:
109
+ """Get role configuration by name.
110
+
111
+ Args:
112
+ name: Role name (e.g., 'smol', 'slow', 'plan', 'commit', 'default')
113
+
114
+ Returns:
115
+ Role configuration dictionary. Returns 'default' role if name not found.
116
+ """
117
+ if not ROLES:
118
+ _init_roles()
119
+
120
+ return ROLES.get(name, ROLES.get("default", {}))
121
+
122
+
123
+ def list_roles() -> list[str]:
124
+ """Get list of all available role names.
125
+
126
+ Returns:
127
+ List of role names in order they appear in configuration.
128
+ """
129
+ if not ROLES:
130
+ _init_roles()
131
+
132
+ return list(ROLES.keys())
133
+
134
+
135
+ def parse_role_args(argv: list[str]) -> Optional[str]:
136
+ """Parse command-line arguments to detect role selection.
137
+
138
+ Detects: --smol, --slow, --plan, --commit
139
+
140
+ Args:
141
+ argv: Command-line arguments (typically sys.argv[1:])
142
+
143
+ Returns:
144
+ Role name if detected, None otherwise.
145
+ """
146
+ role_map = {
147
+ "--smol": "smol",
148
+ "--slow": "slow",
149
+ "--plan": "plan",
150
+ "--commit": "commit",
151
+ }
152
+
153
+ for arg in argv:
154
+ if arg in role_map:
155
+ return role_map[arg]
156
+
157
+ return None
158
+
159
+
160
+ def _init_roles() -> None:
161
+ """Initialize the global ROLES dictionary."""
162
+ global ROLES
163
+ ROLES = _load_roles()
164
+
165
+
166
+ # Initialize on module import
167
+ _init_roles()
168
+
169
+
170
+ if __name__ == "__main__":
171
+ # CLI for testing/inspection
172
+ import json as json_module
173
+
174
+ if len(sys.argv) > 1:
175
+ if sys.argv[1] == "list":
176
+ print("Available roles:")
177
+ for role_name in list_roles():
178
+ print(f" - {role_name}")
179
+ elif sys.argv[1] == "get":
180
+ if len(sys.argv) > 2:
181
+ role_name = sys.argv[2]
182
+ role = get_role(role_name)
183
+ print(json_module.dumps(role, indent=2))
184
+ else:
185
+ print("Usage: python3 model_roles.py get <role_name>")
186
+ elif sys.argv[1] == "parse":
187
+ detected = parse_role_args(sys.argv[2:])
188
+ if detected:
189
+ print(f"Detected role: {detected}")
190
+ else:
191
+ print("No role detected")
192
+ else:
193
+ print("Usage: python3 model_roles.py [list|get <role>|parse <args...>]")
194
+ else:
195
+ # Default: print all roles
196
+ print(json_module.dumps(ROLES, indent=2))
@@ -17,11 +17,9 @@ Architect mode cognitive agent. Designs system architecture, models domains, cre
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_lsp_symbols`: Map out module structure and exported interfaces
21
- - `mcp_lsp_find_references`: Trace dependencies between modules
22
- - `mcp_ast_grep_search`: Find architectural patterns (dependency injection, event handlers)
23
- - `mcp_grep`: Find cross-cutting concerns (logging, error handling, auth checks)
24
- - `mcp_filesystem_directory_tree`: Visualize project structure
20
+ - `filesystem`: Visualize project structure and inspect cross-module boundaries
21
+ - `context7`: Check official guidance for architectural patterns or framework constraints
22
+ - `websearch`: Validate trade-offs against current ecosystem practice when needed
25
23
 
26
24
  ## Constraints
27
25
 
@@ -17,11 +17,9 @@ Backend engineering specialist. Handles all server-side tasks: API routes, middl
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_lsp_goto_definition`: Trace function calls through the codebase
21
- - `mcp_lsp_find_references`: Find all usages of an API endpoint or function
22
- - `mcp_lsp_diagnostics`: Check for type errors before running build
23
- - `mcp_ast_grep_search`: Find patterns like unhandled promises or missing error handling
24
- - `mcp_context7_query-docs`: Look up framework-specific API documentation
20
+ - `context7`: Look up framework-specific API and runtime documentation
21
+ - `filesystem`: Inspect handlers, configs, and local artifacts tied to the request path
22
+ - `websearch`: Verify current integration guidance when third-party behavior may have changed
25
23
 
26
24
  ## Constraints
27
25
 
@@ -17,11 +17,9 @@ Database engineering specialist. Handles schema design, migrations, query optimi
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_bash`: Run migrations, psql/mysql commands, knex/prisma/drizzle CLI
21
- - `mcp_grep`: Find all queries touching a specific table or column
22
- - `mcp_ast_grep_search`: Find raw SQL patterns, N+1 query indicators
23
- - `mcp_lsp_goto_definition`: Trace ORM model relationships
24
- - `mcp_lsp_find_references`: Find all code paths that query a table
20
+ - `filesystem`: Inspect migrations, schema files, and query call sites across the workspace
21
+ - `context7`: Look up ORM and database engine documentation
22
+ - `websearch`: Check current migration or performance guidance when local docs are insufficient
25
23
 
26
24
  ## Constraints
27
25
 
@@ -17,11 +17,10 @@ Frontend design specialist. Handles all UI/UX tasks: component design, responsiv
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_puppeteer_puppeteer_screenshot`: Verify visual output after changes
21
- - `mcp_puppeteer_puppeteer_navigate`: Preview pages in browser
22
- - `mcp_lsp_diagnostics`: Check for TypeScript/CSS errors
23
- - `mcp_ast_grep_search`: Find component patterns across codebase
24
- - `mcp_grep_app_searchGitHub`: Find real-world UI implementation examples
20
+ - `chrome-devtools`: Preview pages, inspect layout issues, and validate responsive behavior in a real browser
21
+ - `filesystem`: Review component files, generated assets, and local screenshots without leaving the workspace
22
+ - `context7`: Look up framework and component-library documentation when implementation details are unclear
23
+ - `websearch`: Check current UI patterns or browser-specific behavior when local context is insufficient
25
24
 
26
25
  ## Constraints
27
26
 
@@ -19,11 +19,10 @@ Implementation mode cognitive agent. Executes approved plans by coordinating dom
19
19
 
20
20
  ## MCP Tools Available
21
21
 
22
- - `mcp_bash`: Run cross-module builds, integration tests, linters
23
- - `mcp_lsp_diagnostics`: Check for errors across all changed files
24
- - `mcp_grep`: Verify changes propagated correctly across modules
25
- - `mcp_ast_grep_search`: Ensure patterns are consistent after refactoring
26
- - `mcp_lsp_find_references`: Verify no broken references after changes
22
+ - `filesystem`: Inspect changed files and generated artifacts across modules
23
+ - `context7`: Pull official docs when implementation details depend on library behavior
24
+ - `websearch`: Verify current ecosystem guidance when local docs are incomplete
25
+ - `chrome-devtools`: Validate browser-visible behavior when a change spans UI and backend flows
27
26
 
28
27
  ## Constraints
29
28
 
@@ -17,11 +17,9 @@ Infrastructure engineering specialist. Handles deployment pipelines, Docker/cont
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_bash`: Run `docker`, `terraform`, `kubectl`, `aws/gcloud/az` CLI, CI tools
21
- - `mcp_grep`: Find configuration patterns, environment variable usage
22
- - `mcp_ast_grep_search`: Find hardcoded URLs, ports, or environment-specific values
23
- - `mcp_context7_query-docs`: Look up cloud provider and tool documentation
24
- - `mcp_lsp_diagnostics`: Validate YAML/JSON configuration files
20
+ - `context7`: Look up infrastructure tool and cloud-provider documentation
21
+ - `websearch`: Check current operational guidance, release notes, and platform caveats
22
+ - `filesystem`: Inspect configuration files, manifests, and deployment artifacts in the workspace
25
23
 
26
24
  ## Constraints
27
25
 
@@ -17,12 +17,10 @@ Research mode cognitive agent. Gathers information, evaluates technologies, anal
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_google_search`: Search for current library versions, comparisons, benchmarks
21
- - `mcp_websearch_web_search_exa`: Deep web search for technical articles and guides
22
- - `mcp_chrome-devtools`: Validate web_search findings against live browser pages when needed
23
- - `mcp_context7_query-docs`: Query official documentation for specific libraries
24
- - `mcp_context7_resolve-library-id`: Find correct library IDs for documentation queries
25
- - `mcp_grep_app_searchGitHub`: Find real-world usage examples on GitHub
20
+ - `websearch`: Search for current library versions, comparisons, benchmarks, and implementation guidance
21
+ - `context7`: Query official documentation for specific libraries and APIs
22
+ - `chrome-devtools`: Validate web findings against live browser behavior when needed
23
+ - `filesystem`: Cross-check local project context against external research before recommending a path
26
24
 
27
25
  ## Constraints
28
26
 
@@ -17,11 +17,9 @@ Security auditor. Reviews code for vulnerabilities, enforces security best pract
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_grep`: Scan for secret patterns (API keys, tokens, passwords)
21
- - `mcp_ast_grep_search`: Find unsafe code patterns (eval, innerHTML, SQL concat)
22
- - `mcp_lsp_find_references`: Trace data flow from user input to sensitive operations
23
- - `mcp_bash`: Run `npm audit`, `semgrep`, dependency checks
24
- - `mcp_context7_query-docs`: Look up security guidance for specific frameworks
20
+ - `context7`: Look up framework-specific security guidance and hardening recommendations
21
+ - `websearch`: Check current advisories, CVEs, and secure deployment guidance
22
+ - `filesystem`: Inspect local config and artifacts involved in the audit path
25
23
 
26
24
  ## Constraints
27
25
 
@@ -17,11 +17,9 @@ Testing engineering specialist. Designs test strategies, writes comprehensive te
17
17
 
18
18
  ## MCP Tools Available
19
19
 
20
- - `mcp_bash`: Run `bun test`, `jest`, `playwright`, coverage tools
21
- - `mcp_grep`: Find untested functions, uncovered branches
22
- - `mcp_ast_grep_search`: Find patterns like functions without corresponding test files
23
- - `mcp_lsp_find_references`: Trace all call sites to determine test scope
24
- - `mcp_lsp_diagnostics`: Verify test file type-correctness
20
+ - `chrome-devtools`: Validate UI and end-to-end flows in a real browser when tests touch frontend behavior
21
+ - `filesystem`: Inspect fixtures, snapshots, and generated test artifacts
22
+ - `context7`: Look up testing-framework docs and current best practices
25
23
 
26
24
  ## Constraints
27
25