Repository navigation
feat(plugins): switch project and personal instruction files - #291
Merged
Merged
Conversation
lokicik
force-pushed
the
feat/instruction-file-switches
branch
4 times, most recently
from
December 1, 2026 15:56
44fbe46 to
aff6173
Compare
Battles loaded the project's AGENTS.md, ~/.config/opencode/AGENTS.md and the skills in ~/.claude and ~/.agents with no switch, and never CLAUDE.md. The Claude Code and Codex lists now carry two entries: - This project's instructions: the project's AGENTS.md, or its CLAUDE.md, on by default and asked once below the composer. - Your own instructions and skills: the global AGENTS.md or ~/.claude/CLAUDE.md and personal skills, off until switched on in Settings. The daemon writes each switch as agent-duel.json into the imported config dirs; core reads it and the instruction and skill discovery follow it live. With the switches the project walk ends at the project root, so ancestor files no longer load. Each side's run records what its prompt loaded (paths and hashes, no text). Also builds fresh defaults in the plugin state schema, whose shared default object carried one import's fingerprint into the next empty state.
Settings and project settings list the instruction switches under their own heading above Plugins, since they are switched in place, not imported. An undecided project file loads, so its switch now shows on.
The tab was named for where its contents come from ("Claude Code and
Codex"). It is now "Instructions, skills and MCP", on the settings
sidebar and on the project settings heading. Settings search still
finds it by "claude", "codex" and "skills".
The inherited Paseo "Plugins" tab is hidden from the sidebar and from
settings search. Agent Duel ships no app plugins and installed ones stay
off, and the tab shared its name with the imported plugins list. The
page keeps its route.
Three labels on these pages are shorter: "Review", "Global list", and
the empty-list line.
Config now reloads only when one of its input files changes. Agent Duel's switch file (agent-duel.json in the imported dirs) is read beside config rather than loaded as config, so it was not an input, and turning a switch on or off waited for a restart. Name it as an input.
…h is off A read loaded the AGENTS.md or CLAUDE.md of the folders above the file without checking Agent Duel's project switch, so a subfolder's instructions reached contestants with the switch off.
The run's loadedSetup listed only what the prompt carried, so a subfolder's AGENTS.md that a read loaded mid-turn was missing from it. The turn-end record adds those files from the side's sessions, after the prompt-time record is written.
The project row showed only the root AGENTS.md or CLAUDE.md, and a project with instructions only in subfolders had no row and no switch. The daemon lists each subfolder's file with git ls-files, and a long list ends in a count.
…e switches Files a config lists under instructions loaded with both switches off. Config the upward walk finds now follows the project switch, including the checkout's config above a battle slot, and the user's OpenCode config follows the global one.
A project's AGENTS.md is almost always wanted, so its switch is never pending: the files load until turned off in the project's settings. The line below the composer and its review sheet now cover plugins only.
lokicik
force-pushed
the
feat/instruction-file-switches
branch
from
December 3, 2026 13:01
f4e03d9 to
41d506e
Compare
3 of 4 tasks
3 of 4 tasks
2 of 4 tasks
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.
What and why
Battles loaded the repo's AGENTS.md and your personal skills with no way to turn them off, and never CLAUDE.md. Now there are two switches: the project's instruction files, subfolders and opencode.json lists included (on by default, switched in the project's settings), and your own instructions and skills (off, in Settings). Each battle side records what it loaded. The settings tab is now "Instructions, skills and MCP", and the unused Paseo "Plugins" tab is hidden.
Testing
npx vitest run packages/server/src/server/agent-plugins/index.test.ts: 15 passed, including a new test that Settings lists subfolder files, also with none at the rootbun test test/instruction-discovery.test.ts test/session-instructions.test.ts test/config/config.test.ts test/tool-read.test.tsin core: 118 passed, 1 skipped, including tests that a switch change reloads config without a restart, that a read loads no subfolder instructions with the switch off, and that files an opencode.json lists follow the switchesbun test test/config/discovery.test.ts test/config/watch.test.tsin core: 8 passedbun test test/arena/loaded-setup.test.ts test/arena/instruction-files.test.tsin opencode: 6 passednpx vitest run src/i18n/resources.test.ts src/i18n/locales.test.tsin app: 56 passedpackages/api/AGENTS.mdand an opencode.json listing CONTRIBUTING.md, where each side readspackages/api/src/handler.ts. Switch off, on, off, in a battle and in a chat with Battle off:loadedSetupis emptyloadedSetuplists all three with hashesAGENTS.mdandpackages/api/AGENTS.mdunder the project switchChecklist
npm run typecheck,npm run lintandnpm run formatpass