@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,119 @@
1
+ ---
2
+ description: Deep security review — scans for vulnerabilities, hardcoded secrets, auth issues, and injection risks. Escalates to Codex for deep line-by-line analysis.
3
+ allowed-tools: Read, Bash(grep:*), Bash(find:*), Bash(cat:*), Bash(git:*), Bash(rg:*), Grep, Glob
4
+ argument-hint: "[file or directory to review, or 'all' for full scan]"
5
+ ---
6
+
7
+ # /OMG:security-review — Vulnerability Scanner + Deep Review
8
+
9
+ ## Step 1: Scope Detection
10
+
11
+ Determine what to scan:
12
+ - If argument is a file: scan that file deeply
13
+ - If argument is a directory: scan all source files in it
14
+ - If "all" or no argument: scan git-tracked source files
15
+
16
+ Identify security-critical files automatically:
17
+ ```bash
18
+ # Auth/session
19
+ find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \) | xargs grep -li "auth\|login\|session\|token\|password\|jwt\|oauth" 2>/dev/null
20
+
21
+ # Payment
22
+ find . -type f -name "*.{ts,js,py,go}" | xargs grep -li "payment\|billing\|stripe\|checkout\|card\|price" 2>/dev/null
23
+
24
+ # Database
25
+ find . -type f -name "*.{ts,js,py,go}" | xargs grep -li "query\|SELECT\|INSERT\|UPDATE\|DELETE\|migration\|schema" 2>/dev/null
26
+ ```
27
+
28
+ ## Step 2: Automated Vulnerability Scan
29
+
30
+ For each security-critical file, check LINE-BY-LINE:
31
+
32
+ **2a. Hardcoded Secrets**
33
+ ```bash
34
+ grep -rn "AKIA\|sk_live\|sk_test\|ghp_\|github_pat\|xoxb-\|xoxp-\|eyJ.*\.eyJ" [files]
35
+ grep -rn "api[_-]key.*=.*['\"][A-Za-z0-9]" [files]
36
+ grep -rn "password.*=.*['\"]" [files] | grep -v "test\|mock\|example\|placeholder"
37
+ ```
38
+
39
+ **2b. SQL Injection**
40
+ ```bash
41
+ grep -rn "f\".*SELECT\|f\".*INSERT\|f\".*UPDATE\|f\".*DELETE" [files]
42
+ grep -rn "\\.format.*SELECT\|%s.*SELECT\|\\+.*SELECT" [files]
43
+ grep -rn "query.*\\$\\{" [files] # template literal SQL
44
+ ```
45
+
46
+ **2c. XSS / Injection**
47
+ ```bash
48
+ grep -rn "innerHTML\|dangerouslySetInnerHTML\|v-html\|\\|safe\b" [files]
49
+ grep -rn "eval(\|exec(\|subprocess.*shell=True" [files]
50
+ grep -rn "document\\.write\|document\\.location" [files]
51
+ ```
52
+
53
+ **2d. Auth/Session Issues**
54
+ ```bash
55
+ grep -rn "jwt\\.decode.*verify.*false\|verify.*False" [files]
56
+ grep -rn "cors.*\\*\|origin.*\\*" [files]
57
+ grep -rn "httpOnly.*false\|secure.*false\|sameSite.*none" [files]
58
+ ```
59
+
60
+ **2e. Path Traversal**
61
+ ```bash
62
+ grep -rn "req\\.params\|req\\.query\|req\\.body" [files] | grep -i "path\|file\|dir"
63
+ grep -rn "\\.\\./\|\\.\\.\\\\" [files]
64
+ ```
65
+
66
+ **2f. Sensitive Data Exposure**
67
+ ```bash
68
+ grep -rn "console\\.log.*password\|console\\.log.*token\|console\\.log.*secret" [files]
69
+ grep -rn "log\\.info.*password\|logger.*token\|print.*secret" [files]
70
+ ```
71
+
72
+ ## Step 3: Codex Deep Review (for high-risk files)
73
+
74
+ For files with auth, payment, or database logic:
75
+
76
+ ```
77
+ /OMG:escalate codex "Security deep review of [file]:
78
+ 1. Read every line. Flag any: hardcoded secrets, SQL injection, XSS, CSRF, auth bypass, privilege escalation, insecure deserialization, SSRF.
79
+ 2. Check auth flow completeness: does every protected route validate the token? Are permissions checked?
80
+ 3. Check payment flow: is card data handled safely? Are amounts validated server-side?
81
+ 4. Check database queries: all parameterized? Any raw string concatenation?
82
+ 5. Rate this file: SAFE / NEEDS_FIX / CRITICAL with specific line numbers."
83
+ ```
84
+
85
+ ## Step 4: Report
86
+
87
+ ```
88
+ Security Review — [scope]
89
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━
90
+
91
+ Files scanned: [N]
92
+ Security-critical files: [N]
93
+
94
+ CRITICAL [N]:
95
+ [file:line] Hardcoded API key: [type]
96
+ [file:line] SQL injection: unparameterized query
97
+
98
+ HIGH [N]:
99
+ [file:line] Missing auth check on protected route
100
+ [file:line] CORS wildcard in production config
101
+
102
+ MEDIUM [N]:
103
+ [file:line] Sensitive data in console.log
104
+ [file:line] httpOnly not set on session cookie
105
+
106
+ LOW [N]:
107
+ [file:line] Missing rate limiting on login endpoint
108
+
109
+ Codex Deep Review:
110
+ [file]: [SAFE|NEEDS_FIX|CRITICAL] — [summary]
111
+
112
+ Fix priority: [ordered list of what to fix first]
113
+ ```
114
+
115
+ ## Anti-patterns
116
+ - Don't just grep and dump raw output — analyze each finding
117
+ - Don't skip test files entirely (they can leak real credentials)
118
+ - Don't claim "looks secure" without running ALL checks above
119
+ - Don't treat this as optional for auth/payment/database changes
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Structured multi-step reasoning using sequential-thinking tool for complex debugging and planning.
3
+ allowed-tools: sequential-thinking_sequentialthinking, Read, Grep, Glob
4
+ argument-hint: "[problem statement to reason through]"
5
+ ---
6
+
7
+ # /OMG:sequential-thinking
8
+
9
+ Use the sequential-thinking tool when the task needs explicit step-by-step reasoning,
10
+ branching, and hypothesis verification.
11
+
12
+ Execution contract:
13
+ - Start with an initial thought budget
14
+ - Revise or branch when new evidence appears
15
+ - End only when a verified conclusion is reached
16
+
17
+ Output contract:
18
+ - Return final conclusion
19
+ - Return key assumptions
20
+ - Return verification steps used
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: Ship pipeline — Idea -> Plan -> Execute -> Evidence -> PR-ready summary
3
+ allowed-tools: Read, Write, Edit, MultiEdit, Grep, Glob, Bash(git:*), Bash(rg:*), Bash(find:*), Bash(cat:*), Bash(python3:*), Bash(pytest:*), Bash(npm test:*), Bash(go test:*), Bash(cargo test:*), Bash(jest:*), Bash(vitest:*)
4
+ argument-hint: "[goal or optional path to .omg/idea.yml]"
5
+ ---
6
+
7
+ # /OMG:ship — Idea -> Evidence -> PR
8
+
9
+ ## Step 1: Load idea contract
10
+ - Prefer `.omg/idea.yml`.
11
+ - If missing, scaffold from `~/.claude/templates/omg/idea.yml` and ask user for minimum fields:
12
+ - `goal`, `constraints`, `acceptance`, `risk`, `evidence_required`.
13
+
14
+ ## Step 2: Convert idea to execution plan
15
+ - Consume plan artifacts generated by `/OMG:deep-plan`.
16
+ - Require `.omg/state/_plan.md` and `.omg/state/_checklist.md` to already encode the business workflow contract.
17
+ - If missing, invoke `/OMG:deep-plan` first and return after those artifacts are created.
18
+ - Use the deep-plan workflow path and task metadata as the execution source of truth.
19
+
20
+ ## Step 3: Execute with Shadow + Evidence discipline
21
+ - Implement changes.
22
+ - Run verification commands.
23
+ - Build an evidence pack at `.omg/evidence/<run-id>.json` containing:
24
+ - `tests[]`, `security_scans[]`, `diff_summary`, `reproducibility`, `unresolved_risks[]`.
25
+
26
+ ## Step 4: Security and trust checks
27
+ - Run `/OMG:security-review` for auth/payment/database/sensitive changes.
28
+ - If config/hook/MCP changes are involved, ensure trust manifest is updated at `.omg/trust/manifest.lock.json`.
29
+
30
+ ## Step 5: PR-ready output
31
+ Return:
32
+ 1. Goal and scope delivered
33
+ 2. Files changed
34
+ 3. Verification evidence (command + exit code)
35
+ 4. Risks/unknowns
36
+ 5. Suggested PR title + body
37
+
38
+ ## Full-power sub-agent protocol
39
+ - Prefer parallel background sub-agent launches for independent workstreams.
40
+ - Do not finalize until every launched track is collected via `background_output`.
41
+ - Use `sequential-thinking` to reconcile conflicts and enforce execution order.
42
+
43
+ ## Anti-patterns
44
+ - Do not claim done without evidence.
45
+ - Do not edit tests to hide product bugs.
46
+ - Do not skip trust review for `.claude/.omg` or MCP changes.
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "oal-advanced",
3
+ "version": "1.0.2",
4
+ "description": "Advanced OAL commands - deep planning, learning, code review, security review, and specialized workflows",
5
+ "type": "oal-plugin",
6
+ "commands": {
7
+ "deep-plan": {
8
+ "path": "commands/OAL:deep-plan.md",
9
+ "description": "Deep strategic planning with domain awareness",
10
+ "category": "planning"
11
+ },
12
+ "learn": {
13
+ "path": "commands/OAL:learn.md",
14
+ "description": "Create reusable skills from patterns",
15
+ "category": "knowledge"
16
+ },
17
+ "code-review": {
18
+ "path": "commands/OAL:code-review.md",
19
+ "description": "Deep code review with line-by-line analysis",
20
+ "category": "quality"
21
+ },
22
+ "security-review": {
23
+ "path": "commands/OAL:security-review.md",
24
+ "description": "Security vulnerability scanning",
25
+ "category": "security"
26
+ },
27
+ "ship": {
28
+ "path": "commands/OAL:ship.md",
29
+ "description": "Ship pipeline - idea to PR-ready summary",
30
+ "category": "delivery"
31
+ },
32
+ "handoff": {
33
+ "path": "commands/OAL:handoff.md",
34
+ "description": "Intelligent session transfer",
35
+ "category": "collaboration"
36
+ },
37
+ "maintainer": {
38
+ "path": "commands/OAL:maintainer.md",
39
+ "description": "Open-source maintainer workflows",
40
+ "category": "oss"
41
+ },
42
+ "sequential-thinking": {
43
+ "path": "commands/OAL:sequential-thinking.md",
44
+ "description": "Structured multi-step reasoning",
45
+ "category": "thinking"
46
+ },
47
+ "ralph-start": {
48
+ "path": "commands/OAL:ralph-start.md",
49
+ "description": "Start Ralph autonomous loop",
50
+ "category": "automation"
51
+ },
52
+ "ralph-stop": {
53
+ "path": "commands/OAL:ralph-stop.md",
54
+ "description": "Stop Ralph autonomous loop",
55
+ "category": "automation"
56
+ }
57
+ },
58
+ "categories": {
59
+ "planning": {
60
+ "description": "Strategic planning and architecture",
61
+ "commands": ["deep-plan"]
62
+ },
63
+ "quality": {
64
+ "description": "Code quality and review",
65
+ "commands": ["code-review"]
66
+ },
67
+ "security": {
68
+ "description": "Security analysis and review",
69
+ "commands": ["security-review"]
70
+ },
71
+ "knowledge": {
72
+ "description": "Learning and skill creation",
73
+ "commands": ["learn"]
74
+ },
75
+ "delivery": {
76
+ "description": "Shipping and release workflows",
77
+ "commands": ["ship"]
78
+ },
79
+ "collaboration": {
80
+ "description": "Team collaboration and handoff",
81
+ "commands": ["handoff"]
82
+ },
83
+ "automation": {
84
+ "description": "Autonomous execution modes",
85
+ "commands": ["ralph-start", "ralph-stop"]
86
+ },
87
+ "thinking": {
88
+ "description": "Structured thinking tools",
89
+ "commands": ["sequential-thinking"]
90
+ },
91
+ "oss": {
92
+ "description": "Open source maintainer tools",
93
+ "commands": ["maintainer"]
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "oal-core",
3
+ "version": "1.0.2",
4
+ "description": "Core OAL commands - essential functionality for routing, initialization, and multi-agent orchestration",
5
+ "type": "oal-plugin",
6
+ "commands": {
7
+ "init": {
8
+ "path": "commands/OAL:init.md",
9
+ "description": "Unified initializer for project setup and domain scaffolding",
10
+ "category": "setup"
11
+ },
12
+ "escalate": {
13
+ "path": "commands/OAL:escalate.md",
14
+ "description": "Auto-route to Codex or Gemini",
15
+ "category": "routing"
16
+ },
17
+ "teams": {
18
+ "path": "commands/OAL:teams.md",
19
+ "description": "Internal team routing for standalone operation",
20
+ "category": "routing"
21
+ },
22
+ "ccg": {
23
+ "path": "commands/OAL:ccg.md",
24
+ "description": "CCG mode - tri-track synthesis (Claude+Codex+Gemini)",
25
+ "category": "routing"
26
+ },
27
+ "crazy": {
28
+ "path": "commands/OAL:crazy.md",
29
+ "description": "CRAZY mode - parallel multi-agent orchestration",
30
+ "category": "orchestration"
31
+ },
32
+ "compat": {
33
+ "path": "commands/OAL:compat.md",
34
+ "description": "Legacy skill compatibility dispatcher",
35
+ "category": "compatibility"
36
+ },
37
+ "health-check": {
38
+ "path": "commands/OAL:health-check.md",
39
+ "description": "Verify project setup and tool integration",
40
+ "category": "setup"
41
+ },
42
+ "mode": {
43
+ "path": "commands/OAL:mode.md",
44
+ "description": "Set cognitive mode for the session",
45
+ "category": "config"
46
+ },
47
+ "domain-init": {
48
+ "path": "commands/OAL:domain-init.md",
49
+ "description": "Alias for domain scaffolding (use init instead)",
50
+ "category": "setup",
51
+ "deprecated": true
52
+ },
53
+ "project-init": {
54
+ "path": "commands/OAL:project-init.md",
55
+ "description": "Alias for project setup (use init instead)",
56
+ "category": "setup",
57
+ "deprecated": true
58
+ }
59
+ },
60
+ "categories": {
61
+ "setup": {
62
+ "description": "Project initialization and setup",
63
+ "commands": ["init", "health-check"]
64
+ },
65
+ "routing": {
66
+ "description": "Model routing and escalation",
67
+ "commands": ["escalate", "teams", "ccg"]
68
+ },
69
+ "orchestration": {
70
+ "description": "Multi-agent orchestration modes",
71
+ "commands": ["crazy"]
72
+ },
73
+ "compatibility": {
74
+ "description": "Legacy compatibility",
75
+ "commands": ["compat"]
76
+ },
77
+ "config": {
78
+ "description": "Configuration and settings",
79
+ "commands": ["mode"]
80
+ }
81
+ }
82
+ }
package/pytest.ini ADDED
@@ -0,0 +1,5 @@
1
+ [pytest]
2
+ testpaths = tests
3
+ python_files = test_*.py
4
+ python_classes = Test*
5
+ python_functions = test_*
@@ -0,0 +1 @@
1
+ """Registry package for OMG."""
@@ -0,0 +1,90 @@
1
+ """OMG v1 supply-chain verification with Warn-and-Run semantics."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import dataclass
5
+ from typing import Any
6
+
7
+
8
+ @dataclass
9
+ class SupplyArtifact:
10
+ id: str
11
+ signer: str | None
12
+ checksum: str | None
13
+ permissions: list[str]
14
+ static_scan: list[dict[str, Any]]
15
+ risk_level: str = "low"
16
+
17
+
18
+ def _normalize(artifact: dict[str, Any]) -> SupplyArtifact:
19
+ return SupplyArtifact(
20
+ id=str(artifact.get("id", "unknown")),
21
+ signer=artifact.get("signer"),
22
+ checksum=artifact.get("checksum"),
23
+ permissions=[str(p) for p in artifact.get("permissions", [])],
24
+ static_scan=[f for f in artifact.get("static_scan", []) if isinstance(f, dict)],
25
+ risk_level=str(artifact.get("risk_level", "low")).lower(),
26
+ )
27
+
28
+
29
+ def verify_artifact(artifact: dict[str, Any], mode: str = "warn_and_run") -> dict[str, Any]:
30
+ a = _normalize(artifact)
31
+ reasons: list[str] = []
32
+ controls: list[str] = []
33
+
34
+ for finding in a.static_scan:
35
+ sev = str(finding.get("severity", "")).lower()
36
+ if sev == "critical":
37
+ reasons.append("critical static scan finding")
38
+ return {
39
+ "action": "deny",
40
+ "risk_level": "critical",
41
+ "reason": "; ".join(reasons),
42
+ "controls": ["block-execution"],
43
+ "trusted": False,
44
+ }
45
+
46
+ perm_blob = " ".join(a.permissions).lower()
47
+ if any(token in perm_blob for token in ["sudo", "rm -rf", "--privileged", "curl |", "wget |"]):
48
+ return {
49
+ "action": "deny",
50
+ "risk_level": "critical",
51
+ "reason": "critical permission profile",
52
+ "controls": ["block-execution"],
53
+ "trusted": False,
54
+ }
55
+
56
+ if not a.signer or not a.checksum:
57
+ reasons.append("missing signer/checksum")
58
+ controls.extend(["isolate-network", "read-only-fs", "manual-approval"])
59
+ if mode == "warn_and_run":
60
+ return {
61
+ "action": "ask",
62
+ "risk_level": "high",
63
+ "reason": "; ".join(reasons),
64
+ "controls": controls,
65
+ "trusted": False,
66
+ }
67
+ return {
68
+ "action": "deny",
69
+ "risk_level": "high",
70
+ "reason": "; ".join(reasons),
71
+ "controls": ["block-execution"],
72
+ "trusted": False,
73
+ }
74
+
75
+ if any(str(f.get("severity", "")).lower() == "high" for f in a.static_scan):
76
+ return {
77
+ "action": "ask",
78
+ "risk_level": "high",
79
+ "reason": "high severity findings present",
80
+ "controls": ["manual-approval"],
81
+ "trusted": False,
82
+ }
83
+
84
+ return {
85
+ "action": "allow",
86
+ "risk_level": a.risk_level if a.risk_level in {"low", "med", "high", "critical"} else "low",
87
+ "reason": "artifact verified",
88
+ "controls": [],
89
+ "trusted": True,
90
+ }
@@ -0,0 +1,9 @@
1
+ # Architect Mode
2
+
3
+ When in architect mode:
4
+ - Map the full system before proposing changes
5
+ - Consider: scalability, maintainability, testability, security
6
+ - Produce: diagrams (text-based), decision records, trade-off analysis
7
+ - Do NOT write implementation code — write specs and interfaces only
8
+ - Every decision must have: rationale, alternatives considered, trade-offs
9
+ - Use /OMG:deep-plan for complex multi-phase work
@@ -0,0 +1,20 @@
1
+ # Big Picture — Map Before Code
2
+
3
+ **When:** Task touches 2+ subsystems, you're unfamiliar with the area, or change could cascade.
4
+
5
+ **Steps:**
6
+ 1. Write .omg/state/_context.md with:
7
+ - Subsystems involved (names + responsibilities)
8
+ - Data flow between them
9
+ - Public interfaces affected
10
+ 2. Identify side effects: "If I change X, what breaks?"
11
+ 3. Get user confirmation before proceeding
12
+
13
+ **Skip when:** Single-file fix within one well-understood module.
14
+
15
+ **Format:**
16
+ ```
17
+ Subsystems: [A] → [B] → [C]
18
+ Change in A affects: B (interface), C (data format)
19
+ Risk: B's tests may break → run B's tests first
20
+ ```
@@ -0,0 +1,26 @@
1
+ # Code Hygiene
2
+
3
+ **Always active.**
4
+
5
+ **No unnecessary code:**
6
+ - Don't add code "just in case" — every line must serve the current requirement
7
+ - Don't add empty catch blocks, unused imports, dead variables, or placeholder functions
8
+ - Don't copy boilerplate that isn't needed for this specific feature
9
+ - If removing code makes the program work the same → remove it
10
+
11
+ **No noise comments:**
12
+ - NEVER: `// increment i by 1`, `// return the result`, `// constructor`, `// import modules`
13
+ - NEVER: `// TODO: implement` (either implement it or note it in working-memory)
14
+ - OK: WHY comments (`// Retry 3x because Stripe webhook occasionally 504s`)
15
+ - OK: WARN comments (`// SECURITY: raw SQL here because ORM can't express this join`)
16
+ - OK: API contract comments (`// @param userId - must be UUID v4, not email`)
17
+
18
+ **Line-by-line awareness:**
19
+ - Before editing a file: read the FULL file (or relevant section), not just the target function
20
+ - After editing: re-read to verify no duplicate imports, no orphaned variables, no broken references
21
+ - Check: does this change break anything ABOVE or BELOW the edit?
22
+
23
+ **Before claiming completion, verify:**
24
+ - `grep -n "TODO\|FIXME\|HACK\|XXX"` — are any left unresolved?
25
+ - No console.log/print debugging statements left in production code
26
+ - No commented-out code blocks (delete or extract to a branch)
@@ -0,0 +1,19 @@
1
+ # Context Management
2
+
3
+ **When:** Long sessions (100+ tool calls), feeling lost, or about to compact.
4
+
5
+ **Prefer /OMG:handoff over automatic compaction.** /OMG:handoff preserves intent + decisions + failure history. Automatic compaction loses nuance.
6
+
7
+ **Minimize context waste:**
8
+ - Read file line ranges, not entire files: `Read(file.ts:10-50)` not `Read(file.ts)`
9
+ - Keep working-memory.md concise (under 30 lines)
10
+ - Don't re-read files you already read this session
11
+ - Use Grep/Glob to find specific content instead of reading everything
12
+
13
+ **Signs of thin context (you need /OMG:handoff soon):**
14
+ - Repeating questions you already asked
15
+ - Contradicting earlier decisions
16
+ - Forgetting file locations
17
+ - Re-reading the same files
18
+
19
+ **Rule:** When in doubt, /OMG:handoff now. It's cheaper than losing context.
@@ -0,0 +1,32 @@
1
+ # Context Minimization Principle
2
+
3
+ Based on: ETH Zurich (2026) "Evaluating AGENTS.md" (arXiv:2602.11988)
4
+ and Lulla et al. (2026) "On the Impact of AGENTS.md Files" (arXiv:2601.20404)
5
+
6
+ ## Key Findings
7
+ - LLM-generated context files LOWER success rates and INCREASE cost by 20%+
8
+ - Human-written minimal files may help slightly (+4%) if they contain ONLY
9
+ information the agent cannot discover by reading project files
10
+ - Always-on rules that don't vary by task type cause unnecessary work
11
+
12
+ ## OMG Policy: Non-Discoverable Only
13
+
14
+ ### INJECT (agent can't discover this from code):
15
+ - Project conventions (naming, commit style, PR process)
16
+ - AI behavior preferences (language, communication style)
17
+ - Active task state (working memory, checklist progress)
18
+ - Failure history (what approaches already failed)
19
+ - Team decisions (why X was chosen over Y)
20
+
21
+ ### DO NOT INJECT (agent can discover this by reading code):
22
+ - Language and framework (detectable from package.json, Cargo.toml, etc.)
23
+ - Dependencies list (detectable from lockfiles)
24
+ - Directory structure (detectable from file listing)
25
+ - API shapes (detectable from source code)
26
+ - Database schema (detectable from migrations/models)
27
+
28
+ ### Budget Enforcement
29
+ - session-start: ≤1500 chars total
30
+ - prompt-enhancer: ≤800 chars per prompt
31
+ - handoff: ≤60 lines, portable ≤100 lines
32
+ - Stale handoffs (>48h): auto-skipped
@@ -0,0 +1,28 @@
1
+ # DDD (Domain-Driven Drive) + SDD (Spec-Driven Development)
2
+
3
+ **When:** Building new features, creating new modules, or the user mentions domain/spec/pattern.
4
+
5
+ **Core DDD workflow (4 steps):**
6
+ 1. **Write first domain by hand** — Define concepts + data handling manually. This becomes the REFERENCE.
7
+ 2. **Establish criteria** — Understand the reference deeply. Know what's correct vs wrong.
8
+ 3. **Replicate by pattern** — Use the reference to generate similar domains. AI output is MUCH more accurate with a concrete pattern.
9
+ 4. **Maintain structure → increasing accuracy** — Initial setup is EVERYTHING. Without it, AI generates plausible-looking garbage.
10
+
11
+ **4 Principles:**
12
+ - Structure becomes pattern → code should be PREDICTABLE across domains
13
+ - Focus per domain → one bounded context at a time, NEVER mix concerns
14
+ - Code names = business language → `createOrder()` not `processData()`, `PaymentIntent` not `TransactionObj`
15
+ - Hooks trigger skills → user command → hook fires → skill activates → AI generates with pattern
16
+
17
+ **SDD workflow:**
18
+ 1. Read the spec/requirement COMPLETELY before writing code
19
+ 2. Extract: inputs, outputs, constraints, edge cases, error states
20
+ 3. Write interface/type first, implementation second
21
+ 4. Every function maps to a spec requirement (traceability)
22
+
23
+ **Before generating code for a new domain, ASK:**
24
+ - Does a reference domain exist? → Read it first, match the pattern
25
+ - Does a spec exist? → Read it, extract requirements
26
+ - If neither → ask the user to define one, or draft one together with /OMG:deep-plan
27
+
28
+ **Evidence:** When creating domain code, cite which reference pattern was followed.
@@ -0,0 +1,16 @@
1
+ # Dependency Safety
2
+
3
+ **When:** Adding, upgrading, or removing any dependency.
4
+
5
+ **Before adding:**
6
+ 1. Can stdlib or existing deps solve this? (Check lockfile for overlap)
7
+ 2. Evaluate: maintenance status, last publish date, weekly downloads, license, bundle size
8
+ 3. Check for known vulnerabilities: `npm audit` / `pip audit` / `cargo audit`
9
+
10
+ **After adding:**
11
+ - Lockfile updated and committed
12
+ - dev vs prod classification correct
13
+ - Version pinned (not floating/latest)
14
+ - Run full test suite to catch conflicts
15
+
16
+ **Red flags:** Last publish >1 year, <1K weekly downloads, copyleft license in proprietary project, >500KB for a utility function.
@@ -0,0 +1,13 @@
1
+ # Doc Check — Read Before Edit
2
+
3
+ **When:** Modifying core logic, adding new patterns, or changing public interfaces.
4
+
5
+ **Steps:**
6
+ 1. Check if docs/ARCHITECTURE_TOC.md or docs/ARCHITECTURE.md exists
7
+ 2. Read the relevant chapter for the subsystem you're touching
8
+ 3. Note invariants — things that must NOT break
9
+ 4. After changes: verify invariants still hold
10
+
11
+ **Skip when:** Fixing typos, updating comments, or trivial changes that don't alter behavior.
12
+
13
+ **Evidence:** "Read [doc], invariants: [list], all preserved: [yes/no]"
@@ -0,0 +1,9 @@
1
+ # Implement Mode
2
+
3
+ When in implement mode:
4
+ - Follow existing patterns in the codebase (read before writing)
5
+ - Write tests BEFORE or ALONGSIDE implementation (TDD preferred)
6
+ - Verify every change: build → lint → test → show exit codes
7
+ - Minimal changes: touch only what's needed for the task
8
+ - No noise comments, no generic names (data/result/temp/val)
9
+ - After each file change: read it back to confirm correctness
@@ -0,0 +1,14 @@
1
+ # Infrastructure Safety
2
+
3
+ **When:** Working with scripts, Docker, Terraform, K8s, DB migrations, CI/CD.
4
+
5
+ **Rules:**
6
+ - `--dry-run` or `--plan` before any destructive operation
7
+ - Never hardcode secrets — use env vars or secret managers
8
+ - Bash scripts: `set -euo pipefail` + `trap` for cleanup
9
+ - Docker: non-root user + health check + specific base image tags
10
+ - Terraform: `plan` before `apply`, state locking enabled
11
+ - DB migrations: backward-compatible always (old code must still work with new schema)
12
+ - CI/CD: test in staging-like environment before production
13
+
14
+ **Forbidden:** `rm -rf` without confirmation, `chmod 777`, force-push to main, unencrypted credentials in config.