Skip to content

AI-Powered GitHub App that enforces product intent, scans for security vulnerabilities, and detects code redundancy on every Pull Request.

License

Notifications You must be signed in to change notification settings

ADFoundryLabs/FeaturePulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

163 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 FeaturePulse

AI-Powered Pull Request Guardian for Product Intent & Security

GitHub App Node.js React License

Automatically enforce product requirements, detect security vulnerabilities, and eliminate code redundancy on every pull request.

Quick Start β€’ Features β€’ Architecture β€’ Configuration β€’ API Reference β€’ Contributing


🌟 What is FeaturePulse?

FeaturePulse is an intelligent GitHub App that acts as an automated product manager and security auditor for your codebase. It analyzes every pull request against your project's defined intent rules (PRD/requirements) and provides:

  • πŸ“Š Intent Score – Measures how well code changes align with your product requirements
  • πŸ›‘οΈ Security Scanning – Detects vulnerabilities in dependencies using the OSV database
  • ⚑ Redundancy Detection – Identifies duplicate or conflicting file names using Levenshtein distance
  • πŸ€– AI-Powered Decisions – Leverages Gemini/OpenRouter AI for intelligent compliance analysis

Think of it as having a tireless product manager and security engineer reviewing every PR 24/7.


✨ Features

🎯 Intent Analysis

Compares code changes against your intent.md requirements document to ensure features are implemented correctly.

βœ… Implemented Features
⚠️ Missing/Incomplete Items  
πŸ›‘ Out-of-Scope Changes

πŸ”’ Security Scanning

Automatically scans new dependencies for known vulnerabilities using the OSV Database.

πŸ“¦ Dependency Analysis
🚨 CVE Detection
⚠️ Sensitive File Detection

πŸ”„ Redundancy Detection

Uses Levenshtein distance to detect:

  • Duplicate filenames in different directories
  • Near-identical file naming patterns
  • Potential code duplication

βš™οΈ Merge Authority Modes

Choose how FeaturePulse enforces decisions:

Mode Behavior
Advisory Warns only, never blocks
Gatekeeper Blocks risky/misaligned PRs
Auto-Approve Approves safe PRs automatically

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              FeaturePulse                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                         β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Webhook    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚   β”‚   GitHub    │──────────────▢│        Node.js Backend          β”‚    β”‚
β”‚   β”‚ Pull Requestβ”‚               β”‚                                 β”‚    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚    β”‚
β”‚                                 β”‚  β”‚ github  β”‚  β”‚    ai.js     β”‚  β”‚    β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚  β”‚   .js   β”‚  β”‚ Gemini/      β”‚  β”‚    β”‚
β”‚   β”‚  intent.md  │───────────────│──│         β”‚  β”‚ OpenRouter   β”‚  β”‚    β”‚
β”‚   β”‚  (Your PRD) β”‚               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚                                 β”‚    β”‚
β”‚                                 β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚    β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚  β”‚ security β”‚  β”‚ redundancy β”‚   β”‚    β”‚
β”‚   β”‚  OSV.dev    │◀──────────────│──│   .js    β”‚  β”‚    .js     β”‚   β”‚    β”‚
β”‚   β”‚  Database   β”‚               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚                                 β”‚    β”‚
β”‚                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                              β”‚                          β”‚
β”‚                                              β–Ό                          β”‚
β”‚                                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚                                 β”‚      React Dashboard (Vite)     β”‚    β”‚
β”‚                                 β”‚  β€’ PR Analysis Stats            β”‚    β”‚
β”‚                                 β”‚  β€’ Feature Subscriptions        β”‚    β”‚
β”‚                                 β”‚  β€’ Authority Mode Settings      β”‚    β”‚
β”‚                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

1. Install the GitHub App

Click the button below to install FeaturePulse on your repositories:

Install FeaturePulse

2. Create Your Intent File

Add an intent.md file to your repository (preferably at .featurepulse/intent.md):

# Project Intent Rules

## Supported Features
1. User authentication via OAuth
2. Dashboard with real-time metrics
3. REST API with rate limiting

## Quality Standards
- All endpoints must have error handling
- Unit test coverage > 80%
- No hardcoded secrets

## Security Requirements
- HTTPS only
- Input validation on all forms
- SQL injection prevention

3. Open a Pull Request

FeaturePulse will automatically:

  1. βœ… Analyze your code changes
  2. βœ… Compare against your intent rules
  3. βœ… Scan for security vulnerabilities
  4. βœ… Check for code redundancy
  5. βœ… Post results as a GitHub Check and PR comment

πŸ“ Project Structure

FeaturePulse/
β”œβ”€β”€ Frontend/                    # React Dashboard (Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx    # Main dashboard with stats & settings
β”‚   β”‚   β”‚   β”œβ”€β”€ Pricing.jsx      # Subscription plans
β”‚   β”‚   β”‚   β”œβ”€β”€ IntentRules.jsx  # Intent rules editor
β”‚   β”‚   β”‚   └── Header.jsx       # Navigation header
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── api.js           # Backend API client
β”‚   β”‚   β”œβ”€β”€ App.jsx              # Main application component
β”‚   β”‚   └── main.jsx             # Entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ Node Backend/                # Express.js API Server
β”‚   β”œβ”€β”€ index.js                 # Main server & webhook handler
β”‚   β”œβ”€β”€ ai.js                    # AI analysis (Gemini/OpenRouter)
β”‚   β”œβ”€β”€ security.js              # CVE scanning via OSV
β”‚   β”œβ”€β”€ redundancy.js            # File redundancy detection
β”‚   β”œβ”€β”€ github.js                # GitHub API interactions
β”‚   β”œβ”€β”€ db.js                    # JSON file database
β”‚   └── package.json
β”‚
β”œβ”€β”€ intent.md                    # Example intent rules template
└── README.md                    # This file

βš™οΈ Configuration

Environment Variables

Create a .env file in the Node Backend directory:

# GitHub App Configuration (Required)
APP_ID=your_github_app_id
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
WEBHOOK_SECRET=your_webhook_secret

# AI Provider (At least one required)
GEMINI_API_KEY=your_gemini_api_key
# OR
OPENROUTER_API_KEY=your_openrouter_api_key

# Payment Integration (Optional)
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret

Frontend Environment

Create a .env file in the Frontend directory:

VITE_API_BASE_URL=http://localhost:3000
VITE_RAZORPAY_KEY_ID=your_razorpay_key_id

πŸ› οΈ Local Development

Prerequisites

  • Node.js v18 or higher
  • npm v8 or higher
  • GitHub App credentials (for full functionality)

Backend Setup

cd "Node Backend"
npm install
npm run dev    # Starts with nodemon for hot-reload

Frontend Setup

cd Frontend
npm install
npm run dev    # Starts Vite dev server

Running Both

# Terminal 1 - Backend (Port 3000)
cd "Node Backend" && npm run dev

# Terminal 2 - Frontend (Port 5173)
cd Frontend && npm run dev

πŸ“‘ API Reference

Webhook Endpoint

POST /webhook

Handles GitHub webhook events for pull requests and app installations.

Event Action Description
pull_request opened, synchronize, reopened Triggers PR analysis
installation deleted Cleans up subscription data

REST Endpoints

Get Installation Status

GET /api/installation-status/:id

Verifies if a GitHub App installation is valid.

Response:

{
  "valid": true
}

Get Subscription

GET /api/subscription/:id

Returns subscription details and settings for an installation.

Response:

{
  "features": ["intent", "security", "summary"],
  "settings": {
    "authorityMode": "gatekeeper"
  }
}

Update Settings

POST /api/settings

Updates authority mode and other settings.

Request Body:

{
  "installationId": "12345",
  "settings": {
    "authorityMode": "advisory"
  }
}

Create Payment Order

POST /api/create-order

Creates a Razorpay order for feature subscription.

Request Body:

{
  "features": ["intent", "security", "summary"],
  "installationId": "12345"
}

πŸ“ Intent File Reference

FeaturePulse looks for intent.md in the following order:

  1. .featurepulse/intent.md (recommended)
  2. Any intent.md in the repository root or subdirectories

Supported Intent Categories

Category Risk Level Default Decision
Documentation Update Low APPROVE
Bug Fix Medium APPROVE
New Feature High WARN
Refactor Medium APPROVE
Test Improvement Low APPROVE
General Improvement Low APPROVE

Decision Logic

BLOCK  β†’ Security HIGH/CRITICAL OR Intent Match < 50%
WARN   β†’ Intent Match < 80% OR Redundancy found
APPROVE β†’ Intent Match > 80% AND Security LOW

πŸ” Security Features

Dependency Vulnerability Scanning

FeaturePulse integrates with the OSV Database to scan npm dependencies added in pull requests for known CVEs.

Sensitive File Detection

The following patterns trigger security warnings:

  • Authentication: auth, login, password, secret, credential
  • Configuration: .env, config.js, secrets
  • Payments: payment, stripe, billing
  • Cryptography: crypto, encrypt, decrypt
  • Database: database, schema

🀝 Contributing

We welcome contributions! Here's how to get started:

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

Development Guidelines

  • Follow existing code style and patterns
  • Add tests for new functionality
  • Update documentation for API changes
  • Use conventional commit messages

πŸ“Š PR Analysis Output

When FeaturePulse analyzes a pull request, it provides:

GitHub Check

βœ… FeaturePulse
   Decision: APPROVE | Score: 85%

PR Comment

## πŸ€– FeaturePulse Analysis

**πŸ“Š Intent Score:** 85%
**πŸ›‘οΈ Decision:** APPROVE
**⚑ Authority Mode:** GATEKEEPER

---

### πŸ“ Executive Summary
This PR implements the user authentication feature as specified in the PRD.

### πŸ“‹ PRD Compliance
* βœ… **Implemented:** OAuth login, session management
* ⚠️ **Missing/Incomplete:** Rate limiting
* πŸ›‘ **Out of Scope:** None

### πŸ›‘οΈ Security & Quality
* **Security Risk:** LOW
* **Vulnerabilities:** None detected
* **Redundancy:** No conflicts found

### πŸ’‘ Recommendations
Consider adding rate limiting before the next release.

πŸ“œ License

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


πŸ™ Acknowledgments


Built with ❀️ for developers who care about code quality

⬆ Back to Top

About

AI-Powered GitHub App that enforces product intent, scans for security vulnerabilities, and detects code redundancy on every Pull Request.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •