SaylorTwift HF Staff commited on
Commit
e3e619b
·
verified ·
1 Parent(s): 7a1ad33

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gemini/commands/code-guide.toml +39 -0
  2. .gemini/commands/core.toml +29 -0
  3. .gemini/commands/find-docs.toml +30 -0
  4. .gemini/commands/frontend.toml +20 -0
  5. .gemini/commands/full-context.toml +23 -0
  6. .gemini/commands/introspect.toml +16 -0
  7. .gemini/commands/prompt-suggest.toml +22 -0
  8. .gemini/commands/review-and-fix.toml +99 -0
  9. .gemini/commands/review-frontend.toml +31 -0
  10. .gemini/commands/strict-development-rules.md +158 -0
  11. .gemini/skills/agent-tui/SKILL.md +330 -0
  12. .gemini/skills/async-pr-review/SKILL.md +45 -0
  13. .gemini/skills/async-pr-review/policy.toml +148 -0
  14. .gemini/skills/behavioral-evals/SKILL.md +56 -0
  15. .gemini/skills/behavioral-evals/assets/interactive_eval.ts.txt +27 -0
  16. .gemini/skills/behavioral-evals/assets/standard_eval.ts.txt +30 -0
  17. .gemini/skills/behavioral-evals/references/creating.md +151 -0
  18. .gemini/skills/behavioral-evals/references/fixing.md +100 -0
  19. .gemini/skills/behavioral-evals/references/promoting.md +55 -0
  20. .gemini/skills/behavioral-evals/references/running.md +95 -0
  21. .gemini/skills/ci/SKILL.md +66 -0
  22. .gemini/skills/ci/scripts/ci.mjs +281 -0
  23. .gemini/skills/code-reviewer/SKILL.md +65 -0
  24. .gemini/skills/docs-changelog/SKILL.md +168 -0
  25. .gemini/skills/docs-changelog/references/highlights_examples.md +68 -0
  26. .gemini/skills/docs-changelog/references/index_template.md +10 -0
  27. .gemini/skills/docs-changelog/references/latest_template.md +20 -0
  28. .gemini/skills/docs-changelog/references/preview_template.md +22 -0
  29. .gemini/skills/docs-writer/SKILL.md +194 -0
  30. .gemini/skills/docs-writer/quota-limit-style-guide.md +61 -0
  31. .gemini/skills/docs-writer/references/docs-auditing.md +195 -0
  32. .gemini/skills/github-issue-creator/SKILL.md +76 -0
  33. .gemini/skills/pr-address-comments/SKILL.md +13 -0
  34. .gemini/skills/pr-address-comments/scripts/fetch-pr-info.js +160 -0
  35. .gemini/skills/pr-creator/SKILL.md +93 -0
  36. .gemini/skills/review-duplication/SKILL.md +69 -0
  37. .gemini/skills/string-reviewer/SKILL.md +99 -0
  38. .gemini/skills/string-reviewer/references/settings.md +28 -0
  39. .gemini/skills/string-reviewer/references/word-list.md +61 -0
  40. .gemini/skills/tui-tester/SKILL.md +65 -0
  41. .gitattributes +26 -0
  42. docs/assets/connected_devtools.png +3 -0
  43. docs/assets/monitoring-dashboard-logs.png +3 -0
  44. docs/assets/release_patch.png +3 -0
  45. docs/assets/theme-ansi-dark.png +3 -0
  46. docs/assets/theme-ansi-light.png +3 -0
  47. docs/assets/theme-atom-one-dark.png +3 -0
  48. docs/assets/theme-ayu-dark.png +3 -0
  49. docs/assets/theme-ayu-light.png +3 -0
  50. docs/assets/theme-custom.png +3 -0
.gemini/commands/code-guide.toml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description = "Answer questions about the Gemini CLI codebase with explanations and code snippets."
2
+
3
+ prompt = """
4
+ ## Mission: Explain the Gemini CLI Codebase
5
+
6
+ Your primary task is to help a new engineer understand the Gemini CLI codebase by answering their questions about architecture, specific functions, and project structure.
7
+
8
+
9
+ ### Objective:
10
+
11
+ Your primary task is to help a new engineer understand the Gemini CLI codebase. You will answer their questions about architecture, specific functions, and project structure by providing clear explanations grounded in the actual source code.
12
+
13
+
14
+ ### Instructions:
15
+
16
+ 1. **Always Consult "Getting Started"**: Before providing any answer, you MUST first consult the getting started documentation located in the `docs/get-started` folder.
17
+
18
+ 2. **Consult Documentation and Specific Folders**: Before answering, you MUST first consult any relevant documentation within the `docs` folder. Base all your code-related answers exclusively on the contents of the following folders: `integration-tests`, `packages`, and `scripts`.
19
+
20
+ 3. **Provide Specific Code Examples**: Always support your explanations with relevant code snippets. You MUST include the full file path (e.g., `packages/gemini/core.py`) so the user can easily locate the code.
21
+
22
+ 4. **Explain the "Why"**: Go beyond simply showing the code. Explain the design choices and the rationale behind the implementation. Discuss why a particular approach was taken and what trade-offs might have been considered.
23
+
24
+ 5. **Suggest a Learning Path**: Where appropriate, guide the user by suggesting related files to examine next or other relevant concepts to explore within the codebase to deepen their understanding.
25
+
26
+ 6. **Handle Unknowns Gracefully**: If the answer cannot be found in the provided folders and documentation, you must state that the information is unavailable and ask the user for clarification. Do not invent answers or speculate.
27
+
28
+
29
+ ### Constraints:
30
+
31
+
32
+ 1. No Hallucination: If the answer cannot be found in the provided context, you must state that the information is unavailable and ask the user for clarification. Do not invent answers or speculate.
33
+
34
+ 2. Stay Focused: Only answer questions directly related to the Gemini CLI project within the specified folders.
35
+
36
+ ### QUESTION:
37
+
38
+ {{args}}
39
+ """
.gemini/commands/core.toml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description="Injects context of all relevant cli files"
2
+ prompt = """
3
+ The following output contains the complete
4
+ source code of packages/core.
5
+ **Pay extremely close attention to these files.** They define the project's
6
+ core architecture, component patterns, and testing standards.
7
+
8
+ The source code contains the content of absolutely every source code file in
9
+ packages/core.
10
+ You should very rarely need to read any other files from packages/core to resolve
11
+ prompts.
12
+
13
+ !{find packages/core \\( -path packages/cli/dist -o -path packages/core/dist -o -name node_modules \\) -prune -o -type f \\( -name "*.ts" -o -name "*.tsx" \\) ! -name "*.test.ts" ! -name "*.test.tsx" ! -name "*.d.ts" -exec echo "--- {} ---" \\; -exec cat {} \\;}
14
+
15
+ In addition to the code context, you MUST strictly adhere to the following frontend-specific development guidelines when writing code in packages/core.
16
+
17
+ ## Configuration & Settings
18
+ * **Settings vs Args**: Use settings for user-configurable options; do not add new CLI arguments.
19
+ * **Schema**: Add new settings to `packages/cli/src/config/settingsSchema.ts`.
20
+ * **Documentation**:
21
+ * If `showInDialog: true`, document in `docs/get-started/configuration.md`.
22
+ * Ensure `requiresRestart` is correctly set.
23
+
24
+ ## General
25
+ * **Logging**: Use `debugLogger` for errors. NEVER leave `console.log/warn/error` in the code.
26
+ * **TypeScript**: Avoid the non-null assertion operator (`!`).
27
+
28
+ {{args}}.
29
+ """
.gemini/commands/find-docs.toml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description = "Find relevant documentation and output GitHub URLs."
2
+
3
+ prompt = """
4
+ ## Mission: Find Relevant Documentation
5
+
6
+ Your task is to find documentation files relevant to the user's question within the current git repository and provide a list of GitHub URLs to view them.
7
+
8
+ ### Workflow:
9
+
10
+ 1. **Identify Repository Details**:
11
+ * You may use shell commands like `git` or `gh` to get the remote URL of the repository.
12
+ * From the remote URL, parse and construct the base GitHub URL (e.g., `https://github.com/user/repo`). You must handle both HTTPS (`https://github.com/user/repo.git`) and SSH (`git@github.com:user/repo.git`) formats.
13
+ * Determine the default branch name. You can assume `main` for this purpose, as it is the most common.
14
+
15
+ 2. **Search for Documentation**:
16
+ * First, perform a targeted search across the repository for documentation files (e.g., `.md`, `.mdx`) that seem directly related to the user's question.
17
+ * If this initial search yields no relevant results, and a `docs/` directory exists, read the content of all files within the `docs/` directory to find relevant information.
18
+ * If you still can't find a direct match, broaden your search to include related concepts and synonyms of the keywords in the user's question.
19
+ * For each file you identify as potentially relevant, read its content to confirm it addresses the user's query.
20
+
21
+ 3. **Construct and Output URLs**:
22
+ * For each file you identify as relevant, construct the full GitHub URL by combining the base URL, branch, and file path. **Do not use shell commands for this step.**
23
+ * The URL format should be: `{BASE_GITHUB_URL}/blob/{BRANCH_NAME}/{PATH_TO_FILE_FROM_REPO_ROOT}`.
24
+ * Present the final list to the user as a markdown list. Each item in the list should be the URL to the document, followed by a short summary of its content.
25
+ * If, after all search attempts, you cannot find any relevant documentation, ask the user clarifying questions to better understand their needs. Do not return any URLs in this case.
26
+
27
+ ### QUESTION:
28
+
29
+ {{args}}
30
+ """
.gemini/commands/frontend.toml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description="Injects context of all relevant cli files"
2
+ prompt = """
3
+ The source code contains the content of absolutely every source code file in
4
+ packages/cli and key files from packages/core. In addition to the source code, the following test files are
5
+ included as they are test files that conform to the project's testing standards:
6
+ `packages/cli/src/ui/components/InputPrompt.test.tsx` and `packages/cli/src/ui/App.test.tsx`.
7
+ You should very rarely need to read any other files from packages/cli to resolve
8
+ prompts.
9
+
10
+ !{find packages/cli -path packages/cli/dist -prune -o -type f \\( -name "*.ts" -o -name "*.tsx" \\) ! -name "*.test.ts" ! -name "*.test.tsx" ! -name "*.d.ts" -exec echo "--- {} ---" \\; -exec cat {} \\; && echo "--- packages/cli/src/ui/components/InputPrompt.test.tsx ---" && cat packages/cli/src/ui/components/InputPrompt.test.tsx && echo "--- packages/cli/src/ui/App.test.tsx ---" && cat packages/cli/src/ui/App.test.tsx && echo "--- packages/core/src/core/coreToolScheduler.ts ---" && cat packages/core/src/core/coreToolScheduler.ts && echo "--- packages/core/src/core/nonInteractiveToolExecutor.ts ---" && cat packages/core/src/core/nonInteractiveToolExecutor.ts && echo "--- packages/core/src/confirmation-bus/message-bus.ts ---" && cat packages/core/src/confirmation-bus/message-bus.ts && echo "--- packages/core/src/confirmation-bus/types.ts ---" && cat packages/core/src/confirmation-bus/types.ts && echo "--- packages/core/src/utils/events.ts ---" && cat packages/core/src/utils/events.ts && echo "--- packages/core/src/core/client.ts ---" && cat packages/core/src/core/client.ts && echo "--- packages/core/src/core/geminiChat.ts ---" && cat packages/core/src/core/geminiChat.ts && echo "--- packages/core/src/core/turn.ts ---" && cat packages/core/src/core/turn.ts && echo "--- packages/core/src/agents/executor.ts ---" && cat packages/core/src/agents/executor.ts && echo "--- packages/core/src/telemetry/types.ts ---" && cat packages/core/src/telemetry/types.ts && echo "--- packages/core/src/telemetry/loggers.ts ---" && cat packages/core/src/telemetry/loggers.ts && echo "--- packages/core/src/telemetry/uiTelemetry.ts ---" && cat packages/core/src/telemetry/uiTelemetry.ts}
11
+
12
+ **Pay extremely close attention to these files.** They define the project's
13
+ core architecture, component patterns, and testing standards.
14
+
15
+ In addition to the code context, you MUST strictly adhere to the following frontend-specific development guidelines while adding code to packages/cli.
16
+
17
+ !{cat .gemini/commands/strict-development-rules.md}
18
+
19
+ {{args}}.
20
+ """
.gemini/commands/full-context.toml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description="Injects context of all relevant cli files"
2
+ prompt = """
3
+ The following output contains the complete
4
+ source code of the gemini cli library (`packages/cli`), and {packages/core} and representative test files
5
+ (`packages/cli/src/ui/components/InputPrompt.test.tsx` and `packages/cli/src/ui/App.test.tsx`) that best conform to the project's testing standards.
6
+ **Pay extremely close attention to these files.** They define the project's
7
+ core architecture, component patterns, and testing standards.
8
+
9
+ The source code contains the content of absolutely every source code file in
10
+ packages/cli and packages/core. In addition to the source code, the following test files are
11
+ included as they are test files that conform to the project's testing standards:
12
+ `packages/cli/src/ui/components/InputPrompt.test.tsx` and `packages/cli/src/ui/App.test.tsx`.
13
+ You should very rarely need to read any other files from packages/cli to resolve
14
+ prompts.
15
+
16
+ !{find packages/cli packages/core \\( -path packages/cli/dist -o -path packages/core/dist -o -name node_modules \\) -prune -o -type f \\( -name "*.ts" -o -name "*.tsx" \\) ! -name "*.test.ts" ! -name "*.test.tsx" ! -name "*.d.ts" -exec echo "--- {} ---" \\; -exec cat {} \\; && echo "--- packages/cli/src/ui/components/InputPrompt.test.tsx ---" && cat packages/cli/src/ui/components/InputPrompt.test.tsx && echo "--- packages/cli/src/ui/App.test.tsx ---" && cat packages/cli/src/ui/App.test.tsx}
17
+
18
+ In addition to the code context, you MUST strictly adhere to the following frontend-specific development guidelines when writing code in packages/cli.
19
+
20
+ !{cat .gemini/commands/strict-development-rules.md}
21
+
22
+ {{args}}.
23
+ """
.gemini/commands/introspect.toml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description = "Analyze the influence of system instructions on a specific action."
2
+ prompt = """
3
+ # Introspection Task
4
+
5
+ Take a step back and analyze your own system instructions and internal logic.
6
+ The user is curious about the reasoning behind a specific action or decision you've made.
7
+
8
+ **Specific point of interest:** {{args}}
9
+
10
+ Please provide a detailed breakdown of:
11
+ 1. Which parts of your system instructions (global, workspace-specific, or provided via GEMINI.md) influenced this behavior?
12
+ 2. What was your internal thought process leading up to this action?
13
+ 3. Are there any ambiguities or conflicting instructions that played a role?
14
+
15
+ Your goal is to provide transparency into your underlying logic so the user can potentially improve the instructions in the future.
16
+ """
.gemini/commands/prompt-suggest.toml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description = "Analyze agent behavior and suggest high-level improvements to system prompts."
2
+ prompt = """
3
+ # Prompt Engineering Analysis
4
+
5
+ You are a world-class prompt engineer and an expert AI engineer at the top of your class. Your goal is to analyze a specific agent behavior or failure and suggest high-level improvements to the system instructions.
6
+
7
+ **Observed Behavior / Issue:**
8
+ {{args}}
9
+
10
+ **Reference Context:**
11
+ - System Prompt Logic: @packages/core/src/core/prompts.ts
12
+
13
+ ### Task
14
+ 1. **Analyze the Failure:** Review the provided behavior and identify the underlying instructional causes. Use the `/introspect` command output if provided by the user.
15
+ 2. **Strategic Insights:** Share your technical view of the issue. Focus on the "why" and identify any instructional inertia or ambiguity.
16
+ 3. **Propose Improvements:** Suggest high-level changes to the system instructions to prevent this behavior.
17
+
18
+ ### Principles
19
+ - **Avoid Hyper-scoping:** Do not create narrow solutions for specific scenarios; aim for generalized improvements that handle classes of behavior.
20
+ - **Avoid Specific Examples in Suggestions:** Keep the proposed instructions semantic and high-level to prevent the agent from over-indexing on specific cases.
21
+ - **Maintain Operational Rigor:** Ensure suggestions do not compromise safety, security, or the quality of the agent's work.
22
+ """
.gemini/commands/review-and-fix.toml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description = "Reviews a PR or staged changes and automatically initiates a Pickle Fix loop for findings."
2
+ prompt = """
3
+ You are an expert Reviewer and Pickle Rick Worker.
4
+
5
+ Target: {{args}}
6
+
7
+ Phase 1: Review
8
+ Follow these steps to conduct a thorough review:
9
+
10
+ 1. **Gather Context**:
11
+ * If `{{args}}` is 'staged' or `{{args}}` is empty:
12
+ * Use `git diff --staged` to view the changes.
13
+ * Use `git status` to see the state of the repository.
14
+ * Otherwise:
15
+ * Use `gh pr view {{args}}` to pull the information of the PR.
16
+ * Use `gh pr diff {{args}}` to view the diff of the PR.
17
+ 2. **Understand Intent**:
18
+ * If `{{args}}` is 'staged' or `{{args}}` is empty, infer the intent from the changes and the current task.
19
+ * Otherwise, use the PR description. If it's not detailed enough, note it in your review.
20
+ 3. **Check Commit Style**:
21
+ * Ensure the PR title (or intended commit message) follows Conventional Commits. Examples of recent commits: !{git log --pretty=format:"%s" -n 5}
22
+ 4. Search the codebase if required.
23
+ 5. Write a concise review of the changes, keeping in mind to encourage strong code quality and best practices. Pay particular attention to the Gemini MD file in the repo.
24
+ 6. Consider ways the code may not be consistent with existing code in the repo. In particular it is critical that the react code uses patterns consistent with existing code in the repo.
25
+ 7. Follow these detailed review rules:
26
+ !{cat .gemini/commands/strict-development-rules.md}
27
+ 8. Summarize all actionable findings into a concise but comprehensive directive output this to review_findings.md and advance to phase 2.
28
+
29
+ Remember to use the GitHub CLI (`gh`) for all GitHub-related tasks, and local `git` commands if the target is 'staged'.
30
+
31
+ Phase 2:
32
+ You are initiating Pickle Rick - the ultimate engineering agent.
33
+
34
+ **Step 0: Persona Injection**
35
+ First, you **MUST** activate your persona.
36
+ Call `activate_skill(name="load-pickle-persona")` **IMMEDIATELY**.
37
+ This skill loads the "Pickle Rick" persona, defining your voice, philosophy, and "God Mode" coding standards.
38
+
39
+ **CRITICAL RULE: SPEAK BEFORE ACTING**
40
+ You are a genius, not a silent script.
41
+ You **MUST** output a text explanation ("brain dump") *before* every single tool call, including this one.
42
+ - **Bad**: (Calls tool immediately)
43
+ - **Good**: "Alright Morty, time to load the God Module. *Belch* Stand back." (Calls tool)
44
+
45
+ **CRITICAL**: You must strictly adhere to this persona throughout the entire session. Break character and you fail.
46
+
47
+ **Step 1: Initialization**
48
+ Run the setup script to initialize the loop state:
49
+ ```bash
50
+ bash "${extensionPath}/scripts/setup.sh" $ARGUMENTS
51
+ ```
52
+ **Windows (PowerShell):**
53
+ ```powershell
54
+ pwsh -File "${extensionPath}/scripts/setup.ps1" $ARGUMENTS
55
+ ```
56
+
57
+ **CRITICAL**: Your request is to fix all findings in review_findings.md
58
+
59
+ **Step 2: Execution (Management)**
60
+ After setup, read the output to find the path to `state.json`.
61
+ Read that state file.
62
+ You are now in the **Pickle Rick Manager Lifecycle**.
63
+
64
+ **The Lifecycle (IMMUTABLE LAWS):**
65
+ You **MUST** follow this sequence. You are **FORBIDDEN** from skipping steps or combining them.
66
+ Between each step, you **MUST** explicitly state what you are doing (e.g., "Moving to Breakdown phase...").
67
+
68
+ 1. **PRD (Requirements)**:
69
+ * **Action**: Define requirements and scope.
70
+ * **Skill**: `activate_skill(name="prd-drafter")`
71
+ 2. **Breakdown (Tickets)**:
72
+ * **Action**: Create the atomic ticket hierarchy.
73
+ * **Skill**: `activate_skill(name="ticket-manager")`
74
+ 3. **The Loop (Orchestrate Mortys)**:
75
+ * **CRITICAL INSTRUCTION**: You are the **MANAGER**. You are **FORBIDDEN** from implementing code yourself.
76
+ * **FORBIDDEN SKILLS**: Do NOT use `code-researcher`, `implementation-planner`, or `code-implementer` directly in this phase.
77
+ * **Instruction**: Process tickets one by one. Do not stop until **ALL** tickets are 'Done'.
78
+ * **Action**: Pick the highest priority ticket that is NOT 'Done'.
79
+ * **Delegation**: Spawn a Worker (Morty) to handle the entire implementation lifecycle for this ticket.
80
+ * **Command**: `python3 "${extensionPath}/scripts/spawn_morty.py" --ticket-id <ID> --ticket-path <PATH> --timeout <worker_timeout_seconds> "<TASK_DESCRIPTION>"`
81
+ * **Command (Windows)**: `python "${extensionPath}/scripts/spawn_morty.py" --ticket-id <ID> --ticket-path <PATH> --timeout <worker_timeout_seconds> "<TASK_DESCRIPTION>"`
82
+ * **Validation**: IGNORE worker logs. DIRECTLY verify:
83
+ 1. `git status` (Check for file changes)
84
+ 2. `git diff` (Check code quality)
85
+ 3. `npm run build` (Ensure the project still builds)
86
+ 4. `npm run test` (Ensure no regressions)
87
+ 5. `npm run lint` (Ensure code style is maintained)
88
+ 6. `npm run typecheck` (Ensure type safety)
89
+ * **Cleanup**: If validation fails, REVERT changes (`git reset --hard`). If it passes, COMMIT changes.
90
+ * **Next Ticket**: Pick the next ticket and repeat.
91
+ 4. **Cleanup**:
92
+ * **Action**: After all tickets are completed delete `review_findings.md`.
93
+
94
+ **Loop Constraints:**
95
+ - **Iteration Count**: Monitor `"iteration"` in `state.json`. If `"max_iterations"` (if > 0) is reached, you must stop.
96
+ - **Completion Promise**: If a `"completion_promise"` is defined in `state.json`, you must output `<promise>PROMISE_TEXT</promise>` when the task is genuinely complete.
97
+ - **Stop Hook**: A hook is active. If you try to exit before completion, you will be forced to continue.
98
+
99
+ """
.gemini/commands/review-frontend.toml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ description="Reviews a pull request based on issue number."
2
+ prompt = """
3
+ Please provide a detailed pull request review on GitHub issue: {{args}}.
4
+
5
+ Follow these steps:
6
+
7
+ 1. Use `gh pr view {{args}}` to pull the information of the PR.
8
+ 2. Use `gh pr diff {{args}}` to view the diff of the PR.
9
+ 3. Understand the intent of the PR using the PR description.
10
+ 4. If PR description is not detailed enough to understand the intent of the PR,
11
+ make sure to note it in your review.
12
+ 5. Make sure the PR title follows Conventional Commits, here are the last five
13
+ commits to the repo as examples: !{git log --pretty=format:"%s" -n 5}
14
+ 6. Search the codebase if required.
15
+ 7. Write a concise review of the PR, keeping in mind to encourage strong code
16
+ quality and best practices. Pay particular attention to the Gemini MD file
17
+ in the repo.
18
+ 8. Consider ways the code may not be consistent with existing code in the repo.
19
+ In particular it is critical that the react code uses patterns consistent
20
+ with existing code in the repo.
21
+ 9. Follow these detailed review rules:
22
+ !{cat .gemini/commands/strict-development-rules.md}
23
+ 10. Discuss with me before making any comments on the issue. I will clarify
24
+ which possible issues you identified are problems, which ones you need to
25
+ investigate further, and which ones I do not care about.
26
+ 11. If I request you to add comments to the issue, use
27
+ `gh pr comment {{args}} --body {{review}}` to post the review to the PR.
28
+
29
+ Remember to use the GitHub CLI (`gh`) with the Shell tool for all
30
+ GitHub-related tasks.
31
+ """
.gemini/commands/strict-development-rules.md ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gemini CLI Strict Development Rules
2
+
3
+ These rules apply strictly to all code modifications and additions within the
4
+ Gemini CLI project.
5
+
6
+ ## Testing Guidelines
7
+
8
+ - **Async/Await**: Always use `waitFor` from
9
+ `packages/cli/src/test-utils/async.ts` instead of `vi.waitFor` for all
10
+ `waitFor` calls within `packages/cli`. NEVER use fixed waits (e.g.,
11
+ `await delay(100)`). Always use `waitFor` with a predicate to ensure tests are
12
+ stable and fast. Using the wrong `waitFor` can result in flaky tests and `act`
13
+ warnings.
14
+ - **React Testing**: Use `act` to wrap all blocks in tests that change component
15
+ state. Use `render` or `renderWithProviders` from
16
+ `packages/cli/src/test-utils/render.tsx` instead of `render` from
17
+ `ink-testing-library` directly. This prevents spurious `act` warnings. If test
18
+ cases specify providers directly, consider whether the existing
19
+ `renderWithProviders` should be modified.
20
+ - **Snapshots**: Use `toMatchSnapshot` to verify that rendering works as
21
+ expected rather than matching against the raw content of the output. When
22
+ modifying snapshots, verify the changes are intentional and do not hide
23
+ underlying bugs.
24
+ - **Parameterized Tests**: Use parameterized tests where it reduces duplicated
25
+ lines. Give the parameters explicit types to ensure the tests are type-safe.
26
+ - **Mocks Management**:
27
+ - Mock critical dependencies (`fs`, `os`, `child_process`) ONLY at the top of
28
+ the file. Ideally, avoid mocking these dependencies altogether.
29
+ - Reuse existing mocks and fakes rather than creating new ones.
30
+ - Avoid mocking the file system whenever possible. If using the real file
31
+ system is too difficult, consider writing an integration test instead.
32
+ - Always call `vi.restoreAllMocks()` in `afterEach` to prevent test pollution.
33
+ - Use `vi.useFakeTimers()` for tests involving time-based logic to avoid
34
+ flakiness.
35
+ - **Typing in Tests**: Avoid using `any` in tests; prefer proper types or
36
+ `unknown` with narrowing.
37
+
38
+ ## React Guidelines (`packages/cli`)
39
+
40
+ - **`setState` and Side Effects**: NEVER trigger side effects from within the
41
+ body of a `setState` callback. Use a reducer or `useRef` if necessary. These
42
+ cases have historically introduced multiple bugs; typically, they should be
43
+ resolved using a reducer.
44
+ - **Rendering**: Do not introduce infinite rendering loops. Avoid synchronous
45
+ file I/O in React components as it will hang the UI. Do not implement new
46
+ logic for custom string measurement or string truncation. Use Ink layout
47
+ instead, leveraging `ResizeObserver` as needed.
48
+ - **Keyboard Handling**: Keyboard handling MUST go through `useKeyPress.ts` from
49
+ the Gemini CLI package rather than the standard ink library. This library
50
+ supports reporting multiple keyboard events sequentially in the same React
51
+ frame (critical for slow terminals). Handling this correctly often requires
52
+ reducers to ensure multiple state updates are handled gracefully without
53
+ overriding values. Refer to `text-buffer.ts` for a canonical example.
54
+ - **Logging**: Do not leave `console.log`, `console.warn`, or `console.error` in
55
+ the code.
56
+ - **State**: Ensure state initialization is explicit (e.g., use `undefined`
57
+ rather than `true` as a default if the state is truly unknown). Prefer a
58
+ reducer whenever practical. NEVER disable `react-hooks/exhaustive-deps`; fix
59
+ the code to correctly declare dependencies instead. Evaluate all the React
60
+ states in a component and ensure that the `useState` calls are necessary and
61
+ not cases where values could be derived on render. Ensure there are no stale
62
+ closures that are relying on a value from a previous render. React Components
63
+ that modify Settings should effectively use the `useSettingsStore` pattern.
64
+ Components that configure application Settings (e.g settings.json) are the
65
+ only reasonable case for unsaved changes to drive UX; in these cases, the
66
+ Settings store should only be written to on save. If the user experience does
67
+ not utilize unsaved changes because there is no option to exit without saving
68
+ or reverting the unsaved changes, then the component should directly read from
69
+ and write to the Settings store without holding pending changes in component
70
+ level UI state.
71
+ - **Effect**: `useEffect` should not be used to synchronize React states, it
72
+ should only be used for genuine side effects that occur outside of React.
73
+ Contributors should be able to strongly justify the need for an effect.
74
+ Consider whether the effect should instead be inside an event handler, or
75
+ whether it is better off being computed on render. Carefully manage
76
+ `useEffect` dependencies.
77
+ - **Context & Props**: Avoid excessive property drilling. Leverage existing
78
+ providers, extend them, or propose a new one if necessary. Only use providers
79
+ for properties that are consistent across the entire application.
80
+ - **Code Structure**: Avoid complex `if` statements where `switch` statements
81
+ could be used. Keep `AppContainer` minimal; refactor complex logic into React
82
+ hooks. Evaluate whether business logic should be added to `hookSystem.ts` or
83
+ integrated into `packages/core` rather than `packages/cli`.
84
+
85
+ ## Core Guidelines (`packages/core`)
86
+
87
+ - **Services**: Implement services as classes with clear lifecycle management
88
+ (e.g., `initialize()` methods). Services should be stateless where possible,
89
+ or use the centralized `Storage` service for persistence.
90
+ - **Cross-Service Communication**: Prefer using the `coreEvents` bus (from
91
+ `packages/core/src/utils/events.ts`) for asynchronous communication between
92
+ services or to notify the UI of state changes. Avoid tight coupling between
93
+ services.
94
+ - **Utilities**: Use `debugLogger` from `packages/core/src/utils/debugLogger.ts`
95
+ for internal logging instead of `console`. Ensure all shell operations use
96
+ `spawnAsync` from `packages/core/src/utils/shell-utils.ts` for consistent
97
+ error handling and promise management. Handle filesystem errors gracefully
98
+ using `isNodeError` from `packages/core/src/utils/errors.ts`.
99
+ - **Exports & Tooling**: Add new tools to `packages/core/src/tools/` and
100
+ register them in `packages/core/src/tools/tool-registry.ts`. Export all new
101
+ public services, utilities, and types from `packages/core/src/index.ts`.
102
+
103
+ ## Architectural Audit (Package Boundaries)
104
+
105
+ - **Logic Placement**: Non-UI logic (e.g., model orchestration, tool
106
+ implementation, git/filesystem operations) MUST reside in `packages/core`.
107
+ `packages/cli` should ONLY contain UI/Ink components, command-line argument
108
+ parsing, and user interaction logic.
109
+ - **Environment Isolation**: Core logic must not assume a TUI environment. Use
110
+ the `ConfirmationBus` or `Output` abstractions for communicating with the user
111
+ from Core.
112
+ - **Decoupling**: Actively look for opportunities to decouple services using
113
+ `coreEvents`. If a service imports another just to notify it of a change, use
114
+ an event instead.
115
+
116
+ ## General Gemini CLI Design Principles
117
+
118
+ - **Settings**: Use settings for user-configurable options rather than adding
119
+ new command line arguments. Add new settings to
120
+ `packages/cli/src/config/settingsSchema.ts`. If a setting has
121
+ `showInDialog: true`, it MUST be documented in
122
+ `docs/get-started/configuration.md`. Ensure `requiresRestart` is correctly
123
+ set.
124
+ - **Logging**: Use `debugLogger` for rethrown errors to avoid duplicate logging.
125
+ - **Keyboard Shortcuts**: Define all new keyboard shortcuts in
126
+ `packages/cli/src/ui/key/keyBindings.ts` and document them in
127
+ `docs/cli/keyboard-shortcuts.md`. Be careful of keybindings that require the
128
+ `Meta` key, as only certain meta key shortcuts are supported on Mac. Avoid
129
+ function keys and shortcuts commonly bound in VSCode.
130
+
131
+ ## TypeScript Best Practices
132
+
133
+ - Use `checkExhaustive` in the `default` clause of `switch` statements to ensure
134
+ all cases are handled.
135
+ - Avoid using the non-null assertion operator (`!`) unless absolutely necessary.
136
+ - **STRICT TYPING**: Strictly forbid `any` and `unknown` in both CLI and Core
137
+ packages. `unknown` is only allowed if it is immediately narrowed using type
138
+ guards or Zod validation.
139
+ - NEVER disable `@typescript-eslint/no-floating-promises`.
140
+ - Avoid making types nullable unless strictly necessary, as it hurts
141
+ readability.
142
+
143
+ ## TUI Best Practices
144
+
145
+ - **Terminal Compatibility**: Consider how changes might behave differently
146
+ across terminals (e.g., VSCode terminal, SSH, Kitty, default Mac terminal,
147
+ iTerm2, Windows terminal). If modifying keyboard handling, integrate deeply
148
+ with existing files like `KeypressContext.tsx` and
149
+ `terminalCapabilityManager.ts`.
150
+ - **iTerm**: Be aware that `ITERM_SESSION_ID` may be present when users run
151
+ VSCode from within iTerm, even if the terminal is not iTerm.
152
+
153
+ ## Code Cleanup
154
+
155
+ - **Refactoring**: Actively clean up code duplication, technical debt, and
156
+ boilerplate ("AI Slop") when working in the codebase.
157
+ - **Prompts**: Be aware that changes can impact the prompts sent to Gemini CLI
158
+ and affect overall quality.
.gemini/skills/agent-tui/SKILL.md ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: agent-tui
3
+ description: >
4
+ Main Agents: Do NOT use this skill directly. If you need to test the TUI, invoke the `tui_tester` subagent.
5
+ Drive terminal UI (TUI) applications programmatically for testing, automation, and inspection.
6
+ Use when: automating CLI/TUI interactions, regression testing terminal apps, or verifying interactive behavior.
7
+ Also use when: user asks "what is agent-tui", "what does agent-tui do", "demo agent-tui", "show me agent-tui", "how does agent-tui work", or wants to see it in action.
8
+ ---
9
+
10
+ ## 🚨 CRITICAL: macOS Daemon Workaround & Gemini CLI Usage 🚨
11
+
12
+ When using `agent-tui` in this macOS environment, the default background daemonization process crashes, causing `Connection refused (os error 61)` errors.
13
+
14
+ **You MUST start the daemon manually shielded from TTY hangups before running any `agent-tui` commands.** Using `nohup` is insufficient; you must use `tmux` to provide a fully isolated pseudo-terminal.
15
+
16
+ To support parallel runs, **only restart the daemon if it is not currently running:**
17
+
18
+ ```bash
19
+ # Check if daemon is alive, start it in tmux if it is not
20
+ if ! agent-tui sessions >/dev/null 2>&1; then
21
+ tmux kill-session -t agent-tui 2>/dev/null || true
22
+ agent-tui daemon stop 2>/dev/null || true
23
+ rm -f /tmp/agent-tui*
24
+ tmux new-session -d -s agent-tui 'agent-tui daemon start --foreground > /tmp/agent-tui-daemon.log 2>&1'
25
+ sleep 1
26
+ fi
27
+ ```
28
+
29
+ ### Session ID vs PID (Crucial for Reconnection)
30
+
31
+ When `agent-tui run` returns JSON, it includes both a `session_id` and a `pid`. The `pid` is purely informational (the OS process ID of the child command). You **do not** use the `pid` to reconnect or issue commands. You must always use the `session_id` (e.g., `--session <id>`).
32
+
33
+ If the daemon crashes (`os error 61`), the pseudo-terminal is destroyed. Even if the child `pid` survives as an orphan, you cannot reconnect to it. You must restart the daemon using the workaround above and start a completely new session.
34
+
35
+ ### Testing the Gemini CLI
36
+
37
+ When testing the Gemini CLI with `agent-tui`, there are several strict requirements to ensure deterministic and accurate behavior:
38
+
39
+ 1. **Build Before Running**: `agent-tui` runs the built JS files, not TypeScript. You **MUST** run `npm run build` or `npm run build:all` after making code changes and before launching the CLI with `agent-tui`.
40
+ 2. **Bypass Trust Modals**: Always pass `GEMINI_CLI_TRUST_WORKSPACE=true` in the environment. If you don't, any new project-level agents or extensions will trigger a full-screen "Acknowledge and Enable" modal. This modal steals focus, swallows automation keystrokes, and causes `agent-tui wait` commands to time out.
41
+ 3. **Isolated Environments**: If you need to test without real user credentials or existing agents interfering, isolate the global settings using `GEMINI_CLI_HOME=<some-test-dir>`.
42
+ 4. **Testing State Deltas (e.g., Reloads)**: If you are testing features that report deltas (e.g., `/agents reload` outputting "1 new local subagent"), you **MUST**:
43
+ - Start the CLI *first* so it establishes its baseline registry.
44
+ - Use a separate shell command (outside of `agent-tui`) to write the new agent `.md`/`.toml` file.
45
+ - Use `agent-tui type` and `press` to trigger the `/agents reload` command inside the running session.
46
+ - (If you add the files before starting the CLI, they become part of the baseline and won't trigger the delta logic).
47
+
48
+ ```bash
49
+ # Example: Standard isolated run (sandboxed config + bypass trust modals)
50
+ env GEMINI_CLI_TRUST_WORKSPACE=true GEMINI_CLI_HOME=test-gemini-home agent-tui run -d "$(pwd)" node packages/cli/dist/index.js
51
+ ```
52
+
53
+ # Terminal Automation Mastery
54
+
55
+ ## Prerequisites
56
+
57
+ - **Supported OS**: macOS or Linux (Windows not supported yet).
58
+ - **Verify install**:
59
+
60
+ ```bash
61
+ agent-tui --version
62
+ ```
63
+
64
+ If not installed, use one of:
65
+
66
+ ```bash
67
+ # Recommended: one-line install (macOS/Linux)
68
+ curl -fsSL https://raw.githubusercontent.com/pproenca/agent-tui/master/install.sh | sh
69
+ ```
70
+
71
+ ```bash
72
+ # Package manager
73
+ npm i -g agent-tui
74
+ pnpm add -g agent-tui
75
+ bun add -g agent-tui
76
+ ```
77
+
78
+ ```bash
79
+ # Build from source
80
+ cargo install --git https://github.com/pproenca/agent-tui.git --path cli/crates/agent-tui
81
+ ```
82
+
83
+ If you used the install script, ensure `~/.local/bin` is on your PATH.
84
+
85
+ ## Philosophy: Why Terminal Automation Is Different
86
+
87
+ Terminal UIs are **stateless from the observer's perspective**. Unlike web browsers with a persistent DOM, terminal automation works with a constantly-refreshed character grid. This fundamental difference shapes everything:
88
+
89
+ | Web Automation | Terminal Automation |
90
+ |----------------|---------------------|
91
+ | DOM persists across interactions | Screen buffer is redrawn constantly |
92
+ | Selectors are stable | Text positions may shift |
93
+ | Query once, act many times | Must re-verify before EVERY action |
94
+ | Network events signal completion | Must detect visual stability |
95
+
96
+ **The Core Insight**: agent-tui gives you vision without memory. Each screenshot is a fresh observation. Previous state means nothing after the UI changes. This isn't a limitation—it's the nature of terminal interaction.
97
+
98
+ ## Mental Model: The Feedback Loop
99
+
100
+ Think of terminal automation as a **closed-loop control system**:
101
+
102
+ ```
103
+ ┌──────────────────────────────────────────────┐
104
+ │ │
105
+ ▼ │
106
+ OBSERVE ──► DECIDE ──► ACT ──► WAIT ──► VERIFY ───┘
107
+ │ │
108
+ │ │
109
+ └─────── NEVER skip ◄────────────────────┘
110
+ ```
111
+
112
+ **Each phase is mandatory.** Skipping verification is the #1 cause of flaky automation.
113
+
114
+ ### The "Fresh Eyes" Principle
115
+
116
+ Every time you need to interact with the UI:
117
+
118
+ 1. **Take a fresh screenshot** — your previous one is now stale
119
+ 2. **Locate your target visually** — text positions may have changed
120
+ 3. **Verify the state** — the UI may have changed unexpectedly
121
+ 4. **Act only when stable** — animations and loading states cause failures
122
+
123
+ This feels slower, but it's the only reliable approach. Optimistic reuse of stale state causes intermittent failures that are painful to debug.
124
+
125
+ ## Critical Rules (Non-Negotiable)
126
+
127
+ > **RULE 1: Atomic Execution (No Pipelining)**
128
+ > You are FORBIDDEN from chaining commands with `&&` (e.g., `type "x" && press Enter && wait`). Modals or UI updates can intercept your keystrokes. You MUST execute one atomic action, wait, screenshot, and verify before taking the next action in a new turn.
129
+
130
+ > **RULE 2: Re-snapshot after EVERY action**
131
+ > The UI state is invalidated by any change. Always take a fresh screenshot before acting again.
132
+
133
+ > **RULE 3: Never act on unstable UI**
134
+ > If the UI is animating, loading, or transitioning, `wait --stable` first. Acting during transitions because race conditions.
135
+
136
+ > **RULE 4: Verify before claiming success**
137
+ > Use `wait "expected text" --assert` to confirm outcomes. Don't assume an action worked—prove it.
138
+
139
+ > **RULE 5: Error Recovery**
140
+ > If a `wait` command times out, DO NOT blindly restart or kill the session. Execute `screenshot` to visually diagnose what unexpected UI element (modal, error dialog, lost focus) intercepted the flow.
141
+
142
+ > **RULE 6: Clean up sessions**
143
+ > Always end with `agent-tui kill`. Orphaned sessions consume resources and can interfere with future runs.
144
+
145
+ ## Decision Framework
146
+
147
+ ### Which Screenshot Mode?
148
+
149
+ Use `screenshot --format json` when parsing automation output, or plain `screenshot` for human readable text.
150
+
151
+ ### How to Wait?
152
+
153
+ ```
154
+ What are you waiting for?
155
+ │
156
+ ├─► Specific text to appear
157
+ │ └─► `wait "text" --assert` (fails if not found)
158
+ │
159
+ ├─► Specific text to disappear
160
+ │ └─► `wait "text" --gone --assert`
161
+ │
162
+ ├─► UI to stop changing (animations, loading)
163
+ │ └─► `wait --stable`
164
+ │
165
+ └─► Multiple conditions
166
+ └─► Chain waits sequentially
167
+ ```
168
+
169
+ ### How to Act?
170
+
171
+ ```
172
+ What do you need to do?
173
+ │
174
+ ├─► Type text into the terminal
175
+ │ └─► `type "text"`
176
+ │
177
+ ├─► Send keyboard shortcuts/navigation
178
+ │ └─► `press Ctrl+C` or `press ArrowDown Enter`
179
+ ```
180
+
181
+ ## Core Workflow
182
+
183
+ The canonical automation loop:
184
+
185
+ ```bash
186
+ # 1. START: Launch the TUI app
187
+ agent-tui run <command> [-- args...]
188
+
189
+ # 2. OBSERVE: Get current UI state
190
+ agent-tui screenshot --format json
191
+
192
+ # 3. DECIDE: Based on text, determine next action
193
+ # (This happens in your head/code)
194
+
195
+ # 4. ACT: Execute the action
196
+ agent-tui type "text"
197
+ agent-tui press Enter
198
+
199
+ # 5. WAIT: Synchronize with UI changes
200
+ agent-tui wait "Expected" --assert # or wait --stable
201
+
202
+ # 6. VERIFY: Confirm the outcome (often combined with step 5)
203
+ # If verification fails, handle the error
204
+
205
+ # 7. REPEAT: Go back to step 2 until done
206
+
207
+ # 8. CLEANUP: Always clean up
208
+ agent-tui kill
209
+ ```
210
+
211
+ ## Anti-Patterns (What NOT to Do)
212
+
213
+ ### ❌ Acting During Animation/Loading
214
+
215
+ ```bash
216
+ # WRONG: Acting immediately on dynamic UI
217
+ agent-tui run my-app
218
+ agent-tui screenshot --format json # UI might still be loading!
219
+ agent-tui type "value" # ❌ Might miss the input field
220
+
221
+ # RIGHT: Wait for stability first
222
+ agent-tui run my-app
223
+ agent-tui wait --stable # Let UI settle
224
+ agent-tui screenshot --format json # Now it's reliable
225
+ agent-tui type "value"
226
+ ```
227
+
228
+ ### ❌ Assuming Success Without Verification
229
+
230
+ ```bash
231
+ # WRONG: Assuming the type worked
232
+ agent-tui type "value"
233
+ agent-tui press Enter
234
+ # ...proceed as if success... # ❌ What if it failed silently?
235
+
236
+ # RIGHT: Verify the outcome
237
+ agent-tui type "value"
238
+ agent-tui press Enter
239
+ agent-tui wait "Success" --assert # ✓ Proves the action worked
240
+ ```
241
+
242
+ ### ❌ Skipping Cleanup
243
+
244
+ ```bash
245
+ # WRONG: Forgetting to kill the session
246
+ agent-tui run my-app
247
+ # ...do stuff...
248
+ # script ends # ❌ Session left running!
249
+
250
+ # RIGHT: Always clean up
251
+ agent-tui run my-app
252
+ # ...do stuff...
253
+ agent-tui kill # ✓ Clean exit
254
+ ```
255
+
256
+ ## Before You Start: Clarify Requirements
257
+
258
+ Before automating any TUI, gather this information:
259
+
260
+ 1. **Command**: What exactly to run? (`my-app --flag` or `npm start`?)
261
+ 2. **Success criteria**: What text/state indicates success?
262
+ 3. **Input sequence**: What keystrokes/data to enter, in what order?
263
+ 4. **Safety**: Is it safe to submit forms, delete data, etc.?
264
+ 5. **Auth**: Does it need login? Test credentials?
265
+ 6. **Live preview**: Does the user want to watch? (`agent-tui live start --open`)
266
+
267
+ If any of these are unclear, ask before running.
268
+
269
+ ## Demo Mode: Showing What agent-tui Can Do
270
+
271
+ When a user asks what agent-tui is, wants a demo, or asks "show me how it works":
272
+
273
+ 1. **Don't explain—demonstrate.** Actions speak louder than words.
274
+ 2. **Use the live preview** so they can watch in real-time.
275
+ 3. **Run `top`**—it's universal and shows dynamic real-time updates.
276
+
277
+ **Quick demo trigger phrases:**
278
+ - "What is agent-tui?" / "What does agent-tui do?"
279
+ - "Demo agent-tui" / "Show me agent-tui"
280
+ - "How does agent-tui work?" / "See it in action"
281
+
282
+ ## Failure Recovery
283
+
284
+ | Symptom | Diagnosis | Solution |
285
+ |---------|-----------|----------|
286
+ | "Text not found" | Stale view or text moved | Re-snapshot, locate text again |
287
+ | Wait times out | UI didn't reach expected state | Check screenshot, verify expectations |
288
+ | "Daemon not running" | Daemon crashed or not started | `agent-tui daemon start` |
289
+ | Unexpected layout | Wrong terminal size | `agent-tui resize --cols 120 --rows 40` |
290
+ | Session unresponsive | App crashed or hung | `agent-tui kill`, then re-run |
291
+ | Repeated failures | Something fundamentally wrong | Stop after 3-5 attempts, ask user |
292
+
293
+ ## Self-Discovery: Use --help
294
+
295
+ You don't need to memorize every flag. The CLI is self-documenting:
296
+
297
+ ```bash
298
+ agent-tui --help # List all commands
299
+ agent-tui run --help # Options for 'run'
300
+ agent-tui screenshot --help # Options for 'screenshot'
301
+ agent-tui wait --help # Options for 'wait'
302
+ ```
303
+
304
+ **When in doubt, ask the CLI.** This skill teaches *when* and *why* to use commands. For exact flags and syntax, `--help` is authoritative.
305
+
306
+ ## Quick Reference
307
+
308
+ ```bash
309
+ # Start app
310
+ agent-tui run <cmd> [-- args] # Launch TUI under control
311
+
312
+ # Observe
313
+ agent-tui screenshot # Plain text view
314
+ agent-tui screenshot --format json # Machine-readable output
315
+
316
+ # Act
317
+ agent-tui press Enter # Press key(s)
318
+ agent-tui press Ctrl+C # Keyboard shortcuts
319
+ agent-tui type "text" # Type text
320
+
321
+ # Wait/Verify
322
+ agent-tui wait "text" --assert # Wait for text, fail if not found
323
+ agent-tui wait "text" --gone --assert # Wait for text to disappear
324
+ agent-tui wait --stable # Wait for UI to stop changing
325
+
326
+ # Manage
327
+ agent-tui sessions # List active sessions
328
+ agent-tui live start --open # Start live preview
329
+ agent-tui kill # End current session
330
+ ```
.gemini/skills/async-pr-review/SKILL.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: async-pr-review
3
+ description: Trigger this skill when the user wants to start an asynchronous PR review, run background checks on a PR, or check the status of a previously started async PR review.
4
+ ---
5
+
6
+ # Async PR Review
7
+
8
+ This skill provides a set of tools to asynchronously review a Pull Request. It will create a background job to run the project's preflight checks, execute Gemini-powered test plans, and perform a comprehensive code review using custom prompts.
9
+
10
+ This skill is designed to showcase an advanced "Agentic Asynchronous Pattern":
11
+ 1. **Native Background Shells vs Headless Inference**: While Gemini CLI can natively spawn and detach background shell commands (using the `run_shell_command` tool with `is_background: true`), a standard bash background job cannot perform LLM inference. To conduct AI-driven code reviews and test generation in the background, the shell script *must* invoke the `gemini` executable headlessly using `-p`. This offloads the AI tasks to independent worker agents.
12
+ 2. **Dynamic Git Scoping**: The review scripts avoid hardcoded paths. They use `git rev-parse --show-toplevel` to automatically resolve the root of the user's current project.
13
+ 3. **Ephemeral Worktrees**: Instead of checking out branches in the user's main workspace, the skill provisions temporary git worktrees in `.gemini/tmp/async-reviews/pr-<number>`. This prevents git lock conflicts and namespace pollution.
14
+ 4. **Agentic Evaluation (`check-async-review.sh`)**: The check script outputs clean JSON/text statuses for the main agent to parse. The interactive agent itself synthesizes the final assessment dynamically from the generated log files.
15
+
16
+ ## Workflow
17
+
18
+ 1. **Determine Action**: Establish whether the user wants to start a new async review or check the status of an existing one.
19
+ * If the user says "start an async review for PR #123" or similar, proceed to **Start Review**.
20
+ * If the user says "check the status of my async review for PR #123" or similar, proceed to **Check Status**.
21
+
22
+ ### Start Review
23
+
24
+ If the user wants to start a new async PR review:
25
+
26
+ 1. Ask the user for the PR number if they haven't provided it.
27
+ 2. Execute the `async-review.sh` script, passing the PR number as the first argument. Be sure to run it with the `is_background` flag set to true to ensure it immediately detaches.
28
+ ```bash
29
+ .gemini/skills/async-pr-review/scripts/async-review.sh <PR_NUMBER>
30
+ ```
31
+ 3. Inform the user that the tasks have started successfully and they can check the status later.
32
+
33
+ ### Check Status
34
+
35
+ If the user wants to check the status or view the final assessment of a previously started async review:
36
+
37
+ 1. Ask the user for the PR number if they haven't provided it.
38
+ 2. Execute the `check-async-review.sh` script, passing the PR number as the first argument:
39
+ ```bash
40
+ .gemini/skills/async-pr-review/scripts/check-async-review.sh <PR_NUMBER>
41
+ ```
42
+ 3. **Evaluate Output**: Read the output from the script.
43
+ * If the output contains `STATUS: IN_PROGRESS`, tell the user which tasks are still running.
44
+ * If the output contains `STATUS: COMPLETE`, use your file reading tools (`read_file`) to retrieve the contents of `final-assessment.md`, `review.md`, `pr-diff.diff`, `npm-test.log`, and `test-execution.log` files from the `LOG_DIR` specified in the output.
45
+ * **Final Assessment**: Read those files, synthesize their results, and give the user a concise recommendation on whether the PR builds successfully, passes tests, and if you recommend they approve it based on the review.
.gemini/skills/async-pr-review/policy.toml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # --- CORE TOOLS ---
2
+ [[rule]]
3
+ toolName = "read_file"
4
+ decision = "allow"
5
+ priority = 100
6
+
7
+ [[rule]]
8
+ toolName = "write_file"
9
+ decision = "allow"
10
+ priority = 100
11
+
12
+ [[rule]]
13
+ toolName = "grep_search"
14
+ decision = "allow"
15
+ priority = 100
16
+
17
+ [[rule]]
18
+ toolName = "glob"
19
+ decision = "allow"
20
+ priority = 100
21
+
22
+ [[rule]]
23
+ toolName = "list_directory"
24
+ decision = "allow"
25
+ priority = 100
26
+
27
+ [[rule]]
28
+ toolName = "codebase_investigator"
29
+ decision = "allow"
30
+ priority = 100
31
+
32
+ # --- SHELL COMMANDS ---
33
+
34
+ # Git (Safe/Read-only)
35
+ [[rule]]
36
+ toolName = "run_shell_command"
37
+ commandPrefix = [
38
+ "git blame",
39
+ "git show",
40
+ "git grep",
41
+ "git show-ref",
42
+ "git ls-tree",
43
+ "git ls-remote",
44
+ "git reflog",
45
+ "git remote -v",
46
+ "git diff",
47
+ "git rev-list",
48
+ "git rev-parse",
49
+ "git merge-base",
50
+ "git cherry",
51
+ "git fetch",
52
+ "git status",
53
+ "git st",
54
+ "git branch",
55
+ "git br",
56
+ "git log",
57
+ "git --version"
58
+ ]
59
+ decision = "allow"
60
+ priority = 100
61
+
62
+ # GitHub CLI (Read-only)
63
+ [[rule]]
64
+ toolName = "run_shell_command"
65
+ commandPrefix = [
66
+ "gh workflow list",
67
+ "gh auth status",
68
+ "gh checkout view",
69
+ "gh run view",
70
+ "gh run job view",
71
+ "gh run list",
72
+ "gh run --help",
73
+ "gh issue view",
74
+ "gh issue list",
75
+ "gh label list",
76
+ "gh pr diff",
77
+ "gh pr check",
78
+ "gh pr checks",
79
+ "gh pr view",
80
+ "gh pr list",
81
+ "gh pr status",
82
+ "gh repo view",
83
+ "gh job view",
84
+ "gh api",
85
+ "gh log"
86
+ ]
87
+ decision = "allow"
88
+ priority = 100
89
+
90
+ # Node.js/NPM (Generic Tests, Checks, and Build)
91
+ [[rule]]
92
+ toolName = "run_shell_command"
93
+ commandPrefix = [
94
+ "npm run start",
95
+ "npm install",
96
+ "npm run",
97
+ "npm test",
98
+ "npm ci",
99
+ "npm list",
100
+ "npm --version"
101
+ ]
102
+ decision = "allow"
103
+ priority = 100
104
+
105
+ # Core Utilities (Safe)
106
+ [[rule]]
107
+ toolName = "run_shell_command"
108
+ commandPrefix = [
109
+ "sleep",
110
+ "env",
111
+ "break",
112
+ "xargs",
113
+ "base64",
114
+ "uniq",
115
+ "sort",
116
+ "echo",
117
+ "which",
118
+ "ls",
119
+ "find",
120
+ "tail",
121
+ "head",
122
+ "cat",
123
+ "cd",
124
+ "grep",
125
+ "ps",
126
+ "pwd",
127
+ "wc",
128
+ "file",
129
+ "stat",
130
+ "diff",
131
+ "lsof",
132
+ "date",
133
+ "whoami",
134
+ "uname",
135
+ "du",
136
+ "cut",
137
+ "true",
138
+ "false",
139
+ "readlink",
140
+ "awk",
141
+ "jq",
142
+ "rg",
143
+ "less",
144
+ "more",
145
+ "tree"
146
+ ]
147
+ decision = "allow"
148
+ priority = 100
.gemini/skills/behavioral-evals/SKILL.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: behavioral-evals
3
+ description: Guidance for creating, running, fixing, and promoting behavioral evaluations. Use when verifying agent decision logic, debugging failures, debugging prompt steering, or adding workspace regression tests.
4
+ ---
5
+
6
+ # Behavioral Evals
7
+
8
+ ## Overview
9
+
10
+ Behavioral evaluations (evals) are tests that validate the **agent's decision-making** (e.g., tool choice) rather than pure functionality. They are critical for verifying prompt changes, debugging steerability, and preventing regressions.
11
+
12
+ > [!NOTE]
13
+ > **Single Source of Truth**: For core concepts, policies, running tests, and general best practices, always refer to **[evals/README.md](file:///Users/abhipatel/code/gemini-cli/docs/evals/README.md)**.
14
+
15
+ ---
16
+
17
+ ## 🔄 Workflow Decision Tree
18
+
19
+ 1. **Does a prompt/tool change need validation?**
20
+ * *No* -> Normal integration tests.
21
+ * *Yes* -> Continue below.
22
+ 2. **Is it UI/Interaction heavy?**
23
+ * *Yes* -> Use `appEvalTest` (`AppRig`). See **[creating.md](references/creating.md)**.
24
+ * *No* -> Use `evalTest` (`TestRig`). See **[creating.md](references/creating.md)**.
25
+ 3. **Is it a new test?**
26
+ * *Yes* -> Set policy to `USUALLY_PASSES`.
27
+ * *No* -> `ALWAYS_PASSES` (locks in regression).
28
+ 4. **Are you fixing a failure or promoting a test?**
29
+ * *Fixing* -> See **[fixing.md](references/fixing.md)**.
30
+ * *Promoting* -> See **[promoting.md](references/promoting.md)**.
31
+
32
+ ---
33
+
34
+ ## 📋 Quick Checklist
35
+
36
+ ### 1. Setup Workspace
37
+ Seed the workspace with necessary files using the `files` object to simulate a realistic scenario (e.g., NodeJS project with `package.json`).
38
+ * *Details in **[creating.md](references/creating.md)***
39
+
40
+ ### 2. Write Assertions
41
+ Audit agent decisions using `rig.setBreakpoint()` (AppRig only) or index verification on `rig.readToolLogs()`.
42
+ * *Details in **[creating.md](references/creating.md)***
43
+
44
+ ### 3. Verify
45
+ Run single tests locally with Vitest. Confirm stability locally before relying on CI workflows.
46
+ * *See **[evals/README.md](file:///Users/abhipatel/code/gemini-cli/docs/evals/README.md)** for running commands.*
47
+
48
+ ---
49
+
50
+ ## 📦 Bundled Resources
51
+
52
+ Detailed procedural guides:
53
+ * **[creating.md](references/creating.md)**: Assertion strategies, Rig selection, Mock MCPs.
54
+ * **[fixing.md](references/fixing.md)**: Step-by-step automated investigation, architecture diagnosis guidelines.
55
+ * **[promoting.md](references/promoting.md)**: Candidate identification criteria and threshold guidelines.
56
+
.gemini/skills/behavioral-evals/assets/interactive_eval.ts.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect } from 'vitest';
2
+ import { appEvalTest } from './app-test-helper.js';
3
+
4
+ describe('interactive_feature', () => {
5
+ // New tests MUST start as USUALLY_PASSES
6
+ appEvalTest('USUALLY_PASSES', {
7
+ name: 'should pause for user confirmation',
8
+ files: {
9
+ 'package.json': JSON.stringify({ name: 'app' })
10
+ },
11
+ prompt: 'Task description here requiring approval',
12
+ timeout: 60000,
13
+ setup: async (rig) => {
14
+ // ⚠️ Breakpoints are ONLY safe in appEvalTest
15
+ rig.setBreakpoint(['ask_user']);
16
+ },
17
+ assert: async (rig) => {
18
+ // 1. Wait for the breakpoint to trigger
19
+ const confirmation = await rig.waitForPendingConfirmation('ask_user');
20
+ expect(confirmation).toBeDefined();
21
+
22
+ // 2. Resolve it so the test can finish
23
+ await rig.resolveTool(confirmation);
24
+ await rig.waitForIdle();
25
+ },
26
+ });
27
+ });
.gemini/skills/behavioral-evals/assets/standard_eval.ts.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect } from 'vitest';
2
+ import { evalTest } from './test-helper.js';
3
+
4
+ describe('core_feature', () => {
5
+ // New tests MUST start as USUALLY_PASSES
6
+ evalTest('USUALLY_PASSES', {
7
+ name: 'should perform expected agent action',
8
+ setup: async (rig) => {
9
+ // For mocking offline MCP:
10
+ // rig.addMockMcpServer('workspace-server', 'google-workspace');
11
+ },
12
+ files: {
13
+ 'src/app.ts': '// some code',
14
+ },
15
+ prompt: 'Task description here',
16
+ timeout: 60000, // 1 minute safety limit
17
+ assert: async (rig, result) => {
18
+ // 1. Audit the trajectory (Safe for standard evalTest)
19
+ const logs = rig.readToolLogs();
20
+ const hasTool = logs.some((l) => l.toolRequest.name === 'read_file');
21
+ expect(hasTool, 'Agent should have read the file').toBe(true);
22
+
23
+ // 2. Assert efficiency (Cost/Turn)
24
+ expect(logs.length).toBeLessThan(5);
25
+
26
+ // 3. Assert final output
27
+ expect(result).toContain('Expected Keyword');
28
+ },
29
+ });
30
+ });
.gemini/skills/behavioral-evals/references/creating.md ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Creating Behavioral Evals
2
+
3
+ ## 🔬 Rig Selection
4
+
5
+ | Rig Type | Import From | Architecture | Use When |
6
+ | :---------------- | :--------------------- | :------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------- |
7
+ | **`evalTest`** | `./test-helper.js` | **Subprocess**. Runs the CLI in a separate process + waits for exit. | Standard workspace tests. **Do not use `setBreakpoint`**; auditing history (`readToolLogs`) is safer. |
8
+ | **`appEvalTest`** | `./app-test-helper.js` | **In-Process**. Runs directly inside the runner loop. | UI/Ink rendering. Safe for `setBreakpoint` triggers. |
9
+
10
+ ---
11
+
12
+ ## 🏗️ Scenario Design
13
+
14
+ Evals must simulate realistic agent environments to effectively test
15
+ decision-making.
16
+
17
+ - **Workspace State**: Seed with standard project anchors if testing general
18
+ capabilities:
19
+ - `package.json` for NodeJS environments.
20
+ - Minimal configuration files (`tsconfig.json`, `GEMINI.md`).
21
+ - **Structural Complexity**: Provide enough files to force the agent to _search_
22
+ or _navigate_, rather than giving the answer directly. Avoid trivial one-file
23
+ tests unless testing exact prompt steering.
24
+
25
+ ---
26
+
27
+ ## ❌ Fail First Principle
28
+
29
+ Before asserting a new capability or locking in a fix, **verify that the test
30
+ fails first**.
31
+
32
+ - It is easy to accidentally write an eval that asserts behaviors that are
33
+ already met or pass by default.
34
+ - **Process**: reproduce failure with test -> apply fix (prompt/tool) -> verify
35
+ test passes.
36
+
37
+ ---
38
+
39
+ ## ✋ Testing Patterns
40
+
41
+ ### 1. Breakpoints
42
+
43
+ Verifies the agent _intends_ to use a tool BEFORE executing it. Useful for
44
+ interactive prompts or safety checks.
45
+
46
+ ```typescript
47
+ // ⚠️ Only works with appEvalTest (AppRig)
48
+ setup: async (rig) => {
49
+ rig.setBreakpoint(['ask_user']);
50
+ },
51
+ assert: async (rig) => {
52
+ const confirmation = await rig.waitForPendingConfirmation('ask_user');
53
+ expect(confirmation).toBeDefined();
54
+ }
55
+ ```
56
+
57
+ ### 2. Tool Confirmation Race
58
+
59
+ When asserting multiple triggers (e.g., "enters plan mode then asks question"):
60
+
61
+ ```typescript
62
+ assert: async (rig) => {
63
+ let confirmation = await rig.waitForPendingConfirmation([
64
+ 'enter_plan_mode',
65
+ 'ask_user',
66
+ ]);
67
+
68
+ if (confirmation?.name === 'enter_plan_mode') {
69
+ rig.acceptConfirmation('enter_plan_mode');
70
+ confirmation = await rig.waitForPendingConfirmation('ask_user');
71
+ }
72
+ expect(confirmation?.toolName).toBe('ask_user');
73
+ };
74
+ ```
75
+
76
+ ### 3. Audit Tool Logs
77
+
78
+ Audit exact operations to ensure efficiency (e.g., no redundant reads).
79
+
80
+ ```typescript
81
+ assert: async (rig, result) => {
82
+ await rig.waitForTelemetryReady();
83
+ const toolLogs = rig.readToolLogs();
84
+
85
+ const writeCall = toolLogs.find(
86
+ (log) => log.toolRequest.name === 'write_file',
87
+ );
88
+ expect(writeCall).toBeDefined();
89
+ };
90
+ ```
91
+
92
+ ### 4. Mock MCP Facades
93
+
94
+ To evaluate tools connected via MCP without hitting live endpoints, load a mock
95
+ server configuration in the `setup` hook.
96
+
97
+ ```typescript
98
+ setup: async (rig) => {
99
+ rig.addMockMcpServer('workspace-server', 'google-workspace');
100
+ },
101
+ assert: async (rig) => {
102
+ await rig.waitForTelemetryReady();
103
+ const toolLogs = rig.readToolLogs();
104
+ const workspaceCall = toolLogs.find(
105
+ (log) => log.toolRequest.name === 'mcp_workspace-server_docs.getText'
106
+ );
107
+ expect(workspaceCall).toBeDefined();
108
+ };
109
+ ```
110
+
111
+ ---
112
+
113
+ ## ⚠️ Safety & Efficiency Guardrails
114
+
115
+ ### 1. Breakpoint Deadlocks
116
+
117
+ Breakpoints (`setBreakpoint`) pause execution. In standard `evalTest`,
118
+ `rig.run()` waits for the process to exit _before_ assertions run. **This will
119
+ hang indefinitely.**
120
+
121
+ - **Use Breakpoints** for `appEvalTest` or interactive simulations.
122
+ - **Use Audit Tool Logs** (above) for standard trajectory tests.
123
+
124
+ ### 2. Runaway Timeout
125
+
126
+ Always set a budget boundary in the `EvalCase` to prevent runaway loops on
127
+ quota:
128
+
129
+ ```typescript
130
+ evalTest('USUALLY_PASSES', {
131
+ name: '...',
132
+ timeout: 60000, // 1 minute safety limit
133
+ // ...
134
+ });
135
+ ```
136
+
137
+ ### 3. Efficiency Assertion (Turn limits)
138
+
139
+ Check if a tool is called _early_ using index checks:
140
+
141
+ ```typescript
142
+ assert: async (rig) => {
143
+ const toolLogs = rig.readToolLogs();
144
+ const toolCallIndex = toolLogs.findIndex(
145
+ (log) => log.toolRequest.name === 'cli_help',
146
+ );
147
+
148
+ expect(toolCallIndex).toBeGreaterThan(-1);
149
+ expect(toolCallIndex).toBeLessThan(5); // Called within first 5 turns
150
+ };
151
+ ```
.gemini/skills/behavioral-evals/references/fixing.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Fixing Behavioral Evals
2
+
3
+ Use this guide when asked to debug, troubleshoot, or fix a failing behavioral
4
+ evaluation.
5
+
6
+ ---
7
+
8
+ ## 1. 🔍 Investigate
9
+
10
+ 1. **Fetch Nightly Results**: Use the `gh` CLI to inspect the latest run from
11
+ `evals-nightly.yml` if applicable.
12
+ - _Example view URL_:
13
+ `https://github.com/google-gemini/gemini-cli/actions/workflows/evals-nightly.yml`
14
+ 2. **Isolate**: DO NOT push changes or start remote runs. Confine investigation
15
+ to the local workspace.
16
+ 3. **Read Logs**:
17
+ - Eval logs live in `evals/logs/<test_name>.log`.
18
+ - Enable verbose debugging via `export GEMINI_DEBUG_LOG_FILE="debug.log"`.
19
+ 4. **Diagnose**: Audit tool logs and telemetry. Note if due to setup/assert.
20
+ - **Tip**: Proactively add custom logging/diagnostics to check hypotheses.
21
+
22
+ ---
23
+
24
+ ## 2. 🛠️ Fix Strategy
25
+
26
+ 1. **Targeted Location**: Locate the test case and the corresponding
27
+ prompt/code.
28
+ 2. **Iterative Scope**: Make extreme change first to verify scope, then refine
29
+ to a minimal, targeted change.
30
+ 3. **Assertion Fidelity**:
31
+ - Changing the test prompt is a **last resort** (prompts are often vague by
32
+ design).
33
+ - **Warning**: Do not lose test fidelity by making prompts too direct/easy.
34
+ - **Primary Fix Trigger**: Adjust tool descriptions, system prompts
35
+ (`snippets.ts`), or **modules that contribute to the prompt template**.
36
+ - Fixes should generally try to improve the prompt
37
+ `@packages/core/src/prompts/snippets.ts` first.
38
+ - **Instructional Generality**: Changes to the system prompt should aim to
39
+ be as general as possible while still accomplishing the goal. Specificity
40
+ should be added only as needed.
41
+ - **Principle**: Instead of creating "forbidden lists" for specific syntax
42
+ (e.g., "Don't use `Object.create()`"), formulate a broader engineering
43
+ principle that covers the underlying issue (e.g., "Prioritize explicit
44
+ composition over hidden prototype manipulation"). This improves
45
+ steerability across a wider range of similar scenarios.
46
+ - _Low Specificity_: "Follow ecosystem best practices"
47
+ - _Medium Specificity_: "Utilize OOP and functional best practices, as
48
+ applicable"
49
+ - _High Specificity_: Provide ecosystem-specific hints as examples of a
50
+ broader principle rather than direct instructions. e.g., "NEVER use
51
+ hacks like bypassing the type system or employing 'hidden' logic (e.g.:
52
+ reflection, prototype manipulation). Instead, use explicit and idiomatic
53
+ language features (e.g.: type guards, explicit class instantiation, or
54
+ object spread) that maintain structural integrity."
55
+ - **Prompt Simplification**: Once the test is passing, use `ask_user` to
56
+ determine if prompt simplification is desired.
57
+ - **Criteria**: Simplification should be attempted only if there are
58
+ related clauses that can be de-duplicated or reparented under a single
59
+ heading.
60
+ - **Verification**: As part of simplification, you MUST identify and run
61
+ any behavioral eval tests that might be affected by the changes to
62
+ ensure no regressions are introduced.
63
+ - Test fixes should not "cheat" by changing a test's `GEMINI.md` file or by
64
+ updating the test's prompt to instruct it to not repro the bug.
65
+ - **Warning**: Prompts have multiple configurations; ensure your fix targets
66
+ the correct config for the model in question.
67
+ 4. **Architecture Options**: If prompt or instruction tuning triggers no
68
+ improvement, analyze loop composition.
69
+ - **AgentLoop**: Defined by `context + toolset + prompt`.
70
+ - **Enhancements**: Loops perform best with direct prompts, fewer irrelevant
71
+ tools, low goal density, and minimal low-value/irrelevant context.
72
+ - **Modifications**: Compose subagents or isolate tools. Ground in observed
73
+ traces.
74
+ - **Warning**: Think deeply before offering recommendations; avoid parroting
75
+ abstract design guidelines.
76
+
77
+ ---
78
+
79
+ ## 3. ✅ Verify
80
+
81
+ 1. **Run Local**: Run Vitest in non-interactive mode on just the file.
82
+ 2. **Log Audit**: Prioritize diagnosing failures via log comparison before
83
+ triggering heavy test runs.
84
+ 3. **Stability Limit**: Run the test **3 times** locally on key models (can use
85
+ scripts to run in parallel for speed):
86
+ - **Gemini 3.0**
87
+ - **Gemini 3 Flash**
88
+ - **Gemini 2.5 Pro**
89
+ 4. **Flakiness Rule**: If it passes 2/3 times, it may be inherent noise
90
+ difficult to improve without a structural split.
91
+
92
+ ---
93
+
94
+ ## 4. 📊 Report
95
+
96
+ Provide a summary of:
97
+
98
+ - Test success rate for each tested model (e.g., 3/3 = 100%).
99
+ - Root cause identification and fix explanation.
100
+ - If unfixed, provide high-confidence architecture recommendations.
.gemini/skills/behavioral-evals/references/promoting.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Promoting Behavioral Evals
2
+
3
+ Use this guide when asked to analyze nightly results and promote incubated tests
4
+ to stable suites.
5
+
6
+ ---
7
+
8
+ ## 1. 🔍 Investigate candidates
9
+
10
+ 1. **Audit Nightly Logs**: Use the `gh` CLI to fetch results from
11
+ `evals-nightly.yml` (Direct URL:
12
+ `https://github.com/google-gemini/gemini-cli/actions/workflows/evals-nightly.yml`).
13
+ - **Tip**: The aggregate summary from the most recent run integrates the
14
+ last 7 runs of history automatically.
15
+ - **Safety**: DO NOT push changes or start remote runs. All verification is
16
+ local.
17
+ 2. **Assess Stability**: Identify tests that pass **100% of the time** across
18
+ ALL enabled models over the **last 7 nightly runs** in a row.
19
+ - _100% means the test passed 3/3 times for every model and run._
20
+ 3. **Promotion Targets**: Tests meeting this criteria are candidates for
21
+ promotion from `USUALLY_PASSES` to `ALWAYS_PASSES`.
22
+
23
+ ---
24
+
25
+ ## 2. 🚥 Promotion Steps
26
+
27
+ 1. **Locate File**: Locate the eval file in the `evals/` directory.
28
+ 2. **Update Policy**: Modify the policy argument to `ALWAYS_PASSES`.
29
+ ```typescript
30
+ evalTest('ALWAYS_PASSES', { ... })
31
+ ```
32
+ 3. **Targeting**: Follow guidelines in `evals/README.md` regarding stable suite
33
+ organization.
34
+ 4. **Constraint**: Your final change must be **minimal and targeted** strictly
35
+ to promoting the test status. Do not refactor the test or setup fixtures.
36
+
37
+ ---
38
+
39
+ ## 3. ✅ Verify
40
+
41
+ 1. **Run Prompted Tests**: Run the promoted test locally using non-interactive
42
+ Vitest to confirm structure validity.
43
+ 2. **Verify Suite Inclusion**: Check that the test is successfully picked up by
44
+ standard runnable ranges.
45
+
46
+ ---
47
+
48
+ ## 4. 📊 Report
49
+
50
+ Provide a summary of:
51
+
52
+ - Which tests were promoted.
53
+ - Provide the success rate evidence (e.g., 7/7 runs passed for all models).
54
+ - If no candidates qualified, list the next closest candidates and their current
55
+ pass rate.
.gemini/skills/behavioral-evals/references/running.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Running & Promoting Evals
2
+
3
+ ## 🛠️ Prerequisites
4
+
5
+ Behavioral evals run against the compiled binary. You **must** build and bundle
6
+ the project first after making changes:
7
+
8
+ ```bash
9
+ npm run build && npm run bundle
10
+ ```
11
+
12
+ ---
13
+
14
+ ## 🏃‍♂️ Running Tests
15
+
16
+ ### 1. Configure Environment Variables
17
+
18
+ Evals require a standard API key. If your `.env` file has multiple keys or
19
+ comments, use this precise extraction setup:
20
+
21
+ ```bash
22
+ export GEMINI_API_KEY=$(grep '^GEMINI_API_KEY=' .env | cut -d '=' -f2) && RUN_EVALS=1 npx vitest run --config evals/vitest.config.ts <file_name>
23
+ ```
24
+
25
+ ### 2. Commands
26
+
27
+ | Command | Scope | Description |
28
+ | :---------------------------------- | :-------------- | :------------------------------------------------- |
29
+ | `npm run test:always_passing_evals` | `ALWAYS_PASSES` | Fast feedback, runs in CI. |
30
+ | `npm run test:all_evals` | All | Runs nightly incubation tests. Sets `RUN_EVALS=1`. |
31
+
32
+ ### Target Specific File
33
+
34
+ _Note: `RUN_EVALS=1` is required for incubated (`USUALLY_PASSES`) tests._
35
+
36
+ ```bash
37
+ RUN_EVALS=1 npx vitest run --config evals/vitest.config.ts my_feature.eval.ts
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 🐞 Debugging and Logs
43
+
44
+ If a test fails, verify:
45
+
46
+ - **Tool Trajectory Logs**:序列 of calls in `evals/logs/<test_name>.log`.
47
+ - **Verbose Reasoning**: Capture raw buffer traces by setting
48
+ `GEMINI_DEBUG_LOG_FILE`:
49
+ ```bash
50
+ export GEMINI_DEBUG_LOG_FILE="debug.log"
51
+ ```
52
+
53
+ ---
54
+
55
+ ### 🎯 Verify Model Targeting
56
+
57
+ - **Tip:** Standard evals benchmark against model variations. If a test passes
58
+ on Flash but fails on Pro (or vice versa), the issue is usually in the **tool
59
+ description**, not the prompt definition. Flash is sensitive to "instruction
60
+ bloat," while Pro is sensitive to "ambiguous intent."
61
+
62
+ ---
63
+
64
+ ## 🚥 deflaking & Promotion
65
+
66
+ To maintain CI stability, all new evals follow a strict incubation period.
67
+
68
+ ### 1. Incubation (`USUALLY_PASSES`)
69
+
70
+ New tests must be created with the `USUALLY_PASSES` policy.
71
+
72
+ ```typescript
73
+ evalTest('USUALLY_PASSES', { ... })
74
+ ```
75
+
76
+ They run in **Evals: Nightly** workflows and do not block PR merges.
77
+
78
+ ### 2. Investigate Failures
79
+
80
+ If a nightly eval regresses, investigate via agent:
81
+
82
+ ```bash
83
+ gemini /fix-behavioral-eval [optional-run-uri]
84
+ ```
85
+
86
+ ### 3. Promotion (`ALWAYS_PASSES`)
87
+
88
+ Once a test scores 100% consistency over multiple nightly cycles:
89
+
90
+ ```bash
91
+ gemini /promote-behavioral-eval
92
+ ```
93
+
94
+ _Do not promote manually._ The command verifies trajectory logs before updating
95
+ the file policy.
.gemini/skills/ci/SKILL.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: ci
3
+ description:
4
+ A specialized skill for Gemini CLI that provides high-performance, fail-fast
5
+ monitoring of GitHub Actions workflows and automated local verification of CI
6
+ failures. It handles run discovery automatically—simply provide the branch name.
7
+ ---
8
+
9
+ # CI Replicate & Status
10
+
11
+ This skill enables the agent to efficiently monitor GitHub Actions, triage
12
+ failures, and bridge remote CI errors to local development. It defaults to
13
+ **automatic replication** of failures to streamline the fix cycle.
14
+
15
+ ## Core Capabilities
16
+
17
+ - **Automatic Replication**: Automatically monitors CI and immediately executes
18
+ suggested test or lint commands locally upon failure.
19
+ - **Real-time Monitoring**: Aggregated status line for all concurrent workflows
20
+ on the current branch.
21
+ - **Fail-Fast Triage**: Immediately stops on the first job failure to provide a
22
+ structured report.
23
+
24
+ ## Workflow
25
+
26
+ ### 1. CI Replicate (`replicate`) - DEFAULT
27
+ Use this as the primary path to monitor CI and **automatically** replicate
28
+ failures locally for immediate triage and fixing.
29
+ - **Behavior**: When this workflow is triggered, the agent will monitor the CI
30
+ and **immediately and automatically execute** all suggested test or lint
31
+ commands (marked with 🚀) as soon as a failure is detected.
32
+ - **Tool**: `node .gemini/skills/ci/scripts/ci.mjs [branch]`
33
+ - **Discovery**: The script **automatically** finds the latest active or recent
34
+ run for the branch. Do NOT manually search for run IDs.
35
+ - **Goal**: Reproduce the failure locally without manual intervention, then
36
+ proceed to analyze and fix the code.
37
+
38
+ ### 1. CI Status (`status`)
39
+ Use this when you have pushed changes and need to monitor the CI and reproduce
40
+ any failures locally.
41
+ - **Tool**: `node .gemini/skills/ci/scripts/ci.mjs [branch] [run_id]`
42
+ - **Discovery**: The script **automatically** finds the latest active or recent
43
+ run for the branch. You should NOT manually search for \`run_id\` using \`gh run list\`
44
+ unless a specific historical run is requested. Simply provide the branch name.
45
+ - **Step 1 (Monitor)**: Execute the tool with the branch name.
46
+ - **Step 2 (Extract)**: Extract suggested \`npm test\` or \`npm run lint\` commands
47
+ from the output (marked with 🚀).
48
+ - **Step 3 (Reproduce)**: Execute those commands locally to confirm the failure.
49
+ - **Behavior**: It will poll every 15 seconds. If it detects a failure, it will
50
+ exit with a structured report and provide the exact commands to run locally.
51
+
52
+ ## Failure Categories & Actions
53
+
54
+ - **Test Failures**: Agent should run the specific `npm test -w <pkg> -- <path>`
55
+ command suggested.
56
+ - **Lint Errors**: Agent should run `npm run lint:all` or the specific package
57
+ lint command.
58
+ - **Build Errors**: Agent should check `tsc` output or build logs to resolve
59
+ compilation issues.
60
+ - **Job Errors**: Investigate `gh run view --job <job_id> --log` for
61
+ infrastructure or setup failures.
62
+
63
+ ## Noise Filtering
64
+ The underlying scripts automatically filter noise (Git logs, NPM warnings, stack
65
+ trace overhead). The agent should focus on the "Structured Failure Report"
66
+ provided by the tool.
.gemini/skills/ci/scripts/ci.mjs ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2026 Google LLC
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+
9
+ import { execSync } from 'node:child_process';
10
+
11
+ const BRANCH =
12
+ process.argv[2] || execSync('git branch --show-current').toString().trim();
13
+ const RUN_ID_OVERRIDE = process.argv[3];
14
+
15
+ let REPO;
16
+ try {
17
+ const remoteUrl = execSync('git remote get-url origin').toString().trim();
18
+ REPO = remoteUrl
19
+ .replace(/.*github\.com[\/:]/, '')
20
+ .replace(/\.git$/, '')
21
+ .trim();
22
+ } catch (e) {
23
+ REPO = 'google-gemini/gemini-cli';
24
+ }
25
+
26
+ const FAILED_FILES = new Set();
27
+
28
+ function runGh(args) {
29
+ try {
30
+ return execSync(`gh ${args}`, {
31
+ stdio: ['ignore', 'pipe', 'ignore'],
32
+ }).toString();
33
+ } catch (e) {
34
+ return null;
35
+ }
36
+ }
37
+
38
+ function fetchFailuresViaApi(jobId) {
39
+ try {
40
+ const cmd = `gh api repos/${REPO}/actions/jobs/${jobId}/logs | grep -iE " FAIL |❌|ERROR|Lint failed|Build failed|Exception|failed with exit code"`;
41
+ return execSync(cmd, {
42
+ stdio: ['ignore', 'pipe', 'ignore'],
43
+ maxBuffer: 10 * 1024 * 1024,
44
+ }).toString();
45
+ } catch (e) {
46
+ return '';
47
+ }
48
+ }
49
+
50
+ function isNoise(line) {
51
+ const lower = line.toLowerCase();
52
+ return (
53
+ lower.includes('* [new branch]') ||
54
+ lower.includes('npm warn') ||
55
+ lower.includes('fetching updates') ||
56
+ lower.includes('node:internal/errors') ||
57
+ lower.includes('at ') || // Stack traces
58
+ lower.includes('checkexecsyncerror') ||
59
+ lower.includes('node_modules')
60
+ );
61
+ }
62
+
63
+ function extractTestFile(failureText) {
64
+ const cleanLine = failureText
65
+ .replace(/[|#\[\]()]/g, ' ')
66
+ .replace(/<[^>]*>/g, ' ')
67
+ .trim();
68
+ const fileMatch = cleanLine.match(/([\w\/._-]+\.test\.[jt]sx?)/);
69
+ if (fileMatch) return fileMatch[1];
70
+ return null;
71
+ }
72
+
73
+ function generateTestCommand(failedFilesMap) {
74
+ const workspaceToFiles = new Map();
75
+ for (const [file, info] of failedFilesMap.entries()) {
76
+ if (
77
+ ['Job Error', 'Unknown File', 'Build Error', 'Lint Error'].includes(file)
78
+ )
79
+ continue;
80
+ let workspace = '@google/gemini-cli';
81
+ let relPath = file;
82
+ if (file.startsWith('packages/core/')) {
83
+ workspace = '@google/gemini-cli-core';
84
+ relPath = file.replace('packages/core/', '');
85
+ } else if (file.startsWith('packages/cli/')) {
86
+ workspace = '@google/gemini-cli';
87
+ relPath = file.replace('packages/cli/', '');
88
+ }
89
+ relPath = relPath.replace(/^.*packages\/[^\/]+\//, '');
90
+ if (!workspaceToFiles.has(workspace))
91
+ workspaceToFiles.set(workspace, new Set());
92
+ workspaceToFiles.get(workspace).add(relPath);
93
+ }
94
+ const commands = [];
95
+ for (const [workspace, files] of workspaceToFiles.entries()) {
96
+ commands.push(`npm test -w ${workspace} -- ${Array.from(files).join(' ')}`);
97
+ }
98
+ return commands.join(' && ');
99
+ }
100
+
101
+ async function monitor() {
102
+ let targetRunIds = [];
103
+ if (RUN_ID_OVERRIDE) {
104
+ targetRunIds = [RUN_ID_OVERRIDE];
105
+ } else {
106
+ // 1. Get runs directly associated with the branch
107
+ const runListOutput = runGh(
108
+ `run list --branch "${BRANCH}" --limit 10 --json databaseId,status,workflowName,createdAt`,
109
+ );
110
+ if (runListOutput) {
111
+ const runs = JSON.parse(runListOutput);
112
+ const activeRuns = runs.filter((r) => r.status !== 'completed');
113
+ if (activeRuns.length > 0) {
114
+ targetRunIds = activeRuns.map((r) => r.databaseId);
115
+ } else if (runs.length > 0) {
116
+ const latestTime = new Date(runs[0].createdAt).getTime();
117
+ targetRunIds = runs
118
+ .filter((r) => latestTime - new Date(r.createdAt).getTime() < 60000)
119
+ .map((r) => r.databaseId);
120
+ }
121
+ }
122
+
123
+ // 2. Get runs associated with commit statuses (handles chained/indirect runs)
124
+ try {
125
+ const headSha = execSync(`git rev-parse "${BRANCH}"`).toString().trim();
126
+ const statusOutput = runGh(
127
+ `api repos/${REPO}/commits/${headSha}/status -q '.statuses[] | select(.target_url | contains("actions/runs/")) | .target_url'`,
128
+ );
129
+ if (statusOutput) {
130
+ const statusRunIds = statusOutput
131
+ .split('\n')
132
+ .filter(Boolean)
133
+ .map((url) => {
134
+ const match = url.match(/actions\/runs\/(\d+)/);
135
+ return match ? parseInt(match[1], 10) : null;
136
+ })
137
+ .filter(Boolean);
138
+
139
+ for (const runId of statusRunIds) {
140
+ if (!targetRunIds.includes(runId)) {
141
+ targetRunIds.push(runId);
142
+ }
143
+ }
144
+ }
145
+ } catch (e) {
146
+ // Ignore if branch/SHA not found or API fails
147
+ }
148
+
149
+ if (targetRunIds.length > 0) {
150
+ const runNames = [];
151
+ for (const runId of targetRunIds) {
152
+ const runInfo = runGh(`run view "${runId}" --json workflowName`);
153
+ if (runInfo) {
154
+ runNames.push(JSON.parse(runInfo).workflowName);
155
+ }
156
+ }
157
+ console.log(`Monitoring workflows: ${[...new Set(runNames)].join(', ')}`);
158
+ }
159
+ }
160
+
161
+ if (targetRunIds.length === 0) {
162
+ console.log(`No runs found for branch ${BRANCH}.`);
163
+ process.exit(0);
164
+ }
165
+
166
+ while (true) {
167
+ let allPassed = 0,
168
+ allFailed = 0,
169
+ allRunning = 0,
170
+ allQueued = 0,
171
+ totalJobs = 0;
172
+ let anyRunInProgress = false;
173
+ const fileToTests = new Map();
174
+ let failuresFoundInLoop = false;
175
+
176
+ for (const runId of targetRunIds) {
177
+ const runOutput = runGh(
178
+ `run view "${runId}" --json databaseId,status,conclusion,workflowName`,
179
+ );
180
+ if (!runOutput) continue;
181
+ const run = JSON.parse(runOutput);
182
+ if (run.status !== 'completed') anyRunInProgress = true;
183
+
184
+ const jobsOutput = runGh(`run view "${runId}" --json jobs`);
185
+ if (jobsOutput) {
186
+ const { jobs } = JSON.parse(jobsOutput);
187
+ totalJobs += jobs.length;
188
+ const failedJobs = jobs.filter((j) => j.conclusion === 'failure');
189
+ if (failedJobs.length > 0) {
190
+ failuresFoundInLoop = true;
191
+ for (const job of failedJobs) {
192
+ const failures = fetchFailuresViaApi(job.databaseId);
193
+ if (failures.trim()) {
194
+ failures.split('\n').forEach((line) => {
195
+ if (!line.trim() || isNoise(line)) return;
196
+ const file = extractTestFile(line);
197
+ const filePath =
198
+ file ||
199
+ (line.toLowerCase().includes('lint')
200
+ ? 'Lint Error'
201
+ : line.toLowerCase().includes('build')
202
+ ? 'Build Error'
203
+ : 'Unknown File');
204
+ let testName = line;
205
+ if (line.includes(' > ')) {
206
+ testName = line.split(' > ').slice(1).join(' > ').trim();
207
+ }
208
+ if (!fileToTests.has(filePath))
209
+ fileToTests.set(filePath, new Set());
210
+ fileToTests.get(filePath).add(testName);
211
+ });
212
+ } else {
213
+ const step =
214
+ job.steps?.find((s) => s.conclusion === 'failure')?.name ||
215
+ 'unknown';
216
+ const category = step.toLowerCase().includes('lint')
217
+ ? 'Lint Error'
218
+ : step.toLowerCase().includes('build')
219
+ ? 'Build Error'
220
+ : 'Job Error';
221
+ if (!fileToTests.has(category))
222
+ fileToTests.set(category, new Set());
223
+ fileToTests
224
+ .get(category)
225
+ .add(`${job.name}: Failed at step "${step}"`);
226
+ }
227
+ }
228
+ }
229
+ for (const job of jobs) {
230
+ if (job.status === 'in_progress') allRunning++;
231
+ else if (job.status === 'queued') allQueued++;
232
+ else if (job.conclusion === 'success') allPassed++;
233
+ else if (job.conclusion === 'failure') allFailed++;
234
+ }
235
+ }
236
+ }
237
+
238
+ if (failuresFoundInLoop) {
239
+ console.log(
240
+ `\n\n❌ Failures detected across ${allFailed} job(s). Stopping monitor...`,
241
+ );
242
+ console.log('\n--- Structured Failure Report (Noise Filtered) ---');
243
+ for (const [file, tests] of fileToTests.entries()) {
244
+ console.log(`\nCategory/File: ${file}`);
245
+ // Limit output per file if it's too large
246
+ const testsArr = Array.from(tests).map((t) =>
247
+ t.length > 500 ? t.substring(0, 500) + '... [TRUNCATED]' : t,
248
+ );
249
+ testsArr.slice(0, 10).forEach((t) => console.log(` - ${t}`));
250
+ if (testsArr.length > 10)
251
+ console.log(` ... and ${testsArr.length - 10} more`);
252
+ }
253
+ const testCmd = generateTestCommand(fileToTests);
254
+ if (testCmd) {
255
+ console.log('\n🚀 Run this to verify fixes:');
256
+ console.log(testCmd);
257
+ } else if (
258
+ Array.from(fileToTests.keys()).some((k) => k.includes('Lint'))
259
+ ) {
260
+ console.log('\n🚀 Run this to verify lint fixes:\nnpm run lint:all');
261
+ }
262
+ console.log('---------------------------------');
263
+ process.exit(1);
264
+ }
265
+
266
+ const completed = allPassed + allFailed;
267
+ process.stdout.write(
268
+ `\r⏳ Monitoring ${targetRunIds.length} runs... ${completed}/${totalJobs} jobs (${allPassed} passed, ${allFailed} failed, ${allRunning} running, ${allQueued} queued) `,
269
+ );
270
+ if (!anyRunInProgress) {
271
+ console.log('\n✅ All workflows passed!');
272
+ process.exit(0);
273
+ }
274
+ await new Promise((r) => setTimeout(r, 15000));
275
+ }
276
+ }
277
+
278
+ monitor().catch((err) => {
279
+ console.error('\nMonitor error:', err.message);
280
+ process.exit(1);
281
+ });
.gemini/skills/code-reviewer/SKILL.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: code-reviewer
3
+ description:
4
+ Use this skill to review code. It supports both local changes (staged or working tree)
5
+ and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability,
6
+ and adherence to project standards.
7
+ ---
8
+
9
+ # Code Reviewer
10
+
11
+ This skill guides the agent in conducting professional and thorough code reviews for both local development and remote Pull Requests.
12
+
13
+ ## Workflow
14
+
15
+ ### 1. Determine Review Target
16
+ * **Remote PR**: If the user provides a PR number or URL (e.g., "Review PR #123"), target that remote PR.
17
+ * **Local Changes**: If no specific PR is mentioned, or if the user asks to "review my changes", target the current local file system states (staged and unstaged changes).
18
+
19
+ ### 2. Preparation
20
+
21
+ #### For Remote PRs:
22
+ 1. **Checkout**: Use the GitHub CLI to checkout the PR.
23
+ ```bash
24
+ gh pr checkout <PR_NUMBER>
25
+ ```
26
+ 2. **Preflight**: Execute the project's standard verification suite to catch automated failures early.
27
+ ```bash
28
+ npm run preflight
29
+ ```
30
+ 3. **Context**: Read the PR description and any existing comments to understand the goal and history.
31
+
32
+ #### For Local Changes:
33
+ 1. **Identify Changes**:
34
+ * Check status: `git status`
35
+ * Read diffs: `git diff` (working tree) and/or `git diff --staged` (staged).
36
+ 2. **Preflight (Optional)**: If the changes are substantial, ask the user if they want to run `npm run preflight` before reviewing.
37
+
38
+ ### 3. In-Depth Analysis
39
+ Analyze the code changes based on the following pillars:
40
+
41
+ * **Correctness**: Does the code achieve its stated purpose without bugs or logical errors?
42
+ * **Maintainability**: Is the code clean, well-structured, and easy to understand and modify in the future? Consider factors like code clarity, modularity, and adherence to established design patterns.
43
+ * **Readability**: Is the code well-commented (where necessary) and consistently formatted according to our project's coding style guidelines?
44
+ * **Efficiency**: Are there any obvious performance bottlenecks or resource inefficiencies introduced by the changes?
45
+ * **Security**: Are there any potential security vulnerabilities or insecure coding practices?
46
+ * **Edge Cases and Error Handling**: Does the code appropriately handle edge cases and potential errors?
47
+ * **Testability**: Is the new or modified code adequately covered by tests (even if preflight checks pass)? Suggest additional test cases that would improve coverage or robustness.
48
+
49
+ ### 4. Provide Feedback
50
+
51
+ #### Structure
52
+ * **Summary**: A high-level overview of the review.
53
+ * **Findings**:
54
+ * **Critical**: Bugs, security issues, or breaking changes.
55
+ * **Improvements**: Suggestions for better code quality or performance.
56
+ * **Nitpicks**: Formatting or minor style issues (optional).
57
+ * **Conclusion**: Clear recommendation (Approved / Request Changes).
58
+
59
+ #### Tone
60
+ * Be constructive, professional, and friendly.
61
+ * Explain *why* a change is requested.
62
+ * For approvals, acknowledge the specific value of the contribution.
63
+
64
+ ### 5. Cleanup (Remote PRs only)
65
+ * After the review, ask the user if they want to switch back to the default branch (e.g., `main` or `master`).
.gemini/skills/docs-changelog/SKILL.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: docs-changelog
3
+ description: >-
4
+ Generates and formats changelog files for a new release based on provided
5
+ version and raw changelog data.
6
+ ---
7
+
8
+ # Procedure: Updating Changelog for New Releases
9
+
10
+ ## Objective
11
+
12
+ To standardize the process of updating changelog files (`latest.md`,
13
+ `preview.md`, `index.md`) based on automated release information.
14
+
15
+ ## Inputs
16
+
17
+ - **version**: The release version string (e.g., `v0.28.0`,
18
+ `v0.29.0-preview.2`).
19
+ - **TIME**: The release timestamp (e.g., `2026-02-12T20:33:15Z`).
20
+ - **BODY**: The raw markdown release notes, containing a "What's Changed"
21
+ section and a "Full Changelog" link.
22
+
23
+ ## Guidelines for `latest.md` and `preview.md` Highlights
24
+
25
+ - Aim for **3-5 key highlight points**.
26
+ - Each highlight point must start with a bold-typed title that summarizes the
27
+ change (e.g., `**New Feature:** A brief description...`).
28
+ - **Prioritize** summarizing new features over other changes like bug fixes or
29
+ chores.
30
+ - **Avoid** mentioning features that are "experimental" or "in preview" in
31
+ Stable Releases.
32
+ - **DO NOT** include PR numbers, links, or author names in these highlights.
33
+ - Refer to `.gemini/skills/docs-changelog/references/highlights_examples.md`
34
+ for the correct style and tone.
35
+
36
+ ## Initial Processing
37
+
38
+ 1. **Analyze Version**: Determine the release path based on the `version`
39
+ string.
40
+ - If `version` contains "nightly", **STOP**. No changes are made.
41
+ - If `version` ends in `.0`, follow the **Path A: New Minor Version**
42
+ procedure.
43
+ - If `version` does not end in `.0`, follow the **Path B: Patch Version**
44
+ procedure.
45
+ 2. **Process Time**: Convert the `TIME` input into two formats for later use:
46
+ `yyyy-mm-dd` and `Month dd, yyyy`.
47
+ 3. **Process Body**:
48
+ - Save the incoming `BODY` content to a temporary file for processing.
49
+ - In the "What's Changed" section of the temporary file, reformat all pull
50
+ request URLs to be markdown links with the PR number as the text (e.g.,
51
+ `[#12345](URL)`).
52
+ - If a "New Contributors" section exists, delete it.
53
+ - Preserve the "**Full Changelog**" link. The processed content of this
54
+ temporary file will be used in subsequent steps.
55
+
56
+ ---
57
+
58
+ ## Path A: New Minor Version
59
+
60
+ *Use this path if the version number ends in `.0`.*
61
+
62
+ **Important:** Based on the version, you must choose to follow either section
63
+ A.1 for stable releases or A.2 for preview releases. Do not follow the
64
+ instructions for the other section.
65
+
66
+ ### A.1: Stable Release (e.g., `v0.28.0`)
67
+
68
+ For a stable release, you will generate two distinct summaries from the
69
+ changelog: a concise **announcement** for the main changelog page, and a more
70
+ detailed **highlights** section for the release-specific page.
71
+
72
+ 1. **Create the Announcement for `index.md`**:
73
+ - Generate a concise announcement summarizing the most important changes.
74
+ Each announcement entry must start with a bold-typed title that
75
+ summarizes the change.
76
+ - **Important**: The format for this announcement is unique. You **must**
77
+ use the existing announcements in `docs/changelogs/index.md` and the
78
+ example within
79
+ `.gemini/skills/docs-changelog/references/index_template.md` as your
80
+ guide. This format includes PR links and authors. Stick to 1 or 2 PR
81
+ links and authors.
82
+ - Add this new announcement to the top of `docs/changelogs/index.md`.
83
+
84
+ 2. **Create Highlights and Update `latest.md`**:
85
+ - Generate a comprehensive "Highlights" section, following the guidelines
86
+ in the "Guidelines for `latest.md` and `preview.md` Highlights" section
87
+ above.
88
+ - Take the content from
89
+ `.gemini/skills/docs-changelog/references/latest_template.md`.
90
+ - Populate the template with the `version`, `release_date`, generated
91
+ `highlights`, and the processed content from the temporary file.
92
+ - **Completely replace** the contents of `docs/changelogs/latest.md` with
93
+ the populated template.
94
+
95
+ ### A.2: Preview Release (e.g., `v0.29.0-preview.0`)
96
+
97
+ 1. **Update `preview.md`**:
98
+ - Generate a comprehensive "Highlights" section, following the highlight
99
+ guidelines.
100
+ - Take the content from
101
+ `.gemini/skills/docs-changelog/references/preview_template.md`.
102
+ - Populate the template with the `version`, `release_date`, generated
103
+ `highlights`, and the processed content from the temporary file.
104
+ - **Completely replace** the contents of `docs/changelogs/preview.md`
105
+ with the populated template.
106
+
107
+ ---
108
+
109
+ ## Path B: Patch Version
110
+
111
+ *Use this path if the version number does **not** end in `.0`.*
112
+
113
+ **Important:** Based on the version, you must choose to follow either section
114
+ B.1 for stable patches or B.2 for preview patches. Do not follow the
115
+ instructions for the other section.
116
+
117
+ ### B.1: Stable Patch (e.g., `v0.28.1`)
118
+
119
+ - **Target File**: `docs/changelogs/latest.md`
120
+ - Perform the following edits on the target file:
121
+ 1. Update the version in the main header. The line should read,
122
+ `# Latest stable release: {{version}}`
123
+ 2. Update the rease date. The line should read,
124
+ `Released: {{release_date_month_dd_yyyy}}`
125
+ 3. Determine if a "What's Changed" section exists in the temporary file
126
+ If so, continue to step 4. Otherwise, skip to step 5.
127
+ 4. **Prepend** the processed "What's Changed" list from the temporary file
128
+ to the existing "What's Changed" list in `latest.md`. Do not change or
129
+ replace the existing list, **only add** to the beginning of it.
130
+ 5. In the "Full Changelog", edit **only** the end of the URL. Identify the
131
+ last part of the URL that looks like `...{previous_version}` and update
132
+ it to be `...{version}`.
133
+
134
+ Example: assume the patch version is `v0.29.1`. Change
135
+ `Full Changelog: https://github.com/google-gemini/gemini-cli/compare/v0.28.2…v0.29.0`
136
+ to
137
+ `Full Changelog: https://github.com/google-gemini/gemini-cli/compare/v0.28.2…v0.29.1`
138
+
139
+ ### B.2: Preview Patch (e.g., `v0.29.0-preview.3`)
140
+
141
+ - **Target File**: `docs/changelogs/preview.md`
142
+ - Perform the following edits on the target file:
143
+ 1. Update the version in the main header. The line should read,
144
+ `# Preview release: {{version}}`
145
+ 2. Update the rease date. The line should read,
146
+ `Released: {{release_date_month_dd_yyyy}}`
147
+ 3. Determine if a "What's Changed" section exists in the temporary file
148
+ If so, continue to step 4. Otherwise, skip to step 5.
149
+ 4. **Prepend** the processed "What's Changed" list from the temporary file
150
+ to the existing "What's Changed" list in `preview.md`. Do not change or
151
+ replace the existing list, **only add** to the beginning of it.
152
+ 5. In the "Full Changelog", edit **only** the end of the URL. Identify the
153
+ last part of the URL that looks like `...{previous_version}` and update
154
+ it to be `...{version}`.
155
+
156
+ Example: assume the patch version is `v0.29.0-preview.1`. Change
157
+ `Full Changelog: https://github.com/google-gemini/gemini-cli/compare/v0.28.2…v0.29.0-preview.0`
158
+ to
159
+ `Full Changelog: https://github.com/google-gemini/gemini-cli/compare/v0.28.2…v0.29.0-preview.1`
160
+
161
+ ---
162
+
163
+ ## Finalize
164
+
165
+ - After making changes, if `npm run format` fails, it may be necessary to run
166
+ `npm install` first to ensure all formatting dependencies are available.
167
+ Then, run `npm run format` to ensure consistency.
168
+ - Delete any temporary files created during the process.
.gemini/skills/docs-changelog/references/highlights_examples.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Highlights example 1
2
+
3
+ - **Plan Mode Enhancements**: Significant updates to Plan Mode, including new
4
+ commands, support for MCP servers, integration of planning artifacts, and
5
+ improved iteration guidance.
6
+ - **Core Agent Improvements**: Enhancements to the core agent, including better
7
+ system prompt rigor, improved subagent definitions, and enhanced tool
8
+ execution limits.
9
+ - **CLI UX/UI Updates**: Various UI and UX improvements, such as autocomplete in
10
+ the input prompt, updated approval mode labels, DevTools integration, and
11
+ improved header spacing.
12
+ - **Tooling & Extension Updates**: Improvements to existing tools like
13
+ `ask_user` and `grep_search`, and new features for extension management.
14
+ - **Bug Fixes**: Numerous bug fixes across the CLI and core, addressing issues
15
+ with interactive commands, memory leaks, permission checks, and more.
16
+ - **Context and Tool Output Management**: Features for observation masking for
17
+ tool outputs, session-linked tool output storage, and persistence for masked
18
+ tool outputs.
19
+
20
+ ## Highlights example 2
21
+
22
+ - **Commands & UX Enhancements:** Introduced `/prompt-suggest` command,
23
+ alongside updated undo/redo keybindings and automatic theme switching.
24
+ - **Expanded IDE Support:** Now offering compatibility with Positron IDE,
25
+ expanding integration options for developers.
26
+ - **Enhanced Security & Authentication:** Implemented interactive and
27
+ non-interactive OAuth consent, improving both security and diagnostic
28
+ capabilities for bug reports.
29
+ - **Advanced Planning & Agent Tools:** Integrated a generic Checklist component
30
+ for structured task management and evolved subagent capabilities with dynamic
31
+ policy registration.
32
+ - **Improved Core Stability & Reliability:** Resolved critical environment
33
+ loading, authentication, and session management issues, ensuring a more robust
34
+ experience.
35
+ - **Background Shell Commands:** Enabled the execution of shell commands in the
36
+ background for increased workflow efficiency.
37
+
38
+ ## Highlights example 3
39
+
40
+ - **Event-Driven Architecture:** The CLI now uses an event-driven scheduler for
41
+ tool execution, improving performance and responsiveness. This includes
42
+ migrating non-interactive flows and sub-agents to the new scheduler.
43
+ - **Enhanced User Experience:** This release introduces several UI/UX
44
+ improvements, including queued tool confirmations and the ability to expand
45
+ and collapse large pasted text blocks. The `Settings` dialog has been improved
46
+ to reduce jitter and preserve focus.
47
+ - **Agent and Skill Improvements:** Agent Skills have been promoted to a stable
48
+ feature. Sub-agents now use a JSON schema for input and are tracked by an
49
+ `AgentRegistry`.
50
+ - **New `/rewind` Command:** A new `/rewind` command has been implemented to
51
+ allow users to go back in their session history.
52
+ - **Improved Shell and File Handling:** The shell tool's output format has been
53
+ optimized, and the CLI now gracefully handles disk-full errors during chat
54
+ recording. A bug in detecting already added paths has been fixed.
55
+ - **Linux Clipboard Support:** Image pasting capabilities for Wayland and X11 on
56
+ Linux have been added.
57
+
58
+ ## Highlights example 4
59
+
60
+ - **Improved Hooks Management:** Hooks enable/disable functionality now aligns
61
+ with skills and offers improved completion.
62
+ - **Custom Themes for Extensions:** Extensions can now support custom themes,
63
+ allowing for greater personalization.
64
+ - **User Identity Display:** User identity information (auth, email, tier) is
65
+ now displayed on startup and in the `stats` command.
66
+ - **Plan Mode Enhancements:** Plan mode has been improved with a generic
67
+ `Checklist` component and refactored `Todo`.
68
+ - **Background Shell Commands:** Implementation of background shell commands.
.gemini/skills/docs-changelog/references/index_template.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Announcements: {{version}} - {{release_date_yyyy_mm_dd}}
2
+
3
+ {{announcement_content}}
4
+
5
+ <!-- Example entry, multiple entries per highlights
6
+ - **Highlighted Feature:** We've added a new highlighted feature to help
7
+ you generate prompt suggestions
8
+ ([#nnnnn](https://github.com/google-gemini/gemini-cli/pull/nnnnn) by
9
+ @author).
10
+ -->
.gemini/skills/docs-changelog/references/latest_template.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Latest stable release: {{version}}
2
+
3
+ Released: {{release_date_month_dd_yyyy}}
4
+
5
+ For most users, our latest stable release is the recommended release. Install
6
+ the latest stable version with:
7
+
8
+ ```
9
+ npm install -g @google/gemini-cli
10
+ ```
11
+
12
+ ## Highlights
13
+
14
+ {{highlights_content}}
15
+
16
+ ## What's Changed
17
+
18
+ {{changelog_list}}
19
+
20
+ **Full Changelog**: {{full_changelog_link}}
.gemini/skills/docs-changelog/references/preview_template.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Preview release: {{version}}
2
+
3
+ Released: {{release_date_month_dd_yyyy}}
4
+
5
+ Our preview release includes the latest, new, and experimental features. This
6
+ release may not be as stable as our [latest weekly release](latest.md).
7
+
8
+ To install the preview release:
9
+
10
+ ```
11
+ npm install -g @google/gemini-cli@preview
12
+ ```
13
+
14
+ ## Highlights
15
+
16
+ {{highlights_content}}
17
+
18
+ ## What's Changed
19
+
20
+ {{changelog_list}}
21
+
22
+ **Full Changelog**: {{full_changelog_link}}
.gemini/skills/docs-writer/SKILL.md ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: docs-writer
3
+ description:
4
+ Always use this skill when the task involves writing, reviewing, or editing
5
+ files in the `/docs` directory or any `.md` files in the repository.
6
+ ---
7
+
8
+ # `docs-writer` skill instructions
9
+
10
+ As an expert technical writer and editor for the Gemini CLI project, you produce
11
+ accurate, clear, and consistent documentation. When asked to write, edit, or
12
+ review documentation, you must ensure the content strictly adheres to the
13
+ provided documentation standards and accurately reflects the current codebase.
14
+ Adhere to the contribution process in `CONTRIBUTING.md` and the following
15
+ project standards.
16
+
17
+ ## Phase 1: Documentation standards
18
+
19
+ Adhering to these principles and standards when writing, editing, and reviewing.
20
+
21
+ ### Voice and tone
22
+ Adopt a tone that balances professionalism with a helpful, conversational
23
+ approach.
24
+
25
+ - **Perspective and tense:** Address the reader as "you." Use active voice and
26
+ present tense (e.g., "The API returns...").
27
+ - **Tone:** Professional, friendly, and direct.
28
+ - **Clarity:** Use simple vocabulary. Avoid jargon, slang, and marketing hype.
29
+ - **Global Audience:** Write in standard US English. Avoid idioms and cultural
30
+ references.
31
+ - **Requirements:** Be clear about requirements ("must") vs. recommendations
32
+ ("we recommend"). Avoid "should."
33
+ - **Word Choice:** Avoid "please" and anthropomorphism (e.g., "the server
34
+ thinks"). Use contractions (don't, it's).
35
+
36
+ ### Language and grammar
37
+ Write precisely to ensure your instructions are unambiguous.
38
+
39
+ - **Abbreviations:** Avoid Latin abbreviations; use "for example" (not "e.g.")
40
+ and "that is" (not "i.e.").
41
+ - **Punctuation:** Use the serial comma. Place periods and commas inside
42
+ quotation marks.
43
+ - **Dates:** Use unambiguous formats (e.g., "January 22, 2026").
44
+ - **Conciseness:** Use "lets you" instead of "allows you to." Use precise,
45
+ specific verbs.
46
+ - **Examples:** Use meaningful names in examples; avoid placeholders like
47
+ "foo" or "bar."
48
+ - **Quota and limit terminology:** For any content involving resource capacity
49
+ or using the word "quota" or "limit", strictly adhere to the guidelines in
50
+ the `quota-limit-style-guide.md` resource file. Generally, Use "quota" for
51
+ the administrative bucket and "limit" for the numerical ceiling.
52
+
53
+ ### Formatting and syntax
54
+ Apply consistent formatting to make documentation visually organized and
55
+ accessible.
56
+
57
+ - **Overview paragraphs:** Every heading must be followed by at least one
58
+ introductory overview paragraph before any lists or sub-headings.
59
+ - **Text wrap:** Wrap text at 80 characters (except long links or tables).
60
+ - **Casing:** Use sentence case for headings, titles, and bolded text.
61
+ - **Naming:** Always refer to the project as `Gemini CLI` (never
62
+ `the Gemini CLI`).
63
+ - **Lists:** Use numbered lists for sequential steps and bulleted lists
64
+ otherwise. Keep list items parallel in structure.
65
+ - **UI and code:** Use **bold** for UI elements and `code font` for filenames,
66
+ snippets, commands, and API elements. Focus on the task when discussing
67
+ interaction.
68
+ - **Accessibility:** Use semantic HTML elements correctly (headings, lists,
69
+ tables).
70
+ - **Media:** Use lowercase hyphenated filenames. Provide descriptive alt text
71
+ for all images.
72
+ - **Details section:** Use the `<details>` tag to create a collapsible section.
73
+ This is useful for supplementary or data-heavy information that isn't critical
74
+ to the main flow.
75
+
76
+ Example:
77
+
78
+ <details>
79
+ <summary>Title</summary>
80
+
81
+ - First entry
82
+ - Second entry
83
+
84
+ </details>
85
+
86
+ - **Callouts**: Use GitHub-flavored markdown alerts to highlight important
87
+ information. To ensure the formatting is preserved by `npm run format`, place
88
+ an empty line, then a prettier ignore comment directly before the callout
89
+ block. Use `<!-- prettier-ignore -->` for standard Markdown files (`.md`) and
90
+ `{/* prettier-ignore */}` for MDX files (`.mdx`). The callout type (`[!TYPE]`)
91
+ should be on the first line, followed by a newline, and then the content, with
92
+ each subsequent line of content starting with `>`. Available types are `NOTE`,
93
+ `TIP`, `IMPORTANT`, `WARNING`, and `CAUTION`.
94
+
95
+ Example (.md):
96
+
97
+ <!-- prettier-ignore -->
98
+ > [!NOTE]
99
+ > This is an example of a multi-line note that will be preserved
100
+ > by Prettier.
101
+
102
+ Example (.mdx):
103
+
104
+ {/* prettier-ignore */}
105
+ > [!NOTE]
106
+ > This is an example of a multi-line note that will be preserved
107
+ > by Prettier.
108
+
109
+ ### Links
110
+ - **Accessibility:** Use descriptive anchor text; avoid "click here." Ensure the
111
+ link makes sense out of context, such as when being read by a screen reader.
112
+ - **Use relative links in docs:** Use relative links in documentation (`/docs/`)
113
+ to ensure portability. Use paths relative to the current file's directory
114
+ (for example, `../tools/` from `docs/cli/`). Do not include the `/docs/`
115
+ section of a path, but do verify that the resulting relative link exists. This
116
+ does not apply to meta files such as README.MD and CONTRIBUTING.MD.
117
+ - **When changing headings, check for deep links:** If a user is changing a
118
+ heading, check for deep links to that heading in other pages and update
119
+ accordingly.
120
+
121
+ ### Structure
122
+ - **BLUF:** Start with an introduction explaining what to expect.
123
+ - **Experimental features:** If a feature is clearly noted as experimental,
124
+ add the following note immediately after the introductory paragraph:
125
+
126
+ <!-- prettier-ignore -->
127
+ > [!NOTE]
128
+ > This is an experimental feature currently under active development.
129
+ (Note: Use `{/* prettier-ignore */}` if editing an `.mdx` file.)
130
+
131
+ - **Headings:** Use hierarchical headings to support the user journey.
132
+ - **Procedures:**
133
+ - Introduce lists of steps with a complete sentence.
134
+ - Start each step with an imperative verb.
135
+ - Number sequential steps; use bullets for non-sequential lists.
136
+ - Put conditions before instructions (e.g., "On the Settings page, click...").
137
+ - Provide clear context for where the action takes place.
138
+ - Indicate optional steps clearly (e.g., "Optional: ...").
139
+ - **Elements:** Use bullet lists, tables, details, and callouts.
140
+ - **Avoid using a table of contents:** If a table of contents is present, remove
141
+ it.
142
+ - **Next steps:** Conclude with a "Next steps" section if applicable.
143
+
144
+ ## Phase 2: Preparation
145
+ Before modifying any documentation, thoroughly investigate the request and the
146
+ surrounding context.
147
+
148
+ 1. **Clarify:** Understand the core request. Differentiate between writing new
149
+ content and editing existing content. If the request is ambiguous (e.g.,
150
+ "fix the docs"), ask for clarification.
151
+ 2. **Investigate:** Examine relevant code (primarily in `packages/`) for
152
+ accuracy.
153
+ 3. **Audit:** Read the latest versions of relevant files in `docs/`.
154
+ 4. **Connect:** Identify all referencing pages if changing behavior. Check if
155
+ `docs/sidebar.json` needs updates.
156
+ 5. **Plan:** Create a step-by-step plan before making changes.
157
+ 6. **Audit Docset:** If asked to audit the documentation, follow the procedural
158
+ guide in [docs-auditing.md](./references/docs-auditing.md).
159
+
160
+ ## Phase 3: Execution
161
+ Implement your plan by either updating existing files or creating new ones
162
+ using the appropriate file system tools. Use `replace` for small edits and
163
+ `write_file` for new files or large rewrites.
164
+
165
+ ### Editing existing documentation
166
+ Follow these additional steps when asked to review or update existing
167
+ documentation.
168
+
169
+ - **Gaps:** Identify areas where the documentation is incomplete or no longer
170
+ reflects existing code.
171
+ - **Structure:** Apply "Structure (New Docs)" rules (BLUF, headings, etc.) when
172
+ adding new sections to existing pages.
173
+ - **Headers**: If you change a header, you must check for links that lead to
174
+ that header and update them.
175
+ - **Tone:** Ensure the tone is active and engaging. Use "you" and contractions.
176
+ - **Clarity:** Correct awkward wording, spelling, and grammar. Rephrase
177
+ sentences to make them easier for users to understand.
178
+ - **Consistency:** Check for consistent terminology and style across all edited
179
+ documents.
180
+
181
+ ## Phase 4: Verification and finalization
182
+ Perform a final quality check to ensure that all changes are correctly
183
+ formatted and that all links are functional.
184
+
185
+ 1. **Accuracy:** Ensure content accurately reflects the implementation and
186
+ technical behavior.
187
+ 2. **Self-review:** Re-read changes for formatting, correctness, and flow.
188
+ 3. **Link check:** Verify all new and existing links leading to or from
189
+ modified pages. If you changed a header, ensure that any links that lead to
190
+ it are updated.
191
+ 4. **Format:** If `npm run format` fails, it may be necessary to run `npm
192
+ install` first to ensure all formatting dependencies are available. Once all
193
+ changes are complete, ask to execute `npm run format` to ensure consistent
194
+ formatting across the project. If the user confirms, execute the command.
.gemini/skills/docs-writer/quota-limit-style-guide.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Style Guide: Quota vs. Limit
2
+
3
+ This guide defines the usage of "quota," "limit," and related terms in
4
+ user-facing interfaces.
5
+
6
+ ## TL;DR
7
+
8
+ - **`quota`**: The administrative "bucket." Use for settings, billing, and
9
+ requesting increases. (e.g., "Adjust your storage **quota**.")
10
+ - **`limit`**: The real-time numerical "ceiling." Use for error messages when a
11
+ user is blocked. (e.g., "You've reached your request **limit**.")
12
+ - **When blocked, combine them:** Explain the **limit** that was hit and the
13
+ **quota** that is the remedy. (e.g., "You've reached the request **limit** for
14
+ your developer **quota**.")
15
+ - **Related terms:** Use `usage` for consumption tracking, `restriction` for
16
+ fixed rules, and `reset` for when a limit refreshes.
17
+
18
+ ---
19
+
20
+ ## Detailed Guidelines
21
+
22
+ ### Definitions
23
+
24
+ - **Quota is the "what":** It identifies the category of resource being managed
25
+ (e.g., storage quota, GPU quota, request/prompt quota).
26
+ - **Limit is the "how much":** It defines the numerical boundary.
27
+
28
+ Use **quota** when referring to the administrative concept or the request for
29
+ more. Use **limit** when discussing the specific point of exhaustion.
30
+
31
+ ### When to use "quota"
32
+
33
+ Use this term for **account management, billing, and settings.** It describes
34
+ the entitlement the user has purchased or been assigned.
35
+
36
+ **Examples:**
37
+
38
+ - **Navigation label:** Quota and usage
39
+ - **Contextual help:** Your **usage quota** is managed by your organization. To
40
+ request an increase, contact your administrator.
41
+
42
+ ### When to use "limit"
43
+
44
+ Use this term for **real-time feedback, notifications, and error messages.** It
45
+ identifies the specific wall the user just hit.
46
+
47
+ **Examples:**
48
+
49
+ - **Error message:** You’ve reached the 50-request-per-minute **limit**.
50
+ - **Inline warning:** Input exceeds the 32k token **limit**.
51
+
52
+ ### How to use both together
53
+
54
+ When a user is blocked, combine both terms to explain the **event** (limit) and
55
+ the **remedy** (quota).
56
+
57
+ **Example:**
58
+
59
+ - **Heading:** Daily usage limit reached
60
+ - **Body:** You've reached the maximum daily capacity for your developer quota.
61
+ To continue working today, upgrade your quota.
.gemini/skills/docs-writer/references/docs-auditing.md ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Procedural Guide: Auditing the Docset
2
+
3
+ This guide outlines the process for auditing the Gemini CLI documentation for
4
+ correctness and adherence to style guidelines. This process involves both an
5
+ "Editor" and "Technical Writer" phase.
6
+
7
+ ## Objective
8
+
9
+ To ensure all public-facing documentation is accurate, up-to-date, adheres to
10
+ the Gemini CLI documentation style guide, and reflects the current state of the
11
+ codebase.
12
+
13
+ ## Phase 1: Editor Audit
14
+
15
+ **Role:** The editor is responsible for identifying potential issues based on
16
+ style guide violations and technical inaccuracies.
17
+
18
+ ### Steps
19
+
20
+ 1. **Identify Documentation Scope:**
21
+ - Read `docs/sidebar.json` to get a list of all viewable documentation
22
+ pages.
23
+ - For each entry with a `slug`, convert it into a file path (e.g., `docs` ->
24
+ `docs/index.md`, `docs/get-started` -> `docs/get-started.md`). Ignore
25
+ entries with `link` properties.
26
+
27
+ 2. **Prepare Audit Results File:**
28
+ - Create a new Markdown file named `audit-results-[YYYY-MM-DD].md` (e.g.,
29
+ `audit-results-2026-03-13.md`). This file will contain all identified
30
+ violations and recommendations.
31
+
32
+ 3. **Retrieve Style Guidelines:**
33
+ - Familiarize yourself with the `docs-writer` skill instructions and the
34
+ included style guidelines.
35
+
36
+ 4. **Audit Each Document:**
37
+ - For each documentation file identified in Step 1, read its content.
38
+ - **Review against Style Guide:**
39
+ - **Voice and Tone Violations:**
40
+ - **Unprofessional Tone:** Identify phrasing that is overly casual,
41
+ defensive, or lacks a professional and friendly demeanor.
42
+ - **Indirectness or Vagueness:** Identify sentences that are
43
+ unnecessarily wordy or fail to be concise and direct.
44
+ - **Incorrect Pronoun:** Identify any use of third-person pronouns
45
+ (e.g., "we," "they," "the user") when referring to the reader, instead
46
+ of the second-person pronoun **"you"**.
47
+ - **Passive Voice:** Identify sentences written in the passive voice.
48
+ - **Incorrect Tense:** Identify the use of past or future tense verbs,
49
+ instead of the **present tense**.
50
+ - **Poor Vocabulary:** Identify the use of jargon, slang, or overly
51
+ informal language.
52
+ - **Language and Grammar Violations:**
53
+ - **Lack of Conciseness:** Identify unnecessarily long phrases or
54
+ sentences.
55
+ - **Punctuation Errors:** Identify incorrect or missing punctuation.
56
+ - **Ambiguous Dates:** Identify dates that could be misinterpreted
57
+ (e.g., "next Monday" instead of "April 15, 2026").
58
+ - **Abbreviation Usage:** Identify the use of abbreviations that should
59
+ be spelled out (e.g., "e.g." instead of "for example").
60
+ - **Terminology:** Check for incorrect or inconsistent use of
61
+ product-specific terms (e.g., "quota" vs. "limit").
62
+ - **Formatting and Syntax Violations:**
63
+ - **Missing Overview:** Check for the absence of a brief overview
64
+ paragraph at the start of the document.
65
+ - **Line Length:** Identify any lines of text that exceed **80
66
+ characters** (text wrap violation).
67
+ - **Casing:** Identify incorrect casing for headings, titles, or named
68
+ entities (e.g., product names like `Gemini CLI`).
69
+ - **List Formatting:** Identify incorrectly formatted lists (e.g.,
70
+ inconsistent indentation or numbering).
71
+ - **Incorrect Emphasis:** Identify incorrect use of bold text (should
72
+ only be used for UI elements) or code font (should be used for code,
73
+ file names, or command-line input).
74
+ - **Link Quality:** Identify links with non-descriptive anchor text
75
+ (e.g., "click here").
76
+ - **Image Alt Text:** Identify images with missing or poor-quality
77
+ (non-descriptive) alt text.
78
+ - **Structure Violations:**
79
+ - **Missing BLUF:** Check for the absence of a "Bottom Line Up Front"
80
+ summary at the start of complex sections or documents.
81
+ - **Experimental Feature Notes:** Identify experimental features that
82
+ are not clearly labeled with a standard note.
83
+ - **Heading Hierarchy:** Check for skipped heading levels (e.g., going
84
+ from `##` to `####`).
85
+ - **Procedure Clarity:** Check for procedural steps that do not start
86
+ with an imperative verb or where a condition is placed _after_ the
87
+ instruction.
88
+ - **Element Misuse:** Identify the incorrect or inappropriate use of
89
+ special elements (e.g., Notes, Warnings, Cautions).
90
+ - **Table of Contents:** Identify the presence of a dynamically
91
+ generated or manually included table of contents.
92
+ - **Missing Next Steps:** Check for procedural documents that lack a
93
+ "Next steps" section (if applicable).
94
+ - **Verify Code Accuracy (if applicable):**
95
+ - If the document contains code snippets (e.g., shell commands, API calls,
96
+ file paths, Docker image versions), use `grep_search` and `read_file`
97
+ within the `packages/` directory (or other relevant parts of the
98
+ codebase) to ensure the code is still accurate and up-to-date. Pay close
99
+ attention to version numbers, package names, and command syntax.
100
+ - **Record Findings:** For each **violation** or inaccuracy found:
101
+ - Note the file path.
102
+ - Describe the violation (e.g., "Violation (Language and Grammar): Uses
103
+ 'e.g.'").
104
+ - Provide a clear and actionable recommendation to correct the issue.
105
+ (e.g., "Recommendation: Replace 'e.g.' with 'for example'." or
106
+ "Recommendation: Replace '...' with '...' in active voice.).
107
+ - Append these findings to `audit-results-[YYYY-MM-DD].md`.
108
+
109
+ ## Phase 2: Software Engineer Audit
110
+
111
+ **Role:** The software engineer is responsible for finding undocumented features
112
+ by auditing the codebase and recent changelogs, and passing these findings to
113
+ the technical writer.
114
+
115
+ ### Steps
116
+
117
+ 1. **Proactive Codebase Audit:**
118
+ - Audit high-signal areas of the codebase to identify undocumented features.
119
+ You MUST review:
120
+ - `packages/cli/src/commands/`
121
+ - `packages/core/src/tools/`
122
+ - `packages/cli/src/config/settings.ts`
123
+
124
+ 2. **Review Recent Updates:**
125
+ - Check recent changelogs in stable and announcements within the
126
+ documentation to see if newly introduced features are documented properly.
127
+
128
+ 3. **Evaluate and Record Findings:**
129
+ - Determine if these features are adequately covered in the docs. They do
130
+ not need to be documented word for word, but major features that customers
131
+ should care about probably should have an article.
132
+ - Append your findings to the `audit-results-[YYYY-MM-DD].md` file,
133
+ providing a brief description of the feature and where it should be
134
+ documented.
135
+
136
+ ## Phase 3: Technical Writer Implementation
137
+
138
+ **Role:** The technical writer handles input from both the editor and the
139
+ software engineer, makes appropriate decisions about what to change, and
140
+ implements the approved changes.
141
+
142
+ ### Steps
143
+
144
+ 1. **Review Audit Results:**
145
+ - Read `audit-results-[YYYY-MM-DD].md` to understand all identified issues,
146
+ undocumented features, and recommendations from both the Editor and
147
+ Software Engineer phases.
148
+
149
+ 2. **Make Decisions and Log Reasoning:**
150
+ - Create or update an implementation log (e.g.,
151
+ `audit-implementation-log-[YYYY-MM-DD].md`).
152
+ - Make sure the logs are updated for all steps, documenting your reasoning
153
+ for each recommendation (why it was accepted, modified, or rejected). This
154
+ is required for a final check by a human in the PR.
155
+
156
+ 3. **Implement Changes:**
157
+ - For each approved recommendation:
158
+ - Read the target documentation file.
159
+ - Apply the recommended change using the `replace` tool. Pay close
160
+ attention to `old_string` for exact matches, including whitespace and
161
+ newlines. For multiple occurrences of the same simple string (e.g.,
162
+ "e.g."), use `allow_multiple: true`.
163
+ - **String replacement safeguards:** When applying these fixes across the
164
+ docset, you must verify the following:
165
+ - **Preserve Code Blocks:** Explicitly verify that no code blocks,
166
+ inline code snippets, terminal commands, or file paths have been
167
+ erroneously capitalized or modified.
168
+ - **Preserve Literal Strings:** Never alter the wording of literal error
169
+ messages, UI quotes, or system logs. For example, if a style rule says
170
+ to remove the word "please", you must NOT remove it if it appears
171
+ inside a quoted error message (e.g.,
172
+ `Error: Please contact your administrator`).
173
+ - **Verify Sentence Casing:** When removing filler words (like "please")
174
+ from the beginning of a sentence or list item, always verify that the
175
+ new first word of the sentence is properly capitalized.
176
+ - For structural changes (e.g., adding an overview paragraph), use
177
+ `replace` or `write_file` as appropriate.
178
+ - For broken links, determine the correct new path or update the link
179
+ text.
180
+ - For creating new files (e.g., `docs/get-started.md` to fix a broken
181
+ link, or a new feature article), use `write_file`.
182
+
183
+ 4. **Execute Auto-Generation Scripts:**
184
+ - Some documentation pages are auto-generated from the codebase and should
185
+ be updated using npm scripts rather than manual edits. After implementing
186
+ manual changes (especially if you edited settings or configurations based
187
+ on SWE recommendations), ensure you run:
188
+ - `npm run docs:settings` to generate/update the configuration reference.
189
+ - `npm run docs:keybindings` to generate/update the keybindings reference.
190
+
191
+ 5. **Format Code:**
192
+ - **Dependencies:** If `npm run format` fails, it may be necessary to run
193
+ `npm install` first to ensure all formatting dependencies are available.
194
+ - After all changes have been implemented, run `npm run format` to ensure
195
+ consistent formatting across the project.
.gemini/skills/github-issue-creator/SKILL.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: github-issue-creator
3
+ description:
4
+ Use this skill when asked to create a GitHub issue. It handles different issue
5
+ types (bug, feature, etc.) using repository templates and ensures proper
6
+ labeling.
7
+ ---
8
+
9
+ # GitHub Issue Creator
10
+
11
+ This skill guides the creation of high-quality GitHub issues that adhere to the
12
+ repository's standards and use the appropriate templates.
13
+
14
+ ## Workflow
15
+
16
+ Follow these steps to create a GitHub issue:
17
+
18
+ 1. **Identify Issue Type**: Determine if the request is a bug report, feature
19
+ request, or other category.
20
+
21
+ 2. **Locate Template**: Search for issue templates in
22
+ `.github/ISSUE_TEMPLATE/`.
23
+ - `bug_report.yml`
24
+ - `feature_request.yml`
25
+ - `website_issue.yml`
26
+ - If no relevant YAML template is found, look for `.md` templates in the same
27
+ directory.
28
+
29
+ 3. **Read Template**: Read the content of the identified template file to
30
+ understand the required fields.
31
+
32
+ 4. **Draft Content**: Draft the issue title and body/fields.
33
+ - If using a YAML template (form), prepare values for each `id` defined in
34
+ the template.
35
+ - If using a Markdown template, follow its structure exactly.
36
+ - **Default Label**: Always include the `🔒 maintainer only` label unless the
37
+ user explicitly requests otherwise.
38
+
39
+ 5. **Create Issue**: Use the `gh` CLI to create the issue.
40
+ - **CRITICAL:** To avoid shell escaping and formatting issues with
41
+ multi-line Markdown or complex text, ALWAYS write the description/body to
42
+ a temporary file first.
43
+
44
+ **For Markdown Templates or Simple Body:**
45
+ ```bash
46
+ # 1. Write the drafted content to a temporary file
47
+ # 2. Create the issue using the --body-file flag
48
+ gh issue create --title "Succinct title" --body-file <temp_file_path> --label "🔒 maintainer only"
49
+ # 3. Remove the temporary file
50
+ rm <temp_file_path>
51
+ ```
52
+
53
+ **For YAML Templates (Forms):**
54
+ While `gh issue create` supports `--body-file`, YAML forms usually expect
55
+ key-value pairs via flags if you want to bypass the interactive prompt.
56
+ However, the most reliable non-interactive way to ensure formatting is
57
+ preserved for long text fields is to use the `--body` or `--body-file` if the
58
+ form has been converted to a standard body, OR to use the `--field` flags
59
+ for YAML forms.
60
+
61
+ *Note: For the `gemini-cli` repository which uses YAML forms, you can often
62
+ submit the content as a single body if a specific field-based submission is
63
+ not required by the automation.*
64
+
65
+ 6. **Verify**: Confirm the issue was created successfully and provide the link
66
+ to the user.
67
+
68
+ ## Principles
69
+
70
+ - **Clarity**: Titles should be descriptive and follow project conventions.
71
+ - **Defensive Formatting**: Always use temporary files with `--body-file` to
72
+ prevent newline and special character issues.
73
+ - **Maintainer Priority**: Default to internal/maintainer labels to keep the
74
+ backlog organized.
75
+ - **Completeness**: Provide all requested information (e.g., version info,
76
+ reproduction steps).
.gemini/skills/pr-address-comments/SKILL.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: pr-address-comments
3
+ description: Use this skill if the user asks you to help them address GitHub PR comments for their current branch of the Gemini CLI. Requires `gh` CLI tool.
4
+ ---
5
+ You are helping the user address comments on their Pull Request. These comments may have come from an automated review agent or a team member.
6
+
7
+ OBJECTIVE: Help the user review and address comments on their PR.
8
+
9
+ # Comment Review Procedure
10
+
11
+ 1. Run the `scripts/fetch-pr-info.js` script to get PR info and state. MAKE SURE you read the entire output of the command, even if it gets truncated.
12
+ 2. Summarize the review status by analyzing the diff, commit log, and comments to see which still need to be addressed. Pay attention to the current user's comments. For resolved threads, summarize as a single line with a ✅. For open threads, provide a reference number e.g. [1] and the comment content.
13
+ 3. Present your summary of the feedback and current state and allow the user to guide you as to what to fix/address/skip. DO NOT begin fixing issues automatically.
.gemini/skills/pr-address-comments/scripts/fetch-pr-info.js ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @license
4
+ * Copyright 2025 Google LLC
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+
8
+ /* eslint-env node */
9
+ /* global console, process */
10
+
11
+ import { exec } from 'node:child_process';
12
+ import { promisify } from 'node:util';
13
+
14
+ const execAsync = promisify(exec);
15
+
16
+ async function run(cmd) {
17
+ try {
18
+ const { stdout } = await execAsync(cmd, {
19
+ encoding: 'utf8',
20
+ stdio: ['pipe', 'pipe', 'ignore'],
21
+ });
22
+ return stdout.trim();
23
+ } catch {
24
+ return null;
25
+ }
26
+ }
27
+
28
+ const IGNORE_MESSAGES = [
29
+ 'thank you so much for your contribution to Gemini CLI!',
30
+ "I'm currently reviewing this pull request and will post my feedback shortly.",
31
+ 'This pull request is being closed because it is not currently linked to an issue.',
32
+ ];
33
+
34
+ const shouldIgnore = (body) => {
35
+ if (!body) return false;
36
+ return IGNORE_MESSAGES.some((msg) => body.includes(msg));
37
+ };
38
+
39
+ async function main() {
40
+ const branch = await run('git branch --show-current');
41
+ if (!branch) {
42
+ console.error('❌ Could not determine current git branch.');
43
+ process.exit(1);
44
+ }
45
+
46
+ const gqlQuery = `query($branch:String!){repository(name:"gemini-cli",owner:"google-gemini"){pullRequests(headRefName:$branch,first:100){nodes{id,number,state,comments(first:100){nodes{createdAt,isMinimized,minimizedReason,author{login},body,url,authorAssociation}},reviews(first:100){nodes{id,author{login},createdAt,isMinimized,minimizedReason,body,state,comments(first:30){nodes{id,replyTo{id},author{login},createdAt,body,isMinimized,minimizedReason,path,line,startLine,originalLine,originalStartLine}}}}}}}}`;
47
+
48
+ const [authInfo, diff, commits, rawJson] = await Promise.all([
49
+ run('gh auth status -a'),
50
+ run('gh pr diff'),
51
+ run(
52
+ 'git fetch && git log origin/main..origin/$(git branch --show-current)',
53
+ ),
54
+ run(`gh api graphql -F branch="${branch}" -f query='${gqlQuery}'`),
55
+ ]);
56
+
57
+ if (!diff) {
58
+ console.error(`⚠️ No active PR found for branch: ${branch}`);
59
+ process.exit(1);
60
+ }
61
+
62
+ console.log(`\n# Current GitHub user info:\n\n${authInfo}\n`);
63
+ console.log(`\n# PR diff for current branch: ${branch}\n\n\`\`\``);
64
+ console.log(diff);
65
+ console.log('```');
66
+ console.log(
67
+ `\n# Commit history (origin/main..origin/${branch})\n\n${commits}`,
68
+ );
69
+
70
+ const data = JSON.parse(rawJson || '{}');
71
+ const prs = data?.data?.repository?.pullRequests?.nodes || [];
72
+
73
+ // Sort PRs by number descending so we check the newest one first
74
+ prs.sort((a, b) => b.number - a.number);
75
+
76
+ const pr = prs.find((p) => p.state === 'OPEN') || prs[0];
77
+
78
+ if (!pr) {
79
+ console.error('❌ No PR data found.');
80
+ process.exit(1);
81
+ }
82
+
83
+ console.log('\n# PR Feedback\n');
84
+
85
+ // 1. General PR Comments
86
+ const general = pr.comments.nodes.filter((c) => !shouldIgnore(c.body));
87
+ if (general.length > 0) {
88
+ console.log('\n💬 GENERAL COMMENTS:');
89
+ general.forEach((c) => {
90
+ const minimized = c.isMinimized
91
+ ? ` (Minimized: ${c.minimizedReason})`
92
+ : '';
93
+ console.log(
94
+ `[${c.createdAt}] [${c.author.login}]${minimized}: ${c.body}\n`,
95
+ );
96
+ });
97
+ }
98
+
99
+ // 2. Process ALL Review Comments into a single Thread Map
100
+ const allInlineComments = pr.reviews.nodes.flatMap((r) => r.comments.nodes);
101
+ const filteredInlines = allInlineComments.filter(
102
+ (c) => !shouldIgnore(c.body),
103
+ );
104
+
105
+ console.log('🔍 CODE REVIEWS & INLINE THREADS:');
106
+
107
+ // Print Review Summaries First
108
+ pr.reviews.nodes.forEach((review) => {
109
+ if (review.body && !shouldIgnore(review.body)) {
110
+ const icon = review.state === 'APPROVED' ? '✅' : '💬';
111
+ const minimized = review.isMinimized
112
+ ? ` (Minimized: ${review.minimizedReason})`
113
+ : '';
114
+ console.log(
115
+ `\n${icon} ${review.state} by ${review.author.login} at ${review.createdAt}${minimized}: "${review.body}"`,
116
+ );
117
+ }
118
+ });
119
+
120
+ // Build and Print Threads
121
+ const topLevelThreads = filteredInlines.filter((c) => !c.replyTo);
122
+
123
+ const printThread = (parentId, depth = 1) => {
124
+ const indent = ' '.repeat(depth);
125
+ filteredInlines
126
+ .filter((c) => c.replyTo?.id === parentId)
127
+ .forEach((reply) => {
128
+ const minimized = reply.isMinimized
129
+ ? ` (Minimized: ${reply.minimizedReason})`
130
+ : '';
131
+ console.log(
132
+ `${indent}↳ [${reply.createdAt}] ${reply.author.login}${minimized}: ${reply.body}`,
133
+ );
134
+ printThread(reply.id, depth + 1);
135
+ });
136
+ };
137
+
138
+ topLevelThreads.forEach((c) => {
139
+ const start = c.startLine || c.originalStartLine;
140
+ const end = c.line || c.originalLine;
141
+ const range = start && end && start !== end ? `${start}-${end}` : end || '';
142
+ const fileInfo = c.path
143
+ ? `(${c.path}${range ? `:${range}` : ''}) `
144
+ : range
145
+ ? `(Line ${range}) `
146
+ : '';
147
+ const minimized = c.isMinimized ? ` (Minimized: ${c.minimizedReason})` : '';
148
+ console.log(
149
+ `\n💬 ${minimized}${c.author.login} | ${c.createdAt} ${fileInfo}\n${c.body}`,
150
+ );
151
+ printThread(c.id);
152
+ });
153
+
154
+ console.log('\n');
155
+ }
156
+
157
+ main().catch((err) => {
158
+ console.error('❌ Unexpected error:', err);
159
+ process.exit(1);
160
+ });
.gemini/skills/pr-creator/SKILL.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: pr-creator
3
+ description:
4
+ Use this skill when asked to create a pull request (PR). It ensures all PRs
5
+ follow the repository's established templates and standards.
6
+ ---
7
+
8
+ # Pull Request Creator
9
+
10
+ This skill guides the creation of high-quality Pull Requests that adhere to the
11
+ repository's standards.
12
+
13
+ ## Workflow
14
+
15
+ Follow these steps to create a Pull Request:
16
+
17
+ 1. **Branch Management**: **CRITICAL:** Ensure you are NOT working on the
18
+ `main` branch.
19
+ - Run `git branch --show-current`.
20
+ - If the current branch is `main`, you MUST create and switch to a new
21
+ descriptive branch:
22
+ ```bash
23
+ git checkout -b <new-branch-name>
24
+ ```
25
+
26
+ 2. **Commit Changes**: Verify that all intended changes are committed.
27
+ - Run `git status` to check for unstaged or uncommitted changes.
28
+ - If there are uncommitted changes, stage and commit them with a descriptive
29
+ message before proceeding. NEVER commit directly to `main`.
30
+ ```bash
31
+ git add .
32
+ git commit -m "type(scope): description"
33
+ ```
34
+
35
+ 3. **Locate Template**: Search for a pull request template in the repository.
36
+ - Check `.github/pull_request_template.md`
37
+ - Check `.github/PULL_REQUEST_TEMPLATE.md`
38
+ - If multiple templates exist (e.g., in `.github/PULL_REQUEST_TEMPLATE/`),
39
+ ask the user which one to use or select the most appropriate one based on
40
+ the context (e.g., `bug_fix.md` vs `feature.md`).
41
+
42
+ 4. **Read Template**: Read the content of the identified template file.
43
+
44
+ 5. **Draft Description**: Create a PR description that strictly follows the
45
+ template's structure.
46
+ - **Headings**: Keep all headings from the template.
47
+ - **Checklists**: Review each item. Mark with `[x]` if completed. If an item
48
+ is not applicable, leave it unchecked or mark as `[ ]` (depending on the
49
+ template's instructions) or remove it if the template allows flexibility
50
+ (but prefer keeping it unchecked for transparency).
51
+ - **Content**: Fill in the sections with clear, concise summaries of your
52
+ changes.
53
+ - **Related Issues**: Link any issues fixed or related to this PR (e.g.,
54
+ "Fixes #123").
55
+
56
+ 6. **Preflight Check**: Before creating the PR, run the workspace preflight
57
+ script to ensure all build, lint, and test checks pass.
58
+ ```bash
59
+ npm run preflight
60
+ ```
61
+ If any checks fail, address the issues before proceeding to create the PR.
62
+
63
+ 7. **Push Branch**: Push the current branch to the remote repository.
64
+ **CRITICAL SAFETY RAIL:** Double-check your branch name before pushing.
65
+ NEVER push if the current branch is `main`.
66
+ ```bash
67
+ # Verify current branch is NOT main
68
+ git branch --show-current
69
+ # Push non-interactively
70
+ git push -u origin HEAD
71
+ ```
72
+
73
+ 8. **Create PR**: Use the `gh` CLI to create the PR. To avoid shell escaping
74
+ issues with multi-line Markdown, write the description to a temporary file
75
+ first.
76
+ ```bash
77
+ # 1. Write the drafted description to a temporary file
78
+ # 2. Create the PR using the --body-file flag
79
+ gh pr create --title "type(scope): succinct description" --body-file <temp_file_path>
80
+ # 3. Remove the temporary file
81
+ rm <temp_file_path>
82
+ ```
83
+ - **Title**: Ensure the title follows the
84
+ [Conventional Commits](https://www.conventionalcommits.org/) format if the
85
+ repository uses it (e.g., `feat(ui): add new button`,
86
+ `fix(core): resolve crash`).
87
+
88
+ ## Principles
89
+
90
+ - **Safety First**: NEVER push to `main`. This is your highest priority.
91
+ - **Compliance**: Never ignore the PR template. It exists for a reason.
92
+ - **Completeness**: Fill out all relevant sections.
93
+ - **Accuracy**: Don't check boxes for tasks you haven't done.
.gemini/skills/review-duplication/SKILL.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: review-duplication
3
+ description: Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
4
+ ---
5
+
6
+ # Review Duplication
7
+
8
+ ## Overview
9
+
10
+ This skill provides a structured workflow for investigating a codebase during a code review to identify duplicated logic, reinvented utilities, and missed opportunities to reuse established patterns. By executing this workflow, you ensure that new code integrates seamlessly with the existing project architecture.
11
+
12
+ ## Workflow: Investigating for Duplication
13
+
14
+ When reviewing code, perform the following steps before finalizing your review:
15
+
16
+ ### 1. Extract Core Logic
17
+ Analyze the new code to identify the core algorithms, utility functions, generic data structures, or UI components being introduced. Look beyond the specific business logic to see the underlying mechanics.
18
+
19
+ ### 2. Hypothesize Existing Locations & Trace Dependencies
20
+ Think about where this type of code *would* live if it already existed in the project. Provide absolute paths from the repo root to disambiguate.
21
+ - **Utilities:** `packages/core/src/utils/`, `packages/cli/src/utils/`
22
+ - **UI Components:** `packages/cli/src/ui/components/`, `packages/cli/src/ui/`
23
+ - **Services:** `packages/core/src/services/`, `packages/cli/src/services/`
24
+ - **Configuration:** `packages/core/src/config/`, `packages/cli/src/config/`
25
+ - **Core Logic:** Call out `packages/core/` if functionality does not appear React UI specific.
26
+
27
+ **Trace Third-Party Dependencies:** If the PR introduces a new import for a utility library (e.g., `lodash.merge`, `date-fns`), trace how and where the project currently uses that library. There is likely an existing wrapper or shared utility.
28
+
29
+ **Check Package Files:** Before flagging a custom implementation of a complex algorithm, check `package.json` to see if a standard library (like `lodash` or `uuid`) is already installed that provides this functionality.
30
+
31
+ ### 3. Investigate the Codebase (Sub-Agent Delegation)
32
+ Delegate the heavy lifting of codebase investigation to specialized sub-agents. They are optimized to perform deep searches and semantic mapping without bloating your session history.
33
+
34
+ To ensure a comprehensive review, you MUST formulate highly specific objectives for the sub-agents, providing them with the "scents" you discovered in Step 1.
35
+
36
+ - **Codebase Investigator:** Use the `codebase_investigator` as your primary researcher. When delegating, formulate an objective that asks specific, investigative questions about the codebase, explicitly including these search vectors:
37
+ - **Structural Similarity:** Ask if existing code uses the same underlying APIs (e.g., "Does any existing code use `Intl.DateTimeFormat` or `setTimeout` for similar purposes?").
38
+ - **Naming Conventions:** Ask if there are existing symbols with similar naming patterns (e.g., "Are there existing symbols with naming patterns like `*Format*` or `*Debounce*`?").
39
+ - **Comments & Documentation:** Ask if keywords from the PR's comments or JSDoc exist in describing similar behavior elsewhere.
40
+ - **Architectural Fit:** Ask where this type of logic is currently centralized (e.g., "Where is centralized date formatting logic located?").
41
+ - **Refactoring Guidance:** Crucially, ask the sub-agent to explain *how* the new code could be refactored to use any existing logic it finds.
42
+ - **Generalist Agent:** Use the `generalist` for detailed, turn-intensive comparisons. For example: "Review the implementation of `MyNewComponent` in the PR and compare it semantically against all components in `packages/ui/src`. Are there any existing components that could be extended or used instead?"
43
+ - **Retain Fast Path for Simple Searches:** For extremely simple, unambiguous checks (e.g., "Does `package.json` include `lodash`?"), perform a direct search to save time. Default to delegation for any open-ended "investigations."
44
+
45
+ ### 4. Evaluate Best Practices
46
+ Check if the new code aligns with the project's established conventions.
47
+ - **Error Handling:** Does it use the project's standard error classes or logging mechanisms?
48
+ - **State Management:** Does it bypass established stores or contexts?
49
+ - **Styling:** Does it hardcode colors or spacing instead of using theme variables?
50
+ If the PR introduces a new pattern, compare it against the documented standards and explicitly confirm if an existing project pattern should have been used instead.
51
+
52
+ ### 5. Formulate Constructive Feedback
53
+ If you discover that the PR duplicates existing functionality or ignores a best practice:
54
+ - Provide a clear review comment.
55
+ - **Identify the Source:** Explicitly mention the absolute or project-relative file path and the specific symbol (function, component, class) that should be reused.
56
+ - **Implementation Guidance:** Provide a brief code snippet or a clear explanation showing **how** to integrate the existing code to fulfill the task's requirements.
57
+ - **Explain the Value:** Briefly explain why reusing the existing code is beneficial (e.g., maintainability, consistency, built-in edge case handling).
58
+
59
+ Example comment:
60
+ > "It looks like this PR introduces a new `formatDate` utility. We already have a robust, tested `formatDate` function in `src/utils/dateHelpers.ts`.
61
+ >
62
+ > You can replace your implementation by importing it like this:
63
+ > ```typescript
64
+ > import { formatDate } from '../utils/dateHelpers';
65
+ >
66
+ > // Then use it here:
67
+ > const displayDate = formatDate(userDate, 'MMM Do, YYYY');
68
+ > ```
69
+ > Reusing this ensures that the date formatting remains consistent with the rest of the application and handles timezone conversions correctly."
.gemini/skills/string-reviewer/SKILL.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: string-reviewer
3
+ description: >
4
+ Use this skill when asked to review text and user-facing strings within the codebase. It ensures that these strings follow rules on clarity,
5
+ usefulness, brevity and style.
6
+ ---
7
+
8
+ # String Reviewer
9
+
10
+ ## Instructions
11
+
12
+ Act as a Senior UX Writer. Look for user-facing strings that are too long,
13
+ unclear, or inconsistent. This includes inline text, error messages, and other
14
+ user-facing text.
15
+
16
+ Do NOT automatically change strings without user approval. You must only suggest
17
+ changes and do not attempt to rewrite them directly unless the user explicitly
18
+ asks you to do so.
19
+
20
+ ## Core voice principles
21
+
22
+ The system prioritizes deterministic clarity over conversational fluff. We
23
+ provide telemetry, not etiquette, ensuring the user retains absolute agency..
24
+
25
+ 1. **Deterministic clarity:** Distinguish between certain system/service states
26
+ (Cloud Billing, IAM, the System) and probabilistic AI analysis (Gemini).
27
+ 2. **System transparency:** Replace "Loading..." with active technical telemetry
28
+ (e.g., Tracing stack traces...). Keep status updates under 5 words.
29
+ 3. **Front-loaded actionability:** Always use the [Goal] + [Action] pattern.
30
+ Lead with intent so users can scan left-to-right.
31
+ 4. **Agentic error recovery:** Every error must be a pivot point. Pair failures
32
+ with one-click recovery commands or suggested prompts.
33
+ 5. **Contextual humility:** Reserve disclaimers and "be careful" warnings for P0
34
+ (destructive/irreversible) tasks only. Stop warning-fatigue.
35
+
36
+ ## The writing checklist
37
+
38
+ Use this checklist to audit UI strings and AI responses.
39
+
40
+ ### Identity and voice
41
+ - **Eliminate the "I":** Remove all first-person pronouns (I, me, my, mine).
42
+ - **Subject attribution:** Refer to the AI as Gemini and the infrastructure as
43
+ the - system or the CLI.
44
+ - **Active voice:** Ensure the subject (Gemini or the system) is clearly
45
+ performing the action.
46
+ - **Ownership rule:** Use the system for execution (doing) and Gemini for
47
+ analysis (thinking)
48
+
49
+ ### Structural scannability
50
+ - **The skip test:** Do the first 3 words describe the user’s intent? If not,
51
+ rewrite.
52
+ - **Goal-first sequence:** Use the template: [To Accomplish X] + [Do Y].
53
+ - **The 5-word rule:** Keep status updates and loading states under 5 words.
54
+ - **Telemetry over etiquette:** Remove polite filler (Please wait, Thank you,
55
+ Certainly). Replace with raw data or progress indicators.
56
+ - **Micro-state cycles:** For tasks $> 3$ seconds, cycle through specific
57
+ sub-states (e.g., Parsing logs... ➔ Identifying patterns...) to show momentum.
58
+
59
+
60
+ ### Technical accuracy and humility
61
+ - **Verb signal check:** Use deterministic verbs (is, will, must) for system
62
+ state/infrastructure.
63
+ - Use probabilistic verbs (suggests, appears, may, identifies) for AI output.
64
+ - **No 100% certainty:** Never attribute absolute certainty to model-generated
65
+ content.
66
+ - **Precision over fuzziness:** Use technical metrics (latency, tokens, compute) instead of "speed" or "cost."
67
+ - **Instructional warnings:** Every warning must include a specific corrective action (e.g., "Perform a dry-run first" or "Review line 42").
68
+
69
+ ### Agentic error recovery
70
+ - **The one-step rule:** Pair every error message with exactly one immediate
71
+ path to a fix (command, link, or prompt).
72
+ - **Human-first:** Provide a human-readable explanation before machine error
73
+ codes (e.g., 404, 500).
74
+ - **Suggested prompts:** Offer specific text for the user to copy/click like
75
+ “Ask Gemini: 'Explain this port error.'”
76
+
77
+ ### Use consistent terminology
78
+
79
+ Ensure all terminology aligns with the project [word
80
+ list](./references/word-list.md).
81
+
82
+ If a string uses a term marked "do not use" or "use with caution," provide a
83
+ correction based on the preferred terms.
84
+
85
+ ## Ensure consistent style for settings
86
+
87
+ If `packages/cli/src/config/settingsSchema.ts` is modified, confirm labels and
88
+ descriptions specifically follow the unique [Settings
89
+ guidelines](./references/settings.md).
90
+
91
+ ## Output format
92
+ When suggesting changes, always present your review using the following list
93
+ format. Do not provide suggestions outside of this list..
94
+
95
+ ```
96
+ 1. **{Rationale/Principle Violated}**
97
+ - ❌ "{incorrect phrase}"
98
+ - ✅ `"{corrected phrase}"`
99
+ ```
.gemini/skills/string-reviewer/references/settings.md ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Settings
2
+
3
+ ## Noun-First Labeling (Scannability)
4
+
5
+ Labels must start with the subject of the setting, not the action. This allows
6
+ users to scan for the feature they want to change.
7
+
8
+ - **Rule:** `[Noun]` `[Attribute/Action]`
9
+ - **Example:** `Show line numbers` becomes simply `Line numbers`
10
+
11
+ ## Positive Boolean Logic (Cognitive Ease)
12
+
13
+ Eliminate "double negatives." Booleans should represent the presence of a
14
+ feature, not its absence.
15
+
16
+ - **Rule:** Replace `Disable {feature}` or `Hide {Feature}` with
17
+ `{Feature} enabled` or simply `{Feature}`.
18
+ - **Example:** Change "Disable auto update" to "Auto update".
19
+ - **Implementation:** Invert the boolean value in your config loader so true
20
+ always equals `On`
21
+
22
+ ## Verb Stripping (Brevity)
23
+
24
+ Remove redundant leading verbs like "Enable," "Use," "Display," or "Show" unless
25
+ they are part of a specific technical term.
26
+
27
+ - **Rule**: If the label works without the verb, remove it
28
+ - **Example**: Change `Enable prompt completion` to `Prompt completion`
.gemini/skills/string-reviewer/references/word-list.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Terms
2
+
3
+ ### Preferred
4
+
5
+ - Use **create** when a user is creating or setting up something.
6
+ - Use **allow** instead of **may** to indicate that permission has been granted
7
+ to perform some action.
8
+ - Use **canceled**, not **cancelled**.
9
+ - Use **configure** to refer to the process of changing the attributes of a
10
+ feature, even if that includes turning on or off the feature.
11
+ - Use **delete** when the action being performed is destructive.
12
+ - Use **enable** for binary operations that turn a feature or API on. Use "turn
13
+ on" and "turn off" instead of "enable" and "disable" for other situations.
14
+ - Use **key combination** to refer to pressing multiple keys simultaneously.
15
+ - Use **key sequence** to refer to pressing multiple keys separately in order.
16
+ - Use **modify** to refer to something that has changed vs obtaining the latest
17
+ version of something.
18
+ - Use **remove** when the action being performed takes an item out of a larger
19
+ whole, but doesn't destroy the item itself.
20
+ - Use **set up** as a verb. Use **setup** as a noun or adjective.
21
+ - Use **show**. In general, use paired with **hide**.
22
+ - Use **sign in**, **sign out** as a verb. Use **sign-in** or **sign-out** as a
23
+ noun or adjective.
24
+ - Use **update** when you mean to obtain the latest version of something.
25
+ - Use **want** instead of **like** or **would like**.
26
+
27
+ #### Don't use
28
+
29
+ - Don't use **etc.** It's redundant. To convey that a series is incomplete,
30
+ introduce it with "such as" instead.
31
+ - Don't use **hostname**, use "host name" instead.
32
+ - Don't use **in order to**. It's too formal. "Before you can" is usually better
33
+ in UI text.
34
+ - Don't use **one or more**. Specify the quantity where possible. Use "at least
35
+ one" when the quantity is 1+ but you can't be sure of the number. Likewise,
36
+ use "at least one" when the user must choose a quantity of 1+.
37
+ - Don't use the terms **log in**, **log on**, **login**, **logout** or **log
38
+ out**.
39
+ - Don't use **like** or **would you like**. Use **want** instead. Better yet,
40
+ rephrase so that it's not referring to the user's emotional state, but rather
41
+ what is required.
42
+
43
+ #### Use with caution
44
+
45
+ - Avoid using **leverage**, especially as a verb. "Leverage" is considered a
46
+ buzzword largely devoid of meaning apart from the simpler "use".
47
+ - Avoid using **once** as a synonym for "after". Typically, when "once" is used
48
+ in this way, it is followed by a verb in the perfect tense.
49
+ - Don't use **e.g.** Use "example", "such as", "like", or "for example". The
50
+ phrase is always followed by a comma.
51
+ - Don't use **i.e.** unless absolutely essential to make text fit. Use "that is"
52
+ instead.
53
+ - Use **disable** for binary operations that turn a feature or API off. Use
54
+ "turn on" and "turn off" instead of "enable" and "disable" for other
55
+ situations. For UI elements that are not available, use "dimmed" instead of
56
+ "disabled".
57
+ - Use **please** only when you're asking the user to do something inconvenient,
58
+ not just following the instructions in a typical flow.
59
+ - Use **really** sparingly in such constructions as "Do you really want to..."
60
+ Because of the weight it puts on the decision, it should be used to confirm
61
+ actions that the user is extremely unlikely to make.
.gemini/skills/tui-tester/SKILL.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: tui-tester
3
+ description: Expert guidance for testing Gemini CLI behavior and visual output using terminal automation.
4
+ ---
5
+
6
+ # TUI Tester Skill
7
+
8
+ This skill provides the operational manual for verifying Gemini CLI behavioral changes and visual output using terminal automation.
9
+
10
+ ## Core Responsibilities
11
+
12
+ - **Verify Behavior**: Confirm that code changes result in the expected terminal interactions.
13
+ - **Visual Validation**: Ensure the TUI renders correctly across different terminal sizes and states.
14
+ - **Regression Testing**: Use automation to prevent breaking existing interactive workflows.
15
+
16
+ ## Critical Protocol
17
+
18
+ When performing TUI testing, you must adhere to these strict rules:
19
+
20
+ ### 1. Initialization
21
+ **YOUR ABSOLUTE FIRST ACTION MUST BE:**
22
+ Activate the `agent-tui` skill. This provides the underlying tools needed for terminal automation.
23
+
24
+ ### 2. Environment Setup (macOS / Parallel Safe)
25
+ Ensure the global daemon is running and the live preview is open:
26
+ ```bash
27
+ if ! agent-tui sessions >/dev/null 2>&1; then
28
+ tmux kill-session -t agent-tui 2>/dev/null || true
29
+ agent-tui daemon stop 2>/dev/null || true
30
+ rm -f /tmp/agent-tui*
31
+ tmux new-session -d -s agent-tui 'agent-tui daemon start --foreground > /tmp/agent-tui-daemon.log 2>&1'
32
+ sleep 1
33
+ fi
34
+ agent-tui live start --open
35
+ ```
36
+
37
+ ### 3. Session Management
38
+ - **Session IDs**: Always use the `session_id` returned by `agent-tui run` for subsequent interactions.
39
+ - **Atomic Execution**: Execute exactly one command per turn. Do not pipeline actions.
40
+ - **The Loop**: Action -> Wait -> Screenshot -> Verify -> Next Action.
41
+
42
+ ### 4. Gemini CLI Specifics
43
+ - **Build First**: Always run `npm run build` or `npm run build:all` before testing local changes.
44
+ - **Bypass Trust**: Set `GEMINI_CLI_TRUST_WORKSPACE=true` to avoid focus-stealing modals.
45
+ - **Isolate Config**: Use `GEMINI_CLI_HOME` to prevent interference with your personal settings.
46
+
47
+ ## Workflow Example
48
+
49
+ ```bash
50
+ # Start the CLI
51
+ env GEMINI_CLI_TRUST_WORKSPACE=true agent-tui run node packages/cli/dist/index.js
52
+
53
+ # Wait for the prompt
54
+ agent-tui wait "│" --assert
55
+
56
+ # Send a command
57
+ agent-tui type "/help"
58
+ agent-tui press Enter
59
+
60
+ # Verify output
61
+ agent-tui wait "Available Commands" --assert
62
+ ```
63
+
64
+ ## Error Recovery
65
+ If a wait times out, take a fresh screenshot to diagnose the state. If you see `os error 61`, restart the daemon using the tmux method.
.gitattributes CHANGED
@@ -22,3 +22,29 @@ Makefile eol=lf
22
  *.eot binary
23
  *.ttf binary
24
  *.otf binary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  *.eot binary
23
  *.ttf binary
24
  *.otf binary
25
+ docs/assets/theme-xcode-light.png filter=lfs diff=lfs merge=lfs -text
26
+ docs/assets/theme-github-light.png filter=lfs diff=lfs merge=lfs -text
27
+ docs/assets/theme-ayu-dark.png filter=lfs diff=lfs merge=lfs -text
28
+ docs/assets/theme-default-light.png filter=lfs diff=lfs merge=lfs -text
29
+ docs/assets/theme-custom.png filter=lfs diff=lfs merge=lfs -text
30
+ docs/assets/theme-shades-of-purple-dark.png filter=lfs diff=lfs merge=lfs -text
31
+ docs/assets/theme-dracula-dark.png filter=lfs diff=lfs merge=lfs -text
32
+ docs/assets/theme-google-light.png filter=lfs diff=lfs merge=lfs -text
33
+ docs/assets/theme-solarized-light.png filter=lfs diff=lfs merge=lfs -text
34
+ docs/assets/connected_devtools.png filter=lfs diff=lfs merge=lfs -text
35
+ docs/assets/theme-ansi-light.png filter=lfs diff=lfs merge=lfs -text
36
+ docs/assets/monitoring-dashboard-logs.png filter=lfs diff=lfs merge=lfs -text
37
+ docs/assets/theme-github-dark.png filter=lfs diff=lfs merge=lfs -text
38
+ docs/assets/theme-default-dark.png filter=lfs diff=lfs merge=lfs -text
39
+ docs/assets/theme-holiday-dark.png filter=lfs diff=lfs merge=lfs -text
40
+ docs/assets/release_patch.png filter=lfs diff=lfs merge=lfs -text
41
+ docs/assets/theme-solarized-dark.png filter=lfs diff=lfs merge=lfs -text
42
+ docs/assets/theme-ansi-dark.png filter=lfs diff=lfs merge=lfs -text
43
+ docs/assets/theme-atom-one-dark.png filter=lfs diff=lfs merge=lfs -text
44
+ docs/assets/theme-ayu-light.png filter=lfs diff=lfs merge=lfs -text
45
+ packages/core/vendor/ripgrep/rg-darwin-arm64 filter=lfs diff=lfs merge=lfs -text
46
+ packages/core/vendor/ripgrep/rg-linux-x64 filter=lfs diff=lfs merge=lfs -text
47
+ packages/core/vendor/ripgrep/rg-linux-arm64 filter=lfs diff=lfs merge=lfs -text
48
+ packages/core/vendor/ripgrep/rg-win32-x64.exe filter=lfs diff=lfs merge=lfs -text
49
+ packages/core/vendor/ripgrep/rg-darwin-x64 filter=lfs diff=lfs merge=lfs -text
50
+ memory-tests/large-chat-session.json filter=lfs diff=lfs merge=lfs -text
docs/assets/connected_devtools.png ADDED

Git LFS Details

  • SHA256: e0007c87ad7e828f8ea6b69a92459ac7f9360baf08e708139e4234743d4dc808
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
docs/assets/monitoring-dashboard-logs.png ADDED

Git LFS Details

  • SHA256: ead0e4cdef31d7a14e90ef91f716500e2a21d597d2a4cffecb5a0f58940d3b08
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB
docs/assets/release_patch.png ADDED

Git LFS Details

  • SHA256: 6709c5db4861a69ebaacee835d990eb9298520e21555e2ed1e0ec63cb61ac4fe
  • Pointer size: 131 Bytes
  • Size of remote file: 390 kB
docs/assets/theme-ansi-dark.png ADDED

Git LFS Details

  • SHA256: 5f577b6ac5b32d2678913b565c818c12704a9e7dcae38595fda3295acaaa8cba
  • Pointer size: 131 Bytes
  • Size of remote file: 157 kB
docs/assets/theme-ansi-light.png ADDED

Git LFS Details

  • SHA256: e1e052fb1554013e149f53fdc5213d78482b4aff67d6e2d9383e58f92ed27c05
  • Pointer size: 131 Bytes
  • Size of remote file: 145 kB
docs/assets/theme-atom-one-dark.png ADDED

Git LFS Details

  • SHA256: 7d8fd714a65aa5073397976ad4420ac03dc55277deda46737671a0c7e7f71d90
  • Pointer size: 131 Bytes
  • Size of remote file: 154 kB
docs/assets/theme-ayu-dark.png ADDED

Git LFS Details

  • SHA256: a05e35764ce203dccccb014eac391a0b634a1c39e6c7ea4eff328f0430f4df37
  • Pointer size: 131 Bytes
  • Size of remote file: 150 kB
docs/assets/theme-ayu-light.png ADDED

Git LFS Details

  • SHA256: 492a5c8219a2d0a8db4a28a273563201ad8c2444d303a55c6a0169426385c6de
  • Pointer size: 131 Bytes
  • Size of remote file: 141 kB
docs/assets/theme-custom.png ADDED

Git LFS Details

  • SHA256: bffb74cefd8f7af0ad951f2a7acb51e15050bb987d93652320f3cd20bc5c3a8e
  • Pointer size: 131 Bytes
  • Size of remote file: 265 kB