agentleFS
yasserstudioyasserstudio/gpc-skills/gpc-train/SKILL.md

gpc-train

Skill1 starsChanged 17 days agoMITView on GitHub

Use when setting up or managing automated staged rollout pipelines with GPC. Trigger when the user mentions gpc train, release train, staged rollout automation, rollout pipeline, release gates, automatic rollout progression, auto-halt on regression, rollout stages — even if they don't explicitly say 'train.' Also trigger when someone wants to automatically progress a release from internal → alpha → production with time gates, or set up crash/ANR gates that pause a rollout.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the task involves:

    line 13
  2. Very specific:

    Create .gpcrc-train.json in the project root (or pass another file with --config).

    line 32
  3. Distinctive:

    every configured gate passes.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

GPC Release Train

When to use

Use this skill when the task involves:

  • Setting up a config-driven staged rollout pipeline
  • Automatically progressing a release through tracks (internal → alpha → production) with time gates
  • Gating progression on crash rate and ANR rate thresholds
  • Pausing, resuming, or aborting an in-flight release train
  • Checking the current stage and gate health of a running train

Inputs required

  • Package name (or configured default in .gpcrc.json)
  • Release train config: stages with tracks, rollout percentages, and time delays
  • Gate thresholds: max crash rate and max ANR rate, as percentages
  • Whether to pause, restart, or abort the train

Procedure

1) Configure the release train

Create .gpcrc-train.json in the project root (or pass another file with --config). Stages and gates are top-level keys:

{
  "stages": [
    { "track": "internal",   "rollout": 100 },
    { "track": "alpha",      "rollout": 100, "after": "2d" },
    { "track": "production", "rollout": 10,  "after": "7d" },
    { "track": "production", "rollout": 100, "after": "14d" }
  ],
  "gates": { "crashes": { "max": 1.5 }, "anr": { "max": 0.5 } }
}

Config keys:

KeyTypeDescription
stages[].trackstringTarget track: internal, alpha, beta, production
stages[].rolloutnumberRollout percentage for this stage (1-100)
stages[].afterstringMinimum time since the previous stage ran (e.g. 2d, 12h, 30m). Omit for no wait.
gates.crashes.maxnumberMaximum crash rate, as a percentage (1.5 = 1.5%), before the train pauses
gates.anr.maxnumberMaximum ANR rate, as a percentage (0.5 = 0.5%), before the train pauses

Train gates are the one place GPC takes percentages. The --threshold flag on gpc vitals commands, gpc watch and vitals.thresholds.* take fractions (0.02 = 2%).

Read:

  • references/rollout-pipeline.md

2) Start the train

gpc train start                      # reads .gpcrc-train.json
gpc train start --config release.json

This writes a state file at ~/.cache/gpc/train-<packageName>.json and runs stage 1 immediately (it sets that track's rollout on Google Play). If a train is already running, start changes nothing and prints its state; --force starts over and runs stage 1 again.

3) Advance the train

Nothing advances on its own. Run gpc train advance on a schedule (a CI cron job, for example). Each run moves to the next stage only when:

  • the next stage's after time has elapsed since the current stage ran, and
  • every configured gate passes.
gpc train advance

Gates read the most recent day of crash and ANR data (the worst value of that day).

  • Gate breached: the train is paused and the command exits 6 (TRAIN_CRASH_GATE_FAILED / TRAIN_ANR_GATE_FAILED).
  • No data for a gate (v1.0.0-rc.2+): the train stays on its current stage and the command exits 6 with TRAIN_GATE_NO_DATA. Vitals lag 2-4 days, so run it again later. Before rc.2 a gate with no data let the train advance.

4) Check train status

gpc train status
gpc train status --json

Prints the saved state: status (running, paused, completed), the current stage index, each stage with its executedAt / scheduledAt time, and the gates.

5) Pause a running train

gpc train pause

Stops advance from moving the train. It does not halt or change any rollout on Google Play. There is no resume command: to continue after a pause, start again with gpc train start --force, which begins at stage 1. Adjust the config first if earlier stages should not run again.

6) Abort the train

gpc train abort

Clears the train state. It does not halt rollouts on Google Play. To stop a release, halt it explicitly:

gpc releases rollout halt --track production

Verification

  • gpc train status shows the correct current stage and gate health values
  • gpc status confirms rollout percentages on each track match the active stage in the train config
  • Gate values (crashes, ANR) are below configured max thresholds
  • State file at ~/.cache/gpc/train-<packageName>.json reflects the current stage index and last progression timestamp

Failure modes / debugging

SymptomLikely CauseFix
Exit 6, TRAIN_CRASH_GATE_FAILED / TRAIN_ANR_GATE_FAILED, train pausedCrash/ANR rate above the gate's max percentageFix the regression in a new release, halt the rollout if needed, then gpc train start --force
Exit 6, TRAIN_GATE_NO_DATANo vitals for the most recent day yet (2-4 day lag, or low traffic)Run gpc train advance again later; the train stayed on its stage
advance does nothingafter time has not elapsed, or the train is pausedgpc train status shows scheduledAt and the status
start prints an old state and does nothingA train is already runninggpc train status to check; gpc train abort or start --force
INVALID_CONFIG on start.gpcrc-train.json missing or not valid JSONCreate it, or pass --config <file>
State file missingCache directory cleared or different machinegpc train start again; it begins at stage 1

Related skills

  • gpc-release-flow: Upload, promote, and manual rollout management
  • gpc-vitals-monitoring: Crash and ANR monitoring used by gate checks
  • gpc-ci-integration: Running gpc train in CI/CD pipelines

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.