@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/commands/OMG:init.md
CHANGED
|
@@ -1,26 +1,134 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
3
|
-
allowed-tools: Read, Write, Edit,
|
|
4
|
-
argument-hint: "[optional
|
|
2
|
+
description: "Unified initializer — auto-detects: project setup (if no .omg/state), domain scaffolding (if argument given), or health check."
|
|
3
|
+
allowed-tools: Read, Write, Edit, MultiEdit, Bash(mkdir:*), Bash(cat:*), Bash(find:*), Bash(ls:*), Bash(head:*), Bash(grep:*), Bash(tree:*), Bash(node:*), Bash(python*:*), Bash(tee:*), Grep, Glob
|
|
4
|
+
argument-hint: "[optional: domain name like 'payment', or 'check' for health check]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# /OMG:init
|
|
7
|
+
# /OMG:init — Unified Project & Domain Initializer
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Auto-Detection Logic
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```
|
|
12
|
+
if argument is a domain name (e.g. "payment", "user-profile"):
|
|
13
|
+
→ DOMAIN INIT (create new domain from existing patterns)
|
|
14
|
+
elif .omg/state directory does not exist:
|
|
15
|
+
→ PROJECT INIT (first-time project setup)
|
|
16
|
+
elif .omg/state/profile.yaml exists:
|
|
17
|
+
→ HEALTH CHECK (verify everything works, offer upgrades)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## MODE A: PROJECT INIT (no .omg/state found)
|
|
23
|
+
|
|
24
|
+
### Step 1: Create .omg/state/profile.yaml (MOST IMPORTANT)
|
|
25
|
+
Detect from code. Ask user for anything undetectable.
|
|
12
26
|
|
|
13
27
|
```yaml
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
# .omg/state/profile.yaml — injected every session (keep under 20 lines)
|
|
29
|
+
name: "[from package.json/Cargo.toml/pyproject.toml]"
|
|
30
|
+
description: "[1 sentence]"
|
|
31
|
+
repo: "[from git remote -v]"
|
|
32
|
+
|
|
33
|
+
language: "[detect]"
|
|
34
|
+
framework: "[detect]"
|
|
35
|
+
database: "[detect or ask]"
|
|
36
|
+
infra: "[detect from Dockerfile/terraform/etc]"
|
|
37
|
+
key_deps: "[top 5]"
|
|
38
|
+
|
|
39
|
+
conventions:
|
|
40
|
+
naming: "[detect: camelCase/snake_case]"
|
|
41
|
+
test_cmd: "[detect: npm test/pytest/cargo test]"
|
|
42
|
+
lint_cmd: "[detect: eslint/ruff/clippy]"
|
|
43
|
+
|
|
44
|
+
ai_behavior:
|
|
45
|
+
communication: "[ask user: language preference]"
|
|
46
|
+
when_stuck: "Ask user after 2 failed attempts"
|
|
47
|
+
testing: "User-journey focused, not boilerplate"
|
|
19
48
|
```
|
|
20
49
|
|
|
21
|
-
|
|
50
|
+
### Step 2: Create knowledge structure + OMG v1 contract dirs
|
|
51
|
+
```
|
|
52
|
+
mkdir -p .omg/state/ledger .omg/knowledge/decisions .omg/knowledge/patterns .omg/knowledge/rules
|
|
53
|
+
mkdir -p .omg/trust .omg/evidence .omg/shadow .omg/migrations
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Copy OMG v1 templates when missing:
|
|
57
|
+
- `.omg/idea.yml`
|
|
58
|
+
- `.omg/policy.yaml`
|
|
59
|
+
- `.omg/runtime.yaml`
|
|
60
|
+
|
|
61
|
+
### Step 3: Auto-detect quality gate
|
|
62
|
+
```json
|
|
63
|
+
// .omg/state/quality-gate.json — only include commands that exist
|
|
64
|
+
{
|
|
65
|
+
"format": "[detect: prettier/black/gofmt or null]",
|
|
66
|
+
"lint": "[detect: eslint/ruff/clippy or null]",
|
|
67
|
+
"typecheck": "[detect: tsc/mypy or null]",
|
|
68
|
+
"test": "[detect: npm test/pytest/cargo test or null]"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 4: Copy relevant contextual rules
|
|
73
|
+
Based on detected project type, copy relevant rules from templates:
|
|
74
|
+
- Web project → security-domains.md, code-hygiene.md
|
|
75
|
+
- Backend → infra-safety.md, dependency-safety.md
|
|
76
|
+
- DDD project → ddd-sdd.md, outside-in.md
|
|
77
|
+
|
|
78
|
+
### Step 5: Verify
|
|
79
|
+
Run `/OMG:health-check` to confirm setup.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## MODE B: DOMAIN INIT (argument = domain name)
|
|
84
|
+
|
|
85
|
+
### Step 1: Find Reference Pattern
|
|
86
|
+
```bash
|
|
87
|
+
find . -type f -name "*.ts" -o -name "*.py" | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -10
|
|
88
|
+
```
|
|
89
|
+
Read the most complete existing domain. Extract:
|
|
90
|
+
- Directory structure (routes, services, models, tests)
|
|
91
|
+
- Naming conventions, error handling, data flow patterns
|
|
92
|
+
|
|
93
|
+
### Step 2: Define the New Domain
|
|
94
|
+
Ask the user:
|
|
95
|
+
- "What entities does [domain] have?"
|
|
96
|
+
- "What actions can be performed?"
|
|
97
|
+
- "What external services does it talk to?"
|
|
98
|
+
- "What are the business rules?"
|
|
99
|
+
|
|
100
|
+
### Step 3: Generate Domain Structure
|
|
101
|
+
Match the reference pattern EXACTLY. Create:
|
|
102
|
+
```
|
|
103
|
+
src/[domain]/
|
|
104
|
+
├── [domain].model.ts
|
|
105
|
+
├── [domain].service.ts
|
|
106
|
+
├── [domain].repository.ts
|
|
107
|
+
├── [domain].controller.ts (or routes)
|
|
108
|
+
├── [domain].types.ts
|
|
109
|
+
└── __tests__/
|
|
110
|
+
└── [domain].service.test.ts
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Step 4: Document the Pattern
|
|
114
|
+
Save to `.omg/knowledge/patterns/[domain]-pattern.md`
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## MODE C: HEALTH CHECK (already initialized)
|
|
119
|
+
|
|
120
|
+
Run `/OMG:health-check` and additionally:
|
|
121
|
+
- Verify profile.yaml is up-to-date with current project state
|
|
122
|
+
- Check if new contextual rules should be added
|
|
123
|
+
- Offer to update quality-gate.json if tools changed
|
|
124
|
+
|
|
125
|
+
---
|
|
22
126
|
|
|
127
|
+
## File Write Method
|
|
128
|
+
Use `Write` tool first. If it fails (file exists), fall back to:
|
|
23
129
|
```bash
|
|
24
|
-
|
|
25
|
-
|
|
130
|
+
cat > .omg/state/profile.yaml << 'EOF'
|
|
131
|
+
[content]
|
|
132
|
+
EOF
|
|
26
133
|
```
|
|
134
|
+
Always READ the file after writing to confirm.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Alias for /OMG:init (project setup mode). Use /OMG:init instead."
|
|
3
|
-
allowed-tools: Read, Write, Edit, MultiEdit, Bash(mkdir:*), Bash(cat:*), Bash(find:*), Bash(ls:*), Bash(head:*), Bash(grep:*), Bash(tree:*), Bash(
|
|
3
|
+
allowed-tools: Read, Write, Edit, MultiEdit, Bash(mkdir:*), Bash(cat:*), Bash(find:*), Bash(ls:*), Bash(head:*), Bash(grep:*), Bash(tree:*), Bash(node:*), Bash(python*:*), Bash(tee:*), Grep, Glob
|
|
4
4
|
argument-hint: "[optional: project description]"
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,18 +1,85 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Create or
|
|
3
|
-
allowed-tools: Read, Write, Edit, Bash
|
|
2
|
+
description: "Create or manage OMG state branches for experimental workflows."
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash
|
|
4
4
|
argument-hint: "--name <branch-name> [--from <snapshot_id>]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# /OMG:session-branch
|
|
7
|
+
# /OMG:session-branch — Branch OMG State
|
|
8
8
|
|
|
9
|
-
OMG state
|
|
9
|
+
Create a named branch of the current OMG state for experimentation or parallel exploration.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Important
|
|
12
12
|
|
|
13
|
+
Branching is **OMG state only** — it captures and restores `.omg/state/` directory contents. It does **not** fork the conversation, context window, or Claude session. Think of it as a checkpoint you can name and switch between.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/OMG:session-branch --name "experiment"
|
|
19
|
+
/OMG:session-branch --name "refactor-v2" --from 20260302_143000_baseline
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## What It Does
|
|
23
|
+
|
|
24
|
+
1. Creates a snapshot of the current `.omg/state/` directory (or restores a specified snapshot)
|
|
25
|
+
2. Writes branch metadata to `.omg/state/branches/<name>.json`
|
|
26
|
+
3. Updates `.omg/state/current_branch.json` to track the active branch
|
|
27
|
+
|
|
28
|
+
## Branch Metadata
|
|
29
|
+
|
|
30
|
+
Each branch stores:
|
|
31
|
+
|
|
32
|
+
| Field | Description |
|
|
33
|
+
|-------|-------------|
|
|
34
|
+
| `name` | Branch name |
|
|
35
|
+
| `snapshot_id` | Associated snapshot ID |
|
|
36
|
+
| `created_at` | ISO timestamp of creation |
|
|
37
|
+
| `parent_branch` | Branch that was active when this branch was created |
|
|
38
|
+
| `status` | Branch status (`active`) |
|
|
39
|
+
|
|
40
|
+
## Managing Branches
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
# List all branches
|
|
44
|
+
python3 tools/session_snapshot.py branches
|
|
45
|
+
|
|
46
|
+
# Switch to a branch (restores its snapshot)
|
|
47
|
+
python3 tools/session_snapshot.py switch experiment
|
|
48
|
+
|
|
49
|
+
# Create branch from specific snapshot
|
|
50
|
+
python3 tools/session_snapshot.py branch my-branch --from 20260302_143000_baseline
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Feature Flag
|
|
54
|
+
|
|
55
|
+
Branching is gated behind `OMG_BRANCHING_ENABLED` (default: `False`).
|
|
56
|
+
|
|
57
|
+
Enable via environment variable:
|
|
13
58
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
59
|
+
export OMG_BRANCHING_ENABLED=true
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or in `settings.json`:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"_omg": {
|
|
66
|
+
"features": {
|
|
67
|
+
"BRANCHING": true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Example Workflow
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
# 1. Create a baseline branch
|
|
77
|
+
/OMG:session-branch --name "baseline"
|
|
78
|
+
|
|
79
|
+
# 2. Do some experimental work...
|
|
80
|
+
# 3. Create experiment branch to save progress
|
|
81
|
+
/OMG:session-branch --name "experiment-auth"
|
|
82
|
+
|
|
83
|
+
# 4. Switch back to baseline if experiment didn't work
|
|
84
|
+
python3 tools/session_snapshot.py switch baseline
|
|
18
85
|
```
|
|
@@ -1,16 +1,53 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Fork OMG state from a specific snapshot checkpoint."
|
|
3
|
-
allowed-tools: Read, Write, Edit, Bash
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash
|
|
4
4
|
argument-hint: "--from <snapshot_id> --name <fork-name>"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# /OMG:session-fork
|
|
7
|
+
# /OMG:session-fork — Fork OMG State from Checkpoint
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Create a new branch from a specific snapshot checkpoint. This is a convenience wrapper around `/OMG:session-branch` that always requires a source snapshot.
|
|
10
|
+
|
|
11
|
+
## Important
|
|
12
|
+
|
|
13
|
+
Forking is **OMG state only** — it restores a previous `.omg/state/` snapshot and creates a new named branch from it. It does **not** fork the conversation or create a parallel Claude session.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/OMG:session-fork --from 20260302_143000_baseline --name "alt-approach"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What It Does
|
|
22
|
+
|
|
23
|
+
1. Looks up the specified snapshot by ID
|
|
24
|
+
2. Restores that snapshot to `.omg/state/`
|
|
25
|
+
3. Creates a new branch with the given name pointing to that snapshot
|
|
26
|
+
4. Updates `.omg/state/current_branch.json`
|
|
27
|
+
|
|
28
|
+
## When to Use Fork vs Branch
|
|
29
|
+
|
|
30
|
+
| Action | Use Case |
|
|
31
|
+
|--------|----------|
|
|
32
|
+
| `/OMG:session-branch --name X` | Save current state as a named branch |
|
|
33
|
+
| `/OMG:session-fork --from S --name X` | Go back to snapshot S and start a new exploration path |
|
|
10
34
|
|
|
11
35
|
## Example
|
|
12
36
|
|
|
13
|
-
```
|
|
14
|
-
|
|
37
|
+
```
|
|
38
|
+
# List available snapshots to find a good fork point
|
|
39
|
+
python3 tools/session_snapshot.py list
|
|
40
|
+
|
|
41
|
+
# Fork from a previous checkpoint
|
|
15
42
|
/OMG:session-fork --from 20260302_100000_pre-refactor --name "approach-b"
|
|
43
|
+
|
|
44
|
+
# Continue working from that earlier state...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Feature Flag
|
|
48
|
+
|
|
49
|
+
Forking shares the `OMG_BRANCHING_ENABLED` feature flag with `/OMG:session-branch` (default: `False`).
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
export OMG_BRANCHING_ENABLED=true
|
|
16
53
|
```
|
|
@@ -1,18 +1,134 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Merge OMG state branches together with conflict detection."
|
|
3
|
-
allowed-tools: Read, Write, Edit, Bash
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash
|
|
4
4
|
argument-hint: "--from <source-branch> [--into <target-branch>] [--preview]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# /OMG:session-merge
|
|
7
|
+
# /OMG:session-merge — Merge OMG State Branches
|
|
8
8
|
|
|
9
|
-
Merge one OMG state branch into another with
|
|
9
|
+
Merge one OMG state branch into another with automatic conflict detection.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Important
|
|
12
12
|
|
|
13
|
+
Merging is **OMG state only** — it merges branch metadata (`.omg/state/branches/<name>.json`). It does **not** merge conversations, context windows, or file system state. Think of it as combining the tracked state from two named branches.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/OMG:session-merge --from "experiment"
|
|
19
|
+
/OMG:session-merge --from "experiment" --into "main"
|
|
20
|
+
/OMG:session-merge --from "experiment" --preview
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What It Does
|
|
24
|
+
|
|
25
|
+
1. Loads the source and target branch metadata as flat JSON dicts
|
|
26
|
+
2. Detects conflicts (keys present in both branches with different values)
|
|
27
|
+
3. If `--preview`: returns conflict report without applying changes
|
|
28
|
+
4. If no conflicts: applies source changes on top of target (last-write-wins)
|
|
29
|
+
5. Marks the source branch as `status: "merged"` in its metadata file
|
|
30
|
+
6. Updates `.omg/state/current_branch.json` to the target branch
|
|
31
|
+
|
|
32
|
+
## Conflict Detection
|
|
33
|
+
|
|
34
|
+
A **value_conflict** occurs when both branches have the same key but different values. When conflicts are found, the merge is **aborted** — you must resolve conflicts manually before merging.
|
|
35
|
+
|
|
36
|
+
Conflict report format:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"key": "snapshot_id",
|
|
41
|
+
"source_value": "20260302_150000_experiment",
|
|
42
|
+
"target_value": "20260302_140000_main",
|
|
43
|
+
"conflict_type": "value_conflict"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Preview Mode
|
|
48
|
+
|
|
49
|
+
Use `--preview` to see what a merge would do without applying changes:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
python3 tools/session_snapshot.py merge-preview experiment --into main
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"source": "experiment",
|
|
60
|
+
"target": "main",
|
|
61
|
+
"conflicts": [],
|
|
62
|
+
"changes": 2,
|
|
63
|
+
"preview": true
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## CLI Commands
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
# Merge source into target
|
|
71
|
+
python3 tools/session_snapshot.py merge experiment --into main
|
|
72
|
+
|
|
73
|
+
# Preview merge without applying
|
|
74
|
+
python3 tools/session_snapshot.py merge-preview experiment --into main
|
|
75
|
+
|
|
76
|
+
# Merge into default target (main)
|
|
77
|
+
python3 tools/session_snapshot.py merge experiment
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Feature Flag
|
|
81
|
+
|
|
82
|
+
Merging is gated behind `OMG_MERGE_ENABLED` (default: `False`).
|
|
83
|
+
|
|
84
|
+
Enable via environment variable:
|
|
13
85
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
86
|
+
export OMG_MERGE_ENABLED=true
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or in `settings.json`:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"_omg": {
|
|
93
|
+
"features": {
|
|
94
|
+
"MERGE": true
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Merge Behavior
|
|
101
|
+
|
|
102
|
+
| Scenario | Result |
|
|
103
|
+
|----------|--------|
|
|
104
|
+
| No conflicts | Source state overlaid on target (last-write-wins) |
|
|
105
|
+
| Conflicts found | Merge aborted, conflicts returned |
|
|
106
|
+
| Source branch missing | Error returned |
|
|
107
|
+
| Target branch missing | Error returned |
|
|
108
|
+
| Feature flag disabled | `{"skipped": true}` |
|
|
109
|
+
|
|
110
|
+
## After Merge
|
|
111
|
+
|
|
112
|
+
- The **target** branch is updated with merged state
|
|
113
|
+
- The **source** branch status changes to `"merged"` (not deleted)
|
|
114
|
+
- `current_branch.json` is updated to the target branch
|
|
115
|
+
- Source branch remains accessible for reference
|
|
116
|
+
|
|
117
|
+
## Example Workflow
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
# 1. Create branches
|
|
121
|
+
/OMG:session-branch --name "main"
|
|
122
|
+
/OMG:session-branch --name "experiment"
|
|
123
|
+
|
|
124
|
+
# 2. Do experimental work on "experiment" branch...
|
|
125
|
+
|
|
126
|
+
# 3. Preview the merge
|
|
127
|
+
/OMG:session-merge --from "experiment" --preview
|
|
128
|
+
|
|
129
|
+
# 4. If no conflicts, apply the merge
|
|
130
|
+
/OMG:session-merge --from "experiment" --into "main"
|
|
131
|
+
|
|
132
|
+
# 5. Verify merge
|
|
133
|
+
python3 tools/session_snapshot.py branches
|
|
18
134
|
```
|
package/commands/OMG:setup.md
CHANGED
|
@@ -1,22 +1,79 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
3
|
-
allowed-tools: Read, Write, Edit, Bash(
|
|
4
|
-
argument-hint: "[optional: --non-interactive
|
|
2
|
+
description: "Native OMG setup and adoption flow for supported hosts"
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash(python*:*), Bash(ls:*), Bash(grep:*)
|
|
4
|
+
argument-hint: "[optional: --non-interactive, --mode omg-only|coexist, --preset safe|balanced|interop|labs]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /OMG:setup
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Feature-gated: requires `OMG_SETUP_ENABLED=1` or `settings.json._omg.features.SETUP: true`.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Overview
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- standalone install or plugin install through `OMG-setup.sh`
|
|
16
|
-
- settings merge and hook registration
|
|
13
|
+
Native OMG setup for Claude Code, Codex, OpenCode, and other supported CLIs.
|
|
14
|
+
The command keeps migration logic internal and focuses the user on a small adoption flow:
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
1. Detect supported CLIs.
|
|
17
|
+
2. Detect overlapping ecosystems.
|
|
18
|
+
3. Recommend an adoption mode.
|
|
19
|
+
4. Apply an OMG preset.
|
|
20
|
+
5. Configure MCP and save preferences.
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
## Wizard Flow
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Step 1: Detect CLIs
|
|
26
|
+
- codex
|
|
27
|
+
- gemini
|
|
28
|
+
- opencode
|
|
29
|
+
- kimi
|
|
30
|
+
|
|
31
|
+
Step 2: Detect adoption context
|
|
32
|
+
- OMC-style markers
|
|
33
|
+
- OMX-style markers
|
|
34
|
+
- Superpowers-style markers
|
|
35
|
+
|
|
36
|
+
Step 3: Choose mode
|
|
37
|
+
- OMG-only (recommended)
|
|
38
|
+
- coexist
|
|
39
|
+
|
|
40
|
+
Step 4: Choose preset
|
|
41
|
+
- safe
|
|
42
|
+
- balanced
|
|
43
|
+
- interop
|
|
44
|
+
- labs
|
|
45
|
+
|
|
46
|
+
Step 5: Configure MCP and persist preferences
|
|
47
|
+
- writes .mcp.json
|
|
48
|
+
- writes .omg/state/cli-config.yaml
|
|
49
|
+
- writes .omg/state/adoption-report.json
|
|
22
50
|
```
|
|
51
|
+
|
|
52
|
+
## Modes
|
|
53
|
+
|
|
54
|
+
`OMG-only`
|
|
55
|
+
- Recommended default.
|
|
56
|
+
- OMG becomes the main hooks, HUD, MCP, and orchestration layer.
|
|
57
|
+
|
|
58
|
+
`coexist`
|
|
59
|
+
- Advanced mode.
|
|
60
|
+
- OMG avoids destructive overlap and keeps third-party command namespaces intact where possible.
|
|
61
|
+
|
|
62
|
+
## Output
|
|
63
|
+
|
|
64
|
+
The command emits a final summary that includes:
|
|
65
|
+
|
|
66
|
+
- CLI detection results
|
|
67
|
+
- auth status
|
|
68
|
+
- MCP configuration status
|
|
69
|
+
- selected preset
|
|
70
|
+
- selected adoption mode
|
|
71
|
+
- adoption report path
|
|
72
|
+
|
|
73
|
+
## Public Path
|
|
74
|
+
|
|
75
|
+
The public OMG journey is:
|
|
76
|
+
|
|
77
|
+
1. install for your host
|
|
78
|
+
2. run `/OMG:setup`
|
|
79
|
+
3. run `/OMG:crazy <goal>`
|