From 6d61cdebef60046a829ddc6e49f3e04dca511c5a Mon Sep 17 00:00:00 2001 From: Jakob Heuser Date: Wed, 25 Nov 2026 15:20:05 -0800 Subject: [PATCH] feat(onboard): read GEMINI.md as an agent-memory source Gemini CLI's context file was already a detection signal for install, but untested, and the onboarding recipe never told the agent to read it. Add it to the agent-memory sources (with nested copies and the context.fileName rename), credit it under agent-files, bump the onboard and report topics, and test both Gemini detection signals. --- .changeset/gemini-md-onboarding.md | 5 +++++ packages/cli/src/agent/onboard.md | 12 ++++++++---- packages/cli/src/agent/report.md | 4 ++-- packages/cli/test/install.test.ts | 14 ++++++++++++++ packages/cli/test/onboard.test.ts | 4 ++-- packages/cli/test/report.test.ts | 2 +- 6 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 .changeset/gemini-md-onboarding.md diff --git a/.changeset/gemini-md-onboarding.md b/.changeset/gemini-md-onboarding.md new file mode 100644 index 000000000..4134f4ada --- /dev/null +++ b/.changeset/gemini-md-onboarding.md @@ -0,0 +1,5 @@ +--- +"@taskless/cli": patch +--- + +Onboarding now reads Gemini CLI's `GEMINI.md` as an agent-memory source, including nested copies and any file `context.fileName` in `.gemini/settings.json` renames it to, and the report credits it under `agent-files`. Install detection of Gemini CLI from `GEMINI.md` or `.gemini/` is now covered by tests. diff --git a/packages/cli/src/agent/onboard.md b/packages/cli/src/agent/onboard.md index db8e56510..def386b42 100644 --- a/packages/cli/src/agent/onboard.md +++ b/packages/cli/src/agent/onboard.md @@ -1,4 +1,4 @@ -# Topic: onboard (CLI v%(CLI_VERSION)s / topic v15) +# Topic: onboard (CLI v%(CLI_VERSION)s / topic v16) %(ONE_COMMAND_PER_CALL)s @@ -168,8 +168,12 @@ Use all of these that apply: and `HACK` comments. Many of these are latent rules ("don't do this", "remove when X"). - **Agent-memory files**: read `CLAUDE.md`, `AGENTS.md`, - `.cursorrules`, `.opencode/AGENTS.md`, and similar agent-context - files for explicit rules and conventions stated in prose. + `GEMINI.md`, `.cursorrules`, `.opencode/AGENTS.md`, and similar + agent-context files for explicit rules and conventions stated in + prose. Gemini CLI also reads a `GEMINI.md` in any subdirectory, and + `context.fileName` in `.gemini/settings.json` can rename the file + (a string or a list of names), so read whatever that setting names + too. %(SOURCE_PR_REVIEW)s - **Commit history**: read the commit messages over the same window for fixes that recur: the same missing header added again, the @@ -232,7 +236,7 @@ pattern, under its kind: - `commits`: a commit in the window that made the fix - `issues`: an issue, ticket, recorded decision, or a comment on one - `conventions`: a TODO, FIXME, XXX, or HACK comment asking for it -- `agent-files`: a line in CLAUDE.md, AGENTS.md, or similar +- `agent-files`: a line in CLAUDE.md, AGENTS.md, GEMINI.md, or similar - `docs`: a passage in the docs, `@deprecated` and the like included - `tests`: a test that pins the behaviour diff --git a/packages/cli/src/agent/report.md b/packages/cli/src/agent/report.md index 88f98eab2..91220f34e 100644 --- a/packages/cli/src/agent/report.md +++ b/packages/cli/src/agent/report.md @@ -1,4 +1,4 @@ -# Topic: report (CLI v%(CLI_VERSION)s / topic v10) +# Topic: report (CLI v%(CLI_VERSION)s / topic v11) %(ONE_COMMAND_PER_CALL)s @@ -173,7 +173,7 @@ pattern. Code that merely follows a pattern is not a call-out. | `reviews` | a review comment; its count is `surfaced`, not evidence | | `commits` | a commit inside `window` that made the fix | | `issues` | an issue, ticket, recorded decision, or comment on one | -| `agent-files` | a line in CLAUDE.md, AGENTS.md, or similar | +| `agent-files` | a line in CLAUDE.md, AGENTS.md, GEMINI.md, or similar | | `conventions` | a TODO, FIXME, XXX, or HACK comment asking for it | | `docs` | a docs passage, `@deprecated` and the like included | | `tests` | a test that pins the behaviour | diff --git a/packages/cli/test/install.test.ts b/packages/cli/test/install.test.ts index 25fd3abc6..db7253f92 100644 --- a/packages/cli/test/install.test.ts +++ b/packages/cli/test/install.test.ts @@ -75,6 +75,20 @@ describe("detectTools", () => { expect(tools[0]!.name).toBe("Cursor"); }); + it("detects Gemini CLI via .gemini/ directory", async () => { + await mkdir(join(cwd, ".gemini"), { recursive: true }); + const tools = await detectTools(cwd); + expect(tools).toHaveLength(1); + expect(tools[0]!.name).toBe("Gemini CLI"); + }); + + it("detects Gemini CLI via GEMINI.md file", async () => { + await writeFile(join(cwd, "GEMINI.md"), "", "utf8"); + const tools = await detectTools(cwd); + expect(tools).toHaveLength(1); + expect(tools[0]!.name).toBe("Gemini CLI"); + }); + it("returns multiple tools when multiple signals exist", async () => { await mkdir(join(cwd, ".claude"), { recursive: true }); await mkdir(join(cwd, ".cursor"), { recursive: true }); diff --git a/packages/cli/test/onboard.test.ts b/packages/cli/test/onboard.test.ts index cf2105a72..1093267ae 100644 --- a/packages/cli/test/onboard.test.ts +++ b/packages/cli/test/onboard.test.ts @@ -422,8 +422,8 @@ describe("onboard recipe asks one question and finishes on its own", () => { : stdout.slice(start, start + title.length + next); } - it("is topic v15", () => { - expect(stdout).toMatch(/^# Topic: onboard {5}\(CLI v.+ \/ topic v15\)/m); + it("is topic v16", () => { + expect(stdout).toMatch(/^# Topic: onboard {5}\(CLI v.+ \/ topic v16\)/m); }); // v10 (#554): a worktree holds only commits, and `init` commits nothing, so diff --git a/packages/cli/test/report.test.ts b/packages/cli/test/report.test.ts index 4c07e421b..2a17e4b09 100644 --- a/packages/cli/test/report.test.ts +++ b/packages/cli/test/report.test.ts @@ -1416,7 +1416,7 @@ describe("taskless report", () => { // The counting and estimating guidance is on demand (#672); --full prints it. const { stdout, exitCode } = await run(["agent", "report", "--full"]); expect(exitCode).toBe(0); - expect(stdout).toMatch(/^# Topic: report {5}\(CLI v.+ \/ topic v10\)/m); + expect(stdout).toMatch(/^# Topic: report {5}\(CLI v.+ \/ topic v11\)/m); const flat = stdout.replaceAll(/\s+/g, " "); const counting = flat.slice(flat.indexOf("## Counting evidence")); expect(counting).toContain(