Browser4 Dev logo

Browser4 Dev

CommunityPopular
platonai
browser4-dev

Develop features inside the Browser4 repository itself: add CLI commands, agent tool domains, REST endpoints, tests, and skills; analyze impact, plan dev tasks, check CDP pitfalls, and verify builds. Use when the user asks to add a new browser4-cli command, new tool domain, REST endpoint, modify Browser4's own Kotlin/Rust code, or check which modules a change affects.

Overview

Publisherplatonai
RepositoryBrowser4
Skill namebrowser4-dev
Stars
1.2K
Forks
152
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by platonai on GitHub. Read the source before you install it.

Installation

Install the Browser4 Dev AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/platonai/Browser4/tree/main/skills/browser4-dev
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/platonai/Browser4.git /tmp/Browser4
mkdir -p .claude/skills
cp -r /tmp/Browser4/skills/browser4-dev .claude/skills/browser4-dev
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Browser4 Dev in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Browser4 Dev on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Browser4 Dev is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

browser4-dev

Quick Start

Add a new browser4-cli command with one call:

text
coding.scaffoldFlow(type="b4-cli-command", name="my-command", verify=true)

scaffoldFlow generates the whole chain — commands.rs CommandDef, backend MCP alias, tool executor, and test — from a single name; verify=true runs the type-appropriate build check. For other work (agent tool, REST endpoint, test class, skill), use the matching type and see Workflows below.

Develop features inside the Browser4 repository itself, following the repository's own conventions (AGENTS.md) — with multi-file skeletons generated from the repository's real reference implementations, so the output never goes stale.

When to Use

  • User wants to add a new browser4-cli command
  • User wants to add a new agent tool domain (plugin tool)
  • User wants to add a REST endpoint (Controller + Service)
  • User wants to add a test class or a skill
  • User wants to modify Browser4's own Kotlin/Rust code and verify it compiles
  • User wants to know which modules a change affects, or plan a whole dev task

How It Works

scaffoldFlow derives multi-file skeletons from the repository's real reference implementations, so generated code matches current conventions instead of stale templates. moduleGraph/impact rebuild the dependency picture from the live pom.xml files, and mvnBuild verifies with structured diagnostics. Follow AGENTS.md conventions at every step.

Patterns

1. Add a new CLI command

text
coding.scaffoldFlow(type="b4-cli-command", name="my-command", verify=true)
coding.mvnBuild(module="browser4-rest")

2. Add a REST endpoint

text
coding.scaffoldFlow(type="rest-endpoint", name="my-resource", verify=true)

3. Modify browser driver code

text
coding.trapCheck(path="browser4-core/browser4-browser/src/.../PulsarWebDriver.kt")
coding.impact(path=<file>)
coding.mvnBuild(module="browser4-core/browser4-browser")

Flags

coding tools take structured arguments, not CLI flags — see Workflows below for each tool's parameters.

Errors & Recovery

SymptomCauseFix
mvnBuild fails after scaffoldingGenerated code conflicts with existing codeRead diagnostics, fix the conflicting file, re-run
scaffoldFlow rejects verify=trueType-specific build check failedRun without verify, inspect, then re-run after fixing
Unknown blast radiusSkipped moduleGraph/impactRun them first — see Workflow 0

Workflows

0. Before changing anything — know the blast radius

coding.moduleGraph(module="browser4-core/browser4-browser")
  → LIVE module graph rebuilt from the real pom.xml files: direct deps,
    transitive dependents, and drift warnings vs the static snapshot

coding.impact(path="browser4-core/browser4-browser/src/.../PulsarWebDriver.kt")
  → owning module + affected modules (transitively) + suggested test commands

coding.trapCheck(path=<browser-driver file>)
  → CDP pitfall advisories (mouseWheel race, cursor positioning, insertText racing)

1. Add a new CLI command

coding.scaffoldFlow(type="b4-cli-command", name="extract-prices",
     description="Extract product prices from a page", category="Extract")
  → 4 files: commands.rs CommandDef, MCPToolController alias, backend skeleton, test

coding.write(path="cli/browser4-cli/src/commands.rs", content=<CommandDef block>)
coding.write(path="browser4-rest/.../MCPToolController.kt", content=<alias snippet>)
... write each piece ...

# Verify both sides:
coding.shell(command="cargo test --bin browser4-cli")          # Rust side
coding.mvnBuild(module="browser4-rest", goals="compile")       # Kotlin side

2. Add a new agent tool domain (plugin)

coding.scaffoldFlow(type="agent-tool", name="browser4-weather", domain="weather",
     basePackage="ai.platon.pulsar.weather", toolMethod="fetchWeather",
     description="Fetch weather for the current page")
  → 2 files: ToolExecutor + ToolMount auto-config

coding.mvnBuild(module="browser4-plugins/browser4-weather", goals="compile")
coding.validate(type="plugin", path="browser4-plugins/browser4-weather")

3. Add a REST endpoint

coding.scaffoldFlow(type="rest-endpoint", name="analysis",
     description="Run an analysis task")
  → 3 files: AnalysisController + AnalysisService + AnalysisControllerTest

4. Add a test class / skill

coding.scaffoldFlow(type="test-class", name="my-tool",
     basePackage="ai.platon.pulsar.agentic.tools")
coding.scaffoldFlow(type="skill", name="browser4-myflow",
     description="A custom Browser4 flow")

5. Clone an existing implementation (anti-staleness)

# Single file:
coding.scaffoldFromExample(path="browser4-plugins/browser4-seo/.../SeoToolExecutor.kt")
  → discovery: shows parameters (basePackage, className, domain, toolMethod)
coding.scaffoldFromExample(path=<same>, basePackage="ai.platon.pulsar.weather",
     className="WeatherToolExecutor", domain="weather", toolMethod="fetchWeather")

# Whole plugin directory (cross-file consistent + stem-derived siblings):
coding.scaffoldFromExample(path="browser4-plugins/browser4-seo",
     className="WeatherToolExecutor", basePackage="ai.platon.pulsar.weather",
     domain="weather", artifactId="browser4-weather")
  → renames the executor AND sibling classes sharing the stem
    (SeoAutoConfiguration→WeatherAutoConfiguration, SeoService→WeatherService, ...)

6. Plan a whole dev task in one call

coding.devTask(task="fix the mouseWheel race in PulsarWebDriver.kt under
     browser4-core/browser4-browser/src/main/kotlin, add a regression test",
     verify=true)
  → AGENTS.md dev-flow plan (read → impact → mvnBuild → tests → trapCheck →
    repo-consistency → commit), with the fast checks already RUN:
    compile of the inferred module, CDP trap check, repo-consistency.
    Add runTests=true to also execute the module's test suite.

Rules

  1. Prefer scaffoldFlow over hand-writing — multi-file consistency (same identifier in commands.rs + alias + test) is automatic.
  2. Verify both sides for CLI changes: cargo test --bin browser4-cli for Rust, coding.mvnBuild for Kotlin.
  3. Kotlin diagnostics: use coding.mvnBuild (fast compiler passthrough) — no JDTLS server is configured.
  4. AGENTS.md is the contract — when the repo's conventions change, regenerate skeletons from the updated reference implementations rather than editing stale output.
  5. Keep changes small: one command/domain/endpoint per cycle; coding.revert undoes a bad edit.
  6. Governance files are protected: delete/replace on VERSION, AGENTS.md, CLAUDE.md, root pom.xml, the BOM, and the CI workflow are blocked by design — ask the user for explicit intent instead of working around it. Add session-level protections for any other file with coding.protect(path, on).
  7. Module topology is live: coding.moduleGraph/coding.impact rebuild from the real poms; the static ModuleMap snapshot is guarded by E2E tests against drift — sync it when adding a module. Use coding.ktReferences(scope="module") and coding.ktInheritance before refactoring shared Kotlin symbols.

Examples

User: 给 browser4-cli 加一个 extract-prices 命令
Agent: 1. coding.scaffoldFlow(type="b4-cli-command", name="extract-prices", ...)
       2. 写 commands.rs CommandDef、MCPToolController alias、后端骨架、测试
       3. coding.shell(command="cargo test --bin browser4-cli")
       4. coding.mvnBuild(module="browser4-rest", goals="compile")
       5. 报告:6 处触点全部就位,双端编译通过

User: 克隆 browser4-seo 插件成天气插件
Agent: 1. coding.scaffoldFromExample(path="browser4-plugins/browser4-seo",
          className="WeatherToolExecutor", basePackage="ai.platon.pulsar.weather",
          domain="weather", artifactId="browser4-weather")
       2. 逐文件 coding.write
       3. coding.mvnBuild(module="browser4-plugins/browser4-weather")
       4. coding.validate(type="plugin", path="browser4-plugins/browser4-weather")

Frequently asked questions

What does the Browser4 Dev AI skill do?

Develop features inside the Browser4 repository itself: add CLI commands, agent tool domains, REST endpoints, tests, and skills; analyze impact, plan dev tasks, check CDP pitfalls, and verify builds. Use when the user asks to add a new browser4-cli command, new tool domain, REST endpoint, modify Browser4's own Kotlin/Rust code, or check which modules a change affects.

Why use Browser4 Dev on TypingMind?

Because you install it once and use it with any model. Browser4 Dev is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Browser4 Dev in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/platonai/Browser4/tree/main/skills/browser4-dev. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Browser4 Dev?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Browser4 Dev?

As many as you like. As long as a model supports skills, you can use Browser4 Dev with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Browser4 Dev AI skill free?

Yes. It is published on GitHub by platonai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇