@trac3er/oh-my-god 1.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 (229) hide show
  1. package/.claude-plugin/marketplace.json +36 -0
  2. package/.claude-plugin/plugin.json +23 -0
  3. package/.claude-plugin/scripts/install.sh +49 -0
  4. package/.claude-plugin/scripts/uninstall.sh +80 -0
  5. package/.claude-plugin/scripts/update.sh +84 -0
  6. package/.mcp.json +20 -0
  7. package/LICENSE +21 -0
  8. package/OMG-setup.sh +1093 -0
  9. package/README.md +335 -0
  10. package/THIRD_PARTY_NOTICES.md +24 -0
  11. package/UPSTREAM_DIFF.md +20 -0
  12. package/agents/__init__.py +1 -0
  13. package/agents/_model_roles.yaml +26 -0
  14. package/agents/designer.md +67 -0
  15. package/agents/explore.md +60 -0
  16. package/agents/model_roles.py +196 -0
  17. package/agents/omg-api-builder.md +23 -0
  18. package/agents/omg-architect-mode.md +43 -0
  19. package/agents/omg-architect.md +13 -0
  20. package/agents/omg-backend-engineer.md +43 -0
  21. package/agents/omg-critic.md +16 -0
  22. package/agents/omg-database-engineer.md +43 -0
  23. package/agents/omg-escalation-router.md +17 -0
  24. package/agents/omg-executor.md +12 -0
  25. package/agents/omg-frontend-designer.md +42 -0
  26. package/agents/omg-implement-mode.md +50 -0
  27. package/agents/omg-infra-engineer.md +43 -0
  28. package/agents/omg-qa-tester.md +16 -0
  29. package/agents/omg-research-mode.md +43 -0
  30. package/agents/omg-security-auditor.md +43 -0
  31. package/agents/omg-testing-engineer.md +43 -0
  32. package/agents/plan.md +80 -0
  33. package/agents/quick_task.md +64 -0
  34. package/agents/reviewer.md +83 -0
  35. package/agents/task.md +71 -0
  36. package/commands/OMG:ccg.md +22 -0
  37. package/commands/OMG:compat.md +57 -0
  38. package/commands/OMG:crazy.md +125 -0
  39. package/commands/OMG:domain-init.md +11 -0
  40. package/commands/OMG:escalate.md +52 -0
  41. package/commands/OMG:health-check.md +45 -0
  42. package/commands/OMG:init.md +134 -0
  43. package/commands/OMG:mode.md +44 -0
  44. package/commands/OMG:project-init.md +11 -0
  45. package/commands/OMG:ralph-start.md +43 -0
  46. package/commands/OMG:ralph-stop.md +23 -0
  47. package/commands/OMG:teams.md +39 -0
  48. package/commands/ai-commit.md +113 -0
  49. package/commands/ccg.md +9 -0
  50. package/commands/create-agent.md +183 -0
  51. package/commands/omc-teams.md +9 -0
  52. package/commands/session-branch.md +85 -0
  53. package/commands/session-fork.md +53 -0
  54. package/commands/session-merge.md +134 -0
  55. package/commands/theme.md +44 -0
  56. package/config/lsp_languages.yaml +324 -0
  57. package/config/themes/catppuccin-frappe.yaml +14 -0
  58. package/config/themes/catppuccin-latte.yaml +14 -0
  59. package/config/themes/catppuccin-macchiato.yaml +14 -0
  60. package/config/themes/catppuccin-mocha.yaml +14 -0
  61. package/config/themes/dracula.yaml +14 -0
  62. package/config/themes/gruvbox-dark.yaml +14 -0
  63. package/config/themes/nord.yaml +14 -0
  64. package/config/themes/one-dark.yaml +14 -0
  65. package/config/themes/solarized-dark.yaml +14 -0
  66. package/config/themes/tokyo-night.yaml +14 -0
  67. package/control_plane/__init__.py +2 -0
  68. package/control_plane/openapi.yaml +109 -0
  69. package/control_plane/server.py +107 -0
  70. package/control_plane/service.py +148 -0
  71. package/crates/omg-natives/Cargo.toml +17 -0
  72. package/crates/omg-natives/src/clipboard.rs +5 -0
  73. package/crates/omg-natives/src/glob.rs +15 -0
  74. package/crates/omg-natives/src/grep.rs +15 -0
  75. package/crates/omg-natives/src/highlight.rs +15 -0
  76. package/crates/omg-natives/src/html.rs +14 -0
  77. package/crates/omg-natives/src/image.rs +5 -0
  78. package/crates/omg-natives/src/keys.rs +5 -0
  79. package/crates/omg-natives/src/lib.rs +36 -0
  80. package/crates/omg-natives/src/prof.rs +5 -0
  81. package/crates/omg-natives/src/ps.rs +5 -0
  82. package/crates/omg-natives/src/shell.rs +5 -0
  83. package/crates/omg-natives/src/task.rs +5 -0
  84. package/crates/omg-natives/src/text.rs +14 -0
  85. package/hooks/_agent_registry.py +421 -0
  86. package/hooks/_budget.py +31 -0
  87. package/hooks/_common.py +476 -0
  88. package/hooks/_learnings.py +126 -0
  89. package/hooks/_memory.py +103 -0
  90. package/hooks/circuit-breaker.py +270 -0
  91. package/hooks/config-guard.py +163 -0
  92. package/hooks/context_pressure.py +53 -0
  93. package/hooks/credential_store.py +801 -0
  94. package/hooks/fetch-rate-limits.py +212 -0
  95. package/hooks/firewall.py +48 -0
  96. package/hooks/hashline-formatter-bridge.py +224 -0
  97. package/hooks/hashline-injector.py +273 -0
  98. package/hooks/hashline-validator.py +216 -0
  99. package/hooks/idle-detector.py +95 -0
  100. package/hooks/intentgate-keyword-detector.py +188 -0
  101. package/hooks/magic-keyword-router.py +195 -0
  102. package/hooks/policy_engine.py +310 -0
  103. package/hooks/post-tool-failure.py +19 -0
  104. package/hooks/post-write.py +199 -0
  105. package/hooks/pre-compact.py +204 -0
  106. package/hooks/pre-tool-inject.py +98 -0
  107. package/hooks/prompt-enhancer.py +672 -0
  108. package/hooks/quality-runner.py +191 -0
  109. package/hooks/secret-guard.py +47 -0
  110. package/hooks/session-end-capture.py +137 -0
  111. package/hooks/session-start.py +275 -0
  112. package/hooks/shadow_manager.py +297 -0
  113. package/hooks/state_migration.py +209 -0
  114. package/hooks/stop-gate.py +7 -0
  115. package/hooks/stop_dispatcher.py +929 -0
  116. package/hooks/test-validator.py +138 -0
  117. package/hooks/todo-state-tracker.py +114 -0
  118. package/hooks/tool-ledger.py +126 -0
  119. package/hooks/trust_review.py +524 -0
  120. package/install.sh +9 -0
  121. package/omg_natives/__init__.py +186 -0
  122. package/omg_natives/_bindings.py +165 -0
  123. package/omg_natives/clipboard.py +36 -0
  124. package/omg_natives/glob.py +42 -0
  125. package/omg_natives/grep.py +61 -0
  126. package/omg_natives/highlight.py +54 -0
  127. package/omg_natives/html.py +157 -0
  128. package/omg_natives/image.py +51 -0
  129. package/omg_natives/keys.py +46 -0
  130. package/omg_natives/prof.py +39 -0
  131. package/omg_natives/ps.py +93 -0
  132. package/omg_natives/shell.py +58 -0
  133. package/omg_natives/task.py +41 -0
  134. package/omg_natives/text.py +50 -0
  135. package/package.json +26 -0
  136. package/plugins/README.md +82 -0
  137. package/plugins/advanced/commands/OMG:code-review.md +114 -0
  138. package/plugins/advanced/commands/OMG:deep-plan.md +221 -0
  139. package/plugins/advanced/commands/OMG:handoff.md +115 -0
  140. package/plugins/advanced/commands/OMG:learn.md +110 -0
  141. package/plugins/advanced/commands/OMG:maintainer.md +31 -0
  142. package/plugins/advanced/commands/OMG:ralph-start.md +43 -0
  143. package/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
  144. package/plugins/advanced/commands/OMG:security-review.md +119 -0
  145. package/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
  146. package/plugins/advanced/commands/OMG:ship.md +46 -0
  147. package/plugins/advanced/plugin.json +96 -0
  148. package/plugins/core/plugin.json +82 -0
  149. package/pytest.ini +5 -0
  150. package/registry/__init__.py +1 -0
  151. package/registry/verify_artifact.py +90 -0
  152. package/rules/contextual/architect-mode.md +9 -0
  153. package/rules/contextual/big-picture.md +20 -0
  154. package/rules/contextual/code-hygiene.md +26 -0
  155. package/rules/contextual/context-management.md +19 -0
  156. package/rules/contextual/context-minimization.md +32 -0
  157. package/rules/contextual/ddd-sdd.md +28 -0
  158. package/rules/contextual/dependency-safety.md +16 -0
  159. package/rules/contextual/doc-check.md +13 -0
  160. package/rules/contextual/implement-mode.md +9 -0
  161. package/rules/contextual/infra-safety.md +14 -0
  162. package/rules/contextual/outside-in.md +13 -0
  163. package/rules/contextual/persistent-mode.md +24 -0
  164. package/rules/contextual/research-mode.md +9 -0
  165. package/rules/contextual/security-domains.md +25 -0
  166. package/rules/contextual/vision-detection.md +27 -0
  167. package/rules/contextual/web-search.md +25 -0
  168. package/rules/contextual/write-verify.md +23 -0
  169. package/rules/core/00-truth.md +20 -0
  170. package/rules/core/01-surgical.md +19 -0
  171. package/rules/core/02-circuit-breaker.md +22 -0
  172. package/rules/core/03-ensemble.md +28 -0
  173. package/rules/core/04-testing.md +30 -0
  174. package/runtime/__init__.py +32 -0
  175. package/runtime/adapters/__init__.py +13 -0
  176. package/runtime/adapters/claude.py +60 -0
  177. package/runtime/adapters/gpt.py +53 -0
  178. package/runtime/adapters/local.py +53 -0
  179. package/runtime/business_workflow.py +220 -0
  180. package/runtime/compat.py +1299 -0
  181. package/runtime/custom_agent_loader.py +366 -0
  182. package/runtime/dispatcher.py +47 -0
  183. package/runtime/ecosystem.py +371 -0
  184. package/runtime/legacy_compat.py +7 -0
  185. package/runtime/omc_compat.py +7 -0
  186. package/runtime/omc_contract_snapshot.json +916 -0
  187. package/runtime/omg_compat_contract_snapshot.json +916 -0
  188. package/runtime/subagent_dispatcher.py +362 -0
  189. package/runtime/team_router.py +838 -0
  190. package/scripts/check-omc-contract-snapshot.py +12 -0
  191. package/scripts/check-omg-compat-contract-snapshot.py +137 -0
  192. package/scripts/check-omg-standalone-clean.py +102 -0
  193. package/scripts/legacy_to_omg_migrate.py +29 -0
  194. package/scripts/migrate-omc.py +464 -0
  195. package/scripts/omc_to_omg_migrate.py +12 -0
  196. package/scripts/omg.py +493 -0
  197. package/scripts/settings-merge.py +224 -0
  198. package/scripts/verify-no-omc.sh +5 -0
  199. package/scripts/verify-standalone.sh +21 -0
  200. package/templates/idea.yml +30 -0
  201. package/templates/policy.yaml +15 -0
  202. package/templates/profile.yaml +25 -0
  203. package/templates/runtime.yaml +12 -0
  204. package/templates/working-memory.md +17 -0
  205. package/tools/__init__.py +2 -0
  206. package/tools/browser_consent.py +289 -0
  207. package/tools/browser_stealth.py +481 -0
  208. package/tools/browser_tool.py +448 -0
  209. package/tools/changelog_generator.py +268 -0
  210. package/tools/commit_splitter.py +361 -0
  211. package/tools/config_discovery.py +151 -0
  212. package/tools/config_merger.py +449 -0
  213. package/tools/git_inspector.py +298 -0
  214. package/tools/lsp_client.py +275 -0
  215. package/tools/lsp_discovery.py +231 -0
  216. package/tools/lsp_operations.py +392 -0
  217. package/tools/python_repl.py +656 -0
  218. package/tools/python_sandbox.py +609 -0
  219. package/tools/search_providers/__init__.py +77 -0
  220. package/tools/search_providers/brave.py +115 -0
  221. package/tools/search_providers/exa.py +116 -0
  222. package/tools/search_providers/jina.py +104 -0
  223. package/tools/search_providers/perplexity.py +139 -0
  224. package/tools/search_providers/synthetic.py +74 -0
  225. package/tools/session_snapshot.py +736 -0
  226. package/tools/ssh_manager.py +912 -0
  227. package/tools/theme_engine.py +294 -0
  228. package/tools/theme_selector.py +137 -0
  229. package/tools/web_search.py +622 -0
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env python3
2
+ """Legacy wrapper for OMG compatibility snapshot checker."""
3
+ from __future__ import annotations
4
+
5
+ import runpy
6
+ from pathlib import Path
7
+
8
+
9
+ if __name__ == "__main__":
10
+ target = Path(__file__).resolve().with_name("check-omg-compat-contract-snapshot.py")
11
+ runpy.run_path(str(target), run_name="__main__")
12
+
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env python3
2
+ """Validate committed OMG compatibility snapshot against runtime contracts."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ from pathlib import Path
8
+ import sys
9
+
10
+ ROOT = Path(__file__).resolve().parents[1]
11
+ if str(ROOT) not in sys.path:
12
+ sys.path.insert(0, str(ROOT))
13
+
14
+ from runtime.compat import ( # noqa: E402
15
+ CONTRACT_SNAPSHOT_SCHEMA,
16
+ CONTRACT_SNAPSHOT_VERSION,
17
+ DEFAULT_CONTRACT_SNAPSHOT_PATH,
18
+ LEGACY_CONTRACT_SNAPSHOT_PATH,
19
+ build_contract_snapshot_payload,
20
+ migrate_contract_snapshot_payload,
21
+ )
22
+
23
+
24
+ def _load_snapshot(path: Path) -> dict:
25
+ with open(path, "r", encoding="utf-8") as f:
26
+ payload = json.load(f)
27
+ if not isinstance(payload, dict):
28
+ raise ValueError("snapshot must be a JSON object")
29
+ return payload
30
+
31
+
32
+ def main() -> int:
33
+ parser = argparse.ArgumentParser(description="Check OMG compatibility contract snapshot drift")
34
+ parser.add_argument("--snapshot", default="")
35
+ parser.add_argument("--strict-version", action="store_true")
36
+ args = parser.parse_args()
37
+
38
+ if args.snapshot:
39
+ snapshot_path = Path(args.snapshot)
40
+ else:
41
+ primary = ROOT / DEFAULT_CONTRACT_SNAPSHOT_PATH
42
+ legacy = ROOT / LEGACY_CONTRACT_SNAPSHOT_PATH
43
+ snapshot_path = primary if primary.exists() else legacy
44
+
45
+ if not snapshot_path.exists():
46
+ print(
47
+ json.dumps(
48
+ {"status": "error", "message": f"snapshot not found: {snapshot_path}"},
49
+ indent=2,
50
+ )
51
+ )
52
+ return 2
53
+
54
+ try:
55
+ current = _load_snapshot(snapshot_path)
56
+ except Exception as exc:
57
+ print(json.dumps({"status": "error", "message": f"invalid snapshot json: {exc}"}, indent=2))
58
+ return 2
59
+
60
+ migrated, migrations = migrate_contract_snapshot_payload(current)
61
+ expected = build_contract_snapshot_payload(include_generated_at=False)
62
+
63
+ if migrated.get("schema") != CONTRACT_SNAPSHOT_SCHEMA:
64
+ print(
65
+ json.dumps(
66
+ {
67
+ "status": "error",
68
+ "message": "snapshot schema mismatch",
69
+ "expected_schema": CONTRACT_SNAPSHOT_SCHEMA,
70
+ "actual_schema": migrated.get("schema"),
71
+ },
72
+ indent=2,
73
+ )
74
+ )
75
+ return 3
76
+
77
+ if args.strict_version and current.get("contract_version") != CONTRACT_SNAPSHOT_VERSION:
78
+ print(
79
+ json.dumps(
80
+ {
81
+ "status": "error",
82
+ "message": "snapshot contract_version mismatch (strict)",
83
+ "expected_version": CONTRACT_SNAPSHOT_VERSION,
84
+ "actual_version": current.get("contract_version"),
85
+ },
86
+ indent=2,
87
+ )
88
+ )
89
+ return 3
90
+
91
+ if migrated.get("contract_version") != CONTRACT_SNAPSHOT_VERSION:
92
+ print(
93
+ json.dumps(
94
+ {
95
+ "status": "error",
96
+ "message": "snapshot contract_version unsupported",
97
+ "expected_version": CONTRACT_SNAPSHOT_VERSION,
98
+ "actual_version": migrated.get("contract_version"),
99
+ },
100
+ indent=2,
101
+ )
102
+ )
103
+ return 3
104
+
105
+ if migrated.get("count") != expected.get("count") or migrated.get("contracts") != expected.get("contracts"):
106
+ print(
107
+ json.dumps(
108
+ {
109
+ "status": "error",
110
+ "message": "snapshot drift detected",
111
+ "expected_count": expected.get("count"),
112
+ "actual_count": migrated.get("count"),
113
+ "migrations_applied": migrations,
114
+ },
115
+ indent=2,
116
+ )
117
+ )
118
+ return 3
119
+
120
+ print(
121
+ json.dumps(
122
+ {
123
+ "status": "ok",
124
+ "message": "snapshot matches runtime contracts",
125
+ "contract_version": CONTRACT_SNAPSHOT_VERSION,
126
+ "migrations_applied": migrations,
127
+ "snapshot": str(snapshot_path),
128
+ },
129
+ indent=2,
130
+ )
131
+ )
132
+ return 0
133
+
134
+
135
+ if __name__ == "__main__":
136
+ raise SystemExit(main())
137
+
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env python3
2
+ """Check that standalone/OMG-first naming rules are preserved."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ from pathlib import Path
8
+ import sys
9
+
10
+ ROOT = Path(__file__).resolve().parents[1]
11
+
12
+ # Paths where legacy aliases are explicitly allowed.
13
+ ALLOW_OMC_CLI = {
14
+ ROOT / "commands" / "OMG:omc-compat.md",
15
+ ROOT / "tests" / "scripts" / "test_omg_cli.py",
16
+ ROOT / "tests" / "scripts" / "test_standalone_clean_check.py",
17
+ ROOT / "scripts" / "check-omg-standalone-clean.py",
18
+ }
19
+
20
+ ALLOW_LEGACY_MIGRATOR = {
21
+ ROOT / "scripts" / "omc_to_omg_migrate.py",
22
+ ROOT / "tests" / "e2e" / "test_standalone_ga.py",
23
+ ROOT / "scripts" / "check-omg-standalone-clean.py",
24
+ }
25
+
26
+ ALLOW_LEGACY_SNAPSHOT_CHECKER = {
27
+ ROOT / "scripts" / "check-omc-contract-snapshot.py",
28
+ ROOT / "tests" / "scripts" / "test_compat_snapshot_check.py",
29
+ ROOT / "scripts" / "check-omg-standalone-clean.py",
30
+ }
31
+
32
+ ALLOW_LEGACY_RUNTIME_IMPORT = {
33
+ ROOT / "tests" / "scripts" / "test_standalone_clean_check.py",
34
+ ROOT / "scripts" / "check-omg-standalone-clean.py",
35
+ }
36
+
37
+ SCAN_GLOBS = [
38
+ "README.md",
39
+ "OMG-setup.sh",
40
+ "install.sh",
41
+ "runtime/**/*.py",
42
+ "hooks/**/*.py",
43
+ "scripts/**/*.py",
44
+ "commands/**/*.md",
45
+ ".github/workflows/**/*.yml",
46
+ "tests/**/*.py",
47
+ ]
48
+
49
+
50
+ def _iter_files(root: Path) -> list[Path]:
51
+ files: list[Path] = []
52
+ for pattern in SCAN_GLOBS:
53
+ files.extend(p for p in root.glob(pattern) if p.is_file())
54
+ # deterministic order
55
+ return sorted(set(files))
56
+
57
+
58
+ def _contains(path: Path, token: str) -> bool:
59
+ return token in path.read_text(encoding="utf-8")
60
+
61
+
62
+ def main() -> int:
63
+ parser = argparse.ArgumentParser(description="Check OMG standalone naming hygiene")
64
+ parser.add_argument("--root", default=str(ROOT))
65
+ args = parser.parse_args()
66
+ root = Path(args.root).resolve()
67
+
68
+ violations: list[str] = []
69
+
70
+ deprecated_workflow = root / ".github" / "workflows" / "omc-compat-gate.yml"
71
+ if deprecated_workflow.exists():
72
+ violations.append(f"deprecated workflow exists: {deprecated_workflow.relative_to(root)}")
73
+
74
+ for path in _iter_files(root):
75
+ rel = path.relative_to(root)
76
+
77
+ if _contains(path, "python3 scripts/omg.py omc "):
78
+ if path not in ALLOW_OMC_CLI:
79
+ violations.append(f"{rel}: legacy CLI namespace used outside allowlist")
80
+
81
+ if _contains(path, "omc_to_omg_migrate.py"):
82
+ if path not in ALLOW_LEGACY_MIGRATOR:
83
+ violations.append(f"{rel}: legacy migrator path reference outside allowlist")
84
+
85
+ if _contains(path, "check-omc-contract-snapshot.py"):
86
+ if path not in ALLOW_LEGACY_SNAPSHOT_CHECKER:
87
+ violations.append(f"{rel}: legacy snapshot checker reference outside allowlist")
88
+
89
+ if _contains(path, "runtime.legacy_compat"):
90
+ if path not in ALLOW_LEGACY_RUNTIME_IMPORT:
91
+ violations.append(f"{rel}: legacy runtime import outside allowlist")
92
+
93
+ if violations:
94
+ print(json.dumps({"status": "error", "violations": violations}, indent=2))
95
+ return 1
96
+
97
+ print(json.dumps({"status": "ok", "message": "standalone naming check passed"}, indent=2))
98
+ return 0
99
+
100
+
101
+ if __name__ == "__main__":
102
+ raise SystemExit(main())
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env python3
2
+ """CLI utility: migrate legacy state into canonical `.omg` layout."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import os
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ ROOT = Path(__file__).resolve().parents[1]
12
+ if str(ROOT) not in sys.path:
13
+ sys.path.insert(0, str(ROOT))
14
+
15
+ from hooks.state_migration import migrate_legacy_to_omg # noqa: E402
16
+
17
+
18
+ def main() -> int:
19
+ parser = argparse.ArgumentParser(description="Migrate legacy state to .omg")
20
+ parser.add_argument("--project-dir", default=os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd()))
21
+ args = parser.parse_args()
22
+
23
+ report = migrate_legacy_to_omg(args.project_dir)
24
+ print(json.dumps(report, indent=2))
25
+ return 0 if report.get("result") in {"ok", "no_legacy"} else 1
26
+
27
+
28
+ if __name__ == "__main__":
29
+ raise SystemExit(main())