RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/code-yeongyu/oh-my-openagent

AGENTS.md

packages/omo-opencode/src/hooks/keyword-detector/AGENTS.md
AGENTS.md

Quality

66/100

Scores the file, not the repository.

Length

631 words

9 headings · 3 code blocks

Repository

67k

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
code-yeongyu/oh-my-openagent/packages/omo-opencode/src/hooks/keyword-detector/AGENTS.mdRawGitHub
1# src/hooks/keyword-detector/ -- Mode Keyword Injection
2 
3**Generated:** 2026-07-17
4 
5## OVERVIEW
6 
7Transform Tier hook on `messages.transform`. Scans the first user message for mode keywords and injects mode-specific system prompts. The detector and routing logic stay in `src/hooks/keyword-detector/`; prompt bodies now live in [`packages/prompts-core/prompts/`](../../../../prompts-core/prompts) so they can be shared by future harness adapters.
8 
9This matches the package layering direction in [`ROADMAP.md`](../../../../../ROADMAP.md): `packages/prompts-core` owns static prompt content, while this OpenCode hook owns keyword detection, model routing, and message injection.
10 
11## KEYWORDS
12 
13| Keyword | Pattern | Effect |
14|---------|---------|--------|
15| `ultrawork` / `ulw` | `/\b(ultrawork|ulw)\b/i` | Full orchestration mode: parallel agents, deep exploration, relentless execution |
16| Team mode | `TEAM_PATTERN` (from `team/`) | Forces orchestration via `team_*` tools when user invokes `team mode` / `team-mode` / `team_mode` / `teammode`; instructs user to enable `team_mode.enabled` if tools are absent and reminds lead to run the closure sequence once every task is terminal |
17| Hyperplan mode | `HYPERPLAN_PATTERN` (from `hyperplan/`) | Loads the `hyperplan` skill and injects adversarial planning mode guidance |
18| Hyperplan-ultrawork combo | `HYPERPLAN_ULTRAWORK_PATTERN` (from `constants.ts`) | Prepends the combo banner, requires the `hyperplan` skill, then appends the routed ultrawork message |
19 
20## STRUCTURE
21 
22```
23keyword-detector/
24├── index.ts # Barrel export
25├── hook.ts # createKeywordDetectorHook() chat.message handler
26├── detector.ts # detectKeywordsWithType() + extractPromptText()
27├── constants.ts # KEYWORD_DETECTORS array, re-exports from submodules
28├── types.ts # KeywordDetector, DetectedKeyword types
29├── ultrawork/
30│ ├── index.ts # getUltraworkMessage() router
31│ ├── source-detector.ts # agent/model routing helpers
32│ ├── default.ts # thin loader for prompts-core/prompts/ultrawork/default.md
33│ ├── gpt.ts # thin loader for prompts-core/prompts/ultrawork/gpt.md
34│ ├── gemini.ts # thin loader for prompts-core/prompts/ultrawork/gemini.md
35│ ├── glm.ts # thin loader for prompts-core/prompts/ultrawork/glm.md
36│ └── planner.ts # thin loader for prompts-core/prompts/ultrawork/planner.md
37├── team/
38│ ├── index.ts
39│ └── default.ts # TEAM_PATTERN + TEAM_MESSAGE from prompts-core mode prompt
40└── hyperplan/
41 ├── index.ts
42 └── default.ts # HYPERPLAN_PATTERN + HYPERPLAN_MESSAGE from prompts-core mode prompt
43```
44 
45## PROMPT CONTENT LOCATIONS
46 
47| Prompt family | Markdown source |
48|---------------|-----------------|
49| Ultrawork default | [`packages/prompts-core/prompts/ultrawork/default.md`](../../../../prompts-core/prompts/ultrawork/default.md) |
50| Ultrawork GPT | [`packages/prompts-core/prompts/ultrawork/gpt.md`](../../../../prompts-core/prompts/ultrawork/gpt.md) |
51| Ultrawork Gemini | [`packages/prompts-core/prompts/ultrawork/gemini.md`](../../../../prompts-core/prompts/ultrawork/gemini.md) |
52| Ultrawork GLM | [`packages/prompts-core/prompts/ultrawork/glm.md`](../../../../prompts-core/prompts/ultrawork/glm.md) |
53| Ultrawork planner | [`packages/prompts-core/prompts/ultrawork/planner.md`](../../../../prompts-core/prompts/ultrawork/planner.md) |
54| Team mode | [`packages/prompts-core/prompts/mode/team.md`](../../../../prompts-core/prompts/mode/team.md) |
55| Hyperplan mode | [`packages/prompts-core/prompts/mode/hyperplan.md`](../../../../prompts-core/prompts/mode/hyperplan.md) |
56 
57The `src/hooks/keyword-detector/{team,hyperplan}/default.ts` files keep the regex triggers in the hook layer and import the markdown-backed constants from `@oh-my-opencode/prompts-core`. The ultrawork files import markdown with Bun's `.md` text loader so the exact prompt bytes are bundled into `dist/index.js`.
58 
59## ULTRAWORK VARIANT ROUTING
60 
61[`ultrawork/source-detector.ts`](ultrawork/source-detector.ts) decides the ultrawork source in priority order:
62 
631. Planner agents (`prometheus`, `planner`, or normalized `plan`) route to `planner.md`.
642. GPT family models, as detected by `isGptModel(modelID)`, route to `gpt.md`.
653. Gemini family models, as detected by `isGeminiModel(modelID)`, route to `gemini.md`.
664. GLM family models, as detected by `isGlmModel(modelID)`, route to `glm.md`.
675. Everything else routes to `default.md`.
68 
69[`ultrawork/index.ts`](ultrawork/index.ts) exposes `getUltraworkMessage(agentName, modelID)`, switches on that source, and returns the loaded markdown body.
70 
71## DETECTION LOGIC
72 
73```
74chat.message (user input)
75 -> extractPromptText(parts)
76 -> isSystemDirective? skip
77 -> removeSystemReminders(text) # strip <SYSTEM_REMINDER> blocks
78 -> detectKeywordsWithType(cleanText, agentName, modelID, disabledKeywords)
79 -> isNonOmoAgent(agentName)? filter keyword injection
80 -> isPlannerAgent(agentName)? filter standalone ultrawork
81 -> for each detected keyword: inject mode message into output
82```
83 
84## CONFIG
85 
86```jsonc
87{
88 "keyword_detector": {
89 // Skip injection for any keyword in this list.
90 "disabled_keywords": ["team", "hyperplan"]
91 }
92}
93```
94 
95Default: empty/missing means every detector is active. Schema lives at [`src/config/schema/keyword-detector.ts`](../../config/schema/keyword-detector.ts).
96 
97## GUARDS
98 
99- **System directive skip**: Messages tagged as system directives are not scanned (prevents infinite loops)
100- **Planner agent filter**: Prometheus/plan agents do not receive `ultrawork` injection
101- **Non-OMO agent filter**: OpenCode built-in Builder/Plan agents do not receive keyword injection
102- **Session agent tracking**: Uses `getSessionAgent()` to get actual agent (not just input hint)
103- **Model-aware messages**: `getUltraworkMessage(agentName, modelID)` adapts message to active model
104- **Ultrawork source routing**: `ultrawork/ultrawork-source-routing.test.ts` pins agent/model-to-prompt-source routing for `getUltraworkSource`
105 

Sections

  • src/hooks/keyword-detector/ -- Mode Keyword Injection
  • OVERVIEW
  • KEYWORDS
  • STRUCTURE
  • PROMPT CONTENT LOCATIONS
  • ULTRAWORK VARIANT ROUTING
  • DETECTION LOGIC
  • CONFIG
  • GUARDS

What it covers

architecture

Stack — with the evidence

typescript

(1.00)

bun

(1.00)

node

(0.70)

vitest

(0.70)

biome

(0.70)

javascript

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
code-yeongyu
Language
—
License
—
Archived
no

All configs in this repo

Also in code-yeongyu/oh-my-openagent

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archdeploymentagent-behaviour62/1002 days ago
code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md · 67kAGENTS.mdtypescriptbun+5lint-formatarchsecuritydeployment+166/1002 days ago
code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 67kAGENTS.mdtypescriptbun+5arch70/1002 days ago
code-yeongyu/oh-my-openagentscript/AGENTS.md · 67kAGENTS.mdtypescriptbun+5buildtestarchdeployment80/1002 days ago
code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archdeploymentagent-behaviour70/1002 days ago
code-yeongyu/oh-my-openagent.agents/AGENTS.md · 67kAGENTS.mdtypescriptbun+5stylearchtesting-strategydatabase64/1002 days ago
code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 67kAGENTS.mdtypescriptbun+5stylearchdo-not71/1002 days ago
code-yeongyu/oh-my-openagentAGENTS.md · 67kAGENTS.mdtypescriptbun+5setupbuildtestlint-format+1184/1002 days ago
code-yeongyu/oh-my-openagentassets/AGENTS.md · 67kAGENTS.mdtypescriptbun+5buildteststylearch88/1002 days ago
code-yeongyu/oh-my-openagentbin/AGENTS.md · 67kAGENTS.mdtypescriptbun+5teststylearch64/1002 days ago
code-yeongyu/oh-my-openagentpackages/AGENTS.md · 67kAGENTS.mdtypescriptnode+5buildtestlint-formatstyle+383/1002 days ago
code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archdependenciesapi48/1002 days ago
code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archapi48/1002 days ago
code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archagent-behaviour56/1002 days ago
code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archdependenciesapi48/1002 days ago
code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5stylearchdependenciesapi60/1002 days ago
code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 67kAGENTS.mdtypescriptbun+5buildtestlint-formatarch+182/1002 days ago
code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archtypesdependenciesapi48/1002 days ago
code-yeongyu/oh-my-openagentpackages/lsp-core/AGENTS.md · 67kAGENTS.mdtypescriptbun+5archmonorepo43/1002 days ago
code-yeongyu/oh-my-openagentpackages/lsp-daemon/AGENTS.md · 67kAGENTS.mdtypescriptnode+5buildtestlint-formatarch+189/100today
Diff against packages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md Diff against packages/omo-opencode/src/tools/background-task/AGENTS.md Diff against script/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md Diff against .agents/AGENTS.md Diff against .opencode/AGENTS.md Diff against AGENTS.md Diff against assets/AGENTS.md Diff against bin/AGENTS.md Diff against packages/AGENTS.md Diff against packages/agents-md-core/AGENTS.md Diff against packages/boulder-state/AGENTS.md Diff against packages/claude-code-compat-core/AGENTS.md Diff against packages/comment-checker-core/AGENTS.md Diff against packages/delegate-core/AGENTS.md Diff against packages/git-bash-mcp/AGENTS.md Diff against packages/hashline-core/AGENTS.md Diff against packages/lsp-core/AGENTS.md Diff against packages/lsp-daemon/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
aaif-goose/gooseAGENTS.md · 52kAGENTS.mdrusttypescript+2setupbuildtestlint-format+6100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67kAGENTS.mdtypescriptbun+10setupbuildtestlint-format+6100/1002 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack