-
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| # 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:** | ||
| ```bash | ||
| # For Augment users: | ||
| auggie --mcp-config mcp.json "go over all my mcp tools and make sure they work as expected" | ||
| ``` | ||
|
|
||
| ### 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 | ||
| ``` | ||
|
|
||
| ### Before Every Commit | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| 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, 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` (use proper logging) | ||
|
||
| - β 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. | ||
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.
is this a tool we need to have installed?
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.
The current MCP config is based on the one used by LangCache, that's why this example was inherited.
Still, I don't like the idea of forcing you to install a particular tool, so I have replaced the command.
Still, you'll need an Augment account to utilize this feature.
npx @augmentcode/auggie --mcp-config mcp.json "go over all my mcp tools and make sure they work as expected"Additionally, added instructions to verify the MCP server's availability in other tools as well (Cursor and Copilot).