agentleFS
tsouth89tsouth89/toolport-studio/.agents/skills/test-t3-app/SKILL.md

test-t3-app

Skill4 starsChanged 4 months agoMITView on GitHub

Launch, retain, and test the T3 Code web app in isolated development environments, including first-try browser authentication with one-time pairing URLs, pairing-token recovery, worktree-safe state directories, cross-turn dev server lifecycle, and direct SQLite inspection or fixture seeding. Use when an agent needs to run T3 locally, iteratively test UI behavior with a human, recover from an expired or consumed pairing token, isolate dev state, or prepare test data in state.sqlite.

6 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. 0 are common, 17 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 17

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

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

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

    Use this skill for the web client.

    line 8
  2. Distinctive:

    Run commands from the repository root.

    line 12
  3. Very specific:

    Use the repository's ignored .t3 directory for reusable worktree-local state.

    line 14
  4. Very specific:

    Use mktemp -d /tmp/t3code-test.XXXXXX for disposable state and retain the printed absolute path.

    line 15
  5. Very specific:

    Start the full web stack with vp run dev --home-dir <base-dir>.

    line 16
  6. Distinctive:

    Keep the terminal session alive and read the selected server port, web port, base directory, and pairing URL from its output.

    line 17
  7. Very specific:

    Treat a base directory as disposable only when it was created or deliberately selected for the current test.

    line 19
  8. Distinctive:

    Treat the overall testing or implementation loop—not an assistant turn or one verification pass—as the environment lifecycle boundary.

    line 25
  9. Distinctive:

    Keep the dev process, base directory, selected ports, authenticated browser tab, registered projects, and seeded fixtures alive while the …

    line 27
  10. Distinctive:

    Do not stop the server merely because one verification pass completed or because you are yielding a response to the user.

    line 28
  11. Distinctive:

    Before starting another environment, check whether the existing process and browser tab still serve the task.

    line 29
  12. Very specific:

    Wait for the server log that says authentication is required and includes a URL ending in /pair#token=....

    line 35
  13. Distinctive:

    Use the controlled in-app browser or browser-automation surface available to the agent.

    line 36
  14. Distinctive:

    Wait for the pairing exchange and redirect to finish before navigating elsewhere.

    line 38
  15. Distinctive:

    Treat pairing URLs as secrets.

    line 41
  16. Distinctive:

    Create another token against the same database and web URL as the running dev server:

    line 45
  17. Very specific:

    Use the Pair URL from this command once.

    line 56
  18. Distinctive:

    Read references/sqlite-fixtures.md before changing the database.

    line 62
  19. Very specific:

    Use node apps/server/scripts/t3-sqlite-state.ts query for schema discovery and read-only checks.

    line 64
  20. Very specific:

    Stop the dev server before using node apps/server/scripts/t3-sqlite-state.ts exec, then restart it with the same base directory.

    line 65
  21. Very specific:

    Use the auth CLI, not direct auth_* table edits, for pairing and sessions.

    line 67
  22. Distinctive:

    When teardown is appropriate:

    line 75
  23. Distinctive:

    Stop the dev process with its terminal interrupt.

    line 77
  24. Distinctive:

    If completion is uncertain, keep the environment alive and mention that it is retained for further iteration.

    line 81
  25. Distinctive:

    If the browser shows an unauthenticated pairing screen, issue a new token instead of retrying the consumed URL.

    line 85
  26. Very specific:

    If the pairing URL is no longer visible, create a replacement token with both --dev-url and --base-url.

    line 86
  27. Distinctive:

    If the replacement token is rejected, verify that the CLI and server use the identical absolute base directory and web URL.

    line 87
  28. Distinctive:

    If the UI shows unexpected data, verify that every command uses the identical explicit base directory before editing anything.

    line 88
  29. Very specific:

    If ports move because another instance is running, trust the current dev-runner output rather than assuming ports 13773 and 5733.

    line 89

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

Test T3 App

Use this skill for the web client. For iOS Simulator, Android Emulator, or physical-device testing against an isolated T3 backend, use the sibling test-t3-mobile skill.

Start an isolated web environment

  1. Run commands from the repository root.
  2. Choose a base directory that belongs only to the current worktree or test:
    • Use the repository's ignored .t3 directory for reusable worktree-local state.
    • Use mktemp -d /tmp/t3code-test.XXXXXX for disposable state and retain the printed absolute path.
  3. Start the full web stack with vp run dev --home-dir <base-dir>.
  4. Keep the terminal session alive and read the selected server port, web port, base directory, and pairing URL from its output.

Treat a base directory as disposable only when it was created or deliberately selected for the current test. Never delete or directly seed the shared ~/.t3 directory. Prefer starting with a new temporary base directory over clearing state of uncertain ownership.

The dev runner disables browser auto-open by default. Do not pass --browser during automated testing: an automatically opened page can consume the one-time bootstrap token before the controlled browser uses it.

Preserve the environment while iterating

Treat the overall testing or implementation loop—not an assistant turn or one verification pass—as the environment lifecycle boundary.

  • Keep the dev process, base directory, selected ports, authenticated browser tab, registered projects, and seeded fixtures alive while the user may inspect the result or request follow-up changes.
  • Do not stop the server merely because one verification pass completed or because you are yielding a response to the user.
  • Before starting another environment, check whether the existing process and browser tab still serve the task. Reuse them when healthy instead of discarding useful state.
  • On a later turn, verify that the existing process is alive and reuse its printed ports and base directory. If it exited, restart with the same base directory; create a new pairing token only when the browser session is no longer valid.
  • Tell the user when a test environment remains available, including its non-secret web URL when useful. Never include a pairing token.

Authenticate the browser on the first navigation

  1. Wait for the server log that says authentication is required and includes a URL ending in /pair#token=....
  2. Use the controlled in-app browser or browser-automation surface available to the agent. Do not use a system-browser launch command during automated testing.
  3. Open that complete URL exactly once as the controlled browser's first navigation. Preserve the fragment and token verbatim.
  4. Wait for the pairing exchange and redirect to finish before navigating elsewhere.
  5. Continue in the same browser context so its stored bearer session remains available.

Treat pairing URLs as secrets. Do not copy them into final responses, screenshots, committed files, or durable logs. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it.

Recover a consumed or expired pairing token

Create another token against the same database and web URL as the running dev server:

TOOLPORT_STUDIO_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
  --base-dir <base-dir> \
  --dev-url <web-url> \
  --base-url <web-url> \
  --ttl 15m \
  --label agent-ui-test

Use the Pair URL from this command once. Derive <server-port> and <web-url> from the current dev-runner output, including any automatically selected port offset. Setting TOOLPORT_STUDIO_PORT keeps the administrative CLI from probing for an unrelated free port.

Always pass --dev-url for a dev-runner environment so the generated pairing URL uses the current web origin. An explicit base directory stores runtime state in <base-dir>/userdata; the <base-dir>/dev fallback is only used by an implicit dev home. Use auth pairing list to inspect active token metadata; it intentionally cannot reveal token secrets.

Inspect or seed SQLite state

Read references/sqlite-fixtures.md before changing the database.

  • Use node apps/server/scripts/t3-sqlite-state.ts query for schema discovery and read-only checks.
  • Stop the dev server before using node apps/server/scripts/t3-sqlite-state.ts exec, then restart it with the same base directory.
  • Seed projection tables only for disposable UI fixtures. Use application commands and APIs when testing business behavior or projection correctness.
  • Use the auth CLI, not direct auth_* table edits, for pairing and sessions.

The helper refuses to write to the shared ~/.t3 directory by default and creates a database backup before each mutation.

Tear down only when the testing loop is finished

Tear down when the user explicitly asks, confirms the iteration is finished, or the overall task is genuinely complete with no pending human review. Do not infer completion from the end of an assistant turn.

When teardown is appropriate:

  1. Stop the dev process with its terminal interrupt.
  2. Preserve the isolated base directory when it contains useful reproduction evidence or state for a likely follow-up.
  3. Otherwise remove only a path created for this test after resolving and verifying the exact target.

If completion is uncertain, keep the environment alive and mention that it is retained for further iteration. A fresh isolated base directory remains the safest reset when authentication, migrations, or fixture state becomes ambiguous.

Troubleshoot predictably

  • If the browser shows an unauthenticated pairing screen, issue a new token instead of retrying the consumed URL.
  • If the pairing URL is no longer visible, create a replacement token with both --dev-url and --base-url.
  • If the replacement token is rejected, verify that the CLI and server use the identical absolute base directory and web URL.
  • If the UI shows unexpected data, verify that every command uses the identical explicit base directory before editing anything.
  • If ports move because another instance is running, trust the current dev-runner output rather than assuming ports 13773 and 5733.

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.