context-graph
Map the decisions behind a codebase from its ADRs, RFCs and design records — each record's status and date, what supersedes or amends what, which records cite which, the files and folders each decision governs, and with git the commits that implemented it and the commits that changed each decision's code since it was made, and who made them — then answer "why is it like this?" from the record and check the record is still true. Finds supersessions only one side records, current decisions pointing at code that is gone, code that has drifted from its decision, two current decisions governing the same path, and references to records that don't exist. Use when the user asks "why do we use X", "which decisions govern this file or service", "is this ADR still current", "has the code drifted since we decided this", "are our ADRs out of date", "what was decided before I change this", wants a map of the architecture decisions, or is onboarding onto a codebase's history.
Other ways to install
With the sibling skills it hands off to:
The whole pack it belongs to:
By hand, from a clone of the repo:
In Claude Code, with the core plugin installed, invoke it as:
Try it
A realistic prompt from the skill's acceptance evals:
I'm new on the platform team and someone told me we keep user sessions in Redis. Before I touch login I'd like to understand why. Our ADRs are in docs/adr and the auth code is in services/auth/. Why do we use Redis for sessions, and is that still the current decision?
What a good result looks like
Example output
Worked example: why do order events go through Kafka? · the skill's own worked example, source
A made-up repository, in inputs/order-events/, with three ADRs:
- ADR-0004 chose Kafka for order events in 2025.
- ADR-0006 has receipts sent when the notifications service reads an OrderPlaced event, and cites ADR-0004.
- ADR-0009 moved order events to SQS in 2026, and says it supersedes ADR-0004. Nobody updated ADR-0004's Status line, and ADR-0009 names a bridge folder that has since been deleted.
The request
I'm changing
services/orders/publisher.py. Why do we publish order events to Kafka, and is that still the plan?
Script runs
python3 scripts/context_graph.py --root examples/inputs/order-events --why services/orders/publisher.py
python3 scripts/context_graph.py --root examples/inputs/order-events
The --why output:
# Decisions governing services/orders/publisher.py
- **ADR-0009 Order events on SQS** (accepted, current, 2026-02-10), via `services/orders/`: docs/adr/0009-sqs-for-order-events.md
- **ADR-0004 Kafka for order events** (marked accepted, but superseded by ADR-0009, 2025-03-02), via `services/orders/`: docs/adr/0004-kafka-for-order-events.md
The full check, which exits 1 because it found problems:
## Problems (2)
- ADR-0004 is still marked Accepted, but ADR-0009 supersedes it: mark it 'Superseded by ADR-0009'
- ADR-0009 is accepted but points at code that is gone: services/kafka-bridge
## Warnings (1)
- ADR-0006 is current but cites ADR-0004, which ADR-0009 supersedes: check it still holds
The reply
It isn't the plan any more. ADR-0009 (accepted 2026-02-10) moved order events from Kafka to SQS queues, one per consumer, published from services/orders/. Its reasons: "only two consumers ever replayed, and the Kafka cluster is the team's largest on-call load". It replaces ADR-0004, which chose Kafka in 2025. ADR-0004's own Status line still says Accepted, so anyone reading it on its own gets the wrong answer.
Before you change the publisher:
- ADR-0004 needs its status fixed. Change
## StatustoSuperseded by ADR-0009, linked to0009-sqs-for-order-events.md. - ADR-0009 names
services/kafka-bridge/, which no longer exists. If billing has moved, add a line saying the bridge was removed. If it hasn't, find where the bridge went. - ADR-0006 (receipts) still cites ADR-0004. It has the notifications service read OrderPlaced events, which now come from an SQS queue. Check that the receipts consumer has its queue before you change what the publisher sends.
What the records don't say: when billing moved off Kafka, and whether replay for a new consumer (now a backfill from the orders table, per ADR-0009) has been tested.
How it's checked
Measured against plain Claude Code (2026-10-23): it met 63% of its checks, against 55% without it, and a blind judge preferred it. How skills are checked
134 assertions across 17 acceptance evals, and 12 trigger queries. Every skill's checks
What the output must do
When it should and shouldn't activate
Should activate:
- Why do we use Kafka for order events? Is the ADR that chose it still the current decision?
- I'm about to refactor services/billing/invoice.py. Which architecture decisions govern it that I should read first?
- Our docs/adr folder has 40 records going back five years. Find the ones that are stale, superseded without being marked, or contradict each other
- Give me a map of our RFCs and ADRs: what supersedes what, and which folders each one covers, for onboarding the new hires
- Is ADR-0012 still true? I think the code it talks about was deleted last year
- ADR-0009 says order events go through one SQS queue per tenant. Has the orders service drifted from that since we decided it, and who changed it?
- Before I rewrite the billing batch job, what decisions did we record about it, and has anyone changed the code since without updating them?
Should leave to another skill:
- We just decided to move our search from Postgres full-text to a hosted search engine. Write the ADR for it in MADR format
- I start on the checkout repo on Monday. How do I run it locally, run the tests, and where's the code for applying discount codes?
- There are no design docs for this monolith. Work out its architecture from the code and the docker-compose file and draw me a C4 diagram
- Here are the notes from this morning's pricing steering meeting. Pull out what was decided, who owns each action and when it's due
- Show me who committed to services/orders in the last month and summarise what changed
Hands off to
- adr-generator — when a decision is live but unrecorded, or a record needs superseding, deprecating or correcting. Write the new or corrected record, with the supersession link the graph found missing.
Related skills
codebase-tour, reverse-architecture, decision-log
Source
SKILL.md · the whole folder on GitHub.