@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,220 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Iterable
4
+ from typing import Any
5
+
6
+ DEFAULT_WORKFLOW_PATH: tuple[str, ...] = (
7
+ "plan",
8
+ "implement",
9
+ "qa",
10
+ "simulate",
11
+ "final_test",
12
+ "production",
13
+ )
14
+
15
+ _STAGE_ALIASES = {
16
+ "plan": "plan",
17
+ "planning": "plan",
18
+ "implement": "implement",
19
+ "implementation": "implement",
20
+ "build": "implement",
21
+ "qa": "qa",
22
+ "quality": "qa",
23
+ "quality_assurance": "qa",
24
+ "test": "final_test",
25
+ "testing": "final_test",
26
+ "final_test": "final_test",
27
+ "final-testing": "final_test",
28
+ "simulate": "simulate",
29
+ "simulation": "simulate",
30
+ "prod": "production",
31
+ "production": "production",
32
+ "deploy": "production",
33
+ }
34
+
35
+
36
+ def _as_string_list(value: Any) -> list[str]:
37
+ if isinstance(value, str):
38
+ text = value.strip()
39
+ return [text] if text else []
40
+ if isinstance(value, Iterable):
41
+ items: list[str] = []
42
+ for raw in value:
43
+ if isinstance(raw, str):
44
+ text = raw.strip()
45
+ if text:
46
+ items.append(text)
47
+ return items
48
+ return []
49
+
50
+
51
+ def _resolve_workflow_path(idea: dict[str, Any]) -> list[str]:
52
+ raw_path = idea.get("workflow") or idea.get("path") or idea.get("delivery_path") or idea.get("workflow_path")
53
+ requested = _as_string_list(raw_path)
54
+ resolved: list[str] = []
55
+ for stage in requested:
56
+ key = _STAGE_ALIASES.get(stage.strip().lower())
57
+ if key and key not in resolved:
58
+ resolved.append(key)
59
+ if not resolved:
60
+ return list(DEFAULT_WORKFLOW_PATH)
61
+ for required in DEFAULT_WORKFLOW_PATH:
62
+ if required not in resolved:
63
+ resolved.append(required)
64
+ return resolved
65
+
66
+
67
+ def build_business_task_plan(idea: dict[str, Any]) -> dict[str, Any]:
68
+ goal = str(idea.get("goal", "")).strip() or "unspecified-goal"
69
+ constraints = _as_string_list(idea.get("constraints", []))
70
+ acceptance = _as_string_list(idea.get("acceptance", []))
71
+ user_instructions = _as_string_list(idea.get("user_instructions", []))
72
+ workflow_path = _resolve_workflow_path(idea)
73
+
74
+ tasks: list[dict[str, Any]] = []
75
+ task_id = 1
76
+
77
+ if user_instructions:
78
+ for instruction in user_instructions:
79
+ tasks.append(
80
+ {
81
+ "id": f"T{task_id}",
82
+ "stage": "plan",
83
+ "title": "Capture user instruction",
84
+ "detail": instruction,
85
+ "source": "user_instructions",
86
+ }
87
+ )
88
+ task_id += 1
89
+
90
+ for item in constraints:
91
+ tasks.append(
92
+ {
93
+ "id": f"T{task_id}",
94
+ "stage": "plan",
95
+ "title": "Capture delivery constraint",
96
+ "detail": item,
97
+ "source": "constraints",
98
+ }
99
+ )
100
+ task_id += 1
101
+
102
+ if "implement" in workflow_path:
103
+ tasks.append(
104
+ {
105
+ "id": f"T{task_id}",
106
+ "stage": "implement",
107
+ "title": "Implement scoped changes",
108
+ "detail": "Apply changes that satisfy user instructions and follow repository patterns.",
109
+ "source": "workflow",
110
+ }
111
+ )
112
+ task_id += 1
113
+
114
+ if "qa" in workflow_path:
115
+ tasks.append(
116
+ {
117
+ "id": f"T{task_id}",
118
+ "stage": "qa",
119
+ "title": "Run QA checks",
120
+ "detail": "Validate behavior against constraints and acceptance criteria.",
121
+ "source": "workflow",
122
+ }
123
+ )
124
+ task_id += 1
125
+
126
+ if "simulate" in workflow_path:
127
+ tasks.append(
128
+ {
129
+ "id": f"T{task_id}",
130
+ "stage": "simulate",
131
+ "title": "Simulate delivery scenarios",
132
+ "detail": "Exercise expected paths and edge cases before final testing.",
133
+ "source": "workflow",
134
+ }
135
+ )
136
+ task_id += 1
137
+
138
+ for item in acceptance:
139
+ tasks.append(
140
+ {
141
+ "id": f"T{task_id}",
142
+ "stage": "final_test",
143
+ "title": "Validate acceptance criterion",
144
+ "detail": item,
145
+ "source": "acceptance",
146
+ }
147
+ )
148
+ task_id += 1
149
+
150
+ if "production" in workflow_path:
151
+ tasks.append(
152
+ {
153
+ "id": f"T{task_id}",
154
+ "stage": "production",
155
+ "title": "Prepare production handoff",
156
+ "detail": "Confirm release readiness, residual risks, and deployment checks.",
157
+ "source": "workflow",
158
+ }
159
+ )
160
+
161
+ stage_summaries = []
162
+ for stage in workflow_path:
163
+ stage_tasks = [task for task in tasks if task["stage"] == stage]
164
+ stage_summaries.append(
165
+ {
166
+ "stage": stage,
167
+ "task_count": len(stage_tasks),
168
+ "tasks": stage_tasks,
169
+ }
170
+ )
171
+
172
+ return {
173
+ "goal": goal,
174
+ "requested_path": _as_string_list(
175
+ idea.get("workflow") or idea.get("path") or idea.get("delivery_path") or idea.get("workflow_path")
176
+ ),
177
+ "resolved_path": workflow_path,
178
+ "constraints": constraints,
179
+ "acceptance": acceptance,
180
+ "user_instructions": user_instructions,
181
+ "stages": stage_summaries,
182
+ "task_count": len(tasks),
183
+ }
184
+
185
+
186
+ def build_business_workflow_result(
187
+ *,
188
+ idea: dict[str, Any],
189
+ plan: dict[str, Any],
190
+ execution: dict[str, Any],
191
+ verification: dict[str, Any],
192
+ ) -> dict[str, Any]:
193
+ plan_payload = build_business_task_plan(idea)
194
+ checks_value = verification.get("checks") if isinstance(verification, dict) else None
195
+ checks = checks_value if isinstance(checks_value, list) else []
196
+ checks_ok = bool(checks) and all(isinstance(check, dict) and check.get("passed") is True for check in checks)
197
+
198
+ stage_status = {
199
+ "plan": "completed" if plan.get("status") == "planned" else "failed",
200
+ "implement": "completed" if execution.get("status") == "executed" else "failed",
201
+ "qa": "completed" if checks_ok else "failed",
202
+ "simulate": "completed" if checks_ok else "failed",
203
+ "final_test": "completed" if checks_ok else "failed",
204
+ "production": "ready" if checks_ok else "blocked",
205
+ }
206
+
207
+ return {
208
+ "goal": plan_payload["goal"],
209
+ "workflow_path": plan_payload["resolved_path"],
210
+ "requested_workflow_path": plan_payload["requested_path"],
211
+ "task_plan": plan_payload,
212
+ "stage_status": [
213
+ {
214
+ "stage": stage,
215
+ "status": stage_status.get(stage, "pending"),
216
+ }
217
+ for stage in plan_payload["resolved_path"]
218
+ ],
219
+ "ready_for_production": checks_ok,
220
+ }