---
name: loom-codebase-atlas
description: "Use when an unfamiliar code area needs a reusable map of modules, callers, interfaces, data flow, constraints, and related records before safe implementation, review, debugging, or planning."
disable-model-invocation: true
---

# loom-codebase-atlas

Codebase atlas is a zoom-out playbook.

It maps a relevant code area in terms of domain language, modules, callers,
interfaces, and decisions, then records accepted reusable context in knowledge.

## Loom Routing

Common routes use these Loom skills for durable records or follow-up workflow:
`loom-knowledge`, `loom-research`, `loom-constitution`, `loom-specs`,
`loom-evidence`, and `loom-tickets`.

Ensure the `using-loom` skill is loaded before applying this workflow.

When routing to any named Loom skill, follow that skill's procedure and guidance
completely. This playbook adds workflow pressure; it does not shorten the target
skill's requirements.

It explains the codebase. It does not replace specs, tickets, evidence, or audit.

## Use This Playbook When

Use this playbook when:

- the agent is unfamiliar with a code area
- a ticket needs context before safe execution
- a bug or review requires caller/callee understanding
- a plan depends on module relationships
- architecture terms need grounding in actual code
- a future agent would benefit from a persistent map

Skip it when a narrow file read is enough to complete a small scoped edit safely.

## Route

Use this route:

```text
question -> scope -> map -> explain -> record -> route
```

## Question

Start with the reason for the atlas.

Examples:

- Where does this behavior enter the system?
- Which modules call this interface?
- What owns this data lifecycle?
- Which code paths must a worker understand before editing?
- Why does this area feel tangled?

The atlas should answer a retrieval need, not become a full repository tour.

## Scope

Bound the map by task, domain, interface, feature, or failure.

Inspect:

- relevant knowledge, specs, decisions, tickets, and evidence
- source files and tests around the area
- public interfaces and callers
- data flow and side effects
- setup, generated files, or external dependencies only when relevant

Use project domain vocabulary when it exists. If language is missing or confused,
route through `loom-domain-language-and-decisions`.

## Map

Describe the area in layers that help future work:

- domain concepts involved
- modules and their roles
- entry points and callers
- interfaces and invariants callers must know
- important side effects, state, data ownership, or lifecycle rules
- tests and evidence that cover the area
- decisions or specs that constrain changes
- known seams, adapters, or extension points
- gaps, unknowns, and risky assumptions

Prefer a compact map over exhaustive file listings. File paths are useful when they
help navigation, but the atlas should explain relationships.

## Explain

Give the operator or future agent the higher-level picture:

- what to read first
- what not to change casually
- which names map to domain concepts
- where behavior is concentrated
- where behavior is scattered
- what would make the next change safer

If the map reveals architectural friction, route to `loom-architecture-deepening`.
If it reveals missing behavior contracts, route to `loom-specs`.

## Record

Create or update a `Knowledge Atlas` when the map should survive the session.

The atlas should include:

- task or domain triggers for retrieval
- applies-to paths or areas
- module/caller map
- key interfaces and invariants
- related specs, decisions, tickets, evidence, or research
- boundaries where the atlas stops applying
- freshness note when the code area changes quickly

Do not promote uncertain exploration as accepted knowledge. Use research or
evidence for unresolved observations.

## Done Means

The atlas pass is done when:

- the original zoom-out question is answered
- relevant modules and callers are mapped at the right level
- durable context is recorded when it will prevent rediscovery, support recovery,
  or guide future work in the mapped area
- unknowns and risks are explicit
- the next work route is clear
