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/goal/AGENTS.md
AGENTS.md

Quality

62/100

Scores the file, not the repository.

Length

399 words

7 headings · 1 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/goal/AGENTS.mdRawGitHub
1# src/hooks/goal/ -- Persistent Per-Session Goal
2 
3**Generated:** 2026-07-17
4 
5## OVERVIEW
6 
715 files (8 impl + 7 tests). The `goal` Session Tier hook (event-based). Replaces the user-facing `ralph-loop` wiring (PR #6184 "goal-replaces-ralph"): `ralphLoop` was removed from `HookNameSchema` and `create-session-hooks.ts`, and `ralph_loop` is now a deprecated config passthrough. The `ralph-loop/` dir + `createRalphLoopHook` factory remain for migration only.
8 
9A goal is a per-session persistent objective. While `status: active`, each `session.idle` re-injects a continuation prompt that drives the agent toward the objective and forbids marking complete without a completion audit. The continuation prompt surfaces `tokensUsed` / `timeUsedSeconds` from the goal record.
10 
11Opt-in: requires `goal.enabled: true` (config) AND the `goal` hook enabled. Wired in [`create-session-hooks.ts`](../../plugin/hooks/create-session-hooks.ts); event dispatched via `event-hook-dispatcher.ts`; tools registered in `tool-registry-core-tools.ts`; `/goal` command parsed in `command-execute-before.ts` and `chat-message/loop-commands.ts`.
12 
13## KEY FILES
14 
15| File | Purpose |
16|------|---------|
17| `index.ts` | `createGoalHook(ctx, options) -> GoalHook`. `event` handler for `session.idle` (continuation) and `session.deleted` (clear). Re-entry guarded by `inFlightContinuations` Set |
18| `controller.ts` | `createGoalController({projectDir})`. CRUD: set/get/pause/resume/clear/markComplete + `accountUsage` (token/time accrual, controller-only) + `updateTui`. Writes TUI mirror |
19| `store.ts` | File persistence. Atomic write (tmp + rename). `readGoal` returns null on ENOENT or parse/schema failure. `STORE_VERSION = 1` |
20| `types.ts` | Zod schemas: `GoalSchema`, `GoalStatusSchema` (`active|paused|complete`), `GoalFileSchema` (v1), tool snapshot/response schemas |
21| `prompt.ts` | `buildContinuationPrompt` / `buildResumePrompt`. Objective wrapped in `<untrusted_objective>` (XML-escaped). Enforces completion audit before `update_goal status:complete` |
22| `tools.ts` | `createGoalTools` -> `create_goal`, `update_goal`, `get_goal` ToolDefinitions. `session_id` optional (defaults to current session) |
23| `validation.ts` | `validateObjective`: trim, non-empty, max 2000 chars. `InvalidObjectiveError` |
24| `command-arguments.ts` | `parseGoalCommand` -> `show | clear | setStatus(active|paused) | setObjective` |
25 
26## STATE
27 
28- Primary: `.omo/goal/{encodeURIComponent(sessionID)}.json` (atomic).
29- TUI mirror: `.omo/ulw-loop/{sessionID}/goals.json` (`TuiLoopSnapshot` v1), rewritten on every mutation.
30- `session.deleted` clears the goal file.
31 
32## INTERFACE
33 
34```typescript
35interface GoalHook {
36 setGoal(sessionID, objective): Goal
37 getGoal(sessionID): Goal | null
38 pauseGoal(sessionID): Goal | null
39 resumeGoal(sessionID): Goal | null
40 clearGoal(sessionID): boolean
41 markComplete(sessionID): Goal | null
42 event(input): Promise<void> // session.idle + session.deleted
43}
44```
45 
46## CONTINUATION DISPATCH
47 
48`session.idle` -> `buildContinuationPrompt(goal)` -> `dispatchInternalPrompt` (async gate, `settleMs: 150`, `queueBehavior: "defer"`, source `goal:idle-continuation`). Dispatch failures log via `console.warn` only; the prompt may still be accepted by another route. `inFlightContinuations` prevents re-entrant dispatches per session.
49 
50## NOTES
51 
52- `default_mode.goal: true` auto-creates a goal from the first main-session message (`chat-message/loop-commands.ts`).
53- `accountUsage` accrues only while `status === active`; paused goals keep their accumulated totals.
54- Ralph Loop behavioral parity preserved via `default_max_iterations` (default 100).
55 

Sections

  • src/hooks/goal/ -- Persistent Per-Session Goal
  • OVERVIEW
  • KEY FILES
  • STATE
  • INTERFACE
  • CONTINUATION DISPATCH
  • NOTES

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
aaif-goose/gooseAGENTS.md · 52kAGENTS.mdrusttypescript+2setupbuildtestlint-format+6100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/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