Skip to main content
Engineering/codependency-analyzer

Codependency Analyzer

You need to extract evidence-based code dependencies and map the critical path and independent work streams.

Contributed by: Mark Whaley · Source: PM Starter Kit

Use this when a PM needs to understand how systems, services, or components depend on each other to make sequencing and prioritization decisions. Inspects the identified repositories and service paths to extract internal service-to-service calls, external third-party dependencies, database tables touched, and event/topic contracts produced and consumed.

This skill produces the dependency snapshot that reveals hidden coupling, critical paths, and independent work streams. It sits at the end of the Feature Impact Radar pipeline: /technical-intent-parser/architecture-context-reviewer/repository-discovery/codependency-analyzer.

Process

Step 1: Gather inputs

Ask the user:

  1. Repositories — The repos identified by /repository-discovery (e.g., payments/billing-service, messaging/notification-platform). If coming from the pipeline, these are already available.
  2. Backend actions — The actions identified by /technical-intent-parser (e.g., schedule_reminder, send_notification, store_user_preferences).
  3. Data entities — The business objects identified by /technical-intent-parser (e.g., invoice, reminder_preferences, user).
  4. Service paths (recommended) — Where each service lives in its repo, from /repository-discovery.
  5. Event streams (if known) — From /architecture-context-reviewer.
  6. Org context (optional) — Languages/frameworks, monorepo/polyrepo, runtime environment.

If repositories, backend actions, and data entities are missing, stop and request them (or run the upstream skills first).

Step 2: Identify which personas are affected

Before generating the analysis, prompt the user:

Persona check: Which user persona(s) are affected by these systems? If you have defined personas (e.g., from /persona-create or /persona-draft), name them. If not, describe who uses the features powered by these components.

This ensures the dependency map highlights what matters to users — not just internal coupling — and helps prioritize which dependency chains to address first.

Step 3: Analyze code dependencies

For each service path, inspect code and metadata to extract dependencies. Use backend actions and data entities as search anchors to reduce noise.

Evidence sources (priority order):

  1. Direct client usage (HTTP/gRPC SDK calls), explicit producers/consumers
  2. API/event schema references + routing config
  3. Dependency manifests + infra config (Helm, Terraform, env vars)
  4. Naming inference (lowest — use only as "suspected", not fact)

What to look for:

  • Internal service-to-service calls: HTTP clients calling internal hostnames, gRPC stubs, shared API client libraries, gateway routing config, service URL config vars
  • External third-party dependencies: SaaS APIs (email, SMS, push), cloud-managed services (queues, storage), external partner APIs, SDK usage
  • Database tables touched: Migrations, ORM models, query targets in DAOs/repositories
  • Event dependencies: Producers (publishing events), consumers (subscriptions, handlers), topic names, schema references

Step 4: Present the dependency snapshot

## Dependency Analysis — (Feature/Context Name)

**Date:** (Date)
**Repos analyzed:** (List)
**Confidence level:** (High / Medium / Low)

---

### Internal Service Dependencies

| Caller | Callee | Mechanism | Evidence |
|---|---|---|---|
| (service-a) | (service-b) | (http / grpc / event / lib) | (File or config where this was found) |

### External Dependencies

| Service | External system | Type | Evidence |
|---|---|---|---|
| (service-name) | (e.g., SendGrid, Stripe, AWS SQS) | (saas / cloud / partner) | (SDK usage, client code, config) |

### Database Tables Touched

| Service | Database.Table | Access pattern | Evidence |
|---|---|---|---|
| (service-name) | (db.table or table if db unknown) | (read / write / migrate) | (Migration file, ORM model, query) |

### Event Dependencies

| Service | Role | Event / Topic | Evidence |
|---|---|---|---|
| (service-name) | (produces / consumes) | (event.name) | (Publisher/handler code, config) |

Step 5: Map the critical path and independent streams

### Dependency Map

(Text diagram showing which systems depend on which.)

[billing-service] ──http──→ [notification-service] │ │ └──http──→ [user-preferences-service] │ [billing-service] ──produces──→ invoice.due_soon ──consumed by──→ [notification-service]


### Critical Path

For (the feature/initiative): (Component A) → (Component B) → (Component C)

This means: (Plain-language explanation of the sequencing constraint.)

### Independent Work Streams

These can be worked on in parallel without blocking each other:
- **Stream 1:** (Components) — (Why they're independent)
- **Stream 2:** (Components) — (Why they're independent)

### Change Blast Radius

| If you change... | These also need to change | Ripple size |
|---|---|---|
| (Component) | (Affected components) | (Small / Medium / Large — with explanation) |

### Coupling Risks

| Risk | Components | Why it's risky | Mitigation |
|---|---|---|---|
| (e.g., shared database) | (Components sharing it) | (What goes wrong) | (How to mitigate) |

Step 6: Review and validate

Ask the user:

  • Does this dependency map match your understanding?
  • Are there dependencies engineers have mentioned that aren't captured here?
  • Does the critical path align with your team's capacity and sequencing?
  • Are there external dependencies (vendor APIs, partner systems) that should be on this map?

Adjust as needed.

Related skills

  • /repository-discovery — upstream: provides the repos and service paths this skill analyzes.
  • /architecture-context-reviewer — upstream: provides verified services, databases, and event streams.
  • /technical-intent-parser — pipeline entry point: decomposes a feature into technical signals.
  • /pre-mortem — when you want to stress-test sequencing decisions for failure modes.
  • /ipm-plan — when you're ready to turn the sequencing into an iteration plan.

Output location

Present the dependency snapshot, critical path, and independent streams as formatted text in the conversation. The user copies the output into planning documentation, shares it in roadmap discussions, or uses it to facilitate sequencing conversations with engineering leads.

Example Output

Input

  • Repositories: commerce/checkout-service, payments/billing-service, messaging/notification-platform, identity/user-preferences-service
  • Backend actions: process_payment, apply_promo_code, send_order_confirmation, store_payment_method
  • Data entities: order, payment_method, promo_code, user_preferences
  • Service paths: checkout-service/src/clients/, billing-service/src/handlers/, notification-platform/src/consumers/, user-preferences-service/src/models/
  • Event streams: Kafka topics — order.completed, payment.failed, promo.redeemed
  • Org context: Polyrepo, Node.js/TypeScript services, Kubernetes on GCP, Stripe SDK in use

Output (abbreviated)

Dependency Analysis — One-Click Checkout with Promo Support

Date: 2025-06-11 Repos analyzed: commerce/checkout-service, payments/billing-service, messaging/notification-platform, identity/user-preferences-service Confidence level: High (direct client code + Kafka config inspected; one suspected dependency noted)


Internal Service Dependencies

CallerCalleeMechanismEvidence
checkout-servicebilling-serviceHTTPcheckout-service/src/clients/billing.client.ts — POST /charges
checkout-serviceuser-preferences-serviceHTTPcheckout-service/src/clients/preferences.client.ts — GET /payment-methods/:userId
notification-platformuser-preferences-serviceHTTPnotification-platform/src/consumers/order-completed.handler.ts — fetches email/push prefs
billing-servicecheckout-serviceSuspected HTTPNaming inference on checkout.callback env var — unconfirmed

External Dependencies

ServiceExternal SystemTypeEvidence
billing-serviceStripeSaaSstripe npm package, billing-service/src/handlers/charge.handler.ts
notification-platformSendGridSaaS@sendgrid/mail SDK, notification-platform/src/senders/email.sender.ts
notification-platformFirebase Cloud MessagingCloudfirebase-admin SDK, notification-platform/src/senders/push.sender.ts
billing-serviceGCP Secret ManagerCloud@google-cloud/secret-manager in billing-service/src/config/secrets.ts

Database Tables Touched

ServiceDatabase.TableAccess PatternEvidence
checkout-servicecommerce.ordersread / writecheckout-service/src/models/order.model.ts, migration 0041_create_orders
checkout-servicecommerce.promo_codesread / writecheckout-service/src/models/promo.model.ts, query in apply_promo_code.ts
billing-servicepayments.payment_methodsread / writebilling-service/src/models/payment-method.model.ts
billing-servicepayments.transactionswritebilling-service/src/handlers/charge.handler.ts
user-preferences-serviceidentity.user_preferencesread / writeuser-preferences-service/src/models/preferences.model.ts

Event Dependencies

ServiceRoleEvent / TopicEvidence
checkout-serviceproducesorder.completedcheckout-service/src/publishers/order.publisher.ts
checkout-serviceproducespromo.redeemedcheckout-service/src/publishers/promo.publisher.ts
billing-serviceproducespayment.failedbilling-service/src/handlers/charge.handler.ts
notification-platformconsumesorder.completednotification-platform/src/consumers/order-completed.handler.ts
notification-platformconsumespayment.failednotification-platform/src/consumers/payment-failed.handler.ts

Dependency Map

[checkout-service] ──http──→ [billing-service] ──→ Stripe
        │                            │
        │                            └──produces──→ payment.failed ──→ [notification-platform]
        │
        └──http──→ [user-preferences-service]
        │                  ↑
        │          (also called by notification-platform)
        │
        └──produces──→ order.completed ──→ [notification-platform] ──→ SendGrid / FCM
        └──produces──→ promo.redeemed   (no consumer found — orphan event)

Critical Path

For one-click checkout with promo support:

user-preferences-servicebilling-servicecheckout-servicenotification-platform

This means: checkout-service cannot complete a purchase flow without user-preferences-service returning a stored payment method and billing-service successfully charging it. notification-platform is downstream of the order.completed event, so it can be integrated last — but its dependency on user-preferences-service for delivery preferences must be validated before go-live.


Independent Work Streams

These can be worked on in parallel without blocking each other:

  • Stream 1: user-preferences-service schema + store_payment_method endpoint — no inbound service dependencies; can be built and tested in isolation
  • Stream 2: notification-platform consumer logic for order.completed and payment.failed — depends only on Kafka topic contracts being finalized, not on checkout flow completion
  • Stream 3: Stripe integration hardening in billing-service — internal to that service; only interface contract (POST /charges response shape) needs to be stable for checkout-service

Change Blast Radius

If you change...These also need to changeRipple size
user-preferences-service /payment-methods response schemacheckout-service, notification-platformLarge — two independent callers; coordinate contract change or version the endpoint
order.completed Kafka topic schemanotification-platform consumer handlerMedium — one consumer, but schema break causes silent failures if not versioned
Stripe charge API (e.g., payment intent migration)billing-service onlySmall — fully encapsulated; no surface exposed to other services
commerce.promo_codes table structurecheckout-service onlySmall — single owner, no cross-service reads detected

Coupling Risks

RiskComponentsWhy It's RiskyMitigation
Shared user-preferences-service called synchronously by two servicescheckout-service, notification-platformLatency spike or downtime in preferences service blocks both checkout completion and order confirmation delivery simultaneouslyAdd response caching in each caller; consider async fallback for notification path
Orphan event: promo.redeemed produced but no consumer foundcheckout-serviceEvent is being published to Kafka with no handler — either a consumer is missing (analytics? loyalty?) or dead code is accumulatingConfirm intended consumer with engineering; remove or document the topic contract
Suspected callback dependency from billing-servicecheckout-servicebilling-service, checkout-serviceIf confirmed, this creates a circular HTTP dependency — a failure in checkout would cascade back into billingInspect CHECKOUT_CALLBACK_URL env var; convert to event-driven if circular call is confirmed

Review Questions for Engineering

  • Does the billing-servicecheckout-service callback exist? If so, what triggers it and can it be replaced with an event?
  • Is there an intended consumer for the promo.redeemed topic — e.g., a loyalty or analytics service not yet in scope?
  • Does notification-platform have a fallback if user-preferences-service is slow at the time an order.completed event arrives?