跳到正文
FunCoding

form-filling

Automatically fills web forms using provided field data and can optionally submit the form. Use when automating form input, testing forms, or submitting structured data to websites.

Star
1,152
许可证
Apache-2.0
最近提交
2026年10月13日

browser4-agentic/src/main/resources/skills/form-filling/SKILL.md

在 GitHub 上查看

Form Filling Skill

Description

Automatically fill web forms with provided data. This skill handles various form field types and can optionally submit the form after filling.

Dependencies

  • web-scraping - Required for detecting form fields and structure

Parameters

ParameterTypeRequiredDefaultDescription
urlStringYes-The URL of the page containing the form
formDataMap<String, String>Yes-Key-value pairs representing field names and values
submitBooleanNofalseWhether to submit the form after filling

Return Value

Returns a SkillResult with the following data structure:

{
  "url": "string",
  "filledFields": ["field1", "field2"],
  "submitted": boolean,
  "message": "status message"
}

Usage Examples

Basic Form Filling

val result = registry.execute(
    skillId = "form-filling",
    context = context,
    params = mapOf(
        "url" to "https://example.com/contact",
        "formData" to mapOf(
            "name" to "John Doe",
            "email" to "[email protected]",
            "message" to "Hello!"
        )
    )
)

Form Filling with Submission

val result = registry.execute(
    skillId = "form-filling",
    context = context,
    params = mapOf(
        "url" to "https://example.com/signup",
        "formData" to mapOf(
            "username" to "johndoe",
            "password" to "securepass123",
            "email" to "[email protected]"
        ),
        "submit" to true
    )
)

Tool Call Specification

ToolSpec(
    domain = "skill.form",
    method = "fill",
    arguments = [
        "url: String",
        "formData: Map<String, String>",
        "submit: Boolean = false"
    ],
    returnType = "SkillResult",
    description = "Fill a web form with the provided data"
)

Error Handling

The skill returns a failure result in the following cases:

  • Missing required parameter url
  • Missing required parameter formData
  • Empty formData map
  • Form fields not found on the page

Lifecycle Hooks

onBeforeExecute

Validates that formData is not empty before execution.

validate

Checks if the required dependency skill (web-scraping) is available in the registry.

Implementation Notes

  • Headless mode is the default for AI agents: Always open browsers in headless mode unless the user explicitly requests a visible browser window (e.g., "show me the browser", "open visibly", "headed"). Headless mode is faster, uses fewer resources, and avoids unnecessary GUI windows. If user participation in the page interaction is required — e.g., logging in or entering a verification code (CAPTCHA) — open a headed browser so the user can see and act on the page. Also open headed as a one-shot escalation when the site blocks the headless browser as a bot (CAPTCHA/challenge/interstitial page, "unusual traffic", or an empty body where content was expected): close, then open --headed <url> with the same session and retry once, telling the user that anti-bot protection forced the switch. If the headed retry is blocked too, stop and report instead of looping.
  • Supports various input types: text, email, password, textarea, select, checkbox, radio
  • Automatically handles form field detection and mapping
  • Respects CSRF tokens and hidden fields
  • Can handle multi-page forms through shared context
  • Thread-safe execution

Security Considerations

  • Never log sensitive form data (passwords, credit cards, etc.)
  • Validate form URLs to prevent CSRF attacks
  • Use HTTPS URLs for sensitive forms
  • Clear sensitive data from memory after use

See Also

相似的 Skill

test-driven-development

OBobra/superpowers298k近 7 天新增 2,631 个 star

migrate-to-shoehorn

MAmattpocock/skills288k近 7 天新增 10,178 个 star

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

精选

accessibility

审计 Web、iOS、Android 的无障碍合规,支持键盘导航与屏幕阅读器。

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

ai-regression-testing

AFaffaan-m/ECC278k近 7 天新增 4,046 个 star

官方

firecrawl-build-interact

FIfirecrawl/firecrawl191k近 7 天新增 2,010 个 star