Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document provides context, architectural principles, and best practices for AI coding assistants (GitHub Copilot, Claude, Cursor, Codex) working on this codebase or reviewing target repositories.

> **Canonical Source**: This file is the single source of truth for AI agent instructions. [CLAUDE.md](./CLAUDE.md) and [.github/copilot-instructions.md](./.github/copilot-instructions.md) are thin pointers to this file.
> **Canonical Source**: This file is the single source of truth for AI agent instructions. [CLAUDE.md](./CLAUDE.md), [GEMINI.md](./GEMINI.md) and [.github/copilot-instructions.md](./.github/copilot-instructions.md) are thin pointers to this file.

---

Expand Down
16 changes: 16 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# devops-cli — Gemini CLI Instructions

@./AGENTS.md

> **This file is a pointer, not the source.** Gemini CLI looks specifically for
> `GEMINI.md`, so this stub exists to redirect it. All actual instructions — project
> overview, build/test commands, code conventions, architecture, AI features,
> environment & modernization policy, and security notes — live in
> [AGENTS.md](./AGENTS.md). Read that file. `devops ai agents` regenerates
> this stub and leaves an existing AGENTS.md alone unless `--force` is given;
> do not duplicate content here.
>
> **Pre-1.0 Alpha Notice**: This codebase is active alpha software prior to release `1.0.0`
> with no backwards compatibility guarantees. The codebase must remain clean of legacy
> references and obsolete shims at all times. Post-1.0 releases adhere strictly to
> Semantic Versioning and enterprise change management (feature flags, deprecations, migrations).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ and excessive permissions fail it, and every other finding is shown. |
| | `devops ai preload` | Preload configured model into VRAM across all configured Ollama servers. |
| | `devops ai test [OPTIONS]` | Send a test prompt to verify AI provider connectivity across configured servers. |
| | `devops ai prewarm [OPTIONS]` | Prewarm local models into GPU VRAM or evict idle models across cluster nodes. |
| | `devops ai agents [OPTIONS]` | Generate LLM/Agent instruction files (AGENTS.md, CLAUDE.md, copilot-instructions.md). |
| | `devops ai agents [OPTIONS]` | Generate LLM/Agent instruction files (AGENTS.md, CLAUDE.md, GEMINI.md, copilot-instructions.md). |
| | `devops ai chat [OPTIONS]` | Start an interactive chat with a Pydantic AI persona (tools, thinking, streaming, RAG). |
| | `devops ai bundle-models [OPTIONS]` | Bundle Ollama model metadata into tarball for air-gapped DevContainers. |
| | `devops ai pipeline [OPTIONS] <prompt>` | Run a multi-agent Pydantic pipeline with shared DevOps tools and RAG context. |
Expand Down
5 changes: 5 additions & 0 deletions changelog.d/1845.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Added
- `devops ai agents` writes a `GEMINI.md` pointer stub, and this repository commits one. Gemini CLI loads `GEMINI.md` by default. It reads `AGENTS.md` only through its `context.fileName` setting. The stub holds an `@./AGENTS.md` import line, the form that the Gemini CLI documentation (v0.65.0) shows. One table, `POINTER_STUBS`, now chooses the title, the tool name, the link and the import line of each stub ([#1845](https://github.com/dan-petty/devops-cli/issues/1845)).

### Changed
- The `devops ai agents` command read its own second copy of the file table. The change deletes that copy. The command now reads `DEFAULT_AGENT_FILES` ([#1845](https://github.com/dan-petty/devops-cli/issues/1845)).
2 changes: 1 addition & 1 deletion docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3315,7 +3315,7 @@ devops ai prewarm [OPTIONS]

### `devops ai agents`

**Generate LLM/Agent instruction files (AGENTS.md, CLAUDE.md, copilot-instructions.md).**
**Generate LLM/Agent instruction files (AGENTS.md, CLAUDE.md, GEMINI.md, copilot-instructions.md).**

```bash
devops ai agents [OPTIONS]
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVCONTAINER_USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ devops devcontainer init --name my-project --image ghcr.io/dan-petty/devops-cli/
This scaffolds:
1. `.devcontainer/devcontainer.json`: Pre-configured manifest using the published image with `/tmp`, persistent user home volume, SSH directory forwarding, post-create lifecycle commands (`devops devcontainer post-create`), and IDE extensions.
2. `.vscode/mcp.json`: Model Context Protocol configuration exposing `devops-cli` tools to AI coding assistants (Claude Desktop, Cursor, VS Code, Antigravity IDE).
3. `AGENTS.md`, `CLAUDE.md` and `.github/copilot-instructions.md`: Operational engineering instructions and architectural constraints for AI pair programmers.
3. `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` and `.github/copilot-instructions.md`: Operational engineering instructions and architectural constraints for AI pair programmers.
4. `.mcp.json`: the same MCP server for Claude Code.

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ git merge # two archived changes to one capability: CONFLICT; two unarchived,
- **Delivery.** `tools.lock` gains an `npm` kind. `[npm.openspec]` pins 1.14.3 beside `src/devops_cli/tools_lock/openspec/package.json` (the exact version) and `package-lock.json` (57 packages, all sha512, all on `registry.npmjs.org`, none with an install script), and `tools_lock_digest()` covers both. `devops install-tools` stages beside the version directory, copies the two files and two empty npmrc files, runs `npm ci --ignore-scripts --no-audit --no-fund --engine-strict --replace-registry-host=never` in the sanitized environment plus an explicit `npm_config_cache`, `npm_config_userconfig` and `npm_config_globalconfig` (npm refuses user and global config that are one file, and a configured registry would otherwise rewrite the lock's URLs), renames into `<user_data_root>/tools/openspec/1.14.3` and links `node_modules/.bin/openspec` into `~/.local/bin`. `devops devcontainer post-create` (the devcontainer's `postCreateCommand`) already installs every lock tool, and the prototype took 4.9 s cold. It reports a failed bootstrap, a missing `npm` or a failed `npm ci`, as a warning, so the hard failure is `devops install-tools`, which fails early with `require_binary("npm", ...)` since the installer provisions no runtime, Python's included, and the gate row. `.node-version` holds `24`, the devcontainer's `node` feature is pinned to `24`, a contract test keeps the two equal, and CI's `static` job runs `actions/setup-node` pinned to v7.1.0 (`949feb2413d6458794dcd2491c4babbbce0c15c1`, resolved with `devops gh api`) and `uv run devops install-tools --tool openspec --only-missing` before the gate. The `audit` row of `devops ci` gains `npm audit --package-lock-only --json --prefix src/devops_cli/tools_lock/openspec` beside `uv audit` (tried against the pin: no vulnerabilities, no install needed), so a vulnerable pin fails the gate; nothing signals a stale one. npm exits 1 for a finding and for an audit that could not run, such as an unreachable registry, so each command is read by its own signal: uv by its exit status (1 against 2), npm by its JSON report (`metadata.vulnerabilities` counts against an `error` object). The bump runbook in the `tools.lock` header: set the version in `tools.lock` and `package.json`; run `npm install --package-lock-only --ignore-scripts`; run `uv run devops openspec regenerate` and commit the skills; run the gate; run `npm audit signatures` and `osv-scanner scan source --lockfile package-lock.json`; run the lock and installer tests; run `devops install-tools --check`. The pin never goes below 1.14.3, which fixes `validate --all` hanging under pre-commit (from its release notes; not reproduced). The `Dockerfile` service stage gains a digest-pinned Node stage and `npm ci --ignore-scripts` from the same lockfile (step 6), because the cut runs there when the roadmap Service runs (#1562 suspends it; until then a person's `devops release prepare` runs the cut).
- **Where the binary comes from.** The devcontainer gets it from post-create and CI's `static` job from its install step. The Copilot cloud agent gets it from `copilot-setup-steps.yml`, which GitHub runs only from the default branch: until the release that carries the file merges to `main`, that agent finds the committed skills and no binary. Claude Code in the cloud and a Gemini CLI host shell get it from `uv run devops install-tools --tool openspec --only-missing`, which needs Node 24, and AGENTS.md says so. Every generated skill starts with `openspec list --json` and has no branch for a missing binary, so AGENTS.md also tells an agent that cannot install it to write the artifacts by hand from `openspec/config.yaml`, and CI validates them.
- **Telemetry and regeneration.** Telemetry is off in every environment. The gate and hook module sets `DO_NOT_TRACK=1`, `OPENSPEC_TELEMETRY=0`, `OPENSPEC_NO_UPDATE_CHECK=1`, `OPEN_SPEC_INTERACTIVE=0` and `XDG_CONFIG_HOME` in the child's environment (the `env` argument of `run_subprocess`, not `extra_allowed_env`, which only keeps a variable the parent already has), because the sanitized child environment of `devops` (the allowlist in `src/devops_cli/core/process.py`) keeps `HOME` and `CI` but none of these, and without `XDG_CONFIG_HOME` the tool would read the developer's real `~/.config/openspec`. The devcontainer sets `OPENSPEC_TELEMETRY=0` and `OPENSPEC_NO_UPDATE_CHECK=1` beside its `DO_NOT_TRACK=1`, and its template and test follow. CI sets `DO_NOT_TRACK: "1"` at the top of the workflow, though the runner's `CI=true` already suffices. The committed `.claude/settings.json` gains an `env` block with the same variables. A host shell or another agent's cloud environment runs `OPENSPEC_TELEMETRY=0 openspec config set telemetry.enabled false` once, a person step, with the prefix, since the command sends an event first. The skills are regenerated only against an isolated config: `uv run devops openspec regenerate` makes a temporary `XDG_CONFIG_HOME`, sets `telemetry.enabled false`, `delivery skills`, `profile custom` and the four workflows in it, and runs `openspec update --force` in the tree (which changed no file on a second machine; the same command under the `core` profile would also add the archive and sync skills); a bare `openspec update` is forbidden because it takes the user's global profile.
- **Agent files and `openspec/config.yaml`.** The generated skills are committed: a cloud agent or fresh clone never runs an install but reads the checkout. `.gitignore` re-includes only `.claude/skills/openspec-*/` (`!.claude/skills/` then `.claude/skills/*` then `!.claude/skills/openspec-*/`, tried: other skills, `settings.local.json` and `worktrees` stay ignored). A hermetic test requires `metadata.generatedBy` in all eight `SKILL.md` to equal the pin, and the two trees to be identical. The `.claude/settings.json` allowlist gains the verbs the four skills call (`openspec status`, `list`, `instructions`, `context`, `show`, `schemas`, `validate` and `new change`), and no bare `Bash(openspec *)`. It also gains `permissions.deny` entries for `openspec init`, `update`, `archive`, `config` and `completion`: every generated skill carries `allowed-tools: Bash(openspec:*)`, which grants the whole verb set during the turn and which the project never hand-edits, and Claude Code evaluates deny rules before allow rules, so a deny entry holds where a narrow allowlist would not (documentation read on 2026-10-22; a Bash deny rule is not a security boundary around the program, so readiness stays the backstop). `GEMINI.md` is added as a third pointer stub (`@AGENTS.md`) through the existing generator, since Gemini CLI loads `GEMINI.md` by default and `AGENTS.md` only through `context.fileName`. `.github/workflows/copilot-setup-steps.yml` is written by hand, with SHA-pinned actions, the pinned install and the opt-outs; `--copilot-cloud` is not used, because its generated workflow runs an unpinned `actions/checkout@v4` and `npm install -g @fission-ai/openspec`. `devops ai agents` generates no OpenSpec file. The default `spec-driven` schema is kept: a fork copies 16 KB of upstream instructions and four templates that change weekly, and the project needs no structural change. Rules are advisory prompts, so what must hold keeps a mechanical check: the gate, readiness and `tests/test_change_folders.py` (every active folder is named `<issue>-<slug>`; `proposal.md` and `tasks.md` exist and `tasks.md` holds at least one `## <n>.` group with a task-list item, since a folder of only `.openspec.yaml` and a delta passes `openspec validate --strict` and the readiness path rule (tried); `proposal.md` has `## Feasibility` and `## Existing Tool Considered` headings found with the markdown parser already a dependency; and no `PR`, `Status`, `Milestone` or `Priority` line). AGENTS.md states only what binds an agent that never runs `openspec` (where the folder lives, who archives, the entry points and the no-binary fallback) and points to `config.yaml` for every artifact convention; the one fact in both, the folder name, is enforced by readiness and that test, so no test has to keep the two documents in agreement. The file below was rendered through `openspec instructions` for the proposal, specs, design, tasks and apply operations with an empty stderr. The folded scalars (`- >-`) are not decoration: a plain scalar containing ` #` is silently cut at the comment and an unknown top-level key is silently ignored, so a hermetic test parses the file with `yaml.compose`, allows only the keys `schema`, `context`, `rules` and `operations` and only folded or literal scalars as rule items. The other defects print a warning with exit 0 (a plain scalar containing `: ` becomes a mapping and the guidance is dropped, a rule under an unknown artifact id is ignored, and a context over 50 KB is ignored), which the gate fails on.
- **Agent files and `openspec/config.yaml`.** The generated skills are committed: a cloud agent or fresh clone never runs an install but reads the checkout. `.gitignore` re-includes only `.claude/skills/openspec-*/` (`!.claude/skills/` then `.claude/skills/*` then `!.claude/skills/openspec-*/`, tried: other skills, `settings.local.json` and `worktrees` stay ignored). A hermetic test requires `metadata.generatedBy` in all eight `SKILL.md` to equal the pin, and the two trees to be identical. The `.claude/settings.json` allowlist gains the verbs the four skills call (`openspec status`, `list`, `instructions`, `context`, `show`, `schemas`, `validate` and `new change`), and no bare `Bash(openspec *)`. It also gains `permissions.deny` entries for `openspec init`, `update`, `archive`, `config` and `completion`: every generated skill carries `allowed-tools: Bash(openspec:*)`, which grants the whole verb set during the turn and which the project never hand-edits, and Claude Code evaluates deny rules before allow rules, so a deny entry holds where a narrow allowlist would not (documentation read on 2026-10-22; a Bash deny rule is not a security boundary around the program, so readiness stays the backstop). `GEMINI.md` is added as a third pointer stub (`@./AGENTS.md`, the form the Gemini CLI documentation shows) through the existing generator, since Gemini CLI loads `GEMINI.md` by default and `AGENTS.md` only through `context.fileName`. `.github/workflows/copilot-setup-steps.yml` is written by hand, with SHA-pinned actions, the pinned install and the opt-outs; `--copilot-cloud` is not used, because its generated workflow runs an unpinned `actions/checkout@v4` and `npm install -g @fission-ai/openspec`. `devops ai agents` generates no OpenSpec file. The default `spec-driven` schema is kept: a fork copies 16 KB of upstream instructions and four templates that change weekly, and the project needs no structural change. Rules are advisory prompts, so what must hold keeps a mechanical check: the gate, readiness and `tests/test_change_folders.py` (every active folder is named `<issue>-<slug>`; `proposal.md` and `tasks.md` exist and `tasks.md` holds at least one `## <n>.` group with a task-list item, since a folder of only `.openspec.yaml` and a delta passes `openspec validate --strict` and the readiness path rule (tried); `proposal.md` has `## Feasibility` and `## Existing Tool Considered` headings found with the markdown parser already a dependency; and no `PR`, `Status`, `Milestone` or `Priority` line). AGENTS.md states only what binds an agent that never runs `openspec` (where the folder lives, who archives, the entry points and the no-binary fallback) and points to `config.yaml` for every artifact convention; the one fact in both, the folder name, is enforced by readiness and that test, so no test has to keep the two documents in agreement. The file below was rendered through `openspec instructions` for the proposal, specs, design, tasks and apply operations with an empty stderr. The folded scalars (`- >-`) are not decoration: a plain scalar containing ` #` is silently cut at the comment and an unknown top-level key is silently ignored, so a hermetic test parses the file with `yaml.compose`, allows only the keys `schema`, `context`, `rules` and `operations` and only folded or literal scalars as rule items. The other defects print a warning with exit 0 (a plain scalar containing `: ` becomes a mapping and the guidance is dropped, a rule under an unknown artifact id is ignored, and a context over 50 KB is ignored), which the gate fails on.

```yaml
schema: spec-driven
Expand Down
Loading
Loading