primer  by pierceboggan

Prime repositories for AI-assisted development

Created 1 week ago

New!

571 stars

Top 56.6% on SourcePulse

GitHubView on GitHub
Project Summary

Primer is a CLI tool designed to enhance AI-assisted development by analyzing codebases and generating .github/copilot-instructions.md files. It targets developers seeking to improve the understanding and utility of AI coding assistants like GitHub Copilot within their projects. The primary benefit is enabling AI models to better comprehend project structure, languages, and frameworks, leading to more accurate and context-aware code suggestions and assistance.

How It Works

Primer begins by analyzing a repository to detect languages, frameworks, and package managers. It then utilizes the Copilot SDK, initiating a Copilot CLI session that allows an AI agent to explore the codebase using tools such as glob, view, and grep. This exploration facilitates the generation of concise, project-specific instructions tailored for AI assistants. For batch processing across multiple repositories or organizations, Primer automates cloning, branching, instruction generation, committing, pushing, and optionally creating pull requests. An integrated evaluation framework allows users to measure instruction quality by running prompts with and without the generated instructions, using a judge model to score responses and produce comparison reports.

Quick Start & Requirements

  • Installation: Clone the repository (git clone https://github.com/pierceboggan/primer.git), navigate into the directory (cd primer), and install dependencies (npm install). Alternatively, many features can be accessed directly via npx tsx src/index.ts <command>.
  • Prerequisites: Node.js 18+ is required. GitHub Copilot CLI must be installed (via VS Code's Copilot Chat extension) and authenticated (/login command). GitHub CLI (gh) is optional but necessary for batch processing and automatic pull request creation (brew install gh && gh auth login).
  • Links: The primary source of information is the repository itself.

Highlighted Details

  • Repository Analysis: Automatically detects languages, frameworks, and package managers.
  • AI-Powered Generation: Leverages the Copilot SDK for context-aware instruction generation.
  • Batch Processing: Supports processing multiple repositories across organizations via an interactive TUI.
  • Evaluation Framework: Enables testing and measurement of instruction effectiveness against AI responses.
  • GitHub Integration: Automates cloning, branching, committing, pushing, and PR creation for GitHub repositories.
  • Interactive TUI: Features a user-friendly terminal interface built with Ink.

Licensing & Compatibility

The project is licensed under the MIT License, which permits broad use, modification, and distribution, including for commercial purposes.

Limitations & Caveats

Primer's functionality is tightly coupled with the GitHub Copilot ecosystem, requiring its CLI and authentication. Batch processing and PR creation depend on the GitHub CLI. The effectiveness of generated instructions is contingent on the underlying AI models and the complexity of the target codebase. Support is primarily focused on GitHub repositories.

Health Check
Last Commit

20 hours ago

Responsiveness

Inactive

Pull Requests (30d)
7
Issues (30d)
3
Star History
576 stars in the last 9 days

Explore Similar Projects

Feedback? Help us improve.