@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.
- package/.claude-plugin/marketplace.json +36 -0
- package/.claude-plugin/plugin.json +23 -0
- package/.claude-plugin/scripts/install.sh +49 -0
- package/.claude-plugin/scripts/uninstall.sh +80 -0
- package/.claude-plugin/scripts/update.sh +84 -0
- package/.mcp.json +20 -0
- package/LICENSE +21 -0
- package/OMG-setup.sh +1093 -0
- package/README.md +335 -0
- package/THIRD_PARTY_NOTICES.md +24 -0
- package/UPSTREAM_DIFF.md +20 -0
- package/agents/__init__.py +1 -0
- package/agents/_model_roles.yaml +26 -0
- package/agents/designer.md +67 -0
- package/agents/explore.md +60 -0
- package/agents/model_roles.py +196 -0
- package/agents/omg-api-builder.md +23 -0
- package/agents/omg-architect-mode.md +43 -0
- package/agents/omg-architect.md +13 -0
- package/agents/omg-backend-engineer.md +43 -0
- package/agents/omg-critic.md +16 -0
- package/agents/omg-database-engineer.md +43 -0
- package/agents/omg-escalation-router.md +17 -0
- package/agents/omg-executor.md +12 -0
- package/agents/omg-frontend-designer.md +42 -0
- package/agents/omg-implement-mode.md +50 -0
- package/agents/omg-infra-engineer.md +43 -0
- package/agents/omg-qa-tester.md +16 -0
- package/agents/omg-research-mode.md +43 -0
- package/agents/omg-security-auditor.md +43 -0
- package/agents/omg-testing-engineer.md +43 -0
- package/agents/plan.md +80 -0
- package/agents/quick_task.md +64 -0
- package/agents/reviewer.md +83 -0
- package/agents/task.md +71 -0
- package/commands/OMG:ccg.md +22 -0
- package/commands/OMG:compat.md +57 -0
- package/commands/OMG:crazy.md +125 -0
- package/commands/OMG:domain-init.md +11 -0
- package/commands/OMG:escalate.md +52 -0
- package/commands/OMG:health-check.md +45 -0
- package/commands/OMG:init.md +134 -0
- package/commands/OMG:mode.md +44 -0
- package/commands/OMG:project-init.md +11 -0
- package/commands/OMG:ralph-start.md +43 -0
- package/commands/OMG:ralph-stop.md +23 -0
- package/commands/OMG:teams.md +39 -0
- package/commands/ai-commit.md +113 -0
- package/commands/ccg.md +9 -0
- package/commands/create-agent.md +183 -0
- package/commands/omc-teams.md +9 -0
- package/commands/session-branch.md +85 -0
- package/commands/session-fork.md +53 -0
- package/commands/session-merge.md +134 -0
- package/commands/theme.md +44 -0
- package/config/lsp_languages.yaml +324 -0
- package/config/themes/catppuccin-frappe.yaml +14 -0
- package/config/themes/catppuccin-latte.yaml +14 -0
- package/config/themes/catppuccin-macchiato.yaml +14 -0
- package/config/themes/catppuccin-mocha.yaml +14 -0
- package/config/themes/dracula.yaml +14 -0
- package/config/themes/gruvbox-dark.yaml +14 -0
- package/config/themes/nord.yaml +14 -0
- package/config/themes/one-dark.yaml +14 -0
- package/config/themes/solarized-dark.yaml +14 -0
- package/config/themes/tokyo-night.yaml +14 -0
- package/control_plane/__init__.py +2 -0
- package/control_plane/openapi.yaml +109 -0
- package/control_plane/server.py +107 -0
- package/control_plane/service.py +148 -0
- package/crates/omg-natives/Cargo.toml +17 -0
- package/crates/omg-natives/src/clipboard.rs +5 -0
- package/crates/omg-natives/src/glob.rs +15 -0
- package/crates/omg-natives/src/grep.rs +15 -0
- package/crates/omg-natives/src/highlight.rs +15 -0
- package/crates/omg-natives/src/html.rs +14 -0
- package/crates/omg-natives/src/image.rs +5 -0
- package/crates/omg-natives/src/keys.rs +5 -0
- package/crates/omg-natives/src/lib.rs +36 -0
- package/crates/omg-natives/src/prof.rs +5 -0
- package/crates/omg-natives/src/ps.rs +5 -0
- package/crates/omg-natives/src/shell.rs +5 -0
- package/crates/omg-natives/src/task.rs +5 -0
- package/crates/omg-natives/src/text.rs +14 -0
- package/hooks/_agent_registry.py +421 -0
- package/hooks/_budget.py +31 -0
- package/hooks/_common.py +476 -0
- package/hooks/_learnings.py +126 -0
- package/hooks/_memory.py +103 -0
- package/hooks/circuit-breaker.py +270 -0
- package/hooks/config-guard.py +163 -0
- package/hooks/context_pressure.py +53 -0
- package/hooks/credential_store.py +801 -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 +310 -0
- package/hooks/post-tool-failure.py +19 -0
- package/hooks/post-write.py +199 -0
- package/hooks/pre-compact.py +204 -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/secret-guard.py +47 -0
- package/hooks/session-end-capture.py +137 -0
- package/hooks/session-start.py +275 -0
- package/hooks/shadow_manager.py +297 -0
- package/hooks/state_migration.py +209 -0
- package/hooks/stop-gate.py +7 -0
- package/hooks/stop_dispatcher.py +929 -0
- package/hooks/test-validator.py +138 -0
- package/hooks/todo-state-tracker.py +114 -0
- package/hooks/tool-ledger.py +126 -0
- package/hooks/trust_review.py +524 -0
- package/install.sh +9 -0
- package/omg_natives/__init__.py +186 -0
- package/omg_natives/_bindings.py +165 -0
- package/omg_natives/clipboard.py +36 -0
- package/omg_natives/glob.py +42 -0
- package/omg_natives/grep.py +61 -0
- package/omg_natives/highlight.py +54 -0
- package/omg_natives/html.py +157 -0
- package/omg_natives/image.py +51 -0
- package/omg_natives/keys.py +46 -0
- package/omg_natives/prof.py +39 -0
- package/omg_natives/ps.py +93 -0
- package/omg_natives/shell.py +58 -0
- package/omg_natives/task.py +41 -0
- package/omg_natives/text.py +50 -0
- package/package.json +26 -0
- package/plugins/README.md +82 -0
- package/plugins/advanced/commands/OMG:code-review.md +114 -0
- package/plugins/advanced/commands/OMG:deep-plan.md +221 -0
- package/plugins/advanced/commands/OMG:handoff.md +115 -0
- package/plugins/advanced/commands/OMG:learn.md +110 -0
- package/plugins/advanced/commands/OMG:maintainer.md +31 -0
- package/plugins/advanced/commands/OMG:ralph-start.md +43 -0
- package/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
- package/plugins/advanced/commands/OMG:security-review.md +119 -0
- package/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
- package/plugins/advanced/commands/OMG:ship.md +46 -0
- package/plugins/advanced/plugin.json +96 -0
- package/plugins/core/plugin.json +82 -0
- package/pytest.ini +5 -0
- package/registry/__init__.py +1 -0
- package/registry/verify_artifact.py +90 -0
- package/rules/contextual/architect-mode.md +9 -0
- package/rules/contextual/big-picture.md +20 -0
- package/rules/contextual/code-hygiene.md +26 -0
- package/rules/contextual/context-management.md +19 -0
- package/rules/contextual/context-minimization.md +32 -0
- package/rules/contextual/ddd-sdd.md +28 -0
- package/rules/contextual/dependency-safety.md +16 -0
- package/rules/contextual/doc-check.md +13 -0
- package/rules/contextual/implement-mode.md +9 -0
- package/rules/contextual/infra-safety.md +14 -0
- package/rules/contextual/outside-in.md +13 -0
- package/rules/contextual/persistent-mode.md +24 -0
- package/rules/contextual/research-mode.md +9 -0
- package/rules/contextual/security-domains.md +25 -0
- package/rules/contextual/vision-detection.md +27 -0
- package/rules/contextual/web-search.md +25 -0
- package/rules/contextual/write-verify.md +23 -0
- package/rules/core/00-truth.md +20 -0
- package/rules/core/01-surgical.md +19 -0
- package/rules/core/02-circuit-breaker.md +22 -0
- package/rules/core/03-ensemble.md +28 -0
- package/rules/core/04-testing.md +30 -0
- 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/business_workflow.py +220 -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/omc_compat.py +7 -0
- package/runtime/omc_contract_snapshot.json +916 -0
- package/runtime/omg_compat_contract_snapshot.json +916 -0
- package/runtime/subagent_dispatcher.py +362 -0
- package/runtime/team_router.py +838 -0
- package/scripts/check-omc-contract-snapshot.py +12 -0
- package/scripts/check-omg-compat-contract-snapshot.py +137 -0
- package/scripts/check-omg-standalone-clean.py +102 -0
- package/scripts/legacy_to_omg_migrate.py +29 -0
- package/scripts/migrate-omc.py +464 -0
- package/scripts/omc_to_omg_migrate.py +12 -0
- package/scripts/omg.py +493 -0
- package/scripts/settings-merge.py +224 -0
- package/scripts/verify-no-omc.sh +5 -0
- package/scripts/verify-standalone.sh +21 -0
- package/templates/idea.yml +30 -0
- package/templates/policy.yaml +15 -0
- package/templates/profile.yaml +25 -0
- package/templates/runtime.yaml +12 -0
- package/templates/working-memory.md +17 -0
- 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 +268 -0
- package/tools/commit_splitter.py +361 -0
- package/tools/config_discovery.py +151 -0
- package/tools/config_merger.py +449 -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/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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Outside-In — Debug from User's Perspective
|
|
2
|
+
|
|
3
|
+
**When:** Debugging, investigating issues, or implementing features.
|
|
4
|
+
|
|
5
|
+
**3 Questions (always ask in this order):**
|
|
6
|
+
1. **User sees:** What does the user experience? What error/behavior?
|
|
7
|
+
2. **System view:** Where in the architecture does this happen? What's the flow?
|
|
8
|
+
3. **Code view:** What specific code is responsible? What does it do wrong?
|
|
9
|
+
|
|
10
|
+
**Fix from outside in:** Start from the user-visible symptom, trace inward.
|
|
11
|
+
Don't start from code and guess what the user sees.
|
|
12
|
+
|
|
13
|
+
**Apply to features too:** "What will the user do? What will they see? Then: how to implement."
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Persistent Work Mode (ulw / ralph)
|
|
2
|
+
|
|
3
|
+
**When:** User says "ulw", "ultrawork", "ralph", "끝까지", "don't stop", "keep going", "until done", "finish everything"
|
|
4
|
+
|
|
5
|
+
**Behavior:**
|
|
6
|
+
- Do NOT stop after one subtask. Work through the ENTIRE task list.
|
|
7
|
+
- If a checklist exists (.omg/state/_checklist.md), complete ALL items.
|
|
8
|
+
- If blocked on one item, SKIP it (mark [!]) and continue to the next.
|
|
9
|
+
- Return to skipped items after completing others.
|
|
10
|
+
- Use /OMG:escalate codex for complex code tasks in parallel.
|
|
11
|
+
- Use /OMG:escalate gemini for UI/visual tasks.
|
|
12
|
+
- Verify each completed item before moving on (run tests, show output).
|
|
13
|
+
|
|
14
|
+
**Completion:**
|
|
15
|
+
Only stop when:
|
|
16
|
+
1. All checklist items are [x] or [!] (with explanation for skipped)
|
|
17
|
+
2. All tests pass
|
|
18
|
+
3. Build succeeds
|
|
19
|
+
4. A completion summary is provided
|
|
20
|
+
|
|
21
|
+
**Anti-patterns:**
|
|
22
|
+
- Don't stop after just one fix and ask "anything else?"
|
|
23
|
+
- Don't skip verification to go faster
|
|
24
|
+
- Don't modify test expectations instead of fixing source code
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Research Mode
|
|
2
|
+
|
|
3
|
+
When in research mode:
|
|
4
|
+
- Prioritize reading and understanding over writing code
|
|
5
|
+
- Use web_search for current information, library docs, best practices
|
|
6
|
+
- Synthesize findings into clear summaries with sources
|
|
7
|
+
- Do NOT modify code unless explicitly asked
|
|
8
|
+
- Report findings with confidence levels (confirmed/likely/uncertain)
|
|
9
|
+
- Suggest next steps after research is complete
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Security-Critical Domains
|
|
2
|
+
|
|
3
|
+
**When:** Touching auth, payment, database, user-data, or privacy-related code.
|
|
4
|
+
|
|
5
|
+
**Detection signals:** File paths or content containing: auth, login, signup, session, token, password, payment, billing, checkout, stripe, database, migration, schema, user, profile, PII, GDPR, encryption, certificate.
|
|
6
|
+
|
|
7
|
+
**Required actions:**
|
|
8
|
+
1. Before making changes: Read the ENTIRE file, not just the target function. Security bugs hide in adjacent code.
|
|
9
|
+
2. Check auth flow end-to-end: login → session creation → token validation → permission check → logout/expiry.
|
|
10
|
+
3. Never hardcode: API keys, secrets, tokens, connection strings, passwords. Use env vars or secret manager.
|
|
11
|
+
4. Validate all inputs: SQL injection, XSS, command injection, path traversal — check at EVERY entry point.
|
|
12
|
+
5. After changes: Request `/OMG:escalate codex "deep security review of [file]: auth flow, injection, privilege escalation"`.
|
|
13
|
+
6. Payment code: PCI-DSS awareness — no raw card numbers in logs, no sensitive data in URLs, encrypt at rest.
|
|
14
|
+
7. Database code: Parameterized queries ONLY. No string concatenation for SQL. Check migration rollback safety.
|
|
15
|
+
|
|
16
|
+
**URI hardening checklist (frontend + backend):**
|
|
17
|
+
- HTTPS-only enforcement (no mixed content)
|
|
18
|
+
- CORS whitelist (not wildcard `*` in production)
|
|
19
|
+
- CSP headers configured
|
|
20
|
+
- Rate limiting on auth/payment endpoints
|
|
21
|
+
- Input sanitization before DB/template rendering
|
|
22
|
+
- No sensitive data in URL parameters (use POST body or headers)
|
|
23
|
+
- Redirect URLs validated against whitelist (open redirect prevention)
|
|
24
|
+
|
|
25
|
+
**Evidence:** After touching security-critical code, you MUST run the security check AND note it in your completion message. Saying "looks fine" without verification is unacceptable.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Vision / Screenshot Auto-Detection
|
|
2
|
+
|
|
3
|
+
**When:** User mentions screenshots, visual bugs, images, UI comparison, or attaches media.
|
|
4
|
+
|
|
5
|
+
**Detection signals:**
|
|
6
|
+
- "screenshot", "screen", "look at this", "attached image", "visual bug"
|
|
7
|
+
- "looks wrong", "looks broken", "compare before/after"
|
|
8
|
+
- Korean: "스크린샷", "캡처", "화면", "이미지", "보여"
|
|
9
|
+
- User attaches PNG/JPG/GIF files
|
|
10
|
+
|
|
11
|
+
**Actions in Claude Code CLI:**
|
|
12
|
+
1. If screenshot capability is available, capture the current UI state
|
|
13
|
+
2. For visual bugs: capture BEFORE making changes
|
|
14
|
+
3. After fix: capture AFTER to show comparison
|
|
15
|
+
4. For UI review: /OMG:escalate gemini with the screenshot for visual analysis
|
|
16
|
+
|
|
17
|
+
**Actions when images are attached:**
|
|
18
|
+
1. Analyze the image content for context
|
|
19
|
+
2. If it shows a UI: identify components, layout, colors
|
|
20
|
+
3. If it shows an error: extract the error message and debug
|
|
21
|
+
4. If it shows a design mockup: use as reference for implementation
|
|
22
|
+
|
|
23
|
+
**Integration with Gemini:**
|
|
24
|
+
Gemini excels at visual/design tasks. When vision context is detected:
|
|
25
|
+
```
|
|
26
|
+
/OMG:escalate gemini "Analyze this UI: [description]. Check: layout, accessibility, responsive behavior, visual consistency."
|
|
27
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Web Search Integration
|
|
2
|
+
|
|
3
|
+
**When:** User asks about current docs, latest API changes, version compatibility, or "look up" / "search for" / "find" something.
|
|
4
|
+
|
|
5
|
+
**Detection signals:**
|
|
6
|
+
- "search", "look up", "find", "latest", "current version", "docs", "documentation"
|
|
7
|
+
- "how to", "best practice" + unfamiliar technology
|
|
8
|
+
- Korean: "검색", "찾아", "최신", "현재", "문서", "공식"
|
|
9
|
+
|
|
10
|
+
**When to suggest web_search:**
|
|
11
|
+
- Unknown API or library version compatibility
|
|
12
|
+
- Current best practices for a rapidly evolving tool
|
|
13
|
+
- Error messages that don't match known patterns
|
|
14
|
+
- Checking if a dependency is maintained/deprecated
|
|
15
|
+
|
|
16
|
+
**How to use:**
|
|
17
|
+
- `/OMG:escalate codex "search for [topic] and summarize findings"`
|
|
18
|
+
- Direct web_search tool if available in the environment
|
|
19
|
+
- Use `web_search` first for discovery, then use `chrome-devtools` MCP to validate findings on live pages when browser verification is needed
|
|
20
|
+
- Check package registry (npm, PyPI) for version info
|
|
21
|
+
|
|
22
|
+
**When NOT to search:**
|
|
23
|
+
- Well-known, stable patterns (basic SQL, HTML, CSS fundamentals)
|
|
24
|
+
- Information already in .omg/knowledge/
|
|
25
|
+
- When the user hasn't asked and you already know the answer
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Write/Edit Verification Rule
|
|
2
|
+
|
|
3
|
+
When any file write or edit operation shows an error, warning, or hook error:
|
|
4
|
+
|
|
5
|
+
1. **NEVER claim success** without reading the file to verify changes are present
|
|
6
|
+
2. **Hook errors from external plugins** (e.g. security_reminder_hook.py) are warnings — the write may have succeeded. READ the file to check.
|
|
7
|
+
3. **"Error editing file"** means the Edit tool failed. Use an alternative:
|
|
8
|
+
- Try `Write` tool (creates new file)
|
|
9
|
+
- Try Bash: `cat > path/to/file << 'EOF'\n[content]\nEOF`
|
|
10
|
+
- Try Bash: `tee path/to/file << 'EOF'\n[content]\nEOF`
|
|
11
|
+
4. **"Error writing file"** (file already exists) — use `Edit` or Bash heredoc
|
|
12
|
+
5. After ANY retry, READ the file again to confirm
|
|
13
|
+
|
|
14
|
+
## Common Hook Error Pattern
|
|
15
|
+
```
|
|
16
|
+
Error: PreToolUse:Write hook error: [python3 .../security_reminder_hook.py]: ⚠️ Security Warning: ...
|
|
17
|
+
```
|
|
18
|
+
This means an external hook emitted a warning. The file write likely succeeded.
|
|
19
|
+
**Action:** Read the file to verify, then continue. Do NOT retry blindly.
|
|
20
|
+
|
|
21
|
+
## Anti-pattern: False Success
|
|
22
|
+
❌ "I've updated the file successfully" (without reading it)
|
|
23
|
+
✅ "Let me verify the changes were applied..." → [Read file] → "Confirmed, the changes are in place."
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Rule 00 — Truth & Evidence
|
|
2
|
+
|
|
3
|
+
NEVER claim a state you haven't verified. Period.
|
|
4
|
+
|
|
5
|
+
**Before saying "done/fixed/works/passes":**
|
|
6
|
+
1. Run the verification command
|
|
7
|
+
2. Check exit code = 0
|
|
8
|
+
3. Include evidence in your report
|
|
9
|
+
|
|
10
|
+
**Report format (every completion):**
|
|
11
|
+
- **Verified:** [commands run + exit codes]
|
|
12
|
+
- **Unverified:** [what couldn't be tested + why]
|
|
13
|
+
- **Assumptions:** [what you assumed without checking]
|
|
14
|
+
|
|
15
|
+
**If tests not run:** Say "Tests: NOT RUN (reason: ...)"
|
|
16
|
+
**If tests fail:** Show failing command + output + plan to fix
|
|
17
|
+
|
|
18
|
+
Forbidden without evidence: "done", "LGTM", "fixed", "works now", "tests passed"
|
|
19
|
+
|
|
20
|
+
> Enforced: stop-gate.py checks evidence. tool-ledger.py logs tool calls.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Rule 01 — Surgical Changes & Active Planning
|
|
2
|
+
|
|
3
|
+
## Change Budgets
|
|
4
|
+
- **Bugfix / small:** ≤3 files OR ≤120 LOC
|
|
5
|
+
- **Medium:** ≤8 files OR ≤400 LOC (set CHANGE_BUDGET=medium)
|
|
6
|
+
- **Large:** explicit justification required
|
|
7
|
+
|
|
8
|
+
## Refactor Ladder (smallest safe step first)
|
|
9
|
+
1. Minimal fix in place
|
|
10
|
+
2. Local refactor in same module
|
|
11
|
+
3. Extract helper only if reused ≥2 places
|
|
12
|
+
4. Cross-module refactor only with plan approval
|
|
13
|
+
|
|
14
|
+
## Active Planning
|
|
15
|
+
For 3+ file changes: create .omg/state/_plan.md + _checklist.md BEFORE coding.
|
|
16
|
+
Mark [x] immediately as steps complete. Update plan when approach changes.
|
|
17
|
+
If stuck 2x: STOP. Try different approach or /OMG:escalate.
|
|
18
|
+
|
|
19
|
+
> Enforced: stop-gate.py checks diff budget. circuit-breaker.py catches loops.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Rule 02 — Circuit Breaker & Collaborative Solving
|
|
2
|
+
|
|
3
|
+
## 2-Strike Rule
|
|
4
|
+
Same approach fails twice → STOP. Don't retry with slight variation.
|
|
5
|
+
|
|
6
|
+
Options:
|
|
7
|
+
1. Fundamentally different approach
|
|
8
|
+
2. /OMG:escalate codex (for deep debugging)
|
|
9
|
+
3. /OMG:escalate gemini (for UI/visual issues)
|
|
10
|
+
4. Ask the user
|
|
11
|
+
|
|
12
|
+
## Anti-Patterns (NEVER)
|
|
13
|
+
- **Bulldozer:** Same approach with slight variation → fails → retry harder
|
|
14
|
+
- **Lone Wolf:** 10 failed attempts before asking for help
|
|
15
|
+
- **Assumer:** Build [X] without confirming user wants [X]
|
|
16
|
+
- **Force-Fixer:** Immediately try to fix without understanding root cause
|
|
17
|
+
|
|
18
|
+
## Auto-Escalation
|
|
19
|
+
After 3 failures: circuit-breaker.py suggests /OMG:escalate with specific context.
|
|
20
|
+
After 5 failures: HARD BLOCK. Must escalate or get user input.
|
|
21
|
+
|
|
22
|
+
> Enforced: circuit-breaker.py tracks patterns + auto-escalates.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Rule 03 — Ensemble Collaboration
|
|
2
|
+
|
|
3
|
+
## Who Does What
|
|
4
|
+
- **Claude:** Orchestration, synthesis, integration, user communication
|
|
5
|
+
- **Codex:** Backend logic, security audit, root cause, algorithms, deep debugging
|
|
6
|
+
- **Gemini:** UI/UX review, visual comparison, accessibility, responsive design
|
|
7
|
+
|
|
8
|
+
## When to Delegate (DO IT, don't just think about it)
|
|
9
|
+
- Backend bug persists after 2 attempts → /OMG:escalate codex
|
|
10
|
+
- Security/auth/crypto involved → /OMG:escalate codex
|
|
11
|
+
- UI/visual change made → /OMG:escalate gemini
|
|
12
|
+
- Change spans frontend + backend → /OMG:ccg (tri-model)
|
|
13
|
+
- Stuck on anything for 3+ attempts → /OMG:escalate to relevant model
|
|
14
|
+
|
|
15
|
+
## Auto-Detection
|
|
16
|
+
prompt-enhancer.py detects keywords and suggests the right model.
|
|
17
|
+
circuit-breaker.py auto-suggests escalation after failures.
|
|
18
|
+
|
|
19
|
+
## Plugins & MCPs
|
|
20
|
+
- Installed plugins: USE them (they're installed for a reason)
|
|
21
|
+
- Available MCPs: SUGGEST with reasoning, wait for user confirmation
|
|
22
|
+
- Context7 (if available): Use for up-to-date library docs
|
|
23
|
+
|
|
24
|
+
## Natural Communication
|
|
25
|
+
Say: "This touches auth — let me get Codex to check the security."
|
|
26
|
+
NOT: "Invoking cross-model review protocol for backend analysis."
|
|
27
|
+
|
|
28
|
+
> Enforced: prompt-enhancer.py + session-start.py detect available tools.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Rule 04 — User-Journey Testing
|
|
2
|
+
|
|
3
|
+
## The Standard: Test What USERS Need
|
|
4
|
+
|
|
5
|
+
Don't write boilerplate. Ask:
|
|
6
|
+
1. What does the user expect to happen?
|
|
7
|
+
2. What could go wrong for the user?
|
|
8
|
+
3. What edge cases would a real user hit?
|
|
9
|
+
|
|
10
|
+
Then write tests for THOSE scenarios.
|
|
11
|
+
|
|
12
|
+
## Test Categories (consider all, run what applies)
|
|
13
|
+
- **Happy path:** The main user flow works
|
|
14
|
+
- **Error handling:** Bad input, unauthorized, network failure, timeout
|
|
15
|
+
- **Edge cases:** Empty, null, max length, concurrent, boundary values
|
|
16
|
+
- **Regression:** Existing behavior unchanged after this change
|
|
17
|
+
- **Integration:** Components work together correctly
|
|
18
|
+
|
|
19
|
+
## Forbidden Patterns
|
|
20
|
+
- assert True / expect(true).toBe(true)
|
|
21
|
+
- Only testing that functions exist (typeof checks)
|
|
22
|
+
- Mocking the thing you're testing
|
|
23
|
+
- 5+ tests but no error/edge cases
|
|
24
|
+
|
|
25
|
+
## Quality Gate
|
|
26
|
+
Every change runs: format → lint → typecheck (if typed) → test
|
|
27
|
+
If quality-gate.json exists, quality-runner.py enforces this.
|
|
28
|
+
|
|
29
|
+
> Enforced: test-validator.py catches fake/boilerplate tests.
|
|
30
|
+
> quality-runner.py runs QA commands.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Runtime package for OMG."""
|
|
2
|
+
|
|
3
|
+
from .compat import (
|
|
4
|
+
build_compat_gap_report,
|
|
5
|
+
build_omc_gap_report,
|
|
6
|
+
dispatch_compat_skill,
|
|
7
|
+
dispatch_omc_skill,
|
|
8
|
+
get_compat_skill_contract,
|
|
9
|
+
get_omc_skill_contract,
|
|
10
|
+
list_compat_skill_contracts,
|
|
11
|
+
list_compat_skills,
|
|
12
|
+
list_omc_skill_contracts,
|
|
13
|
+
list_omc_skills,
|
|
14
|
+
)
|
|
15
|
+
from .ecosystem import ecosystem_status, list_ecosystem_repos, resolve_ecosystem_selection, sync_ecosystem_repos
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"build_compat_gap_report",
|
|
19
|
+
"build_omc_gap_report",
|
|
20
|
+
"dispatch_compat_skill",
|
|
21
|
+
"dispatch_omc_skill",
|
|
22
|
+
"get_compat_skill_contract",
|
|
23
|
+
"get_omc_skill_contract",
|
|
24
|
+
"list_compat_skill_contracts",
|
|
25
|
+
"list_compat_skills",
|
|
26
|
+
"list_omc_skill_contracts",
|
|
27
|
+
"list_omc_skills",
|
|
28
|
+
"ecosystem_status",
|
|
29
|
+
"list_ecosystem_repos",
|
|
30
|
+
"resolve_ecosystem_selection",
|
|
31
|
+
"sync_ecosystem_repos",
|
|
32
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Runtime adapters for OMG v1."""
|
|
2
|
+
|
|
3
|
+
from .claude import ClaudeAdapter
|
|
4
|
+
from .gpt import GPTAdapter
|
|
5
|
+
from .local import LocalAdapter
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_adapters():
|
|
9
|
+
return {
|
|
10
|
+
"claude": ClaudeAdapter(),
|
|
11
|
+
"gpt": GPTAdapter(),
|
|
12
|
+
"local": LocalAdapter(),
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Claude runtime adapter (v1 stub)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from datetime import datetime, timezone
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ClaudeAdapter:
|
|
9
|
+
runtime = "claude"
|
|
10
|
+
|
|
11
|
+
def plan(self, idea: dict[str, Any]) -> dict[str, Any]:
|
|
12
|
+
goal = str(idea.get("goal", "")).strip() or "unspecified-goal"
|
|
13
|
+
return {
|
|
14
|
+
"runtime": self.runtime,
|
|
15
|
+
"phase": "plan",
|
|
16
|
+
"status": "planned",
|
|
17
|
+
"goal": goal,
|
|
18
|
+
"steps": [
|
|
19
|
+
"analyze-goal",
|
|
20
|
+
"generate-plan",
|
|
21
|
+
"emit-checklist",
|
|
22
|
+
],
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def execute(self, plan: dict[str, Any]) -> dict[str, Any]:
|
|
26
|
+
return {
|
|
27
|
+
"runtime": self.runtime,
|
|
28
|
+
"phase": "execute",
|
|
29
|
+
"status": "executed",
|
|
30
|
+
"operations": [
|
|
31
|
+
"apply-plan",
|
|
32
|
+
"collect-diff",
|
|
33
|
+
],
|
|
34
|
+
"errors": [],
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def verify(self, execution_result: dict[str, Any]) -> dict[str, Any]:
|
|
38
|
+
return {
|
|
39
|
+
"runtime": self.runtime,
|
|
40
|
+
"phase": "verify",
|
|
41
|
+
"status": "verified",
|
|
42
|
+
"ok": True,
|
|
43
|
+
"checks": [
|
|
44
|
+
{"name": "tests", "passed": True},
|
|
45
|
+
{"name": "security", "passed": True},
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
def collect_evidence(self, verify_result: dict[str, Any]) -> dict[str, Any]:
|
|
50
|
+
return {
|
|
51
|
+
"runtime": self.runtime,
|
|
52
|
+
"phase": "evidence",
|
|
53
|
+
"status": "collected",
|
|
54
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
55
|
+
"tests": verify_result.get("checks", []),
|
|
56
|
+
"security_scans": [],
|
|
57
|
+
"diff_summary": {},
|
|
58
|
+
"reproducibility": {"seed": "deterministic"},
|
|
59
|
+
"unresolved_risks": [],
|
|
60
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""GPT runtime adapter (v1 stub)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from datetime import datetime, timezone
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GPTAdapter:
|
|
9
|
+
runtime = "gpt"
|
|
10
|
+
|
|
11
|
+
def plan(self, idea: dict[str, Any]) -> dict[str, Any]:
|
|
12
|
+
goal = str(idea.get("goal", "")).strip() or "unspecified-goal"
|
|
13
|
+
return {
|
|
14
|
+
"runtime": self.runtime,
|
|
15
|
+
"phase": "plan",
|
|
16
|
+
"status": "planned",
|
|
17
|
+
"goal": goal,
|
|
18
|
+
"steps": ["analyze-goal", "generate-plan", "emit-checklist"],
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def execute(self, plan: dict[str, Any]) -> dict[str, Any]:
|
|
22
|
+
return {
|
|
23
|
+
"runtime": self.runtime,
|
|
24
|
+
"phase": "execute",
|
|
25
|
+
"status": "executed",
|
|
26
|
+
"operations": ["apply-plan", "collect-diff"],
|
|
27
|
+
"errors": [],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def verify(self, execution_result: dict[str, Any]) -> dict[str, Any]:
|
|
31
|
+
return {
|
|
32
|
+
"runtime": self.runtime,
|
|
33
|
+
"phase": "verify",
|
|
34
|
+
"status": "verified",
|
|
35
|
+
"ok": True,
|
|
36
|
+
"checks": [
|
|
37
|
+
{"name": "tests", "passed": True},
|
|
38
|
+
{"name": "security", "passed": True},
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
def collect_evidence(self, verify_result: dict[str, Any]) -> dict[str, Any]:
|
|
43
|
+
return {
|
|
44
|
+
"runtime": self.runtime,
|
|
45
|
+
"phase": "evidence",
|
|
46
|
+
"status": "collected",
|
|
47
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
48
|
+
"tests": verify_result.get("checks", []),
|
|
49
|
+
"security_scans": [],
|
|
50
|
+
"diff_summary": {},
|
|
51
|
+
"reproducibility": {"seed": "deterministic"},
|
|
52
|
+
"unresolved_risks": [],
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Local model runtime adapter (v1 stub)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from datetime import datetime, timezone
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LocalAdapter:
|
|
9
|
+
runtime = "local"
|
|
10
|
+
|
|
11
|
+
def plan(self, idea: dict[str, Any]) -> dict[str, Any]:
|
|
12
|
+
goal = str(idea.get("goal", "")).strip() or "unspecified-goal"
|
|
13
|
+
return {
|
|
14
|
+
"runtime": self.runtime,
|
|
15
|
+
"phase": "plan",
|
|
16
|
+
"status": "planned",
|
|
17
|
+
"goal": goal,
|
|
18
|
+
"steps": ["analyze-goal", "generate-plan", "emit-checklist"],
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def execute(self, plan: dict[str, Any]) -> dict[str, Any]:
|
|
22
|
+
return {
|
|
23
|
+
"runtime": self.runtime,
|
|
24
|
+
"phase": "execute",
|
|
25
|
+
"status": "executed",
|
|
26
|
+
"operations": ["apply-plan", "collect-diff"],
|
|
27
|
+
"errors": [],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def verify(self, execution_result: dict[str, Any]) -> dict[str, Any]:
|
|
31
|
+
return {
|
|
32
|
+
"runtime": self.runtime,
|
|
33
|
+
"phase": "verify",
|
|
34
|
+
"status": "verified",
|
|
35
|
+
"ok": True,
|
|
36
|
+
"checks": [
|
|
37
|
+
{"name": "tests", "passed": True},
|
|
38
|
+
{"name": "security", "passed": True},
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
def collect_evidence(self, verify_result: dict[str, Any]) -> dict[str, Any]:
|
|
43
|
+
return {
|
|
44
|
+
"runtime": self.runtime,
|
|
45
|
+
"phase": "evidence",
|
|
46
|
+
"status": "collected",
|
|
47
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
48
|
+
"tests": verify_result.get("checks", []),
|
|
49
|
+
"security_scans": [],
|
|
50
|
+
"diff_summary": {},
|
|
51
|
+
"reproducibility": {"seed": "deterministic"},
|
|
52
|
+
"unresolved_risks": [],
|
|
53
|
+
}
|