Files
gemini-cli/tools/gemini-cli-bot
gemini-cli-robot bf42547c92 # Automated Stale Issue Management
## Description
This PR introduces an automated stale issue management reflex script. The script identifies issues that have been inactive for more than 14 days and marks them as `stale` with a nudge to the author. If no further activity occurs for another 7 days, the issue is automatically closed.

The script is "actor-aware" and will not mark an issue as stale if the last comment was from the community, ensuring we don't block users when we are the bottleneck. It also exempts issues labeled `help-wanted` or `🔒Maintainers only`.

## Why is this recommended?
The repository currently has at least 1,000 open issues, many of which appear to be stale. This massive backlog masks the true health of the project and increases the mental load for maintainers. High latency for community issues (46.6h) suggests that follow-up is a bottleneck. Automating the closure of inactive issues will allow maintainers to focus on active, high-priority items.

## Target Metric
`open_issues`

## Expected Improvement
A reduction of `open_issues` by approximately 20-30% (200-300 issues) within the first 30 days of operation.
2026-04-27 17:03:02 +00:00
..

Gemini CLI Bot (Cognitive Repository)

This directory contains the foundational architecture for the gemini-cli-bot, transforming the repository into a proactive, evolutionary system.

It implements a dual-layer approach to balance immediate responsiveness with long-term strategic optimization.

Layered Execution Model

1. System 1: The Pulse (Reflex Layer)

  • Purpose: High-frequency, deterministic maintenance and data collection.
  • Frequency: 30-minute cron (.github/workflows/gemini-cli-bot-pulse.yml).
  • Implementation: Pure TypeScript/JavaScript scripts.
  • Role: Currently focuses on gathering repository metrics (tools/gemini-cli-bot/metrics/scripts).
  • Output: Action execution and metrics-before.csv artifact generation.

2. System 2: The Brain (Reasoning Layer)

  • Purpose: Strategic investigation, policy refinement, and self-optimization.
  • Frequency: 24-hour cron (.github/workflows/gemini-cli-bot-brain.yml).
  • Implementation: Agentic Gemini CLI phases.
  • Role: Analyzing metric trends and running deeper repository health investigations.

Directory Structure

  • metrics/: Contains the deterministic runner (index.ts) and individual TypeScript scripts (scripts/) that use the GitHub CLI to track metrics like open issues, PR latency, throughput, and reviewer domain expertise.
  • processes/scripts/: Placeholder directory for future deterministic triage and routing scripts.
  • investigations/: Placeholder directory for agentic root-cause analysis phases.
  • critique/: Placeholder directory for policy evaluation.
  • history/: Storage for downloaded metrics artifacts from previous runs.

Usage

To manually collect repository metrics locally, run the following command from the workspace root:

npm run metrics

This will execute all scripts within metrics/scripts/ and output the results to a metrics-before.csv file in the root directory.