Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!-- OMC:START -->
<!-- OMC:VERSION:4.10.1 -->

# oh-my-claudecode - Intelligent Multi-Agent Orchestration

You are running with oh-my-claudecode (OMC), a multi-agent orchestration layer for Claude Code.
Coordinate specialized agents, tools, and skills so work is completed accurately and efficiently.

<operating_principles>
- Delegate specialized work to the most appropriate agent.
- Prefer evidence over assumptions: verify outcomes before final claims.
- Choose the lightest-weight path that preserves quality.
- Consult official docs before implementing with SDKs/frameworks/APIs.
</operating_principles>

<delegation_rules>
Delegate for: multi-file changes, refactors, debugging, reviews, planning, research, verification.
Work directly for: trivial ops, small clarifications, single commands.
Route code to `executor` (use `model=opus` for complex work). Uncertain SDK usage → `document-specialist` (repo docs first; Context Hub / `chub` when available, graceful web fallback otherwise).
</delegation_rules>

<model_routing>
`haiku` (quick lookups), `sonnet` (standard), `opus` (architecture, deep analysis).
Direct writes OK for: `~/.claude/**`, `.omc/**`, `.claude/**`, `CLAUDE.md`, `AGENTS.md`.
</model_routing>

<skills>
Invoke via `/oh-my-claudecode:<name>`. Trigger patterns auto-detect keywords.
Tier-0 workflows include `autopilot`, `ultrawork`, `ralph`, `team`, and `ralplan`.
Keyword triggers: `"autopilot"→autopilot`, `"ralph"→ralph`, `"ulw"→ultrawork`, `"ccg"→ccg`, `"ralplan"→ralplan`, `"deep interview"→deep-interview`, `"deslop"`/`"anti-slop"`→ai-slop-cleaner, `"deep-analyze"`→analysis mode, `"tdd"`→TDD mode, `"deepsearch"`→codebase search, `"ultrathink"`→deep reasoning, `"cancelomc"`→cancel.
Team orchestration is explicit via `/team`.
Detailed agent catalog, tools, team pipeline, commit protocol, and full skills registry live in the native `omc-reference` skill when skills are available, including reference for `explore`, `planner`, `architect`, `executor`, `designer`, and `writer`; this file remains sufficient without skill support.
</skills>

<verification>
Verify before claiming completion. Size appropriately: small→haiku, standard→sonnet, large/security→opus.
If verification fails, keep iterating.
</verification>

<execution_protocols>
Broad requests: explore first, then plan. 2+ independent tasks in parallel. `run_in_background` for builds/tests.
Keep authoring and review as separate passes: writer pass creates or revises content, reviewer/verifier pass evaluates it later in a separate lane.
Never self-approve in the same active context; use `code-reviewer` or `verifier` for the approval pass.
Before concluding: zero pending tasks, tests passing, verifier evidence collected.
</execution_protocols>

<hooks_and_context>
Hooks inject `<system-reminder>` tags. Key patterns: `hook success: Success` (proceed), `[MAGIC KEYWORD: ...]` (invoke skill), `The boulder never stops` (ralph/ultrawork active).
Persistence: `<remember>` (7 days), `<remember priority>` (permanent).
Kill switches: `DISABLE_OMC`, `OMC_SKIP_HOOKS` (comma-separated).
</hooks_and_context>

<cancellation>
`/oh-my-claudecode:cancel` ends execution modes. Cancel when done+verified or blocked. Don't cancel if work incomplete.
</cancellation>

<worktree_paths>
State: `.omc/state/`, `.omc/state/sessions/{sessionId}/`, `.omc/notepad.md`, `.omc/project-memory.json`, `.omc/plans/`, `.omc/research/`, `.omc/logs/`
</worktree_paths>

## Setup

Say "setup omc" or run `/oh-my-claudecode:omc-setup`.

<!-- OMC:END -->
41 changes: 41 additions & 0 deletions .claude/rules/project-knowledge/config-pitfalls.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
description: LoongCollector 采集配置常见陷阱。编写或审查 pipeline config YAML 时参考。
globs:
- "**/*.feature"
- "**/case.feature"
- "core/config/**"
- "test/e2e/**"
alwaysApply: false
---
# LoongCollector 采集配置陷阱

## ExcutionTimeout 使配置变为一次性(onetime)

`global.ExcutionTimeout` 存在于配置中时,**整个配置**被标记为 onetime 类型。
只有注册了 `RegisterOnetimeInputCreator` 的插件才能在 onetime 配置中使用。

大部分输入插件(`input_forward`, `input_file`, `input_container_stdio`, `input_prometheus` 等)只注册了 `RegisterContinuousInputCreator`,在 onetime 配置中会报错:

```
failed to parse config:unsupported input plugin module:input_forward
```

### 判断逻辑

```
global.ExcutionTimeout 存在
→ PipelineConfig::GetExpireTimeIfOneTime → mOnetimeExpireTime 被设置
→ CollectionConfig::IsOnetime() == true
→ IsValidNativeInputPlugin(name, true) 在 ONETIME 注册表查找
→ 找不到 → "unsupported input plugin"
```

### 支持 onetime 的输入插件

查看 `PluginRegistry::LoadStaticPlugins()` 中调用 `RegisterOnetimeInputCreator` 的插件,如 `InputStaticFile`。

### 规则

- **持续运行的输入插件配置中不要使用 `ExcutionTimeout`**
- E2E 测试不需要 `ExcutionTimeout` 来控制超时,Go test 的 `-timeout` 参数已经提供了保护
- 如果确实需要一次性采集,使用 `onetime_pipeline_config` 目录 + 支持 onetime 的输入插件
5 changes: 5 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"enabledPlugins": {
"oh-my-claudecode@omc": true
}
}
Loading
Loading