For the complete documentation index, see llms.txt. This page is also available as Markdown.

Audit Logging Coverage

The audit-logging skill scans a Salesforce project read-only, reports where Triton logging is missing or wrong, and produces a prioritized rollout plan.

The audit-logging skill answers the question you have before any rollout: how bad is it, and where do I start? It reads a project without writing anything and produces two things — a coverage report (what's instrumented, what isn't, and what's wrong) and a prioritized plan you can hand straight to instrument-org.

It's the read-only sibling of the instrumentation skills. Nothing it finds is changed; it only tells you what it found.

Invocation is agent-specific. In agents that support slash commands (Claude Code, Cursor) you invoke it as /pharos:audit-logging <path>; in others you point the agent at this skill and a directory. See Running these in your agent.

Usage

/pharos:audit-logging [<path>] [--format md|json] [--fail-on error,debug] [--tech apex,lwc,flow]
Argument
Required
Meaning

<path>

Project root or subtree. Defaults to the detected project root.

--format

md (default, human-readable) or json (machine-readable, for CI).

--fail-on

Exit non-zero when a given class of finding is present — for use as a CI gate.

--tech

Restrict to some technologies. Defaults to all three.

What it checks

The checks mirror the Standards Enforcement review checklist, sorted into hard failures (a machine can be certain) and judgment calls (flagged for a human).

Hard findings — unambiguous

Finding
Why it matters

System.debug in application code

Invisible telemetry — should be a Triton.debug(...).

Triton.instance usage

The removed 1.x singleton; its presence means un-migrated code. Route it to migrate-to-2.0.

Catch-but-not-logged

A catch block with no Triton call — the most common way errors go dark.

Missing flush at a boundary

A method that buffers logs but has no Triton.flush() at the end of the handler/execute/finally.

Un-logged entry points

@AuraEnabled, REST, Queueable execute, Batch start/finish with no logging at all.

Flow fault paths with no Log action

A <faultConnector> with no TritonFlow action — unhandled Flow errors going unseen.

Judgment findings — flagged, not failed

  • Ad-hoc taxonomy strings — .area('...') / .type('...') literals where an enum value exists, hinting at drift.

  • Honesty of levels — ERROR used for non-failures, or loop chatter above FINE.

  • Missing context — record-oriented logs with no .relatedObject(s); callouts with no .integrationPayload(...).

  • Low-comfort code — old, untested, business-critical files that a rollout should treat gently (see the comfort tiers).

  • Publishes in managed-package-object triggers — Triton.logNow(...), Triton.flush(), or Triton.flushTop() on a path reached from a trigger on another package's object (an SObject name carrying that package's namespace). The write belongs to the package, often under an integration user you can't test as. Triton 2.0.0 and later never throws on a failed publish, but an exhausted governor limit still fails the write, and a copy of Triton vendored before 2.0.0 does throw. The audit notes the Triton version it found and recommends Triton.log(...) plus one Triton.flush() as the handler's last statement, and the restricted-user test from Instrument Apex.

The audit uses the same static, grep-level signals the CI guardrails use, plus structural analysis (it parses classes and flows, not just text). The hard findings are exactly what you'd want to block in CI; the judgment findings are what a reviewer should eyeball.

The report

The default Markdown report leads with a scoreboard, then the prioritized plan, then the detail.

The json format emits the same data as structured findings (file, line, rule, severity) so you can gate CI or feed a dashboard.

Where this fits

audit-logging is the front door of the whole workflow:

  1. Audit — run this, read the report. (read-only)

  2. Fix version drift — migrate-to-2.0 on anything using the 1.x singleton.

  3. Instrument — instrument-org works the prioritized plan.

  4. Lock it in — setup-standards wires the hard findings into CI so gaps can't creep back.

Where to go next

Last updated