# Completing The Race

> Use when the simulator finishes its race-tick loop and must wrap up: compiling final results from tick snapshots, stopping the RaceCollector, and reporting outcomes to other agents. Triggered once per simulation, after the last tick.

- Skill: `googlecloudplatform/completing-the-race` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add googlecloudplatform/completing-the-race`
- Raw SKILL.md: https://api.skillmd.com/api/skills/googlecloudplatform/completing-the-race/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: Apache-2.0
- Author: GoogleCloudPlatform (https://skillmd.com/u/googlecloudplatform)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/googlecloudplatform/completing-the-race

---


# Completing the Race

You use this skill to wrap up the simulation after the race phase completes.
This is the final phase of the simulation lifecycle.

## Instructions

1. **Compile Results**: Call `compile_results` first to aggregate all tick
   snapshots into final race metrics (vitals trends, status counts, notable
   events, and sampling quality).
2. **Stop Collector**: Call `stop_race_collector` to shut down the Redis
   subscription and clean up the RaceCollector resources.
3. **Report (Optional)**: Use `call_agent` to communicate final results to other
   agents (e.g., planner, dashboard) as needed for post-race reporting.

## Tools

- `compile_results(tool_context)`:
  Read tick_snapshots from state and aggregate into vitals_trend,
  final_status_counts, notable_events, sampling_quality, and
  avg_runners_reporting.
- `stop_race_collector(tool_context)`:
  Look up the RaceCollector by session_id and stop it to release Redis
  resources.
- `call_agent(agent_name, message, tool_context)`:
  Delegate inter-agent communication via the shared A2A utility.

