Skip to content

rlagycks/oh-my-forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License JavaScript Python Shell Markdown

English | 한국어

oh-my-forge

Every time an agent makes a mistake, change the system so that mistake cannot structurally happen again.

A customized Claude Code harness built on everything-claude-code. The core addition: an ontology-driven structural error prevention system that makes agent failures self-correcting at the harness level.


Why

everything-claude-code is a production-ready performance optimization system for AI agent harnesses — skills, instincts, memory persistence, continuous learning, and cross-harness compatibility (Claude Code, Codex, Cowork).

oh-my-forge keeps all of that and adds two things on top:

1. Ontology-driven structural error prevention

When an agent makes a mistake, the default response is to patch the prompt. That's fragile — the same mistake resurfaces in a new session with a fresh context. oh-my-forge treats mistakes as system signals: each error is classified, routed, and converted into a structural change (a new constraint in the ontology, or a failure instinct in the learning pipeline) so the same failure cannot happen again.

2. Ontology as a GPS for implementation

Claude Code plans. The ontology index (index.json) acts as a coordinate map — Claude reads only the domain index and one spec doc (~3K tokens) instead of exploring the full source tree, then generates a structured BRIEF. Implementation is handled by whichever engine is available:

  • Codex — if the codex CLI is installed (/codex-delegate)
  • Claude — automatic fallback when Codex is not installed (/claude-implement)

No configuration needed. The engine is auto-detected at plan time.

Three principles:

  1. Structural prevention over prompt patching — if a mistake can happen twice, the system is wrong, not the prompt
  2. Ontology + harness co-design — constraints, file coordinates, and specs are defined together
  3. Every session teaches the system — learning is automatic, not manual

Core Systems

1. Ontology (/.claude/ontology/)

The central knowledge graph. Maps logical domains to their files, constraints, and feature specs.

"domain_hooks": {
  "files": ["hooks/hooks.json", "scripts/hooks/..."],
  "spec": "docs/features/hooks.md",
  "constraints": [
    "블로킹 훅(PreToolUse, Stop)은 200ms 이하 — 네트워크 호출 금지",
    "신규 훅은 run-with-flags.js 래퍼를 통해서만 등록"
  ],
  "riskLevel": "high",
  "codexWorkerHint": "workspace-write"
}

Each domain_* entry defines:

  • files — which files belong to this domain
  • spec — the feature doc agents read to understand intent
  • constraints — rules agents must follow, with optional machine-checkable patterns (|pattern:keyword)
  • codexWorkerHint"read-only" or "workspace-write", tells Codex what role to take
  • riskLevel"high" triggers stronger warnings from the constraint guard

Schema: /.claude/ontology/_schema.json validates every domain entry.


2. Implementation Delegation (/commands/codex-delegate.md, /commands/claude-implement.md)

The ontology index doubles as a GPS for implementation. Instead of giving the implementer the full source tree, Claude reads only index.json and the relevant spec doc (~3K tokens total), then generates a structured BRIEF.

/plan  →  auto-detects engine  →  /codex-delegate   (Codex CLI installed)
                                →  /claude-implement  (no Codex, Claude-only)

Both commands use the same BRIEF format and produce the same HANDOFF output — the engine is interchangeable. The /plan skill enforces Codex-first delegation and guards against silent fallback loops (fixed in v1.10.x).

Engine detection (first match wins):

  1. CLAUDE_IMPL_ENGINE env var (claude or codex)
  2. Project .claude/settings.jsonimplementationEngine
  3. Global ~/.claude/settings.jsonimplementationEngine
  4. Auto-detect: codex binary absent → "claude"
  5. Default: "codex"

Project/global implementationEngine is operator configuration, not an in-session escape hatch. pre-write-edit-codex-guard pins the resolved engine per session and blocks direct .claude/settings.json engine flips unless ECC_BYPASS_CODEX_GUARD=1 is set explicitly.

When Codex is pinned, pre-bash-codex-guard also blocks shell-level writes to ontology-tracked files (cat >, heredoc, tee, cp/mv, inline Python/Node writes, in-place editors). Bash is no longer a silent bypass around the Edit/Write guard.

BRIEF
=====
DOMAIN: domain_hooks
WRITE: true
TASK: Add ECC_DISABLED_HOOKS support to the PostToolUse handler

FILES:
hooks/hooks.json
scripts/hooks/run-with-flags.js
...

CONSTRAINTS:
블로킹 훅(PreToolUse, Stop)은 200ms 이하 — 네트워크 호출 금지
신규 훅은 run-with-flags.js 래퍼를 통해서만 등록
...

HANDOFF FORMAT:
  RESULT: DONE | BLOCKED | PARTIAL
  FILES CHANGED: <list>
  TESTS: PASS | FAIL | SKIPPED
  SUMMARY: <one paragraph>

When to use which:

Condition Action
Codex CLI installed /codex-delegate domain_X "task" (or let /plan route automatically)
Claude-only subscription /claude-implement domain_X "task" (or let /plan route automatically)
Multi-domain task Decompose first, then delegate each domain
Architecture decision Handle in Claude directly — do not delegate
Security-sensitive code Implement, then /code-review

3. Constraint Guard (/scripts/hooks/constraint-guard.js)

A PreToolUse hook that runs before every Write, Edit, or MultiEdit.

When an agent edits a file in a tracked domain, this hook:

  1. Looks up which domain_* owns that file
  2. Extracts machine-checkable patterns from the domain's constraints[]
  3. Warns to stderr if the proposed content matches a violation pattern
// Constraint format
"No network calls in blocking hooks — 200ms limit|pattern:require('node-fetch')|pattern:require('axios')"
//                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//                                                  machine-checked patterns
  • Always exits 0 — never blocks tool execution
  • Session-scoped: each warning fires at most once per session
  • riskLevel: "high" domains get a stronger WARNING: HIGH RISK header

3. Error Capture (/commands/error-capture.md)

The /error-capture command is the entry point for the learning loop.

When an agent makes a mistake, run:

/error-capture "hooks script made a direct DB call"
/error-capture scripts/hooks/my-hook.js "added network call without knowing the 200ms limit"

The command:

  1. Classifies the error — ontology gap, harness gap, or both
  2. Routes to the right fix:
    • Ontology gap → adds a new constraint to index.json + updates the feature spec
    • Harness gap → creates a failure instinct file for continuous-learning-v2
  3. Outputs a structured report showing exactly why the same mistake won't happen again

4. Continuous Learning v2 (/skills/continuous-learning-v2/)

Extracts patterns from sessions and promotes them to instincts, then to structural constraints.

Pipeline:

session mistake
  → /error-capture
    → failure instinct (yaml)
      → evolve analysis
        → constraint candidate
          → /ontology-sync → domain constraints[]

Project Structure

oh-my-forge/
├── .claude/
│   └── ontology/
│       ├── _schema.json     # Domain entry validation schema
│       └── index.json       # Domain registry (files, constraints, specs)
├── agents/                  # Specialized subagents for delegation
├── commands/                # Slash commands
│   ├── error-capture.md     # /error-capture — structural error prevention
│   ├── ontology-sync.md     # /ontology-sync — sync ontology
│   ├── evolve.md            # /evolve — promote instincts to structure
│   └── ...
├── hooks/
│   └── hooks.json           # Hook registrations
├── rules/                   # Always-follow guidelines
├── scripts/
│   └── hooks/
│       └── constraint-guard.js  # PreToolUse constraint checker
├── skills/
│   ├── continuous-learning-v2/  # Session → instinct → constraint pipeline
│   └── ...                      # 140+ workflow skills
├── mcp-configs/             # MCP server configurations
└── docs/
    └── features/            # Feature specs linked from ontology domains

Commands

Error Prevention & Implementation Delegation

Command Description
/error-capture [description] Classify a mistake and create a structural fix
/ontology-sync Sync ontology index with current codebase
/evolve Promote failure instincts to skills, rules, or constraints
/codex-delegate <domain> <task> Delegate implementation to Codex using ontology GPS
/claude-implement <domain> <task> Same as above but implemented by Claude — no Codex required

Development

Command Description
/plan Implementation planning
/tdd Test-driven development workflow
/code-review Quality review
/build-fix Fix build errors
/e2e Generate and run E2E tests

Session & Learning

Command Description
/save-session Save current session state
/resume-session Resume a previous session
/learn Extract patterns from the current session
/skill-create Generate a skill from git history
/instinct-status Show current instinct summary

Orchestration

Command Description
/orchestrate Multi-agent task orchestration
/loop Run a command on a recurring interval
/qa-loop Continuous QA loop

Full command list: see /commands/ directory.


Quick Start

Option 1 — Install via plugin (recommended)

Inside any Claude Code session, run:

/plugin install rlagycks/oh-my-forge

Skills, commands, agents, and hooks are available immediately. No cloning or build step required.

Installs access to 36 agents, 144 skills, and 76 commands.

Category Count
Agents 36 agents
Skills 144 skills
Commands 76 commands

Option 2 — Manual install (for contributors or local customization)

git clone https://github.com/rlagycks/oh-my-forge.git
cd oh-my-forge
yarn install
node scripts/ecc.js install

Verify

After either install method, confirm the plugin is loaded:

/plugin list

oh-my-forge should appear in the list. You can then run any command:

/plan
/tdd
/error-capture "description of what went wrong"

Getting Started

Adding a Domain to the Ontology

  1. Edit .claude/ontology/index.json
  2. Add a domain_* entry following the schema
  3. Run validation:
    node scripts/ci/validate-ontology.js

Capturing an Agent Error

# After an agent makes a mistake
/error-capture "description of what went wrong"

# With file context
/error-capture path/to/file.js "what the agent did wrong here"

Privacy

oh-my-forge does not send local hook telemetry to a hosted analytics service, but it does persist some data locally under ~/.claude/ for workflow continuity:

  • session summaries and follow-up notes
  • token/cost metrics
  • optional redacted Bash command audit logs when ECC_ENABLE_BASH_COMMAND_LOG=1

Hook processing runs locally inside Claude Code. Network access can still occur when you opt into MCP servers or use tools that call external services.


Based on

everything-claude-code by Affaan Mustafa — MIT License


License

MIT © 2026 Hyochan Kim — see LICENSE

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors