• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
arthrod

arthrod

ai_comments_to_tasks

Public
Like
ai_comments_to_tasks
Home
Code
4
backend
1
frontend
2
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/1/2025
Viewing readonly version of main branch: v56
View latest version
README.md

PR Message Analyzer

An advanced web application that analyzes long PR messages using AI, with intelligent token-aware chunking, concurrent processing, and specialized prompts for different message types.

Enhanced Features

  • Token-Aware Chunking: Uses tiktoken to intelligently split PR conversations into optimal chunks (max 800 tokens each)
  • Concurrent Processing: Batched analysis with 3 chunks processed simultaneously for faster results
  • Individual LLM Calls: Each chunk gets its own specialized AI analysis
  • Chunk Classification: Automatically identifies bot reviews, user comments, code changes, and system messages
  • Severity Assessment: Issues are categorized as low, medium, high, or critical
  • Actionable Insights: Extracts specific code issues and action items from each message
  • Proper Markdown Rendering: Clean display of formatted analysis results
  • Ordered Results: Shows all chunk analyses in sequence with overall summary

Analysis Strategy

  1. Token-Aware Chunking: Text is split using PR-specific separators, then further divided based on token limits
  2. Classification: Each chunk is categorized (bot_review, user_comment, code_change, system_message, mixed)
  3. Concurrent Analysis: Chunks are processed in batches of 3 with specialized prompts:
    • Bot reviews: Focus on code issues, tool recommendations, severity
    • User comments: Extract feedback, questions, approval signals
    • Code changes: Assess scope, impact, complexity
    • System messages: Extract relevant metadata
  4. Concatenation: Results are combined with an overall summary

Performance Improvements

  • Tiktoken Integration: Precise token counting ensures optimal chunk sizes
  • Concurrent Processing: 3x faster analysis with batched API calls
  • Reduced Token Limits: Faster LLM responses with focused 500-token analysis calls
  • Smart Batching: Respectful API usage with small delays between batches

Structure

  • backend/index.ts - Enhanced Hono server with chunking strategy and individual LLM calls
  • frontend/index.html - Main HTML interface with improved styling
  • frontend/index.tsx - React frontend with markdown rendering and structured display
  • shared/types.ts - Enhanced TypeScript types for chunk analysis

Usage

  1. Copy the entire conversation from your GitHub PR page
  2. Paste the text into the textarea (include bot messages, reviews, comments)
  3. Click "Analyze PR Messages"
  4. Get comprehensive analysis with:
    • Overall summary of the PR
    • Individual chunk analysis in order
    • Severity badges and chunk type indicators
    • Specific code issues and action items
    • Tool messages and recommendations

The application processes each message chunk individually with specialized AI prompts, then provides both detailed per-chunk insights and an overall assessment.

Tech Stack

  • Backend: Hono + Val Town OpenAI (GPT-4o-mini with JSON mode)
  • Frontend: React + TailwindCSS with custom markdown renderer
  • Storage: None (stateless analysis)
  • Chunking: Advanced text splitting based on PR conversation patterns
  • Analysis: Individual LLM calls per chunk + overall summary generation

Features

  • ✅ Token-aware intelligent PR text chunking with tiktoken (max 800 tokens per chunk)
  • ✅ Concurrent processing with batched analysis (3 chunks at a time)
  • ✅ Individual AI analysis for each chunk with specialized prompts
  • ✅ Severity assessment (low/medium/high/critical)
  • ✅ Code issue extraction and actionable item identification
  • ✅ Proper markdown rendering with syntax highlighting
  • ✅ Structured display with badges and visual indicators
  • ✅ Overall summary generation from all chunk analyses
  • ✅ Error handling and validation
  • ✅ Ordered results showing all chunks in sequence
  • ✅ Performance optimizations for faster analysis
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.