agentleFS
zademyzademy/lu-query/skills/lu-query-audit-report/SKILL.md

lu-query-audit-report

Skill2 starsChanged 29 days agoMITView on GitHub

Turn the lu-query audit trail into a single interactive HTML report - KPIs, per-day and per-hour activity, slowest statements, ORA error groups, READ/WRITE split, per-session table. Use when asked what was executed against the database over a period, for an audit or an activity report, or to review what an agent did in a session.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before a retrospective: which statements were slow, which failed, which wrote.

    line 17
  2. Very specific:

    Get the directory: Ask where the lu-query audit Markdown files live.

    line 28
  3. Distinctive:

    Never guess silently: an existing directory with no audit files means audit was off.

    line 31
  4. Very specific:

    Get the window: Ask for two dates in dd/mm/yyyy, maximum one month.

    line 32
  5. Distinctive:

    Run the parser: Never parse the Markdown yourself - it is deterministic work, and you would spend the whole context on regex:

    line 34
  6. Distinctive:

    Read-only on disk: the script only reads audit files and writes one HTML file under <auditDir>/reports/.

    line 71

≈ “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

Audit report from the lu-query trail

The MCP server writes one Markdown file per session - one per server process - with one entry per statement it ran. This skill reads those files and renders a report. It never connects to the database.

When to use

  • "What did we run against the DB last week?", "show me the activity from 01/10 to 17/10"
  • An audit trail to hand to someone else.
  • Before a retrospective: which statements were slow, which failed, which wrote.

When not to use

  • You want to ask the live database something -> lu-query-query-data.
  • You want to investigate a specific failure now -> lu-query-triage-incident.
  • There are no audit files (audit disabled): the server needs audit enabled and an MCP_AUDIT_DIR, otherwise there is nothing to report on.

Workflow

  1. Get the directory. Ask where the lu-query audit Markdown files live. Check first:
    • the MCP config's MCP_AUDIT_DIR for lu-query (if you can read it),
    • ./mcp-audit-logs inside a lu-query clone. Never guess silently: an existing directory with no audit files means audit was off.
  2. Get the window. Ask for two dates in dd/mm/yyyy, maximum one month. If the user says "last week" or "October", resolve it to concrete dates and state them back before running.
  3. Run the parser. Never parse the Markdown yourself - it is deterministic work, and you would spend the whole context on regex:

    node scripts/audit-report.mjs <auditDir> <dd/mm/yyyy> <dd/mm/yyyy>

    It prints the absolute path of the HTML it wrote to <auditDir>/reports/. Exit code 1 plus a message on stderr means it refused: do not retry with different values, read references/troubleshooting.md and fix the cause.

  4. Hand over the path. Give the user the path and one sentence about what it covers. Do not paste the HTML into the conversation and do not summarize numbers you did not read.
  5. Regenerating the same window overwrites the same file, so a second run is always a fresh render of the same data, not a second copy.

Reading results correctly

  • One entry per statement, not per query. run_query is just one of the tools in the report; writes, DDL and PL/SQL appear too. The type split (READ/WRITE/OTHER) is the honest summary of what the session did to the data.
  • Filas: -1 marks a failed statement. Those rows are excluded from "filas devueltas" and counted as errors instead.
  • A session is a server process, not a person and not a conversation. Two clients started at the same moment produce two files; one client reconnecting produces several.
  • Duration is server-side, per statement: it includes Oracle round-trips but not the time the agent spent thinking. The p95 is computed over statements that ran, not over sessions.
  • The trail does not say who ran it. There is no user, host or client in the format, so never attribute statements to a person from this report.
  • The SQL is verbatim. In writes that means real literals (emails, ids, occasionally credentials). The HTML carries a warning about it; keep it out of repositories and out of shared storage.

Panel by panel: references/report.md. Every failure mode: references/troubleshooting.md.

Safety

Read-only on disk: the script only reads audit files and writes one HTML file under <auditDir>/reports/. It never touches the database, never installs anything and never runs npm install. The generated HTML is a document, not a viewer: it runs no query.

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.