detect-foreign-keys

Detect and validate foreign key relationships across relational database tables.

3|1|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/tilmon-engineering/claude-skills --skill detect-foreign-keys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detect-foreign-keys
Source: https://github.com/tilmon-engineering/claude-skills/tree/main/plugins/datapeeker/skills/detect-foreign-keys
Command: npx skills add https://github.com/tilmon-engineering/claude-skills --skill detect-foreign-keys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you systematically discover and validate foreign key relationships between tables in a relational database, enabling reliable joins and data quality assessments.

Core Features & Use Cases

  • Candidate FK detection: heuristic naming patterns, data-type checks, and column-level scans to surface potential foreign keys.
  • Value overlap validation: cross-checks FK values against parent keys to confirm relationships and reveal orphaned records.
  • Cardinality & integrity reporting: computes one-to-many, many-to-one patterns and generates actionable join recommendations and data-quality insights.

Quick Start

Run the FK detection workflow against your database schema to generate a relationships catalog.

Frequently Asked Questions about detect-foreign-keys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect foreign key relationships in an undocumented SQL database?

To detect foreign key relationships in an undocumented SQL database, this Skill uses heuristic naming patterns, data-type checks, and column-level scans to surface potential foreign keys across relational tables.

What is the best way to validate referential integrity and find orphaned records?

Validating referential integrity involves cross-checking foreign key values against parent keys to confirm relationships and reveal orphaned records, which this Skill accomplishes through value overlap validation.

Can I use heuristic foreign key detection for databases with multiple relational tables?

Yes, heuristic foreign key detection is applicable to databases with multiple relational tables and undocumented relationships, producing an actionable catalog of relationships with join recommendations.

How do I assess cardinality and generate join recommendations for data quality analytics?

You can assess cardinality by computing one-to-many and many-to-one patterns across matched tables, generating actionable join recommendations and data-quality insights for your analytics workflows.

Does candidate key detection work without predefined database relationships?

Yes, candidate key detection works without predefined relationships by scanning column-level data types and naming conventions to surface potential foreign keys and enable reliable joins.