All answers

How do we generate and keep a service catalog current from the code?

Dennis PilarinosDennis Pilarinos·Nov 27, 2026·Context Engine · Engineering Insights

Generate a draft catalog entry for each repo from its code and history, have the owning team confirm it, then rerun on a schedule that diffs against the current entry and opens a pull request. Unblocked writes the drafts by reading each repo's code, PRs, docs and chat. Backstage, Port, Cortex or OpsLevel still hold the catalog, and a human owns every entry.

You build a service catalog from the code in three steps. Draft one entry per repo. Ask the owner to confirm it. Then refresh it on a schedule that proposes changes as pull requests. Unblocked writes the drafts. A script or a scheduled Routine asks it about each repo, and it reads the code, pull requests, docs and chat to return the service's purpose, endpoints, dependencies, lifecycle and likely owner, with links. A service catalog is the list of every service a company runs: what each one does, who owns it and what it needs. Backstage, Port, Cortex and OpsLevel are the usual homes for one.

What the catalog tools already do well#

Catalogs already read their data from files in the repo. Backstage describes its catalog as "a centralized system that keeps track of ownership and metadata for all the software in your ecosystem," built on "metadata YAML files stored together with the code" (Backstage Software Catalog). Its descriptor docs recommend naming that file catalog-info.yaml. A component's required owner is "the singular entity (commonly a team) that bears ultimate responsibility for the component," and lifecycle takes values such as production and deprecated (Backstage descriptor format).

OpsLevel reads an opslevel.yml file in each repo with owner, lifecycle, tier and dependencies, and "will automatically synchronize the contents" whenever it changes (OpsLevel docs). Cortex defines services in a cortex.yaml file, and "Cortex may recommend owners" based on your catalog data, which you can accept or reject (Cortex docs). Port's integrations with GitHub, Kubernetes, PagerDuty and Jira "continuously populate the catalog" (Port docs).

So syncing works. Filling the file in is the weak spot. Backstage's catalog overview says it plainly: "Teams owning the components are responsible for maintaining the metadata about them." Most teams write it once, and the owner field outlives the team it names.

Draft one catalog entry per repo from code and history#

Teams we work with write a description of each service from its code and history: purpose, endpoints and dependencies. They also decide if each service is active or deprecated, and who owns it now. Ask every repo the same few questions:

  • What does this service do, in 2 sentences, and which endpoints does it expose?
  • Which services, queues and data stores does it call or depend on?
  • Is it still active, or has work moved to a replacement? Point to the change.
  • Which team has made and reviewed most of its changes over the last 6 months?

Unblocked's REST API has a research endpoint that takes a query plus an optional instruction. It returns a Markdown summary and a sources list, each with a url and a sourceType such as code, pull request, issue, message or documentation (Unblocked research API). Each catalog field has a likely source of evidence:

Catalog fieldWhere the evidence usually lives
Description and purposeREADME, code entry points, the PR that created the service
Endpoints and APIsRoute definitions, API specs, client calls in other repos
DependenciesImports, config files, infrastructure code
LifecycleRecent commit activity, deprecation PRs, migration threads in chat
OwnerWho wrote and reviewed recent changes, on-call config, team docs

Put the YAML shape in the instruction. Have the script write a draft catalog-info.yaml with the sources in a side file. Owners need those links to check the draft.

Several teams also write an agent-friendly runbook per repo in the same pass. Keeping those files fresh is the same problem as keeping agent instructions up to date. One team generates an architecture model from code in CI. For headless jobs, Unblocked's CLI context-* commands return JSON on standard output and authenticate with an API token (programmatic access).

Have the owner confirm, and treat "unknown owner" as a finding#

A generated entry is a proposal. Open it as a pull request in the repo. Ask the named team to approve, fix or reassign it. Owners know things history can't, like a handover agreed for next quarter.

An unknown owner is a service where no recent change, review, on-call entry or team doc points to a team that still exists. In Unblocked's answer, the cited sources stop at people who left or a renamed team. When the evidence points nowhere, say so. Write owner: unknown and file it as a finding. Don't guess the last person who committed. A list of unowned services is often the most useful thing the first run produces. Flag an unsure lifecycle the same way.

Refresh on a schedule that diffs and opens a pull request#

Catalog drift is the gap between what a catalog entry says and what the code and its history now show. With Unblocked, drift appears when this week's cited answer lists a dependency or owner that the stored entry doesn't. The first run fills the catalog. Rerunning is what keeps drift small. Run the same questions on a schedule and compare each answer with the entry in the repo. Open a pull request only when something changed, such as a new dependency or a renamed endpoint.

Some teams run this as a scheduled Unblocked Routine. Routines run hourly, daily, on weekdays, weekly or on a five-field cron expression. "Each routine runs as the team member who created it, using that person's permissions." If your team uses Unblocked Code, "a routine can also start a coding task, and Unblocked opens a pull request when the task finishes" (Routines). Other teams run a script against the API or CLI from CI. GitHub Actions schedules use "POSIX cron syntax" (GitHub Actions events). For a script, give the job its own team token. A token can reach every document in its selected sources, so select only what the job needs.

If you also score services for readiness, the same loop feeds it. Running a production readiness review across hundreds of repos uses this question-per-repo pattern for health checks, alerts and runbooks. The ladder in context engineering across hundreds of repos covers the platform side.

Limits to keep in view#

A human owns the final entry. The generated draft is evidence for a decision, not the decision. Merge nothing without the owning team's approval. Keep the sources with each change, and keep the question templates in the repo so anyone can see the methodology behind an entry.

The output is only as good as the code and history behind it. A January 2026 paper on recovering architecture from large codebases names "architectural drift, missing relations" and "the limited context of Large Language Models" as the main obstacles, and found that "dependency context improves the accuracy of generated architectures" (ArchAgent, arXiv 2601.13007). A dependency set at runtime won't appear. Nor will an owner agreed in a meeting nobody wrote down. Connect the places your teams write things down before you trust an answer that says "no dependencies." How the engine weighs code against older docs is covered in inside the Unblocked context engine.