Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge.

MITAuto-check passedDatabases

Install Trace

skills CLI
$ npx skills add ai-analyst-lab/ai-analyst --skill trace -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ai-analyst-lab/ai-analyst trace --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/trace .claude/skills/trace && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trace
GitHub stars
304
Token cost
~851 tokens
SKILL.md length
445 words
Files
1
Skills in repo
43
Repo updated
First seen
Licence
MIT

At a glance

Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge.

  • Works in 5 steps: Resolve the analysis. Read the current… → Verify the findings manifest. If… → Build + render the trace. Use the… → …
  • Tasks that involve SQL
  • SKILL.md covers Steps and Notes
  • Calls python3

What it does

Trace is an agent skill from ai-analyst-lab/ai-analyst. Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge. Use after an analysis when someone asks "where did that number come from?"

Its SKILL.md is about 850 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering SQL. It works with SQL. The repository describes itself as: AI Product Analyst — Claude Code-powered data analysis toolkit. The licence is MIT.

When your agent uses it

  • Tasks that involve SQL

Example prompts

  • “where did that number come from?”
  • “/trace”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Resolve the analysis. Read the current analysis record
  2. Verify the findings manifest. If reported numbers were not registered,
  3. Build + render the trace. Use the lifecycle command so all inputs come
  4. Open and share it. Open the HTML locally when the environment supports
  5. Read it out. Walk the findings top to bottom: the number, its badge, the SQL. Call out anything

What it can do on your machine

Read from SKILL.md and the folder at commit 52c0744. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trace loads about 851 tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 445 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~851

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ai-analyst-lab/ai-analyst at commit 52c0744, republished under its MIT licence (© ai-analyst-lab). 445 words, ~851 tokens.

Download SKILL.mdSave it as .claude/skills/trace/SKILL.md (or your agent's skills folder).
name
trace
description
Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge. Use after an analysis when someone asks "where did that number come from?"

/trace: expose the query logic behind every number

Renders and shares one self-contained HTML that ties each reported number (a finding) back to the query that produced it, labeled by confidence: cited (the agent named the query), value-match (a query's captured result_value equals the number), or inferred (nearest query in time). Unmatched findings and orphan queries are shown, not hidden. An unverified number is the most important thing to surface. This is the on-demand artifact for any "prove it" moment.

It reads the analysis record, query log, bounded result previews, findings manifest, action log, and reconciler.

Steps

  1. Resolve the analysis. Read the current analysis record:

    bash
    python3 -c "
    import sys; sys.path.insert(0, '.')
    from helpers.knowledge.analysis_context import current_analysis
    print(current_analysis() or '')
    "

    If there is no current analysis, there is nothing to trace yet. Say so and stop (or, for a past run, point build_trace at that analysis_id explicitly).

    Interactive analysis provenance always remains under the repository's top-level working/ directory. The analysis output directory is only where the shareable HTML and written review go. Do not create or copy another current-analysis.json, and do not relocate the query log.

  2. Verify the findings manifest. If reported numbers were not registered, do not pretend a trace exists. Read the saved analysis and query log, then register each reported number with the exact supporting query IDs. Record derived values with their formula and source finding IDs. Never label a timestamp-only guess as a verified link.

  3. Build + render the trace. Use the lifecycle command so all inputs come from the canonical provenance store and the HTML goes to the recorded output directory:

    bash
    python3 scripts/analysis_trace.py build

    This also writes working/provenance_<analysis_id>.json and working/trace_receipt_<analysis_id>.json.

  4. Open and share it. Open the HTML locally when the environment supports that action. Always report the exact path as a deliverable so the user can open or share it. Do not merely say that the trace was generated. It is self-contained and projection-friendly, with large type, collapsible SQL, and colored confidence badges.

    Leave the active marker in place. The next start command replaces it with a fresh id. Do not delete it at the end of the trace.

  5. Read it out. Walk the findings top to bottom: the number, its badge, the SQL. Call out anything unmatched (a number with no query behind it). That is the honesty check and the thing to fix.

Show full SKILL.md (69 more words)Show less

Notes

  • Confidence is itself provenance. A cited link is strongest because the finding names the query. A value-match is supporting evidence because the captured scalar or structured result contains the number. inferred is a hint, not proof, so say so when reading it out.
  • Teaching tie-in. This is the concrete answer to "how do I know the agent didn't make the number up?" Pair it with the provenance-chain diagram.

© ai-analyst-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/trace of ai-analyst-lab/ai-analyst.

Open the folder on GitHubat commit 52c0744

Compare with similar skills

Trace next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trace compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trace this skillai-analyst-lab/ai-analyst304—~851Automated safety check: PassMIT
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
SQL Optimization Patternsynulihao/AgentSkillOS61710 repos~3.3kAutomated safety check: PassNone
SQL PortabilityHL7/sql-on-fhir150—~512Automated safety check: PassCustom licence
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone
Contact FilterChatbotXIO/ChatbotX878—~2.5kAutomated safety check: PassCustom licence

Similar skills

  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 10 repos~3.3k tokens
    DatabasesAuto-check passed
  • SQL Portability

    HL7/sql-on-fhir

    Analyse whether a SQL query is portable across database implementations using sqlglot transpilation.

    150 GitHub stars~512 tokensUpdated yesterday
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Contact Filter

    ChatbotXIO/ChatbotX

    Work with the ChatbotX contact filter system — the shared filter model behind the contacts list, conversations, and broadcast audiences.

    878 GitHub stars~2.5k tokensUpdated today
    DatabasesAuto-check passed
  • Add Utils Function

    MichealWayne/fe-tools

    Add or modify utility functions in fe-tools. An agent skill from MichealWayne/fe-tools.

    207 GitHub stars~602 tokensUpdated 29 days ago
    DatabasesAuto-check passed

More from ai-analyst-lab/ai-analyst

All 43 skills in this repo
  • Always Compare

    ai-analyst-lab/ai-analyst

    Never present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available.

    304 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Archaeology

    ai-analyst-lab/ai-analyst

    Retrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused.

    304 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Archive Analysis

    ai-analyst-lab/ai-analyst

    Save completed analyses to the knowledge system's analysis archive for future reference.

    304 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Auth Preflight

    ai-analyst-lab/ai-analyst

    Verify Google Workspace MCP authentication at the start of any session that needs Google APIs (Docs, Slides, Drive).

    304 GitHub stars~3.1k tokensUpdated 7 days ago
    Auto-check passed
  • Causal

    ai-analyst-lab/ai-analyst

    Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

    304 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Chart To Drive

    ai-analyst-lab/ai-analyst

    Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides.

    304 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about Trace

What does Trace do?

Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge. Trace is an agent skill from ai-analyst-lab/ai-analyst. Show the provenance trace, linking every reported number to the SQL that produced it with a confidence badge.

When should I use Trace?

Trace fits situations like: tasks that involve SQL.

How do I install Trace in Claude Code?

Run `npx skills add ai-analyst-lab/ai-analyst --skill trace -a claude-code`. Or copy the skill folder (.claude/skills/trace in ai-analyst-lab/ai-analyst) into .claude/skills/trace in your project. Claude Code loads it when a task matches its description.

How do I install Trace in Codex?

Run `npx skills add ai-analyst-lab/ai-analyst --skill trace -a codex`. Or copy the skill folder (.claude/skills/trace in ai-analyst-lab/ai-analyst) into .agents/skills/trace in your project. Codex loads it when a task matches its description.

Can I use Trace in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ai-analyst-lab/ai-analyst --skill trace -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trace, .gemini/skills/trace, .github/skills/trace and .opencode/skills/trace in your project.

What does Trace need to run?

Going by SKILL.md and its folder, Trace needs the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Trace access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trace safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trace use?

Trace is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trace use?

About 851 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Trace?

Skills that share tags, products or a category with Trace: Evolving The Data Model (TriliumNext/Trilium, 38k stars), SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), SQL Portability (HL7/sql-on-fhir, 150 stars) and DB Migrations (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trace?

ai-analyst-lab (a GitHub organization) maintains it in ai-analyst-lab/ai-analyst, which has 304 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on September 30, 2026.

Source: ai-analyst-lab/ai-analyst on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.