/wire:dbt-migration-validate <release-folder> [--batch N]from wire
Validates that dbt model translations compile correctly on the target database profile. Accepts a release folder and optional batch size.
Ships in wire. Installing the plugin adds it to Claude Code.
$ARGUMENTS
.wire (project data and status files)When following the workflow specification below, resolve paths as follows:
.wire/ in specs refers to the .wire/ directory in the current repositoryTEMPLATES/ references refer to the templates section embedded at the end of this commandspecs/<path>.md references are shared workflow docs shipped with this plugin — read them from ${CLAUDE_PLUGIN_ROOT}/specs/<path>.md. If the path matches a Wire command (e.g. specs/requirements/generate.md), it means that command (/wire:requirements-generate) and its spec is already embedded in the command file.execution_log.md records one terse row per whole command (timestamp, command, result, a detail string capped at 120 characters). That's enough for a normal audit trail, but it can't answer "what actually happened inside that command, step by step" — which specific files it read, what it inferred, what it proposed, what a consultant decided, why. Tracing exists for engagements that want that depth: a complete, structured, append-only record of every step of every command, scoped to the release and release type it ran under.
Off by default. Tracing never runs unless WIRE_TRACE=true is set in the shell environment. If it isn't, skip this entire section — do nothing, check nothing further, proceed straight to the Workflow Specification exactly as if this section didn't exist. This is the common case and must add zero overhead.
.wire/releases/<release_folder>/trace.jsonl — one JSON object per line (JSON Lines), append-only, alongside that release's status.md and execution_log.md.
For commands not scoped to a specific release (cross-cutting utilities with release_types: [] in their own front-matter, or any command whose argument isn't a release folder), write to .wire/trace.jsonl at the engagement level instead, with release and release_type fields set to null.
This file is local only — nothing in it is ever sent anywhere, unlike the anonymous Segment telemetry event described elsewhere. It stays on the consultant's machine, inside the engagement's own repo, exactly like execution_log.md.
If WIRE_TRACE=true:
release_type (read .wire/releases/<release_folder>/status.md's project_type or release_type field). If this command has no release-folder argument, both are null.command_start event before beginning the Workflow Specification below.step event after completing each one — and where a step itself has meaningfully distinct numbered sub-parts (e.g. "check location A, then location B, then infer a match, then propose it"), treat each of those as its own step event too rather than collapsing them into one. The detail field has no length limit and is not a summary — write what actually happened: values found, files read, decisions made and why, what was proposed and what the consultant chose. If this step involved the data model registry or any other external/optional resource, log it explicitly: whether it was reached, what was searched, what matched (or didn't, and why not), and whether/how the result was used downstream.command_end event when the workflow finishes, with the same result value this command would write to execution_log.md (complete, pass, fail, approved, etc.).Use this pattern for every event (adjust the heredoc body and the Python literals per call — this is a template, not a fixed script):
[ "${WIRE_TRACE:-false}" = "true" ] && {
mkdir -p ".wire/releases/<release_folder>" 2>/dev/null
cat > "/tmp/wire_trace_detail_$$.txt" << 'WIRE_TRACE_DETAIL_EOF'
<the full, untruncated detail text for this event — safe to include quotes,
newlines, code snippets, anything; this heredoc is not shell-interpreted>
WIRE_TRACE_DETAIL_EOF
python3 -c "
import json, datetime
detail = open('/tmp/wire_trace_detail_$$.txt').read().rstrip('\n')
event = {
'ts': datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'),
'release': '<release_folder_or_null>',
'release_type': '<release_type_or_null>',
'command': 'dbt-migration-validate',
'event': '<command_start|step|command_end>',
'step': '<step_number_or_null>',
'step_name': '<step_heading_or_null>',
'result': '<result_value_or_null>',
'detail': detail,
}
with open('.wire/releases/<release_folder>/trace.jsonl', 'a') as f:
f.write(json.dumps(event) + chr(10))
"
rm -f "/tmp/wire_trace_detail_$$.txt"
}
<release_folder_or_null> / <release_type_or_null>: from Step 1 above; write the literal JSON null (no quotes) if either doesn't apply, or a quoted string if it does.event: command_start, step, or command_end.step / step_name: null for command_start/command_end; the step's own number (e.g. "1.5") and heading (e.g. "Check for a Canonical Vertical Match") for a step event.result: null except on command_end.open(...) call to .wire/trace.jsonl for engagement-level (non-release-scoped) commands.trace.jsonl.execution_log.md and Telemetry, not a replacement for either. All three continue exactly as documented elsewhere; tracing is a separate, optional, much finer-grained record for engagements that opt in.execution_log.md is that it isn't limited to a 120-character line — write the real detail.{"ts":"2026-07-05T14:20:03Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"command_start","step":null,"step_name":null,"result":null,"detail":"Invoked for release 20260705_acme (full_platform)"}
{"ts":"2026-07-05T14:20:11Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"step","step":"1.5.1","step_name":"Resolve the registry location","result":null,"detail":"Checked wire/data-model-registry/ (not found — not the Wire source repo). Checked ~/.wire/data-model-registry/ (found — cloned via /wire:utils-data-model-registry-setup on 2026-07-01)."}
{"ts":"2026-07-05T14:20:19Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"step","step":"1.5.2","step_name":"Resolve the vertical","result":null,"detail":"No confident vertical match for Acme (B2B SaaS, no dedicated saas vertical in the registry). Adjacent match found: subscription-commerce — entity shape (subscriber, subscription, subscription_event, monthly_retention, subscription_revenue) proposed as a structural analogue for Acme's MRR/NRR model."}
{"ts":"2026-07-05T14:20:34Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"step","step":"1.5.3","step_name":"Check cross-vertical patterns","result":null,"detail":"crm_identity_resolution flagged as relevant — requirements FR-12 describes reconciling Salesforce and HubSpot contact records, a 12% mismatch rate noted in discovery. Proposed alongside the subscription-commerce adjacent match."}
{"ts":"2026-07-05T14:21:02Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"step","step":"1.5.4","step_name":"Propose and record decision","result":null,"detail":"Presented both proposals. Consultant chose 'adapt' on subscription-commerce (kept subscriber/subscription/subscription_revenue, dropped monthly_retention as out of scope for this phase, renamed subscription_event to billing_event to match client terminology) and 'yes' on crm_identity_resolution as-is. Recorded data_model_registry.vertical: subscription-commerce and cross_vertical_schemas: [crm_identity_resolution] in .wire/engagement/context.md."}
{"ts":"2026-07-05T14:34:47Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"step","step":"5","step_name":"Carry reference pointers forward","result":null,"detail":"account_dim mapped to subscription-commerce's subscriber entity — generation_constraints and reference_implementation pointer carried into data_model_specification.md. subscription_fct mapped to subscription entity, same treatment. contact_identity_map (new, from crm_identity_resolution) added as its own integration model with that pattern's reference_implementation pointer."}
{"ts":"2026-07-05T14:41:15Z","release":"20260705_acme","release_type":"full_platform","command":"data_model-generate","event":"command_end","step":null,"step_name":null,"result":"complete","detail":"Generated data_model_specification.md — 14 models (5 staging, 4 integration, 5 warehouse), including 2 informed by the accepted registry proposals above."}
wire_schema: "1.0" command: validate artifact: dbt_migration domain: migration release_types:
Follow specs/utils/precondition_gate.md before proceeding.
Validates that translated dbt models compile and pass basic structural checks against the target platform profile, and — when a target profile is accessible — that they build cleanly across every rendered code path a model can take at deploy time, not just a single default-target full-refresh compile. A dbt parse/dbt run pass on the default path is exactly what lets branch-only and test-only defects reach the client PR (see Check 5). Optionally runs dbt build (not dbt run) if the target profile is accessible.
--batch N — validate batch N only (default: current_batch in status.md). Reads dbt_audit.csv's batch_number — the topological, finer-grained translation batch.--wave <id> — the intended execution unit for a normal run. Validate every dbt-model row migration/migration_batching.csv assigns to this wave (batch_id), cross-referenced against dbt_audit.csv for the actual model set — see Step 0w below. Accepts zero-padded (B01) or bare (1) forms, normalised identically to dbt_migration-generate's and dbt_migration-lint's --wave. Wave-id form and normalisation are the shared contract in specs/utils/wave_resolution.md (normative; accepts 2, B02, b2, or the W02 display form). --wave and --batch read different numbering schemes — abort if both are supplied: [wire] --wave and --batch read different numbering schemes and cannot be combined. Pick one.--macros — validate the batch-zero macro pass (/wire:dbt-migration-generate --macros) instead of a model batch. See Macro Mode Checks below. Standalone scope — abort if combined with --batch or --wave.--snapshots — targeted snapshot scope. --snapshots (bare) validates every snapshot object-type node (object_type = snapshot in the migration register / audit/dbt_snapshots.csv); --snapshots name1,name2 only the named snapshots. Selection resolves against the snapshot object-type rows, never the model selector. When this is the scope, run only Check 9 (the snapshot three-layer gate) over the selected snapshots and skip the model checks (Checks 1–8). This is the retrofit companion to dbt-migration-generate --snapshots. Normal --batch/--wave runs still run Check 9 over any in-scope snapshot inline; --snapshots is an additional targeted scope, not the only path. Standalone scope — abort if combined with --batch, --wave, --model, --models, --select, --exclude, or --macros: [wire] --snapshots is a standalone scope. Run it on its own; do not combine with --batch/--wave/--model/--models/--select/--exclude/--macros. See Step 0s below.--config <path> — load a per-run config overlay file overriding status.md-sourced fields (migration.dbt_project_path, migration.target_platform, etc.) for this invocation only — never written back to status.md. Mirrors dbt_migration-generate's --config overlay exactly; see that spec's Config overlay section. Orthogonal to scope.--tag-map <path> / --target-dataset <name> / --dbt-project-path <path> — discrete single-field overlay shorthands (for migration.pii_tag_map_path / migration.target_schema / migration.dbt_project_path respectively). Mirror dbt_migration-generate's equivalents exactly; see that spec's Config overlay section.If --config <path> and/or --tag-map/--target-dataset/--dbt-project-path were supplied, load them exactly as dbt_migration-generate Step 0c describes — in-memory for this invocation only, data_safety.production_projects never overridable, discrete flags winning over --config on a per-key basis. Resolve the dbt project(s) at migration.dbt_project_path (or the overlay's equivalent) via specs/utils/dbt_manifest_parse.md Steps 1–2 (nested/multi-project aware) rather than assuming a single project directly at that path — this is what Check 5's dbt compile needs to run from the correct project directory in a monorepo, and what any check below needing the source manifest (e.g. resolving a model's source layer) reads from.
--wave (only when --wave is used)Identical resolution to dbt_migration-generate's Step 1w: normalise the wave id, load migration/migration_batching.csv (abort if missing), filter to rows where batch_id matches and object_type is dbt_model, cross-reference object_id against dbt_audit.csv's model_name to get the actual model set, and print the resolved-model preview before validating. The resolved set replaces "the batch" in every check below — Checks 1–9 run over it exactly as they run over a --batch-resolved set.
--snapshots (only when --snapshots is used)Resolve the selected snapshots against the snapshot object-type nodes only — the object_type = snapshot rows in migration/migration_register.csv, cross-referenced to audit/dbt_snapshots.csv. Never resolve against dbt_audit.csv's model rows or the model selector. Bare --snapshots selects every snapshot node; --snapshots name1,name2 selects only the named ones (a name that does not resolve to a snapshot node is listed as unresolved: [wire] --snapshots: "<name>" is not a snapshot object-type node — check audit/dbt_snapshots.csv.). Abort with [wire] No snapshots matched --snapshots. Aborting. if the resolved set is empty. Print the resolved-snapshot preview before validating. In this scope only Check 9 runs, over the resolved snapshot set — Checks 1–8 (the model checks) are skipped.
Every check below reads "the batch" as whichever model set is in scope for this run — the --batch-resolved set, or the --wave-resolved set from Step 0w. The checks themselves are identical either way; only the resolved model list differs.
Check 1 — Translated files exist for all models in batch
Every model in the batch has a corresponding translated .sql file in migration/dbt/.
PASS/FAIL with gaps.
Check 2 — No source-platform-specific functions remain Scan translated SQL for functions that exist only on the source platform (using feature_detection patterns). Any remaining source-platform functions that should have been translated are a FAIL. PASS: No source-platform-only functions found. FAIL: List functions and models.
Check 3 — MANUAL REVIEW flags tracked
Every -- MANUAL REVIEW comment in the translated SQL is listed in the batch summary file.
PASS: All flags tracked.
FAIL: Flags found in SQL not in summary.
Check 4 — Jinja syntax is valid Scan translated Jinja for obvious syntax errors (unclosed tags, undefined variables). PASS: No Jinja syntax errors. FAIL: List models with errors.
Check 5 — Build across every rendered code path (if target profile available)
If ~/.dbt/profiles.yml has a profile matching migration.target_platform, exercise all code paths a model can take at deploy time, not just one default-target full-refresh compile. Run everything below from whichever project directory Step 0 resolved for these models (a monorepo may resolve different models to different projects — run once per project the in-scope set touches, not once against a single assumed project root). Each sub-check is independently a FAIL; a model passes Check 5 only when every applicable sub-check passes.
5a — Compile under every target profile the project defines. Discover the target names — do not hardcode dev/prod. Read every entry under the resolved dbt profile's outputs: in profiles.yml, unioned with any target name referenced in the models/dbt_project.yml (e.g. {% if target.name == '...' %}). At minimum a dev and a prod-like target must be exercised; if the project defines only one, note "single target defined — cannot exercise target.name branches" so the reduced coverage is visible rather than assumed. For each discovered target T, run dbt compile --select <in-scope models> --target T --profiles-dir ~/.dbt. This is what catches a branch gated on target.name (e.g. a dev-only filter that references a SELECT alias or an unsupported function signature) — never compiled by a single-target run.
PASS: every in-scope model compiles under every discovered target. FAIL: list the model, the target, and the compile error.
5b — Incremental models: build twice (initial then incremental). For every in-scope model whose resolved config is materialized: incremental, run once to seed the relation (full refresh) and then again without --full-refresh, so the is_incremental() branch and its predicate are actually rendered and executed — a single build only ever renders the initial (non-incremental) branch.
PASS: both runs succeed for every incremental model. FAIL: list the model and which run (initial / incremental) failed, with the error. Note "no incremental models in scope" when none apply.
5c — dbt build, not dbt run, so tests execute. Run dbt build --select <in-scope models> --target <prod-like target> --profiles-dir ~/.dbt (build = run + test + snapshot + seed) so generic and singular tests execute. dbt parse and dbt run never execute tests, so an unported test macro, or a test referencing an unresolved var/macro, passes parse and fails only at build — on the client's CI. Fail if any referenced test, macro, or var is unresolved, or any test fails.
PASS: build succeeds and all tests pass. FAIL: list the failing/unresolved test, macro, or var per model.
If the target profile is not available, note "Check 5 skipped — target profile not configured" (not a FAIL) and record it as a coverage gap, since none of 5a–5c ran.
Check 5 coverage report. Emit a per-model coverage table into the batch/wave summary so a reviewer sees coverage rather than assuming it — one row per in-scope model with: targets compiled (5a, list the target names), incremental second run done (5b: yes / n/a), tests run (5c: count run / passed). A model with an empty coverage cell is not "clean", it is "unchecked on that surface" — say so explicitly.
Check 6 — Diff files exist
Every model in the batch has a .diff.md side-by-side diff file.
PASS/FAIL.
Check 7 — Companion schema/properties YAML handled For every model in the batch that has a companion schema/properties YAML in the source project, the translation covers it:
sources.yml referenced by the batch resolves to the target namespace (parameterised database/schema, or repointed) — not left pointing at the source platform.where: filters, and dbt_utils/dbt_expectations arguments containing source-dialect SQL are translated (no source-platform-only functions remain in test SQL — same scan as Check 2, applied to tests).policy_tags / masking meta is either authored into the YAML (dbt-managed) or explicitly recorded in the batch summary as deferred to the security workstream — not silently dropped.
PASS: All companion-YAML items handled or explicitly deferred. FAIL: List models with an un-repointed sources.yml, untranslated test SQL, or dropped policy-tag/meta config.Check 8 — Cross-market Bronze-column substitutions are flagged, not silently dropped
This is the companion check to dbt_migration-generate Step 3.1 item b (the Bronze-schema existence check). For every translated model in the batch:
CAST(NULL AS <type>) carrying a -- MARKET GAP: inline comment (the marker dbt_migration-generate emits when a source column doesn't exist in every in-scope market).-- MARKET GAP: comment in the SQL — a gap recorded in the summary but not flagged inline (or vice versa) is a defect either way.
PASS: every substitution is present in the SQL and tracked in the summary, and every tracked entry has a matching inline flag. FAIL: list models where the SQL and the summary disagree, naming the column and market. If migration.target_markets was unset for this engagement (Step 3.1 item b's single-market skip), note "not applicable — single-market engagement" rather than running the scan.Check 9 — Snapshot three-layer gate (SELECT-only row-equivalence is not sufficient)
For every snapshot in scope (an object_type = snapshot row in the migration register / audit/dbt_snapshots.csv), a plain row-equivalence check on a SELECT is explicitly rejected as the pass criterion — it cannot see SCD-2 continuity. A snapshot passes only when all three layers pass; each layer independently gates. Read the SCD meta-column set and types from the active pair's "Snapshot SCD mechanisms" section.
T. The target snapshot relation matches the source at the baseline: schema including the four SCD meta columns (dbt_scd_id, dbt_updated_at, dbt_valid_from, dbt_valid_to) and their ordinal order (payload first, meta columns at the tail in that order), row count, and a row-level checksum over the same pinned row set. For rebuild_from_T snapshots (recorded sign-off), copy-parity is not expected — assert instead that the target started fresh at T and record the sign-off reference.dbt snapshot adopt-and-continue run: an unchanged upstream row opens no new version; a changed upstream row opens exactly one new version (prior version's dbt_valid_to closed, new version dbt_valid_to NULL); a hard-deleted upstream row is invalidated when invalidate_hard_deletes: true; and a second dbt snapshot run is idempotent (no new versions on unchanged input).dbt_scd_id is unique across the relation; unique_key and dbt_valid_from are not null; there is no more than one open version (dbt_valid_to IS NULL) per unique_key. Overlapping open versions per key is a FAIL.PASS: every in-scope snapshot passes 9a, 9b, and 9c. FAIL: name the snapshot and the failing layer(s); a snapshot passing only a SELECT row-equivalence but failing any layer is a FAIL, not a pass. Note "no snapshots in scope" when none apply.
--macros)Run these instead of Checks 1–9 when --macros is supplied. Ground truth is audit/batch_zero_plan.json (the layer: macro, action: translate entries), re-read here rather than trusted from generate's summary.
Check M1 — Every macro-layer entry has a translated file
For every layer: macro, action: translate entry in batch_zero_plan.json, a translated definition exists under migration/dbt/macros/ at the mirrored relative path. UDF-layer entries are explicitly out of scope (they are validated by /wire:target-setup-validate).
PASS/FAIL with gaps.
Check M2 — No source-platform-specific functions remain in macro bodies Same scan as Check 2, applied to the translated macro files. PASS/FAIL with functions and macros listed.
Check M3 — Tier order is respected
No translated macro references the source-dialect form of a lower-tier macro it depends on — a tier-N macro must call the already-translated tier-<N version. Rebuild the dependency tiers from batch_zero_plan.json.
PASS/FAIL with violations listed.
Check M4 — MANUAL REVIEW flags and deferrals tracked
Every -- MANUAL REVIEW comment in a translated macro, and every compile: deferred macro, is listed in batch_zero_macros_summary.md.
PASS/FAIL.
Check M5 — Diff files exist
Every translated macro has a .diff.md.
PASS/FAIL.
artifacts:
dbt_migration:
validate: pass | fail
validated_date: "{{TODAY}}"
batch_N_validate: pass | fail
macros_validate: pass | fail # set only when run with --macros
wave_validate: # set only when run with --wave, keyed by wave id
B01: pass | fail
check5_coverage: # Check 5 all-code-path coverage; skipped: true when no target profile
targets_compiled: ["dev", "prod"] # target names exercised in 5a
incremental_second_run: pass | n/a # 5b
tests_run: N # 5c — generic + singular tests executed via dbt build
skipped: false
After updating status.md, run these in sequence:
Execution log — Append one row to .wire/releases/$ARGUMENTS/execution_log.md following specs/utils/execution_log.md.
Jira sync — Follow specs/utils/jira_sync.md. Pass $ARGUMENTS as project_folder, dbt_migration as artifact, validate as action.
Document store — Follow specs/utils/docstore_sync.md. Pass $ARGUMENTS as project_folder, dbt_migration as artifact_id, dbt Migration as artifact_name, and the file value from artifacts.dbt_migration in status.md as file_path.
Auto-commit — Follow specs/utils/commit.md. Pass $ARGUMENTS as release_folder, dbt_migration as artifact, validate as action.
Execute the complete workflow as specified above.
After completing the workflow, append a log entry to the project's execution_log.md:
After completing any generate, validate, or review workflow (or a project management command that changes state), append a single log entry to the project's execution log file. Skills also append an entry on activation, making the log a unified trace of all agent activity — both explicit commands and auto-activated skills.
<DP_PROJECTS_PATH>/<project_folder>/execution_log.md
Where <project_folder> is the project directory passed as an argument (e.g., 20260222_acme_platform).
If the file does not exist, create it with the header:
# Execution Log
| Timestamp | Command | Result | Detail | By | Session | Duration | Tokens | Cost (USD) |
|-----------|---------|--------|--------|----|---------|----------|--------|------------|
Then append one row per execution:
| YYYY-MM-DD HH:MMZ | /wire:<command> | <result> | <detail> | <by> | <session> | <duration> | n/a | n/a |
Timestamp: Current date and time in UTC, written YYYY-MM-DD HH:MMZ
(24-hour, a literal Z after the minutes, no T, no seconds, no offset):
2026-10-17 14:05Z. Get it with date -u +"%Y-%m-%d %H:%MZ" (or
python3 <wire>/scripts/log_time.py now), never from the local clock. The
same form is used for every time written into a log row, including an
original time quoted in Detail (ran 2026-10-17 14:28Z), in the release log
and in ticket run logs. From Wire 4.4.3; see "Time zones" below.
Command: Either the /wire:* command invoked, or skill for a skill activation entry
Result / Skill name: For commands, the outcome; for skills, the skill identifier. Use one of:
complete — generate command finished successfullypass — validate command passed all checksfail — validate command found failuresapproved — review command: stakeholder approvedchanges_requested — review command: stakeholder requested changescreated — /wire:new created a new projectarchived — /wire:archive archived a projectremoved — /wire:remove deleted a projectactivated — a skill was auto-activated (used with skill in the Command column)override — specs/utils/precondition_gate.md recorded a consultant overriding an unmet precondition, or an advisory gate satisfied by a director's rulingmode — the director handed control over or took it back ("you drive" / "I'll drive"), per specs/utils/director_operating_model.mdblocked — specs/utils/precondition_gate.md Step 2 stopped the command on an unmet blocking precondition and the consultant chose not to override; Detail is gate: <dep_artifact>.<dep_action> required <outcome>, was <actual> and the Command cell carries the command in full. The Wire mod's commands band shows these rows as Not run: <command>, gate: <...>Detail: A concise one-line summary of what happened. Include:
By: the git user (git config user.name), or unknown if git has no
user configured. Who the run is attributable to, regardless of what typed it.
Session: what invoked the run. One of:
typed — a person typed the commandorchestrator — the orchestrating session dispatched it, followed by its
session id in brackets where one is available: orchestrator [a1b2c3]dbt-developer [staging 1/2]autopilot — /wire:autopilot ran itWhen a persona is set for the run (specs/utils/personas.md), add
as <persona> to the value: typed as delivery-manager,
orchestrator [a1b2c3] as delivery-manager. No persona: the value alone.
This is the same value the invoked_by telemetry property carries
(specs/utils/telemetry.md), read from WIRE_INVOKED_BY and defaulting to
typed. The log records it per row so the record on disk answers the same
question telemetry answers in aggregate.
Duration: Wall-clock time the workflow took. As the first action of the
workflow, run date +%s and note the value as the start time. When
appending the log row, run date +%s again and format the difference as
42s, 4m 12s, or 1h 03m. If the start time was not captured, write
n/a. Skill activation entries write n/a.
Tokens: Total model tokens the run consumed (input + output, including
cache reads and writes). Write the literal n/a — a model cannot measure
its own token usage, and an estimated figure must never be written. On
Claude Code, the Wire plugin's metrics hook backfills this cell with the
measured value from the session transcript after the turn ends (see
Metrics Backfill below). On runtimes without the hook (e.g. Gemini CLI)
the cell stays n/a.
Cost (USD): Estimated cost of the measured tokens, e.g. $0.42. Same
rule as Tokens: write n/a; the metrics hook backfills it where token
usage can be measured. Never compute or guess this yourself.
When a skill activates, it appends a row in the same format as commands, using skill in the Command column and the skill identifier in the Result column, with n/a in all three metric columns:
| YYYY-MM-DD HH:MMZ | skill | <skill-identifier> | activated | <brief trigger description> | <by> | <session> | n/a | n/a | n/a |
Skill identifiers:
| Skill | Identifier |
|---|---|
| Engagement Context | engagement-context |
| Research Persistence | research-persistence |
| dbt Development | dbt-development |
| LookML Content Authoring | lookml-authoring |
| dbt Analytics QA | dbt-analytics-qa |
| dbt Migration | dbt-migration |
| dbt Troubleshooting | dbt-troubleshooting |
| dbt Semantic Layer | dbt-semantic-layer |
| dbt Unit Testing | dbt-unit-testing |
| dbt DAG | dbt-dag |
| Dagster | dagster |
| Fivetran | fivetran |
| Project Review | project-review |
| Looker Dashboard Mockup | looker-dashboard-mockup |
This makes skill activations visible in the same log that captures command invocations, enabling full activity tracing across both explicit commands and automatic skill triggers.
Immediately after appending a command row (this does not apply to skill activation entries), perform a quick freshness check against the project's status.md. This is additive to the logging behavior above — it never blocks the calling command and never modifies status.md.
Process:
artifact_id from the command just logged: strip the /wire: prefix and the trailing -generate, -validate, or -review suffix (e.g. /wire:migration-inventory-generate → migration_inventory). If the command doesn't map to a recognizable artifact (e.g. /wire:new, /wire:status, /wire:archive), skip this check entirely.status.md: artifacts.<artifact_id>.review field (or equivalent approval field) shows pass, approved, or complete.artifacts.<artifact_id> block for a value that is still the literal string TBD, or an empty list ([]) / null where the artifact's own template expects a populated value (i.e. the field is not legitimately optional).⚠ status.md still shows `<field>: TBD` for `<artifact_id>` despite review: pass — status may be stale
Emit one warning per stale field — do not suppress after the first.Run /wire:status-sync <release-folder> to reconcile the record (see specs/utils/status_sync.md).
The offer is informational only — never block the calling command and never run the sync automatically.artifact_id could not be derived: no output, proceed silently.This check is self-contained within this utility, so every caller gets it automatically without any caller-side changes.
|, replace with — to preserve table formatting/wire:status-sync flags them, naming both rows. This does not block any
command — the log is written either way, and the flag is a repair prompt.
Rows are compared as "Time zones" below says.specs/utils/director_operating_model.md's operating model is in force,
only the orchestrating session appends to this file. Lanes write their own
state files and the orchestrator writes the log rows from them (rule 6 of
the operating model). Outside orchestrated mode, every command writes its
own row as it always has.status.md keys in place, then check the file. When a command
records a result in status.md, it changes the existing key; it never adds
a second copy of a key in the same block. A value worth keeping (an earlier
approval date) moves to a prior_<key> field or stays in this log, never
in a duplicate key, because YAML keeps only the last copy and ignores the
first without an error (wire-plugin#2). The same applies to anyone editing
the file by hand or by script. After writing status.md and before
appending the row, run python3 <wire>/scripts/status_file.py check .wire/releases/<release_folder>. If it reports a problem in a line this
command just wrote, fix it now. If the problem was there before, leave it,
say so in the output and point to /wire:status-sync <release_folder>
(specs/utils/status_sync.md Step 1b). In orchestrated mode the
orchestrating session runs the check when it writes status.md from a
lane's state file.n/a and only
ever filled by tooling that measured them. A best guess is worse than
n/a in a client-facing audit trail.Z suffix. A row is never written in local time, and a time
with no zone is never converted by guessing the zone it was written in.specs/utils/status_sync.md Step 4g: By is the approver, Detail says
recorded from PR #<n> approved by <name>, and Session is what ran the
roll-up.From Wire 4.4.3 every Timestamp is UTC, YYYY-MM-DD HH:MMZ. Before that the
rule said local time, and logs mixed UTC rows with rows in the writer's local
time, so a ticket could appear to close before it opened.
date -u +"%Y-%m-%d %H:%MZ". A row's time is the UTC time the
command finished. A roll-up row's Timestamp is the UTC time of the roll-up.YYYY-MM-DD HH:MM without Z is a row written
before 4.4.3. It stays valid, is never rewritten, and is read as "zone
unknown": it may be in any zone from UTC-12 to UTC+14.2026-10-17T14:05Z, 14:05+01:00, 14:05 BST) is
unparseable and reported as such./wire:status-sync Step 4f). Two rows in the same
form compare on the values written. A UTC row next to a zone-unknown row is
out of order only when no zone in that range puts the pair in order; when
some zones do and some do not, the pair is zone_unknown, listed for
information and not a defect. A log that changes from local time to UTC in
British summer time (15:05 then 14:10Z) is therefore not flagged.The rule is implemented in <wire>/scripts/log_time.py (now,
check <execution_log.md>), used by ticket_delivery.py merge-log and tested
by wire/tests/core/validate_execution_log_order.py. The Wire mod's metrics
backfill (below) reads both forms: it matches a row on its command and date,
with a day's slack, not on its time.
From 4.1.0 the Wire mod (hooks/register.ts, a function hook in the Claude
Code plugin) fills the metric cells. It replaces the Stop settings hook
(hooks/wire-metrics.sh and wire_metrics.py), which re-read the session
transcript after each turn.
/wire: command, or
a Wire command called through the Skill tool by the orchestrating session,
a lane or Autopilot.n/a), Tokens and Cost cells of the newest row
whose Command cell names the command, whose Tokens cell is still n/a, and
which is dated no earlier than the day before the run started (a date, not
a time, because commands write the row's time themselves and it is often
rough). It
never touches another cell or row, and never widens a row without the
metric columns.n/a with Tokens filled./wire-usage prints the session's runs with their duration, tokens and cost;
/wire-ran prints each run in full with its result (4.5.0), as the band above
the prompt draws it. The plugin's metrics option, or WIRE_METRICS=false,
turns the backfill off. On runtimes without the mod (Gemini CLI), the metric cells keep the
values the workflow wrote.
Logs written before the By and Session columns existed have four data
columns, and logs written before the Duration, Tokens, and Cost (USD)
columns existed have four or six. They stay valid and are never rewritten:
By, Session,
or metric column as unknown. It does not treat a shorter row as malformed
and does not backfill it.# Execution Log
| Timestamp | Command | Result | Detail | By | Session | Duration | Tokens | Cost (USD) |
|-----------|---------|--------|--------|----|---------|----------|--------|------------|
| 2026-02-22 14:30Z | skill | engagement-context | activated | Context loaded for new conversation | Jane Smith | typed | n/a | n/a | n/a |
| 2026-02-22 14:35Z | /wire:new | created | Project created (type: full_platform, client: Acme Corp) | Jane Smith | typed | 3m 40s | 84210 | $0.61 |
| 2026-02-22 14:40Z | /wire:requirements-generate | complete | Generated requirements specification (3 files) | Jane Smith | orchestrator [a1b2c3] | 18m 05s | 412876 | $3.18 |
| 2026-02-22 15:12Z | /wire:requirements-validate | pass | 14 checks passed, 0 failed | Jane Smith | orchestrator [a1b2c3] | 6m 22s | 156430 | $1.02 |
| 2026-02-22 16:00Z | /wire:requirements-review | approved | Reviewed by Jane Smith | Jane Smith | typed | 24m 10s | 98764 | $0.74 |
| 2026-02-23 09:15Z | /wire:conceptual_model-generate | complete | Generated entity model with 8 entities | Jane Smith | data-designer | 11m 48s | n/a | n/a |
| 2026-02-23 10:30Z | /wire:conceptual_model-validate | fail | 2 issues: missing relationship, orphaned entity | Jane Smith | data-designer | 5m 02s | n/a | n/a |
| 2026-02-23 11:00Z | /wire:conceptual_model-generate | complete | Regenerated entity model (fixed 2 issues, 8 entities) | Jane Smith | data-designer | 9m 31s | n/a | n/a |
| 2026-02-23 11:15Z | /wire:conceptual_model-validate | pass | 12 checks passed, 0 failed | Jane Smith | data-designer | 4m 47s | n/a | n/a |
| 2026-02-23 14:00Z | /wire:conceptual_model-review | changes_requested | Reviewed by John Doe — add Customer entity | Jane Smith | typed | 31m 20s | 122504 | $0.95 |
| 2026-02-23 15:30Z | /wire:conceptual_model-generate | complete | Regenerated entity model (9 entities, added Customer) | Jane Smith | data-designer | 8m 56s | n/a | n/a |
| 2026-02-23 15:45Z | /wire:conceptual_model-validate | pass | 14 checks passed, 0 failed | Jane Smith | data-designer | 4m 12s | n/a | n/a |
| 2026-02-23 16:00Z | /wire:conceptual_model-review | approved | Reviewed by John Doe | Jane Smith | typed | 12m 33s | 74902 | $0.58 |
| 2026-02-24 09:05Z | /wire:migration-strategy-generate | override | migration_inventory.review required approved, was not_started — overridden by Jane Smith: client demo tomorrow, inventory sign-off deferred to Monday | Jane Smith | typed | 2m 08s | 41207 | $0.33 |
| 2026-02-24 10:20Z | /wire:conceptual_model-generate | override | business_rules.review required approved, was not_started — ruling R-1 (Jane Smith): agree definitions at kickoff | Jane Smith | orchestrator [a1b2c3] | 7m 14s | 188341 | $1.44 |
| 2026-02-25 11:02Z | /wire:data_model-generate | complete | ticket CUS-199, ran 2026-02-25 09:40Z: 4 tables | Jane Smith | orchestrator [d4e5f6] | 9m 12s | 201544 | $1.51 |
| 2026-02-25 11:02Z | /wire:data_model-review | approved | recorded from PR #64 approved by John Doe (ticket CUS-199, approved 2026-02-25 10:55Z) | John Doe | orchestrator [d4e5f6] | n/a | n/a | n/a |
The last two rows are a ticket roll-up (specs/utils/status_sync.md Step 4g)
run by an orchestrating session: the first was rolled up from the ticket's run
log; the second records a review result from the ticket's merged pull request,
so By is the approver, Session is the session that ran the roll-up, and the
metric cells stay n/a because no review command ran.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub rittmananalytics/wire-plugin --plugin wire375 commands in this plugin
/adoptAdopt an in-flight project into Wire — assess repo and external sources, map existing work to artifacts, set up engagement structure, generate adoption playbookAdopt an in-flight project into Wire — assess repo and external sources, map existing work to artifacts, set up engagement structure, generate adoption playbook/ads_adversarial-config-generateConfigure and test adversarial review sub-agentConfigure and test adversarial review sub-agent/ads_adversarial-config-reviewTechnical review of adversarial review configurationTechnical review of adversarial review configuration/ads_adversarial-config-validateVerify adversarial review configuration and calibrationVerify adversarial review configuration and calibration/ads_agent-config-generateGenerate agentic data stack Wire skill with routing logic and provenance footerGenerate agentic data stack Wire skill with routing logic and provenance footer/ads_agent-config-reviewTechnical review of agentic data stack skill before eval suite buildTechnical review of agentic data stack skill before eval suite build