OpenSilver is a monorepo containing several independent tools.
- If you see the Pages Router in use, that's because it's a legacy feature. Use App Router, not Pages Router.
- Use
bun, notnpmornode. - Name files and directories in kebab-case.
- Define types, constants, and utils in the corresponding
types.ts,constants.ts, andutils.tsfile based on the tool you're developing. - Use colors from
@src/app/globals.css, not default Tailwind colors. - Combine classNames using
cnfrom@src/lib/utils.ts, not string interpolation. - Comments are code smell, as the code should be self-explanatory. Try to avoid them unless necessary.
- If any of the guidelines above aren't followed in existing code, that's because it's old code; don't write yours based on it.
- Run
bun tscafter making changes and fix the errors, if any. - Use Browser Automation to test your changes as a real user and ensure they work as expected.
- Done.
Use agent-browser for web automation. Run agent-browser --help for all commands.
Core workflow:
agent-browser open <url>- Navigate to pageagent-browser snapshot -i- Get interactive elements with refs (@e1, @e2)agent-browser click @e1/fill @e2 "text"- Interact using refs- Re-snapshot after page changes