Skip to content

feat: add gemini and cursor rules for agentic development#5

Open
malandr wants to merge 3 commits into
mainfrom
feature/gemini-rules
Open

feat: add gemini and cursor rules for agentic development#5
malandr wants to merge 3 commits into
mainfrom
feature/gemini-rules

Conversation

@malandr
Copy link
Copy Markdown
Collaborator

@malandr malandr commented Dec 23, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 23, 2025 23:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds standardized AI agent rules for three different development tools (Gemini, Cursor IDE, and a generic agent configuration). The rules consolidate existing development guidelines from WARP.md, KIRO_INSTRUCTIONS.md, and GitHub Copilot instructions into a unified format for AI-assisted development.

Key changes:

  • Establishes standardized rules covering Git workflow, configuration management, logging, terminal/session management, AI proxy/LLM system, quality/testing, and security
  • Provides tool-specific configuration files for different AI assistants to ensure consistent development practices
  • Centralizes project development guidelines in an easily consumable format for AI agents

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.geminirules Adds development rules for Gemini AI assistant with comprehensive guidelines on Git workflow, code structure, logging, and security
.cursorrules Adds development rules for Cursor IDE's AI features with identical content to ensure consistency across tools
.agent/rules/gemini.md Creates agent-specific rules directory with Gemini configuration in markdown format

Comment thread .cursorrules Outdated
Comment on lines +1 to +55
# Antigravity/Gemini Rules for TeleCLI

These rules govern the development and behavior of the Antigravity/Gemini AI agent within the TeleCLI project. They are derived from project documentation, including WARP.md, KIRO_INSTRUCTIONS.md, and Copilot instructions.

## 1. Core Development Principles
- **Follow Specifications**: Adhere strictly to the architecture and rules defined in `WARP.md` and `docs/session-fixes/`.
- **Modular Design**: Keep code modular and placed in the appropriate modules under `src/`.
- **Async First**: All web endpoints and terminal operations must be non-blocking and use `asyncio`.

## 2. Git & Workflow Rules (CRITICAL)
- **NO MAIN COMMITS**: Never commit directly to the `main` branch.
- **Feature Branches**: Always work on branches named `feature/description` or `fix/description`.
- **Immediate Branching**: Create the feature branch as soon as a task is assigned.
- **Frequent Commits**: Commit logical units of work as they are completed.
- **Conventional Commits**: Use clear, descriptive messages (e.g., `feat:`, `fix:`, `docs:`, `refactor:`).
- **PR Workflow**: Create Pull Requests only after the user validates the work.

## 3. Configuration Management
- **Environment Variables**: All settings must be externalized to `.env`.
- **No Hardcoding**: Never hardcode paths, API tokens, sensitive data, or configuration values.
- **Config Loader**: Use `src/config.py` for all configuration loading.
- **Defaults**: Provide sensible defaults in `config.py` and document them in `.env.sample`.

## 4. Logging Standards
- **Standard Logger**: Use `logger = logging.getLogger(__name__)` in every module.
- **No print()**: Never use the `print()` function for logging or debug information.
- **Appropriate Levels**:
- `DEBUG`: Detailed internal flow and state.
- `INFO`: User actions and significant lifecycle events.
- `WARNING`: Recoverable issues or important notices.
- `ERROR`: Failures requiring attention (log before raising).
- **Format Consistency**: Follow the format `[TIMESTAMP] [LEVEL] [MODULE] message`.
- **Interactions**: Log LLM interactions to `logs/llm_interactions.log` using the dedicated `llm_logger`.

## 5. Terminal & Session Management
- **Terminal Wrapper**: Use the pexpect-based `TerminalWrapper` for all shell interactions.
- **Isolation**: Ensure each user/client has a completely isolated terminal session.
- **Lifecycle**: Properly initialize sessions on start and clean up all resources on close/timeout.
- **Resizing**: Handle terminal resize events to ensure correct rendering.

## 6. AI Proxy & LLM System
- **Provider Interface**: New providers must implement the `LLMProvider` base class.
- **Fallback Logic**: Respect the intelligent fallback system (Gemini -> Claude -> GitHub) on 429 rate limits.
- **Prompt Engineering**: Use the JSON-based response format for AI Proxy interactions as defined in `src/ai_proxy.py`.
- **Memory Compression**: Implement and respect memory summarization to stay within context limits.

## 7. Quality & Testing
- **Pre-commit Testing**: Run `pytest tests/` before considering any task complete.
- **Verification**: Manually verify changes on both Web and Telegram interfaces if applicable.
- **Documentation**: Update the `docs/session-fixes/` index and specific fix files when adding functionality.

## 8. Security
- **Auth**: Respect `AUTH_REQUIRED` and `AUTH_TOKEN` settings.
- **Whitelisting**: Ensure command execution respects `ALLOWED_COMMANDS_ONLY` when enabled.
- **Sanitization**: Sanitize all terminal output before sending to LLMs or UI.
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The content across all three files (.geminirules, .cursorrules, and .agent/rules/gemini.md) is identical. This creates a maintainability issue as any future updates would need to be synchronized across multiple files. Consider either:

  1. Creating a single source file (e.g., .agent/rules/base.md) and symlinking to it from the tool-specific locations
  2. Using a script to generate tool-specific rules from a single source
  3. Adding a clear note in each file referencing the canonical source if duplication is intentional

This will prevent the rules from diverging over time and reduce maintenance burden.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment thread .cursorrules Outdated
Comment thread .geminirules Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Dec 23, 2025

@malandr I've opened a new pull request, #6, to work on those changes. Once the pull request is ready, I'll request review from you.

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.

3 participants