PromptReports
Use cases/Tell an agent what broke here before it edits

Tell an agent what broke here before it edits

Partly builtNo plan row yetRepoOpsContextFile

The workflow manifest is merged (promptcompute.ai #816, with its outcome reworded in #822); the production run is still to do. It reads only, asks no person for an approval, and changes nothing. An agent can start it through the family MCP server (start_run), or a person can.

Use case

Tell an agent what broke here before it edits: a workflow across RepoOps, ContextFile that starts from an agent about to edit files, or a person.

Who would use it

A developer, or the coding agent working for them, about to change files that broke before.

What value it provides

Before the edit, the agent gets the recent AI changes to those files with the incidents and reverts they caused, the lessons that name them, and verified context for the job.

Why it matters to the user

A team pays for a mistake once when every agent reads what went wrong on a file before it changes it.

The problem

An agent edits a file behind two incidents last month and repeats the same mistake. What went wrong sits in RepoOps, and the agent never asked.

Expected outcomes

  • Files asked about that came back with past incidents or lessons
  • Edits that repeat a past case after the agent read it: target 0

Each run records its outcome as met, not met or not measured.

How it runs

1. Read what went wrong on these files: recent AI changes with their findings, rollbacks and reverts, and past cases the diff repeats (get_pre_edit_context)RepoOpsBuilt
2. Search the brain for lessons that name these files, in one repository when the start names it (search_brain)RepoOpsBuilt
3. Return a starter packet of verified context for the edit (context_packet)ContextFileBuilt

Products and connections

ProductRole in this workflowDocs
RepoOpsRead what went wrong on these files: recent AI changes with their findings, rollbacks and reverts, and past cases the diff repeats (get_pre_edit_context); Search the brain for lessons that name these files, in one repository when the start names it (search_brain)Reference · RepoOps docs
ContextFileReturn a starter packet of verified context for the edit (context_packet)Reference · ContextFile docs

Outside the family: GitHub.

What a person approves

Nothing. This workflow only reads.

How to access it from an agent

An agent runs a workflow through the PromptReports MCP server or API, and the runner calls each product for it. Both answer today, and the runner runs the code loop. This workflow will run there once its manifest ships. Switching on

// MCP: https://mcp.promptreports.ai/mcp
start_run({
  workflow: "before-an-edit",
  inputs: { "files": "lib/billing.mjs, lib/cart.mjs (1 to 10)", "planned_diff": "The unified diff (optional)", "repository": "repo-dashboard (optional)" },
  dry_run: false
})
// returns { run_id, status: "running", approvals_url }
get_run({ run_id })   // poll, or subscribe to run events
curl -X POST https://api.promptreports.ai/v1/runs \
  -H "Authorization: Bearer $PROMPTREPORTS_AGENT_TOKEN" \
  -d '{"workflow":"before-an-edit"}'

Or call the products yourself, step by step:

ProductEndpointTools
RepoOpshttps://mcp.repoops.ai/mcpsearch_brain get_pre_edit_context propose_brain_entry get_incident_attribution
ContextFileBuiltto confirm

Set it up

The app at app.promptreports.ai is live. These steps will work once this workflow is on the runner. Switching on

  1. Sign in at app.promptreports.ai with PromptReports ID, and pick your org.
  2. Connect RepoOps, ContextFile on the Connections page. Link GitHub through the product that uses it.
  3. Register the agent that will run it on the Agents page, and give it a version manifest.
  4. Nothing to approve: this workflow only reads.
  5. Fill in the inputs (Files, Planned diff, Repository) and choose the trigger: an agent about to edit files, or a person.
  6. Start a dry run. It will count no workflow request, and it shows which steps would record missing evidence.
  7. Start the run. Approve each gate in the approvals inbox, then read the signed record when it ends.