agentleFS
a-ghorbania-ghorbani/pocketpal-dev-team/skills/run-pr-e2e/SKILL.md

run-pr-e2e

Skill2 starsChanged 3 months agoMITView on GitHub

Android E2E for a PR using the CI-built APK (no local build). Verifies the bit-identical artifact that would ship. Defers to /run-e2e for everything generic.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always a fresh ./worktrees/PR-<N>-e2e on detached origin/<head-branch> — the exact commit CI built.

    line 33
  2. Very specific:

    Never reuse an in-flight PR-<N> fix worktree (APK-vs-specs drift — the fix worktree may have uncommitted changes the CI APK doesn't know …

    line 35
  3. Very specific:

    If PR-<N>-e2e already exists from a prior run, fast-forward it to current origin/<branch>.

    line 36
  4. Very specific:

    Default is every *.spec.ts minus visual-capture, diagnostic, memory-profile:

    line 41
  5. Very specific:

    Add --e2e if any spec in the list drives the automation bridge (memory-snapshot / bench-runner / AUTOMATION_BRIDGE).

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Run PR E2E (CI APK)

This skill covers ONLY what's different from /run-e2e. For pre-flight (sim/emu booted, devices.json drift, port-4723 cleanup), reports, and failure-mode lookup — read /run-e2e. Do not duplicate.

When to use this vs /run-e2e

You wantUse
Test local changes you're iterating on/run-e2e
Verify a PR with the EXACT artifact that would ship (no local build divergence)/run-pr-e2e
Run iOS E2E for a PR/run-e2e (iOS CI doesn't publish a reusable sim build — you have to build from source)

This skill is Android only. iOS is out of scope at the CI-artifact level.

What's different from /run-e2e

Four things. Everything else is the same and lives in /run-e2e.

1. Where the APK comes from

  • Default (prod APK from ci.yml). tools/run-pr-e2e.sh calls tools/fetch-pr-apk.sh, which finds the newest completed ci.yml pull_request run for the PR, downloads android-release-apk, and drops it at <worktree>/android/app/build/outputs/apk/release/app-release.apk. This APK is bridge-stripped — specs that drive the src/__automation__/ bridge (memory-snapshot, bench-runner) silently no-op.
  • --e2e flag (bridge-enabled APK from e2e-tests.yml). Required for bridge-driven specs. e2e-tests.yml is workflow_dispatch-only and matched by head branch — someone must have dispatched it for this PR's branch first, otherwise fetch fails with "no completed workflow_dispatch run found for branch".

2. Worktree contract

Always a fresh ./worktrees/PR-<N>-e2e on detached origin/<head-branch> — the exact commit CI built. Rules:

  • Never reuse an in-flight PR-<N> fix worktree (APK-vs-specs drift — the fix worktree may have uncommitted changes the CI APK doesn't know about).
  • If PR-<N>-e2e already exists from a prior run, fast-forward it to current origin/<branch>; don't create a parallel one.
  • ./tools/create-worktree.sh PR-<N>-e2e --detach --ref origin/<branch> already syncs e2e/devices.json, .env, keystores. For an existing worktree refresh via ./tools/sync-worktree-config.sh "$WORKTREE".

3. Spec selection

Default is every *.spec.ts minus visual-capture, diagnostic, memory-profile:

  • visual-capture — screenshot generation driven by story files, not a regression.
  • diagnostic — device-state inspector, not a regression.
  • memory-profile — has its own pipeline (/memory-profile); needs device-specific baselines to be meaningful.

Enumerate dynamically so new specs on the PR are picked up:

EXCLUDE='^(visual-capture|diagnostic|memory-profile)$'
SPECS=$(find "$WORKTREE/e2e/specs" -type f -name '*.spec.ts' \
  | sed -E 's#.*/##; s#\.spec\.ts$##' | grep -vE "$EXCLUDE" \
  | sort -u | paste -sd, -)

4. The entry point is tools/run-pr-e2e.sh, not the runner directly

It's a thin wrapper around scripts/run-e2e.ts --skip-build. It handles APK fetch + placement, then loops --specs invocations against the runner. Don't replicate its work by calling the runner directly — you'll re-download the APK or fight the wrapper.

Run

From the dev-team repo root:

PR=<number>
PR_BRANCH=$(gh pr view "$PR" --repo a-ghorbani/pocketpal-ai --json headRefName -q .headRefName)

# Create or fast-forward the e2e worktree
cd ./repos/pocketpal-ai && git fetch origin "$PR_BRANCH" && cd -
if [ -d "./worktrees/PR-${PR}-e2e" ]; then
  git -C "./worktrees/PR-${PR}-e2e" reset --hard "origin/$PR_BRANCH"
  ./tools/sync-worktree-config.sh "./worktrees/PR-${PR}-e2e"
else
  ./tools/create-worktree.sh "PR-${PR}-e2e" --detach --ref "origin/$PR_BRANCH"
fi

WORKTREE="./worktrees/PR-${PR}-e2e"
cd "$WORKTREE" && yarn install && (cd e2e && yarn install) && cd -

# Pre-flight: see /run-e2e Step 1 (sim/emu booted, port 4723, devices.json appPath).

SPECS=$(find "$WORKTREE/e2e/specs" -type f -name '*.spec.ts' \
  | sed -E 's#.*/##; s#\.spec\.ts$##' \
  | grep -vE '^(visual-capture|diagnostic|memory-profile)$' \
  | sort -u | paste -sd, -)

POCKETPAL_REPO="$(realpath "$WORKTREE")" \
  bash ./tools/run-pr-e2e.sh "$PR" [--e2e] --specs "$SPECS" -- --devices connected

Add --e2e if any spec in the list drives the automation bridge (memory-snapshot / bench-runner / AUTOMATION_BRIDGE).

Inputs that ONLY exist here (not in /run-e2e)

FlagPurpose
--e2eFetch bridge-enabled APK from e2e-tests.yml (manual dispatch required) instead of prod APK from ci.yml
--no-fetchSkip APK download; reuse an already-installed APK on the device
--specs a,b,cComma-separated list (one wrapper invocation per spec, sequentially)

Everything after -- is passed verbatim to scripts/run-e2e.ts (devices filter, dry-run, etc.).

PR-specific failure modes (everything else: see /run-e2e)

SymptomFix
no completed CI runs found for PR #NPR's ci.yml is still running or failed. gh run watch or pick another run.
artifact 'android-release-apk' not foundThe Android build job failed in that run. gh run view <id>.
(--e2e) no completed e2e-tests.yml workflow_dispatch run found for branche2e-tests.yml was never dispatched for this PR's branch. Dispatch it (select the PR's head branch as the workflow ref), wait, then rerun.
(--e2e) artifact 'e2e-android-apk' not foundE2E build job failed in that dispatch. gh run view <id>.

Required env

  • GITHUB_TOKEN or GH_TOKEN (for artifact download)
  • ANDROID_HOME or ANDROID_SDK_ROOT

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.