Skip to content

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

@digitarald

Description

@digitarald

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions