27 Commits

Author SHA1 Message Date
Bellman
15799479ec fix: align persistent stop hook and tighten agent output contracts (#2653)
Co-authored-by: Codex Review <codex-review@example.com>
2026-04-16 10:23:07 +09:00
Codex Review
f0c59aca2f fix(context-bloat): eliminate three sources of repeated rule/skill injection (#2577)
Three independent bugs caused context window growth across turns:

Bug 1 – skill-injector fallback used an in-memory Map that reset on every
process spawn (UserPromptSubmit fires a new Node.js process each turn).
Fixed: fallback dedup state persisted to
.omc/state/skill-sessions-fallback.json with a 1-hour TTL.

Bug 2 – createRulesInjectorHook existed in
src/hooks/rules-injector/index.ts but was never wired into hooks.json.
Fixed: new scripts/post-tool-rules-injector.mjs added as a PostToolUse
hook that calls the injector and emits hookSpecificOutput.

Bug 3 – In a git worktree nested inside the parent repo, rules from the
parent could bleed in when cwd was the parent repo.
Fixed: processToolExecution calls findProjectRoot(filePath) — using the
accessed file's path, not cwd — so a .git FILE at the worktree root stops
the upward walk before reaching the parent repo.

Regression tests added in src/__tests__/context-bloat-2577.test.ts
(9 new tests; full suite 8106/8113 pass, no regressions).

Constraint: hooks.json pre-tool node path was patched machine-locally by OMC init; only our new PostToolUse entry is included here
Rejected: patching the existing hook commands in hooks.json | machine-local absolute path should not be committed to repo
Confidence: high
Scope-risk: narrow
Not-tested: skill-injector bridge path (file-based dedup already existed there); rules injector with non-alwaysApply glob patterns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:45:18 +00:00
Bellman
9a485d06c5 feat(wiki): add LLM Wiki knowledge layer (#2214)
* feat(wiki): add core wiki module with storage, ingest, query, and lint

Persistent markdown knowledge base (Karpathy's LLM Wiki concept) that
compounds project knowledge across sessions. Keyword-based search only.

- types.ts: WikiPage, frontmatter, config, and operation types
- storage.ts: file I/O with wiki-wide mutex, path traversal prevention,
  YAML frontmatter parsing with proper escape/unescape, atomic writes
- ingest.ts: append-merge strategy (never replaces content), cross-refs
- query.ts: keyword + tag search with relevance scoring and snippets
- lint.ts: health checks (orphans, stale, broken refs, contradictions)
- index.ts: public API barrel export

Constraint: NO vector embeddings — search is keyword-based only
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(wiki): add 7 MCP tool definitions for wiki operations

wiki_ingest, wiki_query, wiki_lint, wiki_add, wiki_list, wiki_read,
wiki_delete — with Zod schemas enforcing size limits on all inputs.

wiki_add delegates to ingestKnowledge for consistent page creation
and rejects overwrites (use wiki_ingest to merge instead).

Constraint: Content capped at 50KB, titles at 200 chars, 20 tags max
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(wiki): wire session hooks for auto-context and capture

SessionStart: inject wiki index into context, rebuild stale index,
feed project-memory into environment.md page.
SessionEnd: bounded append-only session log capture (3s timeout).
PreCompact: inject wiki summary for compaction survival.

Hook scripts follow existing .mjs pattern via hooks.json registration.

Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(wiki): add wiki skill for keyword-triggered access

SKILL.md provides the /wiki skill entry point with keyword detection
for "wiki", "wiki add", "wiki lint", "wiki query" patterns.

Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(wiki): register wiki tools in MCP server and keyword detector

- Add WIKI tool category to constants and DISABLE_TOOLS_GROUP_MAP
- Register wikiTools array in allTools with category tagging
- Add includeWiki filter to getOmcToolNames and test helper
- Add wiki keyword pattern to keyword-detector.mjs

Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(wiki): add wiki test suite and update integration test counts

- storage: 29 tests (frontmatter parsing, serialization roundtrip,
  path traversal prevention, YAML escaping, slug generation)
- ingest: 10 tests (create, merge, tag union, confidence, dedup)
- query: 9 tests (title/content/tag match, category filter, scoring)
- lint: 13 tests (orphan, stale, broken refs, contradictions, oversized)
- Update omc-tools-server counts (+7 wiki tools)
- Update skills counts (+1 wiki skill)

Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 17:17:40 +09:00
Bellman
def6ec1a75 fix(hooks): increase SessionEnd timeout and make notifications fire-and-forget (#1700) (#1701)
The SessionEnd hook had a 10s timeout which was too low — stdin read (5s
default) + notification dispatch + cleanup regularly exceeded it, causing
'Hook cancelled' on every exit.

Three changes:
- Increase hooks.json SessionEnd timeout from 10s to 30s (short-term fix)
- Reduce readStdin timeout to 1s for session-end (input is small)
- Make notifications and reply-listener cleanup fire-and-forget so they
  don't count against the hook timeout budget

Closes #1700

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 01:36:31 +09:00
Yeachan-Heo
7b4e61a0f3 fix(hooks): preserve Windows hook paths with spaces 2026-03-12 10:23:28 +00:00
Yeachan-Heo
bfc50e620c fix(hooks): unblock ExitPlanMode in high-context flows 2026-03-12 06:20:46 +00:00
Bellman
cc61a50fda fix(team): route team prompts correctly and guard context safety (#1006) (#1012) 2026-02-25 07:59:42 +09:00
Yeachan-Heo
ebfb6c717e fix(hooks): reduce readStdin timeout to prevent Stop hook race condition (closes #982) 2026-02-24 07:28:41 +00:00
Bellman
c94481ee85 fix(hooks): replace sh+find-node.sh with cross-platform node+run.cjs chain (#912)
Root fix for recurring Windows hook failures (#909, #899, #892, #869).

On Windows, `sh` resolves to a PE32+ binary (MSYS2/Git Bash) that the OS
refuses to execute in Claude Code's hook subprocess, producing
"cannot execute binary file: Exec format error".

**Changes:**
- `scripts/run.cjs`: new cross-platform CJS wrapper that re-invokes the
  target .mjs using `process.execPath`, eliminating the shell entirely.
- `hooks/hooks.json`: replace every `sh "…/find-node.sh" "…/X.mjs"` entry
  with `node "…/run.cjs" "…/X.mjs"` (plain `node` as portable template).
- `scripts/plugin-setup.mjs`: universal post-install patch (all platforms)
  replaces the leading `node` token with the absolute `process.execPath` so
  nvm/fnm users and Windows users both get the right binary without PATH
  discovery. Backward-compat Windows patch migrates old `sh find-node.sh`
  installs to the new `run.cjs` chain.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:00:11 +09:00
Yeachan-Heo
800890e691 fix(hooks): resolve node binary for nvm/fnm users (closes #892)
Node.js hooks fail silently for nvm/fnm users because claude Code invokes
hook commands in a non-interactive shell that does not source ~/.bashrc or
~/.zshrc, so bare `node` is not on PATH.

Changes:
- Add src/utils/resolve-node.ts with resolveNodeBinary() that probes
  process.execPath → which node → nvm paths → fnm paths → system paths
  and returns an absolute path (never bare 'node' when avoidable).
- Add scripts/find-node.sh, a POSIX shell wrapper that reads the stored
  nodeBinary from ~/.claude/.omc-config.json then falls back through the
  same priority chain; exits 0 on failure so hooks never block Claude Code.
- Update hooks/hooks.json to invoke all hook scripts via find-node.sh
  instead of bare `node`, using sh "${CLAUDE_PLUGIN_ROOT}/scripts/find-node.sh".
- Update installer/index.ts to use resolveNodeBinary() for the HUD
  statusLine command and to persist the detected path as nodeBinary in
  ~/.claude/.omc-config.json for use by find-node.sh at runtime.
- Update scripts/plugin-setup.mjs to use process.execPath for the HUD
  statusLine and to persist nodeBinary to .omc-config.json.
- Add nodeBinary?: string field to OMCConfig interface in auto-update.ts.
- Add src/__tests__/resolve-node.test.ts with 10 tests covering
  pickLatestVersion() and resolveNodeBinary() (all passing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 02:52:21 +00:00
Bellman
b2afd08c5d fix(hooks): dedup plugin hooks, remove ~/.claude/hooks installer path (#793)
- Add scripts/post-tool-use-failure.mjs with static ESM imports (from template)
- Add scripts/code-simplifier.mjs with static ESM imports (from template)
- Add scripts/lib/atomic-write.mjs (mirrors templates/hooks/lib/atomic-write.mjs)
- Add PostToolUseFailure hook entry to hooks/hooks.json
- Add code-simplifier as third Stop hook entry in hooks/hooks.json
- Remove getHookScripts() calls that wrote scripts to ~/.claude/hooks/
- Remove getHooksSettingsConfig() call that wrote hook entries to settings.json
- Add migration: clean up legacy /.claude/hooks/ entries from settings.json
- Mark getHooksSettingsConfig() and getHookScripts() as @deprecated in hooks.ts

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 22:21:10 +09:00
Bellman
c399f5dac8 Merge pull request #779 from 0xarkstar/feat/context-safety
feat(hooks): add context safety system with threshold blocking
2026-02-20 15:02:53 +09:00
0xarkstar
b4dcfabdc0 feat(hooks): automated deliverable verification gates
Add a SubagentStop hook that verifies team agents produced their
expected deliverables before the pipeline transitions to the next stage.

- scripts/verify-deliverables.mjs: SubagentStop hook that checks file
  existence, minimum size, required sections, and required patterns
  (e.g., PASS/FAIL verdict in QA reports). Advisory only — warns via
  additionalContext but never blocks agent shutdown.

- templates/deliverables.json: Default deliverable requirements per
  team pipeline stage (team-plan, team-prd, team-verify, etc.).
  Projects can override with .omc/deliverables.json.

- hooks/hooks.json: Register verify-deliverables.mjs in SubagentStop
  array after subagent-tracker.

The hook loads requirements from project config (.omc/deliverables.json)
first, falling back to OMC defaults. It detects the current stage from
team state (session-scoped with legacy fallback).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:32:34 +09:00
0xarkstar
c09778535e feat(hooks): add context safety system with threshold blocking
Add two new hooks to prevent context-related failures:

- context-safety.mjs (PreToolUse): Blocks TeamCreate and ExitPlanMode
  when context usage exceeds 55% (configurable via
  OMC_CONTEXT_SAFETY_THRESHOLD). Spawning teams at high context leads
  to unrecoverable extended-thinking loops.

- context-guard-stop.mjs (Stop): Suggests session refresh when context
  exceeds 75% (configurable via OMC_CONTEXT_GUARD_THRESHOLD). Includes
  retry guard (max 2 blocks per session) to prevent infinite loops.
  Never blocks context_limit or user-requested stops.

Both hooks follow OMC conventions: timeout-protected stdin via
lib/stdin.mjs, graceful error handling (never block on failure),
and valid JSON output.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:31:39 +09:00
Bellman
3d82f992a0 feat: Project Memory Hook with Compaction Resilience (#331)
Implements comprehensive project memory system that auto-detects and persists
project environment context, with focus on compaction resilience for user directives.

Features:
- Auto-detects languages, frameworks, package managers, build commands
- Persists to .omc/project-memory.json with 24h cache
- Incremental learning from tool usage (Bash, Read, Edit, Write, Glob, Grep)
- User directive detection and preservation ("only look at X", "always use Y")
- Hot path tracking for frequently accessed files/directories
- Directory structure mapping with purpose detection
- PreCompact hook ensures directives survive context compaction

Key Innovation: Solves sponsor pain point where user instructions get lost after
compaction by re-injecting directives via PreCompact hook.

Implementation:
- 9 new modules in src/hooks/project-memory/
- 3 hook scripts (SessionStart, PostToolUse, PreCompact)
- 44 passing tests with full coverage
- Integrated with existing contextCollector and hook system

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:46:38 +09:00
Yeachan-Heo
1f7a47dc75 fix: rename invalid 'Setup' hook event to 'SessionStart' (#320)
The 'Setup' hook event type is not recognized by Claude Code's hook system.
Moved Setup hooks into SessionStart where they belong.

Valid hook events: PreToolUse, PostToolUse, PostToolUseFailure, Notification,
UserPromptSubmit, SessionStart, SessionEnd, Stop, SubagentStart, SubagentStop,
PreCompact, PermissionRequest

Fixes #320
2026-02-02 14:06:53 +00:00
Yeachan-Heo
36f474e165 fix(hooks): add CJS version of persistent-mode for Windows Stop hook (#267)
On Windows, Claude Code's Stop hook runner uses the CJS loader which
cannot load .mjs files, causing MODULE_NOT_FOUND errors every session.

Create persistent-mode.cjs using require() syntax and update hooks.json
to reference it. The .mjs version is kept for backward compatibility.

Fixes #267

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:05:16 +00:00
Yeachan-Heo
58a9be2bd5 chore: remove dead .sh hook scripts, clean installer infrastructure
Remove all dead .sh hook scripts since the plugin system (v3.0.0+) uses
only .mjs scripts exclusively via hooks/hooks.json.

Deleted from hooks/:
- keyword-detector.sh, persistent-mode.sh, stop-continuation.sh, session-start.sh

Deleted from scripts/:
- install.sh (deprecated), keyword-detector.sh, persistent-mode.sh,
  stop-continuation.sh, pre-tool-enforcer.sh, post-tool-verifier.sh,
  claude-sisyphus.sh, sisyphus-aliases.sh

Cleaned src/installer/hooks.ts:
- Removed .sh template loading constants
- Removed HOOKS_SETTINGS_CONFIG_BASH
- Removed getHookScriptsBash() and deprecated exports
- Simplified shouldUseNodeHooks(), getHooksSettingsConfig()

Cleaned src/installer/index.ts:
- Removed bash/node branching logic
- Simplified hook installation to Node.js only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 07:08:10 +00:00
JunghwanNA
bef486f11e fix(subagent-tracker): replace CPU busy-wait loops with syncSleep and fix race condition (#149) (#159)
fix(subagent-tracker): replace CPU busy-wait loops with syncSleep and fix race condition, complete state path migration to .omc/state/
2026-01-27 23:23:32 +09:00
Yeachan-Heo
39d22866a7 feat(hooks): add async hook lifecycle modules for Claude Code integration
Implement 5 new hook modules for Claude Code's async hook lifecycle:

- SubagentStart/SubagentStop: Track active subagents with parent mode context
- PreCompact: Preserve critical state before context compaction
- Setup: Directory structure initialization and periodic maintenance
- PermissionRequest: Smart auto-approval for safe commands during active modes
- SessionEnd: Record metrics, cleanup transient state, export summaries

Wire all hooks into bridge.ts routing and hooks.json configuration.
Add standalone .mjs entry scripts for each hook type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 06:27:37 +00:00
Bellman
3a02feb187 v3.0.0 Release: Zero-Learning-Curve UX & oh-my-claudecode Rebrand
* feat: Add Sisyphus HUD statusline for multi-agent visualization

Implement a standalone HUD that displays orchestration state in Claude Code's
statusline:
- Ralph loop iteration tracking (ralph:3/10)
- Ultrawork mode badge (ultrawork, ultrawork-ralph)
- PRD story progress (US-002)
- Context window usage with threshold colors (ctx:67%)
- Active subagent count (agents:2)
- Background task tracking (bg:3/5)
- Todo completion progress (todos:2/5)

Key features:
- Parses Claude Code stdin JSON for context_window data
- Parses transcript JSONL for agents and todos
- Reads existing .sisyphus/*.json state files
- Color-coded thresholds (green->yellow->red)
- Three presets: minimal, focused, full
- Auto-installs during npm install
- /hud command for configuration

Files added: 14 new files in src/hud/
Files modified: bridge.ts (background task hooks), installer/index.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add Claudeception learned skills system

Implement a system for Claude to extract, store, and reuse learned skills
from conversation sessions. Skills are stored in YAML frontmatter format
and automatically injected into context when triggers match.

Features:
- Hybrid skill storage (user ~/.claude/skills/ + project .sisyphus/skills/)
- YAML frontmatter parsing for skill metadata
- Trigger-based skill matching and injection
- Quality gate validation for skill extraction
- Pattern detection for extractable moments (problem-solution, technique, etc.)
- Promotion from ralph-progress learnings to skills
- Configuration system with persistence
- /claudeception command for managing skills

New files:
- src/hooks/learned-skills/ (12 modules)
- scripts/skill-injector.mjs (UserPromptSubmit hook)
- src/__tests__/learned-skills/ (6 test files, 41 tests)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): Add type-coded agent visualization with model tier colors

Enhanced HUD agent display with multiple visualization formats for better parallel agent visibility.

- Single-character type codes (O=oracle, E=explore, S=sisyphus-junior, etc.)
- Model tier via case (Uppercase=Opus, lowercase=Sonnet/Haiku)
- Color-coded by tier (Magenta=Opus, Yellow=Sonnet, Green=Haiku)
- Duration indicators (<10s: none, 10-59s: (Xs), 1-9m: (Xm), ≥10m: !)
- Configurable formats: count, codes, codes-duration, detailed
- 44 new tests

* refactor: Rename claudeception to mnemosyne (goddess of memory)

Rename the learned skills module to use Greek mythology naming:
- Module: learned-skills -> mnemosyne
- Command: /claudeception -> /mnemosyne
- Exports: Claudeception* -> Mnemosyne*

Mnemosyne was the Titan goddess of memory in Greek mythology,
which fits perfectly for a system that remembers knowledge
from past sessions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: Bump version to 3.0.0-beta and update CHANGELOG

- Update package.json version to 3.0.0-beta
- Add comprehensive CHANGELOG entry for v3.0.0-beta:
  - Mnemosyne learned skills system
  - Sisyphus HUD statusline
  - 443 total tests
  - Breaking changes documented

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Prevent duplicate skills/plugins and add cancel commands

- Add isRunningAsPlugin() to detect Claude Code plugin context
- Skip file installation when CLAUDE_PLUGIN_ROOT is set (plugin mode)
- Update cancel-ralph to clear both local AND global state files
- Add cancel-ultrawork command for standalone ultrawork cancellation
- Add HUD agent type-coded visualization with model tier colors

Fixes duplicate agents/skills appearing when installed via both
npm global and Claude Code plugin marketplace.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(hud): Make wrapper script check development paths first

The HUD wrapper script now checks common development locations
before falling back to npm package import. This allows the HUD
to work during development when the package isn't published.

Development paths checked:
- ~/Workspace/oh-my-claude-sisyphus/dist/hud/index.js
- ~/workspace/oh-my-claude-sisyphus/dist/hud/index.js
- ~/projects/oh-my-claude-sisyphus/dist/hud/index.js
- ~/dev/oh-my-claude-sisyphus/dist/hud/index.js
- ~/code/oh-my-claude-sisyphus/dist/hud/index.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: Add plugin.json manifest for Claude Code plugin system

Enables installation as a Claude Code plugin instead of npm postinstall.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Add local plugin installation guide

Documents how to install oh-my-claude-sisyphus as a Claude Code plugin
from a local development directory using the marketplace system.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(installer): Always install HUD even in plugin mode

- Skip agent/command/hook file copying when running as plugin
- Still install HUD wrapper script and settings.json config
- Updated HUD wrapper to check plugin cache first
- Plugin mode is now the preferred installation method for 3.0.0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add mnemosyne.md command file for plugin mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor!: Plugin-only installation for 3.0.0

BREAKING CHANGE: Removed npm postinstall. Install via plugin only:
  claude plugin marketplace add /path/to/oh-my-claude-sisyphus
  claude plugin install oh-my-claude-sisyphus@oh-my-claude-sisyphus

- Removed postinstall script from package.json
- Added plugin postInstall hook for HUD setup
- Added all plugin assets to npm package files
- Created plugin-setup.mjs for automatic HUD configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): Add multi-line agent visualization

Add new 'multiline' format for agent display that renders each running
agent on its own line with tree characters for visual hierarchy.

- Add renderAgentsMultiLine() function with tree char output (├─, └─)
- Add agentsMaxLines config option to control max detail lines
- Update render.ts to compose header + detail lines
- Set multiline as default for focused/full presets
- Add 9 new tests for multiline format (110 HUD tests pass)

Example output:
[SISYPHUS] ralph:3/10 | ultrawork | agents:3 | todos:2/5
├─ O oracle       2m   analyzing architecture patterns...
├─ e explore     45s   searching for test files
└─ s sj-junior    1m   implementing validation logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add ralph-plan mode for iterative consensus planning

Adds new command that orchestrates Prometheus, Oracle, and Momus in an
iterative loop until all agents are satisfied with the plan quality.

Workflow: Prometheus plans → Oracle advises → Momus reviews → iterate
until Momus approves (OKAY verdict).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(hud): Keep background agents as running in transcript parser

Background agents return a tool_result immediately with "Async agent
launched" text, but this doesn't mean they're completed. The transcript
parser was incorrectly marking them as completed.

Now checks if tool_result content contains "Async agent launched" and
keeps those agents in 'running' status until actual completion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Address Oracle verification feedback for ralph-plan

- Add state tracking mechanism (.sisyphus/ralph-plan-state.json)
- Fix step numbering (merged Steps 5 and 6 into unified Step 5)
- Clarify Oracle invocation timing (conditional, with two scenarios)
- Add iteration observability output ([RALPH-PLAN Iteration N/5] logs)
- Document "direct planning mode" for Prometheus (bypasses interview)
- Add cancellation documentation
- Clarify quality gates are orchestrator-verified

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Final Oracle verification fixes for ralph-plan

- Update cancel-ralph to handle ralph-plan-state.json
- Add quality gate enforcement details (orchestrator responsibility)
- Document PLAN_READY signal convention for Prometheus integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(hud): Prefer dev paths over plugin cache in HUD wrapper

Dev paths now take priority so local development changes are picked up
immediately without being shadowed by old plugin cache versions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): Add /hud setup command for auto-installation

- Add `/hud setup` command to install/repair HUD statusline
- `/hud` now auto-detects missing HUD and guides setup
- Include bash script to find plugin-setup.mjs from cache or dev paths
- Update troubleshooting to reference /hud setup

Fixes issue where /plugin add doesn't run postInstall hook

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: HUD setup guidance and learned skills path

Session Start Hook:
- Add HUD installation check on session start
- Show guidance to run /hud setup if HUD not configured

Mnemosyne Learned Skills:
- Change user-level skills path from ~/.claude/skills/sisyphus-learned/
  to ~/.claude/commands/sisyphus-learned/
- Claude Code loads commands from ~/.claude/commands/, not skills/
- Update documentation in mnemosyne.md and installer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Mnemosyne skill matching and test isolation

Scoring Fix:
- Quality/usage scores now only apply when trigger/tag matches
- Prevents skills from matching purely on quality score

Test Isolation:
- finder.test.ts: Filter for project-scope candidates
- loader.test.ts: Filter for project-scope skills
- Tests now pass regardless of user-level skills present

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): show last activated skill in statusline

Enhances HUD visibility by tracking and displaying the last activated skill:

- types.ts: Add SkillInvocation interface, lastActivatedSkill to TranscriptData,
  lastSkill to HudRenderContext and HudElementConfig, enable in all presets
- transcript.ts: Parse Skill/proxy_Skill tool_use blocks from transcript
- skills.ts: Add renderLastSkill(), update renderSkills() with optional lastSkill,
  add duplicate detection (don't show skill:ultrawork when ultrawork is active)
- render.ts: Pass lastSkill to renderSkills(), handle standalone lastSkill mode
- index.ts: Pass transcriptData.lastActivatedSkill to render context
- hud.md: Update documentation with new skill:name element

HUD now shows: [SISYPHUS] ultrawork skill:prometheus | ctx:67% | ...

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(hud): detect background agent completion and sort freshest first

- Add background agent completion detection via TaskOutput results
  - Extract agentId from "Async agent launched" messages
  - Parse TaskOutput <status>completed</status> to mark agents done
  - Map background agent IDs to original tool_use_ids
- Sort agents by start time (freshest first, oldest last)
  - Add sortByFreshest() helper function
  - Apply to all agent render functions

Fixes issue where background agents accumulated time indefinitely.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): add rate limit display (5h and weekly usage)

Fetch rate limits from Anthropic OAuth API and display in statusline.
Based on jarrodwatts/claude-hud implementation.

- Add usage-api.ts: OAuth credential reading and API fetching
- Add limits.ts: Rate limit rendering with color thresholds
- Display format: 5h:X% wk:Y% with green/yellow/red colors
- 60s cache TTL to avoid API hammering
- Works with Pro/Max/Team subscriptions (not API users)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(skills): consolidate to single source of truth with SKILL.md files

- Migrate 7 builtin skills to bundled SKILL.md files (sisyphus, ralph-loop,
  ralph-init, analyze, deepsearch, prometheus, review)
- Rewrite skills.ts from 1158 lines of hardcoded content to 156 lines of
  dynamic loader that reads from skills/*/SKILL.md at runtime
- Add YAML frontmatter parsing for skill metadata (name, description, model,
  agent, argument-hint)
- Add skill caching with clearSkillsCache() for testing
- Update tests to expect 12 skills (was 10)
- Remove ~1000 lines of duplicate skill definitions

Skills are now maintained in one place (skills/*/SKILL.md) instead of being
duplicated between TypeScript and markdown files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: reduce large TypeScript files by 78% with dynamic loading

Replace inline string constants with dynamic file loading at runtime:

- installer/index.ts: 3324 → 525 lines (84% reduction)
  - Load agent definitions from /agents/*.md
  - Load command definitions from /commands/*.md
  - Load CLAUDE.md content from /docs/CLAUDE.md

- agents/definitions.ts: 1594 → 462 lines (71% reduction)
  - Import base agents from individual .ts files
  - Load tiered variant prompts from /agents/*.md at runtime

- installer/hooks.ts: 1679 → 478 lines (72% reduction)
  - Extract 10 hook scripts to /templates/hooks/
  - Load via loadTemplate() function at runtime

Additional changes:
- Add tools: field to all 11 base agent .md files
- Update tests for new file structure
- Add "types": ["node"] to tsconfig.json

Total: 6597 → 1465 lines (78% reduction, ~5100 lines removed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(agents): add explicit model routing for sub-agents

Claude Code doesn't auto-apply model field from agent frontmatter.
This hybrid fix ensures correct model routing:

- Add model hints to all agent descriptions (Haiku/Sonnet/Opus)
- Add explicit model= parameter to all Task calls in skills/commands
- Update TypeScript definitions with model hints

Agents updated: 11 base agents + 8 tiered variants
Files updated: 22 (agents, commands, skills, definitions.ts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(hud): add OpenCode-inspired UX elements and fix state bugs

New features:
- Context pressure warnings: "COMPRESS?" at 80%, "CRITICAL" at 85%
- Extended thinking indicator (cyan "thinking" when reasoning active)
- Session health indicator with duration and color-coded status
- New presets: 'opencode' and 'dense' configurations

Bug fixes:
- Clear pendingPermissionMap on each parse to prevent stale APPROVE?
- Add staleness detection for state files (ignore >2 hours old)
- Disable permissionStatus by default (heuristic unreliable)

New files:
- src/hud/elements/permission.ts
- src/hud/elements/thinking.ts
- src/hud/elements/session.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(mnemosyne): update skills directory path and enhance extraction docs

- Change USER_SKILLS_DIR from commands/sisyphus-learned to skills/sisyphus-learned
- Skills are now read by skill-injector.mjs hook instead of Claude Code commands
- Enhanced mnemosyne.md with quality gates, anti-patterns, and evaluation criteria
- Added detailed guidance on what makes a useful vs. generic skill

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(plugin): remove invalid skills array from marketplace schema

The skills field was causing "Invalid schema: plugins.0.skills: Invalid input"
validation error. Skills are auto-discovered via plugin.json glob pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: rebrand to oh-my-claudecode with skills-first architecture

- Rename plugin from oh-my-claude-sisyphus to oh-my-claudecode
- Migrate commands to skills/*/SKILL.md structure (auto-discovered)
- Update plugin.json to minimal schema (name, version, description, skills)
- Remove explicit hooks/agents declarations (auto-discovered)
- Update all agent references and documentation
- Fix plugin validation errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: update GitHub URLs to v3.0.0-beta branch temporarily

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: prepare v3.0.0 release with zero-learning-curve UX

BREAKING CHANGES:
- Package renamed from oh-my-claude-sisyphus to oh-my-claudecode
- All SISYPHUS_* env vars renamed to OMC_*
- Directory ~/.sisyphus → ~/.omc, .sisyphus → .omc
- Skills dir ~/.claude/skills/sisyphus-learned → omc-learned

Major changes:
- Rewrite README to < 130 lines (zero-learning-curve focus)
- Add magic keywords (ralph, ralplan, ulw, plan) for power users
- Deprecate install.sh in favor of plugin-only installation
- Add "Delegate Always" and "Learner Agent" guidance to docs
- Update all agent codes in HUD (O→A, s→x, sj→exec)
- Bump version to 3.0.0 stable
- Create comprehensive MIGRATION.md for 2.x users
- Archive old README to docs/FULL-README.md
- Add /omc-setup skill for first-time configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(readme): add oh-my-zsh philosophy tagline

"Some advanced users customize zsh for years - most of us just use oh-my-zsh.
Don't learn Claude Code. Just use OMC."

Also adds updated website assets with matching philosophy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: fix remaining version references to 3.0.0

- AGENTS.md: 3.0.0-beta → 3.0.0
- docs/LOCAL_PLUGIN_INSTALL.md: 3.0.0-beta → 3.0.0
- Regenerate package-lock.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:35:49 +09:00
Yeachan-Heo
962663164b feat: Add bash hook scripts and SessionStart hook for curl/plugin parity
- Add bash hook scripts to hooks/ directory (keyword-detector.sh,
  stop-continuation.sh, persistent-mode.sh, session-start.sh)
- Add SessionStart hook to hooks.json for plugin session restoration
- Add session-start.mjs Node.js script for plugin SessionStart hook
- Update /sisyphus-default to install bash scripts to ~/.claude/hooks/
  and fetch CLAUDE.md from GitHub
- Create docs/CLAUDE.md as canonical source for Sisyphus configuration
- Bump version to 2.0.5

This ensures plugin and curl installations work identically by:
1. Plugin uses hooks/hooks.json with Node.js scripts
2. Both installations can use ~/.claude/hooks/*.sh scripts
3. /sisyphus-default configures both systems

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 02:34:09 +00:00
Yeachan-Heo
691b5c8d71 fix: Add description to hooks.json for plugin system
The plugin hooks.json was missing the required 'description' field
that Claude Code plugin system expects.

Bump to v2.0.4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 02:20:59 +00:00
Bellman
fd80da7d3f fix: Windows support - use Node.js hooks for cross-platform compatibility (#31)
- Create Node.js versions of all hook scripts (.mjs files):
  - keyword-detector.mjs
  - pre-tool-enforcer.mjs
  - post-tool-verifier.mjs
  - persistent-mode.mjs
- Update hooks.json to use `node` instead of `bash` commands
- Add cross-platform binary detection (where vs which)
- Fix path quoting for Windows compatibility
- Bump version to 1.11.1

Closes #30

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:32:43 +09:00
Bellman
169413e181 feat: Add enhanced hook enforcement system (#24)
- Add PreToolUse hook (pre-tool-enforcer.sh) for injection before every tool
- Add PostToolUse hook (post-tool-verifier.sh) for verification after tools
- Enhance Stop hook (persistent-mode.sh) with build/test/git verification
- Add CLI wrapper (claude-sisyphus.sh) with --append-system-prompt
- Add shell aliases (sisyphus-aliases.sh) for easy activation

The enhanced hooks provide stronger Sisyphus behavior enforcement:
- PreToolUse: Contextual reminders before each tool execution
- PostToolUse: Verification prompts after tools, failure detection
- Stop: Additional verification requirements (build, tests, git, background tasks)
- CLI wrapper: Always appends core Sisyphus rules to system prompt

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 11:49:07 +09:00
CreatosInc
0442ff2291 Update hooks.json
Adjusted the format and added missing variables in order to correct the format of the hooks.json file. Without this adjustment Claude Code will error the plugin when attempting to use when installed with the following error. "" 2 errors:
   Failed to load hooks from /home/jessy/.claude/plugins/cache/oh-my-claude-sisyphus/oh-my-claude-sisyphus/1.10.3/hooks/hooks.json: [
     {
       "expected": "record",
       "code": "invalid_type",
       "path": [
         "hooks"
       ],
       "message": "Invalid input: expected record, received undefined"
     }
   ]
   → Check hooks.json file syntax and structure
   Failed to load hooks from /home/jessy/.claude/plugins/cache/oh-my-claude-sisyphus/oh-my-claude-sisyphus/1.10.3/hooks/hooks.json: [
     {
       "expected": "record",
       "code": "invalid_type",
       "path": [
         "hooks"
       ],
       "message": "Invalid input: expected record, received undefined"
     }
   ]
   → Check hooks.json file syntax and structure
2026-01-12 19:14:00 -05:00
Yeachan-Heo
ac12c5c001 feat: Add Claude Code plugin format support (closes #15)
Implemented full Claude Code plugin format support allowing installation
via `/plugin install` command. This restructures the project to be a
valid Claude Code plugin.

Changes:
- Added .claude-plugin/plugin.json manifest with metadata
- Created agents/ directory with 11 specialized subagent markdown files
- Created commands/ directory with 12 slash command markdown files
- Created skills/ directory with 3 skills (ultrawork, git-master, frontend-ui-ux)
- Added hooks/hooks.json for UserPromptSubmit and Stop hooks
- Added scripts/keyword-detector.sh for magic keyword detection
- Added scripts/stop-continuation.sh for todo continuation enforcement
- Updated README.md with plugin installation instructions

Plugin structure:
- .claude-plugin/plugin.json (manifest)
- agents/*.md (11 agents: oracle, librarian, explore, etc.)
- commands/*.md (12 commands: sisyphus, ultrawork, plan, etc.)
- skills/*/SKILL.md (3 skills)
- hooks/hooks.json (hook configuration)

Users can now install via:
- /plugin install oh-my-claude-sisyphus
- /plugin marketplace add Yeachan-Heo/oh-my-claude-sisyphus

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 04:21:48 +00:00