From a085b6c036a1882fe31f70e71d371380a8a0fb25 Mon Sep 17 00:00:00 2001 From: ShawnPana Date: Wed, 12 Nov 2025 17:57:58 -0800 Subject: [PATCH 1/3] Add optional author tracking to templates - Add optional author field to all 6 complex templates in templates.json - Fields: name, github_profile, last_modified_date (all optional) - Default templates (default, advanced, tools) remain without authors - Update validation script to accept and validate author field structure - Add Author Information section to README with examples and best practices This change is backward compatible with browser-use CLI and enables future display of template authorship information. --- .github/scripts/validate_templates.py | 18 ++++++++++++ README.md | 35 ++++++++++++++++++++++ templates.json | 42 +++++++++++++++++++++++---- 3 files changed, 89 insertions(+), 6 deletions(-) diff --git a/.github/scripts/validate_templates.py b/.github/scripts/validate_templates.py index 2c2c63f..f649a2d 100755 --- a/.github/scripts/validate_templates.py +++ b/.github/scripts/validate_templates.py @@ -47,6 +47,24 @@ def validate_template_entry(name: str, config: dict, repo_root: Path) -> list[st if not main_file.exists(): errors.append(f"Template '{name}': main file '{config['file']}' does not exist") + # Validate author field if present (optional) + if 'author' in config: + author = config['author'] + if not isinstance(author, dict): + errors.append(f"Template '{name}': 'author' field must be an object") + else: + # All author fields are optional, but validate types if present + optional_author_fields = { + 'name': str, + 'github_profile': str, + 'last_modified_date': str + } + for field, expected_type in optional_author_fields.items(): + if field in author and not isinstance(author[field], expected_type): + errors.append( + f"Template '{name}': author.{field} must be a {expected_type.__name__}" + ) + # Check files array if present if 'files' in config: for file_spec in config['files']: diff --git a/README.md b/README.md index d765f82..b92b462 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ Each template entry in `templates.json` supports the following fields: |-------|------|-------------| | `files` | array | List of files to copy for complex templates (see File Specification below) | | `next_steps` | array | Custom post-installation instructions (see Next Steps below) | +| `author` | object | Template author information (see Author Information below) | ### File Specification @@ -246,6 +247,40 @@ The CLI automatically replaces these variables in `commands`: // Becomes: "cd shopping && uv run my_bot" ``` +### Author Information + +The optional `author` object allows you to add attribution to your template: + +```json +{ + "name": "Jane Smith", // Optional: Author name or username + "github_profile": "https://github.com/janesmith", // Optional: GitHub profile URL + "last_modified_date": "2025-11-12" // Optional: Last update date (YYYY-MM-DD) +} +``` + +**Example:** + +```json +"my-template": { + "file": "my-template/main.py", + "description": "Advanced web scraping with AI", + "files": [...], + "next_steps": [...], + "author": { + "name": "Jane Smith", + "github_profile": "https://github.com/janesmith", + "last_modified_date": "2025-11-12" + } +} +``` + +**Notes:** +- All fields within `author` are optional +- Default templates (`default`, `advanced`, `tools`) typically don't need author information +- Community-contributed templates should include author information when possible +- The `last_modified_date` should be updated whenever the template is significantly changed + ### Best Practices 1. **README.md**: Include detailed setup instructions, customization tips, and troubleshooting diff --git a/templates.json b/templates.json index 0a3ef95..d42830b 100644 --- a/templates.json +++ b/templates.json @@ -70,7 +70,12 @@ { "footer": "šŸ“– See README.md for detailed instructions" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } }, "job-application": { "file": "job-application/main.py", @@ -137,7 +142,12 @@ { "footer": "šŸ“– See README.md for customization and troubleshooting" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } }, "agentmail": { "file": "agentmail/main.py", @@ -192,7 +202,12 @@ { "footer": "šŸ“– See README.md for customization and advanced usage\n\nšŸŽƒ Code: HAPPYHALLOWEEN -> $50 free!" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } }, "llm-arena": { "file": "llm-arena/main.py", @@ -243,7 +258,12 @@ { "footer": "šŸ“– See README.md for customization and advanced usage\n\n⚔ Enter a task and watch LLMs race to complete it!" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } }, "slack": { "file": "slack/README.md", @@ -310,7 +330,12 @@ { "footer": "šŸ“– See README.md for detailed setup, Event Subscriptions configuration, and production deployment" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } }, "all-openai-jobs": { "file": "all-openai-jobs/main.py", @@ -361,6 +386,11 @@ { "footer": "šŸ“– See README.md for customization and troubleshooting\n\nšŸ¤– CodeAgent will generate extraction code and save it to script.ipynb" } - ] + ], + "author": { + "name": "", + "github_profile": "", + "last_modified_date": "" + } } } From 9a87669e36603425b26b36c893c70cb422a85dae Mon Sep 17 00:00:00 2001 From: ShawnPana Date: Wed, 12 Nov 2025 18:00:46 -0800 Subject: [PATCH 2/3] Remove expired Halloween promo code from agentmail template --- templates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates.json b/templates.json index d42830b..d193048 100644 --- a/templates.json +++ b/templates.json @@ -200,7 +200,7 @@ "commands": ["uv run {output}"] }, { - "footer": "šŸ“– See README.md for customization and advanced usage\n\nšŸŽƒ Code: HAPPYHALLOWEEN -> $50 free!" + "footer": "šŸ“– See README.md for customization and advanced usage" } ], "author": { From 7711408c094d426bcfff487167a0764a8a670d1f Mon Sep 17 00:00:00 2001 From: ShawnPana Date: Wed, 12 Nov 2025 18:32:19 -0800 Subject: [PATCH 3/3] Add featured flag to support TUI template selector - Add 'featured: true' to 6 templates: shopping, job-application, agentmail, llm-arena, slack, all-openai-jobs - Update validation script to accept optional featured boolean field - Add Featured Templates section to README with examples and guidelines This prepares the template-library for the upcoming TUI enhancement in browser-use CLI. --- .github/scripts/validate_templates.py | 5 +++++ README.md | 29 +++++++++++++++++++++++++++ templates.json | 6 ++++++ 3 files changed, 40 insertions(+) diff --git a/.github/scripts/validate_templates.py b/.github/scripts/validate_templates.py index f649a2d..8629434 100755 --- a/.github/scripts/validate_templates.py +++ b/.github/scripts/validate_templates.py @@ -47,6 +47,11 @@ def validate_template_entry(name: str, config: dict, repo_root: Path) -> list[st if not main_file.exists(): errors.append(f"Template '{name}': main file '{config['file']}' does not exist") + # Validate featured field if present (optional) + if 'featured' in config: + if not isinstance(config['featured'], bool): + errors.append(f"Template '{name}': 'featured' field must be a boolean") + # Validate author field if present (optional) if 'author' in config: author = config['author'] diff --git a/README.md b/README.md index b92b462..7a01e3e 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ Each template entry in `templates.json` supports the following fields: |-------|------|-------------| | `files` | array | List of files to copy for complex templates (see File Specification below) | | `next_steps` | array | Custom post-installation instructions (see Next Steps below) | +| `featured` | boolean | Mark template as featured (shown prominently in CLI) | | `author` | object | Template author information (see Author Information below) | ### File Specification @@ -281,6 +282,34 @@ The optional `author` object allows you to add attribution to your template: - Community-contributed templates should include author information when possible - The `last_modified_date` should be updated whenever the template is significantly changed +### Featured Templates + +The optional `featured` boolean flag marks templates for prominent display in the CLI's template selector UI. + +```json +{ + "featured": true +} +``` + +**Example:** + +```json +"shopping": { + "file": "shopping/main.py", + "description": "E-commerce automation with structured output", + "featured": true, + "files": [...], + "next_steps": [...] +} +``` + +**Notes:** +- Featured templates are shown in a dedicated "Featured Templates" section in the CLI +- Default templates (`default`, `advanced`, `tools`) are always shown separately and don't need the featured flag +- Use this to highlight high-quality, well-maintained, or popular community templates +- Currently featured templates: `shopping`, `job-application`, `agentmail`, `llm-arena`, `slack`, `all-openai-jobs` + ### Best Practices 1. **README.md**: Include detailed setup instructions, customization tips, and troubleshooting diff --git a/templates.json b/templates.json index d193048..5726286 100644 --- a/templates.json +++ b/templates.json @@ -14,6 +14,7 @@ "shopping": { "file": "shopping/main.py", "description": "E-commerce automation with structured output (Pydantic models)", + "featured": true, "files": [ { "source": "shopping/main.py", @@ -80,6 +81,7 @@ "job-application": { "file": "job-application/main.py", "description": "Automated job application form submission with resume upload", + "featured": true, "files": [ { "source": "job-application/main.py", @@ -152,6 +154,7 @@ "agentmail": { "file": "agentmail/main.py", "description": "Email inbox automation with 2FA support using AgentMail", + "featured": true, "files": [ { "source": "agentmail/main.py", @@ -212,6 +215,7 @@ "llm-arena": { "file": "llm-arena/main.py", "description": "Compare different AI models side-by-side in LLM Arena", + "featured": true, "files": [ { "source": "llm-arena/main.py", @@ -268,6 +272,7 @@ "slack": { "file": "slack/README.md", "description": "Slack bot for browser automation tasks via mentions", + "featured": true, "files": [ { "source": "slack/app/main.py", @@ -340,6 +345,7 @@ "all-openai-jobs": { "file": "all-openai-jobs/main.py", "description": "Web scraping with CodeAgent to extract job listings from career pages", + "featured": true, "files": [ { "source": "all-openai-jobs/main.py",