agentleFS
ai-analyst-labai-analyst-lab/ai-analyst/.claude/skills/trace/SKILL.md

trace

Skill304 starsChanged 3 months agoMITView on GitHub

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?

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use visual-verdict, ai-slop-cleaner and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lza6Skill

    visual-verdict

    Structured visual QA verdict for screenshot-to-reference comparisons

    Also in 3 projects that use this

  • lza6Skill

    ai-slop-cleaner

    Run an anti-slop cleanup/refactor/deslop workflow

    Also in 3 projects that use this

  • the-huginSkill

    configure-notifications

    Configure notification integrations (Telegram, Discord, Slack) via natural language

    Also in 3 projects that use this

  • an8079Skill

    hud

    Also in 3 projects that use this

  • an8079Skill

    ralplan

    Also in 3 projects that use this

  • jihe520Skill

    doctor

    环境检查与安装向导。检查数学建模工作流所需的全部依赖是否已安装,对缺失项提供安装命令,并在用户确认后执行安装。手动触发。

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 3

    Distinctive

    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:

    Resolve the analysis: Read the current analysis record:

    line 19
  2. Very specific:

    If there is no current analysis, there is nothing to trace yet.

    line 27
  3. Distinctive:

    Verify the findings manifest: If reported numbers were not registered, do not pretend a trace exists.

    line 35
  4. Distinctive:

    Build + render the trace: Use the lifecycle command so all inputs come from the canonical provenance store and the HTML goes to the …

    line 41
  5. Very specific:

    Leave the active marker in place.

    line 55

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “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

/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:

    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:
    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.

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.

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.