Code Ownership Impact
Before any change that crosses team or service boundaries, find CODEOWNERS, blast radius, and required reviewers. The output is a multi-team review packet with named approvers per affected path.
Required Loading
Always load:
prompts/ownership-walk.md— the per-team-ping-list and shared-kernel-detection framework.
When To Run
- Before merging a rename, refactor, deprecate, schema change, or API break.
- Before opening a PR that touches a shared kernel.
- When the author needs to know "who else needs to review this?".
- When a dependency request is being prepared for another team.
Discovery Order
- Walk the diff (
git diff --name-only main..HEAD). - For each changed path, resolve the team that owns the path. Use
codegraph_files(path → team map) orrg 'path:' CODEOWNERSfor a manual lookup. - For each team, list the named approvers from the
CODEOWNERSfile. - Detect shared-kernel membership: any file under
common/,shared/,pkg/,platform/, or matching a shared-kernel pattern (e.g.*::common::*). - Compute the blast radius with
codegraph_impact(orrgfor the symbol + per-callerRead). - For each shared-kernel hit, list the subscriber services and their owning teams.
- Suggest a review order: smaller teams / least-loaded first, larger / release-train-locked last.
Output Contract
The review packet is grouped by team. For each team, name:
- the path(s) the team owns within the diff
- the named approvers (from
CODEOWNERS) - the suggested review deadline (next release-train slot)
- the cross-team impact (for the team's owned services that consume a shared-kernel change)
- the suggested ack-channel (a thread in the team's chat, a CODEOWNERS
@-ping, or an RFC subscribe)
A diff that touches no shared kernel and no per-team boundary produces a single-team review packet (one team, the author's team) — that is itself the correct output.
Tools
codegraph_impact— primary tool for the blast-radius walk.codegraph_files— path → team map.codegraph_callers/codegraph_callees— boundary crossing (who calls into / who is called from the changed symbol).codegraph_search— locate a shared-kernel file by name.- Fallback —
rg 'path:' CODEOWNERS+git log -- <path>for per-path ownership inference. The fallback is acceptable but not as precise.
Fallback
If CodeGraph is unavailable, the fallback is rg CODEOWNERS + git log per changed path. The final report must include the line:
CodeGraph unavailable; ownership gathered by rg/file inspection.
Related Skills
spec-doc-linter— keepsDevAgent.md/CONTEXT.mdhonest; this skill is the human-side counterpart for cross-team change.cross-team-rfc-draft(planned v0.6.1) — the long-form RFC for changes that need a written proposal. code-ownership-impact is the per-PR packet; cross-team-rfc-draft is the proposal.goal-driven-development— orchestrates the spec-to-code flow; code-ownership-impact is the pre-merge counterpart that names approvers.
Examples
Each bad-* doc has a matching good-* in examples/ showing the minimum packet. Read them side by side to calibrate packet depth. examples/ownership-output.md is the canonical "what the agent should emit" sample.