Feature tryouts

From posit-dev/positron · View interactive version

Feature tryouts is an AI agent skill from the GitHub repository posit-dev/positron. Use when adding, reviewing, or troubleshooting an interactive release-note Try This experience, including commands, views, editor samples, Chat drafts, guided spotlights, prerequisites, scoped targets, or Agents-window handoff.

How to use this skill

Skill file

Feature tryouts

Feature tryouts connect release-note links to trusted product interactions. Use this skill to choose the least invasive useful experience, keep behavior feature-owned, bind guidance to the correct UI instance, fail closed, and validate the real journey.

The authoritative contributor contract is src/vs/workbench/contrib/onboarding/README.md. Read it before implementation. This skill owns the execution workflow and must not duplicate a catalogue of current tryouts.

1. Classify the experience

Choose the least invasive level that provides value:

| Level | Use when |

|---|---|

| Try it | Behavior can be prepared safely with isolated data |

| Guide me | Opening and highlighting a real control is sufficient |

| Help me get ready | The user must perform a prerequisite |

| Use my context | The action must bind to an exact editor, session, or widget |

| Explain only | Interaction would be unsafe, misleading, or impossible |

A spotlight alone can be useful. A tryout does not need to reproduce the complete feature.

2. Establish ownership and side effects

Before editing, answer:

  1. What useful state should the user reach?
  2. Which component owns that behavior?
  3. What may the tryout change?
  4. What must remain an explicit user action?
  5. What prerequisites can be missing?
  6. Can several matching controls be visible?
  7. Does preparation need an exact editor, session, or widget?
  8. Does execution cross into the Agents window?
  9. Is this an AI feature subject to Chat, provider, model, workspace, or managed-policy gates?
  10. How will cancellation suppress late asynchronous effects?

Prefer feature-owned contributions and commands. Shared onboarding code should provide reusable lifecycle and presentation primitives, not feature policy.

3. Choose a presentation

| Need | Presentation |

|---|---|

| Run an existing product command with installed-code arguments | command |

| Open a contributed view or view container | openView |

| Show deterministic, read-only text or a comparison | editorSample |

| Prepare an exact feature-owned UI instance | Feature-owned launch presentation |

| Launch a surface and guide one or more controls | Guided presentation |

Add a feature-owned presentation only when the built-in types cannot express the required lifecycle safely.

Canonical implementations:

4. Preserve the trust boundary

Release notes are fetched content. They may identify a tryout, but they never define executable behavior.

Requirements:

Never automatically:

Use stable, namespaced IDs. Do not repurpose an existing ID because old release notes remain available.

5. Own and scope spotlight targets

Use a feature-owned adapter to resolve controls through their owner's normal APIs, following the contributor guide. Existing owner-marked targets through markOnboardingTarget remain supported. Never query another component's classes or DOM structure.

Unique targets

Use an unscoped target only when at most one matching control can be visible in the target window.

Multi-instance targets

Editors, Chat widgets, split panes, and repeated controls require a run scope:

  1. The adapter captures the exact UI owner through its feature API and binds it to a run scope.
  2. The launch presentation returns { kind: 'prepared', targetScope }.
  3. A dedicated adapter command can instead return { targetScope } when its command payload sets captureTargetScope: true.
  4. The sequence resolves targets only within that scope.
  5. Missing or stale scope fails closed instead of falling back to another visible instance.

Scopes are opaque run identities. They are not selectors, persisted state, release-note input, or authorization tokens.

See onboardingTarget.ts, guidedTryoutPresentation.ts, and spotlightPresentation.ts.

6. Handle prerequisites through real product actions

Use:

Do not manufacture diagnostics, sessions, browser navigation, selections, or saved configuration merely to make the example look complete. Explain what the user must do and let the owning feature perform it.

7. Handle Chat and AI examples

Use isAI: true and include the feature's normal Chat visibility and enablement conditions.

Chat examples must:

For model, provider, permission, policy, or managed-setting changes, invoke the policy-and-managed-settings skill.

8. Handle Agents-window examples

Use targetWindow: 'agents' when implementation belongs in the Agents window.

Invoke the sessions skill for changes under src/vs/sessions/**.

9. Apply specialist guidance

Invoke:

Reuse the existing spotlight presentation. Do not create a release-note-specific overlay.

10. Add release-note markup

Use Developer: Copy Feature Example Link to produce the backtick-wrapped shorthand. The first argument is a registered tryout ID; the second is literal display text, not executable behavior:

`try(myFeature.guide,Try My Feature)`

Existing encoded links remain supported with their product-generated labels. See the contributor guide for the shorthand grammar and fallback behavior.

The surrounding prose should explain:

Use releaseNotesTryouts.md for manual validation, not as another source of feature contracts.

11. Test the contract

Add the smallest applicable coverage:

| Capability | Required coverage |

|---|---|

| Registration | Exact ID, metadata, payload, and availability |

| Preparation | No execution during availability or preparation |

| Cancellation | No late effects after cancellation |

| Setup | Offered but never automatically executed |

| Guided target | Owner callback and missing-target behavior |

| Scoped target | Two visible instances; prepared instance wins |

| Command | Missing command fails closed |

| Chat | No send, no draft replacement, exact widget binding |

| Agents handoff | Cancellation, acknowledgment, rejection, and supersession |

| Integrated Browser | Native view hides behind the overlay |

| Release notes | Unknown and malformed links remain inert |

Framework references:

12. Validate and report

Run:

  1. Focused unit tests.
  2. Scoped ESLint.
  3. npm run valid-layers-check when imports or ownership change.
  4. npm run typecheck-client when TypeScript scope warrants it.
  5. npm run build-fast whenever possible.
  6. A real UI flow for cross-window, scoped-target, or native-browser behavior.

Clean temporary profiles, samples, logs, and processes.

The completion report should state:

Stop and redesign when

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.