microsoft / microsoft/agentrc

feat: Auto-generate fix PRs for failing readiness criteria (`agentrc fix --pr`)

Open
#129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.1k
Forks
94
Avg merge
8d 3h
Merged PRs (30d)
7

Description

Problem

Today, agentrc init and agentrc instructions generate instruction files locally and write them to disk. The user must then manually commit, push, and open a PR. For batch adoption — onboarding 10, 50, or 200 repos across an org — this manual step is the bottleneck.

Field teams working with enterprise customers need a way to run AgentRC assessments across many repos and then automatically create PRs with the recommended configurations, so repo owners can review and merge rather than generate from scratch.

Proposal

New command: agentrc fix

A command that generates recommended files and opens a PR:

agentrc fix [path] --pr

Behavior:

  1. Run agentrc analyze on the repo
  2. Run agentrc readiness to identify failing criteria
  3. For each fixable criterion, generate the missing file(s):
    • Missing .github/copilot-instructions.md → generate via instructions
    • Missing lockfile → run npm install --package-lock-only (or equivalent)
    • Missing .github/dependabot.yml → generate a starter config
    • Missing MCP config → generate a template mcp.json
  4. Create a branch (agentrc/fix-readiness-<date>)
  5. Commit generated files with descriptive commit messages
  6. Open a PR with a summary of what was generated and why
Integration with batch

Extend agentrc batch to support --fix --pr:

agentrc batch readiness --fix --pr repos.txt

This would iterate over repos, clone each, run fix, and open PRs. Combined with the webapp or CI integration, this enables an org-wide "fix it" workflow.

Safeguards
  • Never force-push or modify existing files — only add new files or files that don't exist
  • Draft PRs by default--draft flag (default: true) so repo owners must actively merge
  • Dry-run mode--dry-run shows what would be created without making changes
  • Require explicit opt-in--pr flag is required; without it, files are written locally only (current behavior)
  • Configurable branch prefix — allow orgs to set a standard branch naming pattern
PR body template

The generated PR should include:

  • AgentRC readiness score (before)
  • What files were generated and why
  • Link to AgentRC docs for each generated file type
  • Instructions for customizing the generated content

Context

  • Discussed in "AgentRC: Quick Chat on Futures" meeting
  • Key use case: FDE customer engagements where dozens of repos need onboarding
  • Automation was identified as critical for making AgentRC a central tool for the upcoming fiscal year
  • Related: agentrc batch already supports multi-repo readiness assessment (#batch command)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing agentrc analyze, readiness, instructions, and batch commands to understand their entry points and outputs. Define the fix --pr workflow and its dry-run, draft-PR, opt-in, and no-overwrite safeguards, then verify that generated files, commits, branches, PR bodies, and batch execution match the proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.