Skip to content

feat(plugins): switch project and personal instruction files - #291

Merged
lokicik merged 11 commits into
mainfrom
feat/instruction-file-switches
Dec 3, 2026
Merged

lokicik merged 11 commits into
mainfrom
feat/instruction-file-switches

Conversation

@lokicik

@lokicik lokicik commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • [automated] 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 root
  • [automated] bun test test/instruction-discovery.test.ts test/session-instructions.test.ts test/config/config.test.ts test/tool-read.test.ts in 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 switches
  • [automated] bun test test/config/discovery.test.ts test/config/watch.test.ts in core: 8 passed
  • [automated] bun test test/arena/loaded-setup.test.ts test/arena/instruction-files.test.ts in opencode: 6 passed
  • [automated] npx vitest run src/i18n/resources.test.ts src/i18n/locales.test.ts in app: 56 passed
  • [AI] Claude Code drove the dev app on macOS with a stub model and a scratch home folder, before the rebase onto the OpenCode v2.4.2 sync:
    • Defaults: the repo's CLAUDE.md reaches both sides; personal CLAUDE.md and skills don't
    • Turning the personal switch on in Settings adds them to the next battle without a restart
    • In a repo under the home folder, a parent folder's CLAUDE.md no longer loads
    • The renamed tab shows in the sidebar and on the project page, and settings search finds it by "claude", "codex" and "skills"
    • The Paseo Plugins tab is gone from the sidebar and from search; its page still opens by its route
  • [AI] After the rebase, in the browser build with the same scratch home: the personal switch writes on and off, the project switch shows on for a repo with only CLAUDE.md, and the review sheet imports a Claude Code plugin
  • [AI] Against a dev daemon with stub models and the same scratch home, a repo with a root AGENTS.md, packages/api/AGENTS.md and an opencode.json listing CONTRIBUTING.md, where each side reads packages/api/src/handler.ts. Switch off, on, off, in a battle and in a chat with Battle off:
    • Off: none of the three files reach the model, and each run's loadedSetup is empty
    • On: all three reach the model, and loadedSetup lists all three with hashes
    • Settings lists AGENTS.md and packages/api/AGENTS.md under the project switch
  • [AI] Claude Code drove the desktop app on macOS with stub models, its daemon on a scratch home folder:
    • A new project with AGENTS.md files shows nothing below the composer. A battle loads the root and subfolder AGENTS.md and the file its opencode.json names, and the run records all three
    • A project that also has a Claude Code command shows the plugin line with only "1 command", and its review sheet has no instructions entry
    • After turning the project's switch off in Settings → Projects, a new chat's battle gets none of the three and records none
  • Not tested: real models, Windows, Linux

Checklist

  • "What and why" is at most 500 characters
  • npm run typecheck, npm run lint and npm run format pass
  • Screenshots or video attached for UI changes
  • I agree to the contribution licensing policy and have authority to license my contribution.

@lokicik
lokicik requested a review from a team as a code owner November 25, 2026 12:58
@lokicik
lokicik force-pushed the feat/instruction-file-switches branch 4 times, most recently from 44fbe46 to aff6173 Compare December 1, 2026 15:56
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
lokicik force-pushed the feat/instruction-file-switches branch from f4e03d9 to 41d506e Compare December 3, 2026 13:01
@lokicik
lokicik merged commit bfc0b27 into main Dec 3, 2026
5 checks passed
@lokicik
lokicik deleted the feat/instruction-file-switches branch December 3, 2026 13:13
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.

1 participant