> For the complete documentation index, see [llms.txt](https://triton.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triton.pharos.ai/instrumentation-skills/instrumentation-agent.md).

# The Triton Instrumentation Agent

The whole instrumentation skill catalog behind one portable, agent-agnostic persona you point at a Salesforce org to audit, migrate, instrument, and guard it.

The individual skills each do one job. The **Triton Instrumentation Agent** is what you get when you package them behind a single persona: *"Here's my org — instrument it."* It's not a new engine and not a new product — it's the [skill catalog](https://triton.pharos.ai/instrumentation-skills.md#the-skill-catalog) plus a bit of orchestration glue, delivered in whatever form your coding agent understands.

Think of it as the answer to "would an agent be better than a pile of commands?" — yes, when the goal is a full rollout. You hand it a project; it decides what to run and in what order, checking in with you at the boundaries.

{% hint style="info" %}
**Agent-agnostic by construction.** The agent is just three portable pieces — a **system prompt** (the persona and guardrails), the **shared playbook** (the Triton conventions the skills already encode), and a **tool allow-list** (read files, run `sf`/`grep`, write files on approval). Any framework that accepts those runs it. There's no dependency on a specific vendor.
{% endhint %}

## What it bundles

| Framework              | How the agent ships                                                          |
| ---------------------- | ---------------------------------------------------------------------------- |
| **Claude Code**        | A subagent/persona plus the `/pharos:*` commands as its toolbelt.            |
| **Cursor**             | A custom mode (or an `AGENTS.md` persona) with the skills as rules/commands. |
| **Codex CLI / OpenAI** | An `AGENTS.md` describing the persona and the skill files it may follow.     |
| **Windsurf / others**  | A system prompt plus the skill Markdown, loaded as project context.          |
| **Any agent**          | Paste the persona prompt and point it at the skill files and the repo.       |

Because all five share the same playbook, the agent behaves identically wherever it runs — the only thing that changes is how you launch it.

## What it does, end to end

The agent runs the full workflow the separate skills perform, in order, so you don't have to sequence them yourself:

1. **Audit** — runs [`audit-logging`](https://triton.pharos.ai/instrumentation-skills/audit-logging.md) read-only and presents the coverage report and a proposed plan.
2. **Migrate** — where the audit found `Triton.instance`, runs [`migrate-to-2.0`](https://triton.pharos.ai/instrumentation-skills/migrate-to-2.0.md), surfacing every immediate-vs-buffered decision for you.
3. **Instrument** — drives [`instrument-org`](https://triton.pharos.ai/instrumentation-skills/instrument-org.md) through the prioritized phases, one Area per feature, stitching transactions across LWC → Apex → Flow, with a review checkpoint per batch.
4. **Guard** — offers [`setup-standards`](https://triton.pharos.ai/instrumentation-skills/setup-standards.md) to wire the hard findings into CI so the work can't regress.
5. **Report** — leaves you a coverage summary and a list of anything it deferred for a human.

{% hint style="success" %}
**The "point at an org, instrument everywhere" experience.** This is the highest-leverage way to use Triton's tooling: one persona, one instruction, a whole org instrumented consistently — and still a human approving every batch before it's written or deployed.
{% endhint %}

## Guardrails baked into the persona

The persona isn't "instrument aggressively." It carries the same discipline the docs preach, so autonomy never becomes recklessness:

* **Human-in-the-loop stays.** It approves changes at batch boundaries; it never writes hundreds of files unattended.
* **Do no harm on legacy code.** It respects the [comfort tiers](https://triton.pharos.ai/triton-best-practices/legacy-migration.md#start-by-assessing-your-comfort-with-the-code) — minimal edits to old, untested, business-critical code, and it defers rather than rewrites when unsure.
* **One mechanism per call chain.** It keeps transaction stitching consistent (param *or* cache, not both) across the LWC/Apex/Flow legs of a feature.
* **Real taxonomy, upgrade-safe.** It reuses existing Areas, and steers org-specific values to `String` constants rather than editing the shipped enums (see [Custom Classifications](https://github.com/Pharos-AI/triton-docs/tree/release/2.0/core-concepts/custom-classifications.md)).
* **Never lets logging throw.** It follows the [risk-mitigation patterns](https://triton.pharos.ai/triton-best-practices/legacy-migration.md#risk-mitigation) — feature flags and guarded logging calls in the riskiest code.

## When to reach for it (vs. a single skill)

| Situation                                             | Use                                                                                                           |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| One class/component/flow to instrument                | The matching [per-technology skill](https://triton.pharos.ai/instrumentation-skills.md#the-skill-catalog).    |
| A feature or folder                                   | [`instrument-org`](https://triton.pharos.ai/instrumentation-skills/instrument-org.md) scoped to that subtree. |
| A whole org, or a repeatable rollout across many orgs | **The agent.**                                                                                                |
| Just want to see the gaps                             | [`audit-logging`](https://triton.pharos.ai/instrumentation-skills/audit-logging.md).                          |

## Where to go next

* [Instrument the Org](https://triton.pharos.ai/instrumentation-skills/instrument-org.md) — the orchestrator at the agent's core.
* [Audit Logging Coverage](https://triton.pharos.ai/instrumentation-skills/audit-logging.md) · [Migrate to 2.0](https://triton.pharos.ai/instrumentation-skills/migrate-to-2.0.md) · [Set Up Standards](https://triton.pharos.ai/instrumentation-skills/setup-standards.md) — the stages the agent sequences.
* [Legacy Code Logging Rollout](https://triton.pharos.ai/triton-best-practices/legacy-migration.md) — the strategy the persona is built to follow.
* [Spans & Distributed Tracing](https://triton.pharos.ai/end-to-end/spans-and-tracing.md) — the correlated, OTEL-ready shape the agent rolls out everywhere.
