Repository navigation
Description
Friction
This is step 3 of 8 of the OpenSpec adoption decided in issue #1753 and docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md. The adoption exists so that project planning is consistent across agent workflows: Claude Code, Gemini CLI and Copilot read one set of planning conventions. Today only two of the three get a pointer to AGENTS.md.
devops ai agentsgeneratesAGENTS.md, aCLAUDE.mdstub for Claude Code and a.github/copilot-instructions.mdstub for Copilot (DEFAULT_AGENT_FILESinsrc/devops_cli/ai/instruction_generator.py).- Gemini CLI loads
GEMINI.mdby default and readsAGENTS.mdonly whencontext.fileNameis configured, so a Gemini CLI session started in a fresh clone does not see the rules inAGENTS.md, including the change-folder rules the later steps add. generate_instruction_contentpicks the stub by a string test (target_file == CONST_CLAUDE_MD_FILENAME, then"copilot" in target_file), andgenerate_pointer_stubadds the@AGENTS.mdimport line only whenfilename == CONST_CLAUDE_MD_FILENAME. A third tool through those branches adds a third special case in two places.
Evidence
The ADR's Design (Agent files and openspec/config.yaml) records the Gemini CLI behavior from its documentation. The existing byte-for-byte guard is test_instruction_stubs_byte_equal_to_generator in tests/test_agents_md_claims.py, and test_generate_pointer_stub in tests/test_instruction_generator.py covers the stub's content. The AGENTS.md character budget is 40,000 and this step ends at 39,979 with the ADR's wording.
Feasibility to confirm in the change's proposal: that Gemini CLI expands an @AGENTS.md import line in GEMINI.md (read its documentation and record the version), as the ADR assumes.
Existing tool considered
The existing generator and its stub template are extended; no new generator is built. Gemini CLI's own context.fileName setting is the alternative, rejected because it is per-user configuration, not something a fresh clone carries.
The change
src/devops_cli/ai/instruction_generator.py: aCONST_GEMINI_MD_FILENAME = "GEMINI.md"besideCONST_CLAUDE_MD_FILENAME, aDEFAULT_AGENT_FILESentry "Pointer stub redirecting Gemini CLI to AGENTS.md", and the stub choice ingenerate_instruction_contentandgenerate_pointer_stubdriven by a table keyed on the filename (title, tool name, canonical relative path, whether it carries the@AGENTS.mdimport line) instead of another branch.- The generated
GEMINI.mdat the repository root, in the shape ofCLAUDE.md(the@AGENTS.mdimport line, the pointer note and the pre-1.0 alpha notice), written bydevops ai agentsand not by hand. - AGENTS.md: the canonical-source note names
GEMINI.mdbesideCLAUDE.mdand.github/copilot-instructions.md. The file ends this step at 39,979 of its 40,000 characters. - The documentation inventory in
src/devops_cli/config/constants.pylistsGEMINI.mdin classgenerated, likeCLAUDE.md, sodevops docs checkand the inventory test pass. devops docs generate --sync-readmefor the generated references the change touches.
What it deletes
The two string-test branches in generate_instruction_content and the filename == CONST_CLAUDE_MD_FILENAME special case in generate_pointer_stub, replaced by the table.
Tests
tests/test_agents_md_claims.py:test_instruction_stubs_byte_equal_to_generatorcoversGEMINI.mdbyte for byte.tests/test_instruction_generator.py:test_generate_pointer_stubcovers the Gemini stub (title, tool name,@AGENTS.md, link to./AGENTS.md, the alpha notice for this project and its absence for another), andscaffold_agent_instructionswith nofilesargument writesGEMINI.mdand skips an existing one without--force.- The documentation inventory test classifies
GEMINI.md.
Dependencies
Depends on the item titled "feat(openspec): scaffold OpenSpec and gate its change folders in devops ci". The stub itself does not need the scaffold, but the AGENTS.md edits of the sequence are measured one on top of the other, so this item follows it.
Planning record: this item is planned under the current rules (a task file).
Acceptance criteria
uv run devops ai agentsin this repository writesGEMINI.md, and the committed file is identical to the generator's output.GEMINI.mdpoints toAGENTS.mdand carries the@AGENTS.mdimport line.- Choosing a stub no longer branches on the file name in two places.
- AGENTS.md's canonical-source note names
GEMINI.md, and the file stays within its 40,000-character cap (39,979 with the ADR's wording). devops docs checkanddevops cipass.
Proposed design
Problem statement
The devops-cli project needs to generate a GEMINI.md pointer stub to ensure that the Gemini CLI agent can properly read AGENTS.md rules. Currently, only two of the three supported agents (Claude Code and Copilot) receive a pointer to AGENTS.md, while Gemini CLI does not, causing inconsistencies in project planning conventions.
Acceptance criteria
- Criterion 1:
uv run devops ai agentsin this repository writesGEMINI.md, and the committed file is identical to the generator's output.
Verification: Runuv run devops ai agentsand verify thatGEMINI.mdis generated with content matching the expected stub format. - Criterion 2:
GEMINI.mdpoints toAGENTS.mdand carries the@AGENTS.mdimport line.
Verification: Check that the generatedGEMINI.mdfile contains an@AGENTS.mdimport line pointing to the canonical AGENTS.md file. - Criterion 3: Choosing a stub no longer branches on the file name in two places.
Verification: Verify that the logic for selecting which stub to generate has been refactored to use a lookup table instead of string tests. - Criterion 4: AGENTS.md's canonical-source note names
GEMINI.md, and the file stays within its 40,000-character cap (39,979 with the ADR's wording).
Verification: Confirm that AGENTS.md includes a reference to GEMINI.md in its canonical source section and verify that it does not exceed the character limit. - Criterion 5:
devops docs checkanddevops cipass.
Verification: Rundevops docs checkanddevops cicommands to ensure they complete successfully without errors.
Key questions
- What is the current mechanism for generating stub files?: The existing generator in
src/devops_cli/ai/instruction_generator.pyuses string tests (target_file == CONST_CLAUDE_MD_FILENAME, then"copilot" in target_file) to choose which stub to generate, andgenerate_pointer_stubadds the@AGENTS.mdimport line only whenfilename == CONST_CLAUDE_MD_FILENAME. A third tool through those branches adds a third special case in two places. [sources: src/devops_cli/ai/instruction_generator.py] - How will the new GEMINI.md stub be implemented?: A
CONST_GEMINI_MD_FILENAME = "GEMINI.md"will be added besideCONST_CLAUDE_MD_FILENAME, aDEFAULT_AGENT_FILESentry for a pointer stub redirecting Gemini CLI to AGENTS.md, and the stub choice ingenerate_instruction_contentandgenerate_pointer_stubdriven by a table keyed on the filename instead of string tests. (proposed) [sources: src/devops_cli/ai/instruction_generator.py] - What are the requirements for AGENTS.md's character budget?: The AGENTS.md character budget is 40,000 and this step ends at 39,979 with the ADR's wording. [sources: src/devops_cli/ai/instruction_generator.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate introduces a new feature to generate a GEMINI.md pointer stub, which aligns with the 'feat' prefix in its title.This is part of a multi-step adoption of OpenSpec and enhances consistency across agent workflows, but is not critical or urgent.Improves consistency and usability for developers working with different AI agents but does not introduce core functionality or fix an immediate issue.Requires modifications to the instruction generator, addition of new constants, and updates to tests, but builds upon existing code and tools.dan-petty commentedon Oct 22, 2026
Status set to Ready at ae8c2d9 (see proposed design in issue body).
feat(agents): generate a GEMINI.md pointer stub from one table of stu…
dan-petty commentedon Oct 22, 2026
What changed
#1915, merged into
release/v0.2.39as f3b1748.22 file(s) changed.
How it was verified
Check runs at fc921e5:
Acceptance Criteria of
docs/agent/tasks/task-1845-gemini-md-pointer-stub.md:uv run devops ai agentsin this repository writesGEMINI.md. The committed file equals the output of the generator:test_instruction_stubs_byte_equal_to_generatorandtest_ai_agents_command_scaffolds_instructions.GEMINI.mdpoints toAGENTS.mdand holds the@./AGENTS.mdimport line, andCLAUDE.mdkeeps@AGENTS.md:test_generate_pointer_stubandtest_instruction_content_for_each_pointer_stub_comes_from_its_table_row../still selects the stub:test_instruction_content_for_a_stub_path_ignores_a_leading_dot_slash.devops ai agents --file GEMINI.mdwrites the stub alone and makes no model call:test_ai_agents_file_option_writes_only_the_gemini_stub_without_a_model_call.GEMINI.md. It skips an existing one without--force:test_scaffold_agent_instructionsandtest_scaffold_agent_instructions_skips_an_existing_gemini_stub_without_force. The devcontainerinitandpost-createtests also check thatGEMINI.mdis written.AGENTS.md, and of the generatedAGENTS.md, links every stub ofPOINTER_STUBS.AGENTS.mdstays under its cap:test_the_canonical_source_note_links_every_pointer_stubandtest_agents_md_stays_within_character_budget.GEMINI.mdas generated, anddevops docs checkpasses:test_the_generated_class_is_what_the_generator_writes.@AGENTS.md, drop the Gemini entry ofDEFAULT_AGENT_FILES, drop the./handling, drop Gemini from the file table ofcommands/ai.py, dropGEMINI.mdfrom the inventory and drop theGEMINI.mdlink from the canonical-source notes.changelog.d/1845.mdrecords the change.CHANGELOG.mdanddocs/ROADMAP.mdstay as they are./memory show. Check that the text ofAGENTS.mdis in the context. If it is not, file a defect that names the version./memory showcheck in a folder that Gemini CLI does not trust. Report whether the projectGEMINI.mdloads there. The source check covered the settings file and not this case..gemini/settings.jsonwithcontext.fileNameshould replace this stub. The section "Evidence" shows that it works only in a trusted workspace.feat(release): v0.2.39 (#1947)