Structure a Multi-Repo Dependency Update Brief for Coding Agents

Generates a structured execution brief for AI coding agents to update shared dependencies across repos without silent breaking changes.

Agent prompt for Claude Code and Cursor

Prompt

Prompt
Act as a principal software architect coordinating cross-repository upgrades.

I need an execution brief for an autonomous coding agent like Claude Code or Cursor to safely apply an upstream library or package update across downstream consumer repositories.

Before drafting the plan, ask me these 3 questions and pause for my reply:
1. What library is changing, from what version to what version, and what are the specific breaking changes?
2. What are the names or paths of the downstream repositories that consume it?
3. What package manager and test runner do these repositories use (for example pnpm, npm, cargo, poetry, pytest, vitest)?

Once I answer, produce the plan following these rules:
- Map every upstream breaking change directly to concrete code edits required in each consumer repo.
- Provide an exact sequential order of operations across repos, including branch naming and lockfile updates.
- Specify exact shell commands for local validation, type checks, and cross-repo integration runs.
- Never invent version numbers, API signatures, or file paths not provided in our conversation.

Output format:### Upstream Impact Analysis
(List each breaking change with expected consumer impact)

### Cross-Repo Execution Order
(Numbered steps across repositories with git branches and lockfile sync instructions)

### Verification Loops
(Specific shell commands to run in each repository before opening pull requests)

### Rollback & Risk Guardrails
(Explicit failure triggers and fallback steps)

Example output

Auth SDK v3.0 upgrade execution orderUpdate, refresh lockfiles, then verify across both repos
  1. Update payments-serviceStep 1Branch deps/auth-sdk-v3; await verifyTokenAsync in auth.ts
  2. Update portal-apiStep 2Make session.ts async; update jwt.ts and tenant claims
  3. Refresh lockfilesStep 3Run pnpm install at each repo root
  4. Verify each repoVerifyRun typecheck and vitest in both repos
  5. Cross-repo integration testVerifyRun docker compose test file; halt PR on HTTP 401

Example for: upgrading auth-sdk from v2.4 to v3.0 across payments-service and portal-api using pnpm and vitest.

Upstream Impact Analysis
  • auth-sdk v3.0 removes verifyTokenSync in favor of verifyTokenAsync returning a Promise.
  • payments-service uses verifyTokenSync in src/middleware/auth.ts line 34.
  • portal-api uses verifyTokenSync across src/routes/session.ts and src/guards/jwt.ts.
  • JWT claims payload key user_tenant_id is renamed to tenantId in the returned payload.
Cross-Repo Execution Order
  1. Target repository: payments-service

    • Branch: deps/auth-sdk-v3
    • Command: pnpm update auth-sdk@3.0.0 --filter payments-service
    • Code changes: Update src/middleware/auth.ts to await verifyTokenAsync(token) and access token.tenantId.
  2. Target repository: portal-api

    • Branch: deps/auth-sdk-v3
    • Command: pnpm update auth-sdk@3.0.0 --filter portal-api
    • Code changes: Rewrite session check in src/routes/session.ts to async; update src/guards/jwt.ts to import verifyTokenAsync and remap tenant claims.
  3. Lockfile Refresh:

    • Run pnpm install --frozen-lockfile=false at the root of each repository to update pnpm-lock.yaml.
Verification Loops
  1. In payments-service:

    • pnpm run typecheck
    • pnpm vitest run src/middleware/auth.test.ts
  2. In portal-api:

    • pnpm run typecheck
    • pnpm vitest run
  3. Cross-Repo Integration Test:

    • docker compose -f docker-compose.test.yml up --build --abort-on-container-exit
Rollback & Risk Guardrails
  • If vitest fails on token mocking, verify that test mocks in test/mocks/auth.ts reflect Promise returns rather than direct object values.
  • If cross-repo integration returns HTTP 401 on legacy session tokens, halt PR creation and verify token backward-compatibility headers.
Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Pauses for repository names and breaking changes to prevent hallucinations of non-existent files or flags.
  • Forces direct mapping from breaking changes to specific consumer files so agents do not miss edge sites.
  • Separates execution order and verification loops into reproducible shell commands that autonomous agents can run sequentially.

Use this prompt in Claude Code, Cursor, or ChatGPT when orchestrating library upgrades across microservices or independent packages. Paste your version diff and repo names when prompted.

Common edits

  • Add a CI pipeline step if your team uses centralized GitHub Actions workflows across repositories.
  • Include a changeset or semantic version release step if downstream packages are published to an internal registry.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

AI Coding AgentsClaude Code

Audit AI Code Diffs for Performance Regressions

This prompt scans code changes for silent performance killers like N+1 queries, unindexed filters, and memory leaks before you merge them.

AI Coding AgentsClaude Code

Convert User Stories into Strict Acceptance Test Assertions

This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.

AI Coding AgentsClaude Code

Create Automated Verification Loops for Long-Running Coding Agents

Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.

AI Coding AgentsClaude Code

Design a Sandbox Security Policy for Autonomous Coding Agents

Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.

AI Coding AgentsClaude Code

Generate Reproducible Bug Fix Specs for Coding Agents

Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.