feat(junie): import subagents from the shared .agents directory - #1875
Merged
Conversation
Junie discovers custom subagents from the cross-tool `.agents/` directory (project `.agents/` and user `~/.agents/`) in addition to `.junie/agents/`, per the Junie CLI docs. rulesync previously imported only from `.junie/agents/`. Add an optional `importDirPaths` to `ToolSubagentSettablePaths` describing extra import-only discovery roots, and teach the subagents processor to scan them when importing. Generation and orphan deletion still target only the canonical `relativeDirPath` (`.junie/agents/`), so user-owned `.agents/` files are never overwritten or removed. Other tools omit `importDirPaths` and keep their single-directory behavior unchanged. Closes #1821 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…clarify load log Address review feedback on multi-root subagent import: - Warn (and keep the higher-precedence copy) when the same subagent relative path is found in more than one import root, instead of silently overwriting downstream. - Make the load debug log report the tool target and all scanned directories rather than only the canonical one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
Merged
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.
Summary
Junie discovers custom subagents from the cross-tool
.agents/directory (project.agents/and user~/.agents/) in addition to.junie/agents/, per the Junie CLI subagents docs. rulesync previously imported subagents only from.junie/agents/, so subagents authored under the shared.agents/root were silently skipped on import.This resolves the last remaining gap in #1821. (The subagent frontmatter field set already landed via #1845, and the command frontmatter fields were confirmed by the docs to be
description-only, i.e. no change needed.)Changes
importDirPathstoToolSubagentSettablePathsdescribing extra import-only discovery roots.SubagentsProcessor.loadToolFilesto scan those extra roots when importing, passing the per-rootrelativeDirPathtofromFile.JunieSubagent.getSettablePathsnow advertises.agentsas an import root;JunieSubagent.fromFilehonors an explicitrelativeDirPathoverride.docs/reference/file-formats.md(synced toskills/rulesync/).Safety
relativeDirPath(.junie/agents/). The.agents/root is read-only on import, so user-owned.agents/files are never overwritten or removed.importDirPaths, so their single-directory behavior is unchanged (verified: full suite of 6371 tests passes).Tests
JunieSubagent.fromFileloads from.agents; processor imports from both roots and excludes.agents/from deletion..agents/directory.Closes #1821
🤖 Generated with Claude Code