MCP Rules & Context Assistant

October 9, 2025 · View on GitHub

CI Coverage License Python GitHub stars GitHub forks Open issues

Bilingual AI-Assisted Development Toolchain

中英双语 AI 辅助开发工具链

English | 中文


RuleFlow Overview

💡 让 AI 辅助开发记住规则、保持一致 | Making AI-assisted development remember rules and stay consistent

Star 支持项目 · 🍴 Fork 定制你的版本 · 💬 Discussions 加入社区


中文

🎯 RuleFlow 是什么?

在多轮 AI 协作中,你是否遇到过这些困扰:

  • 🤔 AI 总是忘记项目的编码规范和质量标准
  • 😓 每次对话都要重新解释上下文和约束
  • 🔄 团队成员使用不同 AI 工具,规则难以统一

RuleFlow(MCP Rules & Context Assistant)正是为解决这些问题而生。它是一款完全开源(MIT License)的 AI 辅助开发工具,通过规则治理 + 上下文记忆,让 AI 助手在多轮对话中始终遵守你的项目规范,保持代码一致性与高质量交付。

核心特性

  • 🚀 一键安装 - 跨平台支持(Linux/macOS/Windows),零配置启动
  • 📋 智能规则摄取 - 自动从文档提取编码规范,生成可执行门禁
  • 🧠 上下文记忆 - 20轮滚动记忆,支持 VS Code/Cursor/Windsurf 等 IDE
  • ✅ 质量守门员 - 内置覆盖率策略(核心≥98%,其他≥95%),CI/CD 自动生成
  • 🌍 双语支持 - CLI 与 MCP 接口均支持中英文模糊语义
  • 🔒 隐私优先 - 无遥测,所有数据本地存储

快速开始

方式1:一键安装(推荐)

# Linux / macOS
git clone https://github.com/efem1978/ruleflow.git
cd ruleflow
bash install.sh
REM Windows
git clone https://github.com/efem1978/ruleflow.git
cd ruleflow
install.bat

方式2:从源码安装

python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e .
mcp-rules-assistant install-hooks

基本用法

# 初始化配置
mcp-rules-assistant init

# 摄取项目规则
mcp-rules-assistant ingest-rules README.md docs/

# 生成 CI 配置
mcp-rules-assistant generate-ci

# 查看覆盖率报告
mcp-rules-assistant coverage-report --json

# 检查项目健康度
mcp-rules-assistant diagnose

适用场景

  • AI 结对编程 - 在多轮 AI 协作中同步项目规范与上下文
  • 质量守门 - 对高准入项目执行严格的覆盖率与安全扫描
  • 多 IDE 团队 - VS Code、Cursor、Windsurf、JetBrains 混合团队统一规则
  • 合规项目 - 通过结构化仪表盘证明操作留痕与覆盖率达标

文档

参与贡献

我们欢迎所有形式的贡献!

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交变更 (git commit -m 'feat: add amazing feature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 提交 Pull Request

详见 CONTRIBUTING.md

社区支持

  • GitHub Issues - 报告 Bug 或提出功能请求
  • GitHub Discussions - 提问与讨论
  • 参与贡献 - 查看 待办事项

English

🎯 What is RuleFlow?

Ever faced these challenges in multi-turn AI collaboration?

  • 🤔 AI forgets your project's coding standards and quality requirements
  • 😓 You have to re-explain context and constraints in every conversation
  • 🔄 Team members use different AI tools, making it hard to maintain unified rules

RuleFlow (MCP Rules & Context Assistant) is built to solve exactly these problems. It's a fully open-source (MIT License) AI-assisted development tool that uses rule governance + context memory to keep AI assistants aligned with your project standards across multiple conversation rounds, ensuring code consistency and high-quality delivery.

Key Features

  • 🚀 One-Click Install - Cross-platform (Linux/macOS/Windows), zero-config startup
  • 📋 Smart Rule Ingestion - Auto-extract coding standards from docs, generate enforceable gates
  • 🧠 Context Memory - 20-turn rolling memory, supports VS Code/Cursor/Windsurf IDEs
  • ✅ Quality Gatekeeper - Built-in coverage policy (core≥98%, others≥95%), auto-generate CI/CD
  • 🌍 Bilingual - CLI & MCP interface support English/Chinese fuzzy semantics
  • 🔒 Privacy First - No telemetry, all data stored locally

Quick Start

# Linux / macOS
git clone https://github.com/efem1978/ruleflow.git
cd ruleflow
bash install.sh
REM Windows
git clone https://github.com/efem1978/ruleflow.git
cd ruleflow
install.bat

Option 2: From Source

python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e .
mcp-rules-assistant install-hooks

Basic Usage

# Initialize configuration
mcp-rules-assistant init

# Ingest project rules
mcp-rules-assistant ingest-rules README.md docs/

# Generate CI configuration
mcp-rules-assistant generate-ci

# View coverage report
mcp-rules-assistant coverage-report --json

# Check project health
mcp-rules-assistant diagnose

Use Cases

  • AI Pair Programming - Sync project standards & context across multiple AI sessions
  • Quality Gatekeeper - Enforce strict coverage & security scanning for critical projects
  • Multi-IDE Teams - Unified rules for VS Code, Cursor, Windsurf, JetBrains teams
  • Compliance Projects - Prove audit trails & coverage via structured dashboards

Documentation

Contributing

We welcome all contributions!

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

See CONTRIBUTING.md for details.

Community Support

  • GitHub Issues - Report bugs or request features
  • GitHub Discussions - Ask questions & discuss
  • Contribute - Check open issues

📋 System Requirements

  • Python: 3.10+ (3.13 recommended)
  • OS: Linux, macOS, Windows (Git Bash)
  • Git: 2.x+
  • Node.js: 18+ (for VS Code extension development)

🏗 Architecture

mcp-rules-assistant/
├── mcp_rules_assistant/      # Python backend (CLI + MCP Server)
├── extensions/                # IDE extensions
│   ├── vscode/               # VS Code / Cursor / Windsurf
│   └── jetbrains/            # JetBrains IDEs
├── rulesets/                  # Predefined rule templates
├── tests/                     # Comprehensive test suite
└── docs/                      # Documentation

🧪 Quality Gates

  • Linting: Ruff, Black, isort
  • Type Checking: Mypy (strict mode)
  • Testing: Pytest (≥98% core coverage, ≥95% others)
  • Security: Bandit, Semgrep, Hadolint
  • Secrets: detect-secrets

Run all gates:

make ci

📦 Release & Versioning

Current Version: 0.3.2 (OSS Edition)

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Contact


Made with ❤️ by the RuleFlow Team

Star us on GitHub if you find this helpful!