A comprehensive AI-powered product management analysis tool that analyzes GitHub repositories, delivers evidence-backed insights, and compiles maintainer-ready briefing docs in seconds.
- Repository deep dive: Paste any public GitHub repo URL and receive roadmap, feature, debt, performance, team, and security insights.
- Context caching: Analysis context and AI sections persist in session storage so an interrupted session can be restored without re-fetching data.
- Evidence-first cards: Each recommendation cites verified commits, issues, or PRs with canonical links.
- Quarter targeting: Choose whether to assemble docs for the current or next quarter before generating outputs.
- Per-card toggles: Flip the briefcase icon on any roadmap/feature/debt/performance/vulnerability card to include or exclude it. Included cards receive a subtle highlight.
- Deterministic docs: A dedicated
/api/analyze/briefcaseendpoint normalizes selected items and renders three markdown files (quarterly roadmap, feature specs, execution checklist) using reusable templates. - Preview & export: Open the preview modal to tab through each markdown file, copy to clipboard, or download a zipped folder ready for
/docs/insights/YYYY-MM-DD/.
- Next.js app router frontend with animated loading states and responsive layouts.
- API routes for gathering GitHub context, orchestrating section-level AI calls, and generating markdown outputs.
- Octokit + OpenAI powered backend, with all tokens kept server-side.
- Prompt templates per insight category to keep OpenAI responses structured and reference-heavy.
# Clone and navigate to the project
cd dubhacks25
# Run the automated startup script
./start-system.shThe script will:
- Check dependencies
- Install required packages
- Create an environment template
- Start the Next.js development server
- Open the application
Frontend:
npm installCreate .env.local in the root directory:
# GitHub Token for API access
GITHUB_TOKEN=your_github_token_here
# OpenAI API Key for AI analysis
OPENAI_API_KEY=your_openai_api_key_hereGet API Keys:
- GitHub Token: Create Personal Access Token
- OpenAI API Key: Get API Key
npm run dev- Main Application: http://localhost:3000
- API Routes: http://localhost:3000/api/*
- Enter Repository: Paste a GitHub URL from the landing page.
- Context Gathering: The app pulls recent commits, issues, and PRs and stores the context client-side for reuse.
- Insight Generation: Each section is requested sequentially, surfaces the AI response, and normalizes references/owners/success criteria.
- Curation: Maintainers toggle the briefcase icon on the cards they want to export and choose the quarter.
- Briefcase Export: With one click, the app compiles markdown docs, opens a preview modal, and offers copy/ZIP download options.
- Frontend β
/api/analyze/contextcollects repository metadata plus up to 20 commits, 10 issues, and 10 PRs via Octokit. - Client-side cache stores the returned context in
sessionStorageso a browser refresh can restore the analysis session. - Frontend β
/api/analyze/sectionposts the cached context alongside the requested section key. The route enforces strict JSON schemas, normalizes references, and coalesces string arrays. - OpenAI Responses are parsed, validated, and rehydrated with canonical GitHub links before being dispatched back to the UI.
- Frontend β
/api/analyze/briefcasesends the aggregated section data, selected card indices, and quarter choice. The API normalizes items, renders markdown throughlib/briefcaseMarkdown.ts, and returns the final files for preview/download.
βββββββββββββββββββ βββββββββββββββββββ
β Next.js β β External β
β App & API βββββΊβ APIs β
β β β β
β β’ React UI β β β’ GitHub API β
β β’ API Routes β β β’ OpenAI API β
β β’ Prompt files β β β
βββββββββββββββββββ βββββββββββββββββββ
dubhacks25/
βββ app/ # Next.js frontend + API routes
β βββ api/
β β βββ analyze/
β β β βββ context/ # GitHub context aggregation
β β β βββ section/ # Section-level AI calls
β β β βββ briefcase/ # Markdown briefcase generator
β β βββ briefcase/ # Legacy briefcase endpoint (unused in UI)
β βββ insights/ # Insights console UI
β βββ loading/ # Animated loading screen
β βββ page.tsx # Landing page
βββ lib/
β βββ briefcaseMarkdown.ts # Deterministic markdown render helpers
βββ prompts/ # Prompt templates per insight section
βββ start-system.sh # Automated startup script
βββ README.md # This file
- Environment Variables: All API keys stored securely
- Server-side Processing: No tokens exposed to frontend
- CORS Protection: Configured for local development
- Input Validation: All inputs validated and sanitized
# Build for production
npm run build
# Start production server
npm start- Add a new prompt file in the
prompts/directory - Register that file in
SECTION_PROMPT_FILESinsideapp/api/analyze/section/route.ts - Adjust the insights rendering in
app/insights/page.tsx - Restart the development server if it was already running
- Edit the corresponding text file in the
prompts/directory - Redeploy or restart to load the updated templates
- Ensure the JSON fields stay aligned with
SECTION_RESPONSE_SHAPES(reference titles + URLs, optional notes, array fields, etc.)
/api/analyze/contextgathers GitHub repo context (commits/issues/PRs) via Octokit./api/analyze/sectionprompts OpenAI for each insight category using strict JSON schemas and reference normalization./api/analyze/briefcaseturns selected insights into deterministic markdown files for export.- Frontend calls each route with the native fetch API; all tokens remain server-side.
| Variable | Description | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token | Yes |
OPENAI_API_KEY |
OpenAI API Key | Yes |
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the console logs for errors
- Verify all environment variables are set
- Ensure all dependencies are installed
- Restart the development server if it crashed
- Confirm your GitHub and OpenAI credentials are valid
- Maintainer briefcase export (quarter picker, card-level selection, markdown preview & ZIP)
- User authentication and authorization
- Multiple repository analysis
- Export insights to PDF/CSV
- Integration with project management tools
- Advanced analytics and reporting
- Team collaboration features