Unify omc setup and omc-setup skill into a single TypeScript pipeline #2605
pgagarinov
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
Nope that sounds dangerous. Merged that kind of PRs several time and completely fucked up the project, which tightens the automated system. Well-scoped PRs are welcomed. Anyways appreciate your contributions. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
The current setup surface has three independent code paths that have drifted apart:
omc setup(CLI) — callsinstall()directly, syncs agents/skills/hooks/CLAUDE.md. No MCP configuration, no teams config, no HUD config, no welcome message. Fast but incomplete./oh-my-claudecode:omc-setup(skill) — a 4-phase markdown-driven wizard that collects answers viaAskUserQuestion, then shells out to bash scripts (setup-claude-md.sh,setup-progress.sh) andclaude mcp add. Covers the full setup surface but is slow (LLM interprets ~200 lines of markdown per phase), fragile (bash scripts duplicate logic from the installer), and impossible to run non-interactively.Bash scripts (
scripts/setup-claude-md.sh,scripts/setup-progress.sh) — standalone implementations that duplicate logic fromsrc/installer/index.ts. They were the original source of truth but now lag behind the installer on edge cases (CLAUDE_CONFIG_DIR support, plugin-dir-mode, hook deduplication).Concrete pain points
Incomplete CLI install:
omc setupdoes not configure MCP servers, teams, HUD elements, or run the welcome/star flow. Users must run the skill separately to get a complete setup — but the skill takes 30-60s because the LLM re-interprets the phase markdown on every invocation.No non-interactive/preset mode: There is no way to run a complete setup non-interactively. CI pipelines, container images, and multi-machine fleet deployments cannot use the skill (it requires
AskUserQuestion) andomc setupalone leaves the profile incomplete. Users who set up OMC on multiple machines must answer the same 11 questions every time.Bash/TS drift:
setup-claude-md.sh(422 lines) reimplements CLAUDE.md merge logic that also exists ininstaller/index.ts. The two implementations handle edge cases differently (symlinks, empty files, encoding). Bug fixes in one don't propagate to the other.No state machine in TS: The setup-progress state machine (save/clear/resume/complete) lives only in bash. The skill shells out to
setup-progress.shfor every state transition, adding latency and making it impossible to test state transitions in vitest.No preset format: There is no declarative way to express "install with these choices" — every invocation requires either interactive answers or relies on hard-coded defaults scattered across bash scripts and skill markdown.
Proposed solution
Port the setup logic to a single TypeScript module at
src/setup/that serves as the canonical source of truth for bothomc setup(CLI) and/oh-my-claudecode:omc-setup(skill):omc setupon a TTY → interactive wizard (11 questions, readline-based, no LLM overhead)omc setupon a non-TTY → appliesSAFE_DEFAULTSpreset (complete setup, zero questions)omc setup --preset <file>→ non-interactive from a JSON preset file (fleet/CI use case)omc setup --infra-only→ today's bare behavior (escape hatch for existing callers)/oh-my-claudecode:omc-setup→ thin wrapper: collects answers →omc setup --build-preset→omc setup --presetThe bash scripts become thin shims that delegate to
omc setup --<flag>, preserving the positional-arg contract for any out-of-tree callers while eliminating the duplicated logic.Benefits
Scope
src/setup/module: state machine, CLAUDE.md merge, plugin-root resolution, options/preset parser, phase modules (1-4),runSetup()entry pointomc setupgains ~30 flags for phase selection, preset loading, and state machine opssetup-claude-md.shandsetup-progress.shrewritten as 30-line delegatorsomc-setup/SKILL.mdandmcp-setup/SKILL.mdbecome thin preset-builder wrappers--infra-onlyescape hatchI would like to submit a PR that addresses all these issues in one go. I've tried to submit PR a few times but automated system rejected it as being to large. The problem is that large refactoring changes like that are difficult to present as a sequence of small focused changes. That is why I opened this discussions- so that we could try to find a way to contribute to omc without me jumping through too many hoops trying to present a monolith big change as a series of incremental changes each of which doesn't give us a full implementation until all small PRs are merged. If possible, I would rather submit the change as a single PR that addresses the problem in one go.
All reactions