Skip to content

Comments

Add advanced Gemini CLI command documentation templates#9

Merged
TonyCasey merged 1 commit intomainfrom
11-11-2025
Nov 11, 2025
Merged

Add advanced Gemini CLI command documentation templates#9
TonyCasey merged 1 commit intomainfrom
11-11-2025

Conversation

@TonyCasey
Copy link
Owner

@TonyCasey TonyCasey commented Nov 11, 2025

  • Overview:
    Added detailed templates for key Gemini CLI commands such as check-types, create-error, create-repo, create-service, create-tests, and review-changes. These templates include step-by-step guides, usage examples, and best practices.

  • Details:

    • Updated hooks/README.md with an overview of session hooks and customization options.
    • Introduced and documented new session hooks (session-start.js and session-end.js) for automating task tracking and environment preparation.
    • Enhanced documentation formatting and recommendations to match TypeScript and clean architecture standards.

No functional changes to the underlying code were made; adjustments are documentation-focused.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Gemini CLI support with integrated setup flow and templates for hooks, commands, and settings.
    • Introduced centralized rules configuration across all supported tools (Gemini, Claude Code, Cursor, Kilo Code, Roo Code).
  • Documentation

    • Updated repository layout and quick-start guides to reflect multi-tool support.
    • Added comprehensive command and hook documentation for Gemini CLI usage.
    • Deprecated provider-specific rule folders in favour of centralised .dev/rules/ directory.
  • Chores

    • Version bumped to 1.14.0.

- Added detailed templates for the following commands: `check-types`, `create-error`, `create-repo`, `create-service`, `create-tests`, and `review-changes`.
- Included step-by-step guides for each command with usage examples, configuration patterns, error handling guidelines, and best practices.
- Updated `hooks/README.md` with a comprehensive overview of session hooks and customization options.
- Introduced new session hooks (`session-start.js` and `session-end.js`) to automate task tracking, statistics, and environment preparation.
- Enhanced formatting and recommendations in documentation to align with TypeScript coding and clean architecture standards.
@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces comprehensive Gemini CLI support across the codebase, including new setup workflows, template commands and hooks, configuration policies, and extensive documentation updates. The version is bumped to 1.14.0, with centralized rules documentation and cross-tool consistency emphasis throughout.

Changes

Cohort / File(s) Summary
Version & Documentation Updates
CHANGELOG.md, README.md, package.json
Updated CHANGELOG with historical date corrections (2024→2025) and new Gemini CLI entries. Restructured README to highlight centralized rules, repository layout, multi-tool support, and deprecation notices for provider-specific folders. Bumped package version from 1.13.0 to 1.14.0.
Setup Integration
bin/setup.js
Added new setupGemini() function to handle Gemini CLI configuration (creates .gemini directory, migrates config, copies templates). Integrated Gemini into interactive tool selection and setup flow via setupTool().
Core Documentation Templates
templates/AGENTS.md, templates/dev/architecture.md, templates/dev/context-index.md, templates/dev/feature.md
Replaced AGENTS.md content with Codex Session Guide. Added architecture.md and feature.md placeholder files. Updated context-index.md to include .dev/feature.md in Core section.
Gemini Commands Documentation
templates/gemini/commands/check-types.md, templates/gemini/commands/create-error.md, templates/gemini/commands/create-repo.md, templates/gemini/commands/create-service.md, templates/gemini/commands/create-tests.md, templates/gemini/commands/review-changes.md, templates/gemini/commands/status.md
Added comprehensive command templates for Gemini CLI covering type checking, error creation, repository scaffolding, service generation, test creation, pre-PR review workflows, and project status reporting.
Gemini Hooks Implementation
templates/gemini/hooks/README.md, templates/gemini/hooks/session-start.js, templates/gemini/hooks/session-end.js, templates/gemini/hooks/user-prompt-submit.js
Introduced hook infrastructure with documentation. session-start.js validates rules, loads project context, and displays session summary. session-end.js detects completed tasks, auto-commits, and updates session statistics. user-prompt-submit.js validates, enhances, and logs prompts. All export public utility functions.
Gemini Configuration
templates/gemini/settings.json, templates/gemini/tool-policy.json
Added Gemini settings template configuring rule directories, auto-loading, and hook scripts. Added tool-policy.json defining command whitelist/blacklist, file read/write constraints, and confirmation requirements.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant setup.js as bin/setup.js
    participant Gemini as Gemini Setup
    participant FS as File System

    User->>setup.js: run setup flow
    activate setup.js
    setup.js->>User: select tools (checkbox)
    User-->>setup.js: select 'gemini'
    setup.js->>Gemini: setupGemini(language, autoYes)
    activate Gemini
    Gemini->>FS: check .gemini directory
    Gemini->>FS: migrate existing config (if present)
    Gemini->>FS: copy hooks/ (session-start.js, session-end.js, user-prompt-submit.js)
    Gemini->>FS: copy commands/ (templates)
    Gemini->>FS: copy settings.json
    Gemini->>FS: copy tool-policy.json
    Gemini-->>setup.js: setup complete
    deactivate Gemini
    setup.js-->>User: configuration ready
    deactivate setup.js
Loading
sequenceDiagram
    participant CLI as Gemini CLI
    participant Hook as Hook Scripts
    participant State as State Files
    participant Repo as Git Repo
    participant Dev as .dev/

    CLI->>Hook: trigger session-start.js
    activate Hook
    Hook->>Dev: validate .dev/rules/
    Hook->>Dev: load architecture.md
    Hook->>Dev: load & parse todo.md
    Hook->>Repo: check git status
    Hook->>State: save initial .session-state.json
    Hook-->>CLI: context loaded, display summary
    deactivate Hook

    CLI->>Hook: trigger user-prompt-submit.js (pre-submit)
    activate Hook
    Hook->>Hook: validatePrompt() → warnings
    Hook->>Hook: enhancePrompt() → suggestions
    Hook->>State: logPrompt() → .prompt-log.jsonl
    Hook-->>CLI: allow submission (exit 0)
    deactivate Hook

    CLI->>Hook: trigger session-end.js (on close)
    activate Hook
    Hook->>State: load .session-state.json
    Hook->>Dev: diff todo.md for completed tasks
    Hook->>Repo: commitCompletedTasks() (optional)
    Hook->>State: update .session-stats.json (count, duration)
    Hook-->>CLI: session summary
    deactivate Hook
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Areas requiring extra attention:

  • Hook implementations (templates/gemini/hooks/*.js): Logic density around task detection, state management, and error handling; ensure robustness in non-git contexts and edge cases
  • Setup integration (bin/setup.js): Verify setupGemini() flow mirrors existing patterns for other tools and handles migration paths correctly
  • Policy configuration (tool-policy.json): Review whitelist/blacklist rules and confirm they align with security and operational requirements
  • Command templates (templates/gemini/commands/*.md): Cross-check architectural guidance (Clean Architecture patterns, DI patterns) for consistency with existing codebase conventions

Poem

🐰 Hops of Gemini, now in our den,
Hooks that dance when sessions begin,
Commands that scaffold, test, and review,
Centralized rules for all to pursue,
From start to end, the workflow's true! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 11-11-2025

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7afb099 and 274c842.

📒 Files selected for processing (21)
  • CHANGELOG.md (10 hunks)
  • README.md (5 hunks)
  • bin/setup.js (14 hunks)
  • package.json (1 hunks)
  • templates/AGENTS.md (1 hunks)
  • templates/dev/architecture.md (1 hunks)
  • templates/dev/context-index.md (1 hunks)
  • templates/dev/feature.md (1 hunks)
  • templates/gemini/commands/check-types.md (1 hunks)
  • templates/gemini/commands/create-error.md (1 hunks)
  • templates/gemini/commands/create-repo.md (1 hunks)
  • templates/gemini/commands/create-service.md (1 hunks)
  • templates/gemini/commands/create-tests.md (1 hunks)
  • templates/gemini/commands/review-changes.md (1 hunks)
  • templates/gemini/commands/status.md (1 hunks)
  • templates/gemini/hooks/README.md (1 hunks)
  • templates/gemini/hooks/session-end.js (1 hunks)
  • templates/gemini/hooks/session-start.js (1 hunks)
  • templates/gemini/hooks/user-prompt-submit.js (1 hunks)
  • templates/gemini/settings.json (1 hunks)
  • templates/gemini/tool-policy.json (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TonyCasey TonyCasey merged commit 78707d3 into main Nov 11, 2025
2 of 3 checks passed
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 11, 2025

Greptile Overview

Greptile Summary

Added comprehensive Gemini CLI integration with templates for hooks, commands, and settings, mirroring the existing Claude Code structure.

Key additions:

  • Gemini CLI templates including session hooks (session-start.js, session-end.js), command documentation templates (check-types.md, create-service.md, etc.), and configuration files (settings.json, tool-policy.json)
  • Updated setup script (bin/setup.js) to install Gemini CLI alongside other providers
  • Enhanced documentation in README.md and CHANGELOG.md to reference Gemini CLI support
  • Hooks README with comprehensive customization and debugging guidance

Critical issue found:

  • CHANGELOG dates incorrectly modified from 2024 to 2025 for historical releases (versions 1.4.0 through 1.8.1). These are past release dates and must remain accurate to maintain changelog integrity per Keep a Changelog standards.

Confidence Score: 3/5

  • This PR is mostly safe but requires fixing historical CHANGELOG dates before merging
  • Score reflects that this is primarily a documentation and template addition PR with no functional code changes to the core library. The Gemini CLI integration follows the same proven patterns as Claude Code hooks. However, 12 historical CHANGELOG dates were incorrectly modified from 2024 to 2025, which compromises changelog integrity and must be corrected before merge. The templates themselves are well-structured and mirror existing patterns.
  • Pay close attention to CHANGELOG.md - all historical dates from versions 1.4.0 through 1.8.1 must be reverted from 2025 back to 2024

Sequence Diagram

sequenceDiagram
    participant User
    participant SetupCLI as ai-dotfiles-manager
    participant ProjectFS as Project Filesystem
    participant GeminiCLI as Gemini CLI

    User->>SetupCLI: Run setup/update command
    SetupCLI->>User: Prompt for AI tools selection
    User->>SetupCLI: Select "Gemini CLI" (+ others)
    
    SetupCLI->>ProjectFS: Create .gemini/ directory
    SetupCLI->>ProjectFS: Copy templates/gemini/hooks/*.js
    SetupCLI->>ProjectFS: Copy templates/gemini/commands/*.md
    SetupCLI->>ProjectFS: Copy settings.json & tool-policy.json
    SetupCLI->>ProjectFS: Setup .dev/rules/ (centralized)
    
    Note over SetupCLI,ProjectFS: All AI tools reference<br/>.dev/rules/ for consistency
    
    SetupCLI-->>User: Installation complete
    
    User->>GeminiCLI: Start session
    GeminiCLI->>ProjectFS: Execute session-start.js hook
    ProjectFS-->>GeminiCLI: Load .dev/rules/, architecture.md, todo.md
    GeminiCLI->>ProjectFS: Save session state
    GeminiCLI-->>User: Session ready with context loaded
    
    User->>GeminiCLI: Work on tasks
    User->>ProjectFS: Mark todos as complete
    
    User->>GeminiCLI: End session
    GeminiCLI->>ProjectFS: Execute session-end.js hook
    ProjectFS->>ProjectFS: Compare session start/end state
    ProjectFS->>ProjectFS: Auto-commit completed todos
    GeminiCLI-->>User: Session ended, todos committed
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

21 files reviewed, 12 comments

Edit Code Review Agent Settings | Greptile


### Clarified
- Deprecated provider-specific rule folders and shortcut copies; all installs now read rules from centralized `.dev/rules/` (shared). Base rules are linked from the package (copy fallback on Windows).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Historical dates in CHANGELOG should not be modified from 2024 to 2025. These are past release dates that should remain accurate.

Suggested change
## [1.8.1] - 2024-10-25
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 17:17

Comment:
**logic:** Historical dates in CHANGELOG should not be modified from 2024 to 2025. These are past release dates that should remain accurate.

```suggestion
## [1.8.1] - 2024-10-25
```

How can I resolve this? If you propose a fix, please make it concise.

- ✅ All providers reference `.dev/rules/` consistently

## [1.8.0] - 2024-10-25
## [1.8.0] - 2025-10-25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024 for this historical release

Suggested change
## [1.8.0] - 2025-10-25
## [1.8.0] - 2024-10-25
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 37:37

Comment:
**logic:** Revert year to 2024 for this historical release

```suggestion
## [1.8.0] - 2024-10-25
```

How can I resolve this? If you propose a fix, please make it concise.

- ✅ Comprehensive documentation for hook customization

## [1.7.0] - 2024-10-24
## [1.7.0] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.7.0] - 2025-10-24
## [1.7.0] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 64:64

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.7.0] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- ✅ Simpler project configuration

## [1.6.2] - 2024-10-24
## [1.6.2] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.6.2] - 2025-10-24
## [1.6.2] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 80:80

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.6.2] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- `allowedCommands` should only be used when restricting/whitelisting specific commands

## [1.6.1] - 2024-10-24
## [1.6.1] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.6.1] - 2025-10-24
## [1.6.1] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 87:87

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.6.1] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- User override capabilities documented

## [1.5.3] - 2024-10-24
## [1.5.3] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.5.3] - 2025-10-24
## [1.5.3] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 144:144

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.5.3] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- Provided setup instructions for IDE integration and git hooks

## [1.5.2] - 2024-10-24
## [1.5.2] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.5.2] - 2025-10-24
## [1.5.2] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 167:167

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.5.2] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- Updated documentation to reflect ESLint support and backup feature

## [1.5.1] - 2024-10-24
## [1.5.1] - 2025-10-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.5.1] - 2025-10-24
## [1.5.1] - 2024-10-24
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 181:181

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.5.1] - 2024-10-24
```

How can I resolve this? If you propose a fix, please make it concise.

- Updated `printNextSteps()` to inform users about TypeScript config files

## [1.5.0] - 2024-10-24 - Centralized Architecture with Session Hooks
## [1.5.0] - 2025-10-24 - Centralized Architecture with Session Hooks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.5.0] - 2025-10-24 - Centralized Architecture with Session Hooks
## [1.5.0] - 2024-10-24 - Centralized Architecture with Session Hooks
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 194:194

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.5.0] - 2024-10-24 - Centralized Architecture with Session Hooks
```

How can I resolve this? If you propose a fix, please make it concise.

and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2024-10-21
## [1.4.0] - 2025-10-21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Revert year to 2024

Suggested change
## [1.4.0] - 2025-10-21
## [1.4.0] - 2024-10-21
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 235:235

Comment:
**logic:** Revert year to 2024

```suggestion
## [1.4.0] - 2024-10-21
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +38 to +40
function findCompletedTasks(oldContent, newContent) {
const oldPending = (oldContent.match(/- [ ] .+/g) || []).map(t => t.replace('- [ ] ', '').trim());
const newCompleted = (newContent.match(/- [x] .+/gi) || []).map(t => t.replace(/- [x] /i, '').trim());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Completed todos never detected due to unescaped markdown regex

The new Gemini session-end hook never matches todo.md checkbox lines because the regular expressions use /- [ ] .+/g and /- [x] .+/gi. In regex, [ ] and [x] define character classes rather than literal [...], so both expressions fail to match entries like - [ ] task or - [x] task. As a result oldPending and newCompleted are always empty and no completed tasks are ever committed, making the auto-commit feature ineffective. Escaping the brackets (e.g. /\- \[ \] .+/) would fix the detection.

Useful? React with 👍 / 👎.

@TonyCasey TonyCasey deleted the 11-11-2025 branch November 11, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant