feat: support personal local instruction overrides via .local.md#873
Open
MrSong9957 wants to merge 2 commits into
Open
feat: support personal local instruction overrides via .local.md#873MrSong9957 wants to merge 2 commits into
MrSong9957 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #872
What
Adds a
.local.mdpersonal local instruction override layer inInstruction.systemPaths(packages/opencode/src/session/instruction.ts):AGENTS.local.md/CLAUDE.local.md, first-match-wins (only one is loaded —AGENTS.local.mdwins if present,CLAUDE.local.mdis then skipped).AGENTS.md/CLAUDE.mdmain instructions (unchanged).MIMOCODE_DISABLE_CLAUDE_CODE_PROMPTflag.Motivation and full loading logic in #872.
Verification
bun test test/session/instruction.test.ts→ 13 pass (incl. 3 new.local.mdtests: stacking / CLAUDE.md fallback / first-match-wins)bun typecheck(@mimo-ai/cli) → cleanCLAUDE.local.mdloads when noAGENTS.local.md; addingAGENTS.local.mdmakes it win andCLAUDE.local.mdis skipped.改动内容
在
Instruction.systemPaths(packages/opencode/src/session/instruction.ts)新增.local.md个人本地指令覆盖层:AGENTS.local.md/CLAUDE.local.md,first-match-wins(只加载其中一个——若存在AGENTS.local.md则它胜出,随即跳过CLAUDE.local.md)。AGENTS.md/CLAUDE.md主指令之上(主指令不变)。MIMOCODE_DISABLE_CLAUDE_CODE_PROMPTflag 门控。动机与完整加载逻辑见 #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)→ 无错误AGENTS.local.md时加载CLAUDE.local.md;加入AGENTS.local.md后它胜出,CLAUDE.local.md被跳过。