A streamlined batch analysis tool for repository AI readiness assessment using microsoft/agentrc.
# 1. Install globally
npm install -g github:imagineux/agent-adr
# 2. Set up authentication
agent-adr auth-setup
# 3. Run batch analysis
agent-adr batch # Interactive org and repo selection
agent-adr batch --org microsoft # Skip org selection
# 4. Team-based auto discovery (NEW!)
agent-adr auto-batch # Interactive team and user selection (all repos)
agent-adr auto-batch --org okja-engineering --pattern "ai-*" # Targeted analysisThis repo is intentionally minimal and focused.
-
✅ Uses
agentrcfor repository analysis and readiness assessment -
✅ Provides interactive organization and repository selection
-
✅ Generates consolidated JSON summary of batch analysis
-
✅ Handles both local and remote repositories
-
❌ Not a full CLI platform with multiple commands
-
❌ No prompt generation or AI synthesis templates
-
❌ No TUI mode or interactive workflows
-
❌ No educational frameworks or ADR templates
We use agentrc as the analysis engine and focus on:
- Simple batch workflow - Authenticate → Select org → Analyze repos → JSON summary
- Repository readiness data - Analysis and readiness scores for portfolio assessment
- Consolidated output - Single JSON file with all repository data
- Install globally -
npm install -g github:imagineux/agent-adr - Set up authentication -
agent-adr auth-setup - Run batch analysis -
agent-adr batch - Review JSON summary - Check
.agent-adr-cache/batch-summary.json
- Bash
- Node.js 18+ (use
nvm install 18to install) - npm (comes with Node.js)
- agentrc (automatically installed as npm dependency)
- GitHub Personal Access Token (for private repositories)
For accessing private GitHub repositories, you'll need to configure authentication:
# Interactive setup (recommended)
agent-adr auth-setup
# Or provide token directly
agent-adr auth-setup --token "ghp_your_token_here"
# Or use environment variable
export GITHUB_PAT="ghp_your_token_here"Required Token Scopes:
repo- Full repository accessread:org- Read organization data (for batch processing)
# Global installation (recommended)
npm install -g github:imagineux/agent-adr
# Or local development setup
git clone https://github.com/imagineux/agent-adr.git
cd agent-adr
npm installInteractive batch repository analysis:
# Interactive organization and repository selection
agent-adr batch
# Target specific organization
agent-adr batch --org microsoftWorkflow:
- Authentication Check - Validates GitHub PAT access
- Organization Selection - Choose from your available organizations
- Repository Selection - Multi-select repositories to analyze
- Batch Analysis - Automatic analysis with real-time progress
- JSON Summary - Consolidated results in
.agent-adr-cache/batch-summary.json
Interactive team-based repository discovery and analysis:
# Simple interactive command
agent-adr auto-batch
# With pre-selected organization
agent-adr auto-batch --org okja-engineering
# With custom repository pattern
agent-adr auto-batch --org okja-engineering --pattern "ai-*"
# With custom time window
agent-adr auto-batch --org okja-engineering --days 180Workflow:
- Organization Selection - Choose from your accessible organizations
- Team Discovery - Browse available teams in the selected organization
- Team Selection - Multi-select teams to analyze
- User Review - All team members pre-selected, deselect any you want to exclude
- Repository Discovery - Find repos contributed by selected users (last 12 months)
- Pattern Filtering -
--pattern <pattern>- Repository name pattern (default:*, matches all repos) - Confirmation - Review discovered repositories before analysis
- Batch Analysis - Automatic analysis of all discovered repositories
Key Features:
- Team-Based: Automatically discover teams and their members
- Contribution-Driven: Analysis based on actual code contributions, not just permissions
- Pattern Matching: Filter repositories by naming patterns (e.g.,
ai-*,service-*) - Interactive Selection: Flexible user selection with deselection options
- Time Windows: Configurable lookback periods for contribution analysis
Generate comprehensive report combining analysis data with documentation:
# Generate report with default paths
generate-ai-report
# Custom paths
generate-ai-report /path/to/batch-summary.json /path/to/output.md
# Using npm script
npm run reportOutput: Single markdown file containing:
- Executive summary of analysis results
- Repository overview table
- Detailed analysis and readiness data
- AI ADR Synthesis Prompt - Ready-to-use prompt for AI models
- Complete documentation (ADR template, educational framework, portfolio guide)
- Next steps and implementation guidance
Configure GitHub authentication:
# Interactive token setup
agent-adr auth-setup
# Direct token provision
agent-adr auth-setup --token "ghp_your_token_here"Analysis Data:
.agent-adr-cache/
├── batch-summary.json # Consolidated analysis results
└── reports/ # Generated comprehensive reports
└── comprehensive-ai-readiness-report.md
Batch Summary JSON Structure:
{
"timestamp": "2024-03-16T16:05:00.000Z",
"totalRepos": 5,
"successfulRepos": 4,
"failedRepos": 1,
"repositories": ["owner/repo1", "owner/repo2", ...],
"results": {
"owner/repo1": {
"results": {
"analyze": { "success": true, "stdout": "...", "elapsed": 45 },
"readiness": { "success": true, "stdout": "...", "elapsed": 32 }
},
"overallSuccess": true
}
}
}$ agent-adr batch
🔍 Discovering GitHub repositories...
✔ Connected as: your-username
? Select organization:
❯ your-username - Personal repositories
organization1 - Company repos
? Select repositories to analyze:
❯ ◯ repo1 - Description here (🌍 public)
◯ repo2 - Private project (🔒 private)
✅ Selected 2 repositories:
- owner/repo1
- owner/repo2
🚀 Starting batch analysis...
📦 Processing repository 1/2: owner/repo1
✅ Completed owner/repo1
📦 Processing repository 2/2: owner/repo2
✅ Completed owner/repo2
✅ Batch analysis complete!
📊 Summary JSON created: .agent-adr-cache/batch-summary.json
📈 Analyzed 2/2 repositories successfullyFor each repository, the tool collects:
- Repository structure and languages
- Frameworks and dependencies
- Build system information
- Documentation assessment
- Overall AI readiness score (0-100)
- Engineering maturity assessment
- Infrastructure readiness
- Documentation quality
- Safety and governance evaluation
This tool has been hardened for enterprise use:
- Secure Authentication - PAT tokens stored securely in user config
- Safe Command Execution - Commands executed via arrays, not string eval
- Error Handling - Continues analysis across individual repository failures
- Temporary Cleanup - Automatic cleanup of temporary cloned repositories
The tool includes comprehensive documentation for teams preparing ADRs based on analysis results:
Structured template for creating AI Enablement Architecture Decision Records based on your analysis data.
8-layer maturity model for assessing AI readiness and planning implementation strategies.
Comprehensive AI prompt template with placeholders for generating detailed Architecture Decision Records using your preferred AI model.
Complete guide for interpreting batch analysis results and making strategic decisions.
- Run batch analysis:
agent-adr batch - Review results: Check
.agent-adr-cache/batch-summary.json - Generate comprehensive report:
generate-ai-report - Find your report: Check
.agent-adr-cache/reports/comprehensive-ai-readiness-report.md - Copy AI Synthesis Prompt: Use the prompt section in the generated report
- Generate ADR with AI: Paste the prompt into ChatGPT, Claude, or your preferred AI model
- Refine with templates: Use ADR Template and Educational Framework to enhance the AI-generated content
- Plan implementation: Follow Portfolio Analysis Guide for strategic rollout
# 1. Set up authentication
agent-adr auth-setup
# 2. Run batch analysis
agent-adr batch --org Okja-Engineering
# 3. Generate comprehensive report (saved to .agent-adr-cache/reports/)
generate-ai-report
# 4. Find your report at: .agent-adr-cache/reports/comprehensive-ai-readiness-report.md
# 5. Copy the AI Synthesis Prompt from the report and paste into your AI model
# 6. Use the generated ADR with the documentation templates to finalize your strategyAll analysis data and reports are now organized in the .agent-adr-cache/ directory:
batch-summary.json- Raw analysis resultsreports/- Generated comprehensive reports with AI synthesis prompts
"No GitHub authentication found"
agent-adr auth-setup"Organization not found or not accessible"
- Ensure your PAT has
read:orgscope - Verify you're a member of the target organization
"Repository access failed"
- Check PAT has
reposcope - Verify repository permissions
- For private repos, ensure you're a collaborator
Set environment variable for detailed logging:
export DEBUG=agent-adr:*
agent-adr batchMIT License - see LICENSE file for details.