Data Lineage Agent Skill
Contributed by ajillell_uhg
Improved by Laravel Company · 2026-09-07
You are an expert AI System Architect and Data Lineage Specialist. Your task is to design a comprehensive, actionable blueprint for developing a specialized AI Agent named data-lineage-agent. This agent's core function is to analyze, map, and report on data lineage and linkage across complex database scripts and stored procedures.
Goal: Produce a detailed, structured specification for building this agent.
Agent Specification Requirements
1. Role Definition:
The agent must function as an autonomous system capable of ingesting raw database artifacts (SQL scripts, procedure definitions) and deriving a complete, traceable lineage graph of data flow and dependencies within a specified system.
2. Input Context (Provided Variables):
The agent must be designed to utilize the following dynamic variables:
${repositoryUrl}: The URL of the source code repository (e.g., GitHub).${platforms}: A list defining the data environments or systems involved in the data flow.
3. Core Operational Steps (Mandatory Process Flow):
The design must explicitly cover these four critical phases:
- Phase 1: Repository Access & Ingestion: Define the mechanism for securely accessing and cloning the repository (
${repositoryUrl}) to ingest all relevant database scripts and stored procedures. - Phase 2: Lineage Parsing & Mapping: Specify the methodology (e.g., using LLM reasoning, dedicated parsers) to analyze the ingested scripts and accurately identify table relationships, column dependencies, and data flow paths from source tables to final destinations.
- Phase 3: Impact Analysis & Graph Construction: Detail the logic required to trace dependencies across intermediate tables. The output must be structured to facilitate the construction of a dependency graph (using concepts like graph databases) to visualize potential downstream impacts.
- Phase 4: Reporting & Traceability: Define how the lineage information will be translated into actionable reports, ensuring every finding is linked back to specific commits or versions in the repository for complete traceability.
4. Desired Agent Features (Must be implemented):
The final agent design must incorporate the following advanced features:
- Automated Impact Alerts: Ability to trigger notifications when a change in a source table is detected, identifying all downstream tables and platforms affected.
- Version Control Integration: Mandatory linkage of every lineage finding to the specific commit hash or version in the repository.
- Visualization Layer: The design must account for generating visual representations (e.g., directed acyclic graphs) of the data flow.
5. Use Cases (Demonstrate Capability):
The proposed design must clearly address the following scenarios:
- System Impact Assessment: Determining the full scope of changes resulting from modifying any single table.
- End-to-End Data Flow Visualization: Mapping the complete journey of data from initial source to final consumption.
- Dependency Reporting: Generating structured reports detailing all table dependencies and platform linkages.
6. Output Format Constraint:
Provide the complete specification in a structured format, suitable for immediate implementation by a software development team. Use Markdown headings and nested lists to clearly delineate the architecture, methodology, and feature requirements. Focus on the design and logic rather than writing the final production code.
Original prompt (before our improvements)
--- name: data-lineage-agent description: A skill for creating an agent to analyze data lineage and linkage across database scripts and stored procedures. --- # Data Lineage Agent Skill ## Purpose This skill assists in creating an agent that can analyze and report on the data lineage and linkage within a database system. It is ideal for understanding how changes to tables can affect the overall system and helps in uncovering the dependencies across different platforms. ## Steps to Create the Agent 1. **Access the Repository:** - Link to the GitHub repository: [GitHub Repo](https://github.com/optuminsight-payer/COB-PARS_DB_SCRIPTS) - Clone the repository to access all database scripts and stored procedures. 2. **Analyze Data Lineage:** - Use tools to parse SQL scripts to identify table relationships and dependencies. - Map out the data flow from source tables to final tables. 3. **Identify Changes Impact:** - Implement logic to trace changes in intermediate tables to see which final tables are affected. - Use graph databases or lineage analysis tools for better visualization and impact assessment. 4. **Host the Agent:** - Choose a hosting platform (e.g., AWS, Azure) to deploy the agent for continuous analysis and reporting. ## Use Cases - **Impact Analysis:** Determine the impact of changes in any table across the system. - **Data Flow Mapping:** Visualize how data moves through the system from source to final tables. - **Dependency Reporting:** Generate reports on table dependencies and affected platforms. ## Additional Features - **Automated Alerts:** Notify users when potential impacts are detected. - **Version Control Integration:** Link changes to specific commits in the repository for traceability. ## Example Variables - `${repositoryUrl}`: The URL of the GitHub repository. - `${platforms}`: List of platforms involved in the data flow. This skill provides a structured approach to building an agent capable of comprehensive data lineage analysis, which can be crucial for database management and optimization tasks.