@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.
- package/.claude-plugin/marketplace.json +8 -8
- package/.claude-plugin/plugin.json +5 -4
- package/.claude-plugin/scripts/uninstall.sh +74 -3
- package/.claude-plugin/scripts/update.sh +78 -3
- package/.coveragerc +26 -0
- package/.mcp.json +4 -4
- package/CHANGELOG.md +14 -0
- package/CODE_OF_CONDUCT.md +27 -0
- package/CONTRIBUTING.md +62 -0
- package/OMG-setup.sh +1201 -355
- package/README.md +77 -56
- package/SECURITY.md +25 -0
- package/agents/__init__.py +1 -0
- package/agents/model_roles.py +196 -0
- package/agents/omg-architect-mode.md +3 -5
- package/agents/omg-backend-engineer.md +3 -5
- package/agents/omg-database-engineer.md +3 -5
- package/agents/omg-frontend-designer.md +4 -5
- package/agents/omg-implement-mode.md +4 -5
- package/agents/omg-infra-engineer.md +3 -5
- package/agents/omg-research-mode.md +4 -6
- package/agents/omg-security-auditor.md +3 -5
- package/agents/omg-testing-engineer.md +3 -5
- package/build/lib/yaml.py +321 -0
- package/commands/OMG:ai-commit.md +101 -14
- package/commands/OMG:arch.md +302 -19
- package/commands/OMG:ccg.md +12 -7
- package/commands/OMG:compat.md +25 -17
- package/commands/OMG:cost.md +173 -13
- package/commands/OMG:crazy.md +1 -1
- package/commands/OMG:create-agent.md +170 -20
- package/commands/OMG:deps.md +235 -17
- package/commands/OMG:domain-init.md +1 -1
- package/commands/OMG:escalate.md +41 -12
- package/commands/OMG:health-check.md +37 -13
- package/commands/OMG:init.md +122 -14
- package/commands/OMG:project-init.md +1 -1
- package/commands/OMG:session-branch.md +76 -9
- package/commands/OMG:session-fork.md +42 -5
- package/commands/OMG:session-merge.md +124 -8
- package/commands/OMG:setup.md +69 -12
- package/commands/OMG:stats.md +215 -14
- package/commands/OMG:teams.md +19 -10
- package/config/lsp_languages.yaml +8 -0
- package/hooks/__init__.py +0 -0
- package/hooks/_agent_registry.py +423 -0
- package/hooks/_analytics.py +291 -0
- package/hooks/_budget.py +31 -0
- package/hooks/_common.py +569 -0
- package/hooks/_compression_optimizer.py +119 -0
- package/hooks/_cost_ledger.py +176 -0
- package/hooks/_learnings.py +126 -0
- package/hooks/_memory.py +103 -0
- package/hooks/_protected_context.py +150 -0
- package/hooks/_token_counter.py +221 -0
- package/hooks/branch_manager.py +236 -0
- package/hooks/budget_governor.py +232 -0
- package/hooks/circuit-breaker.py +270 -0
- package/hooks/compression_feedback.py +254 -0
- package/hooks/config-guard.py +216 -0
- package/hooks/context_pressure.py +53 -0
- package/hooks/credential_store.py +1020 -0
- package/hooks/fetch-rate-limits.py +212 -0
- package/hooks/firewall.py +48 -0
- package/hooks/hashline-formatter-bridge.py +224 -0
- package/hooks/hashline-injector.py +273 -0
- package/hooks/hashline-validator.py +216 -0
- package/hooks/idle-detector.py +95 -0
- package/hooks/intentgate-keyword-detector.py +188 -0
- package/hooks/magic-keyword-router.py +195 -0
- package/hooks/policy_engine.py +505 -0
- package/hooks/post-tool-failure.py +19 -0
- package/hooks/post-write.py +219 -0
- package/hooks/post_write.py +46 -0
- package/hooks/pre-compact.py +398 -0
- package/hooks/pre-tool-inject.py +98 -0
- package/hooks/prompt-enhancer.py +672 -0
- package/hooks/quality-runner.py +191 -0
- package/hooks/query.py +512 -0
- package/hooks/secret-guard.py +61 -0
- package/hooks/secret_audit.py +144 -0
- package/hooks/session-end-capture.py +137 -0
- package/hooks/session-start.py +277 -0
- package/hooks/setup_wizard.py +582 -0
- package/hooks/shadow_manager.py +297 -0
- package/hooks/state_migration.py +225 -0
- package/hooks/stop-gate.py +7 -0
- package/hooks/stop_dispatcher.py +945 -0
- package/hooks/test-validator.py +361 -0
- package/hooks/test_generator_hook.py +123 -0
- package/hooks/todo-state-tracker.py +114 -0
- package/hooks/tool-ledger.py +149 -0
- package/hooks/trust_review.py +585 -0
- package/hud/omg-hud.mjs +31 -1
- package/lab/__init__.py +1 -0
- package/lab/pipeline.py +75 -0
- package/lab/policies.py +52 -0
- package/package.json +7 -18
- package/plugins/README.md +33 -61
- package/plugins/advanced/commands/OMG:deep-plan.md +3 -3
- package/plugins/advanced/commands/OMG:learn.md +1 -1
- package/plugins/advanced/commands/OMG:security-review.md +3 -3
- package/plugins/advanced/commands/OMG:ship.md +1 -1
- package/plugins/advanced/plugin.json +1 -1
- package/plugins/core/plugin.json +8 -3
- package/plugins/dephealth/__init__.py +0 -0
- package/plugins/dephealth/cve_scanner.py +188 -0
- package/plugins/dephealth/license_checker.py +135 -0
- package/plugins/dephealth/manifest_detector.py +423 -0
- package/plugins/dephealth/vuln_analyzer.py +169 -0
- package/plugins/testgen/__init__.py +0 -0
- package/plugins/testgen/codamosa_engine.py +402 -0
- package/plugins/testgen/edge_case_synthesizer.py +184 -0
- package/plugins/testgen/framework_detector.py +271 -0
- package/plugins/testgen/skeleton_generator.py +219 -0
- package/plugins/viz/__init__.py +0 -0
- package/plugins/viz/ast_parser.py +139 -0
- package/plugins/viz/diagram_generator.py +192 -0
- package/plugins/viz/graph_builder.py +444 -0
- package/plugins/viz/native_parsers.py +259 -0
- package/plugins/viz/regex_parser.py +112 -0
- package/pyproject.toml +81 -0
- package/rules/contextual/write-verify.md +2 -2
- package/rules/core/00-truth.md +1 -1
- package/rules/core/01-surgical.md +1 -1
- package/rules/core/02-circuit-breaker.md +2 -2
- package/rules/core/03-ensemble.md +3 -3
- package/rules/core/04-testing.md +3 -3
- package/runtime/__init__.py +32 -0
- package/runtime/adapters/__init__.py +13 -0
- package/runtime/adapters/claude.py +60 -0
- package/runtime/adapters/gpt.py +53 -0
- package/runtime/adapters/local.py +53 -0
- package/runtime/adoption.py +212 -0
- package/runtime/business_workflow.py +220 -0
- package/runtime/cli_provider.py +85 -0
- package/runtime/compat.py +1299 -0
- package/runtime/custom_agent_loader.py +366 -0
- package/runtime/dispatcher.py +47 -0
- package/runtime/ecosystem.py +371 -0
- package/runtime/legacy_compat.py +7 -0
- package/runtime/mcp_config_writers.py +115 -0
- package/runtime/mcp_lifecycle.py +153 -0
- package/runtime/mcp_memory_server.py +135 -0
- package/runtime/memory_parsers/__init__.py +0 -0
- package/runtime/memory_parsers/chatgpt_parser.py +257 -0
- package/runtime/memory_parsers/claude_import.py +107 -0
- package/runtime/memory_parsers/export.py +97 -0
- package/runtime/memory_parsers/gemini_import.py +91 -0
- package/runtime/memory_parsers/kimi_import.py +91 -0
- package/runtime/memory_store.py +215 -0
- package/runtime/omc_compat.py +7 -0
- package/runtime/providers/__init__.py +0 -0
- package/runtime/providers/codex_provider.py +112 -0
- package/runtime/providers/gemini_provider.py +128 -0
- package/runtime/providers/kimi_provider.py +151 -0
- package/runtime/providers/opencode_provider.py +144 -0
- package/runtime/subagent_dispatcher.py +362 -0
- package/runtime/team_router.py +1167 -0
- package/runtime/tmux_session_manager.py +169 -0
- package/scripts/check-omg-compat-contract-snapshot.py +137 -0
- package/scripts/check-omg-contract-snapshot.py +12 -0
- package/scripts/check-omg-public-ready.py +193 -0
- package/scripts/check-omg-standalone-clean.py +103 -0
- package/scripts/legacy_to_omg_migrate.py +29 -0
- package/scripts/migrate-legacy.py +464 -0
- package/scripts/omc_to_omg_migrate.py +12 -0
- package/scripts/omg.py +492 -0
- package/scripts/settings-merge.py +283 -0
- package/scripts/verify-standalone.sh +8 -4
- package/settings.json +126 -29
- package/templates/profile.yaml +1 -1
- package/tools/__init__.py +2 -0
- package/tools/browser_consent.py +289 -0
- package/tools/browser_stealth.py +481 -0
- package/tools/browser_tool.py +448 -0
- package/tools/changelog_generator.py +347 -0
- package/tools/commit_splitter.py +746 -0
- package/tools/config_discovery.py +151 -0
- package/tools/config_merger.py +449 -0
- package/tools/dashboard_generator.py +300 -0
- package/tools/git_inspector.py +298 -0
- package/tools/lsp_client.py +275 -0
- package/tools/lsp_discovery.py +231 -0
- package/tools/lsp_operations.py +392 -0
- package/tools/pr_generator.py +404 -0
- package/tools/python_repl.py +656 -0
- package/tools/python_sandbox.py +609 -0
- package/tools/search_providers/__init__.py +77 -0
- package/tools/search_providers/brave.py +115 -0
- package/tools/search_providers/exa.py +116 -0
- package/tools/search_providers/jina.py +104 -0
- package/tools/search_providers/perplexity.py +139 -0
- package/tools/search_providers/synthetic.py +74 -0
- package/tools/session_snapshot.py +736 -0
- package/tools/ssh_manager.py +912 -0
- package/tools/theme_engine.py +294 -0
- package/tools/theme_selector.py +137 -0
- package/tools/web_search.py +622 -0
- package/yaml.py +321 -0
- package/.claude-plugin/scripts/install.sh +0 -9
- package/bun.lock +0 -23
- package/bunfig.toml +0 -3
- package/hooks/_budget.ts +0 -1
- package/hooks/_common.ts +0 -63
- package/hooks/circuit-breaker.ts +0 -101
- package/hooks/config-guard.ts +0 -4
- package/hooks/firewall.ts +0 -20
- package/hooks/policy_engine.ts +0 -156
- package/hooks/post-tool-failure.ts +0 -22
- package/hooks/post-write.ts +0 -4
- package/hooks/pre-tool-inject.ts +0 -4
- package/hooks/prompt-enhancer.ts +0 -46
- package/hooks/quality-runner.ts +0 -24
- package/hooks/secret-guard.ts +0 -4
- package/hooks/session-end-capture.ts +0 -19
- package/hooks/session-start.ts +0 -19
- package/hooks/shadow_manager.ts +0 -81
- package/hooks/stop-gate.ts +0 -22
- package/hooks/stop_dispatcher.ts +0 -147
- package/hooks/test-generator-hook.ts +0 -4
- package/hooks/tool-ledger.ts +0 -27
- package/hooks/trust_review.ts +0 -175
- package/lab/pipeline.ts +0 -75
- package/lab/policies.ts +0 -68
- package/runtime/common.ts +0 -111
- package/runtime/compat.ts +0 -174
- package/runtime/dispatcher.ts +0 -25
- package/runtime/ecosystem.ts +0 -186
- package/runtime/provider_bootstrap.ts +0 -99
- package/runtime/provider_smoke.ts +0 -34
- package/runtime/release_readiness.ts +0 -186
- package/runtime/team_router.ts +0 -144
- package/scripts/check-omg-compat-contract-snapshot.ts +0 -20
- package/scripts/check-omg-standalone-clean.ts +0 -12
- package/scripts/check-runtime-clean.ts +0 -94
- package/scripts/omg.ts +0 -352
- package/scripts/settings-merge.ts +0 -93
- package/tools/commit_splitter.ts +0 -23
- package/tools/git_inspector.ts +0 -18
- package/tools/session_snapshot.ts +0 -47
- package/trac3er-oh-my-god-2.0.0.tgz +0 -0
- package/tsconfig.json +0 -15
package/README.md
CHANGED
|
@@ -1,85 +1,106 @@
|
|
|
1
|
-
# OMG
|
|
1
|
+
# OMG 2.0.2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/trac3er00/OMG/actions/workflows/omg-compat-gate.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@trac3er/oh-my-god)
|
|
5
|
+
[](LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+

|
|
24
|
+
|
|
25
|
+
## Quickstart
|
|
26
|
+
|
|
27
|
+
Install with npm:
|
|
17
28
|
|
|
18
29
|
```bash
|
|
19
|
-
|
|
20
|
-
./OMG-setup.sh install
|
|
30
|
+
npm install @trac3er/oh-my-god
|
|
21
31
|
```
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
Or clone and run the setup manager:
|
|
24
34
|
|
|
25
35
|
```bash
|
|
26
|
-
|
|
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
|
-
|
|
42
|
+
Then run:
|
|
30
43
|
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
```text
|
|
45
|
+
/OMG:setup
|
|
46
|
+
/OMG:crazy stabilize auth and dashboard flows
|
|
34
47
|
```
|
|
35
48
|
|
|
36
|
-
|
|
49
|
+
Success looks like:
|
|
37
50
|
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
omg teams --target auto --problem "debug auth regression"
|
|
52
|
-
```
|
|
62
|
+
## Native Adoption
|
|
53
63
|
|
|
54
|
-
|
|
64
|
+
OMG uses native setup language instead of public migration commands.
|
|
55
65
|
|
|
56
|
-
- `
|
|
57
|
-
- `
|
|
58
|
-
- `
|
|
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
|
-
|
|
70
|
+
Compatibility references to OMC, OMX, and Superpowers are documented here: [docs/migration/native-adoption.md](docs/migration/native-adoption.md)
|
|
66
71
|
|
|
67
|
-
##
|
|
72
|
+
## Proof
|
|
68
73
|
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
|
|
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
|
-
##
|
|
104
|
+
## Positioning
|
|
82
105
|
|
|
83
|
-
-
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
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
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
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
|
|