-
Notifications
You must be signed in to change notification settings - Fork 419
Introduce AI assistant rules and commands #5222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
valkirilov
wants to merge
2
commits into
main
Choose a base branch
from
docs/introduce-ai-rules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| # RedisInsight AI Development Rules | ||
|
|
||
| This directory contains the **single source of truth** for AI-assisted development rules and workflows in RedisInsight. These rules are used by multiple AI coding assistants: | ||
|
|
||
| - **Cursor** (via symlinks: `.cursor/rules/` and `.cursor/commands/`) | ||
| - **Augment** (via symlink: `.augment/`) | ||
| - **Windsurf** (via symlink: `.windsurfrules`) | ||
| - **GitHub Copilot** (via file: `.github/copilot-instructions.md`) | ||
|
|
||
| ## MCP (Model Context Protocol) Setup | ||
|
|
||
| AI tools can access external services (JIRA, Confluence, GitHub) via MCP configuration. | ||
|
|
||
| ### Initial Setup | ||
|
|
||
| 1. **Copy the example configuration:** | ||
|
|
||
| ```bash | ||
| cp env.mcp.example .env.mcp | ||
| ``` | ||
|
|
||
| 2. **Get your Atlassian API token:** | ||
|
|
||
| - Go to: https://id.atlassian.com/manage-profile/security/api-tokens | ||
| - Create a classic token by pressing the first "Create Token" button | ||
| - Copy the token | ||
|
|
||
| 3. **Edit `.env.mcp` with your credentials:** | ||
|
|
||
| ```bash | ||
| ATLASSIAN_DOMAIN=your-domain.atlassian.net | ||
| [email protected] | ||
| ATLASSIAN_API_TOKEN=your-api-token-here | ||
| ATLASSIAN_JIRA_PROJECT=RI | ||
| ``` | ||
|
|
||
| 4. **Verify your setup:** | ||
|
|
||
| **For Cursor users:** | ||
|
|
||
| - Restart Cursor to load the new MCP configuration | ||
| - Ask the AI: "Can you list all available MCP tools and test them?" | ||
| - The AI should be able to access JIRA, Confluence, GitHub, and other configured services | ||
|
|
||
| **For Augment users:** | ||
|
|
||
| ```bash | ||
| npx @augmentcode/auggie --mcp-config mcp.json "go over all my mcp tools and make sure they work as expected" | ||
| ``` | ||
|
|
||
| **For GitHub Copilot users:** | ||
|
|
||
| - Note: GitHub Copilot does not currently support MCP integration | ||
| - MCP services (JIRA, Confluence, etc.) will not be available in Copilot | ||
|
|
||
| ### Available MCP Services | ||
|
|
||
| The `mcp.json` file configures these services: | ||
|
|
||
| - **git** - Git operations (status, diff, log, branch management) | ||
| - **github** - GitHub integration (issues, PRs, repository operations) | ||
| - **memory** - Persistent context storage across sessions | ||
| - **sequential-thinking** - Enhanced reasoning for complex tasks | ||
| - **context-7** - Advanced context management | ||
| - **atlassian** - JIRA (RI-XXX tickets) and Confluence integration | ||
|
|
||
| **Note**: Never commit `.env.mcp` to version control (it's in `.gitignore`)! | ||
|
|
||
| ## Structure | ||
|
|
||
| ``` | ||
| .ai/ | ||
| βββ README.md # This file | ||
| βββ rules/ # Development rules and standards | ||
| β βββ 01-CODE_QUALITY.md # Linting, formatting, TypeScript | ||
| β βββ 02-FRONTEND.md # React, Redux, styled-components, component structure | ||
| β βββ 03-BACKEND.md # NestJS, API patterns | ||
| β βββ 04-TESTING.md # Testing standards and practices | ||
| β βββ 05-WORKFLOW.md # Git workflow, commits, dev process | ||
| βββ commands/ # AI workflow commands | ||
| βββ pr/ | ||
| β βββ review.md # PR review workflow | ||
| β βββ plan.md # PR planning workflow | ||
| βββ commit-message.md # Commit message generation | ||
| βββ run-ui-tests.md # Custom test runner usage | ||
| ``` | ||
|
|
||
| ## Project Overview | ||
|
|
||
| **RedisInsight** is a desktop application for Redis database management built with: | ||
|
|
||
| - **Frontend**: React 18, TypeScript, Redux Toolkit, Elastic UI, Monaco Editor, Vite | ||
| - **Backend**: NestJS, TypeScript, Node.js | ||
| - **Desktop**: Electron for cross-platform distribution | ||
| - **Testing**: Jest, Testing Library, Playwright | ||
|
|
||
| **Architecture**: | ||
|
|
||
| ``` | ||
| redisinsight/ | ||
| βββ ui/ # React frontend (Vite + TypeScript) | ||
| βββ api/ # NestJS backend (TypeScript) | ||
| βββ desktop/ # Electron main process | ||
| βββ tests/ # E2E tests (Playwright) | ||
| ``` | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| ### Essential Commands | ||
|
|
||
| ```bash | ||
| # Development | ||
| yarn dev:ui # Start UI dev server | ||
| yarn dev:api # Start API dev server | ||
| yarn dev:desktop # Start full Electron app | ||
|
|
||
| # Testing | ||
| yarn test # Run UI tests | ||
| yarn test:api # Run API tests | ||
| yarn test:cov # Run tests with coverage | ||
|
|
||
| # Code Quality | ||
| yarn lint # Lint all code | ||
| yarn type-check:ui # TypeScript type checking | ||
| yarn prettier:fix # Fix formatting on the changed files | ||
| ``` | ||
|
|
||
| ### Before Every Commit | ||
|
|
||
| 1. β Run linter: `yarn lint` | ||
| 2. β Run tests: `yarn test && yarn test:api` | ||
| 3. β Check types: `yarn type-check:ui` | ||
| 4. β Fix formatting: `yarn prettier:fix` | ||
|
|
||
| ### Key Principles | ||
|
|
||
| - **Quality over speed** - Write maintainable, testable code | ||
| - **Always run linter** after changes | ||
| - **No semicolons** in TypeScript files | ||
| - **Use styled-components** for styling (migrating from SCSS modules) | ||
| - **Use faker** for test data generation | ||
| - **Never use fixed timeouts** in tests | ||
| - **Test coverage** must meet thresholds (80% statements/lines) | ||
|
|
||
| ## Module Aliases | ||
|
|
||
| - `uiSrc/*` β `redisinsight/ui/src/*` | ||
| - `apiSrc/*` β `redisinsight/api/src/*` | ||
| - `desktopSrc/*` β `redisinsight/desktop/src/*` | ||
|
|
||
| ## Redis-Specific Context | ||
|
|
||
| - Support all Redis data types: String, Hash, List, Set, Sorted Set, Vector Set, Stream, JSON | ||
| - Handle Redis modules: RedisJSON, RediSearch, RedisTimeSeries, RedisGraph | ||
| - Connection types: Standalone, Cluster, Sentinel | ||
| - Features: Workbench, Data Browser, Profiler, SlowLog, Pub/Sub | ||
|
|
||
| ## For AI Assistants | ||
|
|
||
| When helping with RedisInsight development: | ||
|
|
||
| ### DO: | ||
|
|
||
| - β Follow established patterns in the codebase | ||
| - β Run linter and tests before suggesting code is complete | ||
| - β Use proper TypeScript types (avoid `any`) | ||
| - β Write tests for all new features | ||
| - β Consider performance and accessibility | ||
| - β Handle errors properly | ||
| - β Reference relevant existing code | ||
|
|
||
| ### DON'T: | ||
|
|
||
| - β Use `console.log` | ||
| - β Add unnecessary comments | ||
| - β Ignore linting errors | ||
| - β Skip tests | ||
| - β Use deprecated APIs | ||
| - β Mutate Redux state directly | ||
| - β Use magic numbers or unclear names | ||
|
|
||
| ## Updating These Rules | ||
|
|
||
| To update AI rules: | ||
|
|
||
| 1. **Edit files in `.ai/` only** (never edit symlinked files directly) | ||
| 2. Changes automatically propagate to all AI tools | ||
| 3. Commit changes to version control | ||
|
|
||
| **Remember**: These rules exist to maintain code quality and consistency. Follow them, but also use good judgment. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add "on the changed files" to avoid running on the entire codebase