Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/rozenite
1 change: 0 additions & 1 deletion .agents/skills/rozenite-agent

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/skills-cli-restructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rozenite': minor
---

Restructure Rozenite for Agents skills so the CLI bundles all content and the installable skill becomes a thin router. Add `rozenite skills list` and `rozenite skills show <id>` to list and read the bundled docs (ground truths, CLI workflow, SDK workflow, SDK code patterns, and one doc per agent-enabled domain). The `rozenite-agent` and `rozenite-agent-sdk` skills are replaced by a single `rozenite` skill that discovers docs through `rozenite skills` instead of hardcoding them, so the skill can no longer go stale.
2 changes: 1 addition & 1 deletion docs/react-agent-features/01-get-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Use `items` instead of `nodes` to match existing paginated Rozenite tool style.
7. Expose `getTree` from `createReactTreeStore`.
8. Register the tool in `createReactDomainService` in `packages/middleware/src/agent/local-domains.ts`.
9. Add `getTree` to `STATIC_DOMAIN_TOOL_NAMES.react` in `packages/agent-sdk/src/constants.ts`.
10. Update `packages/cli/skills/rozenite-agent/domains/react.md`.
10. Update `packages/cli/docs/react.md`.
11. If required by the repository structure, mirror runtime changes under `packages/cli/src/commands/agent/runtime/react/*`.

## Test Plan
Expand Down
2 changes: 1 addition & 1 deletion docs/react-agent-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The goal is not to copy its WebSocket transport. Rozenite already receives React
- Rozenite React types: `packages/middleware/src/agent/runtime/react/types.ts`
- Rozenite React domain registration: `packages/middleware/src/agent/local-domains.ts`
- Static SDK domain tool list: `packages/agent-sdk/src/constants.ts`
- Current CLI skill reference: `packages/cli/skills/rozenite-agent/domains/react.md`
- Current CLI skill doc: `packages/cli/docs/react.md`
- Mirrored CLI runtime copy: `packages/cli/src/commands/agent/runtime/react/*`

When implementing, treat `packages/middleware` as the canonical runtime location. If the CLI copy is still intentionally maintained, mirror equivalent runtime/type changes there after changing middleware.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
---
name: rozenite-agent
description: Use Rozenite for Agents through CLI-driven `rozenite agent` commands to inspect React Native DevTools data and Rozenite plugins on a live app target. Trigger this skill for shell-based debugging and live session work. For Node.js or TypeScript scripts, wrappers, automations, or other programmatic SDK usage, use `rozenite-agent-sdk` instead.
name: cli
description: Shell-driven `rozenite agent ...` workflow — command syntax, session lifecycle, the listing/pagination output contract, calls, and the end-to-end flow.
---

## CLI
# CLI

Use this doc for shell-driven `rozenite agent ...` workflows and live
debugging from the terminal. Read the `core` doc first for ground truths
shared with the SDK workflow (built-in domains, plugin domain tokens, and
when live session data beats source code).

If the task instead needs a Node.js or TypeScript script, wrapper,
automation, or agent runtime built on top of Rozenite, use the `sdk` doc
instead.

- Use `npx rozenite` for Rozenite commands.
- Run `npx rozenite` from the app root where Metro is started for the target app. In monorepos, this is usually the app package root, not the repository root.
- Run `npx rozenite` from the app root where Metro is started for the target
app. In monorepos, this is usually the app package root, not the
repository root.

## Session lifecycle

- Start with `npx rozenite agent session create`. It creates or reuses the
device session and returns when ready. Stop the session when done with
`npx rozenite agent session stop <sessionId>`.
- If `session create` fails because multiple devices are connected, run
`npx rozenite agent targets`, choose the right `id`, then retry with
`--deviceId <id>`.
- Treat `npx rozenite agent targets` as the source of truth for available
targets. If the expected target is missing, ask the user to run the app on
a device.
- Pass `--session <id>` on every domain command.
- Treat the Rozenite session ID as a public runtime identifier, not a
secret, credential, or token.

## Discovering domains and tools

- Discover domains from the live session with
`npx rozenite agent domains --session <id>` only if a domain call fails,
the expected domain is unclear, or you need to confirm what is currently
registered.
- Do not call `npx rozenite agent <domain> tools` or fetch a tool schema
when the expected tool name and arguments are already known (for example
from a domain doc — run `npx rozenite skills list` to find the doc id for
a domain, then `npx rozenite skills show <id>`).
- Check `npx rozenite agent <domain> tools --session <id>` or
`npx rozenite agent <domain> schema --tool <name> --session <id>` only
when no matching domain doc exists, a domain doc doesn't answer the
question, a call fails, or the live domain exposes behavior that differs
from the docs.
- Skip confirmation or discovery steps that do not add new information.

## Listing output contract

Expand Down Expand Up @@ -53,43 +96,12 @@ retain their existing shapes.
by default. Pass `-f, --fields <csv>` to pick specific columns, or
`-v, --verbose` to include every field the tool declares.

## Handoff

- Keep this skill for shell-driven `rozenite agent ...` workflows.
- If the user wants code instead of shell commands, or asks for a Node.js or TypeScript script, wrapper, benchmark, automation, or agent runtime built on top of Rozenite, switch to `rozenite-agent-sdk`.

## Rules

- Agent work is session-scoped. Reuse one session across related commands.
- Always run Rozenite commands in serial. Never issue Rozenite agent commands in parallel.
- Start with `npx rozenite agent session create`. It creates or reuses the device session and returns when ready. Stop the session when done with `npx rozenite agent session stop <sessionId>`.
- If `session create` fails because multiple devices are connected, run `npx rozenite agent targets`, choose the right `id`, then retry with `--deviceId <id>`.
- Treat `npx rozenite agent targets` as the source of truth for available targets. If the expected target is missing, ask the user to run the app on a device.
- Pass `--session <id>` on every domain command.
- Treat the Rozenite session ID as a public runtime identifier, not a secret, credential, or token.
- Use this skill and its `domains/*.md` references as the source of truth for workflow, tool choice, and tool arguments.
- If this skill or a domain reference already identifies the expected domain, try it directly. If a reference already lists the exact tool and arguments you need, call it directly.
- Discover domains from the live session with `npx rozenite agent domains --session <id>` only if a domain call fails, the expected domain is unclear, or you need to confirm what is currently registered.
- Do not call `npx rozenite agent <domain> tools` or fetch tool schema when this skill or its references already provide the needed tool name and arguments.
- Check `npx rozenite agent <domain> tools --session <id>` or `npx rozenite agent <domain> schema --tool <name> --session <id>` only when no matching reference exists, the references do not answer the question, a call fails, or the live domain exposes behavior that differs from the references.
- Skip confirmation or discovery steps that do not add new information.
- For live app inspection, Rozenite session data is the source of truth. Use the relevant live domain before exploring source code.
- Trust that Rozenite is correctly installed. Do not explore the codebase for setup unless the Rozenite CLI fails.
- Do not explore the codebase to infer live runtime state when Rozenite can answer directly.
- Explore source code only when the user asks about implementation or setup, when no relevant domain is available, or when Rozenite shows the required plugin or domain is not registered and the task becomes setup or debugging.
- If the expected plugin domain is missing from the live session, tell the user that the corresponding plugin must be installed and registered in the app.
- When referring to plugin domains in user-facing output, use the plugin's `pluginId` instead of the domain token.
- When making Rozenite calls against a discovered plugin domain, use the live domain token returned by Rozenite.
- Built-in domains are `console`, `network`, `react`, `performance`, and `memory`.
- Additional domains can appear at runtime from the app or installed plugins. Plugin domain tokens are short, derived names, not the npm package name: `@rozenite/mmkv-plugin` becomes `mmkv`, `@avasapp/rozenite-plugin-ably` becomes `avasapp/ably`.
- Domain token shape tells you provenance: a bare word (`mmkv`) is a built-in or an official `@rozenite/*` plugin; `scope/name` (`avasapp/ably`) is a third-party scoped plugin; a verbatim `rozenite-*` name is a third-party unscoped plugin. `evil/mmkv` and `mmkv` are never the same plugin.

## Calls

- Do not pass domain tool names as direct CLI subcommands.
- Always invoke domain tools with `npx rozenite agent <domain> call --tool <toolName> --args '<json>' --session <id>`.
- Continue a paginated domain tool call by passing its returned cursor inside `--args`; `--cursor` is only for CLI-owned domain and tool listings.
- If a domain reference lists only tool names, treat them as tool names, not CLI actions.
- If a domain doc lists only tool names, treat them as tool names, not CLI actions.
- Example: `npx rozenite agent mmkv call --tool list-storages --args '{}' --session <id>`.
- If a command fails with `Unknown domain action`, check the CLI syntax and retry with `call --tool <toolName> --session <id>`.

Expand All @@ -98,10 +110,10 @@ retain their existing shapes.
1. Run Rozenite commands one at a time.
2. Use `npx rozenite agent targets` as the source of truth for available targets when device selection matters. If the expected target is missing, ask the user to run the app on a device.
3. Run `npx rozenite agent session create`.
4. If a matching file exists under `domains/*.md`, read it.
5. If the reference already lists the needed tool and arguments for the expected domain, call it directly.
4. Run `npx rozenite skills list` to find a matching domain doc id, then `npx rozenite skills show <id>` to read it, if one exists for the expected domain.
5. If the doc already lists the needed tool and arguments for the expected domain, call it directly.
6. Run `npx rozenite agent domains --session <id>` only if the call fails, the expected domain is unclear, or you need to confirm what is currently registered.
7. If the expected plugin domain is missing, tell the user to install and register the corresponding plugin in the app.
8. Check `npx rozenite agent <domain> tools --session <id>` or `npx rozenite agent <domain> schema --tool <name> --session <id>` only if the reference is insufficient, the call fails, or you need to confirm a live mismatch.
8. Check `npx rozenite agent <domain> tools --session <id>` or `npx rozenite agent <domain> schema --tool <name> --session <id>` only if the doc is insufficient, the call fails, or you need to confirm a live mismatch.
9. Fall back to source-code exploration only if no relevant domain exists or the task is about implementation or setup.
10. When no further Rozenite calls are needed, stop the session with `npx rozenite agent session stop <sessionId>`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: console
description: Read, filter, and paginate React Native console messages from the app, and clear the log buffer when needed.
domain: console
---

Read, filter, and paginate React Native console messages from the app, and clear the log buffer when needed.

## Tools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: controls
description: Read and mutate app-defined debug controls (text, toggle, select, input, button) exposed via the Controls plugin.
domain: controls
---

# Controls Plugin Domain

A Rozenite plugin for exposing app-defined controls in React Native DevTools. You get a custom control panel: read runtime values, flip toggles, switch options, submit text input, and trigger actions (e.g. reset, refetch) without building extra debug screens. Use this domain to list sections and items, read values, and mutate them via `set-value` or `press-button`.
Expand Down
74 changes: 74 additions & 0 deletions packages/cli/docs/core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: core
description: Ground truths for Rozenite for Agents shared by every workflow — what it is, session and call discipline, built-in and plugin domains, and when live data beats source code.
---

# Core

Rozenite for Agents is the agent-facing way to interact with React Native
DevTools and Rozenite plugins on a running React Native app. It works through
either the `rozenite agent` CLI or the `@rozenite/agent-sdk` package. Read
this doc first, then run `npx rozenite skills show cli` for shell-driven
workflows or `npx rozenite skills show sdk` for programmatic
Node.js/TypeScript workflows.

Rozenite for Agents requires a project with Rozenite already installed and
configured, Metro running, and at least one React Native target connected. It
does not replace that setup.

## Session and call discipline

- Agent work is session-scoped. Create or reuse one session and reuse it
across related commands or calls.
- Always make Rozenite calls in serial. Never issue Rozenite agent commands
or SDK tool calls in parallel.
- Stop the session when the work is done.

## Built-in domains

Built-in domains are always available on a live session: `console`,
`network`, `react`, `performance`, and `memory`.

## Plugin domains

Additional domains can appear at runtime from the app or from installed
Rozenite plugins. Treat the live session's domain list as the source of
truth for which domains actually exist on the connected target.

Plugin domain tokens are short, derived names, not the npm package name:
`@rozenite/mmkv-plugin` becomes `mmkv`, `@avasapp/rozenite-plugin-ably`
becomes `avasapp/ably`.

Domain token shape tells you provenance:

- A bare word (`mmkv`) is a built-in domain or an official `@rozenite/*`
plugin.
- `scope/name` (`avasapp/ably`) is a third-party scoped plugin.
- A verbatim `rozenite-*` name is a third-party unscoped plugin.

`evil/mmkv` and `mmkv` are never the same plugin — do not treat a
similarly-named token as equivalent to a known-good one.

When referring to plugin domains in user-facing output, use the plugin's
`pluginId` (for example `@rozenite/storage-plugin`) instead of the derived
domain token.

If the expected plugin domain is missing from the live session, tell the
user that the corresponding plugin must be installed and registered in the
app. Do not guess at a substitute domain.

## Live data is the source of truth

For live app inspection, Rozenite session data is the source of truth. Use
the relevant live domain before exploring source code to infer runtime
state — a component tree, a storage entry, or a navigation state read from
source code can be stale or simply wrong compared to what's actually
running.

Explore source code only when the user asks about implementation or setup,
when no relevant domain is available, or when Rozenite shows that the
required plugin or domain is not registered and the task becomes setup or
debugging rather than inspection.

Trust that Rozenite is correctly installed. Do not explore the codebase for
setup unless the Rozenite CLI or SDK call actually fails.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: file-system
description: Browse app files and preview file contents read-only via Expo FileSystem or an RNFS-compatible provider.
domain: file-system
---

# File System Plugin Domain

A Rozenite plugin for browsing app files and previewing file contents in React Native DevTools. It provides read-only filesystem inspection through either Expo FileSystem or an RNFS-compatible provider. Use it to discover roots, inspect directories, and preview files without mutating app data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: memory
description: Capture heap snapshots or run allocation sampling over a reproduction, with artifacts written by Metro for offline analysis.
domain: memory
---

Capture one-off heap snapshots or run allocation sampling over a reproduction. Metro writes artifacts under `.rozenite/agent/sessions/<deviceId>/memory` and `.rozenite/agent/sessions/<deviceId>/profiles` for offline analysis.

## Tools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: mmkv
description: Inspect and manage react-native-mmkv storages and entries in real time via the MMKV plugin.
domain: mmkv
---

# MMKV Plugin Domain

A Rozenite plugin for MMKV storage inspection in React Native DevTools. It provides real-time inspection of MMKV instances, data visualization with type detection (string, number, boolean, buffer), and management: list storages and entries, read/create/edit/remove entries. Use it when the app uses `react-native-mmkv` and exposes instances via `useMMKVDevTools`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: network-activity
description: Fallback HTTP, WebSocket, and SSE network inspection via the Network Activity plugin when the built-in network domain is unavailable.
domain: network-activity
---

# Network Activity Plugin Domain

A Rozenite plugin for fallback network inspection when the built-in `network` domain is unavailable, such as on older React Native versions. It mirrors the built-in `network` API for HTTP request recording and inspection, and adds plugin-specific tools for WebSocket and SSE traffic.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: network
description: Record HTTP/HTTPS traffic, then list requests, inspect request/response details and bodies, and analyze timing.
domain: network
---

Record HTTP/HTTPS traffic, then list requests, inspect request and response details and bodies, and analyze timing, similar to the browser DevTools Network panel.

## Precedence
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: performance
description: Start and stop a performance trace on the session target, exporting a Metro-managed trace artifact for offline analysis.
domain: performance
---

Start a performance trace on the session target, reproduce the issue while recording, then stop and export the trace to a Metro-managed artifact under `.rozenite/agent/sessions/<deviceId>/traces`. Calls return only artifact metadata.

## Tools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: react-navigation
description: Inspect React Navigation state, action history, and dispatch navigation actions or deep links via the React Navigation plugin.
domain: react-navigation
---

# React Navigation Plugin Domain

A Rozenite plugin for React Navigation debugging and inspection in React Native DevTools. It provides real-time navigation state monitoring, action timeline inspection, and deep-link testing (React Navigation v7). Use this domain to read focused route and root state, navigate by route name, go back, open deep links, or dispatch low-level actions when needed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: react
description: Search and traverse the React component tree, read props/state/hooks, and record render timelines via profiling.
domain: react
---

Search and traverse the React component tree, read props, state, and hooks for any node, and record render timelines for performance analysis by starting and stopping profiling, then fetching commit data.

## Tools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: redux-devtools
description: Inspect Redux stores and action history, dispatch actions, and control curated DevTools history operations.
domain: redux-devtools
---

# Redux DevTools Plugin Domain

A Rozenite plugin for Redux state inspection and curated history control in React Native DevTools. It exposes store discovery, current state reads, action-history inspection, normal Redux action dispatch, and safe Redux DevTools history operations such as jump, toggle, reset, rollback, commit, sweep, pause, and lock.
Expand Down
Loading
Loading