Skip to content

feat: support personal local instruction overrides via .local.md#873

Open
MrSong9957 wants to merge 2 commits into
XiaomiMiMo:mainfrom
MrSong9957:feat/support-agents-local-md
Open

feat: support personal local instruction overrides via .local.md#873
MrSong9957 wants to merge 2 commits into
XiaomiMiMo:mainfrom
MrSong9957:feat/support-agents-local-md

Conversation

@MrSong9957

Copy link
Copy Markdown

Closes #872

What

Adds a .local.md personal local instruction override layer in Instruction.systemPaths (packages/opencode/src/session/instruction.ts):

  • Candidates AGENTS.local.md / CLAUDE.local.md, first-match-wins (only one is loaded — AGENTS.local.md wins if present, CLAUDE.local.md is then skipped).
  • Stacked on top of the existing AGENTS.md / CLAUDE.md main instructions (unchanged).
  • Gated behind the existing MIMOCODE_DISABLE_CLAUDE_CODE_PROMPT flag.

Motivation and full loading logic in #872.

Verification

  • bun test test/session/instruction.test.ts → 13 pass (incl. 3 new .local.md tests: stacking / CLAUDE.md fallback / first-match-wins)
  • bun typecheck (@mimo-ai/cli) → clean
  • Manually verified in the TUI: CLAUDE.local.md loads when no AGENTS.local.md; adding AGENTS.local.md makes it win and CLAUDE.local.md is skipped.

改动内容

Instruction.systemPathspackages/opencode/src/session/instruction.ts)新增 .local.md 个人本地指令覆盖层:

  • 候选 AGENTS.local.md / CLAUDE.local.mdfirst-match-wins(只加载其中一个——若存在 AGENTS.local.md 则它胜出,随即跳过 CLAUDE.local.md)。
  • 叠加在既有 AGENTS.md / CLAUDE.md 主指令之上(主指令不变)。
  • 受既有 MIMOCODE_DISABLE_CLAUDE_CODE_PROMPT flag 门控。

动机与完整加载逻辑见 #872

验证

  • bun test test/session/instruction.test.ts → 13 pass(含 3 个新增 .local.md 测试:stacking / CLAUDE.md fallback / first-match-wins)
  • bun typecheck@mimo-ai/cli)→ 无错误
  • TUI 手动验证:无 AGENTS.local.md 时加载 CLAUDE.local.md;加入 AGENTS.local.md 后它胜出,CLAUDE.local.md 被跳过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]:Support AGENTS.local.md as a personal local instruction override

2 participants