Skip to content

devwif/devwif_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

293 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

devwifAI

License: MIT Node.js Version TypeScript

A powerful Next.js application that transforms your GitHub repositories through AI-powered automation. devwifAI provides comprehensive code reviews, intelligent development planning, and interactive assistance when mentioned in issue comments.

Table of Contents

Features

devwifAI offers a comprehensive suite of AI-powered automation tools designed to enhance your GitHub workflow:

  • πŸ€– Intelligent Webhook Processing: Automatically processes GitHub webhook events for seamless issue comment integration
  • ✨ Advanced Code Analysis Engine: Transforms and analyzes code with sophisticated processing while intelligently preserving formatting structures
  • πŸ” AI-Powered Code Review: Delivers comprehensive, context-aware code reviews on pull requests using cutting-edge AI analysis and best practices
  • πŸ“‹ Automated Development Planning: Generates detailed development roadmaps with strategic milestones and organized GitHub issue creation
  • ⚑ Real-time Feedback System: Provides immediate status updates and progress tracking for all bot interactions
  • πŸ”„ Seamless Pull Request Management: Automatically creates well-formatted PRs with proposed changes for streamlined review and merging
  • 🎯 Custom AI Task Processing: Handles complex custom instructions and repository-specific requests using advanced AI reasoning
  • πŸ“Š Deep Repository Analysis: Performs complete codebase structure analysis, metadata review, and architectural assessment
  • πŸ”’ Security-First Approach: Built with security best practices and safe handling of sensitive repository data
  • 🌐 Multi-Platform Compatibility: Works seamlessly across different GitHub repository types and project structures

Tech Stack

  • Next.js: Modern React framework with API routes
  • TypeScript: Type-safe code for improved maintainability
  • Tailwind CSS: Utility-first CSS framework for styling
  • Octokit: GitHub API client for JavaScript/TypeScript

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • A GitHub account
  • A registered GitHub App with appropriate permissions

Installation

Prerequisites

Before installing UwUlarpy, ensure you have the following:

  • Node.js version 18 or higher (Download here)
  • npm or yarn package manager
  • Git for repository management
  • A GitHub account with administrative access to target repositories
  • A registered GitHub App with appropriate webhook and repository permissions

Method 1: Clone and Setup (Recommended)

  1. Clone the repository:

    git clone https://github.com/larp-devs/devwif_ai.git
    cd devwif_ai
  2. Install dependencies:

    # Using npm
    npm install
    
    # Or using yarn
    yarn install
  3. Environment configuration:

    # Copy the example environment file
    cp .env.example .env.local
  4. Configure your GitHub App credentials in .env.local:

    # GitHub App Configuration
    APP_ID=your_github_app_id
    PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nyour_github_app_private_key\n-----END RSA PRIVATE KEY-----"
    WEBHOOK_SECRET=your_github_webhook_secret
    
    # Optional: AI Service Configuration
    OPENAI_API_KEY=your_openai_api_key
  5. Start the development server:

    npm run dev
  6. Verify installation: Open http://localhost:3000 to confirm the application is running

Method 2: Docker Setup (Alternative)

  1. Using Docker Compose:
    git clone https://github.com/larp-devs/devwif_ai.git
    cd devwif_ai
    cp .env.example .env.local
    # Configure your .env.local file
    docker-compose up -d

Method 3: Direct Deployment

For production deployments, see the Deployment section below.

GitHub App Registration

To use devwifAI, you'll need to create a GitHub App:

  1. Go to GitHub Settings β†’ Developer settings β†’ GitHub Apps
  2. Click "New GitHub App"
  3. Configure the required permissions and webhook URL
  4. Generate and download your private key
  5. Note your App ID and webhook secret

For detailed GitHub App setup instructions, see DOCUMENTATION.md.

Usage

Quick Start

  1. Install the devwifAI GitHub App on your target repositories
  2. Navigate to any repository issue where you want to use the bot
  3. Mention the bot with @devwif followed by your command
  4. Wait for processing - the bot will reply immediately and process your request

Available Commands

Command Description Usage Context
@devwif Performs AI-powered analysis and assistance Any issue comment
@devwif r Performs comprehensive AI code review Pull request comments
@devwif plan Generates development plan with milestones Any issue comment
@devwif <custom> Processes custom AI-powered requests Any issue comment

Command Examples

Basic AI Assistance

# Get AI assistance for repository analysis
@devwif

# The bot will:
# 1. Analyze the repository structure
# 2. Provide insights and recommendations
# 3. Create actionable suggestions

Code Review

# Request comprehensive code review (use in PR comments)
@devwif r

# The bot will analyze:
# - Code quality and best practices
# - Security vulnerabilities  
# - Performance optimizations
# - Documentation completeness
# - Test coverage

Development Planning

# Generate a comprehensive development plan
@devwif plan

# Creates:
# - Repository analysis report
# - Strategic development roadmap
# - GitHub milestone with categorized issues
# - Priority-based task organization

Custom AI Requests

# Documentation improvement suggestions
@devwif please help me improve the documentation structure and add missing API references

# Security analysis
@devwif analyze the security vulnerabilities in this codebase and suggest improvements

# Performance optimization
@devwif suggest performance improvements for the database queries and API endpoints

# Architecture review
@devwif review the current architecture and suggest scalability improvements

Advanced Usage Patterns

Combining Commands

# Sequential workflow example:
# 1. First, generate a plan
@devwif plan

# 2. Then request specific analysis
@devwif analyze the authentication system for security issues

# 3. Finally, review implementation
@devwif r

Repository-Specific Requests

# Framework-specific improvements
@devwif suggest Next.js specific optimizations for this application

# Language-specific analysis  
@devwif review TypeScript code for type safety improvements

# Infrastructure suggestions
@devwif analyze the deployment configuration and suggest improvements

Configuration

Environment Variables

devwifAI uses environment variables for configuration. Create a .env.local file with:

# Required: GitHub App Configuration
APP_ID=123456                          # Your GitHub App ID
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
WEBHOOK_SECRET=your_webhook_secret      # GitHub webhook secret

# Optional: AI Service Configuration  
OPENAI_API_KEY=sk-...                  # OpenAI API key for enhanced features
MODEL_NAME=gpt-4                       # AI model to use (default: gpt-3.5-turbo)

# Optional: Application Configuration
PORT=3000                              # Server port (default: 3000)
NODE_ENV=development                   # Environment mode
LOG_LEVEL=info                         # Logging level (debug, info, warn, error)

# Optional: Rate Limiting
RATE_LIMIT_REQUESTS=100                # Max requests per window
RATE_LIMIT_WINDOW=3600                 # Rate limit window in seconds

GitHub App Permissions

Your GitHub App requires the following permissions:

Repository Permissions:

  • Contents: Read & Write (for file modifications)
  • Issues: Write (for creating issues and comments)
  • Pull Requests: Write (for creating and reviewing PRs)
  • Metadata: Read (for repository information)

Organization Permissions:

  • Members: Read (for team information)

Webhook Events:

  • Issue comments
  • Pull request reviews
  • Pull requests

Customization Options

UwUification Settings

// Configure in your environment or code
const codeSettings = {
  preserveCodeBlocks: true,    // Keep code blocks unchanged
  preserveLinks: true,         // Keep URLs intact
  analysisDepth: 'comprehensive'  // Analysis depth: basic, standard, comprehensive
};

AI Review Parameters

const reviewConfig = {
  includeSecurityCheck: true,   // Include security analysis
  checkPerformance: true,       // Analyze performance issues
  reviewTests: true,           // Review test coverage
  suggestionLevel: 'detailed'   // brief, standard, detailed
};

The @devwif plan command creates a comprehensive development analysis including:

  • Repository Analysis: Complete codebase structure and metadata review
  • Missing Components: Identification of essential features or infrastructure gaps
  • Critical Fixes: Security issues and bugs requiring immediate attention
  • Required Improvements: Technical debt and code quality enhancements
  • Innovation Ideas: 5 creative feature suggestions for project enhancement
  • GitHub Integration: Automatically creates a milestone and individual issues for tracking

Example workflow:

  1. Comment @devwif plan on any issue
  2. The bot analyzes your entire repository
  3. A milestone is created with the complete plan
  4. Individual GitHub issues are generated for each action item
  5. Issues are categorized by priority (Critical, High, Normal, Feature)

Deployment

devwifAI supports multiple deployment options to fit your infrastructure needs:

Vercel (Recommended)

  1. Fork the repository to your GitHub account
  2. Connect to Vercel:
    • Go to vercel.com and sign in
    • Click "New Project" and import your fork
    • Configure environment variables in Vercel dashboard
  3. Set environment variables in Vercel:
    APP_ID=your_github_app_id
    PRIVATE_KEY=your_private_key
    WEBHOOK_SECRET=your_webhook_secret
    
  4. Deploy - Vercel will automatically deploy on push

Netlify

  1. Fork the repository to your GitHub account
  2. Connect to Netlify:
    • Go to netlify.com and sign in
    • Click "New site from Git" and connect your repository
    • Netlify will automatically detect the netlify.toml configuration
  3. Set environment variables in Netlify:
    APP_ID=your_github_app_id
    PRIVATE_KEY=your_private_key
    WEBHOOK_SECRET=your_webhook_secret
    
  4. Deploy - Netlify will automatically deploy on push
  5. Configure: The netlify.toml file handles build settings and API routes

Self-Hosted

Using PM2 (Production)

# Install PM2 globally
npm install -g pm2

# Build the application
npm run build

# Start with PM2
pm2 start ecosystem.config.js

# Save PM2 configuration
pm2 save
pm2 startup

Using Docker

# Build the image
docker build -t devwifai .

# Run the container
docker run -d \
  --name devwifai \
  -p 3000:3000 \
  -e APP_ID=your_app_id \
  -e PRIVATE_KEY="your_private_key" \
  -e WEBHOOK_SECRET=your_webhook_secret \
  devwifai

Using Docker Compose

# docker-compose.yml
version: '3.8'
services:
  devwifai:
    build: .
    ports:
      - "3000:3000"
    environment:
      - APP_ID=${APP_ID}
      - PRIVATE_KEY=${PRIVATE_KEY}
      - WEBHOOK_SECRET=${WEBHOOK_SECRET}
    restart: unless-stopped

Production Considerations

  • HTTPS Required: GitHub webhooks require HTTPS endpoints
  • Environment Security: Use secure environment variable management
  • Monitoring: Implement logging and monitoring for production use
  • Rate Limiting: Configure appropriate rate limits for your usage
  • Scaling: Consider horizontal scaling for high-traffic scenarios

Contributing

We enthusiastically welcome contributions to devwifAI! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, your involvement helps make this project better for everyone.

Development Workflow

flowchart TD
  A["Next.js Frontend"] --> B["API Routes"]
  B --> C["GitHub Webhook Handler"]
  B --> D["AI Integration Module"]
  C --> E["GitHub API Client (Octokit)"]
  D --> F["OpenAI API (ChatGPT)"]
  E --> G["Repository Analysis"]
  E --> H["Issue & PR Management"]
  G --> I["UWUification Engine"]
  G --> J["Code Review Engine"]
  G --> K["Development Planning Engine"]
  H --> L["Milestone & Issue Creator"]
  H --> M["Pull Request Creator"]
  
  subgraph CONFIG["Configuration"]
    N["Environment Variables"]
    O["GitHub App Credentials"]
  end
  CONFIG --> B
  CONFIG --> D
  
  subgraph SUPPORT["Support & Contributing"]
    P["Issue Templates"]
    Q["Documentation"]
  end
Loading

1. Initial Setup

# Fork the repository on GitHub
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/devwif_ai.git
cd devwif_ai

# Add upstream remote for syncing
git remote add upstream https://github.com/larp-devs/devwif_ai.git

2. Development Environment

# Install dependencies
npm install

# Copy environment file and configure
cp .env.example .env.local
# Edit .env.local with your GitHub App credentials

# Start development server
npm run dev

3. Feature Development

# Create a feature branch from main
git checkout main
git pull upstream main
git checkout -b feature/your-feature-name

# Make your changes and test thoroughly
npm run test
npm run lint
npm run type-check

# Commit your changes with conventional commits
git add .
git commit -m "feat: add new feature description"

4. Quality Assurance

# Run comprehensive quality checks
npm run quality-check

# This includes:
# - TypeScript type checking
# - ESLint code quality analysis  
# - Prettier code formatting
# - Jest unit tests
# - Integration tests

5. Submission

# Push to your fork
git push origin feature/your-feature-name

# Create a Pull Request on GitHub
# - Use a clear, descriptive title
# - Fill out the PR template completely
# - Link any related issues

Contribution Guidelines

Code Standards

  • TypeScript: Use strict TypeScript with proper type definitions
  • ESLint: Follow the configured ESLint rules
  • Prettier: Code must be formatted with Prettier
  • Testing: Include tests for new functionality
  • Documentation: Update relevant documentation

Commit Convention

We use Conventional Commits:

feat: add new feature
fix: resolve bug in webhook handler
docs: update README with new examples
test: add unit tests for uwuification
refactor: improve code organization
style: fix code formatting
chore: update dependencies

Branching Strategy

  • main: Stable production branch
  • develop: Integration branch for features
  • feature/*: Feature development branches
  • hotfix/*: Critical bug fixes
  • release/*: Release preparation branches

Pull Request Requirements

  • Clear, descriptive title and description
  • All CI checks pass (linting, testing, type checking)
  • Code follows project conventions
  • Tests added/updated for new functionality
  • Documentation updated if needed
  • No breaking changes (unless discussed)
  • Reviewed and approved by maintainers

Types of Contributions

πŸ› Bug Reports

When reporting bugs, please include:

  • Clear description of the issue
  • Steps to reproduce the problem
  • Expected vs. actual behavior
  • Environment details (Node.js version, OS, etc.)
  • Screenshots or logs if applicable

Template:

**Bug Description**
A clear description of what the bug is.

**To Reproduce**
1. Go to '...'
2. Click on '....'
3. See error

**Expected Behavior**
What you expected to happen.

**Environment**
- OS: [e.g. iOS]
- Node.js Version: [e.g. 18.17.0]
- devwifAI Version: [e.g. 1.2.3]

✨ Feature Requests

For feature requests, please provide:

  • Clear description of the proposed feature
  • Use case and motivation
  • Potential implementation approach
  • Impact on existing functionality

πŸ“š Documentation

Documentation improvements are always welcome:

  • Fix typos or unclear explanations
  • Add missing examples or use cases
  • Improve API documentation
  • Translate content (if applicable)

πŸ§ͺ Testing

Help improve test coverage:

  • Add unit tests for existing functionality
  • Create integration tests for complex workflows
  • Develop performance benchmarks
  • Test on different platforms and environments

Development Tips

Local Testing

# Test webhook locally using ngrok
npm install -g ngrok
ngrok http 3000

# Update your GitHub App webhook URL to the ngrok URL
# Test with real GitHub events

Debugging

# Enable debug logging
export LOG_LEVEL=debug
npm run dev

# Use Node.js debugger
node --inspect-brk ./node_modules/.bin/next dev

Database and Dependencies

# Clean install dependencies
rm -rf node_modules package-lock.json
npm install

# Update dependencies (be careful with breaking changes)
npm update

Community Guidelines

  • Be Respectful: Treat all community members with respect and kindness
  • Be Constructive: Provide helpful feedback and suggestions
  • Be Patient: Maintainers and contributors volunteer their time
  • Be Collaborative: Work together to find the best solutions
  • Follow Code of Conduct: Adhere to our community standards

Recognition

Contributors are recognized in several ways:

  • Listed in CONTRIBUTORS.md
  • Mentioned in release notes for significant contributions
  • GitHub contributor badges and statistics
  • Optional attribution in documentation

Getting Help

If you need help with contributing:

  • Check existing documentation and issues
  • Ask questions in GitHub Discussions
  • Reach out to maintainers directly
  • Join our community chat (if available)

Thank you for contributing to devwifAI! πŸŽ‰

Documentation

For detailed documentation, see DOCUMENTATION.md

Support

We're committed to providing excellent support for devwifAI users and contributors. Here are multiple ways to get help:

πŸ“š Documentation Resources

πŸ› Bug Reports & Feature Requests

  • GitHub Issues: Report bugs, request features, or ask technical questions
    • Use issue templates for better organization
    • Search existing issues before creating new ones
    • Provide detailed reproduction steps and environment information
    • Label issues appropriately for faster processing

πŸ’¬ Community Support

  • GitHub Discussions: Community-driven support and discussions
    • General questions and usage help
    • Feature discussions and feedback
    • Community showcase and examples
    • Best practices and tips sharing

πŸ“§ Direct Contact

For urgent matters, security issues, or maintainer-specific questions:

πŸ”„ Response Times

We strive to provide timely responses:

  • Critical Security Issues: Within 24 hours
  • Bug Reports: 2-5 business days
  • Feature Requests: 1-2 weeks for initial response
  • General Questions: 3-7 business days
  • Community Discussions: Community-driven, varies

πŸ†˜ Getting Better Help

To receive faster and more accurate support:

For Bug Reports

  • Include your Node.js and npm versions
  • Provide complete error messages and stack traces
  • Share relevant configuration files (remove sensitive data)
  • Describe your expected vs. actual behavior
  • Include steps to reproduce the issue

For Feature Requests

  • Explain your use case and motivation
  • Describe the desired behavior
  • Consider implementation complexity
  • Suggest alternative solutions if applicable

For Usage Questions

  • Check the documentation first
  • Search existing issues and discussions
  • Provide context about what you're trying to achieve
  • Share relevant code snippets (anonymized if needed)

🌍 Community Guidelines

When seeking support:

  • Be Respectful: Treat community members with kindness and respect
  • Be Patient: Maintainers and contributors volunteer their time
  • Be Specific: Provide clear, detailed information about your issue
  • Be Helpful: Help others when you can, and contribute back to the community
  • Follow Templates: Use provided issue and discussion templates when available

πŸ“ˆ Contributing to Support

Help us improve support for everyone:

  • Answer Questions: Help other users in discussions and issues
  • Improve Documentation: Submit PRs for unclear or missing documentation
  • Report Documentation Issues: Let us know about outdated or incorrect information
  • Share Examples: Contribute usage examples and tutorials
  • Provide Feedback: Share your experience and suggestions for improvement

πŸ”— Additional Resources

License

MIT

Acknowledgements

  • OpenAI - AI language model for intelligent assistance
  • Octokit - GitHub API client for JavaScript
  • Next.js - The React framework for production

About

devwif ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •