Skip to content
Back to skills

Lu Query Audit Data Quality

ASecurity

Use lu-query to check Oracle data quality - find duplicate key candidates with find_duplicates, count orphan rows of a foreign key with validate_fk_integrity, and get exact table counts with count_rows. Use when auditing a table before migrating, deduplicating, or validating a legacy FK.

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 18, 2026
ai-agentsrustsql

Works with

  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 18, 2026

npx -y skills add zademy/lu-query --skill lu-query-audit-data-quality --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lu Query Audit Data Quality?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lu Query Audit Data Quality
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zademy-lu-query-audit-data-quality/badge)](https://www.skillsdirectory.com/skills/zademy-lu-query-audit-data-quality)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lu-query-audit-data-quality
description: Use lu-query to check Oracle data quality - find duplicate key candidates with find_duplicates, count orphan rows of a foreign key with validate_fk_integrity, and get exact table counts with count_rows. Use when auditing a table before migrating, deduplicating, or validating a legacy FK.
compatibility: Requires the lu-query MCP server connected over stdio; these tools resolve the owner themselves (schema argument, then ORACLE_DB_SCHEMA, then the session's CURRENT_SCHEMA).
---

# Audit data quality with lu-query

## When to use

- "Are there duplicates?", "does this FK actually hold?", "how many rows does the table have, exactly?"
- Pre-migration or pre-deduplication checks.

## When not to use

- You need row values → [lu-query-query-data](../lu-query-query-data/SKILL.md).
- You want to _fix_ rows → audit first, then [lu-query-plan-data-changes](../lu-query-plan-data-changes/SKILL.md).

## Workflow

1. **Size the table.** `count_rows` (exact, no SQL handcrafting).
2. **Duplicates.** `find_duplicates` with the candidate key column(s). Read `groups`: each entry has the duplicated value, `CNT` and a `SAMPLE_ROWID` you can join on.
3. **Referential integrity.** `validate_fk_integrity` on the child table; optionally `constraint` to check one named FK. It reports orphans per constraint.
4. **Rank and report.** Order findings by business impact, not by tool order. State the exact SQL-equivalent you would run to fix each one, and let the user approve before any write.

## Reading results correctly

- `find_duplicates` excludes `NULL`s (SQL `GROUP BY` semantics): a column that is `NULL` in most rows will not show up as a duplicate group. Verify nullability with `describe_table` before trusting "no duplicates".
- `minCount` defaults to 2; raise it to find triplicates.
- `validate_fk_integrity` returns one row per FK with `orphan_count`. `0` means every child row resolves to a parent _among rows the tool can see_; `> 0` names real orphans.
- Legacy orphans can only exist if the constraint was created (or left) `NOVALIDATE`. If a FK was created and validated, the answer is trivially 0 - that is a real finding, not a bug.

## Tool reference

| Tool                    | Signature                                            | Returns                                                                                               |
| ----------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `count_rows`            | `table*`, `schema?`                                  | `{schema, table, rowCount}`                                                                           |
| `find_duplicates`       | `table*`, `columns*` (array), `minCount?`, `schema?` | `{schema, table, columns, minCount, groups: [{<col>: value, CNT: n, SAMPLE_ROWID: rid}]}`             |
| `validate_fk_integrity` | `table*`, `constraint?`, `schema?`                   | array of `{constraint_name, child_columns, parent_owner, parent_table, parent_columns, orphan_count}` |

Details: `references/tools.md`. Verified transcripts: `references/examples.md`.

## Safety

Read-only. Nothing here writes. But do not turn findings into `UPDATE`s on your own initiative: propose the fix, get approval, then use [lu-query-plan-data-changes](../lu-query-plan-data-changes/SKILL.md).

Files in this skill

  • SKILL.md3.4 KB
  • references/examples.md1.8 KB
  • references/tools.md1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.