`carrick-impact` determines the blast radius of proposed code changes before you modify or delete an interface. It maps producer implementations and consumer call sites across repositories and evaluates type compatibility for each consumer.

## Invocation triggers

Agents load `carrick-impact` before modifying or removing:

- REST and HTTP routes
- GraphQL schema fields
- WebSocket events
- Pub/sub topics
- Request and response type definitions
- Shared functions called across files

The skill also activates on queries such as "who calls this endpoint?", "who consumes this route?", or "what breaks if I change this function?".

## Tool sequence

1. **Discover callers and operations**:
   - `get_operation(method, path)`: Retrieves producer services, consumer call sites, unmatched calls, and near-miss routes for an endpoint or event.
   - `get_callers(function_name, file, depth)`: Identifies internal calling functions across the codebase.
2. **Evaluate contract compatibility**:
   - `check_compatibility(consumer_service, producer_service, path)`: Evaluates request/response type compatibility for each identified consumer service.
3. **Verify working tree modifications**:
   - `carrick check <file> --recheck --json`: Re-evaluates modified local files against the compiled index without network calls.

## Report structure and classification

Reports begin with a summary table of consumer call sites, assigning one of four mutually exclusive verdicts to each row:

- **`COMPATIBLE`**: Request and response types match between consumer and producer.
- **`INCOMPATIBLE`**: Stored analysis indicates a type mismatch or missing route parameter.
- **`UNRESOLVED`**: Types could not be statically verified (for example, due to unextracted `any` or `unknown` types).
- **`NOT COMPARED`**: No stored type comparison exists for the pair.

Every row includes a provenance tag:

- `fact:`: Extracted deterministically from source code.
- `candidate:`: Inferred through model analysis.

The report also lists producer definitions, unmatched calls, and near-miss routes.

## Coverage boundaries

- **New routes on branches**: The hosted index reflects default branches. Routes introduced on a local branch show no consumer call sites until merged and scanned in CI.
- **Near-miss routes**: Calls using dynamic runtime URL concatenation may appear under neighbouring paths or alternative HTTP methods. Verify near misses in source code before concluding an endpoint is uncalled.
- **Indirect function references**: The index tracks direct static calls. Functions passed as callbacks or accessed dynamically through reflection are omitted from caller lists.

## Example

Evaluating `get_operation` on an endpoint with request body dispatching:

```json
{
  "requested": {
    "method": "POST",
    "path": "/v1/orders {action=refund}"
  },
  "producers": [
    {
      "service": "acme-orders",
      "file_location": "functions/orders/index.ts:0",
      "handler": "handleRefund",
      "source": "fact: declared operation"
    }
  ],
  "consumers": [
    {
      "services": ["acme-gateway"],
      "call_file_location": "functions/gateway/src/api-client.ts:133",
      "source": "candidate: model"
    }
  ],
  "near_misses": {
    "same_path_other_method": [
      {
        "side": "unmatched_call",
        "method": "GET",
        "path": "/v1/orders",
        "file_location": "functions/gateway/src/routes/list-orders.ts:13",
        "differs_by": "method GET, requested POST"
      }
    ]
  }
}
```

The skill formats the finding into an impact table:

| consumer service | call site | verdict | source |
| :--- | :--- | :--- | :--- |
| acme-gateway | functions/gateway/src/api-client.ts:133 | UNRESOLVED | candidate |

## Related

- [Task skills](/task-skills) provides an overview of the four standard agent workflows.
- [MCP tools](/mcp-tools) documents `get_operation`, `get_callers`, and `check_compatibility`.
- [CLI](/cli) covers `carrick check`.