This prompt is for maintainers of shared libraries, monorepo owners, and platform teams who need to understand the full downstream impact of a proposed change before committing to it. The job-to-be-done is risk assessment: you are considering a change to a module's public surface—whether a signature modification, a behavioral contract shift, or a deprecation—and you need to know which consumers will break, which will need updates, and how the change cascades through the dependency graph. The ideal user provides two inputs: a structured description of the changed module's public API surface (what is being added, removed, or modified) and a dependency graph showing direct dependents and their consumers. Use this prompt during API deprecation planning, when evaluating whether a seemingly internal refactor will leak into downstream consumers, or before committing to a breaking change that requires coordinated consumer updates.
Prompt
Change Propagation Analysis Prompt

When to Use This Prompt
Understand the blast radius of a proposed change before writing any code by generating a propagation map of direct and indirect dependents.
This prompt does not replace build verification, integration tests, or actual consumer communication. It is a planning tool that produces a propagation map with breakage likelihood assessments and suggested consumer updates. The output is only as reliable as the dependency graph you provide—if your graph is incomplete, stale, or missing indirect dependents, the propagation map will contain false negatives. The prompt assumes you can articulate the change in terms of public contracts: exported functions, classes, interfaces, type signatures, or behavioral guarantees. It is not designed for changes that are purely internal implementation details with no observable effect on consumers, nor for changes where the dependency graph is unknown or must be inferred from source code by the model itself.
Before using this prompt, assemble your dependency graph and change description. After receiving the propagation map, validate it against your own knowledge of the codebase—look for missed indirect dependents, overestimated propagation scope, and consumers flagged as affected that are actually insulated by abstraction layers. The next step is to use the propagation map to plan your rollout: identify which consumers need advance notice, which need code changes, and whether compatibility shims or deprecation windows are required. Avoid treating the propagation map as a final answer; it is a starting point for impact analysis that must be verified against build systems, test suites, and consumer communication channels.
Use Case Fit
Where Change Propagation Analysis delivers high-signal impact maps and where it creates noise or false confidence.
Good Fit: Monorepo Library Maintainers
Use when: a shared module changes and you need to identify every downstream consumer, estimate breakage likelihood, and generate suggested consumer updates before cutting a release. Guardrail: always validate the propagation map against the actual build graph (e.g., Bazel, Nx, Turborepo) to catch missed indirect dependents.
Good Fit: Pre-Merge Impact Review
Use when: a multi-file PR touches a core utility or type definition and the reviewer needs a structured list of affected files, symbols, and contracts ranked by risk. Guardrail: pair the propagation map with a regression risk assessment prompt to identify untested code paths in the affected dependents.
Bad Fit: Dynamic or Reflection-Heavy Codebases
Avoid when: the codebase uses heavy runtime reflection, dynamic imports, string-based dispatch, or dependency injection containers that obscure the static dependency graph. Guardrail: if static analysis cannot resolve true dependents, flag the propagation map as incomplete and require manual review of dynamic call sites before acting on the output.
Bad Fit: Small Single-Package Projects
Avoid when: the repository has fewer than 10 source files or no internal package boundaries. The overhead of running propagation analysis exceeds the value of a manual grep or IDE find-references. Guardrail: use a lightweight symbol-reference search instead; reserve full propagation analysis for projects with clear module boundaries and multiple consumers.
Required Inputs
Must provide: the changed module or symbol, the repository dependency graph (or tool access to generate it), and the scope boundary (e.g., entire monorepo vs. a specific package subtree). Guardrail: if the dependency graph is stale or incomplete, run a graph regeneration step before analysis and reject propagation maps built on outdated structure.
Operational Risk: Overestimated Propagation
Risk: the model reports downstream files as affected when the change is actually backward-compatible (e.g., adding a new optional parameter). This creates unnecessary consumer churn and erodes trust in the analysis. Guardrail: require the prompt to classify each dependent as breaking, possibly-breaking, or unaffected, and route possibly-breaking entries to a human reviewer before notifying consumer teams.
Copy-Ready Prompt Template
A copy-ready template for generating a change propagation map from a proposed source change, identifying all affected dependents, breakage likelihood, and suggested consumer updates.
This template is the core instruction set for the Change Propagation Analysis Prompt. It is designed to be pasted into your AI coding agent, LLM workflow, or evaluation harness. The prompt instructs the model to act as a static analysis and dependency reasoning engine, producing a structured propagation map from a single, well-defined change in a shared library or monorepo module. The output is not a patch; it is a risk assessment and consumer impact plan that engineering leads can review before any code is written.
codeYou are a senior software architect specializing in monorepo maintenance and shared library API design. Your task is to analyze a proposed change in one module and produce a detailed propagation map showing how this change cascades through all direct and indirect dependents. # INPUTS - [SOURCE_MODULE]: The module where the change originates. - [CHANGE_DESCRIPTION]: A precise description of the proposed change (e.g., function signature change, removed export, altered default behavior, new required parameter). - [DEPENDENCY_GRAPH]: A representation of the dependency graph, listing dependents and their relationships. This can be a raw adjacency list, a JSON structure, or the output of a tool like `nx graph` or `madge`. - [CONSUMER_USAGE_PATTERNS]: (Optional) A summary of how key dependents currently use the changed symbol, derived from static analysis or grep results. # OUTPUT SCHEMA Return a single JSON object with the following structure: { "source_change": { "module": "string", "description": "string", "breaking": boolean }, "propagation_map": [ { "dependent_module": "string", "dependency_path": ["string"], "breakage_likelihood": "high" | "medium" | "low" | "none", "impact_rationale": "string", "affected_symbols": ["string"], "suggested_consumer_update": "string" } ], "indirect_dependents_risk_summary": "string", "recommended_change_order": ["string"] } # CONSTRAINTS - Do not invent dependents not present in [DEPENDENCY_GRAPH]. - If a dependent uses the changed symbol, mark breakage_likelihood as "high" for breaking changes and "medium" for behavioral changes. - For indirect dependents (dependents of dependents), assess risk based on whether the intermediate module re-exports or wraps the changed symbol. - If [CONSUMER_USAGE_PATTERNS] is provided, use it to refine the impact_rationale. Otherwise, state assumptions clearly. - The recommended_change_order must respect the dependency graph, listing leaf dependents first.
To adapt this template, replace the square-bracket placeholders with data from your repository tooling. The [DEPENDENCY_GRAPH] is the most critical input; it must be accurate to prevent the model from hallucinating dependents. For a monorepo, you can generate this from Nx project graphs, Turborepo pipelines, or a simple script that parses package.json files. The [CONSUMER_USAGE_PATTERNS] placeholder is optional but strongly recommended for reducing false positives. Populate it by running a grep or static analysis tool (like ts-morph or ast-grep) to find actual call sites of the symbol being changed. Before integrating this prompt into a CI pipeline, run it against known historical changes and compare the output to actual breakage incidents to calibrate your eval thresholds.
Prompt Variables
Inputs required for the Change Propagation Analysis Prompt. Each variable must be populated with enough specificity for the model to trace dependency chains, assess breakage likelihood, and generate actionable consumer updates.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CHANGE_DESCRIPTION] | Natural language description of the proposed change, including the target module, symbol, signature modification, or behavioral alteration. | Refactor the | Must contain a target module and symbol. Parse check: non-empty string with at least one identifiable code entity. |
[REPOSITORY_CONTEXT] | Structured or semi-structured representation of the codebase: file tree, import graph, symbol index, or dependency manifest. | {"modules": {"billing/utils.py": {"exports": ["calculateFee"], "imports": ["models/account.py"]}, "services/invoice.py": {"imports": ["billing/utils.py"]}}} | Must include import or dependency edges. Schema check: valid JSON with modules key. Null allowed if graph is inferred from file paths. |
[CONSUMER_SCOPE] | Boundary defining which dependents to analyze: internal packages only, public API consumers, specific directories, or the entire monorepo. | All internal packages within | Must resolve to a scoped set of files. Parse check: non-empty string. If wildcard or 'all' is used, confirm scope is intentional to avoid over-analysis. |
[BREAKAGE_THRESHOLD] | Confidence level below which a potential breakage should still be reported. Controls sensitivity of the propagation map. | medium | Must be one of: low, medium, high. Enum check. Low reports more speculative impacts; high suppresses uncertain propagation paths. |
[OUTPUT_FORMAT] | Desired structure for the propagation map: JSON schema, markdown table, or structured report with sections. | JSON with fields: affected_file, symbol, impact_type, breakage_likelihood, suggested_fix | Must match a known format key: json, markdown, or report. Schema check: if json, provide expected field definitions. |
[INCLUDE_INDIRECT_DEPENDENTS] | Boolean flag indicating whether to trace transitive dependents beyond direct importers. | Must be true or false. If true, depth limit should be specified or model may produce unbounded chains. If false, only direct importers are analyzed. | |
[KNOWN_SAFE_PATTERNS] | Optional list of patterns, adapters, or wrappers that mitigate breakage risk and should suppress propagation alerts. | ["All consumers use the | Null allowed. If provided, each entry must be a non-empty string. Model should cross-reference these against detected dependents to reduce false positives. |
Implementation Harness Notes
How to wire the Change Propagation Analysis prompt into an AI coding agent or CI pipeline with validation, retries, and human review gates.
The Change Propagation Analysis prompt is designed to be called programmatically, not just used in a chat interface. In a production harness, the prompt receives a structured input payload containing the changed module signature, the dependency graph (or instructions for the agent to retrieve it), and the output schema. The harness is responsible for assembling this context before the model call. For monorepo or shared-library workflows, the dependency graph should be extracted from a build system (e.g., tsconfig.json references, Cargo.toml dependencies, Bazel BUILD files) rather than relying on the model to infer it from source alone. This prevents hallucinated dependencies and ensures the propagation map is grounded in the actual build graph.
After the model returns the propagation map, the harness must validate the output against the expected schema. Key validation checks include: (1) every listed dependent must exist in the provided dependency graph, (2) no circular propagation paths should appear unless the graph itself contains cycles, (3) breakage likelihood scores must fall within the defined range (e.g., 0.0–1.0), and (4) suggested consumer updates must reference real symbols or file paths from the codebase. If validation fails, the harness should retry with the error details appended to the prompt as a correction hint. A maximum of two retries is recommended before escalating to a human reviewer. For high-risk changes—such as public API modifications in shared libraries—the harness should route the validated propagation map to a review queue where a maintainer can confirm or reject the analysis before any code is written.
Model choice matters for this prompt. The task requires reasoning over structured dependency data and producing a consistent, schema-conforming output. Models with strong JSON mode and long-context handling (e.g., Claude 3.5 Sonnet, GPT-4o) perform well. Avoid models that struggle with structured output or tend to hallucinate symbols. For CI integration, wrap the prompt call in a lightweight function that accepts a diff or commit SHA, extracts the changed module, queries the build graph, calls the model, validates the output, and posts the propagation map as a comment on the pull request or merge request. Log every model call with the input context, raw output, validation result, and any retry attempts. This traceability is essential for debugging false negatives—where an indirect dependent is missed—and false positives—where the model overestimates propagation scope. Start with a dry-run mode that posts the analysis as a non-blocking comment before gating merges on propagation review.
Expected Output Contract
Schema and validation rules for the Change Propagation Analysis response. Use this contract to parse, validate, and integrate the model output into downstream tooling such as CI checks, code review dashboards, or migration planners.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
propagation_map | Array of objects | Must be a non-empty array. Each element must conform to the propagation_entry schema. | |
propagation_map[].source_symbol | String (fully qualified) | Must match the pattern ^[\w.]+(::[\w.]+)*$. Must be resolvable to a symbol in the repository index. | |
propagation_map[].dependent_file | String (relative path) | Must be a valid relative file path present in the repository. Must not be the same file as the source symbol's definition file unless internal propagation is explicitly noted. | |
propagation_map[].dependent_symbol | String (fully qualified) | Must match the pattern ^[\w.]+(::[\w.]+)*$. Must be a symbol that directly imports, calls, or references the source_symbol. | |
propagation_map[].breakage_likelihood | Enum: high, medium, low, none | Must be one of the four allowed values. 'high' requires a breaking signature or contract change. 'none' requires evidence that the dependent usage is fully compatible. | |
propagation_map[].breakage_rationale | String | Must be 1-3 sentences citing the specific contract change and how the dependent uses it. Must not be a generic restatement of the likelihood value. | |
propagation_map[].suggested_consumer_update | String or null | If breakage_likelihood is 'high' or 'medium', must contain a concrete code change suggestion. If 'low' or 'none', may be null. Must not suggest changes that alter the dependent's public contract unless necessary. | |
indirect_dependents_checked | Boolean | Must be true if transitive propagation was analyzed, false if only direct dependents were checked. If false, the response must include a note in the limitations field. | |
limitations | Array of strings | If present, each string must describe a specific limitation (e.g., 'dynamic imports not analyzed', 'reflection-based callers excluded'). Must not contain generic disclaimers. |
Common Failure Modes
Change propagation analysis is brittle when the model hallucinates dependencies, misses indirect consumers, or overestimates blast radius. These failure modes and guardrails help you ship a reliable propagation map.
Missed Indirect Dependents
What to watch: The model traces direct imports but skips transitive dependents two or more hops away, leaving downstream breakage invisible. Guardrail: Require the prompt to traverse the full dependency graph depth-first and list every dependent with its dependency path, not just immediate importers.
Hallucinated Dependency Edges
What to watch: The model invents imports or coupling between modules that don't exist in the codebase, inflating the propagation map with phantom risks. Guardrail: Add a strict rule that every claimed dependency must cite a specific import statement, function call, or type reference visible in the provided source context.
Overestimated Breakage Likelihood
What to watch: The model flags every dependent as high-risk even when the changed symbol is backward-compatible or unused by most consumers. Guardrail: Instruct the model to classify breakage into three tiers—breaking, potentially affected, and unaffected—based on actual usage of the changed symbol in each dependent.
Ignored Dynamic or Reflection-Based Access
What to watch: The model misses consumers that access the changed module through dynamic imports, reflection, string-based lookup, or DI containers. Guardrail: Add a secondary check step that searches for the changed symbol name as a string literal across the codebase and flags any matches for manual review.
Stale Context or Partial Repository View
What to watch: The model receives only a subset of the repository and silently assumes no other dependents exist, producing an incomplete propagation map. Guardrail: Require the prompt to explicitly state which directories or files were searched and include a confidence caveat when the search scope is incomplete.
Suggested Consumer Updates Are Too Generic
What to watch: The model produces vague fix suggestions like 'update the import' without showing the actual code change needed in each dependent. Guardrail: Require per-dependent fix snippets that show the before and after code, validated against the actual API surface change in the source module.
Evaluation Rubric
Use this rubric to test the Change Propagation Analysis output before integrating it into a CI guard, review tool, or agent workflow. Each row targets a common failure mode for propagation maps.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Direct dependent coverage | All direct dependents of [CHANGED_MODULE] are listed in the propagation map | A known direct importer or caller is missing from the output | Diff the output dependent list against a static dependency graph (e.g., |
Indirect dependent coverage | All transitive dependents up to [MAX_DEPTH] are included with a propagation path | A known indirect dependent is missing or the propagation chain stops early without explanation | Spot-check 3 known transitive dependents; verify each appears with a complete path from [CHANGED_MODULE] to the dependent |
Breakage likelihood calibration | Each dependent has a breakage likelihood of HIGH, MEDIUM, or LOW with a concrete reason tied to the change type | All dependents are rated HIGH without differentiation, or ratings lack a reason grounded in the change | Sample 5 dependents; verify the rating aligns with whether the dependent imports the changed symbol, relies on changed behavior, or only uses unaffected paths |
No hallucinated dependents | Every listed dependent actually imports, calls, or references [CHANGED_MODULE] in the current codebase | A listed dependent has no import, require, or reference to the changed module when checked | Grep the codebase for references to [CHANGED_MODULE] in each listed dependent file; flag any dependent with zero matches |
Consumer update suggestion relevance | Each HIGH or MEDIUM dependent includes a specific, actionable update suggestion referencing the actual change | Suggestions are generic ('update your code') or reference symbols not present in the dependent | For 3 HIGH-rated dependents, verify the suggestion mentions a concrete symbol, line, or pattern that exists in the dependent file |
Propagation path completeness | Each propagation path lists the full chain of imports or calls from [CHANGED_MODULE] to the dependent | A path contains a broken link where module A depends on B but B does not actually depend on C in the chain | Trace one full propagation path per depth level; verify each hop by checking imports in the intermediate file |
False positive rate on unaffected modules | Modules that import [CHANGED_MODULE] but use only unaffected symbols are rated LOW or excluded with a note | A module that imports only an unchanged constant from [CHANGED_MODULE] is rated HIGH or MEDIUM | Identify 3 modules that import [CHANGED_MODULE] but not the changed symbol; verify they are rated LOW or excluded with justification |
Output schema compliance | The output matches the [OUTPUT_SCHEMA] exactly: all required fields present, no extra fields, correct types | The output is missing a required field, contains an undocumented field, or has a type mismatch (e.g., string instead of array) | Validate the full output against the [OUTPUT_SCHEMA] using a JSON Schema validator; reject on any violation |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single dependency graph input and lighter validation. Focus on getting a readable propagation map without strict schema enforcement. Accept plain-text or markdown output initially.
Prompt modification
- Remove the [OUTPUT_SCHEMA] constraint and replace with: "Output a markdown table with columns: Dependent Module, Breakage Likelihood (Low/Medium/High), Suggested Consumer Update, Rationale."
- Replace [CONSTRAINTS] with: "If you are uncertain about indirect dependents, flag them with [NEEDS VERIFICATION]."
- Drop the eval harness section and rely on manual spot-checking.
Watch for
- Missing indirect transitive dependents that aren't explicitly imported
- Overly broad propagation claims when the change is backward-compatible
- Hallucinated consumer modules that don't exist in the actual codebase

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us