Data Lineage Summary

Data Lineage Summary

Summarizes the upstream and downstream data lineage of a BigQuery or Cloud Storage asset into a plain-English Markdown report to help debug data quality issues.

Skill files3 files

references/

SKILL.md167 lines
1
---
2
name: datalineage-summary
3
metadata:
4
version: "1.0.3"
5
category: BigDataAndAnalytics
6
description: >-
7
Summarizes data lineage graphs on Google Cloud to help users debug data quality issues and understand data provenance for BigQuery and Cloud Storage.
8
Use when summarizing upstream and downstream data flows, and presenting complex lineage data as an intuitive Markdown report.
9
Don't use for generic BigQuery queries, editing lineage relationships, or downstream deprecation.
10
Don't use for downstream blast-radius impact analysis (use datalineage-bigquery-asset-impact-analysis skill instead).
11
---
12
13
# Data Lineage Summary
14
15
This skill guides the agent in investigating and summarizing the Data Lineage
16
graph for a specific focal asset (Table-Level Lineage) or specific fields
17
(Column-Level Lineage). It provides an intuitive left-to-right walkthrough of
18
how data enters and leaves the asset, abstracting away complex node and link
19
details into plain English.
20
21
## Attribution
22
23
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
24
MUST read [Usage Attribution](references/attribution.md). For commands executed
25
directly in the terminal (never in generated scripts, Terraform, or user code),
26
prefix `gcloud` with
27
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:datalineage-summary)"`
28
and append `agent-skills/1.0 (skill:datalineage-summary)` to `User-Agent` headers.
29
30
## Prerequisites
31
32
This skill relies on the **data lineage (Knowledge Catalog) MCP Server** on
33
Google Cloud for graph traversal. Ensure you can run `search_lineage` queries in
34
both upstream and downstream directions. For detailed connection configurations
35
and tool schemas, refer to [MCP Usage](references/mcp-usage.md).
36
37
## Workflow Logic
38
39
### 1. Get Lineage
40
41
Fetch the lineage graph in both directions from the focal point (both upstream
42
and downstream) by making *two separate calls* to the MCP tool: one with
43
`"direction": "UPSTREAM"` and another with `"direction": "DOWNSTREAM"`.
44
45
* **Location Strategy**: You **MUST** use the `read_url` tool to fetch the
46
comprehensive list of locations dynamically from the provided
47
[Knowledge Catalog Locations](https://docs.cloud.google.com/knowledge-catalog/docs/locations.md.txt)
48
link. To ensure cross-regional lineage is not missed, always verify the
49
current list of Google Cloud regions using this link before populating the
50
`locations` array. You **MUST** populate the `locations` array with all
51
supported physical regions fetched from this link. You may optionally
52
additionally determine the asset's specific active region (using `bq show`
53
or `gcloud storage ls`).
54
* **Search Parameters**: Use `maxDepth = 10`, `maxResults = 5000` and
55
`maxProcessPerLink = 10` as robust defaults when calling `search_lineage`.
56
For example, a DOWNSTREAM call should be formatted like this (expanding the
57
`locations` array as needed):
58
59
```json
60
{
61
"parent": "projects/project_id/locations/us",
62
"locations": [
63
"us",
64
"us-central1",
65
"us-east1",
66
"us-west1",
67
"europe-west1",
68
"asia-northeast1"
69
],
70
"rootCriteria": {
71
"entities": {
72
"entities": [
73
{
74
"fullyQualifiedName": "bigquery:project.dataset.table"
75
}
76
]
77
}
78
},
79
"direction": "DOWNSTREAM",
80
"limits": {
81
"maxDepth": 10,
82
"maxResults": 5000,
83
"maxProcessPerLink": 10
84
}
85
}
86
```
87
88
Ensure you make a similar call with `"direction": "UPSTREAM"` to fetch the
89
upstream lineage.
90
91
* **Column-Level Lineage (CLL)**: The `search_lineage` tool can find all
92
Column-Level Lineage (CLL) by configuring the `field` array. If Table-Level
93
Lineage (TLL) is requested, configure the call to get CLL links along with
94
the TLL links by exploiting the `"*"` wildcard. For example:
95
96
```json
97
"rootCriteria": {
98
"entities": {
99
"entities": [
100
{
101
"fullyQualifiedName": "bigquery:project.dataset.table",
102
"field": [
103
"*"
104
]
105
}
106
]
107
}
108
}
109
```
110
111
If evaluating a specific column, replace `"*"` with the specific column name
112
(e.g., `"efficiency_score"`).
113
114
### 2. Summarize
115
116
Generate the summary using the prompt guidelines below.
117
118
* **Persona**: Act as an expert Data Lineage Analyst generating a concise,
119
easy-to-understand left-to-right walkthrough of the data flow.
120
* **Structure & Flow**: Start immediately with the summary text, structured as
121
follows:
122
* **Overall Flow Type**: State the inferred workflow type and data domain
123
(e.g., "This appears to be a Feature Engineering workflow...").
124
* **Systems Overview**: List the primary systems involved up front. If the
125
request is for Column-Level Lineage, you MUST explicitly declare that
126
the scope of the analysis is limited to the specified field up front.
127
* **Upstream Lineage**: Use the exact bold header `**Upstream Lineage:**`.
128
Narrative must detail how data arrives at the focal asset, mentioning
129
key source systems, projects, and processing tasks (e.g., Spark on
130
Dataproc).
131
* **Downstream Lineage**: Use the exact bold header `**Downstream
132
Lineage:**`. Detail where data goes from the focal asset to final
133
consumer systems.
134
* **Analysis Metadata**: Display the parameters used for the API call to
135
provide transparency on the boundaries of the summary. The output must
136
contain:
137
* **Locations Searched**: `{list_of_locations_queried}`
138
* **Parent Location**: `{parent_path}`
139
* **Depth Limit**: `{maxDepth}`
140
* **Process per Link Limit**: `{maxProcessPerLink}`
141
* **Tip for User**: A prompt suggesting they can ask to rerun with
142
expanded locations (if not all were used) or depth.
143
* **Granularity Constraints**:
144
* Prioritize flows between Systems, Projects, and Datasets over individual
145
files/tables.
146
* You MUST explicitly list specific asset names (e.g., source tables,
147
intermediate views, consumer tables) if there are fewer than 5. Do not
148
just summarize counts if there are fewer than 5; name them explicitly.
149
Otherwise, if 5 or more, aggregate them by count (e.g., "5 Cloud
150
Storage buckets").
151
* Only mention counts for *ultimate sources*, *final consumers*, and
152
*total assets*.
153
* Do not repeat project names redundantly for every dataset if only one
154
project is involved.
155
* **Tone**: Avoid jargon and generic phrases like "There are distinct factual
156
points." Be direct and clear. The final output is Markdown.
157
158
### 3. Return the Summary
159
160
Return the final summarized output back to the user.
161
162
## External Documentation
163
164
- [Knowledge Catalog Data Lineage Documentation](https://docs.cloud.google.com/knowledge-catalog/docs/about-data-lineage.md.txt)
165
- [Use the Data Lineage MCP server](https://docs.cloud.google.com/knowledge-catalog/docs/use-lineage-mcp.md.txt)
166
- [Knowledge Catalog Data Lineage API Reference](https://docs.cloud.google.com/knowledge-catalog/docs/reference/data-lineage/rest.md.txt)
167

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 10,806 prompts

More by @OpenSourceBuffGuy

See all
Legal Precedent Research Expert prompt image

Legal Precedent Research Expert

Turns the AI into a legal precedent researcher that maps authorities, analyses holdings, builds arguments and anticipates counterarguments in IRAC-structured memoranda.

system-prompt, act-as, legal-research, litigation, legal, for-lawyers, xml-tags, structured-output, report, guardrails, advanced, long-form, formal, objective, critique, academic-writing, citation-formatting, research-methods

Felt miniature doll walking with a fox prompt image

Felt miniature doll walking with a fox

Generates a handmade felt miniature scene of a wool doll in a casual tech outfit walking across felt grass beside a small felt fox, in a macro stop-motion look.

image-prompt, nano-banana, embroidery, miniature, storybook, whimsical, cozy, macro, bokeh, natural-light, pastel, animals, toys, character-design, cinematic, for-artists, for-designers

Baby copies mother's yoga poses in 3D prompt image

Baby copies mother's yoga poses in 3D

Generates a 20-second Pixar-style 3D clip of a mother doing morning yoga while her baby copies every pose, with fixed character looks and camera plan.

video-prompt, animation, pixar-style, yoga, family, family-friendly, cinematic, character-consistency, camera-movement, tracking-shot, multi-shot, seedance, natural-light, soft-lighting, bokeh, pastel, close-up, wide-shot, widescreen, negative-prompt

Reviews

Loading reviews…

Discussion

Loading comments…