agentleFS
zademyzademy/lu-query/skills/lu-query-explore-schema/SKILL.md

lu-query-explore-schema

Skill2 starsChanged 29 days agoMITView on GitHub

Use lu-query to explore an unknown Oracle database - discover schemas, tables, views, indexes, constraints, triggers, procedures, sequences and partitions, read an object's DDL, and map dependencies with Mermaid graphs. Start here before writing any SQL against an unfamiliar schema. Covers 31 metadata and graph tools.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every object-scoped tool resolves the owner in this order, and stops at the first hit:

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Explore an Oracle schema with lu-query

When to use

  • You do not know the schema: "which table holds orders?", "what columns does SKL_EMP have?", "what breaks if I drop this?"
  • You need the exact DDL of an object before changing it.
  • You need to see relationships: foreign keys, object dependencies.

When not to use

  • You already know the table and want rows → lu-query-query-data.
  • You want to change structure → lu-query-manage-schema.
  • You want to call a procedure → lu-query-use-plsql.

Workflow

  1. Ground yourself. test_connection → confirm database name, current user and current schema. Everything else is relative to that.
  2. Find objects by name pattern. search_objects (any type) or list_tables / list_views (with namePattern, e.g. SKL%). They resolve the session schema on their own; pass schema only to target another owner.
  3. Describe the object. describe_table for columns/nullability/defaults/comments, get_ddl for the full source, or read the resource oracle://schema/{schema}/table/{table} for a formatted column report and oracle://schema/{schema}/object/{object}/ddl for DDL.
  4. Inspect structure. list_indexes, list_constraints, list_partitions, list_triggers, list_sequences / get_sequence_info, list_types.
  5. Check for damage. list_invalid_objects (status INVALID = broken code) and get_plsql_errors for the compilation message.
  6. Map relationships. get_fk_graph (foreign keys) and get_dependency_graph (what an object needs / who needs it). Both return a mermaid field you can render or paste.
  7. Confirm existence cheaply. table_exists returns a bare true/false (views do not count).

Schema resolution (verified)

Every object-scoped tool resolves the owner in this order, and stops at the first hit:

  1. the schema argument of the call;
  2. ORACLE_DB_SCHEMA on the server;
  3. the session's own CURRENT_SCHEMA (SYS_CONTEXT('USERENV','CURRENT_SCHEMA')) - the owner you are connected as.

So with neither ORACLE_DB_SCHEMA nor a schema argument, describe_table, count_rows, get_table_stats, every catalog tool with table and every DDL tool still work: they read the session schema. (Verified 2026-10-18 on 2.16.3. Before that the session fallback was broken and they failed with "needs a schema".)

Pass schema only to target an owner other than the one you are connected as.

A blank schema (" ") is not an owner: it falls through to the next step of the order above. To know the owner you are connected as, read currentSchema from test_connection.

Tool reference

ToolUse for
test_connectionconnectivity, version, current user/schema
list_schemasusers visible to the connection
list_tables / list_viewstables / views, optional schema, namePattern
search_objectsany object type by pattern (returns OBJECT_TYPE, STATUS)
list_objectsobjects filtered by type
describe_tablecolumns, types, nullability, defaults, comments
table_existsboolean existence check
get_ddlDDL of any object (type inferred when omitted on the resource, required here)
list_indexes, list_constraints, list_partitions, list_ind_partitions, list_subpartitionsphysical and logical structure
list_sequences, get_sequence_infosequence range, cache, last number
list_triggers, list_procedures, list_types, list_synonyms, list_lob_columnscode and type objects
list_db_links, list_directories, list_external_tables, list_materialized_views, list_mview_logsobjects outside the local tablespace
list_invalid_objects, list_dependencies, list_scheduler_jobs, list_scheduler_job_runsbreakage and automation

Full signatures, output shapes and gotchas: references/tools.md. Verified transcripts: references/examples.md.

Reading results correctly

  • Column types arrive as Oracle renders them: NUMBER(6,), NUMBER(10,2), TIMESTAMP(6). The trailing comma in NUMBER(precision,) is cosmetic.
  • Dates in JSON are ISO strings with a Z suffix (2024-01-15T06:00:00.000Z); DATE columns are converted to UTC instants - that is the client's serialisation, not the stored local time.
  • STATUS: VALID vs INVALID on search_objects is about compilable code, not permissions.

Safety

This skill is read-only. It never mutates. Keep it that way: do not follow an exploration with a DDL call unless the user asked for the change.

Evidence

Quote the tool call and the rows you relied on. Every call lands in the session audit Markdown; oracle://audit/session/current returns the file for the running session.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.