- 🤖 LLM-Powered Analysis: Detect requirement smells using OpenAI models
- 🔒 Secure: No API keys in browser extension - all handled server-side
- 📊 Comprehensive Taxonomy: 36 smell labels across 5 categories (Morphological, Lexical, Analytical, Relational, Incompleteness)
- 🎯 ISO 29148 Standards: Based on international requirements engineering standards
- 🚀 Fast & Async: Built with FastAPI for high performance Analysis Platform
A complete requirements management and analysis platform consisting of:
- Browser Extension - Adds a Requirements tab to GitHub repositories
- Backend API - FastAPI service with LLM-powered requirement smell detection
- 🔖 GitHub Integration: Seamlessly injects a "Requirements" tab into the GitHub navbar
- 📝 CRUD Operations: Create, read, update, and delete requirements
- 🔢 Auto-incremented IDs: Requirements automatically get unique IDs (REQ-1, REQ-2, etc.)
- 💾 Local Storage: All requirements persist per repository using Chrome's storage API
- 🎨 GitHub Dark Mode: Matches GitHub's dark theme with ReqRev's design language
- 🔍 AI-Powered Analysis: One-click smell detection with detailed explanations
- 🎯 Visual Smell Badges: Color-coded severity indicators (Green → Yellow → Orange → Red)
- 📋 Comprehensive Details Panel: Full descriptions, fix suggestions, and before/after examples for all 36 smells
- 🤖 LLM-Powered Analysis: Detect requirement smells using OpenAI GPT models
- 🔒 Secure: No API keys in browser extension - all handled server-side
- 📊 Comprehensive Taxonomy: 36 smell labels across 5 categories (Morphological, Lexical, Analytical, Relational, Incompleteness)
- 🎯 ISO 29148 Standards: Based on international requirements engineering standards
- 🚀 Fast & Async: Built with FastAPI for high performance
- ✅ Enhanced Accuracy: Conservative detection rules to minimize false positives
┌─────────────────┐
│ Browser │
│ Extension │ HTTPS
│ (TypeScript) ├────────┐
└─────────────────┘ │
▼
┌─────────────┐
│ FastAPI │
│ Backend │
│ (Python) │
└──────┬──────┘
│
▼
┌─────────────┐
│ OpenAI │
│ Fine-tuned │
│ Model │
└─────────────┘
36 Smell Labels Across 5 Categories:
• Morphological (shape, readability)
• Lexical (word choice, vague terms)
• Analytical (grammar, structure)
• Relational (dependencies, coupling)
• Incompleteness (missing info, errors)
See docs/ARCHITECTURE.md for detailed architecture documentation.
reqrev/
├── extension/ # Browser Extension
│ ├── manifest.json # Chrome Extension Manifest V3
│ ├── package.json # Node dependencies
│ ├── webpack.config.js # Webpack bundler config
│ ├── tsconfig.json # TypeScript configuration
│ ├── src/ # Extension source code
│ │ ├── contentScript.tsx
│ │ ├── components/
│ │ ├── hooks/
│ │ └── utils/
│ └── dist/ # Built extension (generated)
│
├── api/ # FastAPI Backend
│ ├── main.py # FastAPI app & CORS
│ ├── config.py # Environment configuration
│ ├── routers/ # API endpoints
│ │ └── requirements.py
│ └── services/ # Business logic
│ └── analyzer.py
│
├── llm_service/ # LLM Integration Layer
│ ├── iso29148_detector.py # Facade
│ ├── openai_client.py # OpenAI client
│ ├── judge_client.py # OpenRouter judge client
│ └── models/
│ └── requirement_smell_result.py
│
├── evaluation/ # Research & Evaluation Tools
│ ├── README.md # Evaluation guide
│ ├── batch_evaluate.py # Batch evaluation script
│ ├── test_judge.py # Simple judge test
│ ├── sample_data/ # Example datasets
│ │ ├── requirements_sample.csv
│ │ └── requirements_sample.json
│ └── results/ # Generated reports (gitignored)
│
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # System architecture
│ ├── API.md # API documentation
│ ├── LLM_JUDGE.md # LLM-as-Judge guide
│ └── JUDGE_IMPLEMENTATION.md
│
├── requirements.txt # Python dependencies
├── .env.example # Environment template
└── README.md # This file
For Browser Extension:
- Node.js (v16 or higher)
- npm or yarn
- Google Chrome or Edge browser
For Backend API:
- Python 3.11+
- pip
- OpenAI API Key
cd extension/
npm installFor development with watch mode:
npm run devFor production build:
npm run buildThis will create a dist/ folder with the compiled extension.
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
extension/dist/folder from your project directory - The ReqRev extension icon should appear in your extensions toolbar
- Navigate to any GitHub repository (e.g.,
https://github.com/facebook/react) - Look for the new Requirements tab in the repository navbar
- Click it to open the requirements panel
- Start managing requirements! 🎉
# From the project root
pip install -r requirements.txt# Copy the example environment file
cp .env.example .env
# Edit .env and add your API keys
nano .env # or use your favorite editorRequired Configuration:
# Required: OpenAI API Key
OPENAI_API_KEY=your_openai_api_key_here
# Model to use (default: gpt-4o-mini)
# For fine-tuned model: ft:gpt-4o-mini:your-org:model-id:suffix
OPENAI_MODEL=gpt-4o-mini
# Model parameters
OPENAI_MAX_TOKENS=1500
OPENAI_TEMPERATURE=0.1Get your OpenAI API key at: https://platform.openai.com/api-keys
💡 Tip: For production use, train a fine-tuned model on the comprehensive smell taxonomy and set
OPENAI_MODELto your fine-tuned model ID.
python -m api.mainThe API will start at http://localhost:8000
You can test it:
curl http://localhost:8000/healthOpen your browser to:
- Interactive API docs: http://localhost:8000/docs
- Alternative docs: http://localhost:8000/redoc
See docs/API.md for detailed API documentation.
- Click the "+ New Requirement" button
- The form opens with auto-generated ID (e.g., REQ-4)
- Edit the title and description
- Click Save
- Click the edit icon (pencil) on any requirement card
- Modify the title and/or description
- Click Save to persist changes
- Click the "Analyze" button on any requirement row
- The system sends the requirement to the backend API for smell detection
- Results appear in the "Smells Detected" column with a color-coded badge:
- 🟢 Green (0): Perfect - no smells detected
- 🟡 Yellow (1-2): Minor issues
- 🟠 Orange (3-5): Moderate issues
- 🔴 Red (6+): Serious issues
- Click the "Details" button to open a comprehensive side panel showing:
- All detected smells with their categories
- What each smell means and why it matters
- Step-by-step fix suggestions
- Before/after examples
- Click the delete icon (trash) on any requirement card
- Confirm the deletion in the dialog
- The requirement is permanently removed
- Each repository's requirements are stored separately
- Storage key format:
requirements:<org>/<repo> - Data persists across browser sessions
- All data is stored locally in Chrome (not synced)
Scripts:
cd extension/
# Install dependencies
npm install
# Development mode with watch
npm run dev
# Production build
npm run build
# Clean dist folder
npm run cleanFile Watching:
When running npm run dev, Webpack watches for file changes and automatically rebuilds. After changes:
- Go to
chrome://extensions/ - Click the refresh icon on the ReqRev extension
- Reload the GitHub page to see updates
Debugging:
Open Chrome DevTools on any GitHub repo page:
- Console logs are prefixed with
[ReqRev] - Check Application → Storage → Local Storage → chrome-extension://...
- Inspect the injected elements using the Elements panel
Running the API:
# Run with auto-reload for development
API_RELOAD=true python -m api.main
# Or use uvicorn directly
uvicorn api.main:app --reload --host 0.0.0.0 --port 8000Testing the API:
# Health check
curl http://localhost:8000/health
# List models
curl http://localhost:8000/api/v1/models
# Analyze a requirement
curl -X POST http://localhost:8000/api/v1/analyze_requirement \
-H "Content-Type: application/json" \
-d '{"requirement_id":"REQ-1","description":"The system shall authenticate users."}'Viewing Logs:
All logs include timestamps and log levels. Set LOG_LEVEL=DEBUG in .env for detailed logging.
Once the API is running, you can analyze requirements for quality issues:
curl -X POST http://localhost:8000/api/v1/analyze_requirement \
-H "Content-Type: application/json" \
-d '{
"requirement_id": "REQ-1",
"description": "The system should maybe provide some user-friendly features."
}'Response:
{
"requirement_id": "REQ-1",
"description": "The system should maybe provide some user-friendly features.",
"smells": ["weak_verb", "subjective", "vagueness"],
"explanation": "The requirement uses weak modal verbs ('should', 'maybe'), contains subjective language ('user-friendly'), and is vague.",
"raw_model_output": {...}
}The system detects 30 requirement smells across 5 categories:
- 🟣 Morphological (5): Shape and readability issues
- 🟠 Lexical (11): Word choice and vague terms
- 🔵 Analytical (5): Grammar and structure
- 🟢 Relational (3): Dependencies and coupling
- 🔴 Incompleteness & Language (10): Missing information and errors
For complete taxonomy with definitions and examples, see docs/TAXONOMY.md.
Detection Accuracy: Enhanced prompts with conservative rules minimize false positives. Simple conditional requirements with clear "shall" statements (e.g., "When X, the system shall Y") won't be flagged.
ReqRev includes a comprehensive evaluation framework for assessing model quality using LLM-as-Judge methodology:
Quick Start:
python start_api.py # Start API
cd evaluation && python batch_evaluate.py # Run evaluationDocumentation:
- evaluation/README.md - Complete evaluation guide with sample data
- docs/LLM_JUDGE.md - LLM-as-Judge methodology and configuration
- ✅ Browser extension with requirements management (CRUD operations)
- ✅ FastAPI backend with CORS security
- ✅ OpenAI integration with comprehensive smell taxonomy (36 labels)
- ✅ 5-category smell detection (Morphological, Lexical, Analytical, Relational, Incompleteness)
- ✅ Extension-to-API integration for smell analysis
- ✅ Color-coded smell count badges (Green/Yellow/Orange/Red severity levels)
- ✅ Comprehensive smell details panel with descriptions, fix suggestions, and examples
- ✅ Enhanced detection accuracy with conservative prompts to minimize false positives
- ✅ Complete documentation with architecture guides and API references
- ✅ LLM-as-Judge evaluation framework with OpenRouter integration
- ✅ Batch evaluation tools for research and model assessment
- ✅ Comprehensive evaluation documentation and sample datasets
- 🔄 Result caching for performance optimization
- Database layer for analysis history
- User authentication and accounts
- Requirements traceability matrix
- Link requirements to GitHub issues
- Export to PDF/Markdown
- Custom smell definitions
- Self-refinement workflow using judge feedback
- React 18.2: UI component framework
- TypeScript 5.3: Type-safe JavaScript
- Webpack 5: Module bundler
- Chrome Extension Manifest V3: Latest extension standard
- Chrome Storage API: Local data persistence
- FastAPI 0.115: Modern Python web framework
- Pydantic: Data validation and settings management
- Uvicorn: ASGI server
- httpx: Async HTTP client
- OpenAI API: GPT models (base or fine-tuned)
- Comprehensive Taxonomy: 36 smell labels across 5 categories
- Structured Output: JSON format with smells and explanations
- Async/Await: Non-blocking LLM calls
- The extension handles GitHub's client-side routing (pushState)
- Tab injection retries if the page isn't fully loaded
- Automatically re-initializes when navigating between repos
storage: Required for chrome.storage.localactiveTab: Required for content script injectionhttps://github.com/*/*: Only active on GitHub repo pages
- Currently supports Google Chrome only
- Manifest V3 compatible (future-proof)
- May work on other Chromium-based browsers (Edge, Brave, etc.)
Tab not appearing?
- Ensure you're on a repository page (not issues, settings, etc.)
- Check the browser console for
[ReqRev]logs - Try refreshing the page
- Reload the extension in
chrome://extensions/
Requirements not saving?
- Check Chrome's storage quota hasn't been exceeded
- Verify extension permissions in
chrome://extensions/ - Look for error messages in the console
Build errors?
- Delete
node_modules/and runnpm installagain - Clear the
dist/folder withnpm run clean - Ensure Node.js version is 16+
MIT License - feel free to use this project however you'd like!
This is an MVP built for the ReqRev project. Contributions, issues, and feature requests are welcome!
For questions or feedback about ReqRev, please open an issue in this repository.
Built with ❤️ for better requirements management on GitHub