diff --git a/packages/omo-codex/plugin/components/comment-checker/test/fixtures/post-tool-use.json b/packages/omo-codex/plugin/components/comment-checker/test/fixtures/post-tool-use.json new file mode 100644 index 000000000..b1d4c0901 --- /dev/null +++ b/packages/omo-codex/plugin/components/comment-checker/test/fixtures/post-tool-use.json @@ -0,0 +1,15 @@ +{ + "session_id": "00000000-0000-0000-0000-000000000000", + "turn_id": "00000000-0000-0000-0000-000000000001", + "transcript_path": "/tmp/codex-comment-checker-transcript.jsonl", + "cwd": ".", + "hook_event_name": "PostToolUse", + "model": "gpt-5.5", + "permission_mode": "default", + "tool_name": "apply_patch", + "tool_input": { + "command": "*** Begin Patch\n*** Add File: src/example.ts\n+export const meaning = 42;\n*** End Patch\n" + }, + "tool_response": "Success. Updated files.", + "tool_use_id": "toolu_000000000000000000000000" +} diff --git a/packages/omo-codex/plugin/components/lsp/hooks/hooks.json b/packages/omo-codex/plugin/components/lsp/hooks/hooks.json new file mode 100644 index 000000000..2e8b75cb1 --- /dev/null +++ b/packages/omo-codex/plugin/components/lsp/hooks/hooks.json @@ -0,0 +1,17 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "^(apply_patch|Write|Edit|MultiEdit|multi_edit|write|edit|multiedit)$", + "hooks": [ + { + "type": "command", + "command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use", + "timeout": 60, + "statusMessage": "LazyCodex(0.2.0): Checking LSP Diagnostics" + } + ] + } + ] + } +} diff --git a/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md b/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md new file mode 100644 index 000000000..36be06844 --- /dev/null +++ b/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md @@ -0,0 +1,35 @@ +--- +name: lsp +description: Use when Codex needs language-server diagnostics, definitions, references, symbols, or rename safety checks in the current workspace. +--- + +# Codex LSP + +Call `lsp` MCP tools through the tool interface; `lsp.*`/`mcp__lsp__*` are tool-call names, not shell commands. + +## Tools + +- `lsp.status`: list configured, installed, missing, disabled, and active language servers. +- `lsp.diagnostics`: check one file or directory for LSP diagnostics. Prefer `severity: "error"` after edits. +- `lsp.goto_definition`: locate a symbol definition from file, line, and character. +- `lsp.find_references`: find usages of a symbol across the workspace. +- `lsp.symbols`: inspect document symbols or search workspace symbols. +- `lsp.prepare_rename`: check whether a rename is valid at a position. +- `lsp.rename`: apply a language-server workspace edit for a rename. + +## Config + +Project config lives at `.codex/lsp-client.json`; user config lives at `~/.codex/lsp-client.json`. + +```json +{ + "lsp": { + "typescript": { + "command": ["typescript-language-server", "--stdio"], + "extensions": [".ts", ".tsx", ".js", ".jsx"] + } + } +} +``` + +Use `lsp.status` first when diagnostics report a missing language server. diff --git a/packages/omo-codex/plugin/components/rules/.codex-plugin/plugin.json b/packages/omo-codex/plugin/components/rules/.codex-plugin/plugin.json new file mode 100644 index 000000000..4c0a824f6 --- /dev/null +++ b/packages/omo-codex/plugin/components/rules/.codex-plugin/plugin.json @@ -0,0 +1,3 @@ +{ + "hooks": "./hooks/hooks.json" +}