Object DevFlowScaffolds
-
- All Implemented Interfaces:
public class DevFlowScaffoldsDevelopment-flow scaffolds for Browser4 self-development.
Unlike hand-written templates (which go stale when the codebase evolves), these scaffolds are generated from the repository's OWN real reference implementations:
b4CliCommandmodels a real CommandDef,agentToolmodels a real ToolExecutor + ToolMount pair. The reference IS the template, so the generated code always matches the current conventions.Each generator returns a map of relative file paths to content, mirroring the multi-file footprint of a real addition (e.g. a new CLI command touches commands.rs + the backend + a test). Cross-file consistency is guaranteed by deriving all identifiers from a single set of parameters.
-
-
Field Summary
Fields Modifier and Type Field Description public final static DevFlowScaffoldsINSTANCE
-
Method Summary
Modifier and Type Method Description final Map<String, String>b4CliCommand(String name, String description, String category, String toolName, String backendMethod)Generate the multi-file skeleton for adding a new browser4-cli command. final Map<String, String>agentTool(String pluginName, String domain, String basePackage, String toolMethod, String toolDescription)Generate the multi-file skeleton for adding a new agent tool domain (ToolExecutor + ToolMount auto-configuration), mirroring how real executors (seo, captcha, ...) are wired. final Map<String, String>restEndpoint(String resource, String description)Generate the REST endpoint skeleton (Controller + Service + test), mirroring the SwarmController/SwarmService task-store pattern: final Map<String, String>testClass(String packageName, String testClass, String targetClass, String description)Generate a Kotlin test-class skeleton following repo conventions (camelCase method names + @DisplayName, runBlocking for suspend). final Map<String, String>skill(String name, String description, List<String> triggers, List<String> tools)Generate a SKILL.md skeleton matching the SkillDefinitionLoader contract (name + description frontmatter, kebab-case name == directory name). -
-
Method Detail
-
b4CliCommand
final Map<String, String> b4CliCommand(String name, String description, String category, String toolName, String backendMethod)
Generate the multi-file skeleton for adding a new browser4-cli command.
The CommandDef skeleton follows the canonical structure seen in real commands (name, description, category, args, options, e2e_coverage, tool_name_fn, tool_params_fn). The backend method is a minimal
@MCPstub the agent fills in; the test skeleton matches repo conventions (camelCase + @DisplayName).- Parameters:
name- kebab-case command name, e.g.description- human-readable descriptioncategory- CLI category, e.g.toolName- MCP tool name, e.g.backendMethod- camelCase backend method, e.g.
-
agentTool
final Map<String, String> agentTool(String pluginName, String domain, String basePackage, String toolMethod, String toolDescription)
Generate the multi-file skeleton for adding a new agent tool domain (ToolExecutor + ToolMount auto-configuration), mirroring how real executors (seo, captcha, ...) are wired.
-
restEndpoint
final Map<String, String> restEndpoint(String resource, String description)
Generate the REST endpoint skeleton (Controller + Service + test), mirroring the SwarmController/SwarmService task-store pattern:
-
testClass
final Map<String, String> testClass(String packageName, String testClass, String targetClass, String description)
Generate a Kotlin test-class skeleton following repo conventions (camelCase method names + @DisplayName, runBlocking for suspend).
-
-
-
-