Plan your work on @docs/roadmap.md item: 5. Expand Gemini CLI instruction and…
- User
Plan your work on @docs/roadmap.md item: 5. Expand Gemini CLI instruction and agent-definition coverage to match the current documented surface area.
The north star now calls out Gemini support for additional instruction filename behavior and broader agent-definition locations than the current implementation models. Evaluate which of those surfaces are safe to support directly and which should remain warning-only until ownership and revert semantics are clear.
Score 7/12 (Architecture 1, Agents 1, OS 1, Confidence 1, Safety 1, Stability 2) - User
--- Content from referenced files ---
- User
Content from @docs/roadmap.md:
- User
- User
--- End of content ---
- User
pause for now
Assistant
I have implemented the majority of the plan to expand Gemini CLI instruction and agent-definition coverage. Here is a summary of the changes:
- Schema & Types: Added a
scopefield (global, repo, workspace) toagentDefinitionsin the manifest and expanded theAgentConfigtype to support scoped definition surfaces. - Registry Updates: Updated all agents to use
agentDefinitionsRepoSupport. Added global definition support for Gemini CLI (~/.gemini/agents/) and OpenCode. - Planned Surfaces: Added an
unsupportedSurfacesregistry toAgentConfig. Gemini CLI now emits "planned surface" warnings during preflight for TOML subagents, configurable instruction filenames, andAGENTS.mdfallback. - Core Logic: Updated the
agentDefinitionsadapter and capability resolution to respect the new scopes. - Discovery: Fixed
initdiscovery to correctly map repository-local agent definitions to the appropriate scope.
- Schema & Types: Added a
- User
continue
Assistant
I will remove the debug log from
src/core/init.ts, run the tests, and address any remaining failures to complete the implementation of the Gemini CLI North Star surfaces.Assistant
I will run the tests to verify the implementation.
Assistant
I will investigate the failure of the
assert.rejectscalls in the tests, specifically checking if the addition ofscope: "repo"to the mock objects is causing the adapter to skip agents or return unexpected results.Assistant
I've identified that
targetAgentsmight be empty in the failing tests due to the filtering based ondetectedAgents. Additionally, I mistakenly addedscope: "repo"to acompileAgentRuleActionscall, resulting in a duplicatescopeproperty. I'll now examinetest/unit/adapters.test.tsaround line 1146 to resolve these issues.Assistant
I'll check the
compilecall at line 1146 to see ifscope: "repo"was added correctly. I'll also investigate thecompilecall at line 1123 for any issues.Assistant
The tests are failing because I'm not passing a
scopein thecompilecalls, so they default toglobal. This results inresolveAgentDefinitionsSupportreturningundefinedforclaude-codesince I moved itsagentDefinitionsSupporttoagentDefinitionsRepoSupport. Consequently, the adapter skips the agent before reaching the validation stage. I'll fix this by addingscope: "repo"to allagentDefinitionsmock objects intest/unit/adapters.test.ts.Assistant
I'm re-running the tests.
Assistant
I've narrowed it down to three failing tests. It appears my regex missed them because they are formatted across multiple lines. I'll now manually fix these three specific instances.
Assistant
I'm re-running the tests.
Assistant
Existing tests pass. I'll now create
test/unit/gemini-north-star.test.tsto verify global agent definitions and preflight warnings for planned Gemini CLI surfaces.Assistant
I'm running the new test.
Assistant
I'll check if
test/helpers/fs.tsexportsrealpath.Assistant
I'll import
realpathfromnode:fs/promisesfor the test.Assistant
Rerunning the test.
Assistant
I should've checked
rmandwriteFiletoo.Assistant
Fixing my imports.
Assistant
Rerunning the test.
Assistant
detectedAgentsisn't iterable inrunPreflight. I'll checksrc/core/preflight.tsat line 325.Assistant
I've got the
runPreflightparameters wrong in my test. I'll correct the call.Assistant
Rerunning the test.
Assistant
I'm not getting the expected warnings. I suspect I might have messed up the
runPreflightimplementation insrc/core/preflight.ts, specifically how it callscollectManifestCapabilityWarningsandcollectCapabilityWarningsForTargets. I'll re-examinesrc/core/preflight.ts.Assistant
I've spotted a bug in
collectManifestCapabilityWarningswhereentry.scopeisn't passed foragentDefinitions. However, that doesn't explain the missing warnings in my test. MyunsupportedSurfacesdefinitions insrc/config/agents.tsshould be triggered, andcollectCapabilityWarningsForTargetsshould be using thereasonfield. I'll debug the test to see what warnings are actually being returned.Assistant
Rerunning the test.
Assistant
Got it. The warnings don't contain the strings I'm looking for because
collectCapabilityWarningsForTargetsuses thereasonfield, not theschemaLabel. I'll update the test to match the actual warning messages, like "Instruction filename overrides are documented but cannot be reliably targeted yet."Assistant
Wait, my
plannedWarningsfilter in the test is missing some warnings. Warning 3, "Gemini CLI loads AGENTS.md natively...", doesn't match "planned" or "documented but." I'll just check the entirewarningsarray instead.Assistant
Rerunning the test.
Assistant
New test passed. I'll now remove the
console.logfromtest/unit/gemini-north-star.test.tsand perform a final run of all tests.Assistant
Running all tests.
Assistant
Tests passed, but I'll now fix
collectManifestCapabilityWarningsinsrc/core/preflight.tsto correctly pass the scope foragentDefinitions.Assistant
Final test run.
Assistant
I have expanded Gemini CLI instruction and agent-definition coverage to align with the documented North Star surfaces.
Changes Summary
- Scoped Agent Definitions: Added
scopesupport (global,repo,workspace) to the manifest schema and engine logic foragentDefinitions. - Gemini CLI Global Support: Enabled direct deployment of global agent definitions to
~/.gemini/agents/when usingscope: "global". - North Star Surface Warnings: Introduced an
unsupportedSurfacesregistry. Gemini CLI now proactively warns during preflight when it detects usage of documented but currently unsafe-to-automate surfaces:- TOML subagent definitions.
- Configurable instruction filenames via
settings.json. - Native
AGENTS.mdfallback.
- Infrastructure Alignment:
- Scoped Agent Definitions: Added
- User
commit your changes
Assistant
I have expanded Gemini CLI instruction and agent-definition coverage to align with the documented North Star surfaces.
Summary of Changes
- Scoped Agent Definitions: Added
scopesupport (global,repo,workspace) to the manifest schema and engine logic foragentDefinitions. - Gemini CLI Global Support: Enabled direct deployment of global agent definitions to
~/.gemini/agents/when usingscope: "global". - North Star Surface Warnings: Introduced an
unsupportedSurfacesregistry. Gemini CLI now proactively warns during preflight when it detects usage of documented but currently unsafe-to-automate surfaces (TOML subagents, configurable instruction filenames viasettings.json, and nativeAGENTS.mdfallback). - Discovery & Resolution: Updated
initdiscovery to correctly map repository-local definitions and enhanced capability resolution to handle the new scoped surfaces.
- Scoped Agent Definitions: Added