Skip to content

Add RoosterJS custom agent with shared browser page support - #3507

Draft
Julia Roldi (juliaroldi) wants to merge 5 commits into
masterfrom
u/juliaroldi/roosterjs-agent
Draft

Julia Roldi (juliaroldi) wants to merge 5 commits into
masterfrom
u/juliaroldi/roosterjs-agent

Conversation

@juliaroldi

Copy link
Copy Markdown
Contributor

Summary

Adds a RoosterJS custom agent (.github/agents/roosterjs.agent.md) for VS Code Copilot Chat. The agent follows AGENTS.md and repeats its main rules: test only with yarn test:fast, run lint, tests, and build before finishing, and make edits through the Content Model. It also points to the existing .claude/skills. It can work with browser pages shared through VS Code's Share with Agent feature, so it can reproduce and check editor behavior in the demo site.

The agent file includes:

  • A workflow: understand, reproduce, fix, verify, report.
  • How to use a shared page's ID with the browser tools (readPage, screenshotPage, clickElement, typeInPage, navigatePage, runPlaywrightCode, and others).
  • What to do when the dev server is down ([WDS] Disconnected!): start yarn start, then reload the page.
  • A map of the demo site: the #RoosterJsContentDiv editor, the ribbon tabs and commands, and the side-pane tabs.
  • Short instructions for inspecting the editor's HTML and Content Model and for reproducing typing and paste bugs.

This PR only adds documentation and configuration. No runtime code changes.

How to test

  1. Check out this branch and open the repo in VS Code with Copilot Chat.
  2. Run yarn start and open http://localhost:3000/ in the VS Code integrated browser, then share the page with the agent.
  3. In Chat, pick the RoosterJS agent and ask it something like "Make the text bold in the demo editor and show me the resulting Content Model". The agent should use the shared page through the browser tools.
  4. Ask it to fix a small issue and check that it runs yarn test:fast --testPathPattern=<area>, yarn eslint, and yarn b, as AGENTS.md requires.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://microsoft.github.io/roosterjs/pr-preview/pr-3507/

Built to branch gh-pages at 2026-12-04 19:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unconditional reload guidance can erase the user’s in-memory reproduction and leave verification running against an empty editor unless state is captured and restored first.

1 open issue
What changed in this PR

Adds a RoosterJS custom agent for VS Code Copilot Chat, combining repository development guidance with browser-based verification using shared demo pages. This is a documentation/configuration-only change with no runtime code changes.

Changes:

  • Defines an understand–reproduce–fix–verify–report workflow aligned with AGENTS.md.
  • Documents shared-page browser tools and dev-server recovery.
  • Adds demo navigation guidance and recipes for inspecting content, reproducing bugs, and recording evidence.
File Description
.github/​agents/​roosterjs.agent.md Defines the agent and its repository workflow, shared-browser usage, and demo verification guidance.

Review effort: Balanced

Comment thread .github/agents/roosterjs.agent.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The agent instructions reference a contributor-specific absolute path and an unavailable skill name, and require Windows-only server discovery commands that fail on macOS and Linux.

3 open issues
1 resolved since last review

Review effort: Balanced

Comment thread .github/agents/roosterjs.agent.md Resolved
## Workflow

1. **Understand.** Find the relevant package, then read the types in `packages/roosterjs-content-model-types/lib/` and the existing code and tests before you change anything.
2. **Confirm understanding and challenge the design.** For every bug-fix or new-feature request, invoke the `roosterjs-grill-me` skill before implementation to verify that your understanding of the user's prompt is correct. Summarize the intended behavior and use the skill's questioning process to clarify assumptions, scope, and acceptance criteria with the user. Use `ask_user` to obtain explicit approval of the proposed changes, not merely acknowledgment of the problem. Stay read-only until that scope is confirmed. Design alternatives raised during questioning are suggestions, not authorization to implement them. Also use this skill when the user explicitly asks to grill, challenge, or pressure-test a RoosterJS design or plan.

- **Prefer the shared page.** Work with the page the user already has open so you see the same state. Open a new page with `openBrowserPage` only when nothing is shared, and tell the user that you did.
- **Reuse the existing dev server.** The demo site is served by `yarn start` (webpack-dev-server, usually at `http://localhost:3000/`). `tools/start.js` uses `detect-port`, so when port 3000 is taken it silently starts a duplicate server on the next free port (3001, 3002, …) and opens another browser tab. A page showing `[WDS] Disconnected!` or `ERR_CONNECTION_REFUSED` is often just a stale tab, not a stopped server. Before you start anything:
1. List running demo servers with `Get-NetTCPConnection -State Listen -LocalPort 3000,3001,3002 -ErrorAction SilentlyContinue`, and confirm each owner is `node tools/start.js` with `Get-CimInstance Win32_Process -Filter "ProcessId=<pid>"`.
Updated guidelines for making edits and using skills.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Mandatory workflow steps reference a nonexistent skill and require Windows-only server-discovery commands, blocking implementation and demo-server setup on affected hosts.

2 open issues
1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants