@docs-flatten kind=code and lets the agent cross the bases to find the root cause.
The Problem
Thecheckout-api Rollout is stuck in Progressing and never turns Healthy. Looking one layer at a time gets nowhere: the manifest looks right, Terraform applied without error, and the code compiles. The answer is at the seam — and it’s spread across three repositories.
Ingredients
- The application repository (service code).
- The infra Terraform module (cluster, node groups).
- The GitOps repository (Argo/Kubernetes manifests).
- ChatCLI with the builtin
@docs-flattentool (included).
No API key required: knowledge mode uses pure-Go BM25 by default. Embeddings (Voyage/OpenAI/Bedrock) are an optional boost.
Step by Step
Index each layer as a base
kind=code slices each repo by structure — functions, Terraform resources, manifests — with symbol/resource titles, instead of one text blob:vendor/, .terraform/, lockfiles, binaries) is skipped automatically, and files above 1 MiB are ignored.Create and attach the three bases
Ask across the layers
In Under the hood, the agent investigates iteratively:
/agent (or /coder), describe the symptom and let the AI connect. @knowledge search fans out across the three bases, tagging each passage by its source base:Get the cross-layer diagnosis
With passages from all three layers in the same reasoning, the AI connects the dots — for example:
TheThe base is read-only — it gives understanding. To apply the fix and run the tests, useRollout/checkout-api(argo) setsreadinessProbeon port 8080, but the service (app,server.go) listens on 8081; andaws_eks_node_group.workers(infra) has adedicated=checkouttaint theRolloutdoesn’t tolerate. Two compounding factors: the probe never passes and the pods don’t even schedule onto the right nodes.
/coder on the live repo with @read/@search/@coder.Why it works
Automatic fan-out
@knowledge search queries all attached bases at once; each hit is tagged by its source base, so the model knows which layer it came from.Structure-aware slicing
Terraform resources, K8s manifests and functions become their own chunks with titles (
aws_eks_node_group.workers, Rollout/checkout-api) — search lands on the right spot.Fixed cost
A ~900-token index card per base, regardless of repo size. Three layers still fit in the prompt.
Keyless
Pure-Go BM25 covers everything with no API key; identifiers (
getReadiness, checkout_api) are found by their parts thanks to camelCase/snake splitting.